#include "FloorplanJS.hpp"
Public Member Functions | |
double | elevation () const |
FloorplanJS () | |
FloorplanJS (const std::string &json) | |
double | latitude () const |
double | longitude () const |
double | northAxis () const |
void | resetElevation () |
void | resetLatitude () |
void | resetLongitude () |
void | resetNorthAxis () |
void | resetUnits () |
bool | setElevation (double elevation) |
bool | setLatitude (double latitude) |
bool | setLongitude (double longitude) |
bool | setNorthAxis (double northAxis) |
bool | setUnits (const std::string &units) |
std::string | toJSON (bool prettyPrint=false) const |
ThreeScene | toThreeScene (bool openstudioFormat) const |
std::string | units () const |
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) |
void | updateThermalZones (const std::vector< FloorplanObject > &objects, bool removeMissingObjects) |
Static Public Member Functions | |
static boost::optional < FloorplanJS > | load (const std::string &json) |
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
openstudio::FloorplanJS::FloorplanJS | ( | ) |
default constructor
openstudio::FloorplanJS::FloorplanJS | ( | const std::string & | json | ) |
constructor from JSON formatted string, will throw if error
double openstudio::FloorplanJS::elevation | ( | ) | const |
elevation from sea level
double openstudio::FloorplanJS::latitude | ( | ) | const |
degrees, North is positive, South is negative
|
static |
load from string
double openstudio::FloorplanJS::longitude | ( | ) | const |
degrees, West is negative, East is positive
double openstudio::FloorplanJS::northAxis | ( | ) | const |
degrees from Building North to True North measured clockwise, opposite of EnergyPlus convention
void openstudio::FloorplanJS::resetElevation | ( | ) |
void openstudio::FloorplanJS::resetLatitude | ( | ) |
void openstudio::FloorplanJS::resetLongitude | ( | ) |
void openstudio::FloorplanJS::resetNorthAxis | ( | ) |
void openstudio::FloorplanJS::resetUnits | ( | ) |
bool openstudio::FloorplanJS::setElevation | ( | double | elevation | ) |
bool openstudio::FloorplanJS::setLatitude | ( | double | latitude | ) |
bool openstudio::FloorplanJS::setLongitude | ( | double | longitude | ) |
bool openstudio::FloorplanJS::setNorthAxis | ( | double | northAxis | ) |
bool openstudio::FloorplanJS::setUnits | ( | const std::string & | units | ) |
std::string openstudio::FloorplanJS::toJSON | ( | bool | prettyPrint = false | ) | const |
print to JSON
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
std::string openstudio::FloorplanJS::units | ( | ) | const |
unit system, "ip" or "si"
void openstudio::FloorplanJS::updateBuildingUnits | ( | const std::vector< FloorplanObject > & | objects, |
bool | removeMissingObjects | ||
) |
void openstudio::FloorplanJS::updateConstructionSets | ( | const std::vector< FloorplanObject > & | objects, |
bool | removeMissingObjects | ||
) |
void openstudio::FloorplanJS::updateSpaces | ( | const std::vector< FloorplanObject > & | objects, |
bool | removeMissingObjects | ||
) |
void openstudio::FloorplanJS::updateSpaceTypes | ( | const std::vector< FloorplanObject > & | objects, |
bool | removeMissingObjects | ||
) |
void openstudio::FloorplanJS::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
void openstudio::FloorplanJS::updateThermalZones | ( | const std::vector< FloorplanObject > & | objects, |
bool | removeMissingObjects | ||
) |