1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : VVTK_SegmentationCursorDlg.h
21 // Author : Oleg Uvarov
24 #ifndef VVTK_SEGMENTATIONCURSORDLG_H
25 #define VVTK_SEGMENTATIONCURSORDLG_H
29 #include "VISU_GaussPtsDeviceActor.h"
33 #include <vtkObject.h>
34 #include <vtkSmartPointer.h>
36 class vtkActorCollection;
37 class vtkCallbackCommand;
52 class VISU_GaussPtsAct1;
53 class VISU_InsideCursorSettings;
54 class VISU_OutsideCursorSettings;
55 class VISU_WidgetCtrl;
57 class VVTK_PrimitiveBox;
60 class SVTK_RenderWindowInteractor;
63 //! Segmentation Cursor Dialog.
65 * Uses for set up Segmentation and Outside Cursor Gauss Points preferenses
66 * and apply them to all actors in the current renderer.
68 class VVTK_SegmentationCursorDlg : public QDialog
73 VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 );
74 ~VVTK_SegmentationCursorDlg();
76 void SetWidgetCtrl( VISU_WidgetCtrl* );
77 void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; }
78 void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; }
80 bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; }
81 void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; }
83 //! Update contents of the Segmentation tab.
84 void UpdateSegmentation();
85 void UpdateInsideGaussPoints();
86 void UpdateOutsideGaussPoints();
88 //! Update contents of the Outside Cursor tab.
89 void UpdateOutsideCursor();
91 VISU_InsideCursorSettings* GetInsideCursorSettings();
92 VISU_OutsideCursorSettings* GetOutsideCursorSettings();
94 vtkSmartPointer<vtkCallbackCommand> GetEventCallbackCommand() { return myEventCallbackCommand; }
96 void SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) { myInteractor = theInteractor; }
99 float getMagnification() const;
100 void setMagnification( float );
102 float getIncrement() const;
103 void setIncrement( float );
106 void ApplySegmentationCursor();
107 void ApplyInsideGaussPoints();
108 void ApplyOutsideGaussPoints();
110 bool CheckNumberOfFaces();
113 MakeImageData( bool theInside,
114 const QString& theMainTexture,
115 const QString& theAlphaTexture );
118 static void ProcessEvents(vtkObject* theObject,
119 unsigned long theEvent,
123 void keyPressEvent( QKeyEvent* e );
126 virtual void done( int );
138 SVTK_RenderWindowInteractor* myInteractor;
140 QTabWidget* myTabBox;
142 // Segmentation cursor
143 QVBox* mySegmentationCursorBox;
145 QGroupBox* myOriginGroup;
146 QtxDblSpinBox* myXOriginSpinBox;
147 QtxDblSpinBox* myYOriginSpinBox;
148 QtxDblSpinBox* myZOriginSpinBox;
150 QGroupBox* myDirectionGroup;
151 QtxDblSpinBox* myDXDirectionSpinBox;
152 QtxDblSpinBox* myDYDirectionSpinBox;
153 QtxDblSpinBox* myDZDirectionSpinBox;
155 QGroupBox* myDepthGroup;
156 QtxDblSpinBox* myDepthSpinBox;
158 QGroupBox* myRadiusGroup;
159 QtxDblSpinBox* myRadiusSpinBox;
160 QtxDblSpinBox* myRatioSpinBox;
162 bool myIsPlaneSegmentation;
165 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
167 VISU_WidgetCtrl* myWidgetCtrl;
168 QtxAction* myPlaneAction;
169 QtxAction* mySphereAction;
172 QVBox* myGaussPointsBox;
174 VVTK_PrimitiveBox* myInsidePrimitiveBox;
175 VVTK_SizeBox* myInsideSizeBox;
177 QString myInsideMainTexture;
178 QString myInsideAlphaTexture;
180 vtkSmartPointer<VISU_InsideCursorSettings> myInsideCursorSettings;
182 VVTK_PrimitiveBox* myOutsidePrimitiveBox;
183 VVTK_SizeBox* myOutsideSizeBox;
185 QString myOutsideMainTexture;
186 QString myOutsideAlphaTexture;
188 vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
190 QLabel* myMagnificationLabel;
191 QtxIntSpinBox* myMagnificationSpinBox;
192 QLabel* myIncrementLabel;
193 QtxDblSpinBox* myIncrementSpinBox;