const std::list<XGUI_ViewerPrs>& /*theSelected*/,
const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
{
- //if (!theFeature || theFeature->getKind() != "SketchLine")
+ //if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
// return;
// use the last point of the previous feature as the first of the new one
//boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
void PartSet_OperationConstraint::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
{
- if (!theFeature || theFeature->getKind() != "SketchLine")
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
return;
boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
double theDeltaX, double theDeltaY,
const std::string& theAttribute)
{
- if (!theFeature || theFeature->getKind() != "SketchLine")
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
return;
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
const std::list<XGUI_ViewerPrs>& /*theSelected*/,
const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
{
- if (!theFeature || theFeature->getKind() != "SketchLine")
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
return;
// use the last point of the previous feature as the first of the new one
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
const std::string& theAttribute,
double& theX, double& theY)
{
- if (!theFeature || theFeature->getKind() != "SketchLine")
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
return;
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
double theX, double theY)
{
boost::shared_ptr<GeomDataAPI_Point2D> aPoint2D;
- if (!theFeature || theFeature->getKind() != "SketchLine")
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
return aPoint2D;
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
#include "PartSet.h"
#include <PartSet_OperationSketchBase.h>
+
+#include <SketchPlugin_Line.h>
+
#include <QObject>
class GeomDataAPI_Point2D;
public:
/// Returns the operation type key
- static std::string Type() { return "SketchLine"; }
+ static std::string Type() { return SKETCH_LINE_KIND; }
public:
/// Constructor
if (!anAttr)
return thePrevPrs;
boost::shared_ptr<ModelAPI_Feature> aFeature = anAttr->feature();
- if (!aFeature || aFeature->getKind() != "SketchLine")
+ if (!aFeature || aFeature->getKind() != SKETCH_LINE_KIND)
return thePrevPrs;
aData = aFeature->data();
double theX, double theY)
{
double aDelta = 0;
- if (theFeature->getKind() != "SketchLine")
+ if (theFeature->getKind() != SKETCH_LINE_KIND)
return aDelta;
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
#include <SketchPlugin_Sketch.h>
#include <list>
+/// Line feature kind
+const std::string SKETCH_LINE_KIND("SketchLine");
+
/// Start 2D point of the line
const std::string LINE_ATTR_START("StartPoint");
/// End 2D point of the line
public:
/// Returns the kind of a feature
SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "SketchLine"; return MY_KIND;}
+ {static std::string MY_KIND = SKETCH_LINE_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
else if (theFeatureID == "SketchPoint") {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
}
- else if (theFeatureID == "SketchLine") {
+ else if (theFeatureID == SKETCH_LINE_KIND) {
return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Line);
}
else if (theFeatureID == "SketchCircle") {
#include <GeomAPI_Pnt.h>
#include <list>
-/// All features of this sketch (list of references)
+/// Sketch feature kind
const std::string SKETCH_KIND("Sketch");
/// Origin point of the sketcher in 3D space
#include "SketchSolver_Constraint.h"
#include <SketchSolver_Solver.h>
+#include <SketchPlugin_Line.h>
+
#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_Data.h>
myAttributesList[aNbPoints++] = CONSTRAINT_ATTRIBUTES[indAttr];
continue;
}
- else if(aKind.compare("SketchLine") == 0)
+ else if(aKind.compare(SKETCH_LINE_KIND) == 0)
{
// entities are placed starting from CONSTRAINT_ATTR_ENTITY_C attribute
myAttributesList[2 + aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
);
if (!anAttr) continue;
if (anAttr->isFeature() && anAttr->feature() &&
- anAttr->feature()->getKind().compare("SketchLine") == 0)
+ anAttr->feature()->getKind().compare(SKETCH_LINE_KIND) == 0)
{
myAttributesList[aNbLines++] = CONSTRAINT_ATTRIBUTES[indAttr];
break;
);
if (!anAttr || !anAttr->isFeature()) continue;
const std::string& aKind = anAttr->feature()->getKind();
- if (aKind.compare("SketchLine") == 0)
+ if (aKind.compare(SKETCH_LINE_KIND) == 0)
{
myAttributesList[aNbEntities++] = CONSTRAINT_ATTRIBUTES[indAttr];
continue;
const std::string& aFeatureKind = aFeature->getKind();
// Line
- if (aFeatureKind.compare("SketchLine") == 0)
+ if (aFeatureKind.compare(SKETCH_LINE_KIND) == 0)
{
Slvs_hEntity aStart = changeEntity(aFeature->data()->attribute(LINE_ATTR_START));
Slvs_hEntity aEnd = changeEntity(aFeature->data()->attribute(LINE_ATTR_END));
if (aFeatureKind.compare("SketchPoint") == 0)
anAttrList.push_back(POINT_ATTR_COORD);
// Line
- else if (aFeatureKind.compare("SketchLine") == 0)
+ else if (aFeatureKind.compare(SKETCH_LINE_KIND) == 0)
{
anAttrList.push_back(LINE_ATTR_START);
anAttrList.push_back(LINE_ATTR_END);