GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
gpu_coverage::Scene Class Reference

Scene graph corresponding to Assimp's aiScene. More...

#include <Scene.h>

Public Types

typedef std::vector< CameraPerspective * > Cameras
 Vector of cameras of the sceene.
 
typedef std::vector< Light * > Lights
 Vector of light sources of the scene.
 
typedef std::vector< Material * > Materials
 Vector of materials of the scene.
 
typedef std::vector< Mesh * > Meshes
 Vector of meshes of the scene.
 
typedef std::vector< Image * > Textures
 Vector of mesh textures of the scene.
 
typedef std::vector< Animation * > Animations
 Vector of animations of the scene.
 
typedef std::vector< CameraPanorama * > PanoramaCameras
 Vector of panorama cameras of the scene.
 
typedef std::map< std::string, Node * > NodeMap
 Map mapping node names to node pointers.
 
typedef std::vector< Channel * > Channels
 Vector of animation channels of the scene.
 

Public Member Functions

 Scene (const aiScene *const aiScene, const std::string &dir)
 Constructor. More...
 
virtual ~Scene ()
 Destructor.
 
void render (const AbstractCamera *const camera, const LocationsMVP *const locationsMVP, const LocationsLight *const locationsLight=NULL, const LocationsMaterial *const locationsMaterial=NULL, const bool hasTesselationShader=false) const
 Render the scene with the current shader. More...
 
NodefindNode (const std::string &name) const
 Finds a node by name, returns NULL if not found. More...
 
MaterialfindMaterial (const std::string &name) const
 Finds a material by name, returns NULL if not found. More...
 
CameraPerspectivefindCamera (const std::string &name) const
 Finds a camera by name, returns NULL if not found. More...
 
CameraPanoramamakePanoramaCamera (Node *const camera)
 Adds a new panorama camera to the scene and returns a pointer. More...
 
const size_t & getNumFrames () const
 Returns the number of animation frames. More...
 
const size_t & getStartFrame () const
 Returns the start frame of the animation. More...
 
const size_t & getEndFrame () const
 Returns the last frame of the animation. More...
 
const ChannelsgetChannels () const
 
NodegetRoot () const
 Get the root node of the scene graph. More...
 
void toDot (const char *dotFilePath) const
 Write the scene graph structure as a GraphViz Dot file for debugging. More...
 

Public Attributes

NodeMap nodeMap
 Map mapping node names to node pointers.
 
Meshes meshes
 Vector of meshes of the scene.
 
Cameras cameras
 Vector of cameras of the sceene.
 
PanoramaCameras panoramaCameras
 Vector of panorama cameras of the scene.
 
Lights lights
 Vector of light sources of the scene.
 
Textures textures
 Vector of mesh textures of the scene.
 
Materials materials
 Vector of materials of the scene.
 
Animations animations
 Vector of animations of the scene.
 
Channels channels
 Vector of animation channels of the scene.
 
Noderoot
 Root node of the scene graph.
 
gpu_coverage::NodelampNode
 Scene graph node where the first light source is attached.
 

Protected Member Functions

void collectNodes (Node *node)
 

Protected Attributes

size_t numFrames
 Number of animation frames, see getNumFrames().
 
size_t startFrame
 First animation frame, see getStartFrame().
 
size_t endFrame
 Last animation frame, see getEndFrame().
 

Detailed Description

Scene graph corresponding to Assimp's aiScene.

Limitations: Currently only one light source is supported for rendering the visual representation of the 3D scene.

Constructor & Destructor Documentation

gpu_coverage::Scene::Scene ( const aiScene *const  aiScene,
const std::string &  dir 
)

Constructor.

Parameters
aiScene[in]Assimp scene structure.
dir[in]Filesystem directory from where to load materials.

Member Function Documentation

CameraPerspective* gpu_coverage::Scene::findCamera ( const std::string &  name) const

Finds a camera by name, returns NULL if not found.

Parameters
nameName of the camera.
Returns
Pointer to the camera of NULL if not found.
Material* gpu_coverage::Scene::findMaterial ( const std::string &  name) const

Finds a material by name, returns NULL if not found.

Parameters
nameName of the material.
Returns
Pointer to the material of NULL if not found.
Node* gpu_coverage::Scene::findNode ( const std::string &  name) const

Finds a node by name, returns NULL if not found.

Parameters
nameName of the node.
Returns
Pointer to the node of NULL if not found.
const Channels& gpu_coverage::Scene::getChannels ( ) const
inline

Returns the animation channels.

Returns
Animation channels.
const size_t& gpu_coverage::Scene::getEndFrame ( ) const
inline

Returns the last frame of the animation.

Returns
End frame.
const size_t& gpu_coverage::Scene::getNumFrames ( ) const
inline

Returns the number of animation frames.

Returns
Number of animation frames.
Node* gpu_coverage::Scene::getRoot ( ) const
inline

Get the root node of the scene graph.

Returns
Root node.
const size_t& gpu_coverage::Scene::getStartFrame ( ) const
inline

Returns the start frame of the animation.

Returns
Start frame.
CameraPanorama* gpu_coverage::Scene::makePanoramaCamera ( Node *const  camera)

Adds a new panorama camera to the scene and returns a pointer.

Parameters
cameraScene graph node where to attach the new camera.
Returns
Pointer to the new camera.
void gpu_coverage::Scene::render ( const AbstractCamera *const  camera,
const LocationsMVP *const  locationsMVP,
const LocationsLight *const  locationsLight = NULL,
const LocationsMaterial *const  locationsMaterial = NULL,
const bool  hasTesselationShader = false 
) const

Render the scene with the current shader.

Parameters
[in]cameraCamera rendering the scene.
[in]locationsMVPLocations of the model, view, and projection shader variables, must not be NULL.
[in]locationsLightLocation of the light source shader variables, ignored if NULL.
[in]locationsMaterialLocation of the material shader variables, ignored if NULL.
[in]hasTesselationShaderSet to true if a tesselation shader is present.
Exceptions
std::invalid_argumentlocationsMVP is NULL.
void gpu_coverage::Scene::toDot ( const char *  dotFilePath) const

Write the scene graph structure as a GraphViz Dot file for debugging.

Parameters
dotFilePathFile path for the output Dot file.

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