}
}
}
- if (aModule)
- aModule->onViewTransformed();
-
if (myOpenTransaction) {
SessionPtr aMgr = ModelAPI_Session::get();
aMgr->finishOperation();
myWorkshop->selectionActivate()->updateSelectionFilters();
myWorkshop->selectionActivate()->updateSelectionModes();
+ if (aModule)
+ aModule->onViewTransformed();
+
// 6. Update sketcher actions
XGUI_ActionsMgr* anActMgr = aWorkshop->actionsMgr();
bool SketcherPrs_Collinear::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aObj1 =
bool SketcherPrs_Equal::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aObj1 =
bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
// Set point of the symbol
bool SketcherPrs_Middle::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aPointObject;
bool SketcherPrs_Mirror::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
// Get axis of mirror
bool SketcherPrs_Parallel::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aObj1 =
bool SketcherPrs_Perpendicular::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aObj1 =
bool SketcherPrs_Rigid::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
myPntArray = new Graphic3d_ArrayOfPoints(1, withColor);
// The constraint attached to a point
std::shared_ptr<GeomAPI_Pnt2d> aPnt = SketcherPrs_Tools::getPoint(myConstraint,
SketchPlugin_Constraint::ENTITY_A());
- std::shared_ptr<GeomAPI_Pnt> aPoint = myPlane->to3D(aPnt->x(), aPnt->y() + theStep);
+ std::shared_ptr<GeomAPI_Pnt> aPoint = plane()->to3D(aPnt->x(), aPnt->y() + theStep);
myPntArray->AddVertex(aPoint->impl<gp_Pnt>());
}
return true;
SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
SketchPlugin_Sketch* theSketcher)
: AIS_InteractiveObject(), myConstraint(theConstraint),
- myPlane(theSketcher->coordinatePlane()), myIsCustomColor(false),
+ myIsCustomColor(false),
mySketcher(theSketcher)
{
SetAutoHilight(Standard_False);
const Handle(SelectMgr_EntityOwner)& theOwner);
/// Returns sketcher plane
- Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return myPlane; }
+ Standard_EXPORT std::shared_ptr<GeomAPI_Ax3> plane() const { return mySketcher->coordinatePlane(); }
/// Returns feature object
Standard_EXPORT ModelAPI_Feature* feature() const { return myConstraint; }
ModelAPI_Feature* myConstraint;
/// Sketcher feature
- ModelAPI_CompositeFeature* mySketcher;
-
- /// Plane of the current sketcher
- std::shared_ptr<GeomAPI_Ax3> myPlane;
+ SketchPlugin_Sketch* mySketcher;
/// Aspect for entities drawing
Handle(Graphic3d_AspectMarker3d) myAspect;
bool SketcherPrs_Tangent::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
ObjectPtr aObj1 =
bool SketcherPrs_Transformation::updateIfReadyToDisplay(double theStep, bool withColor) const
{
- if (!IsReadyToDisplay(myConstraint, myPlane))
+ if (!IsReadyToDisplay(myConstraint, plane()))
return false;
std::shared_ptr<ModelAPI_Data> aData = myConstraint->data();
if (aStart.get() && aEnd.get() && aStart->isInitialized() && aEnd->isInitialized()) {
// Add start point
- std::shared_ptr<GeomAPI_Pnt> aPnt = myPlane->to3D(aStart->x(), aStart->y());
+ std::shared_ptr<GeomAPI_Pnt> aPnt = plane()->to3D(aStart->x(), aStart->y());
Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl<gp_Pnt>());
StdPrs_Point::Add(thePrs, aPoint, myDrawer);
// Add end point
- aPnt = myPlane->to3D(aEnd->x(), aEnd->y());
+ aPnt = plane()->to3D(aEnd->x(), aEnd->y());
aPoint = new Geom_CartesianPoint(aPnt->impl<gp_Pnt>());
StdPrs_Point::Add(thePrs, aPoint, myDrawer);
}
GeomDataAPI_Point2D::getPoint2D(aData, SketchPlugin_MultiRotation::CENTER_ID());
if (aCenter.get() && aCenter->isInitialized()) {
// Show center of rotation
- std::shared_ptr<GeomAPI_Pnt> aPnt = myPlane->to3D(aCenter->x(), aCenter->y());
+ std::shared_ptr<GeomAPI_Pnt> aPnt = plane()->to3D(aCenter->x(), aCenter->y());
Handle(Geom_CartesianPoint) aPoint = new Geom_CartesianPoint(aPnt->impl<gp_Pnt>());
StdPrs_Point::Add(thePrs, aPoint, myDrawer);
}