Salome HOME
Set flag "Auxiliary" for copied features during the Python dump (issue #1899)
[modules/shaper.git] / src / SketchAPI / SketchAPI_SketchEntity.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2 // Name   : SketchAPI_SketchEntity.h
3 // Purpose:
4 //
5 // History:
6 // 07/06/16 - Sergey POKHODENKO - Creation of the file
7
8 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
9 #define SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
10
11 //--------------------------------------------------------------------------------------
12 #include "SketchAPI.h"
13
14 #include <SketchPlugin_SketchEntity.h>
15
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
18
19 class ModelAPI_Feature;
20 //--------------------------------------------------------------------------------------
21 /**\class SketchAPI_SketchEntity
22  * \ingroup CPPHighAPI
23  * \brief Base class for Sketch feature interfaces
24  */
25 class SketchAPI_SketchEntity : public ModelHighAPI_Interface
26 {
27 public:
28   /// Constructor without values
29   SKETCHAPI_EXPORT
30   explicit SketchAPI_SketchEntity(const std::shared_ptr<ModelAPI_Feature> & theFeature);
31   /// Destructor
32   SKETCHAPI_EXPORT
33   virtual ~SketchAPI_SketchEntity();
34
35   /// Auxiliary
36   SKETCHAPI_EXPORT
37   std::shared_ptr<ModelAPI_AttributeBoolean> auxiliary() const;
38
39   /// Set auxiliary
40   SKETCHAPI_EXPORT
41   void setAuxiliary(bool theAuxiliary);
42
43   /// Dump wrapped feature
44   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
45
46   /// Convert list of features to list of appropriate wrappers
47   SKETCHAPI_EXPORT
48   static std::list<std::shared_ptr<SketchAPI_SketchEntity> >
49   wrap(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
50
51 protected:
52   std::shared_ptr<ModelAPI_AttributeBoolean> myAuxiliary;
53
54   bool initialize();
55
56   /// Check the entity is a copy of another feature
57   bool isCopy() const;
58 };
59
60 //! Pointer on SketchEntity object
61 typedef std::shared_ptr<SketchAPI_SketchEntity> SketchEntityPtr;
62
63 //--------------------------------------------------------------------------------------
64 //--------------------------------------------------------------------------------------
65 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_ */