void PartSet_SketcherMgr::stopSketch(ModuleBase_Operation* theOperation)
{
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
+ XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
+
DataPtr aData = myCurrentSketch->data();
if ((!aData) || (!aData->isValid())) {
// The sketch was aborted
myCurrentSketch = CompositeFeaturePtr();
myModule->workshop()->viewer()->removeSelectionFilter(myPlaneFilter);
+
+ // Erase all sketcher objects
+ QStringList aSketchIds = sketchOperationIdList();
+ QObjectPtrList aObjects = aDisplayer->displayedObjects();
+ foreach (ObjectPtr aObj, aObjects) {
+ DataPtr aObjData = aObj->data();
+ if ((!aObjData) || (!aObjData->isValid()))
+ aDisplayer->erase(aObj);
+ }
return;
}
// Hide all sketcher sub-Objects
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
- XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
FeaturePtr aFeature = myCurrentSketch->subFeature(i);
std::list<ResultPtr> aResults = aFeature->results();
//myUseExternalObjects = true;
AIS_ListOfInteractive aPrsList;
- displayedObjects(aContext, aPrsList);
+ ::displayedObjects(aContext, aPrsList);
Handle(AIS_Trihedron) aTrihedron;
AIS_ListIteratorOfListOfInteractive aLIt(aPrsList);
//aContext->NotUseDisplayedObjects();
AIS_ListOfInteractive aPrsList;
- displayedObjects(aContext, aPrsList);
+ ::displayedObjects(aContext, aPrsList);
AIS_ListIteratorOfListOfInteractive aLIt;
//Handle(AIS_Trihedron) aTrihedron;
/// Returns number of displayed objects
int objectsCount() const { return myResult2AISObjectMap.size(); }
+ QObjectPtrList displayedObjects() const { return myResult2AISObjectMap.keys(); }
+
+ /// Returns true if the given object can be shown in shaded mode
bool canBeShaded(ObjectPtr theObject) const;
protected: