Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchAPI / SketchAPI_Offset.cpp
index 392d07fe0d1b653b6cde1212f6b4896fb4061159..7088e97ac01440f8bf32e4a3dbd652d5614e3371 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -34,13 +34,15 @@ SketchAPI_Offset::SketchAPI_Offset (const std::shared_ptr<ModelAPI_Feature> & th
 SketchAPI_Offset::SketchAPI_Offset (const std::shared_ptr<ModelAPI_Feature> & theFeature,
                                     const std::list<std::shared_ptr<ModelAPI_Object> > & theObjects,
                                     const ModelHighAPI_Double & theOffsetValue,
-                                    bool theIsReversed)
+                                    const bool theIsReversed,
+                                    const std::string & theJointType)
   : ModelHighAPI_Interface(theFeature)
 {
   if (initialize()) {
     fillAttribute(theObjects, edgesList());
     fillAttribute(theOffsetValue, value());
     fillAttribute(theIsReversed, reversed());
+    fillAttribute(theJointType, joint());
 
     execute();
   }
@@ -72,6 +74,7 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   AttributeRefListPtr aOffsetObjects = edgesList();
   AttributeDoublePtr aValue = value();
   AttributeBooleanPtr aReversed = reversed();
+  AttributeStringPtr aJoint = joint();
 
   // Check all attributes are already dumped. If not, store the feature as postponed.
   if (!theDumper.isDumped(aOffsetObjects)) {
@@ -80,7 +83,7 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   }
 
   theDumper << aBase << " = " << aSketchName << ".addOffset(" << aOffsetObjects << ", "
-            << aValue << ", " << aReversed << ")" << std::endl;
+            << aValue << ", " << aReversed  << ", " << aJoint << ")" << std::endl;
 
   // Dump variables for a list of created features
   theDumper << "[";
@@ -93,13 +96,12 @@ void SketchAPI_Offset::dump (ModelHighAPI_Dumper& theDumper) const
   }
   theDumper << "] = " << theDumper.name(aBase) << ".offset()" << std::endl;
 
-////  // Set necessary "auxiliary" flag for created features
-////  // (flag is set if it differs to anAux)
-////  for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
-////    FeaturePtr aFeature = (*anIt)->feature();
-////    bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
-////    if (aFeatAux != anAux->value())
-////      theDumper << theDumper.name((*anIt)->feature(), false)
-////                << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
-////  }
+  // Set necessary "auxiliary" flag for created features
+  for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
+    FeaturePtr aFeature = (*anIt)->feature();
+    bool aFeatAux = aFeature->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID())->value();
+    if (aFeatAux)
+      theDumper << theDumper.name((*anIt)->feature(), false)
+                << ".setAuxiliary(" << aFeatAux << ")" <<std::endl;
+  }
 }