OGRE: Ogre::MovableObjectFactory Class Reference - OGRE Documentation

Public Member Functions | Protected Member Functions | Protected Attributes

# Ogre::MovableObjectFactory Class Reference
[Scene]

Interface definition for a factory class which produces a certain kind of MovableObject, and can be registered with Root in order to allow all clients to produce new instances of this object, integrated with the standard Ogre processing. More...

`#include <OgreMovableObject.h>`

Inheritance diagram for Ogre::MovableObjectFactory:
[legend]

List of all members.

## Public Member Functions
| MovableObjectFactory ()
virtual | ~MovableObjectFactory ()
virtual const String & | getType (void) const =0
| Get the type of the object to be created.
virtual MovableObject * | createInstance (const String &name, SceneManager *manager, const NameValuePairList *params=0)
| Create a new instance of the object.
virtual void | destroyInstance (MovableObject *obj)=0
| Destroy an instance of the object.
virtual bool | requestTypeFlags (void) const
| Does this factory require the allocation of a 'type flag', used to selectively include / exclude this type from scene queries?
void | _notifyTypeFlags (unsigned long flag)
| Notify this factory of the type mask to apply.
unsigned long | getTypeFlags (void) const
| Gets the type flag for this factory.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
## Protected Member Functions
virtual MovableObject * | createInstanceImpl (const String &name, const NameValuePairList *params=0)=0
| Internal implementation of create method - must be overridden.
## Protected Attributes
unsigned long | mTypeFlag
| Type flag, allocated if requested.

## Detailed Description

Interface definition for a factory class which produces a certain kind of MovableObject, and can be registered with Root in order to allow all clients to produce new instances of this object, integrated with the standard Ogre processing.

Definition at line 559 of file OgreMovableObject.h.

## Constructor & Destructor Documentation

Ogre::MovableObjectFactory::MovableObjectFactory | ( |  | ) |

Definition at line 569 of file OgreMovableObject.h.

virtual Ogre::MovableObjectFactory::~MovableObjectFactory | ( |  | ) | `[virtual]`

Definition at line 570 of file OgreMovableObject.h.

## Member Function Documentation

void Ogre::MovableObjectFactory::_notifyTypeFlags | ( | unsigned long | flag | ) |

Notify this factory of the type mask to apply.

Remarks:
  This should normally only be called by Root in response to a 'true' result from requestTypeMask. However, you can actually use it yourself if you're careful; for example to assign the same mask to a number of different types of object, should you always wish them to be treated the same in queries.

Definition at line 609 of file OgreMovableObject.h.

virtual MovableObject* Ogre::MovableObjectFactory::createInstance | ( | const String & | name,
|  | SceneManager * | manager,
|  | const NameValuePairList * | params = `0` |
| ) |  |  | `[virtual]`

Create a new instance of the object.

Parameters:

  | name | The name of the new object
  | manager | The SceneManager instance that will be holding the instance once created.
  | params | Name/value pair list of additional parameters required to construct the object (defined per subtype). Optional.

virtual MovableObject* Ogre::MovableObjectFactory::createInstanceImpl | ( | const String & | name,
|  | const NameValuePairList * | params = `0` |
| ) |  |  | `[protected, pure virtual]`

Internal implementation of create method - must be overridden.

Implemented in Ogre::BillboardChainFactory, Ogre::BillboardSetFactory, Ogre::EntityFactory, Ogre::LightFactory, Ogre::ManualObjectFactory, Ogre::ParticleSystemFactory, and Ogre::RibbonTrailFactory.

virtual void Ogre::MovableObjectFactory::destroyInstance | ( | MovableObject * | obj | ) | `[pure virtual]`

Destroy an instance of the object.

Implemented in Ogre::BillboardChainFactory, Ogre::BillboardSetFactory, Ogre::EntityFactory, Ogre::LightFactory, Ogre::ManualObjectFactory, Ogre::ParticleSystemFactory, and Ogre::RibbonTrailFactory.

virtual const String& Ogre::MovableObjectFactory::getType | ( | void |  | ) | const`[pure virtual]`

Get the type of the object to be created.

Implemented in Ogre::BillboardChainFactory, Ogre::BillboardSetFactory, Ogre::EntityFactory, Ogre::LightFactory, Ogre::ManualObjectFactory, Ogre::ParticleSystemFactory, and Ogre::RibbonTrailFactory.

unsigned long Ogre::MovableObjectFactory::getTypeFlags | ( | void |  | ) | const

Gets the type flag for this factory.

Remarks:
  A type flag is like a query flag, except that it applies to all instances of a certain type of object.

Definition at line 616 of file OgreMovableObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 72 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 90 of file OgreMemoryAllocatedObject.h.

virtual bool Ogre::MovableObjectFactory::requestTypeFlags | ( | void |  | ) | const`[virtual]`

Does this factory require the allocation of a 'type flag', used to selectively include / exclude this type from scene queries?

Remarks:
  The default implementation here is to return 'false', ie not to request a unique type mask from Root. For objects that never need to be excluded in SceneQuery results, that's fine, since the default implementation of MovableObject::getTypeFlags is to return all ones, hence matching any query type mask. However, if you want the objects created by this factory to be filterable by queries using a broad type, you have to give them a (preferably unique) type mask - and given that you don't know what other MovableObject types are registered, Root will allocate you one.

Definition at line 600 of file OgreMovableObject.h.

## Member Data Documentation

unsigned long Ogre::MovableObjectFactory::mTypeFlag`[protected]`

Type flag, allocated if requested.

Definition at line 563 of file OgreMovableObject.h.

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

- OgreMovableObject.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:24:57