SHAPER  9.12.0
SketchAPI_SketchEntity.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_SKETCHENTITY_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
22 
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
25 
26 #include <SketchPlugin_SketchEntity.h>
27 
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30 
31 class ModelAPI_Feature;
32 //--------------------------------------------------------------------------------------
38 {
39 public:
41  SKETCHAPI_EXPORT
42  explicit SketchAPI_SketchEntity(const std::shared_ptr<ModelAPI_Feature> & theFeature);
44  SKETCHAPI_EXPORT
45  virtual ~SketchAPI_SketchEntity();
46 
48  SKETCHAPI_EXPORT
49  std::shared_ptr<ModelAPI_AttributeBoolean> auxiliary() const;
50 
52  SKETCHAPI_EXPORT
53  void setAuxiliary(bool theAuxiliary);
54 
56  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
57 
59  SKETCHAPI_EXPORT
60  static std::list<std::shared_ptr<SketchAPI_SketchEntity> >
61  wrap(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
62 
63 protected:
64  std::shared_ptr<ModelAPI_AttributeBoolean> myAuxiliary;
65 
66  bool initialize();
67 
69  bool isCopy() const;
70 };
71 
73 typedef std::shared_ptr<SketchAPI_SketchEntity> SketchEntityPtr;
74 
75 //--------------------------------------------------------------------------------------
76 //--------------------------------------------------------------------------------------
77 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_ */
Feature function that represents the particular functionality of this operation.
Definition: ModelAPI_Feature.h:39
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
std::shared_ptr< ModelAPI_AttributeBoolean > auxiliary() const
Auxiliary.
Definition: SketchAPI_SketchEntity.cpp:62
void setAuxiliary(bool theAuxiliary)
Set auxiliary.
Definition: SketchAPI_SketchEntity.cpp:67
virtual ~SketchAPI_SketchEntity()
Destructor.
Definition: SketchAPI_SketchEntity.cpp:48
bool isCopy() const
Check the entity is a copy of another feature.
Definition: SketchAPI_SketchEntity.cpp:85
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_SketchEntity.cpp:75
static std::list< std::shared_ptr< SketchAPI_SketchEntity > > wrap(const std::list< std::shared_ptr< ModelAPI_Feature > > &theFeatures)
Convert list of features to list of appropriate wrappers.
Definition: SketchAPI_SketchEntity.cpp:94
SketchAPI_SketchEntity(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_SketchEntity.cpp:41