4#ifndef _SCENEPIC_CANVAS3D_H_
5#define _SCENEPIC_CANVAS3D_H_
41 const std::string& frame_id =
"",
43 const std::vector<std::string>& mesh_ids = std::vector<std::string>(),
59 template<
typename MeshType>
61 const std::vector<std::shared_ptr<MeshType>>& meshes,
62 const std::string& frame_id =
"",
66 std::vector<std::string> mesh_ids;
70 std::back_inserter(mesh_ids),
71 [](
const std::shared_ptr<MeshType>& mesh) { mesh->mesh_id(); });
89 const std::map<std::string, LayerSettings> layer_settings);
166 std::string m_canvas_id;
171 std::map<std::string, LayerSettings> m_layer_settings;
172 std::vector<std::shared_ptr<Frame3D>> m_frames;
173 std::string m_media_id;
179 std::size_t m_num_frames;
A camera type.
Definition: camera.h:15
static Camera None()
A value indicating "no camera".
Represents a ScenePic Canvas3D - a 3D viewport that can contain a number of Frame3Ds.
Definition: canvas3d.h:26
const std::string & canvas_id() const
A unique identifier for the canvas.
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.
Canvas3D & media_id(const std::string &audio_id)
JsonValue to_json() const
Convert this object into ScenePic json.
std::string to_string() const
Return a JSON string representing the object.
double height() const
The width of the canvas.
Canvas3D & ui_parameters(const UIParameters &value)
Set of user interface parameters.
Canvas3D & focus_point(const FocusPoint &value)
The default focus point for the canvas.
Canvas3D & shading(const Shading &value)
Set of Shading parameters for the Canvas.
void clear_script()
Call this if you are dumping a ScenePic script in multiple parts, e.g.
const UIParameters & ui_parameters() const
Set of user interface parameters.
const Shading & shading() const
Set of Shading parameters for the Canvas.
Canvas3D & camera(const Camera &value)
Set of Camera parameters for the Canvas.
const FocusPoint & focus_point() const
The default focus point for the canvas.
double width() const
The width of the canvas.
const Camera & camera() const
Set of Camera parameters for the Canvas.
const std::string & media_id() const
The unique ID of the media file associated with this canvas.
void set_layer_settings(const std::map< std::string, LayerSettings > layer_settings)
Specify the visibilities and opacities of certain mesh layers.
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.
Definition: canvas3d.h:60
3D focus point for this frame (with optional 3D rotation for orientation lock), used in the ScenePic ...
Definition: focus_point.h:16
static FocusPoint None()
A value indicating "no focus point".
Representation of a JSON value according to the specification at https://www.json....
Definition: json_value.h:30
Top level container representing an entire ScenePic.
Definition: scene.h:58
Parameters of the shaders.
Definition: shading.h:15
Per-Canvas3D parameters of the ScenePic user interface.
Definition: ui_parameters.h:15
Definition: audio_track.h:14