+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
// File: SketchPlugin_ConstraintParallel.cpp
// Created: 26 May 2014
// Author: Artem ZHIDKOV
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_Data.h>
-#include <SketchPlugin_Point.h>
+#include <ModelAPI_ResultConstruction.h>
+
+#include <SketchPlugin_Line.h>
+#include <SketchPlugin_Sketch.h>
+
+#include <SketcherPrs_Factory.h>
+
+#include <GeomDataAPI_Point2D.h>
+#include <GeomAPI_Pnt2d.h>
+#include <GeomAPI_Pnt.h>
+#include <GeomDataAPI_Dir.h>
+#include <GeomDataAPI_Point.h>
+
+#include <Config_PropManager.h>
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<GeomAPI_Shape>& 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;
}
+