X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintParallel.cpp;h=7a6f71af5650be85384f0ec15cb6d5111553cd37;hb=64981a525f8bc2c450475822e96dcc2766454ad3;hp=91e6c4ca52fa1e6500a538809e759e6fc01caf49;hpb=78be47ffdc50846de6c88b94fb8c933c7c21b5a1;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index 91e6c4ca5..7a6f71af5 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,23 @@ 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 = SketcherPrs_Factory::parallelConstraint(this, sketch()->coordinatePlane(), + thePrevious); + return anAIS; } +