|
| FloorplanJS () |
| default constructor More...
|
|
| FloorplanJS (const std::string &json) |
| constructor from JSON formatted string, will throw if error More...
|
|
double | northAxis () const |
| degrees from North measured clockwise More...
|
|
void | resetNorthAxis () |
|
void | resetUnits () |
|
bool | setNorthAxis (double northAxis) |
|
bool | setUnits (const std::string &units) |
|
std::string | toJSON (bool prettyPrint=false) const |
| print to JSON More...
|
|
ThreeScene | toThreeScene (bool openstudioFormat) const |
| convert to ThreeJS, will throw if error if openstudioFormat is true, surfaces will be created with arbitrary number of vertices, not suitable for rendering using ThreeJS if openstudioFormat is false, surfaces will be created with with either 3 or 4 vertices, suitable for rendering using ThreeJS ThreeJS file produced will always be in metric units, NorthAxis will not be applied during this conversion More...
|
|
std::string | units () const |
| unit system, "ip" or "si" More...
|
|
void | updateBuildingUnits (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
|
void | updateConstructionSets (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
|
void | updateSpaces (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
|
void | updateSpaceTypes (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
|
void | updateStories (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
| update object names in Floorplan with external data if object with same handle exists, name will be updated else if object with same name exists, handle will be assigned else new object will be added if removeMissingObjects is true, then existing objects not in input will be deleted More...
|
|
void | updateThermalZones (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
|
FloorplanJS is an adapter for the FloorspaceJS JSON format.
This class includes code which transforms a FloorspaceJS JSON into a 3D model in ThreeJS format. There are two variations of the ThreeJS format, one which is suitable for rendering with ThreeJS and one that preserves all vertices in a surface for conversion to OpenStudio Model format. Converting from FloorspaceJS to ThreeJS to OpenStudio ensures that the ThreeJS preview of a FloorspaceJS model is as accurate as possible. These conversions can also be used to convert a FloorspaceJS file to a 3D model for translation to other 3D formats.
FloorplanJS does not support version translation of old FloorspaceJS files, that functionality is in the FloorspaceJS project.
The ThreeJSForwardTranslator in the Model project converts an OpenStudio Model to ThreeJS format, code should be shared between these two classes as much as possible.
The class is not impl-ized in hopes that it can be ported to JavaScript via emscripten
ThreeScene openstudio::FloorplanJS::toThreeScene |
( |
bool |
openstudioFormat | ) |
const |
convert to ThreeJS, will throw if error if openstudioFormat is true, surfaces will be created with arbitrary number of vertices, not suitable for rendering using ThreeJS if openstudioFormat is false, surfaces will be created with with either 3 or 4 vertices, suitable for rendering using ThreeJS ThreeJS file produced will always be in metric units, NorthAxis will not be applied during this conversion