static const char * EVENT_UPDATE_VIEWER_BLOCKED = "UpdateViewerBlocked";
static const char * EVENT_UPDATE_VIEWER_UNBLOCKED = "UpdateViewerUnblocked";
+static const char * EVENT_EMPTY_AIS_PRESENTATION = "EmptyAISPresentation";
+static const char * EVENT_EMPTY_OPERATION_PRESENTATION = "EmptyOperationPresentation";
+
static const char * EVENT_PREVIEW_BLOCKED = "PreviewBlocked";
static const char * EVENT_PREVIEW_REQUESTED = "PreviewRequested";
#include "ModuleBase_ResultPrs.h"
#include "ModuleBase_Tools.h"
+#include <ModelAPI_Events.h>
#include <ModelAPI_Tools.h>
#include <ModelAPI_ResultConstruction.h>
#include <GeomAPI_PlanarEdges.h>
#include <Events_Error.h>
+#include <Events_Loop.h>
#include <BRep_Builder.hxx>
#include <Prs3d_Drawer.hxx>
return aValid;
}
-
void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
{
std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
- if (!aShapePtr) {
- Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
- return;
- }
-
- myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
- if (!myOriginalShape.IsNull()) {
- Set(myOriginalShape);
-
- // change deviation coefficient to provide more precise circle
- ModuleBase_Tools::setDefaultDeviationCoefficient(myOriginalShape, Attributes());
- AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
+ if (aShapePtr.get()) {
+ myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
+ if (!myOriginalShape.IsNull())
+ Set(myOriginalShape);
}
- else
+ else {
Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
+ ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
+ }
+ // change deviation coefficient to provide more precise circle
+ ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes());
+ AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
}
void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
#include <ModuleBase_ModelWidget.h>
#include <ModuleBase_ViewerPrs.h>
+#include <ModelAPI_Events.h>
#include <ModelAPI_Result.h>
#include <ModelAPI_Attribute.h>
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_ResultCompSolid.h>
#include <Events_Error.h>
+#include <Events_Loop.h>
#include <GeomAPI_IPresentable.h>
SetColor(myShapeColor);
thePresentation->Clear();
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)> aShapeToPrsMap;
+ fillShapeList(myFeatureShapes, aShapeToPrsMap);
+
+ if (!aShapeToPrsMap.IsEmpty()) {
+ myShapeToPrsMap.Clear();
+ myShapeToPrsMap.Assign(aShapeToPrsMap);
+ }
XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(myWorkshop)->displayer();
Handle(Prs3d_Drawer) aDrawer = Attributes();
-
// create presentations on the base of the shapes
- bool anEmptyAIS = true;
- QMap<ObjectPtr, QList<GeomShapePtr> >::const_iterator anIt = myFeatureShapes.begin(),
- aLast = myFeatureShapes.end();
- for (; anIt != aLast; anIt++) {
- ObjectPtr anObject = anIt.key();
- QList<GeomShapePtr> aShapes = anIt.value();
- QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin(), aShLast = aShapes.end();
- for (; aShIt != aShLast; aShIt++) {
- GeomShapePtr aGeomShape = *aShIt;
- // the shape should not be checked here on empty value because it should be checked in
- // appendShapeIfVisible() on the step of filling myFeatureShapes list
- // the reason is to avoid empty AIS object visualized in the viewer
- //if (!aGeomShape.get()) continue;
- TopoDS_Shape aShape = aGeomShape.get() ? aGeomShape->impl<TopoDS_Shape>() : TopoDS_Shape();
- // change deviation coefficient to provide more precise circle
- ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer);
-
- if (myUseAISWidth) {
- AISObjectPtr anAISPtr = aDisplayer->getAISObject(anObject);
- if (anAISPtr.get()) {
- Handle(AIS_InteractiveObject) anIO = anAISPtr->impl<Handle(AIS_InteractiveObject)>();
- if (!anIO.IsNull()) {
- int aWidth = anIO->Width();
- /// workaround for zero width. Else, there will be a crash
- if (aWidth == 0) { // width returns of TSolid shape is zero
- bool isDisplayed = !anIO->GetContext().IsNull();
- aWidth = PartSet_Tools::getAISDefaultWidth();// default width value
- }
- setWidth(aDrawer, aWidth);
- }
+ for(NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>::Iterator anIter(myShapeToPrsMap);
+ anIter.More(); anIter.Next()) {
+ const TopoDS_Shape& aShape = anIter.Key();
+ // change deviation coefficient to provide more precise circle
+ ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer);
+
+ if (myUseAISWidth) {
+ Handle(AIS_InteractiveObject) anIO = anIter.Value();
+ if (!anIO.IsNull()) {
+ int aWidth = anIO->Width();
+ /// workaround for zero width. Else, there will be a crash
+ if (aWidth == 0) { // width returns of TSolid shape is zero
+ bool isDisplayed = !anIO->GetContext().IsNull();
+ aWidth = PartSet_Tools::getAISDefaultWidth();// default width value
}
+ setWidth(aDrawer, aWidth);
}
- StdPrs_WFDeflectionShape::Add(thePresentation, aShape, aDrawer);
- if (anEmptyAIS)
- anEmptyAIS = false;
}
+ StdPrs_WFDeflectionShape::Add(thePresentation, aShape, aDrawer);
}
- if (anEmptyAIS)
+
+ if (myShapeToPrsMap.IsEmpty()) {
Events_Error::throwException("An empty AIS presentation: PartSet_OperationPrs");
+
+ //std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
+ // new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION)));
+ //Events_Loop::loop()->send(aMsg);
+ }
}
void PartSet_OperationPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
anAttrType == ModelAPI_AttributeSelection::typeId() ||
anAttrType == ModelAPI_AttributeReference::typeId();
}
+
+void PartSet_OperationPrs::fillShapeList(const QMap<ObjectPtr, QList<GeomShapePtr> >& theFeatureShapes,
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& theShapeToPrsMap)
+{
+ theShapeToPrsMap.Clear();
+
+ XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(myWorkshop)->displayer();
+ Handle(Prs3d_Drawer) aDrawer = Attributes();
+
+ // create presentations on the base of the shapes
+ QMap<ObjectPtr, QList<GeomShapePtr> >::const_iterator anIt = myFeatureShapes.begin(),
+ aLast = myFeatureShapes.end();
+ for (; anIt != aLast; anIt++) {
+ ObjectPtr anObject = anIt.key();
+ QList<GeomShapePtr> aShapes = anIt.value();
+ QList<GeomShapePtr>::const_iterator aShIt = aShapes.begin(), aShLast = aShapes.end();
+ for (; aShIt != aShLast; aShIt++) {
+ GeomShapePtr aGeomShape = *aShIt;
+ // the shape should not be checked here on empty value because it should be checked in
+ // appendShapeIfVisible() on the step of filling myFeatureShapes list
+ // the reason is to avoid empty AIS object visualized in the viewer
+ //if (!aGeomShape.get()) continue;
+ TopoDS_Shape aShape = aGeomShape.get() ? aGeomShape->impl<TopoDS_Shape>() : TopoDS_Shape();
+ // change deviation coefficient to provide more precise circle
+ Handle(AIS_InteractiveObject) anIO;
+ if (myUseAISWidth) {
+ AISObjectPtr anAISPtr = aDisplayer->getAISObject(anObject);
+ if (anAISPtr.get())
+ anIO = anAISPtr->impl<Handle(AIS_InteractiveObject)>();
+ }
+ theShapeToPrsMap.Bind(aShape, anIO);
+ }
+ }
+}
#include <Standard_DefineHandle.hxx>
#include <Quantity_Color.hxx>
+#include <NCollection_List.hxx>
#include <QMap>
#include <QList>
GeomShapePtr theGeomShape,
QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes);
+ /// Fills the list of shapes by map of model objects
+ /// \param theFeatureShape a container to find shapes
+ /// \param theShapesMap an out container
+ void fillShapeList(const QMap<ObjectPtr, QList<GeomShapePtr> >& theFeatureShapes,
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& theShapeToPrsMap);
+
private:
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)> myShapeToPrsMap; /// list of visualized shapes
+
QMap<ObjectPtr, QList<GeomShapePtr> > myFeatureShapes; /// visualized shapes
ModuleBase_IWorkshop* myWorkshop; /// current workshop
#include "PartSet_Tools.h"
#include "ModuleBase_Tools.h"
+#include <ModelAPI_Events.h>
#include <ModelAPI_Tools.h>
#include <ModelAPI_ResultConstruction.h>
#include <GeomAPI_PlanarEdges.h>
#include <Events_Error.h>
+#include <Events_Loop.h>
#include <SketchPlugin_SketchEntity.h>
{
thePresentation->Clear();
- std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
- if (!aShapePtr) {
- Events_Error::throwException("An empty AIS presentation: PartSet_ResultSketchPrs");
- return;
- }
+ TopoDS_Shape aResultShape;
+ TopoDS_Compound anAuxiliaryCompound;
+ NCollection_List<TopoDS_Shape> aFaceList;
+ fillShapes(aResultShape, anAuxiliaryCompound, mySketchFaceList);
- setAuxiliaryPresentationStyle(false);
+ bool isEmptyPresentation = aResultShape.IsNull() && anAuxiliaryCompound.IsNull();
- myFacesList.clear();
- ResultConstructionPtr aConstruction =
- std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myResult);
- if (aConstruction.get()) {
- int aFacesNum = aConstruction->facesNum();
- for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) {
- myFacesList.push_back(aConstruction->face(aFaceIndex));
- }
+ if (!aResultShape.IsNull()) {
+ myOriginalShape = aResultShape;
+ if (!myOriginalShape.IsNull())
+ Set(myOriginalShape);
}
- myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
- if (!myOriginalShape.IsNull()) {
- Set(myOriginalShape);
- // change deviation coefficient to provide more precise circle
- ModuleBase_Tools::setDefaultDeviationCoefficient(myOriginalShape, Attributes());
- AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
- }
- else
- Events_Error::throwException("An empty AIS presentation: PartSet_ResultSketchPrs");
+ if (!anAuxiliaryCompound.IsNull())
+ myAuxiliaryCompound = anAuxiliaryCompound;
- // visualize auxiliary shapes and sketch construction elements(point, center of a circle)
- FeaturePtr aResultFeature = ModelAPI_Feature::feature(myResult);
- CompositeFeaturePtr aSketchFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>
- (aResultFeature);
- std::list<ResultPtr> anAuxiliaryResults;
- /// append auxiliary shapes
- for (int i = 0; i < aSketchFeature->numberOfSubs(); i++) {
- FeaturePtr aFeature = aSketchFeature->subFeature(i);
- if (PartSet_Tools::isAuxiliarySketchEntity(aFeature)) {
- std::list<ResultPtr> aResults = aFeature->results();
- std::list<ResultPtr>::const_iterator aIt;
- for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- ResultPtr aResult = *aIt;
- if (aResult.get() && aResult->shape().get())
- anAuxiliaryResults.push_back(aResult);
- }
- }
- else {
- /// append not-edges shapes, e.g. center of a circle, an arc, a point feature
- const std::list<std::shared_ptr<ModelAPI_Result> >& aRes = aFeature->results();
- std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aResIter = aRes.cbegin();
- for (; aResIter != aRes.cend(); aResIter++) {
- std::shared_ptr<ModelAPI_ResultConstruction> aConstr = std::dynamic_pointer_cast<
- ModelAPI_ResultConstruction>(*aResIter);
- if (aConstr) {
- std::shared_ptr<GeomAPI_Shape> aGeomShape = aConstr->shape();
- if (aGeomShape.get()) {
- const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
- if (aShape.ShapeType() != TopAbs_EDGE)
- anAuxiliaryResults.push_back(aConstr);
- }
- }
- }
- }
- }
+ setAuxiliaryPresentationStyle(false);
- if (anAuxiliaryResults.size() > 0) {
+ // change deviation coefficient to provide more precise circle
+ ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes());
+ AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
+
+ if (!myAuxiliaryCompound.IsNull()) {
setAuxiliaryPresentationStyle(true);
- BRep_Builder aBuilder;
- TopoDS_Compound aComp;
- aBuilder.MakeCompound(aComp);
- std::list<ResultPtr>::const_iterator anIt = anAuxiliaryResults.begin(),
- aLast = anAuxiliaryResults.end();
- for (; anIt != aLast; anIt++) {
- ResultPtr aResult = *anIt;
- if (aResult.get()) {
- GeomShapePtr aGeomShape = aResult->shape();
- if (aGeomShape.get()) {
- const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
- if (!aShape.IsNull())
- aBuilder.Add(aComp, aShape);
- }
- }
- }
- myAuxiliaryCompound = aComp;
Handle(Prs3d_Drawer) aDrawer = Attributes();
- StdPrs_WFDeflectionShape::Add(thePresentation, aComp, aDrawer);
+ StdPrs_WFDeflectionShape::Add(thePresentation, myAuxiliaryCompound, aDrawer);
+ }
+
+ if (isEmptyPresentation) {
+ Events_Error::throwException("An empty AIS presentation: PartSet_ResultSketchPrs");
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
+ ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
}
}
TopoDS_Compound aComp;
aBuilder.MakeCompound(aComp);
aBuilder.Add(aComp, myOriginalShape);
- std::list<std::shared_ptr<GeomAPI_Shape>>::const_iterator aIt;
- for (aIt = myFacesList.cbegin(); aIt != myFacesList.cend(); ++aIt) {
- TopoDS_Shape aFace = (*aIt)->impl<TopoDS_Shape>();
+
+ for(NCollection_List<TopoDS_Shape>::Iterator anIt(mySketchFaceList); anIt.More(); anIt.Next()) {
+ const TopoDS_Shape& aFace = anIt.Value();
aBuilder.Add(aComp, aFace);
// for sketch presentation in the face mode wires should be selectable also
// accoring to #1343 Improvement of Extrusion and Revolution operations
aLineAspect->SetTypeOfLine(aType);
}
}
+
+void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& theResultShape,
+ TopoDS_Compound& theAuxiliaryCompound,
+ NCollection_List<TopoDS_Shape>& theFaceList)
+{
+ //if (!aResultShape.IsNull() || !anAuxiliaryCompound.IsNull())
+ std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
+ if (!aShapePtr)
+ return;
+
+ theFaceList.Clear();
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myResult);
+ if (aConstruction.get()) {
+ int aFacesNum = aConstruction->facesNum();
+ for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) {
+ std::shared_ptr<GeomAPI_Face> aFaceShape = aConstruction->face(aFaceIndex);
+ if (aFaceShape.get()) {
+ TopoDS_Shape aFace = (aFaceShape)->impl<TopoDS_Shape>();
+ theFaceList.Append(aFace);
+ }
+ }
+ }
+ theResultShape = aShapePtr->impl<TopoDS_Shape>();
+
+ /// find auxiliary shapes
+ FeaturePtr aResultFeature = ModelAPI_Feature::feature(myResult);
+ CompositeFeaturePtr aSketchFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>
+ (aResultFeature);
+ std::list<ResultPtr> anAuxiliaryResults;
+ for (int i = 0; i < aSketchFeature->numberOfSubs(); i++) {
+ FeaturePtr aFeature = aSketchFeature->subFeature(i);
+ if (PartSet_Tools::isAuxiliarySketchEntity(aFeature)) {
+ std::list<ResultPtr> aResults = aFeature->results();
+ std::list<ResultPtr>::const_iterator aIt;
+ for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
+ ResultPtr aResult = *aIt;
+ if (aResult.get() && aResult->shape().get())
+ anAuxiliaryResults.push_back(aResult);
+ }
+ }
+ else {
+ /// append not-edges shapes, e.g. center of a circle, an arc, a point feature
+ const std::list<std::shared_ptr<ModelAPI_Result> >& aRes = aFeature->results();
+ std::list<std::shared_ptr<ModelAPI_Result> >::const_iterator aResIter = aRes.cbegin();
+ for (; aResIter != aRes.cend(); aResIter++) {
+ std::shared_ptr<ModelAPI_ResultConstruction> aConstr = std::dynamic_pointer_cast<
+ ModelAPI_ResultConstruction>(*aResIter);
+ if (aConstr) {
+ std::shared_ptr<GeomAPI_Shape> aGeomShape = aConstr->shape();
+ if (aGeomShape.get()) {
+ const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
+ if (aShape.ShapeType() != TopAbs_EDGE)
+ anAuxiliaryResults.push_back(aConstr);
+ }
+ }
+ }
+ }
+ }
+
+ if (anAuxiliaryResults.size() > 0) {
+ BRep_Builder aBuilder;
+ //TopoDS_Compound aComp;
+ aBuilder.MakeCompound(theAuxiliaryCompound);
+ std::list<ResultPtr>::const_iterator anIt = anAuxiliaryResults.begin(),
+ aLast = anAuxiliaryResults.end();
+ for (; anIt != aLast; anIt++) {
+ ResultPtr aResult = *anIt;
+ if (aResult.get()) {
+ GeomShapePtr aGeomShape = aResult->shape();
+ if (aGeomShape.get()) {
+ const TopoDS_Shape& aShape = aGeomShape->impl<TopoDS_Shape>();
+ if (!aShape.IsNull())
+ aBuilder.Add(theAuxiliaryCompound, aShape);
+ }
+ }
+ }
+ }
+}
/// \param isAuxiliary a boolean value if the properties are for auxiliary objects
void setAuxiliaryPresentationStyle(const bool isAuxiliary);
+ /// Fills the containers by the current result
+ /// \param theResultShape contains a shape of the result, it will be set as a Shape of AIS_Shape
+ /// \param theAuxiliaryCompound a compound of auxiliary shapes
+ /// \param theFaceList a list of face shapes
+ void PartSet_ResultSketchPrs::fillShapes(TopoDS_Shape& aResultShape,
+ TopoDS_Compound& theAuxiliaryCompound,
+ NCollection_List<TopoDS_Shape>& theFaceList);
+
/// Reference to result object
ResultPtr myResult;
TopoDS_Compound myAuxiliaryCompound;
/// List of faces
- std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
+ //std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
+ NCollection_List<TopoDS_Shape> mySketchFaceList;
};
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED));
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION));
}
//******************************************************
std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
onFeatureRedisplayMsg(aUpdMsg);
+ } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION)) {
+ std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
+ std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+ onFeatureEmptyPresentationMsg(aUpdMsg);
}
//Update property panel on corresponding message. If there is no current operation (no
//property panel), or received message has different feature to the current - do nothing.
bool isCustomized = customizeCurrentObject(anObjects, aRedisplayed);
if (aRedisplayed || isCustomized) {
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
+
//VSV FitAll updated viewer by it self
if (aFirstVisualizedBody)
myWorkshop->viewer()->fitAll();
aDisplayer->updateViewer();
}
}
+
//******************************************************
void XGUI_WorkshopListener::onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
{
//if (myObjectBrowser)
// myObjectBrowser->processEvent(theMsg);
if (aDisplayed) {
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
//VSV FitAll updated viewer by it self
if (aFirstVisualizedBody)
myWorkshop->viewer()->fitAll();
//}
}
+//******************************************************
+void XGUI_WorkshopListener::onFeatureEmptyPresentationMsg(
+ const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
+{
+ std::set<ObjectPtr> anObjects = theMsg->objects();
+ std::set<ObjectPtr>::const_iterator aIt;
+#ifdef DEBUG_FEATURE_CREATED
+ QStringList anInfo;
+ for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
+ anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
+ }
+ QString anInfoStr = anInfo.join(";\t");
+ qDebug(QString("onFeatureEmptyPresentationMsg: %1, %2").arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
+#endif
+
+ XGUI_Workshop* aWorkshop = workshop();
+ XGUI_Displayer* aDisplayer = aWorkshop->displayer();
+
+ bool aRedisplayed = false;
+ for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
+ ObjectPtr anObject = *aIt;
+ aRedisplayed = aDisplayer->erase(anObject, false) || aRedisplayed;
+ }
+
+ if (aRedisplayed)
+ aDisplayer->updateViewer();
+}
+
bool XGUI_WorkshopListener::event(QEvent * theEvent)
{
PostponeMessageQtEvent* aPostponedEv = dynamic_cast<PostponeMessageQtEvent*>(theEvent);
bool event(QEvent * theEvent);
/// Process feature update message
- void onFeatureUpdatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
+ /// \param theMsg a message with a container of objects
+ void onFeatureUpdatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
/// Process feature created message
- void onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
+ /// \param theMsg a message with a container of objects
+ void onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
/// Process feature redisplay message
- void onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
+ /// \param theMsg a message with a container of objects
+ void onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
+ void onFeatureEmptyPresentationMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
/// Displaus object and fit all viewer if the object is first (update viewer will not be called)
/// Asks the module whether the object can be displayed
/// \param theObj an object