1 // File : SMESH_Actor.h
2 // Created : Mon May 13 22:30:51 2002
3 // Author : Nicolas REJNERI
7 // Copyright : Open CASCADE 2002
14 #include "SALOME_Actor.h"
18 #include <vtkDataSetMapper.h>
19 #include <vtkUnstructuredGridReader.h>
21 // Open CASCADE Includes
22 #include <TColStd_IndexedMapOfInteger.hxx>
23 #include <TColStd_DataMapOfIntegerInteger.hxx>
25 typedef struct rgbStruct
32 class SMESH_Actor : public SALOME_Actor {
35 vtkTypeMacro(SMESH_Actor,SALOME_Actor);
37 static SMESH_Actor* New();
40 // This causes the actor to be rendered. It, in turn, will render the actor`s
41 // property and then mapper.
42 virtual void Render(vtkRenderer *, vtkMapper *);
45 // This method is used internally by the rendering process.
46 // We overide the superclass method to properly set the estimated render time.
47 int RenderOpaqueGeometry(vtkViewport *viewport);
49 void ShallowCopy(vtkProp *prop);
51 void setReader(vtkUnstructuredGridReader* r) ;
52 vtkUnstructuredGridReader* getReader();
55 virtual bool hasHighlight() { return true; }
57 vtkMapper* getMapper();
59 void setDisplayMode(int);
61 void SetColor(float r,float g,float b);
62 void GetColor(float& r,float& g,float& b);
63 void SetHighlightColor(float r,float g,float b);
64 void GetHighlightColor(float& r,float& g,float& b);
65 void SetPreselectedColor(float r,float g,float b);
66 void GetPreselectedColor(float& r,float& g,float& b);
68 void SetEdgeColor(float r,float g,float b);
69 void GetEdgeColor(float& r,float& g,float& b);
70 void SetEdgeHighlightColor(float r,float g,float b);
71 void GetEdgeHighlightColor(float& r,float& g,float& b);
72 void SetEdgePreselectedColor(float r,float g,float b);
73 void GetEdgePreselectedColor(float& r,float& g,float& b);
75 void SetNodeColor(float r,float g,float b);
76 void GetNodeColor(float& r,float& g,float& b);
78 void SetNodeSize(int size) ;
85 void RemoveNode(int idSMESHDSnode);
86 void RemoveElement(int idSMESHDSelement);
88 void AddNode(int idSMESHDSnode, int idVTKnode);
89 void AddElement(int idSMESHDSelement, int idVTKelement);
91 int GetIdVTKNode(int idSMESHDSnode);
92 int GetIdVTKElement(int idSMESHDSelement);
94 int GetIdSMESHDSNode(int idVTKnode);
95 int GetIdSMESHDSElement(int idVTKelement);
97 void SetIdsVTKNode(const TColStd_DataMapOfIntegerInteger& mapVTK);
98 void SetIdsSMESHDSNode(const TColStd_DataMapOfIntegerInteger& mapSMESHDS);
100 void SetIdsVTKElement(const TColStd_DataMapOfIntegerInteger& mapVTK);
101 void SetIdsSMESHDSElement(const TColStd_DataMapOfIntegerInteger& mapSMESHDS);
103 vtkDataSet* DataSource;
104 vtkActor* EdgeDevice;
105 vtkActor* EdgeShrinkDevice;
107 float GetShrinkFactor();
108 void SetShrinkFactor(float value );
110 void GetChildActors(vtkActorCollection*);
112 void SetVisibility(bool visibility);
118 SMESH_Actor(const SMESH_Actor&) {};
119 void operator=(const SMESH_Actor&) {};
121 vtkUnstructuredGridReader* myReader;
123 float myShrinkFactor;
126 RGBStruct edgeHighlightColor;
127 RGBStruct edgePreselectedColor;
129 RGBStruct actorColor;
130 RGBStruct actorHighlightColor;
131 RGBStruct actorPreselectedColor;
133 RGBStruct actorNodeColor; // LPN
134 int actorNodeSize; // LPN
137 #endif //SMESH_ACTOR_H