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 // SALOME VTKViewer : build VTK viewer into Salome desktop
28 #ifndef SVTK_VIEWPARAMETERDLG_H
29 #define SVTK_VIEWPARAMETERDLG_H
33 #include "SVTK_DialogBase.h"
35 #include <vtkSmartPointer.h>
36 #include <vtkTimeStamp.h>
38 class SVTK_ViewWindow;
39 class SVTK_RenderWindowInteractor;
49 class vtkCallbackCommand;
52 class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
57 SVTK_ViewParameterDlg(QtxAction* theAction,
58 SVTK_ViewWindow* theParent,
61 ~SVTK_ViewParameterDlg();
66 SVTK_ViewWindow *myMainWindow;
67 SVTK_RenderWindowInteractor* myRWInteractor;
68 bool myIsObserverAdded;
71 QButtonGroup* myProjectionMode;
73 QPushButton* myToBBCenter;
74 QPushButton* myToOrigin;
75 QPushButton* mySelectPoint;
77 QFrame* myFocalCoords;
82 QButtonGroup* myCameraPositionMode;
84 QFrame* myCameraCoords;
89 QFrame* myProjDirection;
90 QLineEdit* myProjDirX;
91 QLineEdit* myProjDirY;
92 QLineEdit* myProjDirZ;
94 QLineEdit* myDistance;
96 QFrame* myViewDirection;
97 QLineEdit* myViewDirX;
98 QLineEdit* myViewDirY;
99 QLineEdit* myViewDirZ;
104 QFrame* myViewAngleBox;
105 QLineEdit* myViewAngle;
107 void setEnabled(QFrame* theWidget, const bool theState);
108 bool computePoint(const double start[3], const double dir[3],
109 const double dist, double result[3]);
110 void updateProjection();
111 void updateCoordinates();
115 //----------------------------------------------------------------------------
116 // Priority at which events are processed
117 vtkFloatingPointType myPriority;
119 // Used to process events
120 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
122 // Used to update camera
123 vtkTimeStamp myCameraMTime;
126 // Main process event method
127 static void ProcessEvents(vtkObject* object,
133 void onProjectionModeChanged(int);
134 void onPositionModeChanged(int);
138 void onSelectPoint();
140 void onFocalCoordChanged();
141 void onCameraCoordChanged();
142 void onDirectionChanged();
143 void onDistanceChanged();
144 void onViewDirectionChanged();
146 void onZoomChanged();
152 #endif // SVTK_VIEWPARAMETERDLG_H