1 // Copyright (C) 2017-20xx CEA/DEN, EDF R&D
3 // File: PlaneGCSSolver_FeatureBuilder.h
4 // Created: 10 Feb 2017
5 // Author: Artem ZHIDKOV
7 #ifndef PlaneGCSSolver_FeatureBuilder_H_
8 #define PlaneGCSSolver_FeatureBuilder_H_
10 #include <PlaneGCSSolver_AttributeBuilder.h>
12 typedef std::map<AttributePtr, EntityWrapperPtr> AttributeEntityMap;
14 /** \class PlaneGCSSolver_FeatureBuilder
16 * \brief Converts SketchPlugin_Feature to the entity applicable for PlaneGCS solver
18 class PlaneGCSSolver_FeatureBuilder : public PlaneGCSSolver_AttributeBuilder
21 PlaneGCSSolver_FeatureBuilder(PlaneGCSSolver_Storage* theStorage = 0);
22 PlaneGCSSolver_FeatureBuilder(const StoragePtr& theStorage);
24 /// \brief Converts an attribute to the solver's entity and stores it for further processing.
25 /// Double attributes and 2D points are supported only.
26 /// \param theAttribute [in] attribute to create
27 /// \return Created wrapper of the attribute applicable for specific solver
28 virtual EntityWrapperPtr createAttribute(AttributePtr theAttribute);
30 /// \brief Converts SketchPlugin's feature to the solver's entity.
31 /// Result if based on the list of already converted attributes.
32 /// \param theFeature [in] feature to create
33 virtual EntityWrapperPtr createFeature(FeaturePtr theFeature);
35 /// \brief Return list of constraints necessary to fix feature's extra DoF
36 virtual const std::list<GCSConstraintPtr>& constraints() const
37 { return myFeatureConstraints; }
40 /// list of converted attributes (will be cleared when the feature is created)
41 AttributeEntityMap myAttributes;
43 /// constraints for the feature
44 /// (primarily used for constrain arcs, which have 9 parameters but 5 DoF)
45 std::list<GCSConstraintPtr> myFeatureConstraints;