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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
21 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
23 #include "ConstructionAPI.h"
25 #include <ConstructionPlugin_Point.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelAPI_AttributeDouble;
31 class ModelAPI_Document;
32 class ModelHighAPI_Double;
34 /// \class ConstructionAPI_Point
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Point feature.
37 class ConstructionAPI_Point: public ModelHighAPI_Interface
40 /// Constructor without values.
41 CONSTRUCTIONAPI_EXPORT
42 explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
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);
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);
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);*/
66 CONSTRUCTIONAPI_EXPORT
67 virtual ~ConstructionAPI_Point();
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 */)
76 CONSTRUCTIONAPI_EXPORT
77 void setByXYZ(const ModelHighAPI_Double & theX,
78 const ModelHighAPI_Double & theY,
79 const ModelHighAPI_Double & theZ);
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);
88 /// Set point and plane for projection.
89 CONSTRUCTIONAPI_EXPORT
90 void setByProjection(const ModelHighAPI_Selection& theVertex,
91 const ModelHighAPI_Selection& theFace);
93 /// Set lines for intersections.
94 CONSTRUCTIONAPI_EXPORT
95 void setByLinesIntersection(const ModelHighAPI_Selection& theEdge1,
96 const ModelHighAPI_Selection& theEdge2);
98 /// Set line and plane for intersections.
99 CONSTRUCTIONAPI_EXPORT
100 void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
101 const ModelHighAPI_Selection& theFace);*/
103 /// Dump wrapped feature
104 CONSTRUCTIONAPI_EXPORT
105 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
108 /// Pointer on Point object.
109 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
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);
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);
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);*/
135 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */