mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
HDF5 optional in code
This commit is contained in:
+10
-8
@@ -437,7 +437,7 @@ if(HDF5_SUPPORT)
|
|||||||
set(lib_ext a)
|
set(lib_ext a)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
SET(HDF5_LIBRARIES
|
SET(HDF5_LIBRARIES
|
||||||
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
|
"${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}"
|
||||||
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
|
"${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}"
|
||||||
"${HDF5_LIBRARY_DIR}/libz${zlib_post}.${lib_ext}"
|
"${HDF5_LIBRARY_DIR}/libz${zlib_post}.${lib_ext}"
|
||||||
@@ -449,14 +449,16 @@ if(HDF5_SUPPORT)
|
|||||||
if (NOT HDF5_LIBRARIES)
|
if (NOT HDF5_LIBRARIES)
|
||||||
# debian default
|
# debian default
|
||||||
|
|
||||||
SET(HDF5_LIBRARIES
|
SET(HDF5_LIBRARIES
|
||||||
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.a
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_cpp.a
|
||||||
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a
|
/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.a
|
||||||
/usr/lib/x86_64-linux-gnu/libsz.a
|
/usr/lib/x86_64-linux-gnu/libsz.a
|
||||||
/usr/lib/x86_64-linux-gnu/libaec.a
|
/usr/lib/x86_64-linux-gnu/libaec.a
|
||||||
z dl
|
z dl
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_definitions(-DWITH_HDF5)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
|
|||||||
@@ -105,7 +105,9 @@ void print_usage(bool suggest_help = true)
|
|||||||
<< " .igs IGES Initial Graphics Exchange Specification\n"
|
<< " .igs IGES Initial Graphics Exchange Specification\n"
|
||||||
<< " .xml XML Property definitions and decomposition tree\n"
|
<< " .xml XML Property definitions and decomposition tree\n"
|
||||||
<< " .svg SVG Scalable Vector Graphics (2D floor plan)\n"
|
<< " .svg SVG Scalable Vector Graphics (2D floor plan)\n"
|
||||||
|
#ifdef WITH_HDF5
|
||||||
<< " .h5 HDF Hierarchical Data Format storing positions, normals and indices\n"
|
<< " .h5 HDF Hierarchical Data Format storing positions, normals and indices\n"
|
||||||
|
#endif
|
||||||
<< " .ifc IFC-SPF Industry Foundation Classes\n"
|
<< " .ifc IFC-SPF Industry Foundation Classes\n"
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "If no output filename given, <input>" << IfcUtil::path::from_utf8(DEFAULT_EXTENSION) << " will be used as the output file.\n";
|
<< "If no output filename given, <input>" << IfcUtil::path::from_utf8(DEFAULT_EXTENSION) << " will be used as the output file.\n";
|
||||||
@@ -834,10 +836,12 @@ int main(int argc, char** argv) {
|
|||||||
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
||||||
serializer = boost::make_shared<SvgSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
|
serializer = boost::make_shared<SvgSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
|
||||||
}
|
}
|
||||||
|
#ifdef WITH_HDF5
|
||||||
else if (output_extension == HDF) {
|
else if (output_extension == HDF) {
|
||||||
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
settings.set(IfcGeom::IteratorSettings::DISABLE_TRIANGULATION, true);
|
||||||
serializer = boost::make_shared<HdfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
|
serializer = boost::make_shared<HdfSerializer>(IfcUtil::path::to_utf8(output_temp_filename), settings);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
else {
|
else {
|
||||||
cerr_ << "[Error] Unknown output filename extension '" << output_extension << "'\n";
|
cerr_ << "[Error] Unknown output filename extension '" << output_extension << "'\n";
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
* *
|
* *
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
#ifdef WITH_HDF5
|
||||||
|
|
||||||
#include "HdfSerializer.h"
|
#include "HdfSerializer.h"
|
||||||
|
|
||||||
@@ -125,3 +126,5 @@ void HdfSerializer::write(const IfcGeom::BRepElement* o) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
#ifndef HdfSERIALIZER_H
|
#ifndef HdfSERIALIZER_H
|
||||||
#define HdfSERIALIZER_H
|
#define HdfSERIALIZER_H
|
||||||
|
|
||||||
|
#ifdef WITH_HDF5
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -55,3 +57,5 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user