1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SALOME VTKViewer : build VTK viewer into Salome desktop
24 #ifndef SVTK_VIEWPARAMETERDLG_H
25 #define SVTK_VIEWPARAMETERDLG_H
29 #include <ViewerTools_DialogBase.h>
31 #include <vtkSmartPointer.h>
32 #include <vtkTimeStamp.h>
34 class SVTK_ViewWindow;
35 class SVTK_RenderWindowInteractor;
45 class vtkCallbackCommand;
48 class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
53 SVTK_ViewParameterDlg(QtxAction* theAction,
54 SVTK_ViewWindow* theParent,
57 ~SVTK_ViewParameterDlg();
62 SVTK_ViewWindow *myMainWindow;
63 SVTK_RenderWindowInteractor* myRWInteractor;
64 bool myIsObserverAdded;
67 QButtonGroup* myProjectionMode;
69 QPushButton* myToBBCenter;
70 QPushButton* myToOrigin;
71 QPushButton* mySelectPoint;
73 QFrame* myFocalCoords;
78 QButtonGroup* myCameraPositionMode;
80 QFrame* myCameraCoords;
85 QFrame* myProjDirection;
86 QLineEdit* myProjDirX;
87 QLineEdit* myProjDirY;
88 QLineEdit* myProjDirZ;
90 QLineEdit* myDistance;
92 QFrame* myViewDirection;
93 QLineEdit* myViewDirX;
94 QLineEdit* myViewDirY;
95 QLineEdit* myViewDirZ;
100 QFrame* myViewAngleBox;
101 QLineEdit* myViewAngle;
103 void setEnabled(QFrame* theWidget, const bool theState);
104 bool computePoint(const double start[3], const double dir[3],
105 const double dist, double result[3]);
106 void updateProjection();
107 void updateCoordinates();
111 //----------------------------------------------------------------------------
112 // Priority at which events are processed
115 // Used to process events
116 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
118 // Used to update camera
119 vtkTimeStamp myCameraMTime;
122 // Main process event method
123 static void ProcessEvents(vtkObject* object,
129 void onProjectionModeChanged(int);
130 void onPositionModeChanged(int);
134 void onSelectPoint();
136 void onFocalCoordChanged();
137 void onCameraCoordChanged();
138 void onDirectionChanged();
139 void onDistanceChanged();
140 void onViewDirectionChanged();
142 void onZoomChanged();
148 #endif // SVTK_VIEWPARAMETERDLG_H