]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx
Salome HOME
Avoid installing redundant files
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DimensionCreateTool.cxx
index 06d3cba253623381b7e5b64c4be557bb59d761af..d860ce1382849c6c247eb1549dd5f377d996968a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -509,7 +509,7 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
           aPmin = aTrimmedCurve->FirstParameter();
           aPmax = aTrimmedCurve->LastParameter();
 
-          aCircle = Handle(Geom_Circle)::DownCast( aTrimmedCurve );
+          aCircle = Handle(Geom_Circle)::DownCast( aTrimmedCurve ); // todo: useless downcast: aCircle always NULL
         }
         break;
       }
@@ -550,7 +550,7 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
           aPmin = aTrimmedCurve->FirstParameter();
           aPmax = aTrimmedCurve->LastParameter();
 
-          aCircle = Handle(Geom_Circle)::DownCast( aTrimmedCurve );
+          aCircle = Handle(Geom_Circle)::DownCast( aTrimmedCurve ); // todo: useless downcast: aCircle always NULL
         }
 
         break;
@@ -579,6 +579,7 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
       // do not break, go to edge checking
       aMeasuredShape = anExpEdge;
     }
+    // fall through!
 
     case TopAbs_EDGE:
     {
@@ -627,6 +628,8 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
       }
     }
     break;
+  default:
+    break;
   }
 
   if ( aCircle.IsNull() )
@@ -687,7 +690,7 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
   Handle(AIS_DiameterDimension) aDimension = new AIS_DiameterDimension( aRuledCirc, aPln );
 
   // if flyout is extended in tangent direction to circle, the default flyout value is used
-  // if flyout is extended in plane of circle, the zero flyout value is choosen initially
+  // if flyout is extended in plane of circle, the zero flyout value is chosen initially
   Standard_Real aFlyout = aCircN.IsParallel( aPln.Axis().Direction(), Precision::Angular() ) ? 0.0 : Settings.DefaultFlyout;
 
   aDimension->SetFlyout(aFlyout);
@@ -929,7 +932,7 @@ void MeasureGUI_DimensionCreateTool::PositionLength( const Bnd_Box& theBnd,
 //            flyout plane to best match the current view projection (if any)
 //            The points are aligned to XOY, YOZ, ZOX planes.
 //            The flyout takes into account bounding box of main shape of face normal
-//            vector. The flyouts tangetial to the circle plane are directed in 
+//            vector. The flyouts tangential to the circle plane are directed in 
 //            accordance with the face normal (if not-null), otherwise the flyouts
 //            are turned to direct to the closest border of bounding box.
 //=================================================================================
@@ -1076,7 +1079,7 @@ void MeasureGUI_DimensionCreateTool::ChooseLengthFlyoutsFromBnd( SeqOfDirs& theD
   {
     const gp_Pln& aPlane = aPlaneIt.Value();
 
-    // transform bounding box to orthogonal coordiantes relative to
+    // transform bounding box to orthogonal coordinates relative to
     // dimension points P1, P2 (x-axis) and plane direction (z-axis),
     // where y coordinates will correspond to flyout direction against
     // the dimension point line