//=======================================================================
void AIS_AngleDimension::Init()
{
- SetGeometryOrientedAngle (Standard_False);
+ SetGeometryOrientedAngle (Standard_False, Standard_False);
SetSpecialSymbol (THE_DEGREE_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_After);
SetFlyout (15.0);
gp_Pln aPlane = aConstructPlane.Value();
if (myGeometryOrientedAngle) {
- gp_Ax1 anAxis = aPlane.Axis();
- gp_Dir aDir = anAxis.Direction();
- aDir.Reverse();
- aPlane.SetAxis(gp_Ax1(anAxis.Location(), aDir));
+ gp_Dir aCPlaneDir = aPlane.Axis().Direction();
+ bool aCPlaneDirToReverse = aCPlaneDir.X() < 0 || aCPlaneDir.Y() < 0 || aCPlaneDir.Z() < 0;
+ // have similar direction for all cases
+ if (!aCPlaneDirToReverse && myUseReverse) {
+ gp_Ax1 anAxis = aPlane.Axis();
+ gp_Dir aDir = anAxis.Direction();
+ aDir.Reverse();
+ aPlane.SetAxis(gp_Ax1(anAxis.Location(), aDir));
+ }
+
+ if (aCPlaneDirToReverse && !myUseReverse) {
+ gp_Ax1 anAxis = aPlane.Axis();
+ gp_Dir aDir = anAxis.Direction();
+ aDir.Reverse();
+ aPlane.SetAxis(gp_Ax1(anAxis.Location(), aDir));
+ }
}
// construct circle forming the arc
gp_Circ aCircle = aConstructCircle.Value();
// construct the arc
- Standard_Boolean isArcSense = !myGeometryOrientedAngle;
- GC_MakeArcOfCircle aConstructArc(aCircle, theFirstAttach, theSecondAttach, isArcSense);
+ GC_MakeArcOfCircle aConstructArc(aCircle, theFirstAttach, theSecondAttach, Standard_True);
if (!aConstructArc.IsDone())
{
return;
//function : SetGeometryOrientedAngle
//purpose :
//=======================================================================
-void AIS_AngleDimension::SetGeometryOrientedAngle(const Standard_Boolean& theState)
+void AIS_AngleDimension::SetGeometryOrientedAngle(const Standard_Boolean& theState,
+ const Standard_Boolean& theUseReverse)
{
myGeometryOrientedAngle = theState;
+ myUseReverse = theUseReverse;
}
//=======================================================================
//! Sets state if the create arc should be built depending on the input geometry orientation
//! or to be always oriented in [0,0,1]. The last case propose angles more than 180 degree.
//! @param theSecondAttach [in] the second attachment point.
- void SetGeometryOrientedAngle(const Standard_Boolean& theState);
+ void SetGeometryOrientedAngle(const Standard_Boolean& theState, const Standard_Boolean& theUseReverse);
public:
private:
Standard_Boolean myGeometryOrientedAngle;
+ Standard_Boolean myUseReverse;
gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint;
switch (anAngleType) {
case ANGLE_DIRECT: {
- SetGeometryOrientedAngle(false);
+ SetGeometryOrientedAngle(true, false);
SetMeasuredGeometry(aEdge1, aEdge2);
}
break;
case ANGLE_SUPPLEMENTARY: {
// to calculate center, first and end points
- SetGeometryOrientedAngle(false);
+ SetGeometryOrientedAngle(false, false);
SetMeasuredGeometry(aEdge1, aEdge2);
gp_Pnt aCenterPnt = CenterPoint();
gp_Pnt aFirstPnt = FirstPoint();
}
break;
case ANGLE_BACKWARD: {
- SetGeometryOrientedAngle(true);
+ SetGeometryOrientedAngle(true, true);
SetMeasuredGeometry(aEdge1, aEdge2);
}
break;