1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_PointBuilder.h
4 // Created: 02 Jun 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomAlgoAPI_PointBuilder_H_
8 #define GeomAlgoAPI_PointBuilder_H_
10 #include <GeomAlgoAPI.h>
19 /// \class GeomAlgoAPI_PointBuilder
21 /// \brief Allows to create vertex-shapes by different parameters
22 class GEOMALGOAPI_EXPORT GeomAlgoAPI_PointBuilder
25 /// Creates a vertex by point
26 static std::shared_ptr<GeomAPI_Vertex> vertex(const std::shared_ptr<GeomAPI_Pnt> thePoint);
28 /// Creates a vertex by point coordinates
29 static std::shared_ptr<GeomAPI_Vertex> vertex(const double theX,
33 /// \brief Creates vertex by edge and distance on it.
34 /// \param[in] theEdge edge.
35 /// \param[in] theValue distance value.
36 /// \param[in] theIsPercent if true theValue will be treated
37 /// as a percentage of theEdge total length.
38 /// \param[in] theIsReverse if true the distance will be measured from the edge end point.
39 /// \return created vertex.
40 static std::shared_ptr<GeomAPI_Vertex> vertexOnEdge(const std::shared_ptr<GeomAPI_Edge> theEdge,
41 const double theValue,
42 const bool theIsPercent = false,
43 const bool theIsReverse = false);
45 /// \brief Creates vertex by projection another vertex on plane.
46 /// \param[in] theVertex vertex to project.
47 /// \param[in] thePlane face for projection. Should be planar.
48 /// \return created vertex.
49 static std::shared_ptr<GeomAPI_Vertex>
50 vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
51 const std::shared_ptr<GeomAPI_Face> thePlane);
53 /// \brief Creates vertex by intersection two coplanar lines.
54 /// \param[in] theEdge1 first linear edge.
55 /// \param[in] theEdge2 second linear edge.
56 /// \return created vertex.
57 static std::shared_ptr<GeomAPI_Vertex>
58 vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge1,
59 const std::shared_ptr<GeomAPI_Edge> theEdge2);
61 /// \brief Creates vertex by intersection line and plane.
62 /// \param[in] theEdge linear edge.
63 /// \param[in] theFace planar face.
64 /// \return created vertex.
65 static std::shared_ptr<GeomAPI_Vertex>
66 vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge,
67 const std::shared_ptr<GeomAPI_Face> theFace);
69 /// Return point by shape vertex
70 static std::shared_ptr<GeomAPI_Pnt> point(const std::shared_ptr<GeomAPI_Shape> theVertex);