00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 00023 // GEOM GEOMGUI : GUI for Geometry component 00024 // File : BasicGUI_PointDlg.h 00025 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S. 00026 00027 #ifndef BASICGUI_POINTDLG_H 00028 #define BASICGUI_POINTDLG_H 00029 00030 #include "GEOMBase_Skeleton.h" 00031 #include "GEOM_GenericObjPtr.h" 00032 #include <QMap> 00033 00034 class DlgRef_2Sel1Spin; 00035 class DlgRef_3Spin; 00036 class DlgRef_2Sel; 00037 class DlgRef_1Sel3Spin; 00038 class DlgRef_1Sel2Spin; 00039 00040 class QLineEdit; 00041 class QGroupBox; 00042 class QButtonGroup; 00043 class QMenu; 00044 class QAction; 00045 00046 class gp_Pnt; 00047 00048 //================================================================================= 00049 // class : BasicGUI_PointDlg 00050 // purpose : 00051 //================================================================================= 00052 class BasicGUI_PointDlg : public GEOMBase_Skeleton 00053 { 00054 Q_OBJECT 00055 00056 public: 00057 BasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 ); 00058 00059 ~BasicGUI_PointDlg(); 00060 00061 bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); } 00062 void OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress() 00063 00064 protected: 00065 // redefined from GEOMBase_Helper 00066 virtual GEOM::GEOM_IOperations_ptr createOperation(); 00067 virtual bool isValid( QString& ); 00068 virtual bool execute( ObjectList& ); 00069 virtual void addSubshapesToStudy(); 00070 00071 private: 00072 void Init(); 00073 void enterEvent( QEvent* ); 00074 double getParameter() const; 00075 double getUParameter() const; 00076 double getVParameter() const; 00077 void updateParamCoord(bool theIsUpdate); 00078 00079 private: 00080 GEOM::GeomObjPtr myEdge; 00081 GEOM::GeomObjPtr myFace; 00082 GEOM::GeomObjPtr myRefPoint; 00083 GEOM::GeomObjPtr myLine1; 00084 GEOM::GeomObjPtr myLine2; 00085 00086 bool myBusy; 00087 00088 DlgRef_3Spin* GroupXYZ; 00089 DlgRef_1Sel3Spin* GroupRefPoint; 00090 DlgRef_2Sel1Spin* GroupOnCurve; 00091 DlgRef_2Sel* GroupLineIntersection; 00092 DlgRef_1Sel2Spin* GroupOnSurface; 00093 00094 QGroupBox* myCoordGrp; 00095 QLineEdit* myX; 00096 QLineEdit* myY; 00097 QLineEdit* myZ; 00098 00099 QGroupBox* myParamGroup; 00100 QButtonGroup* myParamCoord; 00101 00102 QMenu* myBtnPopup; 00103 QMap<QAction*, int> myActions; 00104 00105 TopAbs_ShapeEnum myNeedType; 00106 00107 private slots: 00108 void ClickOnOk(); 00109 bool ClickOnApply(); 00110 void ActivateThisDialog(); 00111 void DeactivateActiveDialog(); 00112 void SelectionIntoArgument(); 00113 void SetEditCurrentArgument(); 00114 void ConstructorsClicked( int ); 00115 void ValueChangedInSpinBox( double ); 00116 void SetDoubleSpinBoxStep( double ); 00117 void ClickParamCoord( int ); 00118 void CheckBoxClicked( int ); 00119 void onBtnPopup( QAction* ); 00120 void updateSize(); 00121 }; 00122 00123 #endif // BASICGUI_POINTDLG_H