Salome HOME
Main fix of this integration is in ConstraintRigid. The AIS should be created uncondi...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintLength.h
index b3954b6fadb246b0908bc902947436a830839b2a..d6098af221cf8c12e60b629ff246c56b80c63a45 100644 (file)
@@ -9,7 +9,10 @@
 
 #include "SketchPlugin.h"
 #include "SketchPlugin_ConstraintBase.h"
-#include <SketchPlugin_Sketch.h>
+#include "SketchPlugin_Sketch.h"
+
+#include <GeomAPI_ICustomPrs.h>
+
 #include <list>
 
 class GeomDataAPI_Point2D;
@@ -22,7 +25,7 @@ class GeomDataAPI_Point2D;
  *  SketchPlugin_Constraint::VALUE() (length) and SketchPlugin_Constraint::ENTITY_A() (segment),
  *  SketchPlugin_Constraint::FLYOUT_VALUE_PNT() (distance of a constraints handle)
  */
-class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase
+class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase, public GeomAPI_ICustomPrs
 {
  public:
   /// Length constraint kind
@@ -61,6 +64,10 @@ class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase
   /// \param theID identifier of changed attribute
   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
 
+  /// Customize presentation of the feature
+  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
+                                     std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs);
+
   /// \brief Use plugin manager for features creation
   SketchPlugin_ConstraintLength();
 
@@ -70,6 +77,9 @@ private:
     std::shared_ptr<GeomAPI_Pnt>& thePoint1, std::shared_ptr<GeomAPI_Pnt>& thePoint2,
     std::shared_ptr<GeomDataAPI_Point2D>& theStartPoint,
     std::shared_ptr<GeomDataAPI_Point2D>& theEndPoint);
+
+private:
+  bool myFlyoutUpdate; ///< to avoid cyclic dependencies on automatic updates of flyout point
 };
 
 #endif