1 // Copyright (C) 2009-2013 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;
129 virtual void onHelpRequested();
134 void ActivateThisDialog();
135 void DeactivateActiveDialog();
136 void SelectionIntoArgument();
137 void SetEditCurrentArgument();
138 void ConstructorsClicked( int );
139 void ValueChangedInSpinBox( double );
140 void SetDoubleSpinBoxStep( double );
141 void ClickParamCoord( int );
142 void CheckBoxClicked( int );
143 void onBtnPopup( QAction* );
148 void setDocumentModel( HEXABLOCK::GUI::DocumentModel* m );
149 void setPatternDataSelectionModel( HEXABLOCK::GUI::PatternDataSelectionModel* s );
150 bool onAccept( const bool publish = true, const bool useTransaction = true );
154 virtual bool eventFilter( QObject *obj, QEvent *event );
155 virtual void hideEvent ( QHideEvent * event );
156 virtual void showEvent ( QShowEvent * event );
157 void _initInputWidget();
158 void _initViewManager();
159 void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
160 bool _isLineOrListWidget(QObject*);
163 void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel );
164 void onWindowActivated( SUIT_ViewManager* vm );
165 void updateHelpFileName();
169 HEXABLOCK::GUI::DocumentModel* _documentModel;
170 HEXABLOCK::GUI::PatternDataSelectionModel* _patternDataSelectionModel;
171 // QLineEdit* _vertex_le;
173 QObject* _currentObj;
174 bool _selectionMutex;
182 #endif // MYBASICGUI_POINTDLG_H