Salome HOME
Added option to create Construction Point by projection point on plane. Fixed CPP...
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_PointBuilder.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_PointBuilder.h
4 // Created:     02 Jun 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomAlgoAPI_PointBuilder_H_
8 #define GeomAlgoAPI_PointBuilder_H_
9
10 #include <GeomAlgoAPI.h>
11 #include <memory>
12
13 class GeomAPI_Edge;
14 class GeomAPI_Face;
15 class GeomAPI_Pnt;
16 class GeomAPI_Shape;
17 class GeomAPI_Vertex;
18
19 /// \class GeomAlgoAPI_PointBuilder
20 /// \ingroup DataAlgo
21 /// \brief Allows to create vertex-shapes by different parameters
22 class GEOMALGOAPI_EXPORT GeomAlgoAPI_PointBuilder
23 {
24 public:
25   /// Creates a vertex by point
26   static std::shared_ptr<GeomAPI_Vertex> vertex(const std::shared_ptr<GeomAPI_Pnt> thePoint);
27
28   /// Creates a vertex by point coordinates
29   static std::shared_ptr<GeomAPI_Vertex> vertex(const double theX,
30                                                 const double theY,
31                                                 const double theZ);
32
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 as a percentage of theEdge total length.
37   /// \param[in] theIsReverse if true the distance will be measured from the edge end point.
38   /// \return created vertex.
39   static std::shared_ptr<GeomAPI_Vertex> vertexOnEdge(const std::shared_ptr<GeomAPI_Edge> theEdge,
40                                                       const double theValue,
41                                                       const bool theIsPercent = false,
42                                                       const bool theIsReverse = false);
43
44   /// \brief Creates vertex by projection another vertex on plane.
45   /// \param[in] theVertex vertex to project.
46   /// \param[in] thePlane face for projection. Should be planar.
47   /// \return created vertex.
48   static std::shared_ptr<GeomAPI_Vertex> vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
49                                                             const std::shared_ptr<GeomAPI_Face> thePlane);
50
51   /// Return point by shape vertex
52   static std::shared_ptr<GeomAPI_Pnt> point(const std::shared_ptr<GeomAPI_Shape> theVertex);
53 };
54
55 #endif