]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionAPI/ConstructionAPI_Point.h
Salome HOME
3e67ce80ee76ba397b534ee1424480c2692eead0
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Point.h
1 // Name   : ConstructionAPI_Point.h
2 // Purpose: 
3 //
4 // History:
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
9
10 #include "ConstructionAPI.h"
11
12 #include <ConstructionPlugin_Point.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelAPI_AttributeDouble;
18 class ModelAPI_Document;
19 class ModelHighAPI_Double;
20
21 /// \class ConstructionAPI_Point
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Point feature
24 class ConstructionAPI_Point: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values
28   CONSTRUCTIONAPI_EXPORT
29   explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values
32   CONSTRUCTIONAPI_EXPORT
33   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34                         const ModelHighAPI_Double& theX,
35                         const ModelHighAPI_Double& theY,
36                         const ModelHighAPI_Double& theZ);
37
38   /// Constructor with values
39   CONSTRUCTIONAPI_EXPORT
40   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                         const ModelHighAPI_Selection& theEdge,
42                         const ModelHighAPI_Double& theDistanceValue,
43                         const bool theDistancePercent = false,
44                         const bool theReverse = false);
45
46   /// Destructor
47   CONSTRUCTIONAPI_EXPORT
48   virtual ~ConstructionAPI_Point();
49
50   INTERFACE_8(ConstructionPlugin_Point::ID(),
51               creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
52               x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
53               y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
54               z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */,
55               edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */,
56               distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */,
57               distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */,
58               reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */
59   )
60
61   /// Set point values
62   CONSTRUCTIONAPI_EXPORT
63   void setByXYZ(const ModelHighAPI_Double & theX,
64                 const ModelHighAPI_Double & theY,
65                 const ModelHighAPI_Double & theZ);
66
67   /// Set edge and distance on it for point
68   CONSTRUCTIONAPI_EXPORT
69   void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
70                            const ModelHighAPI_Double& theDistanceValue,
71                            const bool theDistancePercent = false,
72                            const bool theReverse = false);
73 };
74
75 /// Pointer on Point object
76 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
77
78 /// \ingroup CPPHighAPI
79 /// \brief Create Point feature
80 CONSTRUCTIONAPI_EXPORT
81 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
82                   const ModelHighAPI_Double & theX,
83                   const ModelHighAPI_Double & theY,
84                   const ModelHighAPI_Double & theZ);
85
86 /// \ingroup CPPHighAPI
87 /// \brief Create Point feature
88 CONSTRUCTIONAPI_EXPORT
89 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
90                   const ModelHighAPI_Selection& theEdge,
91                   const ModelHighAPI_Double& theDistanceValue,
92                   const bool theDistancePercent = false,
93                   const bool theReverse = false);
94
95 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */