1 // File : SALOME_Actor.h
2 // Created : Wed Feb 20 17:24:59 2002
3 // Author : Nicolas REJNERI
6 // Copyright : Open CASCADE 2002
10 #ifndef SALOME_ACTOR_H
11 #define SALOME_ACTOR_H
14 #ifndef _Handle_SALOME_InteractiveObject_HeaderFile
15 #include <Handle_SALOME_InteractiveObject.hxx>
17 #include "SALOME_InteractiveObject.hxx"
20 #include <vtkLODActor.h>
22 class SALOME_Actor : public vtkLODActor
25 //constructor should be protected due to first implementation of this class
26 //it was abstract class
30 vtkTypeMacro(SALOME_Actor,vtkActor);
33 // This causes the actor to be rendered. It, in turn, will render the actor`s
34 // property and then mapper.
35 virtual void Render(vtkRenderer *, vtkMapper *);
38 // This method is used internally by the rendering process.
39 // We overide the superclass method to properly set the estimated render time.
40 virtual int RenderOpaqueGeometry(vtkViewport *viewport);
43 // Release any graphics resources that are being consumed by this actor.
44 // The parameter window could be used to determine which graphic
45 // resources to release.
46 virtual void ReleaseGraphicsResources(vtkWindow *);
48 virtual void ShallowCopy(vtkProp *prop);
50 virtual Standard_Boolean hasIO() { return !myIO.IsNull(); }
51 virtual Handle_SALOME_InteractiveObject getIO() { return myIO; }
52 void setIO(const Handle(SALOME_InteractiveObject)& io) { myIO = io; }
54 virtual Standard_CString getName() { return myName; }
55 virtual void setName(Standard_CString aName)
62 virtual int getDisplayMode() { return myDisplayMode; }
63 virtual void setDisplayMode(int mode) { myDisplayMode = mode; }
65 virtual bool hasHighlight() { return false; }
66 virtual void highlight(Standard_Boolean highlight) { ishighlighted = highlight; }
67 virtual Standard_Boolean isHighlighted() { return ishighlighted; }
69 virtual void SetOpacity(float opa) { m_opacity = opa; }
70 virtual float GetOpacity() { return m_opacity; }
72 virtual void SetColor(float r,float g,float b) {};
73 virtual void GetColor(float& r,float& g,float& b) {};
75 virtual void SetPreviewProperty(vtkProperty* Prop) { PreviewProperty = Prop; }
77 virtual void SetPreSelected(Standard_Boolean presel = Standard_False) { ispreselected = presel; }
79 // Used to obtain all dependent actors
80 virtual void GetChildActors(vtkActorCollection*) {};
82 //virtual void ApplyScaling ( vtkMapper* newMapper, bool recover = false );
83 virtual void SetMapper ( vtkMapper* newMapper );
84 virtual vtkMapper* GetInitialMapper() { return m_Initial; }
87 vtkProperty *PreviewProperty;
88 Standard_Boolean ispreselected;
90 Handle_SALOME_InteractiveObject myIO;
91 Standard_CString myName;
94 Standard_Boolean ishighlighted;
99 #endif // SALOME_ACTOR_H