* 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
{
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()
+ /// End point of translation
+ inline static const std::string& ANGLE_FULL_ID()
+ {
+ static const std::string MY_ANGLE_FULL_ID("MultiRotationFullAngle");
+ return MY_ANGLE_FULL_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
ObjectPtr copyFeature(ObjectPtr theObject);
void rotateFeature(ObjectPtr theInitial, ObjectPtr theTarget,
double theCenterX, double theCenterY, double theAngle);
+
+ bool updateFullAngleValue();
+
+private:
+ bool myBlockAngle; /// a boolean state to avoid recusive angle change in attributeChanged
};
#endif