void PartSet_Module::onFeatureConstructed(ObjectPtr theFeature, int theMode)
{
-// bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
-// if (isDisplay) {
- ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
- PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
- if (aPrevOp) {
- std::list<FeaturePtr> aList = aPrevOp->subFeatures();
- XGUI_Displayer* aDisplayer = myWorkshop->displayer();
- std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
- std::list<FeaturePtr>::iterator aSFIt;
- for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
- std::list<ResultPtr> aResults = (*aSFIt)->results();
- std::list<ResultPtr>::iterator aIt;
- for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
+ bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
+ ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
+ PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
+ if (aPrevOp) {
+ std::list<FeaturePtr> aList = aPrevOp->subFeatures();
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
+ std::list<FeaturePtr>::iterator aSFIt;
+ for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
+ std::list<ResultPtr> aResults = (*aSFIt)->results();
+ std::list<ResultPtr>::iterator aIt;
+ for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
+ if (isDisplay)
aDisplayer->activateInLocalContext((*aIt), aModes, false);
- }
+ else
+ aDisplayer->erase((*aIt), false);
}
}
+ }
+ if (isDisplay)
ModelAPI_EventCreator::get()->sendUpdated(theFeature,
Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
-// }
-// else
-// ->erase(theFeature->firstResult(), true);
/* bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
// TODO visualizePreview(theFeature, isDisplay, false);
if (!isDisplay) {
boost::dynamic_pointer_cast<SketchPlugin_Feature>(*anIt);
if (!aSPFeature)
continue;
- //visualizePreview((*anIt), true, false);
- aDisplayer->activateInLocalContext((*anIt), aModes, false);
+ std::list<ResultPtr> aResults = aSPFeature->results();
+ std::list<ResultPtr>::const_iterator aRIt;
+ for (aRIt = aResults.cbegin(); aRIt != aResults.cend(); ++aRIt) {
+ aDisplayer->display((*aRIt), false);
+ aDisplayer->activateInLocalContext((*aRIt), aModes, false);
+ }
+ aDisplayer->display(aSPFeature, false);
}
aDisplayer->updateViewer();
}
#include <ModelAPI_Data.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_Events.h>
#include <GeomAlgoAPI_FaceBuilder.h>
#include <GeomDataAPI_Point.h>
#include <GeomAPI_XYZ.h>
#include <ModuleBase_ViewerPrs.h>
+#include <Events_Loop.h>
#include <AIS_Shape.hxx>
#include <AIS_ListOfInteractive.hxx>
PartSet_OperationSketchBase::stopOperation();
emit featureConstructed(feature(), FM_Hide);
emit closeLocalContext();
+
+ FeaturePtr aFeature = feature();
+ std::list<ResultPtr> aResults = aFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
+ ModelAPI_EventCreator::get()->sendUpdated(*aIt,
+ Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ }
+ //ModelAPI_EventCreator::get()->sendUpdated(aFeature,
+ // Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
}
bool PartSet_OperationSketch::isNestedOperationsEnabled() const
if (anObject) {
Handle(AIS_InteractiveObject) anAIS = anObject->impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- aContext->Erase(anAIS, isUpdateViewer);
+ aContext->Remove(anAIS, isUpdateViewer);
}
}
myResult2AISObjectMap.erase(theObject);
if (!anObj) continue;
Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
- aContext->Erase(anAIS, false);
+ aContext->Remove(anAIS, false);
aRemoved.push_back(aFeature);
}
}