scenepic 1.1.0
3D Visualization Made Easy
|
Represents a ScenePic Canvas3D - a 3D viewport that can contain a number of Frame3Ds. More...
#include <canvas3d.h>
Public Member Functions | |
std::shared_ptr< Frame3D > | create_frame (const std::string &frame_id="", const FocusPoint &focus_point=FocusPoint::None(), const std::vector< std::string > &mesh_ids=std::vector< std::string >(), const Camera &camera=Camera::None()) |
Creates a new Frame3D object and appends to the list of Frame3Ds in the Canvas3D. More... | |
template<typename MeshType > | |
std::shared_ptr< Frame3D > | create_frame_with_meshes (const std::vector< std::shared_ptr< MeshType > > &meshes, const std::string &frame_id="", const FocusPoint &focus_point=FocusPoint::None(), const Camera &camera=Camera::None()) |
Creates a new Frame3D object and appends to the list of Frame3Ds in the Canvas3D. More... | |
void | set_layer_settings (const std::map< std::string, LayerSettings > layer_settings) |
Specify the visibilities and opacities of certain mesh layers. More... | |
const std::string & | canvas_id () const |
A unique identifier for the canvas. More... | |
void | clear_script () |
Call this if you are dumping a ScenePic script in multiple parts, e.g. More... | |
std::string | to_string () const |
Return a JSON string representing the object. More... | |
JsonValue | to_json () const |
Convert this object into ScenePic json. More... | |
const Camera & | camera () const |
Set of Camera parameters for the Canvas. More... | |
Canvas3D & | camera (const Camera &value) |
Set of Camera parameters for the Canvas. More... | |
const Shading & | shading () const |
Set of Shading parameters for the Canvas. More... | |
Canvas3D & | shading (const Shading &value) |
Set of Shading parameters for the Canvas. More... | |
const FocusPoint & | focus_point () const |
The default focus point for the canvas. More... | |
Canvas3D & | focus_point (const FocusPoint &value) |
The default focus point for the canvas. More... | |
const UIParameters & | ui_parameters () const |
Set of user interface parameters. More... | |
Canvas3D & | ui_parameters (const UIParameters &value) |
Set of user interface parameters. More... | |
const std::string & | media_id () const |
The unique ID of the media file associated with this canvas. More... | |
Canvas3D & | media_id (const std::string &audio_id) |
double | width () const |
The width of the canvas. More... | |
double | height () const |
The width of the canvas. More... | |
Friends | |
class | Scene |
Represents a ScenePic Canvas3D - a 3D viewport that can contain a number of Frame3Ds.
Set of Camera parameters for the Canvas.
const std::string & scenepic::Canvas3D::canvas_id | ( | ) | const |
A unique identifier for the canvas.
void scenepic::Canvas3D::clear_script | ( | ) |
Call this if you are dumping a ScenePic script in multiple parts, e.g.
for client-server interactions, or when chunking a large visualization into multiple files.
std::shared_ptr< Frame3D > scenepic::Canvas3D::create_frame | ( | const std::string & | frame_id = "" , |
const FocusPoint & | focus_point = FocusPoint::None() , |
||
const std::vector< std::string > & | mesh_ids = std::vector< std::string >() , |
||
const Camera & | camera = Camera::None() |
||
) |
Creates a new Frame3D object and appends to the list of Frame3Ds in the Canvas3D.
frame_id | a unique identifier for the Frame3D (will be automatically populated if not provided). |
focus_point | optional 3D focus point for this frame (with optional 3D rotation for orientation lock), used in the ScenePic user interface. |
mesh_ids | optionally pre-populate this Frame3D with a set of Meshes, for convenience. |
camera | an optional camera for the frame |
|
inline |
Creates a new Frame3D object and appends to the list of Frame3Ds in the Canvas3D.
frame_id | a unique identifier for the Frame3D (will be automatically populated if not provided). |
meshes | optionally pre-populate this Frame3D with a set of Meshes, for convenience. |
focus_point | optional 3D focus point for this frame (with optional 3D rotation for orientation lock), used in the ScenePic user interface. |
camera | optional camera for the frame |
MeshType | a type with a mesh_id method. |
const FocusPoint & scenepic::Canvas3D::focus_point | ( | ) | const |
The default focus point for the canvas.
Canvas3D & scenepic::Canvas3D::focus_point | ( | const FocusPoint & | value | ) |
The default focus point for the canvas.
double scenepic::Canvas3D::height | ( | ) | const |
The width of the canvas.
const std::string & scenepic::Canvas3D::media_id | ( | ) | const |
The unique ID of the media file associated with this canvas.
This file will be used to drive playback, i.e. frames will be displayed in time with the playback of the media file.
Canvas3D & scenepic::Canvas3D::media_id | ( | const std::string & | audio_id | ) |
void scenepic::Canvas3D::set_layer_settings | ( | const std::map< std::string, LayerSettings > | layer_settings | ) |
Specify the visibilities and opacities of certain mesh layers.
Each Mesh object can optionally be part of a user-identified layer (see Mesh constructor). Calling set_layer_settings will result in an additional drop-down selector in the ScenePic user interface. Currently, opacity is only guaranteed to be correct for Meshes that do not overlap. If you know one mesh should be rendered before another for opacity purposes, use the renderOrder setting: low numbers will be drawn before high numbers, and layers with no renderOrder set will be drawn first. Meshes without layer ids, or with layer ids that are not specified in this dictionary, will be drawn filled, without wireframe, at opacity 1.0, and before any layers with renderOrder set.
Set of Shading parameters for the Canvas.
JsonValue scenepic::Canvas3D::to_json | ( | ) | const |
Convert this object into ScenePic json.
std::string scenepic::Canvas3D::to_string | ( | ) | const |
Return a JSON string representing the object.
const UIParameters & scenepic::Canvas3D::ui_parameters | ( | ) | const |
Set of user interface parameters.
Canvas3D & scenepic::Canvas3D::ui_parameters | ( | const UIParameters & | value | ) |
Set of user interface parameters.
double scenepic::Canvas3D::width | ( | ) | const |
The width of the canvas.
|
friend |