]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Mantis issue 0020435: EDF 909 GEOM : Show Only Selected.
authorjfa <jfa@opencascade.com>
Wed, 18 Nov 2009 09:55:07 +0000 (09:55 +0000)
committerjfa <jfa@opencascade.com>
Wed, 18 Nov 2009 09:55:07 +0000 (09:55 +0000)
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_Displayer.h

index f8aaa621b82a81d5ae10cc3cb3e84145ff562a34..3a56162c04ff9d5c6e95cf8bce0ec09be338db7e 100644 (file)
@@ -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
index 90b551fc3a395a0045d13b26672862d522d750aa..8b11fe66f09c89fb52f426db098ed2da34ab53cd 100644 (file)
@@ -155,9 +155,14 @@ public:
 
   static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
 
+  /* 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 */