1 // VISU VISUGUI : GUI of VISU component
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : VVTK_SegmentationCursorDlg.h
8 // Author : Oleg Uvarov
11 #ifndef VVTK_SEGMENTATIONCURSORDLG_H
12 #define VVTK_SEGMENTATIONCURSORDLG_H
16 #include <vtkObject.h>
17 #include <vtkSmartPointer.h>
19 class vtkActorCollection;
20 class vtkCallbackCommand;
35 class VISU_GaussPtsAct1;
36 class VISU_InsideCursorSettings;
37 class VISU_OutsideCursorSettings;
38 class VISU_WidgetCtrl;
40 class VVTK_PrimitiveBox;
43 class SVTK_RenderWindowInteractor;
47 typedef vtkSmartPointer<vtkImageData> TTextureValue;
50 GetTexture(const QString& theMainTexture,
51 const QString& theAlphaTexture);
54 //! Segmentation Cursor Dialog.
56 * Uses for set up Segmentation and Outside Cursor Gauss Points preferenses
57 * and apply them to all actors in the current renderer.
59 class VVTK_SegmentationCursorDlg : public QDialog
64 VVTK_SegmentationCursorDlg( QWidget* parent = 0, const char* name = 0 );
65 ~VVTK_SegmentationCursorDlg();
67 void SetWidgetCtrl( VISU_WidgetCtrl* );
68 void SetPlaneAction( QtxAction* theAction ) { myPlaneAction = theAction; }
69 void SetSphereAction( QtxAction* theAction ) { mySphereAction = theAction; }
71 bool GetIsPlaneSegmentation() const { return myIsPlaneSegmentation; }
72 void SetIsPlaneSegmentation( bool on ) { myIsPlaneSegmentation = on; }
74 //! Update contents of the Segmentation tab.
75 void UpdateSegmentation();
76 void UpdateInsideGaussPoints();
77 void UpdateOutsideGaussPoints();
79 //! Update contents of the Outside Cursor tab.
80 void UpdateOutsideCursor();
82 VISU_InsideCursorSettings* GetInsideCursorSettings();
83 VISU_OutsideCursorSettings* GetOutsideCursorSettings();
85 vtkSmartPointer<vtkCallbackCommand> GetEventCallbackCommand() { return myEventCallbackCommand; }
87 void SetInteractor( SVTK_RenderWindowInteractor* theInteractor ) { myInteractor = theInteractor; }
90 float getMagnification() const;
91 void setMagnification( float );
93 float getIncrement() const;
94 void setIncrement( float );
97 void ApplySegmentationCursor();
98 void ApplyInsideGaussPoints();
99 void ApplyOutsideGaussPoints();
101 bool CheckNumberOfFaces();
104 MakeImageData( bool theInside,
105 const QString& theMainTexture,
106 const QString& theAlphaTexture );
109 static void ProcessEvents(vtkObject* theObject,
110 unsigned long theEvent,
115 virtual void done( int );
127 SVTK_RenderWindowInteractor* myInteractor;
129 QTabWidget* myTabBox;
131 // Segmentation cursor
132 QVBox* mySegmentationCursorBox;
134 QGroupBox* myOriginGroup;
135 QtxDblSpinBox* myXOriginSpinBox;
136 QtxDblSpinBox* myYOriginSpinBox;
137 QtxDblSpinBox* myZOriginSpinBox;
139 QGroupBox* myDirectionGroup;
140 QtxDblSpinBox* myDXDirectionSpinBox;
141 QtxDblSpinBox* myDYDirectionSpinBox;
142 QtxDblSpinBox* myDZDirectionSpinBox;
144 QGroupBox* myDepthGroup;
145 QtxDblSpinBox* myDepthSpinBox;
147 QGroupBox* myRadiusGroup;
148 QtxDblSpinBox* myRadiusSpinBox;
149 QtxDblSpinBox* myRatioSpinBox;
151 bool myIsPlaneSegmentation;
154 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
156 VISU_WidgetCtrl* myWidgetCtrl;
157 QtxAction* myPlaneAction;
158 QtxAction* mySphereAction;
161 QVBox* myGaussPointsBox;
163 VVTK_PrimitiveBox* myInsidePrimitiveBox;
164 VVTK_SizeBox* myInsideSizeBox;
166 QString myInsideMainTexture;
167 QString myInsideAlphaTexture;
169 vtkSmartPointer<VISU_InsideCursorSettings> myInsideCursorSettings;
171 VVTK_PrimitiveBox* myOutsidePrimitiveBox;
172 VVTK_SizeBox* myOutsideSizeBox;
174 QString myOutsideMainTexture;
175 QString myOutsideAlphaTexture;
177 vtkSmartPointer<VISU_OutsideCursorSettings> myOutsideCursorSettings;
179 QLabel* myMagnificationLabel;
180 QtxIntSpinBox* myMagnificationSpinBox;
181 QLabel* myIncrementLabel;
182 QtxDblSpinBox* myIncrementSpinBox;