1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GeometryGUI_PointDlg.h
25 // Author : Lucien PIGNOLONI
29 #ifndef DIALOGBOX_POINT_H
30 #define DIALOGBOX_POINT_H
32 #include "SALOME_Selection.h"
33 #include "GEOM_ShapeTypeFilter.hxx"
34 #include "GeometryGUI_SpinBox.h"
37 #include <TopoDS_Edge.hxx>
54 #include <AIS_Shape.hxx>
55 #include <AIS_InteractiveObject.hxx>
56 #include <AIS_InteractiveContext.hxx>
57 #include <AIS_ListIteratorOfListOfInteractive.hxx>
58 #include <AIS_Drawer.hxx>
61 //=================================================================================
62 // class : GeometryGUI_PointDlg
64 //=================================================================================
65 class GeometryGUI_PointDlg : public QDialog
70 GeometryGUI_PointDlg( QWidget* parent = 0, const char* name = 0,
71 SALOME_Selection* Sel = 0,
72 const Handle(AIS_InteractiveContext)& ic = 0,
76 ~GeometryGUI_PointDlg();
80 SALOME_Selection* mySelection ; /* Current selection */
81 TopoDS_Shape mySimulationTopoDs; /* Shape used to display a simulation */
82 gp_Pnt myPoint ; /* Is 'mySimulationTopoDs' */
83 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
84 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
86 /* Interactive and local context management see also : bool UseLocalContext() */
87 Handle (AIS_InteractiveContext) myIC ; /* Interactive context from IAPP */
88 Standard_Integer myLocalContextId ; /* identify a local context for this method */
89 TopAbs_ShapeEnum myLocalContextMode ; /* identify a selection mode into local context */
90 bool myUseLocalContext ; /* true when method as opened a local context */
92 int myConstructorId ; /* Current constructor id = radio button id */
93 double myParameter ; /* Parameter used to create a vertex on edge (point on curve) */
94 bool myOkEdge ; /* true when an edge is selected by user */
96 Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* filter for selection */
98 void Init(SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic) ; /* Initialize dialog */
99 void enterEvent(QEvent* e);
100 void closeEvent(QCloseEvent* e) ;
102 QButtonGroup* GroupConstructors;
103 QRadioButton* Constructor1;
104 QRadioButton* Constructor2;
106 QGroupBox* GroupCoordinates;
111 GeometryGUI_SpinBox* SpinBox_X ;
112 GeometryGUI_SpinBox* SpinBox_Y ;
113 GeometryGUI_SpinBox* SpinBox_Z ;
115 QGroupBox* GroupWithEdge;
116 QLabel* TextLabel_Edge;
117 QPushButton* SelectButton_Edge;
118 QLineEdit* LineEdit_Edge;
119 QLabel* TextLabel_Parameter;
120 GeometryGUI_SpinBox* SpinBox_Parameter;
122 QGroupBox* GroupButtons;
123 QPushButton* buttonApply;
124 QPushButton* buttonOk;
125 QPushButton* buttonCancel;
129 void ConstructorsClicked(int constructorId);
131 void ClickOnCancel();
133 void SetEditCurrentArgument() ;
134 void LineEditReturnPressed() ;
135 void SelectionIntoArgument() ;
136 void DeactivateActiveDialog() ;
137 void ActivateThisDialog() ;
138 void ValueChangedInSpinBox( double newValue ) ;
139 bool CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex) ;
142 void PointIntoCoordinates(gp_Pnt P, bool displayPoint) ;
143 bool UseLocalContext() ; /* return true if method has opened a local context */
146 QGridLayout* GeometryGUI_PointDlgLayout;
147 QGridLayout* GroupConstructorsLayout;
148 QGridLayout* GroupCoordinatesLayout;
149 QGridLayout* GroupWithEdgeLayout;
150 QGridLayout* GroupButtonsLayout;
153 #endif // DIALOGBOX_POINT_H