#include <SketchPlugin_Feature.h>
#include <SketchPlugin_Sketch.h>
+/// Circle feature kind
+const std::string SKETCH_CIRCLE_KIND("SketchCircle");
+
/// 2D point - center of the circle
const std::string CIRCLE_ATTR_CENTER("CircleCenter");
/// Radius of the circle
public:
/// Returns the kind of a feature
SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "SketchCircle"; return MY_KIND;}
+ {static std::string MY_KIND = SKETCH_CIRCLE_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
if (theFeatureID == SKETCH_KIND) {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
}
- else if (theFeatureID == "SketchPoint") {
+ else if (theFeatureID == SKETCH_POINT_KIND) {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
}
else if (theFeatureID == SKETCH_LINE_KIND) {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Line);
}
- else if (theFeatureID == "SketchCircle") {
+ else if (theFeatureID == SKETCH_CIRCLE_KIND) {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Circle);
}
else if (theFeatureID == "SketchConstraintCoincidence") {
#include "SketchPlugin_Feature.h"
#include <list>
+/// Point feature kind
+const std::string SKETCH_POINT_KIND("SketchPoint");
+
/// Coordinates of the point
const std::string POINT_ATTR_COORD("PointCoordindates");
public:
/// Returns the kind of a feature
SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "SketchPoint"; return MY_KIND;}
+ {static std::string MY_KIND = SKETCH_POINT_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
#include <SketchSolver_Solver.h>
#include <SketchPlugin_Line.h>
+#include <SketchPlugin_Point.h>
+#include <SketchPlugin_Circle.h>
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_Data.h>
if (anAttr->isFeature() && anAttr->feature())
{ // verify posiible entities
const std::string& aKind = anAttr->feature()->getKind();
- if (aKind.compare("SketchPoint") == 0)
+ if (aKind.compare(SKETCH_POINT_KIND) == 0)
{
myAttributesList[aNbPoints++] = CONSTRAINT_ATTRIBUTES[indAttr];
continue;
);
if (!anAttr || !anAttr->isFeature()) continue;
const std::string& aKind = anAttr->feature()->getKind();
- if (aKind.compare("SketchCircle") == 0 || aKind.compare("SketchArc") == 0)
+ if (aKind.compare(SKETCH_CIRCLE_KIND) == 0 || aKind.compare("SketchArc") == 0)
{
myAttributesList[aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
continue;
return aLineEntity.h;
}
// Circle
- else if (aFeatureKind.compare("SketchCircle") == 0)
+ else if (aFeatureKind.compare(SKETCH_CIRCLE_KIND) == 0)
{
Slvs_hEntity aCenter = changeEntity(aFeature->data()->attribute(CIRCLE_ATTR_CENTER));
Slvs_hEntity aRadius = changeEntity(aFeature->data()->attribute(CIRCLE_ATTR_RADIUS));
return anArcEntity.h;
}
// Point (it has low probability to be an attribute of constraint, so it is checked at the end)
- else if (aFeatureKind.compare("SketchPoint") == 0)
+ else if (aFeatureKind.compare(SKETCH_POINT_KIND) == 0)
{
Slvs_hEntity aPoint = changeEntity(aFeature->data()->attribute(POINT_ATTR_COORD));
std::vector<std::string> anAttrList;
const std::string& aFeatureKind = theFeature->getKind();
// Point
- if (aFeatureKind.compare("SketchPoint") == 0)
+ if (aFeatureKind.compare(SKETCH_POINT_KIND) == 0)
anAttrList.push_back(POINT_ATTR_COORD);
// Line
else if (aFeatureKind.compare(SKETCH_LINE_KIND) == 0)
anAttrList.push_back(LINE_ATTR_END);
}
// Circle
- else if (aFeatureKind.compare("SketchCircle") == 0)
+ else if (aFeatureKind.compare(SKETCH_CIRCLE_KIND) == 0)
{
anAttrList.push_back(CIRCLE_ATTR_CENTER);
anAttrList.push_back(CIRCLE_ATTR_RADIUS);