mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-18 11:20:21 +00:00
Add geometry database (.rdbview) export to IfcViewerFull
Wire a new "Export Geometry Database" tool button in AddModelDialog, adjacent to "Convert IFC File to Database", to produce a zipped read-only artifact combining a lossy RDB (with IfcRepresentationItem stripped) and a .ifcview geometry sidecar. Intended for cloud coordination workflows where parametric geometry editing is not needed. Pipeline changes to support this: - document_serializer_context gains a `skip_supertypes` field; the rdb plugin forwards it to RocksDbSerializer so the same registry path produces full or lossy RDBs. - Vertex quantization helpers (octEncodeNormal + quantizeVertex) move out of ViewportWindow.cpp into a shared header so the sidecar's byte layout stays identical regardless of whether it came from a GPU readback or a CPU pipeline. - New HeadlessSidecarBuilder runs a GeometryStreamer on the calling thread, captures MeshChunk/InstanceChunk into a SidecarData on the CPU, then computes georef + packed elements + LODs and writes the .ifcview — no ViewportWindow or GL context required. The Controller's export flow runs RDB conversion + sidecar build + QZipWriter packaging on a background QThread, writing through `<dest>.tmp` then renaming for atomic appearance in cloud-sync folders. ifcviewer-full now links Qt6::CorePrivate for QZipWriter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,7 @@ boost::shared_ptr<Serializer> create_serializer(const ifcopenshell::serializers:
|
||||
if (context.input_filename.empty()) {
|
||||
throw ifcopenshell::exception("RocksDB document serializer requires an input filename");
|
||||
}
|
||||
return boost::make_shared<RocksDbSerializer>(context.input_filename, context.output_filename);
|
||||
return boost::make_shared<RocksDbSerializer>(context.input_filename, context.output_filename, context.skip_supertypes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ struct SERIALIZERS_API document_serializer_context {
|
||||
std::string schema_name;
|
||||
bool stream = false;
|
||||
int dialect = 0;
|
||||
// Supertype names to skip when streaming entities into the serializer.
|
||||
// Currently only honoured by the RocksDB serializer; consumers building
|
||||
// lossy/read-only databases pass e.g. {"IfcRepresentationItem"} to drop
|
||||
// geometry definitions.
|
||||
std::vector<std::string> skip_supertypes;
|
||||
};
|
||||
|
||||
class SERIALIZERS_API document_serializer_registry {
|
||||
|
||||
Reference in New Issue
Block a user