#include "PartSet_WidgetEditor.h"
#include "PartSet_ResultSketchPrs.h"
#include "PartSet_ExternalPointsMgr.h"
+#include "PartSet_PreviewSketchPlane.h"
#include <XGUI_ModuleConnector.h>
#include <XGUI_Displayer.h>
#include <SketchPlugin_MultiRotation.h>
#include <SketchPlugin_MultiTranslation.h>
#include <SketchPlugin_IntersectionPoint.h>
+#include <SketchPlugin_Projection.h>
#include <SketcherPrs_Tools.h>
myIsConstraintsShown[PartSet_Tools::Geometrical] = true;
myIsConstraintsShown[PartSet_Tools::Dimensional] = true;
myIsConstraintsShown[PartSet_Tools::Expressions] = false;
+
+ mySketchPlane = new PartSet_PreviewSketchPlane();
}
PartSet_SketcherMgr::~PartSet_SketcherMgr()
FeaturePtr aFeature = myCurrentSelection.begin().key();
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
- if (aSPFeature && (!aSPFeature->isExternal())) {
- myModule->editFeature(aSPFeature);
+ if (aSPFeature) {
+ if (!aSPFeature->isExternal())
+ myModule->editFeature(aSPFeature);
+ else {
+ FeaturePtr aProjectionFeature = PartSet_Tools::findRefsToMeFeature(aFeature,
+ SketchPlugin_Projection::ID());
+ if (aProjectionFeature.get())
+ myModule->editFeature(aProjectionFeature);
+ }
}
}
}
// Display all sketcher sub-Objects
myCurrentSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFOperation->feature());
+ mySketchPlane->createSketchPlane(myCurrentSketch, myModule->workshop());
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
// Hide sketcher result
XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
// The sketch was aborted
myCurrentSketch = CompositeFeaturePtr();
+ mySketchPlane->eraseSketchPlane(myModule->workshop());
// TODO: move this outside of if-else
myModule->workshop()->viewer()->removeSelectionFilter(myCirclePointFilter);
myModule->workshop()->viewer()->removeSelectionFilter(myPlaneFilter);
myCurrentSketch->setDisplayed(true);
myCurrentSketch = CompositeFeaturePtr();
+ mySketchPlane->eraseSketchPlane(myModule->workshop());
myModule->workshop()->viewer()->removeSelectionFilter(myCirclePointFilter);
myModule->workshop()->viewer()->removeSelectionFilter(myPlaneFilter);
void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOperation)
{
+ previewSketchPlane()->updatePlaneSize(activeSketch(), myModule->workshop());
myIsMouseOverViewProcessed = true;
operationMgr()->onValidateOperation();
// when sketch nested operation is stopped the cursor should be restored unconditionally