]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[GITHUB #2] problem in export dialog - difference in STEP vs BREP github/002_problem_in_export_dialog 70/head
authormbs <martin.bernhard@opencascade.com>
Wed, 11 Sep 2024 17:29:33 +0000 (18:29 +0100)
committermbs <martin.bernhard@opencascade.com>
Wed, 11 Sep 2024 17:29:33 +0000 (18:29 +0100)
When selecting a feature, the context is a Feature and not a Result.
Therefore, the result pointer is NULL and causes a SIGSEGV on Linux.
On Windows, the exception is caught in Model_Update::executeFeature().

src/GeomAlgoAPI/GeomAlgoAPI_STEPExport.cpp

index 651b1b401f3074470b61887a468fe5a636bf2000..a02cf68099dbd548baa737c82354e51c6b3469f6 100644 (file)
@@ -142,9 +142,12 @@ bool STEPExport(const std::string& theFileName,
       getAttributes(*aResult, anAttrs);
       exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab);
     }
-    else { // whole result selection
+    else if (aResult->get()) { // whole result selection
       putResult(*aResult, GeomShapePtr(), aNullLab, anAttrs);
     }
+    else { // feature selection => export simple shape
+      exportShape(*aShape, anAttrs, GeomShapePtr(), aNullLab);
+    }
   }
   // store the XCAF document to STEP file
   try {