From 033114ec508716ce71196d4d2018a5a818706d39 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 31 Jul 2015 15:39:56 +0300 Subject: [PATCH] Compsolid: define to do not visualize compsolid itself, to visualize subobjects only. --- src/FeaturesPlugin/partition_widget.xml | 2 +- src/XGUI/XGUI_Displayer.cpp | 33 ++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/FeaturesPlugin/partition_widget.xml b/src/FeaturesPlugin/partition_widget.xml index 33e2c0174..10671d60d 100755 --- a/src/FeaturesPlugin/partition_widget.xml +++ b/src/FeaturesPlugin/partition_widget.xml @@ -14,7 +14,7 @@ diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index b76ded075..78ecbc641 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse //#define DEBUG_FEATURE_REDISPLAY //#define DEBUG_SELECTION_FILTERS +//#define DEBUG_COMPOSILID_DISPLAY // Workaround for bug #25637 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList) { @@ -109,7 +111,20 @@ bool XGUI_Displayer::isVisible(ObjectPtr theObject) const void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) { if (isVisible(theObject)) { - redisplay(theObject, theUpdateViewer); +#ifdef DEBUG_COMPOSILID_DISPLAY + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); + if (aCompsolidResult.get()) { + for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { + ResultPtr aSubResult = aCompsolidResult->subResult(i); + if (aSubResult.get()) + redisplay(aSubResult, false); + } + if (theUpdateViewer) + updateViewer(); + } + else +#endif + redisplay(theObject, theUpdateViewer); } else { AISObjectPtr anAIS; @@ -120,6 +135,19 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) } else { ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult.get() != NULL) { +#ifdef DEBUG_COMPOSILID_DISPLAY + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); + if (aCompsolidResult.get()) { + for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { + ResultPtr aSubResult = aCompsolidResult->subResult(i); + if (aSubResult.get()) + display(aSubResult, false); + } + if (theUpdateViewer) + updateViewer(); + } + else { +#endif std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (aShapePtr.get() != NULL) { anAIS = AISObjectPtr(new GeomAPI_AISObject()); @@ -127,6 +155,9 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) //anAIS->createShape(aShapePtr); isShading = true; } +#ifdef DEBUG_COMPOSILID_DISPLAY + } // close else +#endif } } if (anAIS) -- 2.39.2