@@ -55,7 +55,7 @@ CDasherViewSquare::CDasherViewSquare(CSettingsStore* pSettingsStore, CDasherScre
5555 parameter == LP_GEOMETRY)
5656 {
5757 m_bVisibleRegionValid = false ;
58- SetScaleFactor ();
58+ ComputeScaleFactor ();
5959 }
6060 });
6161}
@@ -70,7 +70,7 @@ void CDasherViewSquare::SetOrientation(Options::ScreenOrientations newOrient)
7070 if (newOrient == GetOrientation ()) return ;
7171 CDasherView::SetOrientation (newOrient);
7272 m_bVisibleRegionValid = false ;
73- SetScaleFactor ();
73+ ComputeScaleFactor ();
7474}
7575
7676// ///////////////////////////////////////////////////////////////////////////
@@ -176,7 +176,7 @@ CDasherNode* CDasherViewSquare::Render(CDasherNode* pRoot, myint iRootMin, myint
176176// / specified as two co-ordinates, intended to the be the corners of
177177// / the leading edge of the containing box.
178178
179- CDasherViewSquare::CTextString* CDasherViewSquare::DasherDrawText (myint iDasherMaxX, myint iDasherMidY, CDasherScreen::Label* pLabel, const ColorPalette::Color& Color)
179+ CDasherViewSquare::CTextString* CDasherViewSquare::DasherDrawText (myint iDasherMaxX, myint iDasherMidY, CDasherScreen::Label* pLabel, const ColorPalette::Color& Color) const
180180{
181181 screenint x, y;
182182 Dasher2Screen (iDasherMaxX, iDasherMidY, x, y);
@@ -315,7 +315,7 @@ CDasherViewSquare::CTextString::~CTextString()
315315 }
316316}
317317
318- void CDasherViewSquare::TruncateTri (myint x, myint y1, myint y2, myint midy1, myint midy2, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth)
318+ void CDasherViewSquare::TruncateTri (myint x, myint y1, myint y2, myint midy1, myint midy2, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth) const
319319{
320320 DASHER_ASSERT (y1 <= midy1 && midy1 <= midy2 && midy2 <= y2);
321321
@@ -410,7 +410,7 @@ void CDasherViewSquare::TruncateTri(myint x, myint y1, myint y2, myint midy1, my
410410
411411#define sq (X ) ((X)*(X))
412412
413- void CDasherViewSquare::Circle (myint Range, myint y1, myint y2, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth)
413+ void CDasherViewSquare::Circle (myint Range, myint y1, myint y2, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth) const
414414{
415415 std::vector<point> pts;
416416 myint cy ((y1 + y2) / 2 ), r (Range / 2 ), x1, x2;
@@ -465,7 +465,7 @@ void CDasherViewSquare::Circle(myint Range, myint y1, myint y2, const ColorPalet
465465 delete[] p_array;
466466}
467467
468- void CDasherViewSquare::CircleTo (myint cy, myint r, myint y1, myint x1, myint y3, myint x3, point dest, std::vector<point>& pts, double dXMul)
468+ void CDasherViewSquare::CircleTo (myint cy, myint r, myint y1, myint x1, myint y3, myint x3, point dest, std::vector<point>& pts, double dXMul) const
469469{
470470 myint y2 ((y1 + y3) / 2 );
471471 myint x2 (static_cast <myint>(sqrt ((sq (r) - sq (cy - y2)) * dXMul)));
@@ -485,7 +485,7 @@ void CDasherViewSquare::CircleTo(myint cy, myint r, myint y1, myint x1, myint y3
485485}
486486#undef sq
487487
488- void CDasherViewSquare::DasherSpaceArc (myint cy, myint r, myint x1, myint y1, myint x2, myint y2, const ColorPalette::Color& color, int iLineWidth)
488+ void CDasherViewSquare::DasherSpaceArc (myint cy, myint r, myint x1, myint y1, myint x2, myint y2, const ColorPalette::Color& color, int iLineWidth) const
489489{
490490 point p;
491491 // start point
@@ -507,7 +507,7 @@ void CDasherViewSquare::DasherSpaceArc(myint cy, myint r, myint x1, myint y1, my
507507 Screen ()->Polyline (p_array, static_cast <int >(pts.size ()), iLineWidth, color);
508508}
509509
510- void CDasherViewSquare::Quadric (myint Range, myint lowY, myint highY, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth)
510+ void CDasherViewSquare::Quadric (myint Range, myint lowY, myint highY, const ColorPalette::Color& fillColor, const ColorPalette::Color& outlineColor, int lineWidth) const
511511{
512512 static const double RR2 = 1.0 / sqrt (2.0 );
513513 const int midY = static_cast <int >((lowY + highY) / 2 );
@@ -536,7 +536,7 @@ void CDasherViewSquare::Quadric(myint Range, myint lowY, myint highY, const Colo
536536#undef NUM_STEPS
537537}
538538
539- bool CDasherViewSquare::IsSpaceAroundNode (myint y1, myint y2)
539+ bool CDasherViewSquare::IsSpaceAroundNode (myint y1, myint y2) const
540540{
541541 const DasherCoordScreenRegion visibleRegion = VisibleRegion ();
542542 const myint maxX (y2 - y1);
@@ -730,7 +730,7 @@ void CDasherViewSquare::DisjointRender(CDasherNode* pRender, myint y1, myint y2,
730730 }
731731}
732732
733- void CDasherViewSquare::DasherDrawCube (myint iDasherMaxX, myint iDasherMinY, myint iDasherMinX, myint iDasherMaxY, CubeDepthLevel nodeDepth, CubeDepthLevel parentDepth, const ColorPalette::Color& Color, const ColorPalette::Color& outlineColor, int iThickness, ScreenRegion* parentScreenBounds)
733+ void CDasherViewSquare::DasherDrawCube (myint iDasherMaxX, myint iDasherMinY, myint iDasherMinX, myint iDasherMaxY, CubeDepthLevel nodeDepth, CubeDepthLevel parentDepth, const ColorPalette::Color& Color, const ColorPalette::Color& outlineColor, int iThickness, ScreenRegion* parentScreenBounds) const
734734{
735735 screenint iScreenMaxX, iScreenMinY, iScreenMinX, iScreenMaxY;
736736 Dasher2Screen (iDasherMaxX, iDasherMinY, iScreenMaxX, iScreenMinY);
@@ -803,7 +803,7 @@ bool CDasherViewSquare::CoversCrosshair(myint Range, myint y1, myint y2)
803803 return false ;
804804}
805805
806- ColorPalette::Color CDasherViewSquare::SimulateTransparency (CDasherNode* pCurrentNode)
806+ ColorPalette::Color CDasherViewSquare::SimulateTransparency (CDasherNode* pCurrentNode) const
807807{
808808 if (pCurrentNode == nullptr ) return GetNamedColor (NamedColor::background);
809809
@@ -881,7 +881,7 @@ void CDasherViewSquare::NewRender(CDasherNode* pCurrentNode, myint y1, myint y2,
881881 const int line_width = labs (m_pSettingsStore->GetLongParameter (LP_OUTLINE_WIDTH));
882882 const ColorPalette::Color& fill_color = line_width < 0 ? ColorPalette::noColor : (m_pSettingsStore->GetBoolParameter (BP_SIMULATE_TRANSPARENCY) ? SimulateTransparency (pCurrentNode) : pCurrentNode->getNodeColor (m_pColorPalette));
883883 const ColorPalette::Color& outline_color = line_width == 0 ? ColorPalette::noColor : pCurrentNode->getOutlineColor (m_pColorPalette);
884-
884+
885885 switch (m_pSettingsStore->GetLongParameter (LP_SHAPE_TYPE))
886886 {
887887 case Options::OVERLAPPING_RECTANGLE:
@@ -1008,7 +1008,7 @@ void CDasherViewSquare::NewRender(CDasherNode* pCurrentNode, myint y1, myint y2,
10081008// / just the inverse of the mapping used to calculate the screen
10091009// / positions of boxes etc.
10101010
1011- void CDasherViewSquare::Screen2Dasher (screenint iInputX, screenint iInputY, myint& iDasherX, myint& iDasherY)
1011+ void CDasherViewSquare::Screen2Dasher (screenint iInputX, screenint iInputY, myint& iDasherX, myint& iDasherY) const
10121012{
10131013 // Things we're likely to need:
10141014
@@ -1041,7 +1041,7 @@ void CDasherViewSquare::Screen2Dasher(screenint iInputX, screenint iInputY, myin
10411041 iDasherY = iymap (iDasherY);
10421042}
10431043
1044- void CDasherViewSquare::SetScaleFactor ( void )
1044+ void CDasherViewSquare::ComputeScaleFactor ( )
10451045{
10461046 // Parameters for X non-linearity.
10471047 // Set some defaults here, in case we change(d) them later...
@@ -1141,7 +1141,7 @@ inline myint CDasherViewSquare::CustomIDivScaleFactor(myint iNumerator)
11411141 // return (iNumerator + iDenominator - 1) / iDenominator;
11421142}
11431143
1144- void CDasherViewSquare::Dasher2Screen (myint iDasherX, myint iDasherY, screenint& iScreenX, screenint& iScreenY)
1144+ void CDasherViewSquare::Dasher2Screen (myint iDasherX, myint iDasherY, screenint& iScreenX, screenint& iScreenY) const
11451145{
11461146 // Apply the nonlinearities
11471147
@@ -1180,7 +1180,7 @@ void CDasherViewSquare::Dasher2Screen(myint iDasherX, myint iDasherY, screenint&
11801180 }
11811181}
11821182
1183- void CDasherViewSquare::Dasher2Polar (myint iDasherX, myint iDasherY, double & r, double & theta)
1183+ void CDasherViewSquare::Dasher2Polar (myint iDasherX, myint iDasherY, double & r, double & theta) const
11841184{
11851185 iDasherX = xmap (iDasherX);
11861186 iDasherY = ymap (iDasherY);
@@ -1194,7 +1194,7 @@ void CDasherViewSquare::Dasher2Polar(myint iDasherX, myint iDasherY, double& r,
11941194 r = sqrt (x * x + y * y);
11951195}
11961196
1197- void CDasherViewSquare::DasherLine2Screen (myint x1, myint y1, myint x2, myint y2, std::vector<point>& vPoints)
1197+ void CDasherViewSquare::DasherLine2Screen (myint x1, myint y1, myint x2, myint y2, std::vector<point>& vPoints) const
11981198{
11991199 if (x1 != x2 && y1 != y2)
12001200 {
@@ -1264,7 +1264,7 @@ void CDasherViewSquare::DasherLine2Screen(myint x1, myint y1, myint x2, myint y2
12641264 vPoints.push_back (p);
12651265}
12661266
1267- CDasherView::DasherCoordScreenRegion CDasherViewSquare::VisibleRegion ()
1267+ CDasherView::DasherCoordScreenRegion CDasherViewSquare::VisibleRegion () const
12681268{
12691269 if (!m_bVisibleRegionValid)
12701270 {
@@ -1299,7 +1299,7 @@ CDasherView::DasherCoordScreenRegion CDasherViewSquare::VisibleRegion()
12991299void CDasherViewSquare::ScreenResized (CDasherScreen* NewScreen)
13001300{
13011301 m_bVisibleRegionValid = false ;
1302- SetScaleFactor ();
1302+ ComputeScaleFactor ();
13031303}
13041304
13051305// / Draw the crosshair
0 commit comments