Back to index

salome-gui  6.5.0
SVTK_ViewParameterDlg.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 
00024 #ifndef SVTK_VIEWPARAMETERDLG_H
00025 #define SVTK_VIEWPARAMETERDLG_H
00026 
00027 #include "SVTK.h"
00028 
00029 #include <ViewerTools_DialogBase.h>
00030 
00031 #include <vtkSmartPointer.h>
00032 #include <vtkTimeStamp.h>
00033 
00034 class SVTK_ViewWindow;
00035 class SVTK_RenderWindowInteractor;
00036 
00037 class QtxAction;
00038 
00039 class QLineEdit;
00040 class QPushButton;
00041 class QFrame;
00042 class QCheckBox;
00043 class QButtonGroup;
00044 
00045 class vtkCallbackCommand;
00046 class vtkObject;
00047 
00048 class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase
00049 {
00050   Q_OBJECT;
00051 
00052 public:
00053   SVTK_ViewParameterDlg(QtxAction* theAction,
00054                         SVTK_ViewWindow* theParent,
00055                         const char* theName);
00056 
00057   ~SVTK_ViewParameterDlg();
00058   
00059   void addObserver();
00060   
00061 protected:
00062   SVTK_ViewWindow *myMainWindow;
00063   SVTK_RenderWindowInteractor* myRWInteractor;
00064   bool myIsObserverAdded;
00065   bool myBusy;
00066   
00067   QButtonGroup* myProjectionMode;
00068 
00069   QPushButton*  myToBBCenter;
00070   QPushButton*  myToOrigin;
00071   QPushButton*  mySelectPoint;
00072 
00073   QFrame*       myFocalCoords;
00074   QLineEdit*    myFocalX;
00075   QLineEdit*    myFocalY;
00076   QLineEdit*    myFocalZ;
00077   
00078   QButtonGroup* myCameraPositionMode;
00079 
00080   QFrame*       myCameraCoords;
00081   QLineEdit*    myCameraX;
00082   QLineEdit*    myCameraY;
00083   QLineEdit*    myCameraZ;
00084 
00085   QFrame*       myProjDirection;
00086   QLineEdit*    myProjDirX;
00087   QLineEdit*    myProjDirY;
00088   QLineEdit*    myProjDirZ;
00089 
00090   QLineEdit*    myDistance;
00091 
00092   QFrame*       myViewDirection;
00093   QLineEdit*    myViewDirX;
00094   QLineEdit*    myViewDirY;
00095   QLineEdit*    myViewDirZ;
00096 
00097   QFrame*       myScaleBox;
00098   QLineEdit*    myScale;
00099 
00100   QFrame*       myViewAngleBox;
00101   QLineEdit*    myViewAngle;
00102 
00103   void setEnabled(QFrame* theWidget, const bool theState);
00104   bool computePoint(const double start[3], const double dir[3], 
00105                     const double dist, double result[3]);
00106   void updateProjection();
00107   void updateCoordinates();
00108 
00109   void updateData();
00110 
00111   //----------------------------------------------------------------------------
00112   // Priority at which events are processed
00113   vtkFloatingPointType myPriority;
00114 
00115   // Used to process events
00116   vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
00117 
00118   // Used to update camera
00119   vtkTimeStamp myCameraMTime;
00120 
00121   // Description:
00122   // Main process event method
00123   static void ProcessEvents(vtkObject* object, 
00124                             unsigned long event,
00125                             void* clientdata, 
00126                             void* calldata);
00127 
00128 protected slots:
00129   void onProjectionModeChanged(int);
00130   void onPositionModeChanged(int);
00131   
00132   void onToBBCenter();
00133   void onToOrigin();
00134   void onSelectPoint();
00135 
00136   void onFocalCoordChanged();
00137   void onCameraCoordChanged();
00138   void onDirectionChanged();
00139   void onDistanceChanged();
00140   void onViewDirectionChanged();
00141 
00142   void onZoomChanged();
00143 
00144   void onClickClose();
00145 
00146 };
00147 
00148 #endif // SVTK_VIEWPARAMETERDLG_H