1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GeomAlgoAPI_PointBuilder_H_
22 #define GeomAlgoAPI_PointBuilder_H_
24 #include <GeomAlgoAPI.h>
33 /// \class GeomAlgoAPI_PointBuilder
35 /// \brief Allows to create vertex-shapes by different parameters
36 class GEOMALGOAPI_EXPORT GeomAlgoAPI_PointBuilder
39 /// Creates a vertex by point
40 static std::shared_ptr<GeomAPI_Vertex> vertex(const std::shared_ptr<GeomAPI_Pnt> thePoint);
42 /// Creates a vertex by point coordinates
43 static std::shared_ptr<GeomAPI_Vertex> vertex(const double theX,
47 /// \brief Creates vertex by edge and distance on it.
48 /// \param[in] theEdge edge.
49 /// \param[in] theValue distance value.
50 /// \param[in] theIsPercent if true theValue will be treated
51 /// as a percentage of theEdge total length.
52 /// \param[in] theIsReverse if true the distance will be measured from the edge end point.
53 /// \return created vertex.
54 static std::shared_ptr<GeomAPI_Vertex> vertexOnEdge(const std::shared_ptr<GeomAPI_Edge> theEdge,
55 const double theValue,
56 const bool theIsPercent = false,
57 const bool theIsReverse = false);
59 /// \brief Creates vertex by projection another vertex on edge.
60 /// \param[in] theVertex vertex to project.
61 /// \param[in] theEdge edge for projection.
62 /// \return created vertex.
63 static std::shared_ptr<GeomAPI_Vertex>
64 vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
65 const std::shared_ptr<GeomAPI_Edge> theEdge);
67 /// \brief Creates vertex by projection another vertex on plane.
68 /// \param[in] theVertex vertex to project.
69 /// \param[in] theFace face for projection. Should be planar.
70 /// \return created vertex.
71 static std::shared_ptr<GeomAPI_Vertex>
72 vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
73 const std::shared_ptr<GeomAPI_Face> theFace);
75 /// \brief Creates vertex by intersection two coplanar lines.
76 /// \param[in] theEdge1 first linear edge.
77 /// \param[in] theEdge2 second linear edge.
78 /// \return created vertex.
79 static std::shared_ptr<GeomAPI_Vertex>
80 vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge1,
81 const std::shared_ptr<GeomAPI_Edge> theEdge2);
83 /// \brief Creates vertex by intersection line and plane.
84 /// \param[in] theEdge linear edge.
85 /// \param[in] theFace planar face.
86 /// \return created vertex.
87 static std::shared_ptr<GeomAPI_Vertex>
88 vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge,
89 const std::shared_ptr<GeomAPI_Face> theFace);
91 /// Return point by shape vertex
92 static std::shared_ptr<GeomAPI_Pnt> point(const std::shared_ptr<GeomAPI_Shape> theVertex);