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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
22 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
24 #include "ConstructionAPI.h"
26 #include <ConstructionPlugin_Point.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelAPI_AttributeDouble;
32 class ModelAPI_Document;
33 class ModelHighAPI_Double;
35 /// \class ConstructionAPI_Point
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Point feature.
38 class ConstructionAPI_Point: public ModelHighAPI_Interface
41 /// Constructor without values.
42 CONSTRUCTIONAPI_EXPORT
43 explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature);
45 /// Constructor with values.
46 CONSTRUCTIONAPI_EXPORT
47 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const ModelHighAPI_Double& theX,
49 const ModelHighAPI_Double& theY,
50 const ModelHighAPI_Double& theZ);
52 /*/// Constructor with values.
53 CONSTRUCTIONAPI_EXPORT
54 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const ModelHighAPI_Selection& theEdge,
56 const ModelHighAPI_Double& theDistanceValue,
57 const bool theDistancePercent = false,
58 const bool theReverse = false);
60 /// Constructor with values.
61 CONSTRUCTIONAPI_EXPORT
62 ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63 const ModelHighAPI_Selection& theObject1,
64 const ModelHighAPI_Selection& theObject2);*/
67 CONSTRUCTIONAPI_EXPORT
68 virtual ~ConstructionAPI_Point();
70 INTERFACE_3(ConstructionPlugin_Point::ID(),
71 x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */,
72 y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */,
73 z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */)
77 CONSTRUCTIONAPI_EXPORT
78 void setByXYZ(const ModelHighAPI_Double & theX,
79 const ModelHighAPI_Double & theY,
80 const ModelHighAPI_Double & theZ);
82 /*/// Set edge and distance on it for point.
83 CONSTRUCTIONAPI_EXPORT
84 void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
85 const ModelHighAPI_Double& theDistanceValue,
86 const bool theDistancePercent = false,
87 const bool theReverse = false);
89 /// Set point and plane for projection.
90 CONSTRUCTIONAPI_EXPORT
91 void setByProjection(const ModelHighAPI_Selection& theVertex,
92 const ModelHighAPI_Selection& theFace);
94 /// Set lines for intersections.
95 CONSTRUCTIONAPI_EXPORT
96 void setByLinesIntersection(const ModelHighAPI_Selection& theEdge1,
97 const ModelHighAPI_Selection& theEdge2);
99 /// Set line and plane for intersections.
100 CONSTRUCTIONAPI_EXPORT
101 void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge,
102 const ModelHighAPI_Selection& theFace);*/
104 /// Dump wrapped feature
105 CONSTRUCTIONAPI_EXPORT
106 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
109 /// Pointer on Point object.
110 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
112 /// \ingroup CPPHighAPI
113 /// \brief Create Point feature
114 CONSTRUCTIONAPI_EXPORT
115 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
116 const ModelHighAPI_Double & theX,
117 const ModelHighAPI_Double & theY,
118 const ModelHighAPI_Double & theZ);
120 /*/// \ingroup CPPHighAPI
121 /// \brief Create Point feature
122 CONSTRUCTIONAPI_EXPORT
123 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
124 const ModelHighAPI_Selection& theEdge,
125 const ModelHighAPI_Double& theDistanceValue,
126 const bool theDistancePercent = false,
127 const bool theReverse = false);
129 /// \ingroup CPPHighAPI
130 /// \brief Create Point feature
131 CONSTRUCTIONAPI_EXPORT
132 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
133 const ModelHighAPI_Selection& theObject1,
134 const ModelHighAPI_Selection& theObject2);*/
136 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */