1 // File : GeometryGUI_PointDlg.h
3 // Author : Lucien PIGNOLONI
5 // Module : GeometryGUI
6 // Copyright : OPEN CASCADE
10 #ifndef DIALOGBOX_POINT_H
11 #define DIALOGBOX_POINT_H
13 #include "SALOME_Selection.h"
14 #include "GEOM_ShapeTypeFilter.hxx"
15 #include "GeometryGUI_SpinBox.h"
18 #include <TopoDS_Edge.hxx>
35 #include <AIS_Shape.hxx>
36 #include <AIS_InteractiveObject.hxx>
37 #include <AIS_InteractiveContext.hxx>
38 #include <AIS_ListIteratorOfListOfInteractive.hxx>
39 #include <AIS_Drawer.hxx>
42 //=================================================================================
43 // class : GeometryGUI_PointDlg
45 //=================================================================================
46 class GeometryGUI_PointDlg : public QDialog
51 GeometryGUI_PointDlg( QWidget* parent = 0, const char* name = 0,
52 SALOME_Selection* Sel = 0,
53 const Handle(AIS_InteractiveContext)& ic = 0,
57 ~GeometryGUI_PointDlg();
61 SALOME_Selection* mySelection ; /* Current selection */
62 TopoDS_Shape mySimulationTopoDs; /* Shape used to display a simulation */
63 gp_Pnt myPoint ; /* Is 'mySimulationTopoDs' */
64 GeometryGUI* myGeomGUI ; /* Current GeomGUI object */
65 GEOM::GEOM_Gen_var myGeom ; /* Current GeomI object */
67 /* Interactive and local context management see also : bool UseLocalContext() */
68 Handle (AIS_InteractiveContext) myIC ; /* Interactive context from IAPP */
69 Standard_Integer myLocalContextId ; /* identify a local context for this method */
70 TopAbs_ShapeEnum myLocalContextMode ; /* identify a selection mode into local context */
71 bool myUseLocalContext ; /* true when method as opened a local context */
73 int myConstructorId ; /* Current constructor id = radio button id */
74 double myParameter ; /* Parameter used to create a vertex on edge (point on curve) */
75 bool myOkEdge ; /* true when an edge is selected by user */
77 Handle(GEOM_ShapeTypeFilter) myEdgeFilter; /* filter for selection */
79 void Init(SALOME_Selection* Sel, const Handle(AIS_InteractiveContext)& ic) ; /* Initialize dialog */
80 void enterEvent(QEvent* e);
81 void closeEvent(QCloseEvent* e) ;
83 QButtonGroup* GroupConstructors;
84 QRadioButton* Constructor1;
85 QRadioButton* Constructor2;
87 QGroupBox* GroupCoordinates;
92 GeometryGUI_SpinBox* SpinBox_X ;
93 GeometryGUI_SpinBox* SpinBox_Y ;
94 GeometryGUI_SpinBox* SpinBox_Z ;
96 QGroupBox* GroupWithEdge;
97 QLabel* TextLabel_Edge;
98 QPushButton* SelectButton_Edge;
99 QLineEdit* LineEdit_Edge;
100 QLabel* TextLabel_Parameter;
101 GeometryGUI_SpinBox* SpinBox_Parameter;
103 QGroupBox* GroupButtons;
104 QPushButton* buttonApply;
105 QPushButton* buttonOk;
106 QPushButton* buttonCancel;
110 void ConstructorsClicked(int constructorId);
112 void ClickOnCancel();
114 void SetEditCurrentArgument() ;
115 void LineEditReturnPressed() ;
116 void SelectionIntoArgument() ;
117 void DeactivateActiveDialog() ;
118 void ActivateThisDialog() ;
119 void ValueChangedInSpinBox( double newValue ) ;
120 bool CalculateVertexOnCurve(const TopoDS_Edge& anEdge, const Standard_Real aParameter, TopoDS_Shape& resultVertex) ;
123 void PointIntoCoordinates(gp_Pnt P, bool displayPoint) ;
124 bool UseLocalContext() ; /* return true if method has opened a local context */
127 QGridLayout* GeometryGUI_PointDlgLayout;
128 QGridLayout* GroupConstructorsLayout;
129 QGridLayout* GroupCoordinatesLayout;
130 QGridLayout* GroupWithEdgeLayout;
131 QGridLayout* GroupButtonsLayout;
134 #endif // DIALOGBOX_POINT_H