Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / OBJECT / VISU_PickingSettings.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  VISU OBJECT : interactive object for VISU entities implementation
21 //  File   : VISU_PickingSettings.cxx
22 //  Author : Oleg UVAROV
23 //  Module : VISU
24 //
25 #ifndef VISU_PickingSettings_HeaderFile
26 #define VISU_PickingSettings_HeaderFile
27
28 #include "VISU_OBJECT.h"
29 #include <vtkObject.h>
30 #include <vtkCommand.h>
31
32 #include "VTKViewer.h"
33
34 #include "VISU_Actor.h"
35
36 //============================================================================
37 namespace VISU
38 {
39   const vtkIdType UpdatePickingSettingsEvent     = vtkCommand::UserEvent + 103; 
40 }
41
42 //! Class of Picking settings.
43 /*!
44  * Contains information about the following parameters:
45  * Cursor Pyramid height, Info Window transparency,
46  * Info Window position, Zoom factor on first selected point,
47  * Camera movement steps number and Display parent mesh.
48  */
49 class VISU_OBJECT_EXPORT VISU_PickingSettings : public vtkObject
50 {
51  public:
52   enum { BelowPoint = 0, TopLeftCorner };
53
54  public:
55   vtkTypeMacro( VISU_PickingSettings, vtkObject );
56
57   static
58   VISU_PickingSettings*
59   Get();
60
61   static
62   VISU_PickingSettings*
63   New();
64
65   vtkSetMacro( IsInitial, bool );
66   vtkGetMacro( IsInitial, bool );
67
68   vtkSetMacro( PyramidHeight, vtkFloatingPointType );
69   vtkGetMacro( PyramidHeight, vtkFloatingPointType );
70
71   vtkSetMacro( CursorSize, vtkFloatingPointType );
72   vtkGetMacro( CursorSize, vtkFloatingPointType );
73
74   vtkSetVector3Macro( Color, vtkFloatingPointType );
75   vtkGetVector3Macro( Color, vtkFloatingPointType );
76
77   vtkSetMacro( PointTolerance, vtkFloatingPointType );
78   vtkGetMacro( PointTolerance, vtkFloatingPointType );
79
80   vtkSetMacro( InfoWindowEnabled, bool );
81   vtkGetMacro( InfoWindowEnabled, bool );
82
83   vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType );
84   vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType );
85
86   vtkSetMacro( InfoWindowPosition, int );
87   vtkGetMacro( InfoWindowPosition, int );
88
89   vtkSetMacro( CameraMovementEnabled, bool );
90   vtkGetMacro( CameraMovementEnabled, bool );
91
92   vtkSetMacro( ZoomFactor, vtkFloatingPointType );
93   vtkGetMacro( ZoomFactor, vtkFloatingPointType );
94
95   vtkSetMacro( StepNumber, int );
96   vtkGetMacro( StepNumber, int );
97
98   vtkSetMacro( DisplayParentMesh, bool );
99   vtkGetMacro( DisplayParentMesh, bool );
100
101 private:
102   VISU_PickingSettings();
103   virtual ~VISU_PickingSettings();
104
105 private:
106   bool                 IsInitial;
107
108   vtkFloatingPointType PyramidHeight;
109   vtkFloatingPointType CursorSize;
110
111   vtkFloatingPointType PointTolerance;
112
113   vtkFloatingPointType Color[3];
114
115   bool                 InfoWindowEnabled;
116   vtkFloatingPointType InfoWindowTransparency;
117   int                  InfoWindowPosition;
118
119   bool                 CameraMovementEnabled;
120   vtkFloatingPointType ZoomFactor;
121   int                  StepNumber;
122
123   bool                 DisplayParentMesh;
124 };
125
126 #endif