20 #ifndef ConstructionPlugin_Plane_H
21 #define ConstructionPlugin_Plane_H
23 #include "ConstructionPlugin.h"
25 #include <ModelAPI_Feature.h>
26 #include <ModelAPI_Result.h>
27 #include <GeomAPI_ICustomPrs.h>
28 #include <GeomAPI_Shape.h>
37 CONSTRUCTIONPLUGIN_EXPORT
virtual const std::string&
getKind()
46 static const std::string CONSTRUCTION_PLANE_COLOR(
"150,150,180");
47 return CONSTRUCTION_PLANE_COLOR;
53 static const std::string PLANE_COLOR_NAME(
"construction_plane_color");
54 return PLANE_COLOR_NAME;
58 inline static const std::string&
ID()
60 static const std::string CONSTRUCTION_PLANE_KIND(
"Plane");
61 return CONSTRUCTION_PLANE_KIND;
67 static const std::string MY_CREATION_METHOD_ID(
"creation_method");
68 return MY_CREATION_METHOD_ID;
74 static const std::string MY_CREATION_METHOD_ID(
"by_general_equation");
75 return MY_CREATION_METHOD_ID;
81 static const std::string MY_CREATION_METHOD_ID(
"by_three_points");
82 return MY_CREATION_METHOD_ID;
88 static const std::string MY_CREATION_METHOD_ID(
"by_line_and_point");
89 return MY_CREATION_METHOD_ID;
95 static const std::string MY_CREATION_METHOD_ID(
"by_other_plane");
96 return MY_CREATION_METHOD_ID;
102 static const std::string MY_CREATION_METHOD_ID(
"by_other_plane_option");
103 return MY_CREATION_METHOD_ID;
109 static const std::string MY_CREATION_METHOD_ID(
"by_distance_from_other");
110 return MY_CREATION_METHOD_ID;
116 static const std::string MY_CREATION_METHOD_ID(
"by_coincident_to_point");
117 return MY_CREATION_METHOD_ID;
123 static const std::string MY_CREATION_METHOD_ID(
"by_rotation");
124 return MY_CREATION_METHOD_ID;
130 static const std::string MY_CREATION_METHOD_ID(
"by_two_parallel_planes");
131 return MY_CREATION_METHOD_ID;
135 inline static const std::string&
POINT1()
137 static const std::string ATTR_ID(
"point1");
142 inline static const std::string&
POINT2()
144 static const std::string ATTR_ID(
"point2");
149 inline static const std::string&
POINT3()
151 static const std::string ATTR_ID(
"point3");
156 inline static const std::string&
LINE()
158 static const std::string ATTR_ID(
"line");
163 inline static const std::string&
POINT()
165 static const std::string ATTR_ID(
"point");
172 static const std::string ATTR_ID(
"perpendicular");
177 inline static const std::string&
PLANE()
179 static const std::string ATTR_ID(
"plane");
186 static const std::string ATTR_ID(
"distance");
193 static const std::string ATTR_ID(
"reverse");
200 static const std::string ATTR_ID(
"coincident_point");
205 inline static const std::string&
AXIS()
207 static const std::string ATTR_ID(
"axis");
212 inline static const std::string&
ANGLE()
214 static const std::string ATTR_ID(
"angle");
218 inline static const std::string& PLANE1()
220 static const std::string ATTR_ID(
"plane1");
224 inline static const std::string& PLANE2()
226 static const std::string ATTR_ID(
"plane2");
230 inline static const std::string& NB_COPIES()
232 static const std::string ATTR_ID(
"nb_copies");
237 inline static const std::string&
A()
239 static const std::string ATTR_ID(
"A");
243 inline static const std::string&
B()
245 static const std::string ATTR_ID(
"B");
249 inline static const std::string&
C()
251 static const std::string ATTR_ID(
"C");
255 inline static const std::string&
D()
257 static const std::string ATTR_ID(
"D");
262 CONSTRUCTIONPLUGIN_EXPORT
virtual void execute();
276 std::shared_ptr<GeomAPI_Shape> createByThreePoints();
277 std::shared_ptr<GeomAPI_Shape> createByLineAndPoint();
278 std::shared_ptr<GeomAPI_Shape> createByCoincidentPoint();
279 void createByRotation(ListOfShape& theShapes);
280 std::shared_ptr<GeomAPI_Shape> createByTwoParallelPlanes();
Feature for creation of the new planar surface in PartSet.
Definition: ConstructionPlugin_Plane.h:34
static const std::string & REVERSE()
Attribute name for reverse flag.
Definition: ConstructionPlugin_Plane.h:191
static const std::string & DEFAULT_COLOR()
Default color for a plane.
Definition: ConstructionPlugin_Plane.h:44
static const std::string & DISTANCE()
Attribute name for distance.
Definition: ConstructionPlugin_Plane.h:184
virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs)
Customize presentation of the feature.
Definition: ConstructionPlugin_Plane.cpp:163
static const std::string & CREATION_METHOD_BY_OTHER_PLANE()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:93
static const std::string & POINT()
Attribute name for point.
Definition: ConstructionPlugin_Plane.h:163
virtual void execute()
Creates a new part document if needed.
Definition: ConstructionPlugin_Plane.cpp:113
std::shared_ptr< GeomAPI_Shape > createByGeneralEquation()
Creates a new plane by general equation.
Definition: ConstructionPlugin_Plane.cpp:189
virtual const std::string & getKind()
Definition: ConstructionPlugin_Plane.h:37
static const std::string & POINT2()
Attribute name for second point.
Definition: ConstructionPlugin_Plane.h:142
void createByDistanceFromOther(ListOfShape &theShapes)
Creates a new plane by copy of face plane with translation along the normal to the specified distance...
Definition: ConstructionPlugin_Plane.cpp:295
static const std::string & AXIS()
Attribute name for axis.
Definition: ConstructionPlugin_Plane.h:205
static const std::string & CREATION_METHOD_BY_LINE_AND_POINT()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:86
static const std::string & ID()
Plane kind.
Definition: ConstructionPlugin_Plane.h:58
static const std::string & CREATION_METHOD_BY_OTHER_PLANE_OPTION()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:100
static const std::string & POINT1()
Attribute name for first point.
Definition: ConstructionPlugin_Plane.h:135
static const std::string & CREATION_METHOD_BY_GENERAL_EQUATION()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:72
static const std::string & POINT3()
Attribute name for third point.
Definition: ConstructionPlugin_Plane.h:149
static const std::string & CREATION_METHOD_BY_ROTATION()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:121
static const std::string & A()
Attribute name for a parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:237
static const std::string & LINE()
Attribute name for line.
Definition: ConstructionPlugin_Plane.h:156
static const std::string & COLOR_NAME()
Default color property name.
Definition: ConstructionPlugin_Plane.h:51
static const std::string & CREATION_METHOD_BY_THREE_POINTS()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:79
static const std::string & CREATION_METHOD_BY_DISTANCE_FROM_OTHER()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:107
static const std::string & C()
Attribute name for c parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:249
static const std::string & COINCIDENT_POINT()
Attribute name for coincident point.
Definition: ConstructionPlugin_Plane.h:198
static const std::string & PLANE()
Attribute name for selected plane.
Definition: ConstructionPlugin_Plane.h:177
static const std::string & CREATION_METHOD_BY_TWO_PARALLEL_PLANES()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:128
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:65
ConstructionPlugin_Plane()
Use plugin manager for features creation.
Definition: ConstructionPlugin_Plane.cpp:61
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: ConstructionPlugin_Plane.cpp:66
static const std::string & PERPENDICULAR()
Attribute name for perpendicular flag.
Definition: ConstructionPlugin_Plane.h:170
static const std::string & B()
Attribute name for b parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:243
static const std::string & D()
Attribute name for d parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:255
static const std::string & ANGLE()
Attribute name for angle.
Definition: ConstructionPlugin_Plane.h:212
static const std::string & CREATION_METHOD_BY_COINCIDENT_TO_POINT()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:114
Interface of a class which can provide specific customization of object presentation.
Definition: GeomAPI_ICustomPrs.h:37
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41