00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 // SALOME VTKViewer : build VTK viewer into Salome desktop 00021 // File : 00022 // Author : 00023 // Module : SALOME 00024 // $Header: 00025 // 00026 #ifndef SVTK_VIEWPARAMETERDLG_H 00027 #define SVTK_VIEWPARAMETERDLG_H 00028 00029 #include "SVTK.h" 00030 00031 #include <ViewerTools_DialogBase.h> 00032 00033 #include <vtkSmartPointer.h> 00034 #include <vtkTimeStamp.h> 00035 00036 class SVTK_ViewWindow; 00037 class SVTK_RenderWindowInteractor; 00038 00039 class QtxAction; 00040 00041 class QLineEdit; 00042 class QPushButton; 00043 class QFrame; 00044 class QCheckBox; 00045 class QButtonGroup; 00046 00047 class vtkCallbackCommand; 00048 class vtkObject; 00049 00050 class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase 00051 { 00052 Q_OBJECT; 00053 00054 public: 00055 SVTK_ViewParameterDlg(QtxAction* theAction, 00056 SVTK_ViewWindow* theParent, 00057 const char* theName); 00058 00059 ~SVTK_ViewParameterDlg(); 00060 00061 void addObserver(); 00062 00063 protected: 00064 SVTK_ViewWindow *myMainWindow; 00065 SVTK_RenderWindowInteractor* myRWInteractor; 00066 bool myIsObserverAdded; 00067 bool myBusy; 00068 00069 QButtonGroup* myProjectionMode; 00070 00071 QPushButton* myToBBCenter; 00072 QPushButton* myToOrigin; 00073 QPushButton* mySelectPoint; 00074 00075 QFrame* myFocalCoords; 00076 QLineEdit* myFocalX; 00077 QLineEdit* myFocalY; 00078 QLineEdit* myFocalZ; 00079 00080 QButtonGroup* myCameraPositionMode; 00081 00082 QFrame* myCameraCoords; 00083 QLineEdit* myCameraX; 00084 QLineEdit* myCameraY; 00085 QLineEdit* myCameraZ; 00086 00087 QFrame* myProjDirection; 00088 QLineEdit* myProjDirX; 00089 QLineEdit* myProjDirY; 00090 QLineEdit* myProjDirZ; 00091 00092 QLineEdit* myDistance; 00093 00094 QFrame* myViewDirection; 00095 QLineEdit* myViewDirX; 00096 QLineEdit* myViewDirY; 00097 QLineEdit* myViewDirZ; 00098 00099 QFrame* myScaleBox; 00100 QLineEdit* myScale; 00101 00102 QFrame* myViewAngleBox; 00103 QLineEdit* myViewAngle; 00104 00105 void setEnabled(QFrame* theWidget, const bool theState); 00106 bool computePoint(const double start[3], const double dir[3], 00107 const double dist, double result[3]); 00108 void updateProjection(); 00109 void updateCoordinates(); 00110 00111 void updateData(); 00112 00113 //---------------------------------------------------------------------------- 00114 // Priority at which events are processed 00115 vtkFloatingPointType myPriority; 00116 00117 // Used to process events 00118 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand; 00119 00120 // Used to update camera 00121 vtkTimeStamp myCameraMTime; 00122 00123 // Description: 00124 // Main process event method 00125 static void ProcessEvents(vtkObject* object, 00126 unsigned long event, 00127 void* clientdata, 00128 void* calldata); 00129 00130 protected slots: 00131 void onProjectionModeChanged(int); 00132 void onPositionModeChanged(int); 00133 00134 void onToBBCenter(); 00135 void onToOrigin(); 00136 void onSelectPoint(); 00137 00138 void onFocalCoordChanged(); 00139 void onCameraCoordChanged(); 00140 void onDirectionChanged(); 00141 void onDistanceChanged(); 00142 void onViewDirectionChanged(); 00143 00144 void onZoomChanged(); 00145 00146 void onClickClose(); 00147 00148 }; 00149 00150 #endif // SVTK_VIEWPARAMETERDLG_H