Salome HOME
Debug information to check selection filters set in the displayer
authornds <natalia.donis@opencascade.com>
Fri, 10 Apr 2015 09:30:42 +0000 (12:30 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 10 Apr 2015 09:30:42 +0000 (12:30 +0300)
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h

index 9914826eff9967d9bdc3e3fad27e9955d47ed790..d920f4630516a99986b86978b39c80be5dbe03e5 100644 (file)
@@ -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()
index bd07090f4ba3112b30aa216099f20c4c268fc6ea..b2860a24069e7f77d7b5afccb2ce12a4643bc064 100644 (file)
@@ -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.