X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintParallel.cpp;h=29a7f0a25c1c6da37e19c10a514b0ad0ee9687ff;hb=2e9c8b6bbbc29447cd5c68e9ca9f341d022bdd1b;hp=91e6c4ca52fa1e6500a538809e759e6fc01caf49;hpb=0def354d1ef7b4f5e942fee47b7d6b56e4d478ea;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index 91e6c4ca5..29a7f0a25 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::type()); + data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type()); + //data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::type()); } 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; } +