Version: 9.12.0
MeasureGUI_AnnotationDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : MeasureGUI_AnnotationDlg.h
25 
26 #ifndef MeasureGUI_AnnotationDlg_H
27 #define MeasureGUI_AnnotationDlg_H
28 
29 #include <GEOMBase_Skeleton.h>
30 
31 #include <GEOM_Annotation.hxx>
32 #include <GEOM_Constants.h>
34 
35 #include <TopAbs_ShapeEnum.hxx>
36 //#include <TColStd_DataMapOfIntegerInteger.hxx>
37 //#include <TColStd_IndexedMapOfInteger.hxx>
38 //#include <TopTools_IndexedMapOfShape.hxx>
39 
40 //#include <QMap>
41 //#include <QSet>
42 //#include <QVector>
43 //#include <QTableWidget>
44 
45 class QGroupBox;
46 class QLineEdit;
47 class QPushButton;
48 class QComboBox;
49 class QCheckBox;
50 class SalomeApp_IntSpinBox;
52 
53 //=================================================================================
54 // class : MeasureGUI_AnnotationDlg
55 // purpose :
56 //=================================================================================
58 {
59  Q_OBJECT
60 
61 public:
62  MeasureGUI_AnnotationDlg ( GeometryGUI* theGeometryGUI,
63  const bool theIsCreate,
64  QWidget* parent=0,
65  bool modal=false, Qt::WindowFlags fl=0 );
67 
68 protected:
69  // redefined from GEOMBase_Helper
70  virtual GEOM::GEOM_IOperations_ptr createOperation();
71  virtual bool isValid ( QString& );
72  virtual bool execute ();
73 
74  SALOME_Prs* buildPrs();
76  void redisplayPreview();
77 
78  void closeEvent( QCloseEvent* theEv );
79 
80 private slots:
81  void ClickOnOk();
82  bool ClickOnApply();
83  void SelectionIntoArgument();
85 
86  void onTextChange();
87  void onTypeChange();
88  void onSubShapeTypeChange();
89 
90  void onDragged( Handle_GEOM_Annotation theAnnotation );
91 
92 private:
93  void Init();
94 
95  void activateSelectionArgument( QPushButton* theSelectionButton );
96  void activateSelection();
97  TopAbs_ShapeEnum getShapeType() const;
98 
99  bool getPickedPoint( gp_Pnt& thePnt, const TopoDS_Shape& theShape );
100  gp_Pnt getAttachPoint( const TopoDS_Shape& theShape, bool& theIsOk );
101  gp_Pnt getDefaultPosition( const gp_Pnt& theAttach );
102 
103 private:
104  TopAbs_ShapeEnum mySelectionMode;
112 
113  QLineEdit* myTextEdit;
114 
115  QPushButton* myShapeSelBtn;
116  // update shape name by shape selection if it has not been manually modified yet
118  QLineEdit* myShapeName;
119  QCheckBox* myIsScreenFixed;
120 
122 
123  QPushButton* mySubShapeSelBtn;
124  QLineEdit* mySubShapeName;
125 
127 };
128 
129 #endif
Definition: GEOMBase_Skeleton.h:53
Definition: GeometryGUI.h:74
Definition: MeasureGUI_AnnotationDlg.h:58
void onTypeChange()
Definition: MeasureGUI_AnnotationDlg.cxx:619
bool myShapeNameModified
Definition: MeasureGUI_AnnotationDlg.h:117
bool ClickOnApply()
Definition: MeasureGUI_AnnotationDlg.cxx:378
void activateSelectionArgument(QPushButton *theSelectionButton)
Definition: MeasureGUI_AnnotationDlg.cxx:446
QCheckBox * myIsScreenFixed
Definition: MeasureGUI_AnnotationDlg.h:119
TopAbs_ShapeEnum getShapeType() const
Definition: MeasureGUI_AnnotationDlg.cxx:356
gp_Pnt getDefaultPosition(const gp_Pnt &theAttach)
Definition: MeasureGUI_AnnotationDlg.cxx:978
~MeasureGUI_AnnotationDlg()
Definition: MeasureGUI_AnnotationDlg.cxx:209
void onDragged(Handle_GEOM_Annotation theAnnotation)
Definition: MeasureGUI_AnnotationDlg.cxx:694
QLineEdit * myShapeName
Definition: MeasureGUI_AnnotationDlg.h:118
bool getPickedPoint(gp_Pnt &thePnt, const TopoDS_Shape &theShape)
Definition: MeasureGUI_AnnotationDlg.cxx:888
QLineEdit * mySubShapeName
Definition: MeasureGUI_AnnotationDlg.h:124
QComboBox * mySubShapeTypeCombo
Definition: MeasureGUI_AnnotationDlg.h:121
int myEditAnnotationIndex
Definition: MeasureGUI_AnnotationDlg.h:106
MeasureGUI_AnnotationDlg(GeometryGUI *theGeometryGUI, const bool theIsCreate, QWidget *parent=0, bool modal=false, Qt::WindowFlags fl=0)
Definition: MeasureGUI_AnnotationDlg.cxx:112
MeasureGUI_AnnotationInteractor * myInteractor
Definition: MeasureGUI_AnnotationDlg.h:126
virtual bool execute()
Definition: MeasureGUI_AnnotationDlg.cxx:765
void SelectionIntoArgument()
Definition: MeasureGUI_AnnotationDlg.cxx:482
void closeEvent(QCloseEvent *theEv)
Definition: MeasureGUI_AnnotationDlg.cxx:595
void activateSelection()
Definition: MeasureGUI_AnnotationDlg.cxx:344
SALOME_Prs * buildPrs()
Definition: MeasureGUI_AnnotationDlg.cxx:802
void SetEditCurrentArgument()
Definition: MeasureGUI_AnnotationDlg.cxx:431
QLineEdit * myTextEdit
Definition: MeasureGUI_AnnotationDlg.h:113
void redisplayPreview()
Definition: MeasureGUI_AnnotationDlg.cxx:845
void ClickOnOk()
Definition: MeasureGUI_AnnotationDlg.cxx:366
bool myIsCreation
an index of edited annotation in the list shape annotations, -1 in create operation
Definition: MeasureGUI_AnnotationDlg.h:110
void Init()
Definition: MeasureGUI_AnnotationDlg.cxx:217
QPushButton * myShapeSelBtn
Definition: MeasureGUI_AnnotationDlg.h:115
void onSubShapeTypeChange()
Definition: MeasureGUI_AnnotationDlg.cxx:670
GEOMGUI_AnnotationAttrs::Properties myAnnotationProperties
Definition: MeasureGUI_AnnotationDlg.h:107
void onTextChange()
Definition: MeasureGUI_AnnotationDlg.cxx:607
bool myIsPositionDefined
Definition: MeasureGUI_AnnotationDlg.h:108
virtual bool isValid(QString &)
Definition: MeasureGUI_AnnotationDlg.cxx:733
TopAbs_ShapeEnum mySelectionMode
Definition: MeasureGUI_AnnotationDlg.h:104
QPushButton * mySubShapeSelBtn
Definition: MeasureGUI_AnnotationDlg.h:123
GEOM::GeomObjPtr myShape
Definition: MeasureGUI_AnnotationDlg.h:111
gp_Pnt getAttachPoint(const TopoDS_Shape &theShape, bool &theIsOk)
Definition: MeasureGUI_AnnotationDlg.cxx:923
void updateSubShapeEnableState()
Definition: MeasureGUI_AnnotationDlg.cxx:830
virtual GEOM::GEOM_IOperations_ptr createOperation()
Definition: MeasureGUI_AnnotationDlg.cxx:724
QString myEditAnnotationEntry
Definition: MeasureGUI_AnnotationDlg.h:105
Class implementing logical layer for interactive dragging of annotation labels. It includes two compo...
Definition: MeasureGUI_AnnotationInteractor.h:51
GenericObjPtr< GEOM::GEOM_Object > GeomObjPtr
Definition: GEOM_GenericObjPtr.h:218
Definition: GEOMGUI_AnnotationAttrs.h:79