//*************************************************************************************
void SketchPlugin_ConstraintDistance::execute()
{
//*************************************************************************************
void SketchPlugin_ConstraintDistance::execute()
{
- boost::shared_ptr<ModelAPI_Data> aData = data();
- AttributeDoublePtr anAttrValue = boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+ std::shared_ptr<ModelAPI_Data> aData = data();
+ AttributeDoublePtr anAttrValue = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
if (aPoint_A && aPoint_B) {
aPnt_A = aPoint_A->pnt();
aPnt_B = aPoint_B->pnt();
} else if (!aPoint_A && aPoint_B) {
if (aPoint_A && aPoint_B) {
aPnt_A = aPoint_A->pnt();
aPnt_B = aPoint_B->pnt();
} else if (!aPoint_A && aPoint_B) {
aData, SketchPlugin_Constraint::ENTITY_A());
if (aLine) {
aPnt_B = aPoint_B->pnt();
aPnt_A = getProjectionPoint(aLine, aPnt_B);
}
} else if (aPoint_A && !aPoint_B) {
aData, SketchPlugin_Constraint::ENTITY_A());
if (aLine) {
aPnt_B = aPoint_B->pnt();
aPnt_A = getProjectionPoint(aLine, aPnt_B);
}
} else if (aPoint_A && !aPoint_B) {
aData, SketchPlugin_Constraint::ENTITY_B());
if (aLine) {
aPnt_A = aPoint_A->pnt();
aData, SketchPlugin_Constraint::ENTITY_B());
if (aLine) {
aPnt_A = aPoint_A->pnt();
- boost::shared_ptr<GeomAPI_Pnt> aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y());
- boost::shared_ptr<GeomAPI_Pnt> aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y());
- boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = boost::shared_ptr<GeomAPI_Pnt>();
+ std::shared_ptr<GeomAPI_Pnt> aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y());
+ std::shared_ptr<GeomAPI_Pnt> aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y());
+ std::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = std::shared_ptr<GeomAPI_Pnt>();
if(aFlyOutAttr->isInitialized()) {
aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y());
} else {
if(aFlyOutAttr->isInitialized()) {
aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y());
} else {
aFlyOutAttr->setValue(aFPnt);
aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y());
}
// value calculation
aFlyOutAttr->setValue(aFPnt);
aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y());
}
// value calculation
ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE()));
double aValue = aValueAttr->value();
// Issue #196: checking the positivity of the distance constraint
ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE()));
double aValue = aValueAttr->value();
// Issue #196: checking the positivity of the distance constraint
//*************************************************************************************
void SketchPlugin_ConstraintDistance::move(double theDeltaX, double theDeltaY)
{
//*************************************************************************************
void SketchPlugin_ConstraintDistance::move(double theDeltaX, double theDeltaY)
{
aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
aPoint->move(theDeltaX, theDeltaY);
}
aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
aPoint->move(theDeltaX, theDeltaY);
}
getFeaturePoint(aData, SketchPlugin_Constraint::ENTITY_B());
if (aPointA && aPointB) { // both points
aDistance = aPointA->pnt()->distance(aPointB->pnt());
} else {
if (!aPointA && aPointB) { //Line and point
getFeaturePoint(aData, SketchPlugin_Constraint::ENTITY_B());
if (aPointA && aPointB) { // both points
aDistance = aPointA->pnt()->distance(aPointB->pnt());
} else {
if (!aPointA && aPointB) { //Line and point
getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
if (aLine) {
aDistance = aLine->distanceToPoint(aPointB->pnt());
}
} else if (aPointA && !aPointB) { // Point and line
getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
if (aLine) {
aDistance = aLine->distanceToPoint(aPointB->pnt());
}
} else if (aPointA && !aPointB) { // Point and line
getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
if (aLine) {
aDistance = aLine->distanceToPoint(aPointA->pnt());
getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
if (aLine) {
aDistance = aLine->distanceToPoint(aPointA->pnt());
ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
if (anAttr)
aFeature = ModelAPI_Feature::feature(anAttr->object());
if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
if (anAttr)
aFeature = ModelAPI_Feature::feature(anAttr->object());
if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
else if (aFeature && aFeature->getKind() == SketchPlugin_Circle::ID())
aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
else if (aFeature && aFeature->getKind() == SketchPlugin_Circle::ID())
ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
if (anAttr) {
FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
if (anAttr) {
FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
-boost::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
- const boost::shared_ptr<SketchPlugin_Line>& theLine,
- const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
+ const std::shared_ptr<SketchPlugin_Line>& theLine,
+ const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
- boost::shared_ptr<ModelAPI_Data> aData = theLine->data();
- boost::shared_ptr<GeomDataAPI_Point2D> aPoint1 = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ std::shared_ptr<ModelAPI_Data> aData = theLine->data();
+ std::shared_ptr<GeomDataAPI_Point2D> aPoint1 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aData->attribute(SketchPlugin_Line::END_ID()));
GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
aData->attribute(SketchPlugin_Line::END_ID()));
GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());