//================================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- double theCenterX, double theCenterY,
- double theStartX, double theStartY,
- double theEndX, double theEndY,
- bool theInversed)
+ double theCenterX, double theCenterY,
+ double theStartX, double theStartY,
+ double theEndX, double theEndY,
+ bool theInversed)
: SketchAPI_SketchEntity(theFeature)
{
if(initialize()) {
//================================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
- const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+ const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
: SketchAPI_SketchEntity(theFeature)
{
if(initialize()) {
//================================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- double theStartX, double theStartY,
- double theEndX, double theEndY,
- double thePassedX, double thePassedY)
+ double theStartX, double theStartY,
+ double theEndX, double theEndY,
+ double thePassedX, double thePassedY)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
//===============================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
//================================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_RefAttr& theTangentPoint,
- double theEndX, double theEndY,
- bool theInversed)
+ const ModelHighAPI_RefAttr& theTangentPoint,
+ double theEndX, double theEndY,
+ bool theInversed)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
//================================================================================================
SketchAPI_MacroArc::SketchAPI_MacroArc(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_RefAttr& theTangentPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+ const ModelHighAPI_RefAttr& theTangentPoint,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
: SketchAPI_SketchEntity(theFeature)
{
if (initialize()) {
//================================================================================================
void SketchAPI_MacroArc::setByCenterStartEnd(double theCenterX, double theCenterY,
- double theStartX, double theStartY,
- double theEndX, double theEndY,
- bool theInversed)
+ double theStartX, double theStartY,
+ double theEndX, double theEndY,
+ bool theInversed)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_CENTER_AND_POINTS(), myarcType);
fillAttribute(center(), theCenterX, theCenterY);
- fillAttribute(startPoint(), theStartX, theStartY);
- fillAttribute(endPoint(), theEndX, theEndY);
+ fillAttribute(startPoint1(), theStartX, theStartY);
+ fillAttribute(endPoint1(), theEndX, theEndY);
fillAttribute(theInversed, myreversed);
execute();
//================================================================================================
void SketchAPI_MacroArc::setByCenterStartEnd(const std::shared_ptr<GeomAPI_Pnt2d>& theCenter,
- const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+ const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_CENTER_AND_POINTS(), myarcType);
fillAttribute(theCenter, mycenter);
- fillAttribute(theStart, mystartPoint);
- fillAttribute(theEnd, myendPoint);
+ fillAttribute(theStart, mystartPoint1);
+ fillAttribute(theEnd, myendPoint1);
fillAttribute(theInversed, myreversed);
execute();
//================================================================================================
void SketchAPI_MacroArc::setByStartEndPassed(double theStartX, double theStartY,
- double theEndX, double theEndY,
- double thePassedX, double thePassedY)
+ double theEndX, double theEndY,
+ double thePassedX, double thePassedY)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_THREE_POINTS(), myarcType);
- fillAttribute(startPoint(), theStartX, theStartY);
- fillAttribute(endPoint(), theEndX, theEndY);
+ fillAttribute(startPoint2(), theStartX, theStartY);
+ fillAttribute(endPoint2(), theEndX, theEndY);
fillAttribute(passedPoint(), thePassedX, thePassedY);
execute();
//================================================================================================
void SketchAPI_MacroArc::setByStartEndPassed(const std::shared_ptr<GeomAPI_Pnt2d>& theStart,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePassed)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_THREE_POINTS(), myarcType);
- fillAttribute(theStart, mystartPoint);
- fillAttribute(theEnd, myendPoint);
+ fillAttribute(theStart, mystartPoint2);
+ fillAttribute(theEnd, myendPoint2);
fillAttribute(thePassed, mypassedPoint);
execute();
//================================================================================================
void SketchAPI_MacroArc::setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
- double theEndX, double theEndY,
- bool theInversed)
+ double theEndX, double theEndY,
+ bool theInversed)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_TANGENT_EDGE(), myarcType);
fillAttribute(theTangentPoint, mytangentPoint);
- fillAttribute(endPoint(), theEndX, theEndY);
+ fillAttribute(endPoint3(), theEndX, theEndY);
fillAttribute(theInversed, myreversed);
execute();
//================================================================================================
void SketchAPI_MacroArc::setByTangent(const ModelHighAPI_RefAttr& theTangentPoint,
- const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
- bool theInversed)
+ const std::shared_ptr<GeomAPI_Pnt2d>& theEnd,
+ bool theInversed)
{
fillAttribute(SketchPlugin_MacroArc::ARC_TYPE_BY_TANGENT_EDGE(), myarcType);
fillAttribute(theTangentPoint, mytangentPoint);
- fillAttribute(theEnd, myendPoint);
+ fillAttribute(theEnd, myendPoint3);
fillAttribute(theInversed, myreversed);
execute();
SketchPlugin_MacroArc::ID();
}
- INTERFACE_9(SketchPlugin_MacroArc::ID(),
- arcType, SketchPlugin_MacroArc::ARC_TYPE(),
- ModelAPI_AttributeString, /** Arc type */,
- center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
- GeomDataAPI_Point2D, /** Center point */,
- startPoint, SketchPlugin_MacroArc::START_POINT_ID(),
- GeomDataAPI_Point2D, /** Start point */,
- endPoint, SketchPlugin_MacroArc::END_POINT_ID(),
- GeomDataAPI_Point2D, /** End point */,
- passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
- GeomDataAPI_Point2D, /** Passed point */,
- tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
- ModelAPI_AttributeRefAttr, /** Tangent point */,
- reversed, SketchPlugin_MacroArc::REVERSED_ID(),
- ModelAPI_AttributeBoolean, /** Reversed flag */,
- radius, SketchPlugin_MacroArc::RADIUS_ID(),
- ModelAPI_AttributeDouble, /** Radius */,
- angle, SketchPlugin_MacroArc::ANGLE_ID(),
- ModelAPI_AttributeDouble, /** Angle */)
+ INTERFACE_12(SketchPlugin_MacroArc::ID(),
+ arcType, SketchPlugin_MacroArc::ARC_TYPE(),
+ ModelAPI_AttributeString, /** Arc type */,
+ center, SketchPlugin_MacroArc::CENTER_POINT_ID(),
+ GeomDataAPI_Point2D, /** Center point */,
+ startPoint1, SketchPlugin_MacroArc::START_POINT_1_ID(),
+ GeomDataAPI_Point2D, /** Start point */,
+ endPoint1, SketchPlugin_MacroArc::END_POINT_1_ID(),
+ GeomDataAPI_Point2D, /** End point */,
+ startPoint2, SketchPlugin_MacroArc::START_POINT_2_ID(),
+ GeomDataAPI_Point2D, /** Start point */,
+ endPoint2, SketchPlugin_MacroArc::END_POINT_2_ID(),
+ GeomDataAPI_Point2D, /** End point */,
+ passedPoint, SketchPlugin_MacroArc::PASSED_POINT_ID(),
+ GeomDataAPI_Point2D, /** Passed point */,
+ tangentPoint, SketchPlugin_MacroArc::TANGENT_POINT_ID(),
+ ModelAPI_AttributeRefAttr, /** Tangent point */,
+ endPoint3, SketchPlugin_MacroArc::END_POINT_3_ID(),
+ GeomDataAPI_Point2D, /** End point */,
+ reversed, SketchPlugin_MacroArc::REVERSED_ID(),
+ ModelAPI_AttributeBoolean, /** Reversed flag */,
+ radius, SketchPlugin_MacroArc::RADIUS_ID(),
+ ModelAPI_AttributeDouble, /** Radius */,
+ angle, SketchPlugin_MacroArc::ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** Angle */)
private:
data()->addAttribute(ARC_TYPE(), ModelAPI_AttributeString::typeId());
data()->addAttribute(CENTER_POINT_ID(), GeomDataAPI_Point2D::typeId());
- data()->addAttribute(START_POINT_ID(), GeomDataAPI_Point2D::typeId());
- data()->addAttribute(END_POINT_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(START_POINT_1_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(END_POINT_1_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(START_POINT_2_ID(), GeomDataAPI_Point2D::typeId());
+ data()->addAttribute(END_POINT_2_ID(), GeomDataAPI_Point2D::typeId());
data()->addAttribute(PASSED_POINT_ID(), GeomDataAPI_Point2D::typeId());
data()->addAttribute(TANGENT_POINT_ID(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(END_POINT_3_ID(), GeomDataAPI_Point2D::typeId());
data()->addAttribute(REVERSED_ID(), ModelAPI_AttributeBoolean::typeId());
if(theID == ARC_TYPE()) {
SketchPlugin_Tools::resetAttribute(this, CENTER_POINT_ID());
SketchPlugin_Tools::resetAttribute(this, CENTER_POINT_REF_ID());
- SketchPlugin_Tools::resetAttribute(this, START_POINT_ID());
+ SketchPlugin_Tools::resetAttribute(this, START_POINT_1_ID());
SketchPlugin_Tools::resetAttribute(this, START_POINT_REF_ID());
- SketchPlugin_Tools::resetAttribute(this, END_POINT_ID());
+ SketchPlugin_Tools::resetAttribute(this, END_POINT_1_ID());
SketchPlugin_Tools::resetAttribute(this, END_POINT_REF_ID());
+ SketchPlugin_Tools::resetAttribute(this, START_POINT_2_ID());
+ SketchPlugin_Tools::resetAttribute(this, END_POINT_2_ID());
SketchPlugin_Tools::resetAttribute(this, PASSED_POINT_ID());
SketchPlugin_Tools::resetAttribute(this, PASSED_POINT_REF_ID());
SketchPlugin_Tools::resetAttribute(this, TANGENT_POINT_ID());
+ SketchPlugin_Tools::resetAttribute(this, END_POINT_3_ID());
SketchPlugin_Tools::resetAttribute(this, REVERSED_ID());
SketchPlugin_Tools::resetAttribute(this, RADIUS_ID());
SketchPlugin_Tools::resetAttribute(this, ANGLE_ID());
return;
AttributePoint2DPtr aStartPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(START_POINT_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(START_POINT_1_ID()));
if (!aStartPointAttr->isInitialized())
return;
myEnd = myStart;
AttributePoint2DPtr anEndPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_1_ID()));
if (!anEndPointAttr->isInitialized())
return;
void SketchPlugin_MacroArc::fillByThreePassedPoints()
{
AttributePoint2DPtr aStartPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(START_POINT_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(START_POINT_2_ID()));
if (!aStartPointAttr->isInitialized())
return;
AttributePoint2DPtr anEndPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_2_ID()));
if (!anEndPointAttr->isInitialized())
return;
return;
AttributePoint2DPtr anEndPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_ID()));
+ std::dynamic_pointer_cast<GeomDataAPI_Point2D>(attribute(END_POINT_3_ID()));
if (!anEndPointAttr->isInitialized())
return;
}
/// Start 2D point of the arc
- inline static const std::string& START_POINT_ID()
+ inline static const std::string& START_POINT_1_ID()
{
- static const std::string ID = "start_point";
+ static const std::string ID = "start_point_1";
+ return ID;
+ }
+
+ /// Start 2D point of the arc
+ inline static const std::string& START_POINT_2_ID()
+ {
+ static const std::string ID = "start_point_2";
return ID;
}
}
/// End 2D point of the arc
- inline static const std::string& END_POINT_ID()
+ inline static const std::string& END_POINT_1_ID()
+ {
+ static const std::string ID = "end_point_1";
+ return ID;
+ }
+
+ /// End 2D point of the arc
+ inline static const std::string& END_POINT_2_ID()
+ {
+ static const std::string ID = "end_point_2";
+ return ID;
+ }
+
+ /// End 2D point of the arc
+ inline static const std::string& END_POINT_3_ID()
{
- static const std::string ID = "end_point";
+ static const std::string ID = "end_point_3";
return ID;
}
SketchPlugin_MacroCircle::THIRD_POINT_REF_ID());
} else if (theMacroFeature->getKind() == SketchPlugin_MacroArc::ID()) {
thePoints[0] = toPoint(theMacroFeature,
- SketchPlugin_MacroArc::START_POINT_ID(),
+ SketchPlugin_MacroArc::START_POINT_2_ID(),
SketchPlugin_MacroArc::START_POINT_REF_ID());
thePoints[1] = toPoint(theMacroFeature,
- SketchPlugin_MacroArc::END_POINT_ID(),
+ SketchPlugin_MacroArc::END_POINT_2_ID(),
SketchPlugin_MacroArc::END_POINT_REF_ID());
thePoints[2] = toPoint(theMacroFeature,
SketchPlugin_MacroArc::PASSED_POINT_ID(),
tooltip="Center of a circle"
accept_expressions="0"
enable_value="enable_by_preferences" />
- <sketch-2dpoint_selector id="start_point"
+ <sketch-2dpoint_selector id="start_point_1"
reference_attribute="start_point_ref"
title="Start point"
tooltip="Start point"
accept_expressions="0"
enable_value="enable_by_preferences"/>
- <sketch-2dpoint_selector id="end_point"
+ <sketch-2dpoint_selector id="end_point_1"
reference_attribute="end_point_ref"
title="End point"
tooltip="End point"
accept_expressions="0"
enable_value="enable_by_preferences"/>
- <validator id="GeomValidators_Different" parameters="center_point,start_point,end_point"/>
+ <validator id="GeomValidators_Different" parameters="center_point,start_point_1,end_point_1"/>
</box>
<box id="by_three_points"
icon="icons/Sketch/arc_3pt_32x32.png"
title="Three points on arc">
- <sketch-2dpoint_selector id="start_point"
+ <sketch-2dpoint_selector id="start_point_2"
reference_attribute="start_point_ref"
title="Start point"
tooltip="Start point"
accept_expressions="0"
enable_value="enable_by_preferences"/>
- <sketch-2dpoint_selector id="end_point"
+ <sketch-2dpoint_selector id="end_point_2"
reference_attribute="end_point_ref"
title="End point"
tooltip="End point"
<validator id="SketchPlugin_DifferentReference" parameters="start_point_ref,end_point_ref,passed_point_ref"/>
<validator id="SketchPlugin_ThirdPointValidator" parameters="passed_point_ref"/>
</sketch-2dpoint_selector>
- <validator id="GeomValidators_Different" parameters="start_point,end_point,passed_point"/>
+ <validator id="GeomValidators_Different" parameters="start_point_2,end_point_2,passed_point"/>
</box>
<box id="by_tangent_edge"
icon="icons/Sketch/arc_tang_32x32.png"
shape_types="vertex">
<validator id="SketchPlugin_ArcTangentPoint"/>
</sketch_shape_selector>
- <sketch-2dpoint_selector id="end_point"
+ <sketch-2dpoint_selector id="end_point_3"
reference_attribute="end_point_ref"
title="End point"
tooltip="End point"