Salome HOME
SMH: 3.0.0 preparation - merged and adopted version (POLYWORK+HEAD)
[modules/visu.git] / src / OBJECT / VISU_Actor.h
index 298f25cbd063c2ac1b13de3070a26b995805a706..01cf5c67baa6aae216c1a3ccd49320731dfede90 100644 (file)
-//  File      : VISU_Actor.h
-//  Created   : Wed Feb 20 18:04:42 CET 2002
-//  Author    : Laurent CORNABE with the help of Nicolas REJNERI
-//  Project   : SALOME
-//  Module    : VISU
-//  Copyright : PRINCIPIA RD
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  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 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 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   : VISU_Actor.h
+//  Author : Laurent CORNABE with the help of Nicolas REJNERI
+//  Module : VISU
 //  $Header$
 
-
 #ifndef VISU_ACTOR_H
 #define VISU_ACTOR_H
 
 #include "SALOME_Actor.h"
 
 #include <string>
-// VTK Includes
-#include <vtkActor.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataNormals.h>
-#include <vtkProperty.h>
-
-#ifdef _WIN_32
-#define VTKOCC_EXPORT __declspec (dllexport)
-#else
-#define VTKOCC_EXPORT
-#endif
-
-#define VisuActorType_Mesh 1
-#define VisuActorType_BoundingBox 2
-#define VisuActorType_DeformedShape 3
-#define VisuActorType_Vectors 4
-#define VisuActorType_ScalarMap 5
-#define VisuActorType_IsoSurfaces 6
-#define VisuActorType_CutPlanes 7
-#define VisuActorType_Plot2D 8
-#define VisuActorType_StreamLines 9
 
+class vtkProp;
+class vtkProperty;
+class vtkDataSetMapper;
 
+class VTKViewer_ShrinkFilter;
+class VISU_PipeLine;
 
 namespace VISU { 
   class Prs3d_i;
 }
 
-class VISU_ScalarBarActor;
+#ifdef _WIN_32
+#define VTKOCC_EXPORT __declspec (dllexport)
+#else
+#define VTKOCC_EXPORT VTK_EXPORT
+#endif
 
 class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
-  friend class VISU::Prs3d_i;
  public:
   vtkTypeMacro(VISU_Actor,SALOME_Actor);
-
-  Standard_Boolean IsHighlighting;
-
-  static VISU_Actor* New();
-
-  void setActor(vtkActor *Actor);
-
   void ShallowCopy(vtkProp *prop);
+  static VISU_Actor* New();
+  virtual ~VISU_Actor();
 
-  void highlight(Standard_Boolean highlight);
-  Standard_Boolean isHighlighted() { return true; };
+  virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
 
-  void  SetOpacity(float opa) {};
-  float GetOpacity() 
-    { return 0;};
+  VISU::Prs3d_i* GetPrs3d(){ return myPrs3d;}
+  virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d);
 
-  Standard_Boolean HasScalarBar()
-    { return myHasScalarBar; }
+  virtual VISU_PipeLine* GetPipeLine() { return myPipeLine;}
+  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
 
-  void setScalarBar(VISU_ScalarBarActor* theBar);
-  VISU_ScalarBarActor* getScalarBar()
-    { return myScalarBar; }
+  VISU_Actor* GetParent(){ return myParent;}
+  virtual void SetParent(VISU_Actor* theParent);
 
+  virtual void SetOpacity(float theValue);
+  virtual float GetOpacity();
 
-  void setIO(const Handle(SALOME_InteractiveObject)& io) 
-    { SALOME_Actor::setIO(io); myName = io->getName(); }
-    
+  virtual void SetRepresentation(int theMode);
 
-  VISU::Prs3d_i* getPrs3d() { return Presentation; }
-  void setPrs3d(VISU::Prs3d_i* thePrs) { Presentation = thePrs; }
-    
-  vtkDataSet *DataSource;
-  VISU_Actor*   EdgeDevice;
+  virtual bool IsShrunkable() { return myIsShrinkable;}
+  virtual bool IsShrunk() { return myIsShrunk;}
+  virtual void SetShrink();
+  virtual void UnShrink(); 
 
-  Standard_Boolean IsShrinkable;
-  Standard_Boolean IsShrunk;
-  int VisuActorType;
-  Standard_Boolean ResultAtNode;
-  int VectorComponent;
-  char FieldName[40];
+  virtual void SetShrinkable(bool theIsShrinkable);
+  virtual void SetShrinkFactor(float theFactor = 0.8); 
+  virtual float GetShrinkFactor();
 
-  Standard_Boolean IsDefined;
+  virtual void SetVisibility(int theMode);
+  virtual int GetVisibility();
 
-  float VABounds[6];
-  void setVABounds(const float bounds[6]);
-  void getVABounds(float bounds[6]);
+  virtual void SetLineWidth(float theLineWidth);
+  virtual float GetLineWidth();
+  virtual int GetNodeObjId(int theVtkID);
+  virtual int GetElemObjId(int theVtkID);
 
-  ~VISU_Actor();
  protected:
   VISU_Actor();
-  
-  Standard_Boolean myHasScalarBar;
-  VISU_ScalarBarActor* myScalarBar;
-  VISU::Prs3d_i* Presentation;
-
- private:
-  vtkProperty* HighlightProperty;
-
+  VISU_Actor* myParent;
+  VISU::Prs3d_i* myPrs3d;
+  VISU_PipeLine* myPipeLine;
+  vtkDataSetMapper* myMapper;
+
+  VTKViewer_ShrinkFilter* myShrinkFilter;
+  bool myIsShrinkable;
+  bool myIsShrunk;
 };
+
 #endif //VISU_ACTOR_H