0027105: Make code ISO-compliant [-Wpedantic fixes]
[occt.git] / src / AIS / AIS_RadiusDimension.cxx
index f6760a6..b1114e9 100644 (file)
@@ -5,8 +5,8 @@
 //
 // This file is part of Open CASCADE Technology software library.
 //
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
 // by the Free Software Foundation, with special exception defined in the file
 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
 // distribution for complete text of the license and disclaimer of any warranty.
 #include <ElCLib.hxx>
 #include <gce_MakeDir.hxx>
 
-IMPLEMENT_STANDARD_HANDLE (AIS_RadiusDimension, AIS_Dimension)
-IMPLEMENT_STANDARD_RTTIEXT (AIS_RadiusDimension, AIS_Dimension)
+
+IMPLEMENT_STANDARD_RTTIEXT(AIS_RadiusDimension,AIS_Dimension)
 
 namespace
 {
   static const Standard_ExtCharacter THE_RADIUS_SYMBOL ('R');
-};
+}
 
 //=======================================================================
 //function : Constructor
@@ -75,19 +75,17 @@ AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape)
 //=======================================================================
 void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle)
 {
-  myCircle       = theCircle;
-  myGeometryType = GeometryType_Edge;
-  myShape        = BRepLib_MakeEdge (theCircle);
-  myAnchorPoint  = ElCLib::Value (0, myCircle);
-  myIsValid      = IsValidCircle (myCircle);
+  myCircle          = theCircle;
+  myGeometryType    = GeometryType_Edge;
+  myShape           = BRepLib_MakeEdge (theCircle);
+  myAnchorPoint     = ElCLib::Value (0, myCircle);
+  myIsGeometryValid = IsValidCircle (myCircle);
 
-  if (myIsValid)
+  if (myIsGeometryValid)
   {
     ComputePlane();
   }
 
-  myIsValid &= CheckPlane (myPlane);
-
   SetToUpdate();
 }
 
@@ -98,19 +96,17 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle)
 void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle,
                                                const gp_Pnt&  theAnchorPoint)
 {
-  myCircle       = theCircle;
-  myGeometryType = GeometryType_Edge;
-  myShape        = BRepLib_MakeEdge (theCircle);
-  myAnchorPoint  = theAnchorPoint;
-  myIsValid      = IsValidCircle (myCircle) && IsValidAnchor (myCircle, theAnchorPoint);
+  myCircle          = theCircle;
+  myGeometryType    = GeometryType_Edge;
+  myShape           = BRepLib_MakeEdge (theCircle);
+  myAnchorPoint     = theAnchorPoint;
+  myIsGeometryValid = IsValidCircle (myCircle) && IsValidAnchor (myCircle, theAnchorPoint);
 
-  if (myIsValid)
+  if (myIsGeometryValid)
   {
     ComputePlane();
   }
 
-  myIsValid &= CheckPlane (myPlane);
-
   SetToUpdate();
 }
 
@@ -121,18 +117,16 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle,
 void AIS_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape)
 {
   Standard_Boolean isClosed = Standard_False;
-  myShape        = theShape;
-  myGeometryType = GeometryType_UndefShapes;
-  myIsValid      = InitCircularDimension (theShape, myCircle, myAnchorPoint, isClosed) 
-                && IsValidCircle (myCircle);
+  myShape                   = theShape;
+  myGeometryType            = GeometryType_UndefShapes;
+  myIsGeometryValid         = InitCircularDimension (theShape, myCircle, myAnchorPoint, isClosed) 
+                              && IsValidCircle (myCircle);
 
-  if (myIsValid)
+  if (myIsGeometryValid)
   {
     ComputePlane();
   }
 
-  myIsValid &= CheckPlane (myPlane);
-
   SetToUpdate();
 }
 
@@ -158,7 +152,7 @@ Standard_Boolean AIS_RadiusDimension::CheckPlane (const gp_Pln& thePlane) const
 //=======================================================================
 void AIS_RadiusDimension::ComputePlane()
 {
-  if (!IsValid())
+  if (!myIsGeometryValid)
   {
     return;
   }
@@ -284,7 +278,7 @@ const gp_Pnt AIS_RadiusDimension::GetTextPosition() const
 //=======================================================================
 void AIS_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos)
 {
-  if (!myIsValid)
+  if (!myIsGeometryValid)
   {
     return;
   }