Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / SketchAPI / SketchAPI_SketchEntity.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
22 #define SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_
23
24 //--------------------------------------------------------------------------------------
25 #include "SketchAPI.h"
26
27 #include <SketchPlugin_SketchEntity.h>
28
29 #include <ModelHighAPI_Interface.h>
30 #include <ModelHighAPI_Macro.h>
31
32 class ModelAPI_Feature;
33 //--------------------------------------------------------------------------------------
34 /**\class SketchAPI_SketchEntity
35  * \ingroup CPPHighAPI
36  * \brief Base class for Sketch feature interfaces
37  */
38 class SketchAPI_SketchEntity : public ModelHighAPI_Interface
39 {
40 public:
41   /// Constructor without values
42   SKETCHAPI_EXPORT
43   explicit SketchAPI_SketchEntity(const std::shared_ptr<ModelAPI_Feature> & theFeature);
44   /// Destructor
45   SKETCHAPI_EXPORT
46   virtual ~SketchAPI_SketchEntity();
47
48   /// Auxiliary
49   SKETCHAPI_EXPORT
50   std::shared_ptr<ModelAPI_AttributeBoolean> auxiliary() const;
51
52   /// Set auxiliary
53   SKETCHAPI_EXPORT
54   void setAuxiliary(bool theAuxiliary);
55
56   /// Dump wrapped feature
57   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
58
59   /// Convert list of features to list of appropriate wrappers
60   SKETCHAPI_EXPORT
61   static std::list<std::shared_ptr<SketchAPI_SketchEntity> >
62   wrap(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
63
64 protected:
65   std::shared_ptr<ModelAPI_AttributeBoolean> myAuxiliary;
66
67   bool initialize();
68
69   /// Check the entity is a copy of another feature
70   bool isCopy() const;
71 };
72
73 //! Pointer on SketchEntity object
74 typedef std::shared_ptr<SketchAPI_SketchEntity> SketchEntityPtr;
75
76 //--------------------------------------------------------------------------------------
77 //--------------------------------------------------------------------------------------
78 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_ */