//purpose :
//=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge,
- const TopoDS_Edge& theSecondEdge,
- const Standard_Boolean& theUseLongestDistance)
+ const TopoDS_Edge& theSecondEdge)
: AIS_Dimension (AIS_KOD_PLANEANGLE)
{
Init();
- SetMeasuredGeometry (theFirstEdge, theSecondEdge, theUseLongestDistance);
+ SetMeasuredGeometry (theFirstEdge, theSecondEdge);
}
//=======================================================================
//purpose :
//=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge,
- const TopoDS_Edge& theSecondEdge,
- const Standard_Boolean& theUseLongestDistance)
+ const TopoDS_Edge& theSecondEdge)
{
gp_Pln aComputedPlane;
mySecondShape = theSecondEdge;
myThirdShape = TopoDS_Shape();
myGeometryType = GeometryType_Edges;
- myIsGeometryValid = InitTwoEdgesAngle (aComputedPlane, theUseLongestDistance);
+ myIsGeometryValid = InitTwoEdgesAngle (aComputedPlane);
if (myIsGeometryValid && !myIsPlaneCustom)
{
}
gp_Pln aPlane = aConstructPlane.Value();
+ if (myUseReverse) {
+ gp_Ax1 anAxis = aPlane.Axis();
+ gp_Dir aDir = anAxis.Direction();
+ aDir.Reverse();
+ aPlane.SetAxis(gp_Ax1(anAxis.Location(), aDir));
+ }
Standard_Real aRadius = theFirstAttach.Distance (theCenter);
//function : InitTwoEdgesAngle
//purpose :
//=======================================================================
-Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane,
- const Standard_Boolean& theUseLongestDistance)
+Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane)
{
TopoDS_Edge aFirstEdge = TopoDS::Edge (myFirstShape);
TopoDS_Edge aSecondEdge = TopoDS::Edge (mySecondShape);
// |
// | <- dimension should be here
// *----
- if (theUseLongestDistance) {
- myFirstPoint = myCenterPoint.Distance (aFirstPoint1) > myCenterPoint.Distance (aLastPoint1)
+ myFirstPoint = !myCenterPoint.IsEqual(aFirstPoint1, Precision::Confusion())
? aFirstPoint1
: aLastPoint1;
-
- mySecondPoint = myCenterPoint.Distance (aFirstPoint2) > myCenterPoint.Distance (aLastPoint2)
+ mySecondPoint = !myCenterPoint.IsEqual(aFirstPoint2, Precision::Confusion())
? aFirstPoint2
: aLastPoint2;
- } else {
- myFirstPoint = !myCenterPoint.IsEqual(aFirstPoint1, Precision::Confusion())
- ? aFirstPoint1
- : aLastPoint1;
- mySecondPoint = !myCenterPoint.IsEqual(aFirstPoint2, Precision::Confusion())
- ? aFirstPoint2
- : aLastPoint2;
- }
}
return IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
//! These two edges should be intersected by each other. Otherwise the geometry is not valid.
//! @param theFirstEdge [in] the first edge.
//! @param theSecondEdge [in] the second edge.
- //! @param theUseLongestDistance [in] automatically fills first/second points of presentation by
//! the maximum distanced point of edges from the presentation center
Standard_EXPORT AIS_AngleDimension (const TopoDS_Edge& theFirstEdge,
- const TopoDS_Edge& theSecondEdge,
- const Standard_Boolean& theUseLongestDistance = Standard_True);
+ const TopoDS_Edge& theSecondEdge);
//! Constructs the angle display object defined by three points.
//! @param theFirstPoint [in] the first point (point on first angle flyout).
//! These two edges should be intersected by each other. Otherwise the geometry is not valid.
//! @param theFirstEdge [in] the first edge.
//! @param theSecondEdge [in] the second edge.
- //! @param theUseLongestDistance [in] automatically fills first/second points of presentation by
//! the maximum distanced point of edges from the presentation center
Standard_EXPORT void SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge,
- const TopoDS_Edge& theSecondEdge,
- const Standard_Boolean& theUseLongestDistance = Standard_True);
+ const TopoDS_Edge& theSecondEdge);
//! Measures angle defined by three points.
//! @param theFirstPoint [in] the first point (point on first angle flyout).
protected:
//! Init angular dimension to measure angle between two linear edges.
- //! @param theUseLongestDistance [in] automatically fills first/second points of presentation by
//! the maximum distanced point of edges from the presentation center
//! @return TRUE if the angular dimension can be constructured
//! for the passed edges.
- Standard_EXPORT Standard_Boolean InitTwoEdgesAngle (gp_Pln& theComputedPlane,
- const Standard_Boolean& theUseLongestDistance = Standard_True);
+ Standard_EXPORT Standard_Boolean InitTwoEdgesAngle (gp_Pln& theComputedPlane);
//! Init angular dimension to measure angle between two planar faces.
//! there is no user-defined poisitoning. So attach points are set