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.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : GEOM_Actor.h
25 // Author : Christophe ATTANASIO
32 #include "GEOM_OBJECT_defs.hxx"
34 #include "SALOME_Actor.h"
37 #include <TopoDS_Shape.hxx>
43 class GEOM_OBJECT_EXPORT GEOM_Actor : public SALOME_Actor {
45 vtkTypeMacro(GEOM_Actor,SALOME_Actor);
47 static GEOM_Actor* New();
50 // This causes the actor to be rendered. It, in turn, will render the actor's
51 // property and then mapper.
52 virtual void Render(vtkRenderer *, vtkMapper *);
55 // Release any graphics resources that are being consumed by this actor.
56 // The parameter window could be used to determine which graphic
57 // resources to release.
58 void ReleaseGraphicsResources(vtkWindow *);
60 const TopoDS_Shape& getTopo();
61 void setInputShape(const TopoDS_Shape& ashape, double adef1,
62 int imode, bool isVector = false);
64 double getDeflection();
65 void setDeflection(double adefl);
67 double isVector() { return myIsVector; }
74 virtual void setDisplayMode(int);
77 virtual void highlight(bool theHighlight);
78 virtual bool hasHighlight() { return true; }
80 void ShallowCopy(vtkProp *prop);
83 void SetHighlightProperty(vtkProperty* Prop);
84 void SetWireframeProperty(vtkProperty* Prop);
85 void SetShadingProperty(vtkProperty* Prop);
88 void SetOpacity(vtkFloatingPointType opa);
89 vtkFloatingPointType GetOpacity();
92 void SetColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b);
93 void GetColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b);
95 virtual bool IsInfinite() {return myIsInfinite;}
100 GEOM_Actor(const GEOM_Actor&) {};
101 void operator=(const GEOM_Actor&) {};
103 void CreateWireframeMapper();
104 void CreateShadingMapper();
105 void CreateMapper(int theMode);
106 void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
114 TopoDS_Shape myShape;
118 vtkMapper* ShadingMapper;
119 vtkMapper* WireframeMapper;
121 vtkProperty* ShadingProperty;
122 vtkProperty* WireframeProperty;
123 vtkProperty* HighlightProperty;
127 #endif //GEOM_ACTOR_H