Helios++
Helios software for LiDAR simulations
|
Class representing a scene asset. More...
#include <Scene.h>
Public Member Functions | |
Scene ()=default | |
Scene default constructor. | |
Scene (Scene &s) | |
bool | finalizeLoading () |
Handle scene loading finish process. More... | |
std::shared_ptr< AABB > | getAABB () |
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< RaySceneIntersection > | getIntersection (glm::dvec3 &rayOrigin, glm::dvec3 &rayDir, bool groundOnly) |
Obtain the intersection between the ray and the scene, if any. More... | |
std::map< double, Primitive * > | getIntersections (glm::dvec3 &rayOrigin, glm::dvec3 &rayDir, bool 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... | |
void | writeObject (std::string path) |
Serialize the scene and write it to given output file. More... | |
![]() | |
std::string | getLocationString () |
Obtain asset location string. More... | |
Static Public Member Functions | |
static Scene * | readObject (std::string path) |
Read serialized scene from given file. More... | |
Public Attributes | |
std::vector< Primitive * > | primitives |
Vector of primitives composing the scene. | |
![]() | |
std::string | id = "" |
Asset identifier. | |
std::string | name = "Unnamed Asset" |
Asset name. | |
std::string | sourceFilePath = "" |
Path to asset file. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
std::shared_ptr< KDTreeNodeRoot > | kdtree |
KDTree splitting scene points/vertices to speed-up intersection computations. | |
std::shared_ptr< AABB > | bbox |
Axis aligned bounding box defining scene boundaries. | |
std::shared_ptr< AABB > | bbox_crs |
Original axis aligned bounding box defining scene boundaries before centering it. | |
Friends | |
class | boost::serialization::access |
Class representing a scene asset.
bool Scene::finalizeLoading | ( | ) |
Handle scene loading finish process.
Computations such as primitives update and centering the scene (all its vertices) so the axis aligned bounding box defining its boundaries start at (0, 0, 0) and also KDTree building are performed here
shared_ptr< AABB > Scene::getAABB | ( | ) |
Obtain the axis aligned bounding box defining scene boundaries.
dvec3 Scene::getGroundPointAt | ( | glm::dvec3 | point | ) |
Obtain the ground point at specified XY coordinates.
point | Point definint the XY coordinates for which the ground point shall be obtained |
shared_ptr< RaySceneIntersection > Scene::getIntersection | ( | glm::dvec3 & | rayOrigin, |
glm::dvec3 & | rayDir, | ||
bool | groundOnly | ||
) |
Obtain the intersection between the ray and the scene, if any.
rayOrigin | Ray origin 3D coordinates |
rayDir | Ray 3D director vector |
groundOnly | Flag to specify if only ground points must be considered (true) or not (false) |
map< double, Primitive * > Scene::getIntersections | ( | glm::dvec3 & | rayOrigin, |
glm::dvec3 & | rayDir, | ||
bool | groundOnly | ||
) |
Obtain all intersections between the ray and the scene, if any.
rayOrigin | Ray origin 3D coordinates |
rayDir | Ray 3D director vector |
groundOnly | Flag to specify if only ground points must be considered (true) or not (false) |
dvec3 Scene::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.
|
static |
Read serialized scene from given file.
path | Path to file where a serialized scene is stored |
void Scene::writeObject | ( | std::string | path | ) |
Serialize the scene and write it to given output file.
path | Path to output file where serialized scene shall be stored |