1 // Copyright (C) 2007-2013 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.
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& );
64 void enterEvent(QEvent *);
67 * This method converts the curve into curve parameters required to
68 * construct an object using the interface
69 * GEOM_ICurvesOperations::MakePolyline2DOnPlane.
71 * \param theCurve a curve object, that contains data.
72 * \param theCoordsList the list of coordinates list. theCoordsList[0]
73 * is the coordinates list of the first section. theCoordsList[1]
74 * is for the second section etc. Output parameter.
75 * \param theNamesList the list of names. The order corresponds to
76 * theCoordsList. Output parameter.
77 * \param theTypesList the list of curve types. The order corresponds to
78 * theCoordsList. Output parameter.
79 * \param theClosedList the list of Closed flags. The order corresponds to
80 * theCoordsList. Output parameter.
82 void GetCurveParams(GEOM::ListOfListOfDouble &theCoords,
83 GEOM::string_array &theNames,
84 GEOM::short_array &theTypes,
85 GEOM::ListOfBool &theCloseds);
88 * This method returns the current local coordinate system.
90 * \return local coordinate system.
92 gp_Ax3 GetActiveLocalCS();
95 * This method returns the current working plane. Can be null.
97 * \return the current working plane.
99 GEOM::GeomObjPtr GetActiveWPlane();
102 * This method add a local coordinate system of the selected object.
104 * \param theSelectedObject the selected object. It can be a planar face
105 * or an inported polyline.
106 * \param IsPlane true for planar face; false for imported polyline.
107 * \param theLCS the local coordinate system.
109 void AddLocalCS(GEOM::GeomObjPtr theSelectedObject,
111 const gp_Ax3 &theLCS);
114 * This method converts the working plane object into
115 * the local coordinate system of the polyline.
117 * \param theGeomObj the working plane
118 * \return the local coordinate system
120 gp_Ax3 WPlaneToLCS(GEOM::GeomObjPtr theGeomObj);
126 void ClickOnCancel();
127 void processStartedSubOperation( QWidget*, bool );
128 void processFinishedSubOperation( QWidget* );
129 void SetEditCurrentArgument();
130 void SelectionIntoArgument();
131 void ActivateThisDialog();
132 void onUpdatePreview();
133 void ActivateLocalCS();
137 CurveCreator_Curve *myCurve;
138 CurveCreator_Widget *myEditorWidget;
139 QGroupBox *myAddElementBox;
140 QComboBox *myPlnComboBox;
141 QPushButton *myPlnButton;
142 QPushButton *myPlnSelButton;
143 QPushButton *myPolylineSelButton;
144 QLineEdit *myWPlaneLineEdit;
145 QLineEdit *myPolylineEdit;
146 QLineEdit *myEditCurrentArgument; /* Current LineEdit */
147 QList<gp_Ax3> myLCSList;
148 QList<GEOM::GeomObjPtr> myWPlaneList;
152 #endif // ENTITYGUI_POLYLINEDLG_H