scenepic 1.1.0
3D Visualization Made Easy
|
A 2D canvas that can contain a number of Frame2Ds. More...
#include <canvas2d.h>
Public Member Functions | |
const std::string & | canvas_id () const |
A unique identifier for the canvas. More... | |
std::shared_ptr< Frame2D > | create_frame (const std::string &frame_id="") |
Creates a new Frame2D object and appends to the list of Frame2Ds in the Canvas2D. 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 Color & | background_color () const |
The background color of the frame. More... | |
Canvas2D & | background_color (const Color &color) |
Set the background color of the frame. More... | |
double | width () const |
The width of the canvas. More... | |
double | height () const |
The width of the canvas. More... | |
const std::string & | media_id () const |
The unique ID of the media file associated with this canvas. More... | |
void | set_layer_settings (const std::map< std::string, LayerSettings > layer_settings) |
Specify the visibilities and opacities of certain mesh layers. More... | |
Canvas2D & | media_id (const std::string &media_id) |
Friends | |
class | Scene |
A 2D canvas that can contain a number of Frame2Ds.
const Color & scenepic::Canvas2D::background_color | ( | ) | const |
The background color of the frame.
Set the background color of the frame.
const std::string & scenepic::Canvas2D::canvas_id | ( | ) | const |
A unique identifier for the canvas.
void scenepic::Canvas2D::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< Frame2D > scenepic::Canvas2D::create_frame | ( | const std::string & | frame_id = "" | ) |
double scenepic::Canvas2D::height | ( | ) | const |
The width of the canvas.
const std::string & scenepic::Canvas2D::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.
Canvas2D & scenepic::Canvas2D::media_id | ( | const std::string & | media_id | ) |
void scenepic::Canvas2D::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.
JsonValue scenepic::Canvas2D::to_json | ( | ) | const |
Convert this object into ScenePic json.
std::string scenepic::Canvas2D::to_string | ( | ) | const |
Return a JSON string representing the object.
double scenepic::Canvas2D::width | ( | ) | const |
The width of the canvas.
|
friend |