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 // File : Sketcher_Utils.h
24 // Author : Sergey KHROMOV
27 #ifndef _Sketcher_Utils_HXX_
28 #define _Sketcher_Utils_HXX_
31 #include "Sketcher.hxx"
34 #include <TopoDS_Shape.hxx>
43 * This class represents a set of utils needed to compute sketcher geometry.
45 class SKETCHER_SALOME_EXPORT Sketcher_Utils
51 * This method makes a shape from the list of 2D coordinates on the working
52 * plane. The result represents a vertex if there is only one point
53 * in the contour. If there are more then one points the result is a wire
54 * consisting of linear segments between points. It is either closed or not
55 * depending on the flag IsClosed. In case of failure the result is a null
58 * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
59 * ..., xN, yN for N 2D points.
60 * \param IsClosed if Standard_True the first and last points are connected
61 * to form the closed contour.
62 * \param thePlane the working plane coordinate system.
63 * \return the result polyline.
65 static TopoDS_Shape MakePolyline(const std::list <double> &theCoords2D,
66 const Standard_Boolean IsClosed,
67 const gp_Ax3 &thePlane);
70 * This method makes a shape from the list of 2D coordinates on the working
71 * plane. The result represents a vertex if there is only one point
72 * in the contour. If there are more then one points the result is a wire
73 * consisting of a points interpolation BSpline curve. It is either closed
74 * or not depending on the flag IsClosed. In case of failure the result is
77 * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
78 * ..., xN, yN for N 2D points.
79 * \param IsClosed if Standard_True the first and last points are connected
80 * to form the closed contour.
81 * \param thePlane the working plane coordinate system.
82 * \return the result interpolation wire.
84 static TopoDS_Shape MakeInterpolation(const std::list <double> &theCoords2D,
85 const Standard_Boolean IsClosed,
86 const gp_Ax3 &thePlane);
89 * This method converts the list of 2D point coordinates into 3D points
90 * basing on the working plane. The result list contains not confused points.
92 * \param theCoords2D is the list of coordinates in the form x1, y1, x2, y2,
93 * ..., xN, yN for N 2D points.
94 * \param thePlane the working plane coordinate system.
95 * \param thePoints the list of 3D points.
97 static void To3D(const std::list <double> &theCoords2D,
98 const gp_Ax3 &thePlane,
99 std::list <gp_Pnt> &thePoints);