From 0623aa4a9f5db575fe167fe7a8033df24393e909 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 18 Nov 2009 09:55:07 +0000 Subject: [PATCH] Mantis issue 0020435: EDF 909 GEOM : Show Only Selected. --- src/GEOMGUI/GEOM_Displayer.cxx | 38 ++++++++++++++++++++++++++++++++++ src/GEOMGUI/GEOM_Displayer.h | 7 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index f8aaa621b..3a56162c0 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -991,6 +991,44 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry, return prs; } +//================================================================= +/*! + * GEOM_Displayer::buildSubshapePresentation + * Builds/finds object's presentation for the current viewer + * Calls corresponding Update() method by means of double dispatch + * For not published objects (for Mantis issue 0020435) + */ +//================================================================= +SALOME_Prs* GEOM_Displayer::buildSubshapePresentation(const TopoDS_Shape& aShape, + const QString& entry, + SALOME_View* theViewFrame) +{ + SALOME_Prs* prs = 0; + internalReset(); + + myViewFrame = theViewFrame ? theViewFrame : GetActiveView(); + + if (myViewFrame) + { + prs = LightApp_Displayer::buildPresentation(entry, theViewFrame); + if (prs) + { + Handle(SALOME_InteractiveObject) theIO = new SALOME_InteractiveObject(); + theIO->setEntry(entry.toLatin1().constData()); + if (!theIO.IsNull()) + { + // set interactive object + setIO(theIO); + // finally set shape + setShape(aShape); + myType = GEOM_SUBSHAPE; + } + UpdatePrs(prs); // Update presentation by using of the double dispatch + } + } + return prs; +} + //================================================================= /*! * GEOM_Displayer::internalReset diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 90b551fc3..8b11fe66f 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -155,9 +155,14 @@ public: static SALOMEDS::Color getUniqueColor( const QList& ); + /* Builds presentation of not published object */ + virtual SALOME_Prs* buildSubshapePresentation(const TopoDS_Shape& aShape, + const QString&, + SALOME_View* = 0); + protected: /* internal methods */ - /* Builds presentation accordint to the current viewer type */ + /* Builds presentation according to the current viewer type */ virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); /* Sets interactive object */ -- 2.39.2