From: nds Date: Fri, 31 Jul 2015 12:39:56 +0000 (+0300) Subject: Compsolid: define to do not visualize compsolid itself, to visualize subobjects only. X-Git-Tag: V_1.4.0_beta4~438 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=033114ec508716ce71196d4d2018a5a818706d39;p=modules%2Fshaper.git Compsolid: define to do not visualize compsolid itself, to visualize subobjects only. --- 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)