#include <GltfForwardTranslator.hpp>
Public Member Functions | |
GltfForwardTranslator () | |
bool | modelToGLTF (const model::Model &model, const path &outputPath) |
Convert an OpenStudio Model to Gltf format. More... | |
bool | modelToGLTF (const model::Model &model, std::function< void(double)> updatePercentage, const path &outputpath) |
std::string | modelToGLTFString (const model::Model &model) |
Convert an OpenStudio Model to Gltf format but as a JSON string. More... | |
QA / QC convenience methods | |
bool | loadGLTF (const path &inputPath, const path &inputNonEmbededpath) |
load minimal gltf for QA/QC More... | |
bool | loadGLTF (const path &inputPath) |
load minimal gltf for QA/QC More... | |
GltfMetaData | getMetaData () const |
std::vector< GltfUserData > | getUserDataCollection () const |
boost::optional< GltfUserData > | getUserDataBySurfaceName (const std::string &surfaceName) const |
std::vector< LogMessage > | warnings () const |
Get warning messages generated by the last translation. More... | |
std::vector< LogMessage > | errors () const |
Get error messages generated by the last translation. More... | |
GltfForwardTranslator converts an OpenStudio Model to GLTF format.
There are two variations of the GLTF format, a triangulated one which is suitable for rendering with GLTF and non-triangulated one that preserves all vertices in a surface for conversion to OpenStudio Model format.
The FloorplanJS in the Utilities/Geometry project converts a FloorspaceJS JSON file to GLTF format, code should be shared between these two classes as much as possible.
openstudio::gltf::GltfForwardTranslator::GltfForwardTranslator | ( | ) |
std::vector<LogMessage> openstudio::gltf::GltfForwardTranslator::errors | ( | ) | const |
Get error messages generated by the last translation.
GltfMetaData openstudio::gltf::GltfForwardTranslator::getMetaData | ( | ) | const |
boost::optional<GltfUserData> openstudio::gltf::GltfForwardTranslator::getUserDataBySurfaceName | ( | const std::string & | surfaceName | ) | const |
std::vector<GltfUserData> openstudio::gltf::GltfForwardTranslator::getUserDataCollection | ( | ) | const |
bool openstudio::gltf::GltfForwardTranslator::loadGLTF | ( | const path & | inputPath, |
const path & | inputNonEmbededpath | ||
) |
load minimal gltf for QA/QC
bool openstudio::gltf::GltfForwardTranslator::loadGLTF | ( | const path & | inputPath | ) |
load minimal gltf for QA/QC
bool openstudio::gltf::GltfForwardTranslator::modelToGLTF | ( | const model::Model & | model, |
const path & | outputPath | ||
) |
Convert an OpenStudio Model to Gltf format.
bool openstudio::gltf::GltfForwardTranslator::modelToGLTF | ( | const model::Model & | model, |
std::function< void(double)> | updatePercentage, | ||
const path & | outputpath | ||
) |
std::string openstudio::gltf::GltfForwardTranslator::modelToGLTFString | ( | const model::Model & | model | ) |
Convert an OpenStudio Model to Gltf format but as a JSON string.
std::vector<LogMessage> openstudio::gltf::GltfForwardTranslator::warnings | ( | ) | const |
Get warning messages generated by the last translation.