1 // Copyright (C) 2007-2015 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 #ifndef ENTITYGUI_POLYLINEDLG_H
24 #define ENTITYGUI_POLYLINEDLG_H
27 #include <GEOMBase_Skeleton.h>
29 class CurveCreator_Curve;
30 class CurveCreator_Widget;
35 //=================================================================================
36 // class : EntityGUI_PolylineDlg
38 //=================================================================================
39 class EntityGUI_PolylineDlg : public GEOMBase_Skeleton
45 EntityGUI_PolylineDlg (GeometryGUI*, QWidget* = 0,
46 bool = false, Qt::WindowFlags = 0);
48 virtual ~EntityGUI_PolylineDlg();
50 void deleteSelected();
55 // redefined from GEOMBase_Helper
56 virtual GEOM::GEOM_IOperations_ptr createOperation();
57 virtual bool isValid( QString& );
58 virtual bool execute( ObjectList& );
59 virtual QList<GEOM::GeomObjPtr> getSourceObjects();
65 void enterEvent(QEvent *);
68 * This method converts the curve into curve parameters required to
69 * construct an object using the interface
70 * GEOM_ICurvesOperations::MakePolyline2DOnPlane.
72 * \param theCurve a curve object, that contains data.
73 * \param theCoordsList the list of coordinates list. theCoordsList[0]
74 * is the coordinates list of the first section. theCoordsList[1]
75 * is for the second section etc. Output parameter.
76 * \param theNamesList the list of names. The order corresponds to
77 * theCoordsList. Output parameter.
78 * \param theTypesList the list of curve types. The order corresponds to
79 * theCoordsList. Output parameter.
80 * \param theClosedList the list of Closed flags. The order corresponds to
81 * theCoordsList. Output parameter.
83 void GetCurveParams(GEOM::ListOfListOfDouble &theCoords,
84 GEOM::string_array &theNames,
85 GEOM::short_array &theTypes,
86 GEOM::ListOfBool &theCloseds);
89 * This method returns the current local coordinate system.
91 * \return local coordinate system.
93 gp_Ax3 GetActiveLocalCS();
96 * This method returns the current working plane. Can be null.
98 * \return the current working plane.
100 GEOM::GeomObjPtr GetActiveWPlane();
103 * This method add a local coordinate system of the selected object.
105 * \param theSelectedObject the selected object. It can be a planar face
106 * or an inported polyline.
107 * \param IsPlane true for planar face; false for imported polyline.
108 * \param theLCS the local coordinate system.
110 void AddLocalCS(GEOM::GeomObjPtr theSelectedObject,
112 const gp_Ax3 &theLCS);
115 * This method converts the working plane object into
116 * the local coordinate system of the polyline.
118 * \param theGeomObj the working plane
119 * \return the local coordinate system
121 gp_Ax3 WPlaneToLCS(GEOM::GeomObjPtr theGeomObj);
127 void ClickOnCancel();
128 void processStartedSubOperation( QWidget*, bool );
129 void processFinishedSubOperation( QWidget* );
130 void SetEditCurrentArgument();
131 void SelectionIntoArgument();
132 void ActivateThisDialog();
133 void onUpdatePreview();
134 void ActivateLocalCS();
138 CurveCreator_Curve *myCurve;
139 CurveCreator_Widget *myEditorWidget;
140 QGroupBox *myAddElementBox;
141 QComboBox *myPlnComboBox;
142 QPushButton *myPlnButton;
143 QPushButton *myPlnSelButton;
144 QPushButton *myPolylineSelButton;
145 QLineEdit *myWPlaneLineEdit;
146 QLineEdit *myPolylineEdit;
147 QLineEdit *myEditCurrentArgument; /* Current LineEdit */
148 QList<gp_Ax3> myLCSList;
149 QList<GEOM::GeomObjPtr> myWPlaneList;
153 #endif // ENTITYGUI_POLYLINEDLG_H