]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0021719: EDF 1654 : Materials
authorana <ana@opencascade.com>
Fri, 28 Dec 2012 15:51:47 +0000 (15:51 +0000)
committerana <ana@opencascade.com>
Fri, 28 Dec 2012 15:51:47 +0000 (15:51 +0000)
src/SVTK/SVTK_View.cxx
src/SVTK/SVTK_View.h
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h

index 03a9070fef207b3991dc4ada76c3cb8ff6b5a4f5..5f52ea604d4b424f7fb8c446b32c68e36c3f9498 100644 (file)
@@ -746,39 +746,60 @@ 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*> >
                           (&SALOME_Actor::SetMaterial,aProps));
 }
 
-/*!
-  Get current front material
-  \param theIObject - object
-  \return property contained material properties of the given object
-*/
-vtkProperty* 
-SVTK_View
-::GetMaterial(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->GetMaterial();
+/*!\r
+  Get current front material\r
+  \param theIObject - object\r
+  \return property contained front material properties of the given object\r
+*/\r
+vtkProperty* \r
+SVTK_View\r
+::GetFrontMaterial(const Handle(SALOME_InteractiveObject)& theIObject)\r
+{\r
+  using namespace SVTK;\r
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());\r
+  SALOME_Actor* anActor = \r
+    Find<SALOME_Actor>(aCopy.GetActors(),\r
+                       TIsSameIObject<SALOME_Actor>(theIObject));\r
+  if(anActor)\r
+    return anActor->GetFrontMaterial();\r
+  return NULL;\r
+}\r
+\r
+/*!\r
+  Get current back material\r
+  \param theIObject - object\r
+  \return property contained back material properties of the given object\r
+*/\r
+vtkProperty* \r
+SVTK_View\r
+::GetBackMaterial(const Handle(SALOME_InteractiveObject)& theIObject)\r
+{\r
+  using namespace SVTK;\r
+  VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors());\r
+  SALOME_Actor* anActor = \r
+    Find<SALOME_Actor>(aCopy.GetActors(),\r
+                       TIsSameIObject<SALOME_Actor>(theIObject));\r
+  if(anActor)\r
+    return anActor->GetBackMaterial();
   return NULL;
 }
 
index 0542c24f9fa231426ae3ef84847a6848d81c4656..1ad3037df85df506c7419e29adfffe7078514178 100644 (file)
@@ -212,11 +212,15 @@ 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 624ed1deb6c8b95429868396a59d6dfd0d76059d..fc8eda9a24e9b969a88d985043190dbd70f2bb7b 100755 (executable)
@@ -621,13 +621,23 @@ VTKViewer_Actor
 }
 
 /*!
-  Get current material
-*/
-vtkProperty* 
-VTKViewer_Actor
-::GetMaterial()
-{
-  return NULL;
+  Get current front material\r
+*/\r
+vtkProperty* \r
+VTKViewer_Actor\r
+::GetFrontMaterial()\r
+{\r
+  return NULL;\r
+}\r
+\r
+/*!\r
+  Get current back material\r
+*/\r
+vtkProperty* \r
+VTKViewer_Actor\r
+::GetBackMaterial()\r
+{\r
+  return NULL;\r
 }
 
 /*!
index 5a385e56c0b460d6fef2931fbf6457134bd68b0f..5225cd6b4df8317ed9374f103d02b5a6fd4a374f 100755 (executable)
@@ -119,15 +119,20 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   void
   SetColor(const vtkFloatingPointType theRGB[3]);
 
-  //! Change material
-  virtual
-  void
+  //! Change material\r
+  virtual\r
+  void\r
   SetMaterial(std::vector<vtkProperty*> theProps);
 
-  //! Get current material
-  virtual
-  vtkProperty* 
-  GetMaterial();
+  //! Get current front material\r
+  virtual\r
+  vtkProperty* \r
+  GetFrontMaterial();\r
+\r
+  //! Get current back material\r
+  virtual\r
+  vtkProperty* \r
+  GetBackMaterial();
 
   //----------------------------------------------------------------------------
   // For selection mapping purpose