From aa0a1a69f9309b922dc953ef1bfd4fae588807d4 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 16 Jun 2015 23:47:45 +0300 Subject: [PATCH] Fix for selection of translation and rotation constraints --- src/SketcherPrs/SketcherPrs_Transformation.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/SketcherPrs/SketcherPrs_Transformation.cpp b/src/SketcherPrs/SketcherPrs_Transformation.cpp index 47f32f7b5..02a326bfe 100644 --- a/src/SketcherPrs/SketcherPrs_Transformation.cpp +++ b/src/SketcherPrs/SketcherPrs_Transformation.cpp @@ -9,6 +9,9 @@ #include "SketcherPrs_PositionMgr.h" #include +#include +#include +#include #include #include @@ -26,6 +29,14 @@ SketcherPrs_Transformation::SketcherPrs_Transformation(ModelAPI_Feature* theCons bool isTranslation) : SketcherPrs_SymbolPrs(theConstraint, thePlane), myIsTranslation(isTranslation) { + int aPointsNb = 0; + if (theConstraint->getKind() == SketchPlugin_MultiTranslation::ID()) { + aPointsNb = theConstraint->integer(SketchPlugin_MultiTranslation::NUMBER_OF_COPIES_ID())->value(); + } else if (theConstraint->getKind() == SketchPlugin_MultiRotation::ID()) { + aPointsNb = theConstraint->integer(SketchPlugin_MultiRotation::NUMBER_OF_COPIES_ID())->value(); + } + aPointsNb == 0 ? aPointsNb = 2 : aPointsNb++; // by default we have 2 points for symbols + myPntArray = new Graphic3d_ArrayOfPoints(aPointsNb); } bool SketcherPrs_Transformation::updatePoints(double theStep) const @@ -40,7 +51,6 @@ bool SketcherPrs_Transformation::updatePoints(double theStep) const return false; SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); - myPntArray = new Graphic3d_ArrayOfPoints(aNbB); int i; ObjectPtr aObj; -- 2.39.2