}
//--------------------------------------------------------------------------------------
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setAngle(
+ const ModelHighAPI_RefAttr & theLine1,
+ const ModelHighAPI_RefAttr & theLine2,
+ const ModelHighAPI_Double & theValue)
+{
+ // TODO(spo): is support of angle type necessary?
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintAngle::ID());
+ fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setCoincident(
const ModelHighAPI_RefAttr & thePoint1,
const ModelHighAPI_RefAttr & thePoint2)
return aFeature;
}
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setCollinear(
+ const ModelHighAPI_RefAttr & theLine1,
+ const ModelHighAPI_RefAttr & theLine2)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintCollinear::ID());
+ fillAttribute(theLine1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theLine2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setDistance(
const ModelHighAPI_RefAttr & thePoint,
- const ModelHighAPI_RefAttr & theLine,
+ const ModelHighAPI_RefAttr & thePointOrLine,
const ModelHighAPI_Double & theValue)
{
std::shared_ptr<ModelAPI_Feature> aFeature =
compositeFeature()->addFeature(SketchPlugin_ConstraintDistance::ID());
fillAttribute(thePoint, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
- fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ fillAttribute(thePointOrLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
aFeature->execute();
return aFeature;
}
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setEqual(
+ const ModelHighAPI_RefAttr & theObject1,
+ const ModelHighAPI_RefAttr & theObject2)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintEqual::ID());
+ fillAttribute(theObject1, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theObject2, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setFillet(
const std::list<ModelHighAPI_RefAttr> & thePoints,
const ModelHighAPI_Double & theRadius)
return aFeature;
}
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setMiddlePoint(
+ const ModelHighAPI_RefAttr & thePoint,
+ const ModelHighAPI_RefAttr & theLine)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintMiddle::ID());
+ fillAttribute(thePoint, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setParallel(
const ModelHighAPI_RefAttr & theLine1,
const ModelHighAPI_RefAttr & theLine2)
return aFeature;
}
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setRadius(
+ const ModelHighAPI_RefAttr & theCircleOrArc,
+ const ModelHighAPI_Double & theValue)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintRadius::ID());
+ fillAttribute(theCircleOrArc, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theValue, aFeature->real(SketchPlugin_Constraint::VALUE()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setRigid(
const ModelHighAPI_RefAttr & theObject)
{
+ // TODO(spo): should it be renamed to Fixed?
std::shared_ptr<ModelAPI_Feature> aFeature =
compositeFeature()->addFeature(SketchPlugin_ConstraintRigid::ID());
fillAttribute(theObject, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
return aFeature;
}
+std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setTangent(
+ const ModelHighAPI_RefAttr & theLine,
+ const ModelHighAPI_RefAttr & theCircle)
+{
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ compositeFeature()->addFeature(SketchPlugin_ConstraintTangent::ID());
+ fillAttribute(theLine, aFeature->refattr(SketchPlugin_Constraint::ENTITY_A()));
+ fillAttribute(theCircle, aFeature->refattr(SketchPlugin_Constraint::ENTITY_B()));
+ aFeature->execute();
+ return aFeature;
+}
+
std::shared_ptr<ModelAPI_Feature> SketchAPI_Sketch::setVertical(
const ModelHighAPI_RefAttr & theLine)
{
SKETCHAPI_EXPORT
std::shared_ptr<SketchAPI_Arc> addArc(const std::string & theExternalName);
+ /// Set angle
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setAngle(
+ const ModelHighAPI_RefAttr & theLine1,
+ const ModelHighAPI_RefAttr & theLine2,
+ const ModelHighAPI_Double & theValue);
+
/// Set coincident
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setCoincident(
const ModelHighAPI_RefAttr & thePoint1,
const ModelHighAPI_RefAttr & thePoint2);
+ /// Set collinear
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setCollinear(
+ const ModelHighAPI_RefAttr & theLine1,
+ const ModelHighAPI_RefAttr & theLine2);
+
/// Set distance
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setDistance(
const ModelHighAPI_RefAttr & thePoint,
- const ModelHighAPI_RefAttr & theLine,
+ const ModelHighAPI_RefAttr & thePointOrLine,
const ModelHighAPI_Double & theValue);
+ /// Set equal
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setEqual(
+ const ModelHighAPI_RefAttr & theObject1,
+ const ModelHighAPI_RefAttr & theObject2);
+
/// Set fillet
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setFillet(
const ModelHighAPI_RefAttr & theLine,
const ModelHighAPI_Double & theValue);
+ /// Set middle
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setMiddlePoint(
+ const ModelHighAPI_RefAttr & thePoint,
+ const ModelHighAPI_RefAttr & theLine);
+
+ // TODO(spo): setMirror
+
/// Set parallel
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setParallel(
const ModelHighAPI_RefAttr & theLine1,
const ModelHighAPI_RefAttr & theLine2);
+ /// Set radius
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setRadius(
+ const ModelHighAPI_RefAttr & theCircleOrArc,
+ const ModelHighAPI_Double & theValue);
+
/// Set rigid
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setRigid(
const ModelHighAPI_RefAttr & theObject);
+ /// Set tangent
+ SKETCHAPI_EXPORT
+ std::shared_ptr<ModelAPI_Feature> setTangent(
+ const ModelHighAPI_RefAttr & theLine,
+ const ModelHighAPI_RefAttr & theCircle);
+
/// Set vertical
SKETCHAPI_EXPORT
std::shared_ptr<ModelAPI_Feature> setVertical(
const ModelHighAPI_RefAttr & theLine);
- // TODO(spo): set* (constraints)
-
- // TODO(spo): addMirror
+ // TODO(spo): addRectagle, projection, Translation, Rotation
/// Set constraint value
SKETCHAPI_EXPORT