X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchSolver%2FSketchSolver_ConstraintMovement.cpp;h=bbaf6ac24a33074bf48e4a4917683609b8b2761e;hb=d5b5ce2284869d8b97ce638502c58c810bbeb0c7;hp=94c6d7af10066fa33f4489933acae9427abbdb76;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp index 94c6d7af1..bbaf6ac24 100644 --- a/src/SketchSolver/SketchSolver_ConstraintMovement.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintMovement.cpp @@ -78,12 +78,14 @@ void SketchSolver_ConstraintMovement::process() static bool isSimpleMove(FeaturePtr theMovedFeature, AttributePtr theDraggedPoint) { bool isSimple = true; +#ifdef CHANGE_RADIUS_WHILE_MOVE if (theMovedFeature->getKind() == SketchPlugin_Circle::ID()) isSimple = (theDraggedPoint.get() != 0); else if (theMovedFeature->getKind() == SketchPlugin_Arc::ID()) { isSimple = (theDraggedPoint.get() != 0 && theDraggedPoint->id() == SketchPlugin_Arc::CENTER_ID()); } +#endif return isSimple; } @@ -210,10 +212,17 @@ void SketchSolver_ConstraintMovement::startPoint( void SketchSolver_ConstraintMovement::moveTo( const std::shared_ptr& theDestinationPoint) { + if (!myMovedFeature) + return; // nothing to move + double aDelta[2] = { theDestinationPoint->x() - myStartPoint->x(), theDestinationPoint->y() - myStartPoint->y() }; +#ifdef CHANGE_RADIUS_WHILE_MOVE int aMaxSize = mySimpleMove ? (int)myFixedValues.size() : 2; +#else + int aMaxSize = myMovedFeature->getKind() == SketchPlugin_Line::ID() && !myDraggedPoint ? 4 : 2; +#endif for (int i = 0; i < aMaxSize; ++i) myFixedValues[i] += aDelta[i % 2]; }