Salome HOME
SketchSolver Refactoring: Eliminate SolveSpace as a sketch solver.
[modules/shaper.git] / src / SketchSolver / PlaneGCSSolver / PlaneGCSSolver_EntityBuilder.h
1 // Copyright (C) 2017-20xx CEA/DEN, EDF R&D
2
3 // File:    PlaneGCSSolver_EntityBuilder.h
4 // Created: 14 Feb 2017
5 // Author:  Artem ZHIDKOV
6
7 #ifndef PlaneGCSSolver_EntityBuilder_H_
8 #define PlaneGCSSolver_EntityBuilder_H_
9
10 #include <PlaneGCSSolver_Defs.h>
11 #include <PlaneGCSSolver_Storage.h>
12
13 /** \class   PlaneGCSSolver_EntityBuilder
14  *  \ingroup Plugins
15  *  \brief   API to convert data model entity to the entity applicable for PlaneGCS solver
16  */
17 class PlaneGCSSolver_EntityBuilder
18 {
19 public:
20   /// \brief Create entity in the given storage.
21   ///        If the storage is empty, the entity should not be changed
22   ///         while constraint solving. So, it is created out of the storage.
23   PlaneGCSSolver_EntityBuilder(PlaneGCSSolver_Storage* theStorage = 0)
24     : myStorage(theStorage)
25   {}
26
27   virtual ~PlaneGCSSolver_EntityBuilder() {}
28
29   /// \brief Converts an attribute to the solver's entity.
30   ///        Double attributes and 2D points are supported only.
31   /// \param theAttribute [in]  attribute to create
32   /// \return Created wrapper of the attribute applicable for specific solver
33   virtual EntityWrapperPtr createAttribute(AttributePtr theAttribute) = 0;
34
35   /// \brief Converts SketchPlugin's feature to the solver's entity.
36   ///        Result if based on the list of already converted attributes.
37   /// \param theFeature [in]  feature to create
38   virtual EntityWrapperPtr createFeature(FeaturePtr) = 0;
39
40   /// \brief Return list of constraints necessary to fix feature's extra DoF
41   virtual const std::list<GCSConstraintPtr>& constraints() const = 0;
42
43 protected:
44   PlaneGCSSolver_Storage* myStorage;
45 };
46
47 #endif