Salome HOME
473ddd103d5420e616005110bd3dffb77939a52f
[modules/visu.git] / src / OBJECT / VISU_GaussPtsSettings.h
1 //  VISU OBJECT : interactive object for VISU entities implementation
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : 
25 //  Author : 
26 //  Module : VISU
27 //  $Header$
28
29 #ifndef VISU_GaussPtsSettings_HeaderFile
30 #define VISU_GaussPtsSettings_HeaderFile
31
32 #include <vtkObject.h>
33 #include <vtkCommand.h>
34
35 #include "VTKViewer.h"
36
37 class vtkImageData;
38
39 #include "VISU_Actor.h"
40
41 //============================================================================
42 namespace VISU
43 {
44   const vtkIdType UpdateFromSettingsEvent        = vtkCommand::UserEvent + 100; 
45   const vtkIdType UpdateInsideSettingsEvent      = vtkCommand::UserEvent + 101; 
46   const vtkIdType UpdateOutsideSettingsEvent     = vtkCommand::UserEvent + 102; 
47   const vtkIdType UpdatePickingSettingsEvent     = vtkCommand::UserEvent + 103; 
48 }
49
50
51 //! Base class of Gauss Points settings.
52 class VTKOCC_EXPORT VISU_GaussPtsSettings : public vtkObject
53 {
54  public:
55   vtkTypeMacro( VISU_GaussPtsSettings, vtkObject );
56
57   VISU_GaussPtsSettings();
58   virtual ~VISU_GaussPtsSettings();
59
60   static
61   VISU_GaussPtsSettings*
62   New();
63
64   vtkSetMacro( Initial, bool );
65   vtkGetMacro( Initial, bool );
66
67   vtkSetMacro( PrimitiveType, int );
68   vtkGetMacro( PrimitiveType, int );
69
70   vtkSetMacro( Clamp, vtkFloatingPointType );
71   vtkGetMacro( Clamp, vtkFloatingPointType );
72
73   vtkSetMacro( Texture, vtkImageData* );
74   vtkGetMacro( Texture, vtkImageData* );
75
76   vtkSetMacro( AlphaThreshold, vtkFloatingPointType );
77   vtkGetMacro( AlphaThreshold, vtkFloatingPointType );
78
79   vtkSetMacro( Resolution, int );
80   vtkGetMacro( Resolution, int );
81
82   vtkSetMacro( Magnification, vtkFloatingPointType );
83   vtkGetMacro( Magnification, vtkFloatingPointType );
84
85   vtkSetMacro( Increment, vtkFloatingPointType );
86   vtkGetMacro( Increment, vtkFloatingPointType );
87
88  protected:
89   bool                Initial;
90
91   int                 PrimitiveType;
92   vtkFloatingPointType Clamp;
93   vtkImageData*       Texture;
94   vtkFloatingPointType AlphaThreshold;
95   int                 Resolution;
96   vtkFloatingPointType Magnification;
97   vtkFloatingPointType Increment;
98 };
99
100
101 //! Class of Inside Cursor Gauss Points settings.
102 /*!
103  * Contains information about the point sprite parameters:
104  * Clamp, Texture, Alpha threshold, Const size and Color.
105  * Used by Gauss Points Actor.
106  */
107 class VTKOCC_EXPORT VISU_InsideCursorSettings : public VISU_GaussPtsSettings
108 {
109  public:
110   vtkTypeMacro( VISU_InsideCursorSettings, vtkObject );
111
112   VISU_InsideCursorSettings();
113   virtual ~VISU_InsideCursorSettings();
114
115   static
116   VISU_InsideCursorSettings*
117   New();
118
119   vtkSetMacro( MinSize, vtkFloatingPointType );
120   vtkGetMacro( MinSize, vtkFloatingPointType );
121
122   vtkSetMacro( MaxSize, vtkFloatingPointType );
123   vtkGetMacro( MaxSize, vtkFloatingPointType );
124
125  protected:
126   vtkFloatingPointType MinSize;
127   vtkFloatingPointType MaxSize;
128 };
129
130
131 //============================================================================
132 //! Class of Outside Cursor Gauss Points settings.
133 /*!
134  * Contains information about the point sprite parameters:
135  * Clamp, Texture, Alpha threshold, Const size and Color.
136  * Used by Gauss Points Actor.
137  */
138 class VTKOCC_EXPORT VISU_OutsideCursorSettings : public VISU_GaussPtsSettings
139 {
140  public:
141   vtkTypeMacro( VISU_OutsideCursorSettings, vtkObject );
142
143   VISU_OutsideCursorSettings();
144   virtual ~VISU_OutsideCursorSettings();
145
146   static
147   VISU_OutsideCursorSettings*
148   New();
149
150   vtkSetMacro( Size, vtkFloatingPointType );
151   vtkGetMacro( Size, vtkFloatingPointType );
152
153   vtkSetMacro( Uniform, bool );
154   vtkGetMacro( Uniform, bool );
155
156   vtkSetVector3Macro( Color, vtkFloatingPointType );
157   vtkGetVector3Macro( Color, vtkFloatingPointType );
158
159  protected:
160   vtkFloatingPointType Size;
161   bool                Uniform;
162   vtkFloatingPointType Color[3];
163 };
164
165
166 //! Class of Picking settings.
167 /*!
168  * Contains information about the following parameters:
169  * Cursor Pyramid height, Info Window transparency,
170  * Info Window position, Zoom factor on first selected point,
171  * Camera movement steps number and Display parent mesh.
172  * Used by Gauss Points Actor.
173  */
174 class VTKOCC_EXPORT VISU_PickingSettings : public vtkObject
175 {
176  public:
177   enum { BelowPoint = 0, TopLeftCorner };
178
179  public:
180   vtkTypeMacro( VISU_PickingSettings, vtkObject );
181
182   VISU_PickingSettings();
183   virtual ~VISU_PickingSettings();
184
185   static
186   VISU_PickingSettings*
187   New();
188
189   vtkSetMacro( Initial, bool );
190   vtkGetMacro( Initial, bool );
191
192   vtkSetMacro( PyramidHeight, vtkFloatingPointType );
193   vtkGetMacro( PyramidHeight, vtkFloatingPointType );
194
195   vtkSetMacro( CursorSize, vtkFloatingPointType );
196   vtkGetMacro( CursorSize, vtkFloatingPointType );
197
198   vtkSetVector3Macro( Color, vtkFloatingPointType );
199   vtkGetVector3Macro( Color, vtkFloatingPointType );
200
201   vtkSetMacro( PointTolerance, vtkFloatingPointType );
202   vtkGetMacro( PointTolerance, vtkFloatingPointType );
203
204   vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType );
205   vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType );
206
207   vtkSetMacro( InfoWindowPosition, int );
208   vtkGetMacro( InfoWindowPosition, int );
209
210   vtkSetMacro( ZoomFactor, vtkFloatingPointType );
211   vtkGetMacro( ZoomFactor, vtkFloatingPointType );
212
213   vtkSetMacro( StepNumber, int );
214   vtkGetMacro( StepNumber, int );
215
216   vtkSetMacro( DisplayParentMesh, bool );
217   vtkGetMacro( DisplayParentMesh, bool );
218
219 private:
220   bool                Initial;
221
222   vtkFloatingPointType PyramidHeight;
223   vtkFloatingPointType CursorSize;
224   vtkFloatingPointType PointTolerance;
225   vtkFloatingPointType Color[3];
226   vtkFloatingPointType InfoWindowTransparency;
227   int                 InfoWindowPosition;
228   vtkFloatingPointType ZoomFactor;
229   int                 StepNumber;
230   bool                DisplayParentMesh;
231 };
232
233
234 #endif