1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : VVTK_SegmentationCursorDlg.h
23 // Author : Oleg Uvarov
26 #ifndef VVTK_SEGMENTATIONCURSORDLG_H
27 #define VVTK_SEGMENTATIONCURSORDLG_H
31 #include "VISU_GaussPtsDeviceActor.h"
35 #include <vtkObject.h>
36 #include <vtkSmartPointer.h>
38 class vtkActorCollection;
39 class vtkCallbackCommand;
52 class QtxDoubleSpinBox;
55 class VISU_GaussPtsAct1;
56 class VISU_InsideCursorSettings;
57 class VISU_OutsideCursorSettings;
58 class VISU_WidgetCtrl;
60 class VVTK_PrimitiveBox;
63 class SVTK_RenderWindowInteractor;
66 //! Segmentation Cursor Dialog.
68 * Uses for set up Segmentation and Outside Cursor Gauss Points preferenses
69 * and apply them to all actors in the current renderer.
71 class VVTK_SegmentationCursorDlg : public QDialog
76 VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 );
77 ~VVTK_SegmentationCursorDlg();
79 void SetWidgetCtrl( VISU_WidgetCtrl* );
80 void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; }
81 void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; }
83 bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; }
84 void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; }
86 //! Update contents of the Segmentation tab.
87 void UpdateSegmentation();
88 void UpdateInsideGaussPoints();
89 void UpdateOutsideGaussPoints();
91 //! Update contents of the Outside Cursor tab.
92 void UpdateOutsideCursor();
94 VISU_InsideCursorSettings* GetInsideCursorSettings();
95 VISU_OutsideCursorSettings* GetOutsideCursorSettings();
97 vtkSmartPointer<vtkCallbackCommand> GetEventCallbackCommand() { return myEventCallbackCommand; }
99 void SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) { myInteractor = theInteractor; }
102 float getMagnification() const;
103 void setMagnification( float );
105 float getIncrement() const;
106 void setIncrement( float );
109 void ApplySegmentationCursor();
110 void ApplyInsideGaussPoints();
111 void ApplyOutsideGaussPoints();
113 bool CheckNumberOfFaces();
116 MakeImageData( bool theInside,
117 const QString& theMainTexture,
118 const QString& theAlphaTexture );
121 static void ProcessEvents(vtkObject* theObject,
122 unsigned long theEvent,
126 void keyPressEvent( QKeyEvent* e );
129 virtual void done( int );
141 SVTK_RenderWindowInteractor* myInteractor;
143 QTabWidget* myTabBox;
145 // Segmentation cursor
146 QWidget* mySegmentationCursorBox;
148 QGroupBox* myOriginGroup;
149 QtxDoubleSpinBox* myXOriginSpinBox;
150 QtxDoubleSpinBox* myYOriginSpinBox;
151 QtxDoubleSpinBox* myZOriginSpinBox;
153 QGroupBox* myDirectionGroup;
154 QtxDoubleSpinBox* myDXDirectionSpinBox;
155 QtxDoubleSpinBox* myDYDirectionSpinBox;
156 QtxDoubleSpinBox* myDZDirectionSpinBox;
158 QGroupBox* myDepthGroup;
159 QtxDoubleSpinBox* myDepthSpinBox;
161 QGroupBox* myRadiusGroup;
162 QtxDoubleSpinBox* myRadiusSpinBox;
163 QtxDoubleSpinBox* myRatioSpinBox;
165 bool myIsPlaneSegmentation;
168 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
170 VISU_WidgetCtrl* myWidgetCtrl;
171 QtxAction* myPlaneAction;
172 QtxAction* mySphereAction;
175 QWidget* myGaussPointsBox;
177 VVTK_PrimitiveBox* myInsidePrimitiveBox;
178 VVTK_SizeBox* myInsideSizeBox;
180 QString myInsideMainTexture;
181 QString myInsideAlphaTexture;
183 vtkSmartPointer<VISU_InsideCursorSettings> myInsideCursorSettings;
185 VVTK_PrimitiveBox* myOutsidePrimitiveBox;
186 VVTK_SizeBox* myOutsideSizeBox;
188 QString myOutsideMainTexture;
189 QString myOutsideAlphaTexture;
191 vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
193 QLabel* myMagnificationLabel;
194 QtxIntSpinBox* myMagnificationSpinBox;
195 QLabel* myIncrementLabel;
196 QtxDoubleSpinBox* myIncrementSpinBox;