X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MultiTranslation.h;h=b9d44214d7f980837841a29d2d67c69928de0600;hb=f5c7bb3100ed321392da42f61c2ab505833ec61a;hp=f741d2ee722f3b8942762b54f6e2bc8ea6a540a3;hpb=3d063c74ca0ff72184f77d74df198c3bf0730aff;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MultiTranslation.h b/src/SketchPlugin/SketchPlugin_MultiTranslation.h index f741d2ee7..b9d44214d 100644 --- a/src/SketchPlugin/SketchPlugin_MultiTranslation.h +++ b/src/SketchPlugin/SketchPlugin_MultiTranslation.h @@ -19,10 +19,9 @@ * SketchPlugin_Constraint::ENTITY_A() for initial list of objects and * SketchPlugin_Constraint::ENTITY_B() for the list of created objects * - * The list of created objects contains a number of copies of each object given in - * the NUMBER_OF_COPIES_ID() attribute plus 1 (the initial objects are stored into this - * attribute too). At the start of the list, there are collected N copies - * of first object from initial list, then N copies of second object etc. + * The list of created objects contains initial and copied objects of each object given. The + * number copies is the NUMBER_OF_OBJECTS_ID() minus 1. At the start of the list, there are + * collected N copies of first object from initial list, then N copies of second object etc. */ class SketchPlugin_MultiTranslation : public SketchPlugin_ConstraintBase { @@ -47,23 +46,44 @@ class SketchPlugin_MultiTranslation : public SketchPlugin_ConstraintBase return MY_TRANSLATION_LIST_ID; } + /// attribute name for first point + inline static const std::string& VALUE_TYPE() + { + static const std::string VALUE_TYPE_ATTR("ValueType"); + return VALUE_TYPE_ATTR; + } + /// Start point of translation inline static const std::string& START_POINT_ID() { 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() { static const std::string MY_END_POINT_ID("MultiTranslationEndPoint"); return MY_END_POINT_ID; } - /// Number of translated objects - inline static const std::string& NUMBER_OF_COPIES_ID() + /// End point of translation + inline static const std::string& END_FULL_POINT_ID() + { + static const std::string MY_END_FULL_POINT_ID("MultiTranslationFullEndPoint"); + return MY_END_FULL_POINT_ID; + } + + /// Total number of objects, initial and translated objects + inline static const std::string& NUMBER_OF_OBJECTS_ID() { - static const std::string MY_NUMBER_OF_COPIES_ID("MultiTranslationCopies"); - return MY_NUMBER_OF_COPIES_ID; + static const std::string MY_NUMBER_OF_OBJECTS_ID("MultiTranslationObjects"); + return MY_NUMBER_OF_OBJECTS_ID; } /// \brief Creates a new part document if needed @@ -72,6 +92,10 @@ class SketchPlugin_MultiTranslation : public SketchPlugin_ConstraintBase /// \brief Request for initialization of data model of the feature: adding all attributes SKETCHPLUGIN_EXPORT virtual void initAttributes(); + /// Called on change of any argument-attribute of this object + /// \param theID identifier of changed attribute + SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); + /// Returns the AIS preview SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious); @@ -80,6 +104,9 @@ class SketchPlugin_MultiTranslation : public SketchPlugin_ConstraintBase private: ObjectPtr copyFeature(ObjectPtr theObject); + +private: + bool myBlockValue; /// a boolean state to avoid recusive value change in attributeChanged }; #endif