]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionAPI/ConstructionAPI_Point.h
Salome HOME
fc7aed7a9a56d8952482245993574660c8e10f93
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Point.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
18 //
19
20 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
21 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
22
23 #include "ConstructionAPI.h"
24
25 #include <ConstructionPlugin_Point.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelAPI_AttributeDouble;
31 class ModelAPI_Document;
32 class ModelHighAPI_Double;
33
34 /// \class ConstructionAPI_Point
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Point feature.
37 class ConstructionAPI_Point: public ModelHighAPI_Interface
38 {
39 public:
40   /// Constructor without values.
41   CONSTRUCTIONAPI_EXPORT
42   explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
44   /// Constructor with values.
45   CONSTRUCTIONAPI_EXPORT
46   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                         const ModelHighAPI_Double& theX,
48                         const ModelHighAPI_Double& theY,
49                         const ModelHighAPI_Double& theZ);
50
51   /*/// Constructor with values.
52   CONSTRUCTIONAPI_EXPORT
53   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54                         const ModelHighAPI_Selection& theEdge,
55                         const ModelHighAPI_Double& theDistanceValue,
56                         const bool theDistancePercent = false,
57                         const bool theReverse = false);
58
59   /// Constructor with values.
60   CONSTRUCTIONAPI_EXPORT
61   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                         const ModelHighAPI_Selection& theObject1,
63                         const ModelHighAPI_Selection& theObject2);*/
64
65   /// Destructor.
66   CONSTRUCTIONAPI_EXPORT
67   virtual ~ConstructionAPI_Point();
68
69   INTERFACE_3(ConstructionPlugin_Point::ID(),
70               x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
71               y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
72               z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */)
73
74
75   /// Set point values.
76   CONSTRUCTIONAPI_EXPORT
77   void setByXYZ(const ModelHighAPI_Double & theX,
78                 const ModelHighAPI_Double & theY,
79                 const ModelHighAPI_Double & theZ);
80
81   /*/// Set edge and distance on it for point.
82   CONSTRUCTIONAPI_EXPORT
83   void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
84                            const ModelHighAPI_Double& theDistanceValue,
85                            const bool theDistancePercent = false,
86                            const bool theReverse = false);
87
88   /// Set point and plane for projection.
89   CONSTRUCTIONAPI_EXPORT
90   void setByProjection(const ModelHighAPI_Selection& theVertex,
91                        const ModelHighAPI_Selection& theFace);
92
93   /// Set lines for intersections.
94   CONSTRUCTIONAPI_EXPORT
95   void setByLinesIntersection(const ModelHighAPI_Selection& theEdge1,
96                               const ModelHighAPI_Selection& theEdge2);
97
98   /// Set line and plane for intersections.
99   CONSTRUCTIONAPI_EXPORT
100   void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
101                                      const ModelHighAPI_Selection& theFace);*/
102
103   /// Dump wrapped feature
104   CONSTRUCTIONAPI_EXPORT
105   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
106 };
107
108 /// Pointer on Point object.
109 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
110
111 /// \ingroup CPPHighAPI
112 /// \brief Create Point feature
113 CONSTRUCTIONAPI_EXPORT
114 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
115                   const ModelHighAPI_Double & theX,
116                   const ModelHighAPI_Double & theY,
117                   const ModelHighAPI_Double & theZ);
118
119 /*/// \ingroup CPPHighAPI
120 /// \brief Create Point feature
121 CONSTRUCTIONAPI_EXPORT
122 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
123                   const ModelHighAPI_Selection& theEdge,
124                   const ModelHighAPI_Double& theDistanceValue,
125                   const bool theDistancePercent = false,
126                   const bool theReverse = false);
127
128 /// \ingroup CPPHighAPI
129 /// \brief Create Point feature
130 CONSTRUCTIONAPI_EXPORT
131 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
132                   const ModelHighAPI_Selection& theObject1,
133                   const ModelHighAPI_Selection& theObject2);*/
134
135 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */