]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix previous wrong-tag commit
authorana <ana@opencascade.com>
Mon, 16 Apr 2012 12:36:08 +0000 (12:36 +0000)
committerana <ana@opencascade.com>
Mon, 16 Apr 2012 12:36:08 +0000 (12:36 +0000)
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_View.h
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h

index 9702c2ebc73f02042c28b45a4d42bbf382c4afad..5db2c234926ee72122ddb7d9b05fe8ef918f0119 100644 (file)
@@ -746,17 +746,20 @@ SVTK_View
 /*!
   Change material
   \param theIObject - object
-  \param thePropF - property contained new properties of material
+  \param thePropF - property contained new properties of front material
+  \param thePropB - property contained new properties of back material
 */
 void
 SVTK_View
 ::SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
-             vtkProperty* thePropF)
+             vtkProperty* thePropF,
+             vtkProperty* thePropB)
 {
   using namespace SVTK;
   VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
   std::vector<vtkProperty*> aProps;
   aProps.push_back( thePropF );
+  aProps.push_back( thePropB );
   ForEachIf<SALOME_Actor>(aCopy.GetActors(),
                           TIsSameIObject<SALOME_Actor>(theIObject),
                           TSetFunction<SALOME_Actor,std::vector<vtkProperty*> >
@@ -766,11 +769,11 @@ SVTK_View
 /*!
   Get current front material
   \param theIObject - object
-  \return property contained material properties of the given object
+  \return property contained front material properties of the given object
 */
 vtkProperty* 
 SVTK_View
-::GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject)
+::GetFrontMaterial(const Handle(SALOME_InteractiveObject)& theIObject)
 {
   using namespace SVTK;
   VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
@@ -778,7 +781,26 @@ SVTK_View
     Find<SALOME_Actor>(aCopy.GetActors(),
                        TIsSameIObject<SALOME_Actor>(theIObject));
   if(anActor)
-    return anActor->GetMaterial();
+    return anActor->GetFrontMaterial();
+  return NULL;
+}
+
+/*!
+  Get current back material
+  \param theIObject - object
+  \return property contained back material properties of the given object
+*/
+vtkProperty* 
+SVTK_View
+::GetBackMaterial(const Handle(SALOME_InteractiveObject)& theIObject)
+{
+  using namespace SVTK;
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());
+  SALOME_Actor* anActor = 
+    Find<SALOME_Actor>(aCopy.GetActors(),
+                       TIsSameIObject<SALOME_Actor>(theIObject));
+  if(anActor)
+    return anActor->GetBackMaterial();
   return NULL;
 }
 
index fcceb6467229b10ce3a67dea4e0376fc6a7e7094..cff14c9229868963c7e8cb488ec675418e313792 100644 (file)
@@ -212,11 +212,16 @@ public:
   //! Change material
   void
   SetMaterial(const Handle(SALOME_InteractiveObject)& theIObject,
-             vtkProperty* thePropF);
+             vtkProperty* thePropF,
+             vtkProperty* thePropB);
 
-  //! Get current material
+  //! Get current front material
   vtkProperty* 
-  GetMaterial(const Handle(SALOME_InteractiveObject)& theIObject);
+  GetFrontMaterial(const Handle(SALOME_InteractiveObject)& theIObject);
+
+  //! Get current back material
+  vtkProperty* 
+  GetBackMaterial(const Handle(SALOME_InteractiveObject)& theIObject);
 
   //----------------------------------------------------------------------------
   // Erase Display functions
index 7f51412c0ffd109e3991feeb69551b8eb9c83bd7..fd54a793a656ba292d56b3844fc20b679ae66023 100755 (executable)
@@ -621,15 +621,26 @@ VTKViewer_Actor
 }
 
 /*!
-  Get current material
+  Get current front material
 */
 vtkProperty* 
 VTKViewer_Actor
-::GetMaterial()
+::GetFrontMaterial()
 {
   return NULL;
 }
 
+/*!
+  Get current back material
+*/
+vtkProperty* 
+VTKViewer_Actor
+::GetBackMaterial()
+{
+  return NULL;
+}
+
+
 /*!
   \return display mode
 */
index 7e8b0a0ef2a1f0414d69cb87203fd5b52aec62bc..8ab7dc82aab016d390477638bd960a2abe08bb03 100755 (executable)
@@ -124,10 +124,15 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   void
   SetMaterial(std::vector<vtkProperty*> theProps);
 
-  //! Get current material
+  //! Get current front material
   virtual
   vtkProperty* 
-  GetMaterial();
+  GetFrontMaterial();
+
+  //! Get current back material
+  virtual
+  vtkProperty* 
+  GetBackMaterial();
 
   //----------------------------------------------------------------------------
   // For selection mapping purpose