OpenStudio:model
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
openstudio::model::ThreeJSForwardTranslator Class Reference

#include <ThreeJSForwardTranslator.hpp>

Public Member Functions

std::vector< LogMessageerrors () const
 Get error messages generated by the last translation. More...
 
ThreeScene modelToThreeJS (const Model &model, bool triangulateSurfaces)
 Convert an OpenStudio Model to ThreeJS format Triangulate surfaces if the ThreeJS representation will be used for display Do not triangulate surfaces if the ThreeJs representation will be translated back to a model. More...
 
ThreeScene modelToThreeJS (const Model &model, bool triangulateSurfaces, std::function< void(double)> updatePercentage)
 
 ThreeJSForwardTranslator ()
 
std::vector< LogMessagewarnings () const
 Get warning messages generated by the last translation. More...
 

Detailed Description

ThreeJSForwardTranslator converts an OpenStudio Model to ThreeJS format.

There are two variations of the ThreeJS format, a triangulated one which is suitable for rendering with ThreeJS 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 ThreeJS format, code should be shared between these two classes as much as possible.

Constructor & Destructor Documentation

openstudio::model::ThreeJSForwardTranslator::ThreeJSForwardTranslator ( )

Member Function Documentation

std::vector<LogMessage> openstudio::model::ThreeJSForwardTranslator::errors ( ) const

Get error messages generated by the last translation.

ThreeScene openstudio::model::ThreeJSForwardTranslator::modelToThreeJS ( const Model model,
bool  triangulateSurfaces 
)

Convert an OpenStudio Model to ThreeJS format Triangulate surfaces if the ThreeJS representation will be used for display Do not triangulate surfaces if the ThreeJs representation will be translated back to a model.

ThreeScene openstudio::model::ThreeJSForwardTranslator::modelToThreeJS ( const Model model,
bool  triangulateSurfaces,
std::function< void(double)>  updatePercentage 
)
std::vector<LogMessage> openstudio::model::ThreeJSForwardTranslator::warnings ( ) const

Get warning messages generated by the last translation.