X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintParallel.cpp;h=42ce74b78572f01ad5a9af1544e639eca8544320;hb=f5c7bb3100ed321392da42f61c2ab505833ec61a;hp=91e6c4ca52fa1e6500a538809e759e6fc01caf49;hpb=ea1f85e839a4208cc3ed0789d924044cccc53aa0;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index 91e6c4ca5..42ce74b78 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> + // File: SketchPlugin_ConstraintParallel.cpp // Created: 26 May 2014 // Author: Artem ZHIDKOV @@ -6,7 +8,20 @@ #include #include -#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include SketchPlugin_ConstraintParallel::SketchPlugin_ConstraintParallel() { @@ -14,17 +29,25 @@ SketchPlugin_ConstraintParallel::SketchPlugin_ConstraintParallel() void SketchPlugin_ConstraintParallel::initAttributes() { - data()->addAttribute(CONSTRAINT_ATTR_ENTITY_A, ModelAPI_AttributeRefAttr::type()); - data()->addAttribute(CONSTRAINT_ATTR_ENTITY_B, ModelAPI_AttributeRefAttr::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId()); + //data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId()); } void SketchPlugin_ConstraintParallel::execute() { } -const boost::shared_ptr& SketchPlugin_ConstraintParallel::preview() +AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevious) { - /// \todo Preview for parallel constraint - return getPreview(); + if (!sketch()) + return thePrevious; + + AISObjectPtr anAIS = thePrevious; + if (!anAIS) { + anAIS = SketcherPrs_Factory::parallelConstraint(this, sketch()->coordinatePlane()); + } + return anAIS; } +