]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix compilation with opencascade version 6.8.0 and older 9048/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 14 Nov 2019 04:38:54 +0000 (22:38 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 14 Nov 2019 04:38:54 +0000 (22:38 -0600)
source/opencascade/utilities.cc

index c000c31730a806569103055b00d5dafb944c7e58..42229eea326f186ec4905be6b75836b81003e47c 100644 (file)
@@ -335,16 +335,24 @@ namespace OpenCASCADE
       }
 
     StlAPI_Writer writer;
-    const auto    error = writer.Write(shape_to_be_written, filename.c_str());
+
 #  if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) >= 690)
+    // opencascade versions 6.9.0 onwards return an error status
+    const auto error = writer.Write(shape_to_be_written, filename.c_str());
 
+    // which is a custom type between 6.9.0 and 7.1.0
 #    if ((OCC_VERSION_MAJOR * 100 + OCC_VERSION_MINOR * 10) < 720)
     AssertThrow(error == StlAPI_StatusOK,
                 ExcMessage("Error writing STL from shape."));
 #    else
+    // and a boolean from version 7.2.0 onwards
     AssertThrow(error == true, ExcMessage("Error writing STL from shape."));
 #    endif
 
+#  else
+
+    // for opencascade versions 6.8.0 and older the return value is void
+    writer.Write(shape_to_be_written, filename.c_str());
 #  endif
   }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.