mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 22:16:41 +00:00
Preprocessor stuff for stp and igs serializers
This commit is contained in:
@@ -35,9 +35,12 @@
|
|||||||
|
|
||||||
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||||
|
|
||||||
#include <IGESControl_Controller.hxx>
|
|
||||||
#include <Standard_Version.hxx>
|
#include <Standard_Version.hxx>
|
||||||
|
|
||||||
|
#if OCC_VERSION_HEX < 0x60900
|
||||||
|
#include <IGESControl_Controller.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -562,7 +565,10 @@ int main(int argc, char** argv)
|
|||||||
} else if (output_extension == ".stp") {
|
} else if (output_extension == ".stp") {
|
||||||
serializer = new StepSerializer(output_temp_filename, settings);
|
serializer = new StepSerializer(output_temp_filename, settings);
|
||||||
} else if (output_extension == ".igs") {
|
} else if (output_extension == ".igs") {
|
||||||
|
#if OCC_VERSION_HEX < 0x60900
|
||||||
|
// According to https://tracker.dev.opencascade.org/view.php?id=25689 something has been fixed in 6.9.0
|
||||||
IGESControl_Controller::Init(); // work around Open Cascade bug
|
IGESControl_Controller::Init(); // work around Open Cascade bug
|
||||||
|
#endif
|
||||||
serializer = new IgesSerializer(output_temp_filename, settings);
|
serializer = new IgesSerializer(output_temp_filename, settings);
|
||||||
} else if (output_extension == ".svg") {
|
} else if (output_extension == ".svg") {
|
||||||
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
||||||
|
|||||||
@@ -21,9 +21,15 @@
|
|||||||
#define IGESSERIALIZER_H
|
#define IGESSERIALIZER_H
|
||||||
|
|
||||||
#include "OpenCascadeBasedSerializer.h"
|
#include "OpenCascadeBasedSerializer.h"
|
||||||
|
#include "../ifcparse/IfcLogger.h"
|
||||||
|
|
||||||
#include <IGESControl_Writer.hxx>
|
#include <IGESControl_Writer.hxx>
|
||||||
|
|
||||||
|
#ifndef HAVE_CONFIG_H
|
||||||
|
/// @note this is brittle, but apparently the only way to differentiate OCCT
|
||||||
|
/// from OCE. In the latter including this header fails for some versions.
|
||||||
#include <Interface_Static.hxx>
|
#include <Interface_Static.hxx>
|
||||||
|
#endif
|
||||||
|
|
||||||
class IgesSerializer : public OpenCascadeBasedSerializer
|
class IgesSerializer : public OpenCascadeBasedSerializer
|
||||||
{
|
{
|
||||||
@@ -45,8 +51,12 @@ public:
|
|||||||
void setUnitNameAndMagnitude(const std::string& /*name*/, float magnitude) {
|
void setUnitNameAndMagnitude(const std::string& /*name*/, float magnitude) {
|
||||||
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
const char* symbol = getSymbolForUnitMagnitude(magnitude);
|
||||||
if (symbol) {
|
if (symbol) {
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
Logger::Warning("Setting IGES units not supported on OCE");
|
||||||
|
#else
|
||||||
Interface_Static::SetCVal("xstep.cascade.unit", symbol);
|
Interface_Static::SetCVal("xstep.cascade.unit", symbol);
|
||||||
Interface_Static::SetCVal("write.iges.unit", symbol);
|
Interface_Static::SetCVal("write.iges.unit", symbol);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user