HoloLens: Export of cull face mode to JSON

This commit is contained in:
sigurdp 2019-01-15 15:13:45 +01:00
parent 7588c0d2ae
commit f2668eae4e
2 changed files with 13 additions and 0 deletions

View File

@ -303,6 +303,13 @@ std::unique_ptr<VdeMesh> 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<int>(tim.time()*1000));
return mesh;
@ -345,6 +352,11 @@ QString VdeVizDataExtractor::createModelMetaJsonString(const std::vector<std::un
jsonMeshMeta["opacity"] = mesh->opacity;
if (!mesh->cullFaceModeStr.isEmpty())
{
jsonMeshMeta["cullFaceMode"] = mesh->cullFaceModeStr;
}
jsonMeshMetaList.push_back(jsonMeshMeta);
}

View File

@ -48,6 +48,7 @@ struct VdeMesh
cvf::Color3f color;
float opacity;
QString cullFaceModeStr; // front, back or none (or empty)
int verticesPerPrimitive;
cvf::cref<cvf::Vec3fArray> vertexArr;