SHAPER  9.12.0
SketchAPI_Projection.h
1 // Copyright (C) 2014-2023 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 SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_
22 
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 
26 #include <SketchPlugin_Projection.h>
27 
28 #include "SketchAPI_SketchEntity.h"
29 //--------------------------------------------------------------------------------------
31 //--------------------------------------------------------------------------------------
37 {
38 public:
40  SKETCHAPI_EXPORT
41  explicit SketchAPI_Projection(const std::shared_ptr<ModelAPI_Feature> & theFeature);
43  SKETCHAPI_EXPORT
44  SketchAPI_Projection(const std::shared_ptr<ModelAPI_Feature> & theFeature,
45  const ModelHighAPI_Selection & theExternalFeature);
47  SKETCHAPI_EXPORT
48  virtual ~SketchAPI_Projection();
49 
50  INTERFACE_4(SketchPlugin_Projection::ID(),
51  externalFeature, SketchPlugin_Projection::EXTERNAL_FEATURE_ID(),
53  projectedFeature, SketchPlugin_Projection::PROJECTED_FEATURE_ID(),
57  includeToResult, SketchPlugin_Projection::INCLUDE_INTO_RESULT(),
59  )
60 
61 
62  SKETCHAPI_EXPORT
63  void setExternalFeature(const ModelHighAPI_Selection & theExternalLine);
64 
66  SKETCHAPI_EXPORT
67  void setIncludeToResult(bool theKeepResult);
68 
70  SKETCHAPI_EXPORT
71  void setKeepReferenceToOriginal(bool theKeepRefToOriginal);
72 
74  SKETCHAPI_EXPORT
75  std::shared_ptr<SketchAPI_SketchEntity> createdFeature() const;
76 
78  SKETCHAPI_EXPORT
79  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
80 };
81 
83 typedef std::shared_ptr<SketchAPI_Projection> ProjectionPtr;
84 
85 //--------------------------------------------------------------------------------------
86 //--------------------------------------------------------------------------------------
87 #endif /* SRC_SKETCHAPI_SKETCHAPI_PROJECTION_H_ */
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains reference to an attribute of a feature or reference to a feature (switchable)
Definition: ModelAPI_AttributeRefAttr.h:33
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for Projection feature.
Definition: SketchAPI_Projection.h:37
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Projection.cpp:120
std::shared_ptr< SketchAPI_SketchEntity > createdFeature() const
Returns created feature.
Definition: SketchAPI_Projection.cpp:88
virtual ~SketchAPI_Projection()
Destructor.
Definition: SketchAPI_Projection.cpp:59
SketchAPI_Projection(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Projection.cpp:42
virtual std::shared_ptr< ModelAPI_AttributeSelection > externalFeature() const
External feature.
Definition: SketchAPI_Projection.h:59
virtual std::shared_ptr< ModelAPI_AttributeBoolean > includeToResult() const
Include into result.
Definition: SketchAPI_Projection.h:59
void setIncludeToResult(bool theKeepResult)
Set flag to include projection to result or not.
Definition: SketchAPI_Projection.cpp:72
void setKeepReferenceToOriginal(bool theKeepRefToOriginal)
Set flag to keep the reference to the original shape.
Definition: SketchAPI_Projection.cpp:78
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Projection.h:59
virtual std::shared_ptr< ModelAPI_AttributeRefAttr > projectedFeature() const
Projected feature.
Definition: SketchAPI_Projection.h:59
void setExternalFeature(const ModelHighAPI_Selection &theExternalLine)
Set external feature.
Definition: SketchAPI_Projection.cpp:65
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & ID()
Projection feature kind.
Definition: SketchPlugin_Projection.h:35
static const std::string & EXTERNAL_ID()
Reference to the external edge or vertex as a AttributeSelection.
Definition: SketchPlugin_SketchEntity.h:55