Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / OBJECT / VISU_GaussPtsDeviceActor.h
1 //  SMESH OBJECT : interactive object for SMESH visualization
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : 
25 //  Author : 
26 //  Module : 
27 //  $Header$
28
29 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
30 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
31
32 #include "VTKViewer_GeometryFilter.h"
33
34 #include <vtkLODActor.h>
35 #include <vtkSmartPointer.h>
36
37 class VTKViewer_Transform;
38 class VTKViewer_TransformFilter;
39 class VTKViewer_PassThroughFilter;
40
41 class VISU_OpenGLPointSpriteMapper;
42 class VISU_GaussPointsPL;
43
44
45 //============================================================================
46 class VISU_GaussPtsDeviceActor: public vtkLODActor
47 {
48  public:
49   vtkTypeMacro(VISU_GaussPtsDeviceActor,vtkLODActor);
50
51   static 
52   VISU_GaussPtsDeviceActor* 
53   New();
54
55   virtual
56   void
57   Render(vtkRenderer *, vtkMapper *);
58
59   //----------------------------------------------------------------------------
60   void
61   AddToRender(vtkRenderer* theRenderer); 
62
63   void
64   RemoveFromRender(vtkRenderer* theRenderer);
65
66   void
67   SetTransform(VTKViewer_Transform* theTransform); 
68
69   //----------------------------------------------------------------------------
70   VISU_GaussPointsPL* 
71   GetPipeLine();
72
73   void
74   SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
75
76   void
77   ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
78
79   VISU_OpenGLPointSpriteMapper*
80   GetPSMapper();
81
82   virtual
83   int
84   GetPickable();
85
86  protected:
87   //----------------------------------------------------------------------------
88   vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
89   vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
90   vtkSmartPointer<VTKViewer_GeometryFilter> myGeomFilter;
91   vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
92
93   typedef vtkSmartPointer<VTKViewer_PassThroughFilter> PPassThroughFilter;
94   std::vector<PPassThroughFilter> myPassFilter;
95
96   VISU_GaussPtsDeviceActor();
97   ~VISU_GaussPtsDeviceActor();
98
99  private:
100   VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
101   void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
102 };
103
104
105 //============================================================================
106 class vtkActor;
107 class vtkConeSource;
108 class vtkAppendPolyData;
109 class vtkPolyDataMapper;
110
111 #include <vtkLODActor.h>
112
113 class VISU_CursorPyramid : public vtkLODActor 
114 {
115 public:
116   vtkTypeMacro(VISU_CursorPyramid, vtkObject);
117
118   static
119   VISU_CursorPyramid* 
120   New();
121
122   virtual
123   void
124   Render(vtkRenderer *, vtkMapper *);
125
126   void
127   AddToRender(vtkRenderer* theRenderer);
128
129   void
130   RemoveFromRender(vtkRenderer* theRenderer);
131
132   void
133   Init(vtkFloatingPointType theHeight,
134        vtkFloatingPointType theCursorSize,
135        vtkFloatingPointType theRadius,
136        vtkFloatingPointType theMagnification,
137        vtkFloatingPointType theClamp,
138        vtkFloatingPointType thePos[3],
139        vtkFloatingPointType theColor[3]);
140
141   void SetPreferences(vtkFloatingPointType theHeight,
142                       vtkFloatingPointType theCursorSize);
143
144 protected:
145   VISU_CursorPyramid();
146
147   void
148   Init(vtkFloatingPointType theHeight,
149        vtkFloatingPointType theRadius);
150
151   int myNbCones;
152   vtkSmartPointer<vtkConeSource> mySources[6];
153   vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
154   vtkSmartPointer<vtkPolyDataMapper> myMapper;
155   //
156   vtkFloatingPointType myHeight;
157   vtkFloatingPointType myCursorSize;
158   vtkFloatingPointType myRadius;
159   vtkFloatingPointType myMagnification;
160   vtkFloatingPointType myClamp;
161
162  private:
163   VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
164   void operator=(const VISU_CursorPyramid&); // Not implemented
165 };
166
167
168 //==================================================================
169 // class VISU_FramedTextActor
170 //
171 #include <vtkActor2D.h>
172 //
173 class vtkViewport;
174 class vtkProp;
175 class vtkWindow;
176 class vtkPolyData;
177 class vtkPolyDataMapper2D;
178 class vtkActor2D;
179 class vtkTimeStamp;
180 class vtkTextProperty;
181 class vtkTextMapper;
182
183 class VISU_FramedTextActor : public vtkActor2D
184 {
185 public:
186   // vtks
187   vtkTypeRevisionMacro(VISU_FramedTextActor,vtkActor2D);
188   static VISU_FramedTextActor *New();
189   //
190   virtual int  RenderOpaqueGeometry(vtkViewport* viewport);
191   virtual int  RenderTranslucentGeometry(vtkViewport*) { return 0; };
192   virtual int  RenderOverlay(vtkViewport* viewport);
193   virtual void ReleaseGraphicsResources(vtkWindow *);
194   virtual void SetVisibility (int );
195   virtual int  GetVisibility() ;
196   virtual void SetPickable (int ) ;
197   virtual int GetPickable();
198   //
199   // selectors
200   void SetText(const char* theText);
201   char* GetText();
202   //
203   void SetModePosition(const int theMode);
204   int  GetModePosition()const;
205   //
206   void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
207   const vtkFloatingPointType* GetWorldPoint()const;
208   //
209   void  SetDistance(const vtkFloatingPointType theDistance);
210   vtkFloatingPointType GetDistance()const;
211   //
212   void  SetTransparency(const vtkFloatingPointType theTransparency);
213   vtkFloatingPointType GetTransparency()const;
214   //
215 protected:
216   VISU_FramedTextActor();
217   ~VISU_FramedTextActor();
218
219 protected:
220   vtkPolyData         *myBar;
221   vtkPolyDataMapper2D *myBarMapper;
222   vtkActor2D          *myBarActor;
223   //
224   vtkTextProperty *myTextProperty;
225   vtkTextMapper   *myTextMapper;
226   vtkActor2D      *myTextActor;
227   //
228   vtkTimeStamp  myBuildTime;
229   //
230   int   myModePosition;
231   vtkFloatingPointType myWorldPoint[4];
232   vtkFloatingPointType myDistance;
233   vtkFloatingPointType myTransparency;
234   
235 private:
236  VISU_FramedTextActor(const VISU_FramedTextActor&);  // Not implemented.
237   void operator=(const VISU_FramedTextActor&);  // Not implemented.
238 };
239
240 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H