//
// 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
//=======================================================================
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();
}
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();
}
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();
}
//=======================================================================
void AIS_RadiusDimension::ComputePlane()
{
- if (!IsValid())
+ if (!myIsGeometryValid)
{
return;
}
//=======================================================================
void AIS_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos)
{
- if (!myIsValid)
+ if (!myIsGeometryValid)
{
return;
}