Helios++
Helios software for LiDAR simulations
StaticScene Class Reference

Static scene basic implementation. More...

#include <StaticScene.h>

Inheritance diagram for StaticScene:
Collaboration diagram for StaticScene:

Public Member Functions

 StaticScene ()=default
 Static scene default constructor.
 
 StaticScene (StaticScene &ss)
 Copy constructor for static scene. More...
 
 StaticScene (Scene &s)
 Build a static scene using given scene as basis. More...
 
void appendStaticObject (shared_ptr< ScenePart > obj)
 Append given static object to the scene. More...
 
shared_ptr< ScenePartgetStaticObject (size_t const index)
 Obtain static object at given index. More...
 
void setStaticObject (size_t const index, shared_ptr< ScenePart > obj)
 Set static object at given index. More...
 
void removeStaticObject (size_t const index)
 Remove static object at given index. More...
 
void clearStaticObjects ()
 Remove all static objects from the static scene.
 
size_t numStaticObjects ()
 Obtain the number of static objects in the scene. More...
 
void writeObject (std::string path) override
 Serialize the static scene and write it to given output file. More...
 
- Public Member Functions inherited from Scene
 Scene ()
 Scene default constructor.
 
 Scene (Scene &s)
 
bool finalizeLoading (bool const safe=false)
 Handle scene loading finish process. More...
 
void registerParts ()
 Register all scene parts composing the scene in the parts vector with no repetitions. More...
 
std::shared_ptr< AABBgetAABB ()
 Obtain the axis aligned bounding box defining scene boundaries. More...
 
glm::dvec3 getGroundPointAt (glm::dvec3 point)
 Obtain the ground point at specified XY coordinates. More...
 
std::shared_ptr< RaySceneIntersectiongetIntersection (glm::dvec3 const &rayOrigin, glm::dvec3 const &rayDir, bool const groundOnly) const
 Obtain the intersection between the ray and the scene, if any. More...
 
std::shared_ptr< RaySceneIntersectiongetIntersection (vector< double > const &tMinMax, glm::dvec3 const &rayOrigin, glm::dvec3 const &rayDir, bool const groundOnly) const
 Like Scene::getIntersection(dvec3 const, dvec3 const, bool const) but receiving precomputed minimum and maximum intersection times with respect to the axis aligned bounding box that bounds the scene. More...
 
std::map< double, Primitive * > getIntersections (glm::dvec3 &rayOrigin, glm::dvec3 &rayDir, bool const groundOnly)
 Obtain all intersections between the ray and the scene, if any. More...
 
glm::dvec3 getShift ()
 Obtain the minimum boundaries of the original axis aligned bounding box containing the scene, before it was centered so (0, 0, 0) became its new minimum boundaries. More...
 
glm::dvec3 const & getShiftRef () const
 Like Scene::getShift but returning a const reference instead of a copy. More...
 
std::vector< Vertex * > getAllVertices ()
 Obtain all vertices (without repetitions) composing the scene. More...
 
void doForceOnGround ()
 For each scene part which is flagged as forceOnGround, it will be vertically translated to closest ground scene part. More...
 
glm::dvec3 findForceOnGroundQ (int const searchDepth, glm::dvec3 const minzv, vector< Vertex * > &vertices, vector< double > const &o, vector< double > const &v)
 Assist doForceOnGround function to find an adequate \(q\) for step 4. More...
 
void buildKDGrove (bool const safe=false)
 Build the KDGrove for the scene, overwriting previous one if any. More...
 
void buildKDGroveWithLog (bool const safe=false)
 Call buildKDGrove exporting building information through logging system. More...
 
virtual std::shared_ptr< KDGroveRaycaster > const & getRaycaster () const
 
virtual std::shared_ptr< KDGroveFactorygetKDGroveFactory () const
 Obtain the KDGrove factory used by the scene. More...
 
virtual void setKDGroveFactory (std::shared_ptr< KDGroveFactory > const kdgf)
 Set the KDGrove factory to be used by the scene. More...
 
virtual std::shared_ptr< KDGrovegetKDGrove () const
 Obtain the KDGrove used by the scene. More...
 
