Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::SkyboxGenerator Class Reference

The SkyboxGenerator class is a singleton that allows for the creation of a skybox from a level by taking pictures to all 6 sides. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/designtools/SkyboxGenerator.h>

Inheritance diagram for orxonox::SkyboxGenerator:
orxonox::Configurable orxonox::Singleton< SkyboxGenerator > orxonox::Tickable orxonox::Listable orxonox::OrxonoxInterface orxonox::Identifiable orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Identifiable

Public Member Functions

 SkyboxGenerator ()
 Constructor. More...
 
virtual ~SkyboxGenerator ()
 Destructor. More...
 
void setConfigValues (void)
 Sets some config values. More...
 
void setSize (unsigned int size)
 Set the size of the skybox faces to be generated. More...
 
virtual void tick (float dt) override
 This is where the skybox generation happens. More...
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 
- Public Member Functions inherited from orxonox::OrxonoxInterface
 OrxonoxInterface ()
 
- Public Member Functions inherited from orxonox::Destroyable
 Destroyable ()
 Constructor: Sets the default values. More...
 
virtual ~Destroyable ()
 Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More...
 
void destroy ()
 Deletes the object if no strong pointers point to this object. More...
 
void destroyLater ()
 Works like destroy() but doesn't destroy the object until the current tick has ended. More...
 
unsigned int getReferenceCount () const
 Returns the number of strong pointers that point to this object. More...
 

Static Public Member Functions

static void createSkybox (void)
 Generate the 6 faces of a skybox. More...
 
- Static Public Member Functions inherited from orxonox::Singleton< SkyboxGenerator >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static SkyboxGeneratorgetInstance ()
 Returns a reference to the singleton instance. More...
 

Protected Member Functions

void startSkyboxGeneration (void)
 Starts the generation of the skybox. More...
 
- Protected Member Functions inherited from orxonox::Singleton< SkyboxGenerator >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 
- Protected Member Functions inherited from orxonox::Tickable
 Tickable ()
 Constructor: Registers the object in the Tickable-list. More...
 
- Protected Member Functions inherited from orxonox::Destroyable
virtual void preDestroy ()
 This virtual function is called if destroy() is called and no StrongPtr points to this object. More...
 

Private Member Functions

void restoreRenderWindow (Ogre::RenderWindow *renderWindow)
 Restore the render window. More...
 
void saveImage (Ogre::Image *image, const std::string &name) const
 Resizes and saves the input image under the input name. More...
 
void setupCamera (Ogre::Camera *camera)
 Set up the input camera to be ready to generate a skybox face. More...
 
void setupRenderWindow (Ogre::RenderWindow *renderWindow)
 Setup the input render window to be ready to generate the skybox. More...
 

Private Attributes

float aspectRatio_
 The backed up aspect ratio of the camera. More...
 
bool bCaptionsRemoved_
 Whether the overlays have been removed. More...
 
bool bCleanup_
 Whether the generator is being cleaned up. More...
 
bool bCreateFace_
 Whether the faces are being created,. More...
 
bool bGenerateSkybox_
 Whether a skybox is currently being generated. More...
 
bool bSetup_
 Whether the render window is being setup. More...
 
bool bWait_
 Whether we have to wait for the setup to take effect. More...
 
unsigned int faceCounter_
 Counter to keep track of which skybox face is being created. More...
 
Ogre::Radian fovy_
 The backed up field of view of the camera. More...
 
unsigned int gridSize_
 The backed up grid size of the ScreenshotManager. More...
 
std::string imageExtension_
 Extension of the generated image files. More...
 
std::vector< std::string > names_
 The names of the image files for the skybox faces to be generated. More...
 
std::vector< std::pair< int, int > > rotations_
 The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated. More...
 
unsigned int size_
 The desired size of the skybox faces. More...
 
std::string skyboxPrefix_
 Prefix for the generated image files. More...
 
bool windowFullScreen_
 Whether the window was in fullscreen mode. More...
 
unsigned int windowHeight_
 The backed up window height. More...
 
unsigned int windowWidth_
 The backed up window width. More...
 

Static Private Attributes

static SkyboxGeneratorsingletonPtr_s
 Singleton pointer. More...
 

Friends

class Singleton< SkyboxGenerator >
 

Detailed Description

