From: nds Date: Mon, 9 Nov 2015 08:59:51 +0000 (+0300) Subject: #816 In multi-rotation, be able to put the total angle or the step angle (Rotation... X-Git-Tag: V_2.0.0_alfa1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f5808114dee59a1d834275aded9f20fcb63f26d;p=modules%2Fshaper.git #816 In multi-rotation, be able to put the total angle or the step angle (Rotation only) Realization for Translation Correction for right focus change after the end point in the create operation selection. Later, it could be corrected if there is an alternative method to validators->isCase() is implemented. It should answer which controls are visible. It is important here, where the same attributes can be used in both switch cases but we do not like to focus those, which are not currently being used. --- diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp index 9c7994384..c94ae2dca 100755 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.cpp @@ -31,6 +31,7 @@ void SketchPlugin_MultiTranslation::initAttributes() data()->addAttribute(VALUE_TYPE(), ModelAPI_AttributeString::typeId()); data()->addAttribute(START_POINT_ID(), GeomDataAPI_Point2D::typeId()); + data()->addAttribute(START_FULL_POINT_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(END_POINT_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(END_FULL_POINT_ID(), GeomDataAPI_Point2D::typeId()); data()->addAttribute(NUMBER_OF_OBJECTS_ID(), ModelAPI_AttributeInteger::typeId()); @@ -272,6 +273,24 @@ void SketchPlugin_MultiTranslation::attributeChanged(const std::string& theID) data()->attribute(SketchPlugin_Constraint::ENTITY_B()))->clear(); } } + else if (theID == START_POINT_ID() && !myBlockValue) { + myBlockValue = true; + std::shared_ptr aStartPoint = + std::dynamic_pointer_cast(attribute(START_POINT_ID())); + std::shared_ptr aStartFullPoint = + std::dynamic_pointer_cast(attribute(START_FULL_POINT_ID())); + aStartFullPoint->setValue(aStartPoint->pnt()); + myBlockValue = false; + } + else if (theID == START_FULL_POINT_ID() && !myBlockValue) { + myBlockValue = true; + std::shared_ptr aStartPoint = + std::dynamic_pointer_cast(attribute(START_POINT_ID())); + std::shared_ptr aStartFullPoint = + std::dynamic_pointer_cast(attribute(START_FULL_POINT_ID())); + aStartPoint->setValue(aStartFullPoint->pnt()); + myBlockValue = false; + } else if (theID == END_POINT_ID() && !myBlockValue) { int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1; if (aNbCopies > 0) { diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.h b/src/SketchPlugin/SketchPlugin_MultiTranslation.h index ed9a8f878..b9d44214d 100644 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.h +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.h @@ -59,6 +59,13 @@ class SketchPlugin_MultiTranslation : public SketchPlugin_ConstraintBase static const std::string MY_START_POINT_ID("MultiTranslationStartPoint"); return MY_START_POINT_ID; } + /// Start point of translation + inline static const std::string& START_FULL_POINT_ID() + { + static const std::string MY_START_FULL_POINT_ID("MultiTranslationFullStartPoint"); + return MY_START_FULL_POINT_ID; + } + /// End point of translation inline static const std::string& END_POINT_ID() { diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index e728cf7cc..a1986c159 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -301,7 +301,7 @@