Salome HOME
This commit was generated by cvs2git to create tag 'V1_4_0b2'.
[modules/kernel.git] / src / OBJECT / SALOME_Actor.h
index 47971b53d1a3eb5079ff60f9dd4adf2915b4b874..03758fee9870e4aba7bdd4f4d19a6fb239b69348 100644 (file)
@@ -1,63 +1,84 @@
-//  File      : SALOME_Actor.h
-//  Created   : Wed Feb 20 17:24:59 2002
-//  Author    : Nicolas REJNERI
-//  Project   : SALOME
-//  Module    : SALOME
-//  Copyright : Open CASCADE 2002
+//  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
+//
+//  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   : SALOME_Actor.h
+//  Author : Nicolas REJNERI
+//  Module : SALOME
 //  $Header$
 
-
 #ifndef SALOME_ACTOR_H
 #define SALOME_ACTOR_H
 
 // SALOME Includes
+#include "VTKViewer_Common.h"
+#include "SALOME_InteractiveObject.hxx"
 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
-#include <Handle_SALOME_InteractiveObject.hxx>
+#include "Handle_SALOME_InteractiveObject.hxx"
 #endif
-#include "SALOME_InteractiveObject.hxx"
+#include <vector.h>
 
-//VTK Includes
-#include <vtkLODActor.h>
+class SALOME_Transform;
+class SALOME_TransformFilter;
+class SALOME_PassThroughFilter;
 
-class SALOME_Actor : public vtkLODActor 
-{
+extern int SALOME_POINT_SIZE;
+
+class SALOME_Actor : public vtkLODActor{
  protected:
   //constructor should be protected due to first implementation of this class
   //it was abstract class
   SALOME_Actor();
   ~SALOME_Actor();
  public:
-  vtkTypeMacro(SALOME_Actor,vtkActor);
+  static SALOME_Actor* New();
+
+  vtkTypeMacro(SALOME_Actor,vtkLODActor);
 
   // Description:
   // This causes the actor to be rendered. It, in turn, will render the actor`s
   // property and then mapper.
-  virtual void Render(vtkRenderer *, vtkMapper *);
+  //virtual void Render(vtkRenderer *, vtkMapper *);
 
   // Description:
   // This method is used internally by the rendering process.
   // We overide the superclass method to properly set the estimated render time.
-  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+  //virtual int RenderOpaqueGeometry(vtkViewport *viewport);
 
   // Description:
   // Release any graphics resources that are being consumed by this actor.
   // The parameter window could be used to determine which graphic
   // resources to release.
-  virtual void ReleaseGraphicsResources(vtkWindow *);
-
-  virtual void ShallowCopy(vtkProp *prop);
+  //virtual void ReleaseGraphicsResources(vtkWindow *);
 
   virtual Standard_Boolean hasIO() { return !myIO.IsNull(); }
   virtual Handle_SALOME_InteractiveObject getIO() { return myIO; } 
-  void setIO(const Handle(SALOME_InteractiveObject)& io) { myIO = io; }
+  virtual void setIO(const Handle(SALOME_InteractiveObject)& io) { myIO = io; }
 
   virtual Standard_CString getName()     { return myName; }
-  virtual void setName(Standard_CString aName)
-    {
-      myName = aName;
-      if ( hasIO() )
-       myIO->setName(aName);
-    }
+  virtual void setName(Standard_CString aName){
+    myName = aName;
+    if(hasIO())        myIO->setName(aName);
+  }
 
   virtual int getDisplayMode() { return myDisplayMode; }
   virtual void setDisplayMode(int mode) { myDisplayMode = mode; }
@@ -72,17 +93,29 @@ class SALOME_Actor : public vtkLODActor
   virtual void SetColor(float r,float g,float b) {};
   virtual void GetColor(float& r,float& g,float& b) {};
 
-  virtual void SetPreviewProperty(vtkProperty* Prop) { PreviewProperty = Prop; }
+  vtkSetObjectMacro(PreviewProperty,vtkProperty);
 
   virtual void SetPreSelected(Standard_Boolean presel = Standard_False)   { ispreselected = presel; }
 
   // Used to obtain all dependent actors
   virtual void GetChildActors(vtkActorCollection*) {};
   
-  //virtual void ApplyScaling ( vtkMapper*  newMapper, bool recover = false ); 
-  virtual void SetMapper ( vtkMapper*  newMapper ); 
-  virtual vtkMapper* GetInitialMapper() { return m_Initial; } 
+  virtual void AddToRender(vtkRenderer* theRenderer); 
+  virtual void RemoveFromRender(vtkRenderer* theRenderer);
+
+  virtual vtkPolyData* GetPolyDataInput(); 
+  virtual void SetMapper(vtkMapper* theMapper); 
+  virtual void SetTransform(SALOME_Transform* theTransform); 
+
+  virtual unsigned long int GetMTime();
 
+  virtual void SetRepresentation(int theMode);
+  virtual int GetRepresentation();
+
+  // Infinitive means actor without size (point for example
+  // which is not taken into account in calculation of boundaries of the scene
+  virtual bool IsInfinitive() { return false; }
+    
  protected:
   vtkProperty         *PreviewProperty;
   Standard_Boolean    ispreselected;
@@ -94,6 +127,11 @@ class SALOME_Actor : public vtkLODActor
   Standard_Boolean    ishighlighted;
   int myDisplayMode;
 
-  vtkMapper*   m_Initial;
+  SALOME_Transform *myTransform;
+  std::vector<SALOME_PassThroughFilter*> myPassFilter;
+  SALOME_TransformFilter *myTransformFilter;
+  vtkProperty *myProperty;
+  int myRepresentation;
 };
+
 #endif // SALOME_ACTOR_H