X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_MultiRotation.h;h=3a1be2088bd46f66a413418e9f465c38c0c055c2;hb=dfaa54ec6f09d6849c3e767d2d43e1a00935075b;hp=e743386f48b338cad8edc05638c4b277c3584604;hpb=e7c4184a3752e98c384b35e812120fcadc92c194;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MultiRotation.h b/src/SketchPlugin/SketchPlugin_MultiRotation.h index e743386f4..3a1be2088 100644 --- a/src/SketchPlugin/SketchPlugin_MultiRotation.h +++ b/src/SketchPlugin/SketchPlugin_MultiRotation.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_MultiRotation : public SketchPlugin_ConstraintBase { @@ -53,17 +52,25 @@ class SketchPlugin_MultiRotation : public SketchPlugin_ConstraintBase static const std::string MY_CENTER_ID("MultiRotationCenter"); return MY_CENTER_ID; } + /// attribute name for first point + inline static const std::string& ANGLE_TYPE() + { + static const std::string ANGLE_TYPE_ATTR("AngleType"); + return ANGLE_TYPE_ATTR; + } + /// End point of translation inline static const std::string& ANGLE_ID() { static const std::string MY_ANGLE_ID("MultiRotationAngle"); return MY_ANGLE_ID; } - /// Number of translated objects - inline static const std::string& NUMBER_OF_COPIES_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("MultiRotationCopies"); - return MY_NUMBER_OF_COPIES_ID; + static const std::string MY_NUMBER_OF_OBJECTS_ID("MultiRotationObjects"); + return MY_NUMBER_OF_OBJECTS_ID; } /// \brief Creates a new part document if needed @@ -72,16 +79,25 @@ class SketchPlugin_MultiRotation : 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); + /// removes all fields from this feature: results, data, etc + SKETCHPLUGIN_EXPORT virtual void erase(); + /// \brief Use plugin manager for features creation SketchPlugin_MultiRotation(); private: ObjectPtr copyFeature(ObjectPtr theObject); - void rotateFeature(ObjectPtr theInitial, ObjectPtr theTarget, - double theCenterX, double theCenterY, double theAngle); + //void rotateFeature(ObjectPtr theInitial, ObjectPtr theTarget, + // double theCenterX, double theCenterY, double theAngle); + + bool updateFullAngleValue(); }; #endif