SHAPER 9.16.0
FeaturesPlugin_Placement.h
1// Copyright (C) 2014-2026 CEA, EDF
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
18//
19
20#ifndef FeaturesPlugin_Placement_H_
21#define FeaturesPlugin_Placement_H_
22
23#include "FeaturesPlugin.h"
24#include <ModelAPI_Feature.h>
25#include <GeomAlgoAPI_Placement.h>
26#include <GeomAlgoAPI_Transform.h>
27
29class GeomAPI_Shape;
30
40{
41 public:
43 inline static const std::string& ID()
44 {
45 static const std::string MY_PLACEMENT_ID("Placement");
46 return MY_PLACEMENT_ID;
47 }
48
51 inline static const std::string& OBJECTS_LIST_ID()
52 {
53 static const std::string MY_OBJECTS_LIST_ID("placement_objects_list");
54 return MY_OBJECTS_LIST_ID;
55 }
56
58 inline static const std::string& START_SHAPE_ID()
59 {
60 static const std::string MY_START_SHAPE_ID("placement_start_shape");
61 return MY_START_SHAPE_ID;
62 }
64 inline static const std::string& END_SHAPE_ID()
65 {
66 static const std::string MY_END_SHAPE_ID("placement_end_shape");
67 return MY_END_SHAPE_ID;
68 }
70 inline static const std::string& REVERSE_ID()
71 {
72 static const std::string MY_REVERSE_ID("placement_reverse_direction");
73 return MY_REVERSE_ID;
74 }
76 inline static const std::string& CENTERING_ID()
77 {
78 static const std::string MY_CENTERING_ID("placement_centering");
79 return MY_CENTERING_ID;
80 }
81
83 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
84 {
85 static std::string MY_KIND = FeaturesPlugin_Placement::ID();
86 return MY_KIND;
87 }
88
90 FEATURESPLUGIN_EXPORT virtual void execute();
91
93 FEATURESPLUGIN_EXPORT virtual void initAttributes();
94
97private:
99 bool isShapeValid(GeomShapePtr theShape);
100};
101
102#endif
Feature for applying of placement operation: relative movement of Solid.
Definition: FeaturesPlugin_Placement.h:40
FeaturesPlugin_Placement()
Use plugin manager for features creation.
Definition: FeaturesPlugin_Placement.cpp:46
static const std::string & END_SHAPE_ID()
attribute name of attractable face
Definition: FeaturesPlugin_Placement.h:64
static const std::string & REVERSE_ID()
attribute name of flag of reverse direction
Definition: FeaturesPlugin_Placement.h:70
static const std::string & CENTERING_ID()
attribute name of flag of centering position
Definition: FeaturesPlugin_Placement.h:76
static const std::string & START_SHAPE_ID()
attribute name of referenced object
Definition: FeaturesPlugin_Placement.h:58
virtual void execute()
Performs the algorithm and stores results it in the data structure.
Definition: FeaturesPlugin_Placement.cpp:67
static const std::string & ID()
Placement kind.
Definition: FeaturesPlugin_Placement.h:43
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: FeaturesPlugin_Placement.h:83
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: FeaturesPlugin_Placement.cpp:50
static const std::string & OBJECTS_LIST_ID()
attribute name of references sketch entities list, it should contain a sketch result or a pair a sket...
Definition: FeaturesPlugin_Placement.h:51
Interface to the topological shape object.
Definition: GeomAPI_Shape.h:43
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:41
The body (shape) result of a feature.
Definition: ModelAPI_ResultBody.h:43