scenepic 1.1.0
3D Visualization Made Easy
Public Member Functions | Friends | List of all members
scenepic::Canvas3D Class Reference

Represents a ScenePic Canvas3D - a 3D viewport that can contain a number of Frame3Ds. More...

#include <canvas3d.h>

Public Member Functions

std::shared_ptr< Frame3Dcreate_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< Frame3Dcreate_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 Cameracamera () const
 Set of Camera parameters for the Canvas. More...
 
Canvas3Dcamera (const Camera &value)
 Set of Camera parameters for the Canvas. More...
 
const Shadingshading () const
 Set of Shading parameters for the Canvas. More...
 
Canvas3Dshading (const Shading &value)
 Set of Shading parameters for the Canvas. More...
 
const FocusPointfocus_point () const
 The default focus point for the canvas. More...
 
Canvas3Dfocus_point (const FocusPoint &value)
 The default focus point for the canvas. More...
 
const UIParametersui_parameters () const
 Set of user interface parameters. More...
 
Canvas3Dui_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...
 
Canvas3Dmedia_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
 

Detailed Description

Represents a ScenePic Canvas3D - a 3D viewport that can contain a number of Frame3Ds.

Member Function Documentation

◆ camera() [1/2]

const Camera & scenepic::Canvas3D::camera ( ) const

Set of Camera parameters for the Canvas.

◆ camera() [2/2]

Canvas3D & scenepic::Canvas3D::camera ( const Camera value)

Set of Camera parameters for the Canvas.

◆ canvas_id()

const std::string & scenepic::Canvas3D::canvas_id ( ) const

A unique identifier for the canvas.

◆ clear_script()

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.

◆ create_frame()

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.

Parameters
frame_ida unique identifier for the Frame3D (will be automatically populated if not provided).
focus_pointoptional 3D focus point for this frame (with optional 3D rotation for orientation lock), used in the ScenePic user interface.
mesh_idsoptionally pre-populate this Frame3D with a set of Meshes, for convenience.
cameraan optional camera for the frame
Returns
a new Frame3D object

◆ create_frame_with_meshes()

template<typename MeshType >
std::shared_ptr< Frame3D > scenepic::Canvas3D::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() 
)
inline

Creates a new Frame3D object and appends to the list of Frame3Ds in the Canvas3D.

Parameters
frame_ida unique identifier for the Frame3D (will be automatically populated if not provided).
meshesoptionally pre-populate this Frame3D with a set of Meshes, for convenience.
focus_pointoptional 3D focus point for this frame (with optional 3D rotation for orientation lock), used in the ScenePic user interface.
cameraoptional camera for the frame
Template Parameters
MeshTypea type with a mesh_id method.
Returns
a new Frame3D object

◆ focus_point() [1/2]

const FocusPoint & scenepic::Canvas3D::focus_point ( ) const

The default focus point for the canvas.

◆ focus_point() [2/2]

Canvas3D & scenepic::Canvas3D::focus_point ( const FocusPoint value)

The default focus point for the canvas.

◆ height()

double scenepic::Canvas3D::height ( ) const

The width of the canvas.

◆ media_id() [1/2]

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.

◆ media_id() [2/2]

Canvas3D & scenepic::Canvas3D::media_id ( const std::string &  audio_id)

◆ set_layer_settings()

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.

◆ shading() [1/2]

const Shading & scenepic::Canvas3D::shading ( ) const

Set of Shading parameters for the Canvas.

◆ shading() [2/2]

Canvas3D & scenepic::Canvas3D::shading ( const Shading value)

Set of Shading parameters for the Canvas.

◆ to_json()

JsonValue scenepic::Canvas3D::to_json ( ) const

Convert this object into ScenePic json.

Returns
a json value

◆ to_string()

std::string scenepic::Canvas3D::to_string ( ) const

Return a JSON string representing the object.

◆ ui_parameters() [1/2]

const UIParameters & scenepic::Canvas3D::ui_parameters ( ) const

Set of user interface parameters.

◆ ui_parameters() [2/2]

Canvas3D & scenepic::Canvas3D::ui_parameters ( const UIParameters value)

Set of user interface parameters.

◆ width()

double scenepic::Canvas3D::width ( ) const

The width of the canvas.

Friends And Related Function Documentation

◆ Scene

friend class Scene
friend

The documentation for this class was generated from the following file: