]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/OBJECT/GEOM_Actor.h
Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / OBJECT / GEOM_Actor.h
index 0b708e80b5699fcdde2c89eb76b3bf89f2cbe697..28df32d67c0235c5ce4ba6a1ec996a1f75f2edc0 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 //  GEOM OBJECT : interactive object for Geometry entities visualization
@@ -63,18 +63,16 @@ public:
   static GEOM_Actor* New();
 
   void SetShape(const TopoDS_Shape& theShape,
-                float theDeflection,
-                bool theIsRelative,
-                bool theIsVector = false);
+               float theDeflection,
+               bool theIsVector = false);
 
-  void SetDeflection(float theDeflection, bool theIsRelative);
+  void SetDeflection(float theDeflection);
   float GetDeflection() const{ return myDeflection;}
-  bool GetIsRelative() const{ return myIsRelative;}
 
   void AddToRender(vtkRenderer* theRenderer);
   void RemoveFromRender(vtkRenderer* theRenderer);
 
-  enum EDisplayMode{ eWireframe, eShading};
+  enum EDisplayMode{ eWireframe, eShading, eShadingWithEdges = eShading + 2 };
 
 /*   void SetDisplayMode(EDisplayMode theMode);  */
 /*   EDisplayMode GetDisplayMode() const { return myDisplayMode;}  */
@@ -88,6 +86,9 @@ public:
   void SetWireframeProperty(vtkProperty* Prop);
   void SetShadingProperty(vtkProperty* Prop);
 
+  vtkProperty* GetWireframeProperty();
+  vtkProperty* GetShadingProperty();
+
   void setDeflection(double adef);
   virtual void setDisplayMode(int thenewmode);
 
@@ -124,6 +125,10 @@ public:
   void SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
   void GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
 
+  // Material
+  void SetMaterial(std::vector<vtkProperty*> theProps);
+  vtkProperty* GetMaterial();
+
   virtual bool IsInfinitive();
 
   // overloaded functions
@@ -163,6 +168,15 @@ public:
   void
   GetNbIsos(int &theNbU,int &theNbV);
   
+  virtual 
+  void SetIsosWidth(const int width);
+
+  int GetIsosWidth() const;
+
+  virtual void SetWidth(const int width);
+
+  int GetWidth() const;
+  
   //! Vector mode management
   virtual
   void
@@ -171,12 +185,27 @@ public:
   virtual
   bool
   GetVectorMode();
+  
+  //! Edges in shading color management
+  void SetEdgesInShadingColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
+
+  void
+  StoreIsoNumbers();
+
+  void
+  RestoreIsoNumbers();
+  
+  void
+  ResetIsoNumbers();
 
 protected:
   void SetModified();
 
   void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
 
+  void StoreBoundaryColors();
+  void RestoreBoundaryColors();
+
   GEOM_Actor();
   ~GEOM_Actor();
 
@@ -186,7 +215,6 @@ private:
   bool isOnlyVertex;
 
   float myDeflection;
-  bool myIsRelative;
   bool myIsForced;
 
   //  EDisplayMode myDisplayMode;
@@ -217,12 +245,15 @@ private:
   vtkSmartPointer<vtkProperty>  myShadingFaceProp;
 
   PAppendFilter myAppendFilter;
-  PPolyDataMapper myPolyDataMapper;
+  PPolyGeomPainterDataMapper myPolyDataMapper;
 
   virtual void SetMapper(vtkMapper*);
 
   GEOM_Actor(const GEOM_Actor&);
   void operator=(const GEOM_Actor&);
+
+  vtkFloatingPointType myEdgesInWireframeColor[3];
+  vtkFloatingPointType myEdgesInShadingColor[3];
 };
 
 #endif //GEOM_ACTOR_H