Salome HOME
Avoid installing redundant files
[modules/geom.git] / src / MeasureGUI / MeasureGUI_DimensionCreateTool.cxx
index b571b61c776f726e4a190372c7033a7e01ebee3f..d860ce1382849c6c247eb1549dd5f377d996968a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  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
@@ -76,7 +76,6 @@
 #include <TColgp_SequenceOfDir.hxx>
 #include <V3d_View.hxx>
 
-
 // plane associated with custom data
 struct PlaneAndSegment
 {
@@ -510,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;
       }
@@ -551,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;
@@ -580,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:
     {
@@ -628,6 +628,8 @@ Handle(AIS_DiameterDimension) MeasureGUI_DimensionCreateTool::Diameter( const GE
       }
     }
     break;
+  default:
+    break;
   }
 
   if ( aCircle.IsNull() )
@@ -688,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);
@@ -930,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.
 //=================================================================================
@@ -1077,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
@@ -1147,8 +1149,8 @@ template <typename TPlane>
 TPlane MeasureGUI_DimensionCreateTool::SelectPlaneForProjection( const NCollection_Sequence<TPlane>& thePlanes,
                                                                  const Handle(V3d_View)& theView ) const
 {
-  Quantity_Parameter U[3];
-  Quantity_Parameter N[3];
+  Standard_Real U[3];
+  Standard_Real N[3];
   theView->Up( U[0], U[1], U[2] );
   theView->Proj( N[0], N[1], N[2] );