X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e5ed787e9f0f4eac35b9a55e97ea4a177e2fdda..e828e4f7f10ae3ce6c4575011564c457b02e57c3:/utils/ogl/src/lines.cpp diff --git a/utils/ogl/src/lines.cpp b/utils/ogl/src/lines.cpp index b321ba3854..6beb7de8d2 100644 --- a/utils/ogl/src/lines.cpp +++ b/utils/ogl/src/lines.cpp @@ -11,6 +11,7 @@ #ifdef __GNUG__ #pragma implementation "lines.h" +#pragma implementation "linesp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -24,11 +25,9 @@ #include #endif -#ifdef PROLOGIO #include -#endif -#if USE_IOSTREAMH +#if wxUSE_IOSTREAMH #include #else #include @@ -81,7 +80,7 @@ wxLineShape::wxLineShape() newRegion = new wxShapeRegion; newRegion->SetName("Start"); newRegion->SetSize(150, 50); - m_regions.Append((wxObject *)newRegion); + m_regions.Append((wxObject *)newRegion); newRegion = new wxShapeRegion; newRegion->SetName("End"); @@ -214,10 +213,10 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) wxNode *node = m_regions.Nth(i); if (!node) return; - + wxShapeRegion *region = (wxShapeRegion *)node->Data(); region->SetText(s); - dc.SetFont(region->GetFont()); + dc.SetFont(* region->GetFont()); region->GetSize(&w, &h); // Initialize the size if zero @@ -226,7 +225,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) w = 100; h = 50; region->SetSize(w, h); } - + wxStringList *string_list = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode()); node = string_list->First(); while (node) @@ -285,15 +284,15 @@ void wxLineShape::DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y // First, clear a rectangle for the text IF there is any if (region->GetFormattedText().Number() > 0) { - dc.SetPen(g_oglWhiteBackgroundPen); - dc.SetBrush(g_oglWhiteBackgroundBrush); + dc.SetPen(* g_oglWhiteBackgroundPen); + dc.SetBrush(* g_oglWhiteBackgroundBrush); // Now draw the text - if (region->GetFont()) dc.SetFont(region->GetFont()); + if (region->GetFont()) dc.SetFont(* region->GetFont()); - dc.DrawRectangle((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h); - if (m_pen) dc.SetPen(m_pen); + if (m_pen) dc.SetPen(* m_pen); dc.SetTextForeground(* region->GetActualColourObject()); #ifdef __WXMSW__ @@ -321,10 +320,10 @@ void wxLineShape::EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double if (region->GetFormattedText().Number() > 0) { - dc.SetPen(g_oglWhiteBackgroundPen); - dc.SetBrush(g_oglWhiteBackgroundBrush); + dc.SetPen(* g_oglWhiteBackgroundPen); + dc.SetBrush(* g_oglWhiteBackgroundBrush); - dc.DrawRectangle((double)(xp - w/2.0), (double)(yp - h/2.0), (double)w, (double)h); + dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h); } } @@ -445,7 +444,7 @@ void wxLineShape::SetEnds(double x1, double y1, double x2, double y2) first_point->y = y1; last_point->x = x2; last_point->y = y2; - + m_xpos = (double)((x1 + x2)/2.0); m_ypos = (double)((y1 + y2)/2.0); } @@ -708,7 +707,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p deltaX = x4 - positionOnLineX; deltaY = y4 - positionOnLineY; } - + switch (arrow->_GetType()) { case ARROW_ARROW: @@ -723,13 +722,13 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p &side1_x, &side1_y, &side2_x, &side2_y); wxPoint points[4]; - points[0].x = tip_x; points[0].y = tip_y; - points[1].x = side1_x; points[1].y = side1_y; - points[2].x = side2_x; points[2].y = side2_y; - points[3].x = tip_x; points[3].y = tip_y; + points[0].x = (int) tip_x; points[0].y = (int) tip_y; + points[1].x = (int) side1_x; points[1].y = (int) side1_y; + points[2].x = (int) side2_x; points[2].y = (int) side2_y; + points[3].x = (int) tip_x; points[3].y = (int) tip_y; - dc.SetPen(m_pen); - dc.SetBrush(m_brush); + dc.SetPen(* m_pen); + dc.SetBrush(* m_brush); dc.DrawPolygon(4, points); break; } @@ -749,13 +748,13 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p double x1 = (double)(x - (diameter/2.0)); double y1 = (double)(y - (diameter/2.0)); - dc.SetPen(m_pen); + dc.SetPen(* m_pen); if (arrow->_GetType() == ARROW_HOLLOW_CIRCLE) - dc.SetBrush(g_oglWhiteBackgroundBrush); + dc.SetBrush(* g_oglWhiteBackgroundBrush); else - dc.SetBrush(m_brush); + dc.SetBrush(* m_brush); - dc.DrawEllipse(x1, y1, diameter, diameter); + dc.DrawEllipse((long) x1, (long) y1, (long) diameter, (long) diameter); break; } case ARROW_SINGLE_OBLIQUE: @@ -788,7 +787,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p | / | / | /theta - | /(x1, y1) + | /(x1, y1) |______________________ */ double theta = 0.0; @@ -832,8 +831,8 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p arrow->GetMetaFile()->GetBounds(&minX, &minY, &maxX, &maxY); // Make erasing rectangle slightly bigger or you get droppings. int extraPixels = 4; - dc.DrawRectangle((double)(deltaX + x + minX - (extraPixels/2.0)), (double)(deltaY + y + minY - (extraPixels/2.0)), - (double)(maxX - minX + extraPixels), (double)(maxY - minY + extraPixels)); + dc.DrawRectangle((long)(deltaX + x + minX - (extraPixels/2.0)), (long)(deltaY + y + minY - (extraPixels/2.0)), + (long)(maxX - minX + extraPixels), (long)(maxY - minY + extraPixels)); } else arrow->GetMetaFile()->Draw(dc, x+deltaX, y+deltaY); @@ -855,7 +854,7 @@ void wxLineShape::OnErase(wxDC& dc) double bound_x, bound_y; GetBoundingBoxMax(&bound_x, &bound_y); - if (m_font) dc.SetFont(m_font); + if (m_font) dc.SetFont(* m_font); // Undraw text regions for (int i = 0; i < 3; i++) @@ -871,15 +870,15 @@ void wxLineShape::OnErase(wxDC& dc) } // Undraw line - dc.SetPen(g_oglWhiteBackgroundPen); - dc.SetBrush(g_oglWhiteBackgroundBrush); + dc.SetPen(* g_oglWhiteBackgroundPen); + dc.SetBrush(* g_oglWhiteBackgroundBrush); // Drawing over the line only seems to work if the line has a thickness // of 1. if (old_pen && (old_pen->GetWidth() > 1)) { - dc.DrawRectangle((double)(m_xpos - (bound_x/2.0) - 2.0), (double)(m_ypos - (bound_y/2.0) - 2.0), - (double)(bound_x+4.0), (double)(bound_y+4.0)); + dc.DrawRectangle((long)(m_xpos - (bound_x/2.0) - 2.0), (long)(m_ypos - (bound_y/2.0) - 2.0), + (long)(bound_x+4.0), (long)(bound_y+4.0)); } else { @@ -1018,7 +1017,7 @@ bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double o { xr = 0.0; yr = 0.0; } - + m_labelObjects[i]->Move(dc, xp+xr, yp+yr); } } @@ -1029,7 +1028,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) { if (!m_from || !m_to) return; - + if (m_lineControlPoints->Number() > 2) Initialise(); @@ -1039,7 +1038,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) double other_end_x, other_end_y; FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y); - + wxNode *first = m_lineControlPoints->First(); wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxNode *last = m_lineControlPoints->Last(); @@ -1065,7 +1064,7 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) // if (moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) // Only move control points if it's a self link. And only works if attachment mode is ON. - if ((m_from == m_to) && m_from->GetAttachmentMode() && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) + if ((m_from == m_to) && (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) && moveControlPoints && m_lineControlPoints && !(x_offset == 0.0 && y_offset == 0.0)) { wxNode *node = m_lineControlPoints->First(); while (node) @@ -1091,7 +1090,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d { if (!m_from || !m_to) return; - + // Do each end - nothing in the middle. User has to move other points // manually if necessary. double end_x, end_y; @@ -1110,7 +1109,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d if (m_lineControlPoints->Number() > 2) { - if (m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_from, &nth, &no_arcs, FALSE); // Not incoming @@ -1121,7 +1120,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d (double)second_point->x, (double)second_point->y, &end_x, &end_y); - if (m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_to, &nth, &no_arcs, TRUE); // Incoming @@ -1139,7 +1138,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d double toX = m_to->GetX(); double toY = m_to->GetY(); - if (m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_from, &nth, &no_arcs, FALSE); @@ -1148,7 +1147,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d fromY = end_y; } - if (m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() != ATTACHMENT_MODE_NONE) { int nth, no_arcs; FindNth(m_to, &nth, &no_arcs, TRUE); @@ -1157,12 +1156,12 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d toY = other_end_y; } - if (!m_from->GetAttachmentMode()) + if (m_from->GetAttachmentMode() == ATTACHMENT_MODE_NONE) (void) m_from->GetPerimeterPoint(m_from->GetX(), m_from->GetY(), toX, toY, &end_x, &end_y); - if (!m_to->GetAttachmentMode()) + if (m_to->GetAttachmentMode() == ATTACHMENT_MODE_NONE) (void) m_to->GetPerimeterPoint(m_to->GetX(), m_to->GetY(), fromX, fromY, &other_end_x, &other_end_y); @@ -1178,9 +1177,9 @@ void wxLineShape::OnDraw(wxDC& dc) if (m_lineControlPoints) { if (m_pen) - dc.SetPen(m_pen); + dc.SetPen(* m_pen); if (m_brush) - dc.SetBrush(m_brush); + dc.SetBrush(* m_brush); int n = m_lineControlPoints->Number(); wxPoint *points = new wxPoint[n]; @@ -1212,7 +1211,7 @@ void wxLineShape::OnDraw(wxDC& dc) wxPen *solid_pen = wxThePenList->FindOrCreatePen(m_pen->GetColour(), 1, wxSOLID); if (solid_pen) - dc.SetPen(solid_pen); + dc.SetPen(* solid_pen); } DrawArrows(dc); } @@ -1222,7 +1221,7 @@ void wxLineShape::OnDrawControlPoints(wxDC& dc) { if (!m_drawHandles) return; - + // Draw temporary label rectangles if necessary for (int i = 0; i < 3; i++) { @@ -1296,14 +1295,6 @@ void wxLineShape::OnDrawContents(wxDC& dc) } } - -#ifdef PROLOGIO -char *wxLineShape::GetFunctor() -{ - return "arc_image"; -} -#endif - void wxLineShape::SetTo(wxShape *object) { m_to = object; @@ -1323,7 +1314,7 @@ void wxLineShape::MakeControlPoints() wxRealPoint *first_point = (wxRealPoint *)first->Data(); wxRealPoint *last_point = (wxRealPoint *)last->Data(); - wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, + wxLineControlPoint *control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, first_point->x, first_point->y, CONTROL_POINT_ENDPOINT_FROM); control->m_point = first_point; @@ -1336,7 +1327,7 @@ void wxLineShape::MakeControlPoints() { wxRealPoint *point = (wxRealPoint *)node->Data(); - control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, + control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, point->x, point->y, CONTROL_POINT_LINE); control->m_point = point; @@ -1346,7 +1337,7 @@ void wxLineShape::MakeControlPoints() node = node->Next(); } - control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, + control = new wxLineControlPoint(m_canvas, this, CONTROL_POINT_SIZE, last_point->x, last_point->y, CONTROL_POINT_ENDPOINT_TO); control->m_point = last_point; @@ -1377,9 +1368,9 @@ void wxLineShape::ResetControlPoints() } #ifdef PROLOGIO -void wxLineShape::WritePrologAttributes(wxExpr *clause) +void wxLineShape::WriteAttributes(wxExpr *clause) { - wxShape::WritePrologAttributes(clause); + wxShape::WriteAttributes(clause); if (m_from) clause->AddAttributeValue("from", m_from->GetId()); @@ -1401,12 +1392,12 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) clause->AddAttributeValue("keep_lines_straight", (long)m_maintainStraightLines); // Make a list of lists for the (sp)line controls - wxExpr *list = new wxExpr(PrologList); + wxExpr *list = new wxExpr(wxExprList); wxNode *node = m_lineControlPoints->First(); while (node) { wxRealPoint *point = (wxRealPoint *)node->Data(); - wxExpr *point_list = new wxExpr(PrologList); + wxExpr *point_list = new wxExpr(wxExprList); wxExpr *x_expr = new wxExpr((double) point->x); wxExpr *y_expr = new wxExpr((double) point->y); point_list->Append(x_expr); @@ -1422,17 +1413,17 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) // (arrowType arrowEnd xOffset arrowSize) if (m_arcArrows.Number() > 0) { - wxExpr *arrow_list = new wxExpr(PrologList); + wxExpr *arrow_list = new wxExpr(wxExprList); node = m_arcArrows.First(); while (node) { wxArrowHead *head = (wxArrowHead *)node->Data(); - wxExpr *head_list = new wxExpr(PrologList); + wxExpr *head_list = new wxExpr(wxExprList); head_list->Append(new wxExpr((long)head->_GetType())); head_list->Append(new wxExpr((long)head->GetArrowEnd())); head_list->Append(new wxExpr(head->GetXOffset())); head_list->Append(new wxExpr(head->GetArrowSize())); - head_list->Append(new wxExpr(PrologString, (head->GetName() ? head->GetName() : ""))); + head_list->Append(new wxExpr(wxExprString, head->GetName())); head_list->Append(new wxExpr(head->GetId())); // New members of wxArrowHead @@ -1447,9 +1438,9 @@ void wxLineShape::WritePrologAttributes(wxExpr *clause) } } -void wxLineShape::ReadPrologAttributes(wxExpr *clause) +void wxLineShape::ReadAttributes(wxExpr *clause) { - wxShape::ReadPrologAttributes(clause); + wxShape::ReadAttributes(clause); int iVal = (int) m_isSpline; clause->AssignAttributeValue("is_spline", &iVal); @@ -1482,11 +1473,11 @@ void wxLineShape::ReadPrologAttributes(wxExpr *clause) node = next; } } - + newRegion = new wxShapeRegion; newRegion->SetName("Start"); newRegion->SetSize(150, 50); - m_regions.Append((wxObject *)newRegion); + m_regions.Append((wxObject *)newRegion); newRegion = new wxShapeRegion; newRegion->SetName("End"); @@ -1549,7 +1540,7 @@ void wxLineShape::ReadPrologAttributes(wxExpr *clause) double arrowSize = 0.0; wxString arrowName(""); long arrowId = -1; - + wxExpr *type_expr = node->Nth(0); wxExpr *end_expr = node->Nth(1); wxExpr *dist_expr = node->Nth(2); @@ -1575,9 +1566,9 @@ void wxLineShape::ReadPrologAttributes(wxExpr *clause) arrowId = id_expr->IntegerValue(); if (arrowId == -1) - arrowId = NewId(); + arrowId = wxNewId(); else - RegisterId(arrowId); + wxRegisterId(arrowId); wxArrowHead *arrowHead = AddArrow(arrowType, arrowEnd, arrowSize, xOffset, (char*) (const char*) arrowName, NULL, arrowId); if (yOffsetExpr) @@ -1729,7 +1720,7 @@ void wxLineControlPoint::OnBeginDragLeft(double x, double y, int keys, int attac { m_shape->GetEventHandler()->OnSizingBeginDragLeft(this, x, y, keys, attachment); } - + void wxLineControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment) { m_shape->GetEventHandler()->OnSizingEndDragLeft(this, x, y, keys, attachment); @@ -1744,7 +1735,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, doub wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); - dc.SetLogicalFunction(wxXOR); + dc.SetLogicalFunction(OGLRBLF); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); dc.SetPen(dottedPen); @@ -1802,7 +1793,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, lineShape->GetTo()->OnDrawContents(dc); this->SetDisableLabel(TRUE); - dc.SetLogicalFunction(wxXOR); + dc.SetLogicalFunction(OGLRBLF); lpt->m_xpos = x; lpt->m_ypos = y; lpt->m_point->x = x; lpt->m_point->y = y; @@ -1822,7 +1813,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM || lpt->m_type == CONTROL_POINT_ENDPOINT_TO) { - m_canvas->SetCursor(g_oglBullseyeCursor); + m_canvas->SetCursor(* g_oglBullseyeCursor); lpt->m_oldCursor = wxSTANDARD_CURSOR; } } @@ -1856,7 +1847,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM) { if (lpt->m_oldCursor) - m_canvas->SetCursor(lpt->m_oldCursor); + m_canvas->SetCursor(* lpt->m_oldCursor); // this->Erase(dc); @@ -1870,7 +1861,7 @@ void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, in if (lpt->m_type == CONTROL_POINT_ENDPOINT_TO) { if (lpt->m_oldCursor) - m_canvas->SetCursor(lpt->m_oldCursor); + m_canvas->SetCursor(* lpt->m_oldCursor); // lpt->m_xpos = x; lpt->m_ypos = y; @@ -1942,7 +1933,7 @@ void wxLineControlPoint::OnBeginDragRight(double x, double y, int keys, int atta m_oldCursor = wxSTANDARD_CURSOR; } } - + void wxLineControlPoint::OnEndDragRight(double x, double y, int keys, int attachment) { wxClientDC dc(GetCanvas()); @@ -2145,7 +2136,7 @@ bool wxLineShape::ClearArrow(const wxString& name) * Finds an arrowhead at the given position (if -1, any position) * */ - + wxArrowHead *wxLineShape::FindArrowHead(int position, const wxString& name) { wxNode *node = m_arcArrows.First(); @@ -2177,7 +2168,7 @@ wxArrowHead *wxLineShape::FindArrowHead(long arrowId) * Deletes an arrowhead at the given position (if -1, any position) * */ - + bool wxLineShape::DeleteArrowHead(int position, const wxString& name) { wxNode *node = m_arcArrows.First(); @@ -2253,7 +2244,7 @@ int wxLineShape::FindLinePosition(double x, double y) { double startX, startY, endX, endY; GetEnds(&startX, &startY, &endX, &endY); - + // Find distances from centre, start and end. The smallest wins. double centreDistance = (double)(sqrt((x - m_xpos)*(x - m_xpos) + (y - m_ypos)*(y - m_ypos))); double startDistance = (double)(sqrt((x - startX)*(x - startX) + (y - startY)*(y - startY))); @@ -2365,7 +2356,7 @@ wxArrowHead::wxArrowHead(WXTYPE type, int end, double size, double dist, const w m_metaFile = mf; m_id = arrowId; if (m_id == -1) - m_id = NewId(); + m_id = wxNewId(); } wxArrowHead::wxArrowHead(wxArrowHead& toCopy) @@ -2380,9 +2371,9 @@ wxArrowHead::wxArrowHead(wxArrowHead& toCopy) m_metaFile = new wxPseudoMetaFile(*(toCopy.m_metaFile)); else m_metaFile = NULL; - m_id = NewId(); + m_id = wxNewId(); } - + wxArrowHead::~wxArrowHead() { if (m_metaFile) delete m_metaFile; @@ -2396,7 +2387,7 @@ void wxArrowHead::SetSize(double size) double oldWidth = m_metaFile->m_width; if (oldWidth == 0.0) return; - + double scale = (double)(size/oldWidth); if (scale != 1.0) m_metaFile->Scale(scale, scale); @@ -2431,18 +2422,18 @@ void wxLabelShape::OnDraw(wxDC& dc) { if (m_lineShape && !m_lineShape->GetDrawHandles()) return; - + double x1 = (double)(m_xpos - m_width/2.0); double y1 = (double)(m_ypos - m_height/2.0); if (m_pen) { if (m_pen->GetWidth() == 0) - dc.SetPen(g_oglTransparentPen); + dc.SetPen(* g_oglTransparentPen); else - dc.SetPen(m_pen); + dc.SetPen(* m_pen); } - dc.SetBrush(wxTRANSPARENT_BRUSH); + dc.SetBrush(* wxTRANSPARENT_BRUSH); if (m_cornerRadius > 0.0) dc.DrawRoundedRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height), m_cornerRadius);