From d9af84f3ba67333e0e3d1d34e436ddb8ea6b3be5 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 2 Jun 2016 08:54:05 +0300 Subject: [PATCH] Issue #1535 crash when mirror: debug information --- src/ModuleBase/ModuleBase_ModelWidget.cpp | 28 +++ src/ModuleBase/ModuleBase_ModelWidget.h | 4 +- .../ModuleBase_OperationFeature.cpp | 27 +++ src/ModuleBase/ModuleBase_Tools.cpp | 202 ++++++++++++++++++ src/ModuleBase/ModuleBase_Tools.h | 8 + src/PartSet/PartSet_OperationPrs.cpp | 19 +- src/PartSet/PartSet_SketcherMgr.cpp | 2 + src/XGUI/XGUI_Displayer.cpp | 14 +- src/XGUI/XGUI_SelectionMgr.cpp | 2 + 9 files changed, 301 insertions(+), 5 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 01bb7f33e..d82016eac 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -26,6 +26,8 @@ //#define DEBUG_VALUE_STATE +//#define DEBUG_WIDGET_INSTANCE + ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData) : QWidget(theParent), @@ -35,6 +37,10 @@ ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, myFlushUpdateBlocked(false), myWidgetValidator(0) { +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::ModuleBase_ModelWidget"); +#endif + myIsInternal = theData->getBooleanAttribute(ATTR_INTERNAL, false); myDefaultValue = theData->getProperty(ATTR_DEFAULT); @@ -47,6 +53,13 @@ ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, connect(this, SIGNAL(valuesModified()), this, SLOT(onWidgetValuesModified())); } +ModuleBase_ModelWidget::~ModuleBase_ModelWidget() +{ +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::~ModuleBase_ModelWidget"); +#endif +} + bool ModuleBase_ModelWidget::reset() { bool aResult = resetCustom(); @@ -159,6 +172,9 @@ void ModuleBase_ModelWidget::setFeature(const FeaturePtr& theFeature, const bool bool ModuleBase_ModelWidget::focusTo() { +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::focusTo"); +#endif QList aControls = getControls(); QList::const_iterator anIt = aControls.begin(), aLast = aControls.end(); bool isFocusAccepted = false; @@ -174,6 +190,9 @@ bool ModuleBase_ModelWidget::focusTo() void ModuleBase_ModelWidget::activate() { +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::activate"); +#endif // the control value is stored to the mode by the focus in on the widget // we need the value is initialized in order to enable the apply button in the property panel. // It should happens in the creation mode only because all fields are filled in the edition mode @@ -191,6 +210,9 @@ void ModuleBase_ModelWidget::activate() void ModuleBase_ModelWidget::deactivate() { +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::deactivate"); +#endif myIsValueStateBlocked = false; myState = Stored; if (myWidgetValidator) @@ -297,6 +319,9 @@ bool ModuleBase_ModelWidget::restoreValue() void ModuleBase_ModelWidget::updateObject(ObjectPtr theObject) { if (!myFlushUpdateBlocked) { +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::updateObject"); +#endif ModuleBase_Tools::flushUpdated(theObject); emit objectUpdated(); } @@ -305,6 +330,9 @@ void ModuleBase_ModelWidget::updateObject(ObjectPtr theObject) void ModuleBase_ModelWidget::moveObject(ObjectPtr theObj) { //blockUpdateViewer(true); +#ifdef DEBUG_WIDGET_INSTANCE + qDebug("ModuleBase_ModelWidget::moveObject"); +#endif static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED); ModelAPI_EventCreator::get()->sendUpdated(theObj, anEvent); diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index c21ef7e8a..b8417dd6e 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -46,9 +46,7 @@ Q_OBJECT /// a low-level API for reading xml definitions of widgets ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData); /// Destructor - virtual ~ModuleBase_ModelWidget() - { - } + virtual ~ModuleBase_ModelWidget(); /// Fills the widget with default values. It calls the resetCustom method and change /// the widget state to Reset if the reset is performed. diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index 8194f09bb..79d72de89 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -42,6 +42,8 @@ #include #endif +//#define DEBUG_OPERATION_START + #ifdef _DEBUG #include #endif @@ -231,6 +233,9 @@ bool ModuleBase_OperationFeature::isDisplayedOnStart(ObjectPtr theObject) bool ModuleBase_OperationFeature::start() { +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::start -- begin"); +#endif setIsModified(false); QString anId = getDescription()->operationId(); if (myIsEditing) { @@ -249,16 +254,26 @@ bool ModuleBase_OperationFeature::start() // in order to update commands status in the workshop, to be exact the feature action // to be unchecked abort(); +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::start -- end : IMPOSSIBLE to start"); +#endif return false; } } //Already called startOperation(); emit started(); +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::start -- end"); +#endif return true; } void ModuleBase_OperationFeature::abort() { +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::abort -- begin"); +#endif + emit beforeAborted(); // the viewer update should be blocked in order to avoid the features blinking before they are @@ -293,10 +308,16 @@ void ModuleBase_OperationFeature::abort() Events_Loop::loop()->send(aMsg); emit aborted(); +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::abort -- end"); +#endif } bool ModuleBase_OperationFeature::commit() { +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::commit -- begin"); +#endif ModuleBase_IPropertyPanel* aPanel = propertyPanel(); if (aPanel) { ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget(); @@ -328,8 +349,14 @@ bool ModuleBase_OperationFeature::commit() emit committed(); afterCommitOperation(); +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::commit -- end : IMPOSSIBLE to commit"); +#endif return true; } +#ifdef DEBUG_OPERATION_START + qDebug("ModuleBase_OperationFeature::commit -- end"); +#endif return false; } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 043709e8f..012ebb0b5 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -56,6 +56,23 @@ const double tolerance = 1e-7; //#define DEBUG_ACTIVATE_WINDOW //#define DEBUG_SET_FOCUS +//#define DEBUG_SELECTION_INFO + +#ifdef DEBUG_SELECTION_INFO +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif namespace ModuleBase_Tools { @@ -301,6 +318,191 @@ QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo) return aFeatureStr; } +#ifdef DEBUG_SELECTION_INFO +QString getShapeTypeInfo(const int theType) +{ + QString anInfo = "Undefined"; + switch(theType) { + case TopAbs_COMPOUND: anInfo = "compound"; break; + case TopAbs_COMPSOLID: anInfo = "compsolid"; break; + case TopAbs_SOLID: anInfo = "solid"; break; + case TopAbs_SHELL: anInfo = "shell"; break; + case TopAbs_FACE: anInfo = "face"; break; + case TopAbs_WIRE: anInfo = "wire"; break; + case TopAbs_EDGE: anInfo = "edge"; break; + case TopAbs_VERTEX: anInfo = "vertex"; break; + case TopAbs_SHAPE: anInfo = "shape"; break; + default: break; + } + return anInfo; +} + +QString getModeInfo(const int theMode) +{ + QString anInfo = "Undefined"; + switch(theMode) { + case 0: anInfo = "SHAPE(0)"; break; + case 1: anInfo = "VERTEX(1)"; break; + case 2: anInfo = "EDGE(2)"; break; + case 3: anInfo = "WIRE(3)"; break; + case 4: anInfo = "FACE(4)"; break; + case 5: anInfo = "SHELL(5)"; break; + case 6: anInfo = "SOLID(6)"; break; + case 7: anInfo = "COMPSOLID(7)"; break; + case 8: anInfo = "COMPOUND(8)"; break; + case 100: anInfo = "Sel_Mode_First(100)"; break; //SketcherPrs_Tools + case 101: anInfo = "Sel_Constraint(101)"; break; + case 102: anInfo = "Sel_Dimension_All(102)"; break; + case 103: anInfo = "Sel_Dimension_Line(103)"; break; + case 104: anInfo = "Sel_Dimension_Text(104)"; break; + default: break; + } + return anInfo; +} + +QString displayedInteractiveObjects(Handle(AIS_InteractiveContext)& theContext, + const bool theShapeInfoOnly = true) +{ + if (theContext.IsNull()) + return ""; + AIS_ListOfInteractive aListOfIO; + theContext->DisplayedObjects(aListOfIO, false); + QStringList anObjects; + AIS_ListIteratorOfListOfInteractive aIt; + for (aIt.Initialize(aListOfIO); aIt.More(); aIt.Next()) { + Handle(AIS_InteractiveObject) anAISIO = aIt.Value(); + Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISIO); + if (theShapeInfoOnly && aShapePrs.IsNull()) + continue; + + QString anInfo = "IO"; + std::ostringstream aPtrStr; + aPtrStr << "[" << anAISIO.Access() << "]"; + anInfo += aPtrStr.str().c_str(); + + if (!aShapePrs.IsNull()) { + const TopoDS_Shape& aShape = aShapePrs->Shape(); + if (aShape.IsNull()) + Events_Error::throwException("An empty AIS presentation"); + else + anInfo += QString(", shape type: %1").arg(getShapeTypeInfo(aShape.ShapeType())); + } + TColStd_ListOfInteger aTColModes; + theContext->ActivatedModes(anAISIO, aTColModes); + TColStd_ListIteratorOfListOfInteger itr( aTColModes ); + QIntList aModesActivatedForIO; + bool isDeactivated = false; + QStringList aModes; + for (; itr.More(); itr.Next() ) { + Standard_Integer aMode = itr.Value(); + aModes.append(getModeInfo(aMode)); + //int aShapeMode = (aMode > 8)? aMode : AIS_Shape::SelectionType(aMode); + } + if (aModes.size() > 0) + anInfo += QString(", activated modes: %1").arg(aModes.join(", ")); + + anObjects += anInfo; + } + QString aValue = QString("displayedIO[%1]").arg(anObjects.size()); + if (anObjects.size() > 0) + aValue += QString(":\n %1").arg(anObjects.join("\n ")); + return aValue; +} + +QString activeOwners(Handle(AIS_InteractiveContext)& theContext, const bool theShapeInfoOnly = true) +{ + if (theContext.IsNull()) + return ""; + Handle(AIS_LocalContext) aLContext = theContext->LocalContext(); + TCollection_AsciiString aSelectionName = aLContext->SelectionName(); + aLContext->UnhilightPicked(Standard_False); + + NCollection_List anActiveOwners; + aLContext->MainSelector()->ActiveOwners(anActiveOwners); + NCollection_List::Iterator anOwnersIt (anActiveOwners); + Handle(SelectMgr_EntityOwner) anOwner; + QStringList anObjects; + for (; anOwnersIt.More(); anOwnersIt.Next()) { + anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); + Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner); + if (theShapeInfoOnly && BROwnr.IsNull()) + continue; + + QString anInfo = "Owner"; + std::ostringstream aPtrStr; + aPtrStr << "[" << anOwner.Access() << "]"; + anInfo += aPtrStr.str().c_str(); + + Handle(AIS_InteractiveObject) aAISObj = + Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); + if (!aAISObj.IsNull()) { + std::ostringstream aPtrStr; + aPtrStr << "[" << aAISObj.Access() << "]"; + anInfo += QString(", selectable(IO): %1").arg(aPtrStr.str().c_str()); + } + + if (!BROwnr.IsNull() && BROwnr->HasShape()) { + const TopoDS_Shape& aShape = BROwnr->Shape(); + if (aShape.IsNull()) + Events_Error::throwException("An empty AIS presentation"); + else + anInfo += QString(", shape type: %1").arg(getShapeTypeInfo(aShape.ShapeType())); + } + anObjects += anInfo; + } + QString aValue = QString("activeOwners[%1]").arg(anObjects.size()); + if (anObjects.size() > 0) + aValue += QString(":\n %1").arg(anObjects.join("\n ")); + return aValue; +} + +QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, const bool theShapeInfoOnly = true) +{ + QStringList anObjects; + if (theContext.IsNull()) + return ""; + + QList aSelectedIds; // Remember of selected address in order to avoid duplicates + for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected()) { + Handle(SelectMgr_EntityOwner) anOwner = theContext->SelectedOwner(); + Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner); + if (theShapeInfoOnly && BROwnr.IsNull()) + continue; + + if (aSelectedIds.contains((long)anOwner.Access())) + continue; + aSelectedIds.append((long)anOwner.Access()); + + QString anInfo = "Owner"; + std::ostringstream aPtrStr; + aPtrStr << "[" << anOwner.Access() << "]"; + anInfo += aPtrStr.str().c_str(); + + if (!BROwnr.IsNull() && BROwnr->HasShape()) { + const TopoDS_Shape& aShape = BROwnr->Shape(); + anInfo += QString(", shape type = %1").arg(getShapeTypeInfo(aShape.ShapeType())); + } + anObjects += anInfo; + } + QString aValue = QString("selectedOwners[%1]").arg(anObjects.size()); + if (anObjects.size() > 0) + aValue += QString(":\n %1").arg(anObjects.join("\n ")); + return aValue; +} +#endif + +void selectionInfo(Handle(AIS_InteractiveContext)& theContext, const std::string& thePrefix) +{ +#ifdef DEBUG_SELECTION_INFO + QString aValue = QString("\n\n\nDEBUG_SELECTION_INFO for '%1'\n%2\n%3\n%4") + .arg(thePrefix.c_str()) + .arg(displayedInteractiveObjects(theContext)) + .arg(activeOwners(theContext)) + .arg(selectedOwners(theContext)); + qDebug(aValue.toStdString().c_str()); +#endif +} + typedef QMap ShapeTypes; static ShapeTypes myShapeTypes; diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index b50ec66a1..cdc4121b1 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -24,6 +24,8 @@ #include +class Handle_AIS_InteractiveContext; + class QWidget; class QLayout; class QDoubleSpinBox; @@ -140,6 +142,12 @@ MODULEBASE_EXPORT QAction* createAction(const QIcon& theIcon, const QString& the /// \return a string MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo = false); +/// Converts the AIS context information in a string information. +/// \param theContext a viewer context +/// \param thePrefix additional information where the method is called +MODULEBASE_EXPORT void selectionInfo(Handle_AIS_InteractiveContext& theContext, + const std::string& thePrefix); + /// Converts string value (name of shape type) to shape enum value /// \param theType - string with shape type name /// \return TopAbs_ShapeEnum value diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 7102e16c0..3ede14b4d 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -42,8 +42,11 @@ #include #include #include +#include +#include //#define DEBUG_EMPTY_SHAPE +#define DEBUG_OPERATION_PRS // multi-rotation/translation operation //#define DEBUG_HIDE_COPY_ATTRIBUTE @@ -58,6 +61,9 @@ IMPLEMENT_STANDARD_RTTIEXT(PartSet_OperationPrs, ViewerData_AISShape); PartSet_OperationPrs::PartSet_OperationPrs(ModuleBase_IWorkshop* theWorkshop) : ViewerData_AISShape(TopoDS_Shape()), myWorkshop(theWorkshop), myUseAISWidth(false) { +#ifdef DEBUG_OPERATION_PRS + qDebug("PartSet_OperationPrs::PartSet_OperationPrs"); +#endif myShapeColor = Quantity_Color(1, 1, 1, Quantity_TOC_RGB); // first presentation for having correct Compute until presentation with shapes are set @@ -86,6 +92,10 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { +#ifdef DEBUG_OPERATION_PRS + qDebug("PartSet_OperationPrs::Compute -- begin"); +#endif + SetColor(myShapeColor); thePresentation->Clear(); bool aReadyToDisplay = !myShapeToPrsMap.IsEmpty(); @@ -93,9 +103,13 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(myWorkshop)->displayer(); Handle(Prs3d_Drawer) aDrawer = Attributes(); // create presentations on the base of the shapes + BRep_Builder aBuilder; + TopoDS_Compound aComp; + aBuilder.MakeCompound(aComp); for(NCollection_DataMap::Iterator anIter(myShapeToPrsMap); anIter.More(); anIter.Next()) { const TopoDS_Shape& aShape = anIter.Key(); + aBuilder.Add(aComp, aShape); // change deviation coefficient to provide more precise circle ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer); @@ -113,13 +127,16 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t } StdPrs_WFDeflectionShape::Add(thePresentation, aShape, aDrawer); } - + Set(aComp); if (!aReadyToDisplay) { Events_Error::throwException("An empty AIS presentation: PartSet_OperationPrs"); std::shared_ptr aMsg = std::shared_ptr( new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION))); Events_Loop::loop()->send(aMsg); } +#ifdef DEBUG_OPERATION_PRS + qDebug("PartSet_OperationPrs::Compute -- end"); +#endif } void PartSet_OperationPrs::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 1a07384b7..49b111759 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -386,6 +387,7 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE if (!aContext.IsNull()) { // MoveTo in order to highlight current object aContext->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView()); + ModuleBase_Tools::selectionInfo(aContext, "PartSet_SketcherMgr::onMousePressed -- MoveTo"); } // Remember highlighted objects for editing ModuleBase_ISelection* aSelect = aWorkshop->selection(); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 2b3b043e4..95d589966 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -260,6 +260,7 @@ bool XGUI_Displayer::erase(ObjectPtr theObject, const bool theUpdateViewer) if (!anAIS.IsNull()) { emit beforeObjectErase(theObject, anObject); aContext->Remove(anAIS, false/*update viewer*/); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::erase -- Remove"); aErased = true; } } @@ -346,6 +347,8 @@ bool XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) aContext->Deactivate(aAISIO, 0); #endif + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::redisplay -- Redisplay"); + if (aNeedToRestoreSelection) myWorkshop->module()->restoreSelection(); @@ -390,6 +393,7 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) deactivateAIS(anAIS); // the selection from the previous activation modes should be cleared manually (#26172) aContext->LocalContext()->ClearOutdatedSelection(anAIS, true); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivate -- ClearOutdatedSelection"); if (theUpdateViewer) updateViewer(); } @@ -631,7 +635,7 @@ void XGUI_Displayer::setSelected(const QList& theValue } if (!aShapesToBeSelected.IsEmpty()) XGUI_Displayer::AddOrRemoveSelectedShapes(aContext, aShapesToBeSelected); - } else { + } else { // it seems the next code is obsolete as the context is always opened in SHAPER aContext->UnhilightCurrents(false); aContext->ClearCurrents(false); foreach (ModuleBase_ViewerPrsPtr aPrs, theValues) { @@ -645,6 +649,7 @@ void XGUI_Displayer::setSelected(const QList& theValue } } } + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::setSelected -- AddOrRemoveSelected/UnhilightCurrents(no local context)"); if (theUpdateViewer) updateViewer(); } @@ -676,6 +681,7 @@ bool XGUI_Displayer::eraseAll(const bool theUpdateViewer) if (theUpdateViewer) updateViewer(); } + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::eraseAll -- Remove"); myResult2AISObjectMap.clear(); #ifdef DEBUG_DISPLAY qDebug("eraseAll"); @@ -690,6 +696,7 @@ void deactivateObject(Handle(AIS_InteractiveContext) theContext, { if (!theObject.IsNull()) { theContext->Deactivate(theObject); + ModuleBase_Tools::selectionInfo(theContext, "XGUI_Displayer::deactivateObject -- Deactivate"); //if (theClear) { //theObject->ClearSelected(); // theContext->LocalContext()->ClearOutdatedSelection(theObject, true); @@ -891,6 +898,8 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, } else aContext->Activate(theIO, theMode, false); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activateAIS -- Activate"); + #ifdef DEBUG_ACTIVATE_AIS ObjectPtr anObject = getObject(theIO); anInfo.append(ModuleBase_Tools::objectInfo((*anIt))); @@ -909,6 +918,7 @@ void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, c aContext->Deactivate(theIO); else aContext->Deactivate(theIO, theMode); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivateAIS -- Deactivate"); #ifdef DEBUG_DEACTIVATE_AIS ObjectPtr anObject = getObject(theIO); @@ -977,6 +987,7 @@ bool XGUI_Displayer::eraseAIS(AISObjectPtr theAIS, const bool theUpdateViewer) Handle(AIS_InteractiveObject) anAISIO = theAIS->impl(); if (!anAISIO.IsNull() && aContext->IsDisplayed(anAISIO)) { aContext->Remove(anAISIO, false/*update viewer*/); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::eraseAIS -- Remove"); aErased = true; } } @@ -1171,6 +1182,7 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, // the selection from the previous activation modes should be cleared manually (#26172) theIO->ClearSelected(); aContext->LocalContext()->ClearOutdatedSelection(theIO, true); + ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activate -- ClearSelected/ClearOutdatedSelection"); // For performance issues //if (theUpdateViewer) // updateViewer(); diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index 8bc012412..0d9b701f6 100755 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -22,6 +22,7 @@ #include #include +#include #include @@ -64,6 +65,7 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the aContext->AddOrRemoveSelected(anOwner, isUpdateViewer); } } + ModuleBase_Tools::selectionInfo(aContext, "XGUI_SelectionMgr::setSelectedOwners -- AddOrRemoveSelected"); } //************************************************************** -- 2.30.2