1 // Copyright (C) 2009-2012 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef MYBASICGUI_POINTDLG_H
22 #define MYBASICGUI_POINTDLG_H
27 #include "MyGEOMBase_Skeleton.hxx"
28 #include "GEOM_GenericObjPtr.h"
31 class DlgRef_2Sel1Spin;
34 class DlgRef_1Sel3Spin;
35 class DlgRef_1Sel2Spin;
45 #include <QItemSelection>
46 #include <SUIT_ViewManager.h>
47 #include <SUIT_Session.h>
48 #include <OCCViewer_ViewWindow.h>
49 #include <OCCViewer_ViewManager.h>
50 // #include <VTKViewer_ViewModel.h>
54 #include "SVTK_Selection.h"
55 #include <SVTK_ViewModel.h>
61 class PatternDataSelectionModel;
66 //=================================================================================
67 // class : MyBasicGUI_PointDlg
69 //=================================================================================
70 typedef class MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
75 MyBasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
76 ~MyBasicGUI_PointDlg();
78 bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); }
79 void OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress()
82 // redefined from GEOMBase_Helper
84 virtual GEOM::GEOM_IOperations_ptr createOperation();
85 virtual bool isValid( QString& );
86 virtual bool execute( ObjectList& );
87 virtual void addSubshapesToStudy();
91 void enterEvent( QEvent* );
92 double getParameter() const;
93 double getUParameter() const;
94 double getVParameter() const;
95 void updateParamCoord(bool theIsUpdate);
98 GEOM::GeomObjPtr myEdge;
99 GEOM::GeomObjPtr myFace;
100 GEOM::GeomObjPtr myRefPoint;
101 GEOM::GeomObjPtr myLine1;
102 GEOM::GeomObjPtr myLine2;
106 DlgRef_3Spin* GroupXYZ;
107 DlgRef_1Sel3Spin* GroupRefPoint;
108 DlgRef_2Sel1Spin* GroupOnCurve;
109 DlgRef_2Sel* GroupLineIntersection;
110 DlgRef_1Sel2Spin* GroupOnSurface;
112 QGroupBox* myCoordGrp;
119 QGroupBox* myParamGroup;
120 QButtonGroup* myParamCoord;
123 QMap<QAction*, int> myActions;
125 TopAbs_ShapeEnum myNeedType;
130 void ActivateThisDialog();
131 void DeactivateActiveDialog();
132 void SelectionIntoArgument();
133 void SetEditCurrentArgument();
134 void ConstructorsClicked( int );
135 void ValueChangedInSpinBox( double );
136 void SetDoubleSpinBoxStep( double );
137 void ClickParamCoord( int );
138 void CheckBoxClicked( int );
139 void onBtnPopup( QAction* );
145 void setDocumentModel( HEXABLOCK::GUI::DocumentModel* m );
146 void setPatternDataSelectionModel( HEXABLOCK::GUI::PatternDataSelectionModel* s );
148 bool onAccept( const bool publish = true, const bool useTransaction = true );
152 virtual bool eventFilter( QObject *obj, QEvent *event );
153 virtual void hideEvent ( QHideEvent * event );
154 virtual void showEvent ( QShowEvent * event );
155 void _initInputWidget();
156 void _initViewManager();
157 void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
158 bool _isLineOrListWidget(QObject*);
161 void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel );
162 void onWindowActivated( SUIT_ViewManager* vm );
166 HEXABLOCK::GUI::DocumentModel* _documentModel;
167 HEXABLOCK::GUI::PatternDataSelectionModel* _patternDataSelectionModel;
168 LightApp_SelectionMgr* _mgr;
169 SUIT_ViewManager* _vtkVm;
170 SUIT_ViewManager* _occVm;
171 // QLineEdit* _vertex_le;
173 QObject* _currentObj;
174 bool _selectionMutex;
182 #endif // MYBASICGUI_POINTDLG_H