1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : MeasureGUI_AnnotationDlg.h
26 #ifndef MeasureGUI_AnnotationDlg_H
27 #define MeasureGUI_AnnotationDlg_H
29 #include <GEOMBase_Skeleton.h>
31 #include <GEOM_Annotation.hxx>
32 #include <GEOM_Constants.h>
33 #include <GEOMGUI_AnnotationAttrs.h>
35 #include <TopAbs_ShapeEnum.hxx>
36 //#include <TColStd_DataMapOfIntegerInteger.hxx>
37 //#include <TColStd_IndexedMapOfInteger.hxx>
38 //#include <TopTools_IndexedMapOfShape.hxx>
43 //#include <QTableWidget>
50 class SalomeApp_IntSpinBox;
51 class MeasureGUI_AnnotationInteractor;
53 //=================================================================================
54 // class : MeasureGUI_AnnotationDlg
56 //=================================================================================
57 class MeasureGUI_AnnotationDlg : public GEOMBase_Skeleton
62 MeasureGUI_AnnotationDlg ( GeometryGUI* theGeometryGUI,
63 const bool theIsCreate,
65 bool modal=false, Qt::WindowFlags fl=0 );
66 ~MeasureGUI_AnnotationDlg();
69 // redefined from GEOMBase_Helper
70 virtual GEOM::GEOM_IOperations_ptr createOperation();
71 virtual bool isValid ( QString& );
72 virtual bool execute ();
74 SALOME_Prs* buildPrs();
75 void updateSubShapeEnableState();
76 void redisplayPreview();
78 void closeEvent( QCloseEvent* theEv );
83 void SelectionIntoArgument();
84 void SetEditCurrentArgument();
88 void onSubShapeTypeChange();
90 void onDragged( Handle_GEOM_Annotation theAnnotation );
95 void activateSelectionArgument( QPushButton* theSelectionButton );
96 void activateSelection();
97 TopAbs_ShapeEnum getShapeType() const;
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 );
104 TopAbs_ShapeEnum mySelectionMode;
105 QString myEditAnnotationEntry;
106 int myEditAnnotationIndex;
107 GEOMGUI_AnnotationAttrs::Properties myAnnotationProperties;
108 bool myIsPositionDefined;
109 /// an index of edited annotation in the list shape annotations, -1 in create operation
111 GEOM::GeomObjPtr myShape;
113 QLineEdit* myTextEdit;
115 QPushButton* myShapeSelBtn;
116 // update shape name by shape selection if it has not been manually modified yet
117 bool myShapeNameModified;
118 QLineEdit* myShapeName;
119 QCheckBox* myIsScreenFixed;
121 QComboBox* mySubShapeTypeCombo;
123 QPushButton* mySubShapeSelBtn;
124 QLineEdit* mySubShapeName;
126 MeasureGUI_AnnotationInteractor* myInteractor;