Salome HOME
SketchSolver Refactoring: Eliminate SolveSpace as a sketch solver.
[modules/shaper.git] / src / SketchSolver / SketchSolver_IEntityWrapper.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:    SketchSolver_IEntityWrapper.h
4 // Created: 30 Nov 2015
5 // Author:  Artem ZHIDKOV
6
7 #ifndef SketchSolver_IEntityWrapper_H_
8 #define SketchSolver_IEntityWrapper_H_
9
10 #include <SketchSolver.h>
11
12 #include <ModelAPI_Attribute.h>
13 #include <ModelAPI_Feature.h>
14
15 #include <list>
16 #include <memory>
17
18 /// Types of entities
19 enum SketchSolver_EntityType {
20   ENTITY_UNKNOWN = 0,
21   ENTITY_SCALAR,
22   ENTITY_ANGLE,
23   ENTITY_POINT,
24   ENTITY_LINE,
25   ENTITY_CIRCLE,
26   ENTITY_ARC
27 };
28
29 /**
30  *  Wrapper providing operations with entities regardless the solver.
31  */
32 class SketchSolver_IEntityWrapper
33 {
34 public:
35   SketchSolver_IEntityWrapper() : myExternal(false) {}
36   virtual ~SketchSolver_IEntityWrapper() {}
37
38   /// \brief Return type of current entity
39   virtual SketchSolver_EntityType type() const = 0;
40
41   /// \brief Change flag indicating the entity cannot be changed in the solver
42   void setExternal(bool theExternal) { myExternal = theExternal; }
43   /// \brief Return the External flag
44   bool isExternal() const { return myExternal; }
45
46 private:
47   bool myExternal;
48 };
49
50 typedef std::shared_ptr<SketchSolver_IEntityWrapper> EntityWrapperPtr;
51
52 #endif