{
gp_Pln aComputedPlane;
- myFirstShape = theFirstEdge;
- mySecondShape = theSecondEdge;
- myThirdShape = TopoDS_Shape();
- myGeometryType = GeometryType_Edges;
- myIsValid = InitTwoEdgesAngle (aComputedPlane);
+ myFirstShape = theFirstEdge;
+ mySecondShape = theSecondEdge;
+ myThirdShape = TopoDS_Shape();
+ myGeometryType = GeometryType_Edges;
+ myIsGeometryValid = InitTwoEdgesAngle (aComputedPlane);
- if (myIsValid && !myIsPlaneCustom)
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
mySecondShape = BRepLib_MakeVertex (myCenterPoint);
myThirdShape = BRepLib_MakeVertex (mySecondPoint);
myGeometryType = GeometryType_Points;
- myIsValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
+ myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
- if (myIsValid && !myIsPlaneCustom)
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
const TopoDS_Vertex& theSecondVertex,
const TopoDS_Vertex& theThirdVertex)
{
- myFirstShape = theFirstVertex;
- mySecondShape = theSecondVertex;
- myThirdShape = theThirdVertex;
- myFirstPoint = BRep_Tool::Pnt (theFirstVertex);
- myCenterPoint = BRep_Tool::Pnt (theSecondVertex);
- mySecondPoint = BRep_Tool::Pnt (theThirdVertex);
- myGeometryType = GeometryType_Points;
- myIsValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
-
- if (myIsValid && !myIsPlaneCustom)
+ myFirstShape = theFirstVertex;
+ mySecondShape = theSecondVertex;
+ myThirdShape = theThirdVertex;
+ myFirstPoint = BRep_Tool::Pnt (theFirstVertex);
+ myCenterPoint = BRep_Tool::Pnt (theSecondVertex);
+ mySecondPoint = BRep_Tool::Pnt (theThirdVertex);
+ myGeometryType = GeometryType_Points;
+ myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
+
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
//=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone)
{
- myFirstShape = theCone;
- mySecondShape = TopoDS_Shape();
- myThirdShape = TopoDS_Shape();
- myGeometryType = GeometryType_Face;
- myIsValid = InitConeAngle();
+ myFirstShape = theCone;
+ mySecondShape = TopoDS_Shape();
+ myThirdShape = TopoDS_Shape();
+ myGeometryType = GeometryType_Face;
+ myIsGeometryValid = InitConeAngle();
- if (myIsValid && !myIsPlaneCustom)
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace)
{
- myFirstShape = theFirstFace;
- mySecondShape = theSecondFace;
- myThirdShape = TopoDS_Shape();
- myGeometryType = GeometryType_Faces;
- myIsValid = InitTwoFacesAngle();
+ myFirstShape = theFirstFace;
+ mySecondShape = theSecondFace;
+ myThirdShape = TopoDS_Shape();
+ myGeometryType = GeometryType_Faces;
+ myIsGeometryValid = InitTwoFacesAngle();
- if (myIsValid && !myIsPlaneCustom)
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
const TopoDS_Face& theSecondFace,
const gp_Pnt& thePoint)
{
- myFirstShape = theFirstFace;
- mySecondShape = theSecondFace;
- myThirdShape = TopoDS_Shape();
- myGeometryType = GeometryType_Faces;
- myIsValid = InitTwoFacesAngle (thePoint);
+ myFirstShape = theFirstFace;
+ mySecondShape = theSecondFace;
+ myThirdShape = TopoDS_Shape();
+ myGeometryType = GeometryType_Faces;
+ myIsGeometryValid = InitTwoFacesAngle (thePoint);
- if (myIsValid && !myIsPlaneCustom)
+ if (myIsGeometryValid && !myIsPlaneCustom)
{
ComputePlane();
}
- myIsValid &= CheckPlane (myPlane);
-
SetToUpdate();
}
//=======================================================================
void AIS_AngleDimension::ComputePlane()
{
- if (!IsValid())
+ if (!myIsGeometryValid)
{
return;
}
if (IsTextPositionCustom())
{
- AdjustParameters (myFixedTextPosition,anExtensionSize, aHorisontalTextPos);
+ AdjustParameters (myFixedTextPosition,anExtensionSize, aHorisontalTextPos, myFlyout);
}
// Handle user-defined and automatic arrow placement
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
}
- myIsComputed = Standard_True;
+ mySelectionGeom.IsComputed = Standard_True;
}
//=======================================================================
}
//=======================================================================
-//function : AdjustAspectParameters
+//function : AdjustParameters
//purpose :
//=======================================================================
void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos,
Standard_Real& theExtensionSize,
- Prs3d_DimensionTextHorizontalPosition& theAlignment)
+ Prs3d_DimensionTextHorizontalPosition& theAlignment,
+ Standard_Real& theFlyout) const
{
Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length();
// Horizontal center
if (aTextPar > aParamBeg && aTextPar < aParamEnd)
{
- myFlyout = aRadius;
-
- SetToUpdate();
+ theFlyout = aRadius;
return;
}
if (aTextPar > aParamBeg && aTextPar < aParamEnd)
{
- myFlyout = -aRadius;
-
- SetToUpdate();
+ theFlyout = -aRadius;
return;
}
gp_Vec aPosFlyoutDir = gp_Vec (myCenterPoint, myFirstPoint).Normalized().Scaled (aRadius);
- myFlyout = aFirstTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
+ theFlyout = aFirstTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
? -aRadius : aRadius;
}
else
gp_Vec aPosFlyoutDir = gp_Vec (myCenterPoint, mySecondPoint).Normalized().Scaled (aRadius);
- myFlyout = aSecondTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
+ theFlyout = aSecondTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
? -aRadius : aRadius;
}
}