SHAPER 9.16.0
FeaturesAPI_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 FeaturesAPI_Placement_H_
21#define FeaturesAPI_Placement_H_
22
23#include "FeaturesAPI.h"
24
25#include <FeaturesPlugin_Placement.h>
26
27#include <ModelHighAPI_Interface.h>
28#include <ModelHighAPI_Macro.h>
29
32
37{
38public:
40 FEATURESAPI_EXPORT
41 explicit FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
44 FEATURESAPI_EXPORT
45 FeaturesAPI_Placement(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const std::list<ModelHighAPI_Selection>& theObjects,
47 const ModelHighAPI_Selection& theStartShape,
48 const ModelHighAPI_Selection& theEndShape,
49 const bool theReverseDirection = false,
50 const bool theCentering = false);
51
53 FEATURESAPI_EXPORT
54 virtual ~FeaturesAPI_Placement();
55
56 INTERFACE_5(FeaturesPlugin_Placement::ID(),
67
68
69 FEATURESAPI_EXPORT
70 void setObjects(const std::list<ModelHighAPI_Selection>& theObjects);
71
73 FEATURESAPI_EXPORT
74 void setStartShape(const ModelHighAPI_Selection& theStartShape);
75
77 FEATURESAPI_EXPORT
78 void setEndShape(const ModelHighAPI_Selection& theEndShape);
79
81 FEATURESAPI_EXPORT
82 void setReverseDirection(const bool theReverseDirection);
83
85 FEATURESAPI_EXPORT
86 void setCentering(const bool theCentering);
87
89 FEATURESAPI_EXPORT
90 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
91};
92
94typedef std::shared_ptr<FeaturesAPI_Placement> PlacementPtr;
95
98FEATURESAPI_EXPORT
99PlacementPtr addPlacement(const std::shared_ptr<ModelAPI_Document>& thePart,
100 const std::list<ModelHighAPI_Selection>& theObjects,
101 const ModelHighAPI_Selection& theStartShape,
102 const ModelHighAPI_Selection& theEndShape,
103 const bool reverse = false,
104 const bool centering = false,
105 const bool keepSubResults = false);
106
107#endif // FeaturesAPI_Placement_H_
Interface for Placement feature.
Definition: FeaturesAPI_Placement.h:37
void setObjects(const std::list< ModelHighAPI_Selection > &theObjects)
Set objects.
Definition: FeaturesAPI_Placement.cpp:57
virtual ~FeaturesAPI_Placement()
Destructor.
Definition: FeaturesAPI_Placement.cpp:51
virtual std::shared_ptr< ModelAPI_AttributeSelection > endShape() const
End shape.
Definition: FeaturesAPI_Placement.h:66
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reverseDirection() const
Reverse direction flag.
Definition: FeaturesAPI_Placement.h:66
virtual std::shared_ptr< ModelAPI_AttributeSelectionList > objects() const
Main objects.
Definition: FeaturesAPI_Placement.h:66
virtual std::shared_ptr< ModelAPI_AttributeSelection > startShape() const
Start shape.
Definition: FeaturesAPI_Placement.h:66
void setReverseDirection(const bool theReverseDirection)
Set reverse direction flag.
Definition: FeaturesAPI_Placement.cpp:81
void setEndShape(const ModelHighAPI_Selection &theEndShape)
Set end shape.
Definition: FeaturesAPI_Placement.cpp:73
FeaturesAPI_Placement(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: FeaturesAPI_Placement.cpp:26
virtual std::shared_ptr< ModelAPI_AttributeBoolean > centering() const
Centering flag.
Definition: FeaturesAPI_Placement.h:66
void setCentering(const bool theCentering)
Set centering flag.
Definition: FeaturesAPI_Placement.cpp:89
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: FeaturesAPI_Placement.cpp:97
void setStartShape(const ModelHighAPI_Selection &theStartShape)
Set start shape.
Definition: FeaturesAPI_Placement.cpp:65
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
static const std::string & ID()
Placement kind.
Definition: FeaturesPlugin_Placement.h:43
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
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains list of references to the sub-shapes with possibility to manage them.
Definition: ModelAPI_AttributeSelectionList.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
PlacementPtr addPlacement(const std::shared_ptr< ModelAPI_Document > &thePart, const std::list< ModelHighAPI_Selection > &theObjects, const ModelHighAPI_Selection &theStartShape, const ModelHighAPI_Selection &theEndShape, const bool reverse=false, const bool centering=false, const bool keepSubResults=false)
Create Placement feature.
Definition: FeaturesAPI_Placement.cpp:124