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

Represents a frame of an animation which contains a number of transformed Mesh objects. More...

#include <frame3d.h>

Public Member Functions

void add_meshes_by_id (const std::vector< std::string > &mesh_ids, const Transform &transform=Transform::Identity())
 Add meshes to the frame. More...
 
template<typename MeshType >
void add_meshes (const std::vector< std::shared_ptr< MeshType > > &meshes, const Transform &transform=Transform::Identity())
 Add meshes to the frame. More...
 
void add_mesh_by_id (const std::string &mesh_id, const Transform &transform=Transform::Identity())
 Add a mesh to the frame. More...
 
template<typename MeshType >
void add_mesh (const std::shared_ptr< MeshType > &mesh, const Transform &transform=Transform::Identity())
 Add a mesh to the frame. More...
 
void add_label (const std::shared_ptr< Label > &label, const Vector &position)
 Add a label to the frame. More...
 
void set_layer_settings (const std::map< std::string, LayerSettings > layer_settings)
 Specify the visibilities and opacities of certain mesh layers. More...
 
const Cameracamera () const
 The default camera parameters for this frame. More...
 
Frame3Dcamera (const Camera &camera)
 Set the default camera parameters for this frame. More...
 
const FocusPointfocus_point () const
 The focus point of the frame. More...
 
Frame3Dfocus_point (const FocusPoint &focus_point)
 Set the focus point of the frame. 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...
 

Friends

class Canvas3D
 

Detailed Description

Represents a frame of an animation which contains a number of transformed Mesh objects.

Member Function Documentation

◆ add_label()

void scenepic::Frame3D::add_label ( const std::shared_ptr< Label > &  label,
const Vector &  position 
)

Add a label to the frame.

Parameters
labelthe label to add
positionthe position at which to put the label

◆ add_mesh()

template<typename MeshType >
void scenepic::Frame3D::add_mesh ( const std::shared_ptr< MeshType > &  mesh,
const Transform &  transform = Transform::Identity() 
)
inline

Add a mesh to the frame.

Parameters
meshthe mesh to add
transforman optional transform applied to the mesh
Template Parameters
MeshTypea type with a mesh_id method.

◆ add_mesh_by_id()

void scenepic::Frame3D::add_mesh_by_id ( const std::string &  mesh_id,
const Transform &  transform = Transform::Identity() 
)

Add a mesh to the frame.

Parameters
mesh_idthe id of the mesh to add
transforman optional transform applied to the mesh

◆ add_meshes()

template<typename MeshType >
void scenepic::Frame3D::add_meshes ( const std::vector< std::shared_ptr< MeshType > > &  meshes,
const Transform &  transform = Transform::Identity() 
)
inline

Add meshes to the frame.

Parameters
meshesthe meshes to add
transforman optional transform applied to all the meshes
Template Parameters
MeshTypea type with a mesh_id method.

◆ add_meshes_by_id()

void scenepic::Frame3D::add_meshes_by_id ( const std::vector< std::string > &  mesh_ids,
const Transform &  transform = Transform::Identity() 
)

Add meshes to the frame.

Parameters
mesh_idsthe ids of the meshes to add
transforman optional transform applied to all the meshes

◆ camera() [1/2]

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

The default camera parameters for this frame.

◆ camera() [2/2]

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

Set the default camera parameters for this frame.

Parameters
camerathe camera parameters

◆ focus_point() [1/2]

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

The focus point of the frame.

◆ focus_point() [2/2]

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

Set the focus point of the frame.

◆ set_layer_settings()

void scenepic::Frame3D::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.

◆ to_json()

JsonValue scenepic::Frame3D::to_json ( ) const

Convert this object into ScenePic json.

Returns
a json value

◆ to_string()

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

Return a JSON string representing the object.

Friends And Related Function Documentation

◆ Canvas3D

friend class Canvas3D
friend

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