Helios++
Helios software for LiDAR simulations
SerialSceneWrapper Class Reference

Wrapper for scenes which assists read and write serialization operations depending on the type of scene (Scene, StaticScene, DynScene) More...

#include <SerialSceneWrapper.h>

Inheritance diagram for SerialSceneWrapper:
Collaboration diagram for SerialSceneWrapper:

Public Types

enum  SceneType { SCENE , STATIC_SCENE , DYNAMIC_SCENE }
 Types of scene that can be handled by the SerialSceneWrapper.
 

Public Member Functions

 SerialSceneWrapper ()
 Default constructor for serial scene wrapper.
 
 SerialSceneWrapper (SceneType sceneType, Scene *scene)
 
void writeScene (std::string const &path)
 Serialize the scene writing it to given output file. More...
 
SceneType getSceneType () const
 Obtain the type of scene being wrapped. More...
 
void setSceneType (SceneType const &sceneType)
 Set the type of scene being wrapped. More...
 
ScenegetScene () const
 Obtain the scene being wrapped. More...
 
void setScene (Scene *scene)
 Set the scene being wrapped. More...
 
StaticScenegetStaticScene () const
 Obtain the scene being wrapped as a StaticScene. More...
 
DynScenegetDynScene () const
 Obtain the scene being wrapped as a DynScene. More...
 
- Public Member Functions inherited from Asset
std::string getLocationString ()
 Obtain asset location string. More...
 
virtual bool isEgg () const
 Check whether the asset is an EggAsset or not. More...
 

Static Public Member Functions

static SerialSceneWrapperreadScene (std::string const &path)
 Read serialized scene from given file, automatically handling the scene type to be read.
 

Protected Attributes

SceneType sceneType
 Type of the scene being wrapped.
 
Scenescene
 Pointer to the scene being wrapped.
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 Serialize a SerialSceneWrapper to a stream of bytes. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Attributes inherited from Asset
std::string id = ""
 Asset identifier.
 
std::string name = "Unnamed Asset"
 Asset name.
 
std::string sourceFilePath = ""
 Path to asset file.
 

Detailed Description

Wrapper for scenes which assists read and write serialization operations depending on the type of scene (Scene, StaticScene, DynScene)

Author
Alberto M. Esmoris Pena
Version
1.0
See also
Scene
StaticScene
DynScene

Member Function Documentation

◆ getDynScene()

DynScene* SerialSceneWrapper::getDynScene ( ) const
inline

Obtain the scene being wrapped as a DynScene.

Returns
Scene being wrapped as a DynScene
See also
DynScene
SerialSceneWrapper::scene
SerialSceneWrapper::getScene

◆ getScene()

Scene* SerialSceneWrapper::getScene ( ) const
inline

◆ getSceneType()

SceneType SerialSceneWrapper::getSceneType ( ) const
inline

Obtain the type of scene being wrapped.

Returns
Type of scene being wrapped
See also
SerialSceneWrapper::sceneType
SerialSceneWrapper::setSceneType

◆ getStaticScene()

StaticScene* SerialSceneWrapper::getStaticScene ( ) const
inline

Obtain the scene being wrapped as a StaticScene.

Returns
Scene being wrapped as a StaticScene
See also
StaticScene
SerialSceneWrapper::scene
SerialSceneWrapper::getScene

◆ serialize()

template<class Archive >
void SerialSceneWrapper::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

Serialize a SerialSceneWrapper to a stream of bytes.

Template Parameters
ArchiveType of rendering
Parameters
arSpecific rendering for the stream of bytes
versionVersion number for the SerialSceneWrapper

◆ setScene()

void SerialSceneWrapper::setScene ( Scene scene)
inline

Set the scene being wrapped.

Parameters
sceneNew scene to be wrapped
See also
SerialSceneWrapper::scene
SerialSceneWrapper::getScene

◆ setSceneType()

void SerialSceneWrapper::setSceneType ( SceneType const &  sceneType)
inline

Set the type of scene being wrapped.

Parameters
sceneTypeType of scene to be wrapped
See also
SerialSceneWrapper::sceneType
SerialSceneWrapper::getSceneType

◆ writeScene()

void SerialSceneWrapper::writeScene ( std::string const &  path)

Serialize the scene writing it to given output file.

Parameters
pathPath to output file where serialized scene shall be stored.

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