From: dbv Date: Tue, 16 Jun 2015 20:47:45 +0000 (+0300) Subject: Fix for selection of translation and rotation constraints X-Git-Tag: V_1.3.0~231 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aa0a1a69f9309b922dc953ef1bfd4fae588807d4;p=modules%2Fshaper.git Fix for selection of translation and rotation constraints --- 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;