virtual void setKDGrove (std::shared_ptr< KDGrove > const kdgrove)
 Set the KDGrove to be used by the scene. More...
 
virtual std::shared_ptr< AABBgetBBox () const
 Obtain the scene's bounding box. More...
 
virtual void setBBox (std::shared_ptr< AABB > const bbox)
 Set the scene's bounding box. More...
 
virtual std::shared_ptr< AABBgetBBoxCRS () const
 Obtain the scene's coordinate reference system bounding box. More...
 
virtual void setBBoxCRS (std::shared_ptr< AABB > const bbox)
 Set the scene's coordinate reference system bounding box. More...
 
virtual bool hasMovingObjects () const
 Checke whether the scene contains at least one moving object (true) or not (false) More...
 
virtual bool doSimStep ()
 Support simulation step handling from scene side. 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 StaticScenereadObject (std::string path)
 Read serialized static scene from given file. More...
 
- Static Public Member Functions inherited from Scene
static ScenereadObject (std::string path)
 Read serialized scene from given file. More...
 

Protected Attributes

vector< shared_ptr< ScenePart > > staticObjs
 Static objects composing the scene.
 
- Protected Attributes inherited from Scene
std::shared_ptr< KDGroveFactorykdgf
 The KDGrove factory used to build the scene KDGrove. More...
 
std::shared_ptr< KDGrovekdgrove
 KDGrove containing a KDTree for each scene part to speed-up ray-primitive intersection check computations.
 
std::shared_ptr< AABBbbox
 Axis aligned bounding box defining scene boundaries.
 
std::shared_ptr< AABBbbox_crs
 Original axis aligned bounding box defining scene boundaries before centering it.
 
std::shared_ptr< KDGroveRaycasterraycaster
 The raycaster based on KDGrove. More...
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Attributes inherited from Scene
std::vector< Primitive * > primitives
 Vector of primitives composing the scene.
 
std::vector< std::shared_ptr< ScenePart > > parts
 Parts composing the scene with no repeats. More...
 
- 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

Static scene basic implementation.

Author
Alberto M. Esmoris Pena
Version
1.0

A static scene is a simple scene which is aware of primitives composing each object in the scene.

See also
DynScene

Constructor & Destructor Documentation

◆ StaticScene() [1/2]

StaticScene::StaticScene ( StaticScene ss)

Copy constructor for static scene.

Parameters
ssStatic scene to be copied

◆ StaticScene() [2/2]

StaticScene::StaticScene ( Scene s)
inline

Build a static scene using given scene as basis.

Parameters
sBasis scene for static scene

Member Function Documentation

◆ appendStaticObject()

void StaticScene::appendStaticObject ( shared_ptr< ScenePart obj)
inline

Append given static object to the scene.

Parameters
objStatic object to be appended to the scene
See also
ScenePart

◆ getStaticObject()

shared_ptr<ScenePart> StaticScene::getStaticObject ( size_t const  index)
inline

Obtain static object at given index.

Parameters
indexIndex of static object to be obtained
Returns
Static object at given index

◆ numStaticObjects()

size_t StaticScene::numStaticObjects ( )
inline

Obtain the number of static objects in the scene.

Returns
Number of static objects in the scene

◆ readObject()

StaticScene * StaticScene::readObject ( std::string  path)
static

Read serialized static scene from given file.

Parameters
pathPath to file where a serialized static scene is stored
Returns
Imported static scene

◆ removeStaticObject()

void StaticScene::removeStaticObject ( size_t const  index)
inline

Remove static object at given index.

Parameters
indexIndex of static object to be removed

◆ serialize()

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

Serialize a StaticScene to a stream of bytes.

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

◆ setStaticObject()

void StaticScene::setStaticObject ( size_t const  index,
shared_ptr< ScenePart obj 
)
inline

Set static object at given index.

Parameters
indexIndex of static object to be setted
objNew static object

◆ writeObject()

void StaticScene::writeObject ( std::string  path)
overridevirtual

Serialize the static scene and write it to given output file.

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

Reimplemented from Scene.


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