The SkyboxGenerator class is a singleton that allows for the creation of a skybox from a level by taking pictures to all 6 sides.

The 6 images created by the createSkybox() method are placed in the log folder in your build directory.

The image filename prefix and the file extension can both be adjusted as config values, so can the desired size of the skybox faces.

Author
Gion-Andri Cantieni
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::SkyboxGenerator::SkyboxGenerator ( )

Constructor.

Registers and initializes the singleton.

orxonox::SkyboxGenerator::~SkyboxGenerator ( )
virtual

Destructor.

Member Function Documentation

void orxonox::SkyboxGenerator::createSkybox ( void  )
static

Generate the 6 faces of a skybox.

void orxonox::SkyboxGenerator::restoreRenderWindow ( Ogre::RenderWindow *  renderWindow)
private

Restore the render window.

Reset the window size, reset the grid size of the ScreenshotManager.

Parameters
renderWindowThe render window to be restored.
void orxonox::SkyboxGenerator::saveImage ( Ogre::Image *  image,
const std::string &  name 
) const
private

Resizes and saves the input image under the input name.

Parameters
imageA pointer to the image to be saved. The image is deleted afterwards,
nameThe desired filename of the image.
void orxonox::SkyboxGenerator::setConfigValues ( void  )

Sets some config values.

void orxonox::SkyboxGenerator::setSize ( unsigned int  size)
inline

Set the size of the skybox faces to be generated.

Parameters
sizeThe size in pixels.
void orxonox::SkyboxGenerator::setupCamera ( Ogre::Camera *  camera)
private

Set up the input camera to be ready to generate a skybox face.

Parameters
cameraThe camera to be set up.
void orxonox::SkyboxGenerator::setupRenderWindow ( Ogre::RenderWindow *  renderWindow)
private

Setup the input render window to be ready to generate the skybox.

Parameters
renderWindowThe render window to be set up.
void orxonox::SkyboxGenerator::startSkyboxGeneration ( void  )
inlineprotected

Starts the generation of the skybox.

void orxonox::SkyboxGenerator::tick ( float  dt)
overridevirtual

This is where the skybox generation happens.

Generating a skybox takes several (up to 10) ticks.

Reimplemented from orxonox::Tickable.

Friends And Related Function Documentation

friend class Singleton< SkyboxGenerator >
friend

Member Data Documentation

float orxonox::SkyboxGenerator::aspectRatio_
private

The backed up aspect ratio of the camera.

bool orxonox::SkyboxGenerator::bCaptionsRemoved_
private

Whether the overlays have been removed.

bool orxonox::SkyboxGenerator::bCleanup_
private

Whether the generator is being cleaned up.

bool orxonox::SkyboxGenerator::bCreateFace_
private

Whether the faces are being created,.

bool orxonox::SkyboxGenerator::bGenerateSkybox_
private

Whether a skybox is currently being generated.

bool orxonox::SkyboxGenerator::bSetup_
private

Whether the render window is being setup.

bool orxonox::SkyboxGenerator::bWait_
private

Whether we have to wait for the setup to take effect.

unsigned int orxonox::SkyboxGenerator::faceCounter_
private

Counter to keep track of which skybox face is being created.

Ogre::Radian orxonox::SkyboxGenerator::fovy_
private

The backed up field of view of the camera.

unsigned int orxonox::SkyboxGenerator::gridSize_
private

The backed up grid size of the ScreenshotManager.

std::string orxonox::SkyboxGenerator::imageExtension_
private

Extension of the generated image files.

std::vector<std::string> orxonox::SkyboxGenerator::names_
private

The names of the image files for the skybox faces to be generated.

std::vector< std::pair<int, int> > orxonox::SkyboxGenerator::rotations_
private

The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated.

SkyboxGenerator* orxonox::SkyboxGenerator::singletonPtr_s
staticprivate

Singleton pointer.

unsigned int orxonox::SkyboxGenerator::size_
private

The desired size of the skybox faces.

std::string orxonox::SkyboxGenerator::skyboxPrefix_
private

Prefix for the generated image files.

bool orxonox::SkyboxGenerator::windowFullScreen_
private

Whether the window was in fullscreen mode.

unsigned int orxonox::SkyboxGenerator::windowHeight_
private

The backed up window height.

unsigned int orxonox::SkyboxGenerator::windowWidth_
private

The backed up window width.


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