1 // GEOM OBJECT : interactive object for Geometry entities visualization
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GEOM_Actor.h
25 // Author : Christophe ATTANASIO
32 #include "SALOME_Actor.h"
35 #include <TopoDS_Shape.hxx>
42 #define VTKOCC_EXPORT __declspec (dllexport)
47 class VTKOCC_EXPORT GEOM_Actor : public SALOME_Actor {
49 vtkTypeMacro(GEOM_Actor,SALOME_Actor);
51 static GEOM_Actor* New();
54 // This causes the actor to be rendered. It, in turn, will render the actor's
55 // property and then mapper.
56 virtual void Render(vtkRenderer *, vtkMapper *);
59 // Release any graphics resources that are being consumed by this actor.
60 // The parameter window could be used to determine which graphic
61 // resources to release.
62 void ReleaseGraphicsResources(vtkWindow *);
64 const TopoDS_Shape& getTopo();
65 void setInputShape(const TopoDS_Shape& ashape,double adef1,int imode);
67 double getDeflection();
68 void setDeflection(double adefl);
75 virtual void setDisplayMode(int);
78 virtual void highlight(bool theHighlight);
79 virtual bool hasHighlight() { return true; }
81 void ShallowCopy(vtkProp *prop);
84 void SetHighlightProperty(vtkProperty* Prop);
85 void SetWireframeProperty(vtkProperty* Prop);
86 void SetShadingProperty(vtkProperty* Prop);
89 void SetOpacity(float opa);
93 void SetColor(float r,float g,float b);
94 void GetColor(float& r,float& g,float& b);
96 virtual bool IsInfinite() {return myIsInfinite;}
101 GEOM_Actor(const GEOM_Actor&) {};
102 void operator=(const GEOM_Actor&) {};
104 void CreateWireframeMapper();
105 void CreateShadingMapper();
106 void CreateMapper(int theMode);
107 void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
115 TopoDS_Shape myShape;
118 vtkMapper* ShadingMapper;
119 vtkMapper* WireframeMapper;
121 vtkProperty* ShadingProperty;
122 vtkProperty* WireframeProperty;
123 vtkProperty* HighlightProperty;
127 #endif //GEOM_ACTOR_H