SetDimensionAspect(createDimensionAspect());
myStyleListener = new SketcherPrs_DimensionStyleListener();
-#ifdef OCCT_28850_FIXED
- if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID())
- SetDirection(plane()->dirX()->impl<gp_Dir>(), true);
- else if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceVertical::ID())
- SetDirection(plane()->dirY()->impl<gp_Dir>(), true);
-#endif
+ setDirection(theConstraint, plane());
}
SketcherPrs_LengthDimension::~SketcherPrs_LengthDimension()
else
anAttributeValue = aData->real(SketchPlugin_Constraint::VALUE());
myValue.init(anAttributeValue);
+
+ setDirection(myConstraint, plane());
}
// compute flyout distance
SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
AIS_LengthDimension::ComputeSelection(aSelection, aMode);
}
+
+void SketcherPrs_LengthDimension::setDirection(ModelAPI_Feature* theConstraint,
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+{
+#ifdef OCCT_28850_FIXED
+ if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID())
+ SetDirection(thePlane->dirX()->impl<gp_Dir>(), true);
+ else if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceVertical::ID())
+ SetDirection(thePlane->dirY()->impl<gp_Dir>(), true);
+#endif
+}
const std::shared_ptr<GeomAPI_Ax3>& thePlane,
gp_Pnt& thePnt1, gp_Pnt& thePnt2);
+ /// Set the direction for horizontal/vertical constraint
+ void setDirection(ModelAPI_Feature* theConstraint,
+ const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+
/// Constraint feature
ModelAPI_Feature* myConstraint;