]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchAPI/SketchAPI_Projection.cpp
Salome HOME
Task #3235: Projection without link to source shape
[modules/shaper.git] / src / SketchAPI / SketchAPI_Projection.cpp
index 06c36fa664b988d209e606d75147ae6b6a9462e2..8c833606b9bfe25b5079a70d94bc59ab406ccbd2 100644 (file)
@@ -56,16 +56,6 @@ SketchAPI_Projection::SketchAPI_Projection(
   }
 }
 
-SketchAPI_Projection::SketchAPI_Projection(
-    const std::shared_ptr<ModelAPI_Feature> & theFeature,
-    const std::wstring & theExternalName)
-: SketchAPI_SketchEntity(theFeature)
-{
-  if (initialize()) {
-    setByExternalName(theExternalName);
-  }
-}
-
 SketchAPI_Projection::~SketchAPI_Projection()
 {
 
@@ -79,14 +69,18 @@ void SketchAPI_Projection::setExternalFeature(const ModelHighAPI_Selection & the
   execute(true);
 }
 
-void SketchAPI_Projection::setByExternalName(const std::wstring& 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);
 }