From f2668eae4e25a10bc854f369019fc0fe7ee993ae Mon Sep 17 00:00:00 2001 From: sigurdp Date: Tue, 15 Jan 2019 15:13:45 +0100 Subject: [PATCH] HoloLens: Export of cull face mode to JSON --- .../HoloLensCommands/VdeVizDataExtractor.cpp | 12 ++++++++++++ .../Commands/HoloLensCommands/VdeVizDataExtractor.h | 1 + 2 files changed, 13 insertions(+) diff --git a/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp b/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp index 122dff2b11..459ff9e31a 100644 --- a/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp +++ b/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.cpp @@ -303,6 +303,13 @@ std::unique_ptr VdeVizDataExtractor::createMeshFromExportPart(const Vde mesh->color = exportPart.color(); mesh->opacity = exportPart.opacity(); + if (exportPart.cullFace() != VdeExportPart::CF_NONE) + { + if (exportPart.cullFace() == VdeExportPart::CF_FRONT) mesh->cullFaceModeStr = "front"; + else if (exportPart.cullFace() == VdeExportPart::CF_BACK) mesh->cullFaceModeStr = "back"; + else mesh->cullFaceModeStr = "none"; + } + //cvf::Trace::show("createMeshFromExportPart(): numFaces=%d, time=%dms", faceCount, static_cast(tim.time()*1000)); return mesh; @@ -345,6 +352,11 @@ QString VdeVizDataExtractor::createModelMetaJsonString(const std::vectoropacity; + if (!mesh->cullFaceModeStr.isEmpty()) + { + jsonMeshMeta["cullFaceMode"] = mesh->cullFaceModeStr; + } + jsonMeshMetaList.push_back(jsonMeshMeta); } diff --git a/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.h b/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.h index f4f2c81711..9acf5cefc3 100644 --- a/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.h +++ b/ApplicationCode/Commands/HoloLensCommands/VdeVizDataExtractor.h @@ -48,6 +48,7 @@ struct VdeMesh cvf::Color3f color; float opacity; + QString cullFaceModeStr; // front, back or none (or empty) int verticesPerPrimitive; cvf::cref vertexArr;