Salome HOME
Dump "auxiliary" flag for offset geometry
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 15 Feb 2021 20:52:59 +0000 (23:52 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Mon, 15 Feb 2021 20:52:59 +0000 (23:52 +0300)
src/SketchAPI/SketchAPI_Offset.cpp
test.hdfs/BearingSeparator.hdf [new file with mode: 0644]
test.hdfs/BearingSeparator.py [new file with mode: 0644]

index 392d07fe0d1b653b6cde1212f6b4896fb4061159..5d4e4a4b86b9bf9f895a6c84dfd5f8032be49fdb 100644 (file)
@@ -93,13 +93,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;
+  }
 }
diff --git a/test.hdfs/BearingSeparator.hdf b/test.hdfs/BearingSeparator.hdf
new file mode 100644 (file)
index 0000000..b447aab
Binary files /dev/null and b/test.hdfs/BearingSeparator.hdf differ
diff --git a/test.hdfs/BearingSeparator.py b/test.hdfs/BearingSeparator.py
new file mode 100644 (file)
index 0000000..1db90ed
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2021  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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+if __name__ == "__main__":
+  aPartFeature = locals()["Part_1"]
+  model.testNbResults(aPartFeature, 1)
+  model.testNbSubResults(aPartFeature, [0])
+  model.testNbSubShapes(aPartFeature, GeomAPI_Shape.SOLID, [1])
+  model.testNbSubShapes(aPartFeature, GeomAPI_Shape.FACE, [115])
+  model.testNbSubShapes(aPartFeature, GeomAPI_Shape.EDGE, [890])
+  model.testNbSubShapes(aPartFeature, GeomAPI_Shape.VERTEX, [1780])
+  model.testResultsVolumes(aPartFeature, [1311.87963636394])
+  model.testResultsAreas(aPartFeature, [3765.24411189])
+
+  assert(model.checkPythonDump())