OpenStudio:gltf
 All Classes Namespaces Functions Typedefs Pages
Public Member Functions | List of all members
openstudio::gltf::GltfForwardTranslator Class Reference

#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< GltfUserDatagetUserDataCollection () const
 
boost::optional< GltfUserDatagetUserDataBySurfaceName (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

openstudio::gltf::GltfForwardTranslator::GltfForwardTranslator ( )

Member Function Documentation

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.