#ifndef SketchPlugin_MacroCircle_H_
#define SketchPlugin_MacroCircle_H_
+#include <ModelAPI_IReentrant.h>
+
#include "SketchPlugin.h"
#include "SketchPlugin_SketchEntity.h"
* \brief Feature for creation of the new circle in Sketch.
*/
class SketchPlugin_MacroCircle: public SketchPlugin_SketchEntity,
- public GeomAPI_IPresentable
+ public GeomAPI_IPresentable,
+ public ModelAPI_IReentrant
{
public:
/// Circle feature kind
return ID;
}
+ inline static const std::string& EDIT_CIRCLE_TYPE()
+ {
+ static const std::string ID("edit_circle_type");
+ return ID;
+ }
+
/// Creation method by center and passed point.
inline static const std::string& CIRCLE_TYPE_BY_CENTER_AND_PASSED_POINTS()
{
SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;};
+ /// Apply information of the message to current object. It fills reference object,
+ /// tangent type and tangent point refence in case of tangent arc
+ virtual std::string processEvent(const std::shared_ptr<Events_Message>& theMessage);
+
/// Use plugin manager for features creation
SketchPlugin_MacroCircle();
private:
- void createCircleByCenterAndPassed();
- void createCircleByThreePoints();
+ void fillByCenterAndPassed();
+ void fillByThreePoints();
+ /// set fields if only two of three points is initialized
+ void fillByTwoPassedPoints();
+
+ void constraintsForCircleByCenterAndPassed(FeaturePtr theCircleFeature);
+ void constraintsForCircleByThreePoints(FeaturePtr theCircleFeature);
- FeaturePtr createCircleFeature(const std::shared_ptr<GeomAPI_Circ2d>& theCircle);
+ FeaturePtr createCircleFeature();
private:
std::shared_ptr<GeomAPI_Pnt2d> myCenter;
- double myRadius;
+ double myRadius;
};
#endif