OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::ThreeScene Class Reference

#include <ThreeJS.hpp>

Public Member Functions

std::vector< ThreeGeometrygeometries () const
 
boost::optional< ThreeGeometrygetGeometry (const std::string &geometryId) const
 
boost::optional< ThreeMaterialgetMaterial (const std::string &materialId) const
 
std::vector< ThreeMaterialmaterials () const
 
ThreeSceneMetadata metadata () const
 
ThreeSceneObject object () const
 This method is renamed to 'threeSceneObject()' in C#.
 
 ThreeScene (const std::string &json_str)
 constructor from JSON formatted string (or path to a JSON file), will throw if error
 
 ThreeScene (const ThreeSceneMetadata &metadata, const std::vector< ThreeGeometry > &geometries, const std::vector< ThreeMaterial > &materials, const ThreeSceneObject &sceneObject)
 constructor
 
std::string toJSON (bool prettyPrint=false) const
 print to JSON
 

Static Public Member Functions

static boost::optional< ThreeSceneload (const std::string &json)
 load from string
 

Detailed Description

ThreeScene is an adapter for a scene in the three.js geometry format, defined at: https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4.

The class is not impl-ized in hopes that it can be ported to JavaScript via emscripten

Constructor & Destructor Documentation

◆ ThreeScene() [1/2]

openstudio::ThreeScene::ThreeScene ( const ThreeSceneMetadata & metadata,
const std::vector< ThreeGeometry > & geometries,
const std::vector< ThreeMaterial > & materials,
const ThreeSceneObject & sceneObject )

constructor

◆ ThreeScene() [2/2]

openstudio::ThreeScene::ThreeScene ( const std::string & json_str)

constructor from JSON formatted string (or path to a JSON file), will throw if error

Member Function Documentation

◆ geometries()

std::vector< ThreeGeometry > openstudio::ThreeScene::geometries ( ) const

◆ getGeometry()

boost::optional< ThreeGeometry > openstudio::ThreeScene::getGeometry ( const std::string & geometryId) const

◆ getMaterial()

boost::optional< ThreeMaterial > openstudio::ThreeScene::getMaterial ( const std::string & materialId) const

◆ load()

static boost::optional< ThreeScene > openstudio::ThreeScene::load ( const std::string & json)
static

load from string

◆ materials()

std::vector< ThreeMaterial > openstudio::ThreeScene::materials ( ) const

◆ metadata()

ThreeSceneMetadata openstudio::ThreeScene::metadata ( ) const

◆ object()

ThreeSceneObject openstudio::ThreeScene::object ( ) const

This method is renamed to 'threeSceneObject()' in C#.

◆ toJSON()

std::string openstudio::ThreeScene::toJSON ( bool prettyPrint = false) const

print to JSON