From: nds Date: Fri, 10 Apr 2015 09:30:42 +0000 (+0300) Subject: Debug information to check selection filters set in the displayer X-Git-Tag: V_1.1.0~51^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dc3e2c45eb68a8309ba7762d5dffe50486dbfdcd;p=modules%2Fshaper.git Debug information to check selection filters set in the displayer --- diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 9914826ef..d920f4630 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -45,6 +45,8 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse //#define DEBUG_DISPLAY //#define DEBUG_ACTIVATE +//#define DEBUG_FEATURE_REDISPLAY +#define DEBUG_SELECTION_FILTERS // Workaround for bug #25637 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList) @@ -248,8 +250,15 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer) } // Customization of presentation bool isCustomized = customizeObject(theObject); + #ifdef DEBUG_FEATURE_REDISPLAY + qDebug(QString("Redisplay: %1, isEqualShapes=%2, isCustomized=%3"). + arg(!isEqualShapes || isCustomized).arg(isEqualShapes).arg(isCustomized).toStdString().c_str()); + #endif if (!isEqualShapes || isCustomized) { aContext->Redisplay(aAISIO, false); + #ifdef DEBUG_FEATURE_REDISPLAY + //qDebug(" Redisplay happens"); + #endif if (isUpdateViewer) updateViewer(); } @@ -699,6 +708,10 @@ void XGUI_Displayer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilte return; } GetFilter()->Add(theFilter); +#ifdef DEBUG_SELECTION_FILTERS + int aCount = GetFilter()->StoredFilters().Extent(); + qDebug(QString("addSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str()); +#endif } void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter) @@ -709,6 +722,10 @@ void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFi Handle(SelectMgr_AndFilter) aCompositeFilter = GetFilter(); if (aCompositeFilter->IsIn(theFilter)) aCompositeFilter->Remove(theFilter); +#ifdef DEBUG_SELECTION_FILTERS + int aCount = GetFilter()->StoredFilters().Extent(); + qDebug(QString("removeSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str()); +#endif } void XGUI_Displayer::removeFilters() diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index bd07090f4..b2860a240 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -72,6 +72,12 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \param isUpdate the parameter whether the viewer should be update immediatelly void displayAIS(AISObjectPtr theAIS, bool isUpdate = true); + /** Redisplay the shape if it was displayed + * \param theObject an object instance + * \param isUpdateViewer the parameter whether the viewer should be update immediatelly + */ + void redisplay(ObjectPtr theObject, bool isUpdateViewer = true); + /** * Add presentations which corresponds to the given features to current selection * \param theFeatures a list of features to be selected @@ -225,12 +231,6 @@ signals: /// \return true if the object is succesfully displayed void display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading, bool isUpdateViewer = true); -public: - /** Redisplay the shape if it was displayed - * \param theObject an object instance - * \param isUpdateViewer the parameter whether the viewer should be update immediatelly - */ - void redisplay(ObjectPtr theObject, bool isUpdateViewer = true); private: /// Activates the interactive object in the local context.