Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / OBJECT / VISU_GaussPtsSettings.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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 //  VISU OBJECT : interactive object for VISU entities implementation
24 //  File   : 
25 //  Author : 
26 //  Module : VISU
27 //  $Header$
28 //
29 #ifndef VISU_GaussPtsSettings_HeaderFile
30 #define VISU_GaussPtsSettings_HeaderFile
31
32 #include "VISU_OBJECT.h"
33
34 #include <vtkObject.h>
35 #include <vtkCommand.h>
36
37 #include "VTKViewer.h"
38
39 class vtkImageData;
40
41 #include "VISU_Actor.h"
42
43 //============================================================================
44 namespace VISU
45 {
46   const vtkIdType UpdateFromSettingsEvent        = vtkCommand::UserEvent + 100; 
47   const vtkIdType UpdateInsideSettingsEvent      = vtkCommand::UserEvent + 101; 
48   const vtkIdType UpdateOutsideSettingsEvent     = vtkCommand::UserEvent + 102; 
49 }
50
51
52 //! Base class of Gauss Points settings.
53 class VISU_OBJECT_EXPORT VISU_GaussPtsSettings : public vtkObject
54 {
55  public:
56   vtkTypeMacro( VISU_GaussPtsSettings, vtkObject );
57
58   VISU_GaussPtsSettings();
59   virtual ~VISU_GaussPtsSettings();
60
61   static
62   VISU_GaussPtsSettings*
63   New();
64
65   vtkSetMacro( Initial, bool );
66   vtkGetMacro( Initial, bool );
67
68   vtkSetMacro( PrimitiveType, int );
69   vtkGetMacro( PrimitiveType, int );
70
71   vtkSetMacro( Clamp, vtkFloatingPointType );
72   vtkGetMacro( Clamp, vtkFloatingPointType );
73
74   vtkSetMacro( Texture, vtkImageData* );
75   vtkGetMacro( Texture, vtkImageData* );
76
77   vtkSetMacro( AlphaThreshold, vtkFloatingPointType );
78   vtkGetMacro( AlphaThreshold, vtkFloatingPointType );
79
80   vtkSetMacro( Resolution, int );
81   vtkGetMacro( Resolution, int );
82
83   vtkSetMacro( Magnification, vtkFloatingPointType );
84   vtkGetMacro( Magnification, vtkFloatingPointType );
85
86   vtkSetMacro( Increment, vtkFloatingPointType );
87   vtkGetMacro( Increment, vtkFloatingPointType );
88
89  protected:
90   bool                Initial;
91
92   int                 PrimitiveType;
93   vtkFloatingPointType Clamp;
94   vtkImageData*       Texture;
95   vtkFloatingPointType AlphaThreshold;
96   int                 Resolution;
97   vtkFloatingPointType Magnification;
98   vtkFloatingPointType Increment;
99 };
100
101
102 //! Class of Inside Cursor Gauss Points settings.
103 /*!
104  * Contains information about the point sprite parameters:
105  * Clamp, Texture, Alpha threshold, Const size and Color.
106  * Used by Gauss Points Actor.
107  */
108 class VISU_OBJECT_EXPORT VISU_InsideCursorSettings : public VISU_GaussPtsSettings
109 {
110  public:
111   vtkTypeMacro( VISU_InsideCursorSettings, vtkObject );
112
113   VISU_InsideCursorSettings();
114   virtual ~VISU_InsideCursorSettings();
115
116   static
117   VISU_InsideCursorSettings*
118   New();
119
120   vtkSetMacro( MinSize, vtkFloatingPointType );
121   vtkGetMacro( MinSize, vtkFloatingPointType );
122
123   vtkSetMacro( MaxSize, vtkFloatingPointType );
124   vtkGetMacro( MaxSize, vtkFloatingPointType );
125
126  protected:
127   vtkFloatingPointType MinSize;
128   vtkFloatingPointType MaxSize;
129 };
130
131
132 //============================================================================
133 //! Class of Outside Cursor Gauss Points settings.
134 /*!
135  * Contains information about the point sprite parameters:
136  * Clamp, Texture, Alpha threshold, Const size and Color.
137  * Used by Gauss Points Actor.
138  */
139 class VISU_OBJECT_EXPORT VISU_OutsideCursorSettings : public VISU_GaussPtsSettings
140 {
141  public:
142   vtkTypeMacro( VISU_OutsideCursorSettings, vtkObject );
143
144   VISU_OutsideCursorSettings();
145   virtual ~VISU_OutsideCursorSettings();
146
147   static
148   VISU_OutsideCursorSettings*
149   New();
150
151   vtkSetMacro( Size, vtkFloatingPointType );
152   vtkGetMacro( Size, vtkFloatingPointType );
153
154   vtkSetMacro( Uniform, bool );
155   vtkGetMacro( Uniform, bool );
156
157   vtkSetVector3Macro( Color, vtkFloatingPointType );
158   vtkGetVector3Macro( Color, vtkFloatingPointType );
159
160  protected:
161   vtkFloatingPointType Size;
162   bool                Uniform;
163   vtkFloatingPointType Color[3];
164 };
165
166 #endif