Salome HOME
Update copyrights
[modules/shaper.git] / src / SketchAPI / SketchAPI_SketchEntity.h
1 // Copyright (C) 2014-2019  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 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 //--------------------------------------------------------------------------------------
33 /**\class SketchAPI_SketchEntity
34  * \ingroup CPPHighAPI
35  * \brief Base class for Sketch feature interfaces
36  */
37 class SketchAPI_SketchEntity : public ModelHighAPI_Interface
38 {
39 public:
40   /// Constructor without values
41   SKETCHAPI_EXPORT
42   explicit SketchAPI_SketchEntity(const std::shared_ptr<ModelAPI_Feature> & theFeature);
43   /// Destructor
44   SKETCHAPI_EXPORT
45   virtual ~SketchAPI_SketchEntity();
46
47   /// Auxiliary
48   SKETCHAPI_EXPORT
49   std::shared_ptr<ModelAPI_AttributeBoolean> auxiliary() const;
50
51   /// Set auxiliary
52   SKETCHAPI_EXPORT
53   void setAuxiliary(bool theAuxiliary);
54
55   /// Dump wrapped feature
56   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
57
58   /// Convert list of features to list of appropriate wrappers
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
68   /// Check the entity is a copy of another feature
69   bool isCopy() const;
70 };
71
72 //! Pointer on SketchEntity object
73 typedef std::shared_ptr<SketchAPI_SketchEntity> SketchEntityPtr;
74
75 //--------------------------------------------------------------------------------------
76 //--------------------------------------------------------------------------------------
77 #endif /* SRC_SKETCHAPI_SKETCHAPI_SKETCHENTITY_H_ */