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