Salome HOME
Issue #1063: Problem of dynamic cast on Linux for Selection validators is solved
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MultiTranslation.h
index 5bebd18825b6a04e5a4d511c70cc74981417b33e..b9d44214d7f980837841a29d2d67c69928de0600 100644 (file)
  *  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
@@ -84,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