-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "SketchAPI_Projection.h"
#include <SketchPlugin_Line.h>
+#include <SketchPlugin_BSpline.h>
+#include <SketchPlugin_BSplinePeriodic.h>
#include <SketchPlugin_Circle.h>
+#include <SketchPlugin_Ellipse.h>
+#include <SketchPlugin_EllipticArc.h>
#include <SketchPlugin_Point.h>
-#include <SketchAPI_Line.h>
-#include <SketchAPI_Circle.h>
#include <SketchAPI_Arc.h>
+#include <SketchAPI_BSpline.h>
+#include <SketchAPI_Circle.h>
+#include <SketchAPI_Ellipse.h>
+#include <SketchAPI_EllipticArc.h>
+#include <SketchAPI_Line.h>
#include <SketchAPI_Point.h>
#include <ModelHighAPI_Dumper.h>
}
}
-SketchAPI_Projection::SketchAPI_Projection(
- const std::shared_ptr<ModelAPI_Feature> & theFeature,
- const std::string & theExternalName)
-: SketchAPI_SketchEntity(theFeature)
-{
- if (initialize()) {
- setByExternalName(theExternalName);
- }
-}
-
SketchAPI_Projection::~SketchAPI_Projection()
{
execute(true);
}
-void SketchAPI_Projection::setByExternalName(const std::string& theExternalName)
+void SketchAPI_Projection::setIncludeToResult(bool theKeepResult)
{
- setExternalFeature(ModelHighAPI_Selection("EDGE", theExternalName));
+ fillAttribute(theKeepResult, includeToResult());
+ execute(true);
}
-void SketchAPI_Projection::setIncludeToResult(bool theKeepResult)
+void SketchAPI_Projection::setKeepReferenceToOriginal(bool theKeepRefToOriginal)
{
- fillAttribute(theKeepResult, includeToResult());
+ // the Fixed constraint should be assigned explicitly
+ fillAttribute(false, feature()->boolean(SketchPlugin_Projection::MAKE_FIXED()));
+ fillAttribute(theKeepRefToOriginal ? "true" : "false",
+ feature()->string(SketchPlugin_Projection::KEEP_REFERENCE_ID()));
execute(true);
}
anEntity.reset(new SketchAPI_Circle(aProjectedFeature));
else if (aProjectedFeature->getKind() == SketchPlugin_Arc::ID())
anEntity.reset(new SketchAPI_Arc(aProjectedFeature));
+ else if (aProjectedFeature->getKind() == SketchPlugin_Ellipse::ID())
+ anEntity.reset(new SketchAPI_Ellipse(aProjectedFeature));
+ else if (aProjectedFeature->getKind() == SketchPlugin_EllipticArc::ID())
+ anEntity.reset(new SketchAPI_EllipticArc(aProjectedFeature));
+ else if (aProjectedFeature->getKind() == SketchPlugin_BSpline::ID())
+ anEntity.reset(new SketchAPI_BSpline(aProjectedFeature));
+ else if (aProjectedFeature->getKind() == SketchPlugin_BSplinePeriodic::ID())
+ anEntity.reset(new SketchAPI_BSplinePeriodic(aProjectedFeature));
else if (aProjectedFeature->getKind() == SketchPlugin_Point::ID())
anEntity.reset(new SketchAPI_Point(aProjectedFeature));