void AIS_AngleDimension::Init()
{
SetGeometryOrientedAngle (Standard_False, Standard_False);
+ SetArrowVisible(Standard_True, Standard_True);
SetSpecialSymbol (THE_DEGREE_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_After);
SetFlyout (15.0);
gp_Pln aPlane = aConstructPlane.Value();
if (myGeometryOrientedAngle) {
- gp_Dir aCPlaneDir = aPlane.Axis().Direction();
- bool aCPlaneDirToReverse = aCPlaneDir.X() < 0 || aCPlaneDir.Y() < 0 || aCPlaneDir.Z() < 0;
+ gp_Dir aCPlaneDir = GetPlane().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();
if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
{
DrawArc (thePresentation,
- isArrowsExternal ? aFirstAttach : aFirstArrowEnd,
- isArrowsExternal ? aSecondAttach : aSecondArrowEnd,
+ (isArrowsExternal || !myFirstArrowVisible) ? aFirstAttach : aFirstArrowEnd,
+ (isArrowsExternal || !mySecondArrowVisible) ? aSecondAttach : aSecondArrowEnd,
myCenterPoint,
Abs (GetFlyout()),
theMode);
{
DrawExtension (thePresentation,
anExtensionSize,
- isArrowsExternal ? aFirstArrowEnd : aFirstAttach,
+ (isArrowsExternal && myFirstArrowVisible) ? aFirstArrowEnd : aFirstAttach,
aFirstExtensionDir,
aLabelString,
aLabelWidth,
{
DrawExtension (thePresentation,
anExtensionSize,
- isArrowsExternal ? aSecondArrowEnd : aSecondAttach,
+ (isArrowsExternal && mySecondArrowVisible) ? aSecondArrowEnd : aSecondAttach,
aSecondExtensionDir,
aLabelString,
aLabelWidth,
Prs3d_Root::NewGroup (thePresentation);
DrawArc (thePresentation,
- isArrowsExternal ? aFirstAttach : aFirstArrowEnd,
- isArrowsExternal ? aSecondAttach : aSecondArrowEnd,
+ (isArrowsExternal || !myFirstArrowVisible) ? aFirstAttach : aFirstArrowEnd,
+ (isArrowsExternal || !mySecondArrowVisible) ? aSecondAttach : aSecondArrowEnd,
myCenterPoint,
Abs(GetFlyout ()),
theMode);
{
Prs3d_Root::NewGroup (thePresentation);
- DrawArrow (thePresentation, aFirstArrowBegin, gp_Dir (aFirstArrowVec));
- DrawArrow (thePresentation, aSecondArrowBegin, gp_Dir (aSecondArrowVec));
+ if (myFirstArrowVisible)
+ DrawArrow (thePresentation, aFirstArrowBegin, gp_Dir (aFirstArrowVec));
+ if (mySecondArrowVisible)
+ DrawArrow (thePresentation, aSecondArrowBegin, gp_Dir (aSecondArrowVec));
}
if ((theMode == ComputeMode_All || theMode == ComputeMode_Line) && isArrowsExternal)
{
Prs3d_Root::NewGroup (thePresentation);
- if (aHPosition != LabelPosition_Left)
+ if (aHPosition != LabelPosition_Left && myFirstArrowVisible)
{
DrawExtension (thePresentation,
aDimensionAspect->ArrowTailSize(),
LabelPosition_None);
}
- if (aHPosition != LabelPosition_Right)
+ if (aHPosition != LabelPosition_Right && mySecondArrowVisible)
{
DrawExtension (thePresentation,
aDimensionAspect->ArrowTailSize(),
myUseReverse = theUseReverse;
}
+//=======================================================================
+//function : SetArrowVisible
+//purpose :
+//=======================================================================
+void AIS_AngleDimension::SetArrowVisible(const Standard_Boolean& theFirstArrowVisible,
+ const Standard_Boolean& theSecondArrowVisible)
+{
+ myFirstArrowVisible = theFirstArrowVisible;
+ mySecondArrowVisible = theSecondArrowVisible;
+}
+
//=======================================================================
//function : AdjustParameters
//purpose :
switch (anAngleType) {
case ANGLE_DIRECT: {
SetGeometryOrientedAngle(true, false);
+ SetArrowVisible(Standard_False, Standard_True);
SetMeasuredGeometry(aEdge1, aEdge2);
}
break;
gp_Pnt aSecondPnt = SecondPoint();
double anEdge2Length = aCenterPnt.Distance(aSecondPnt);
aSecondPnt = aCenterPnt.Translated (gp_Vec(aCenterPnt, aSecondPnt).Normalized() * (-anEdge2Length));
+ SetArrowVisible(Standard_True, Standard_False);
SetMeasuredGeometry(aFirstPnt, aCenterPnt, aSecondPnt);
}
break;
case ANGLE_BACKWARD: {
SetGeometryOrientedAngle(true, true);
+ SetArrowVisible(Standard_False, Standard_True);
SetMeasuredGeometry(aEdge1, aEdge2);
}
break;