|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CScene Class ReferenceA CScene, which own a list of Render Traversals, and a render() method.
More...
#include <scene.h>
Inheritance diagram for NL3D::CScene
[legend]Collaboration diagram for NL3D::CScene:
[legend]List of all members.
Shape/Instances. |
typedef std::multimap<std::string,
CTransformShape**> | TWaitingInstancesMMap |
CShapeBank* | _ShapeBank |
TWaitingInstancesMMap | _WaitingInstances |
Public Methods |
|
| CScene () |
| Constructor. More...
|
| ~CScene () |
| Destructor. release(). More...
|
void | initDefaultTravs () |
| Create / register the 5 basic traversals:CHrcTrav, CClipTrav, CLightTrav, CAnimDetailTrav, CRenderTravInit. More...
|
void | initDefaultRoots () |
| Create/setRoot the defaults models roots: a CTransform and a CLightGroup. More...
|
void | setDriver (IDriver *drv) |
| Set the driver to render Traversal. More...
|
IDriver* | getDriver () const |
| Get the driver of render Traversal. More...
|
void | addTrav (ITrav *v) |
| Add a ITrav or a ITravScene to the scene. More...
|
void | release () |
| Release all relative to the scene (Models, traversals...)... Destroy the Basic traversals too. More...
|
|
void | render (bool doHrcPass=true) |
| Render the scene, via the registered ITravScene, from the CurrentCamera view. More...
|
|
void | setCam (CCamera *cam) |
| Set/Get the current camera/Viewport. More...
|
CCamera* | getCam () |
void | setViewport (const class CViewport& viewport) |
CViewport | getViewport () |
|
void | setShapeBank (CShapeBank*pShapeBank) |
| Set the shape bank. More...
|
virtual CTransformShape* | createInstance (const std::string &shapeName) |
| Create a model, instance of the shape "shapename". More...
|
void | createInstanceAsync (const std::string &shapeName, CTransformShape **pInstance) |
| Create an instance, if the shape is not present, load the shape asynchronously. More...
|
void | deleteInstance (CTransformShape*model) |
| Delete an instance via his pointer. More...
|
Static Public Methods |
|
void | registerBasics () |
| Register Basic models and observers. More...
|
Private Types |
typedef std::map<sint, ITravScene*> | TTravMap |
Private Attributes |
TTravMap | RenderTraversals |
CRefPtr<CCamera> | CurrentCamera |
| The camera / Viewport. More...
|
CViewport | _Viewport |
CTransform* | Root |
|
CHrcTrav* | HrcTrav |
CClipTrav* | ClipTrav |
CLightTrav* | LightTrav |
CAnimDetailTrav* | AnimDetailTrav |
CRenderTrav* | RenderTrav |
Detailed Description
A CScene, which own a list of Render Traversals, and a render() method.
USER RULES:
- Before creating any CScene, call the cool method CScene::registerBasics(), to register baisc models and observers.
- Create a CScene (NB: may be static
CScene scene;) . - call first initDefaultRoot() to create / register automatically the 5 basic traversals:
- add others user-specified traversals with addTrav().
- initRootModels() to create/setRoot the defaults models roots for the basic traversals:
- set your driver for this scene with setDriver().
- create any other model with createModel() (such as a camera).
- Specify a Camera (SmartPtr-ed !!)
- render().
CScene own those Traversals and those Root and kill them at ~CScene().
Coordinate System: right hand cordinates with: X to the right, Y to the far, Z to the top.
Z ^ | > Y | / | / |/ -------> X
Shape System:\n The scene has an instance Managagement:
- IShape design the object that is instancied (a mesh as example).
- ITransformShape is the instance, which smart_point to a IShape.
- user can add shape manually in the scene CShapeBank with CShapeBank::add() (), or remove them with CShapeBank::release() ().
- user create instance of a shape with CScene::createInstance(string shapeName); This create/load auto the shape if needed (searching in CPath, shapename must be a valid file name), and then create the instance, with help of IShape::createInstance().
-
Author(s):
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 109 of file scene.h.
Member Typedef Documentation
typedef std::multimap<std::string,CTransformShape**> NL3D::CScene::TWaitingInstancesMMap [private]
|
|
Constructor & Destructor Documentation
NL3D::CScene::~CScene (
|
)
|
|
Member Function Documentation
void NL3D::CScene::addTrav (
|
ITrav * v )
|
|
|
Add a ITrav or a ITravScene to the scene.
If not a ITravScene (tested with help of dynamic_cast) or if trav->getRenderOrder()==0, The traversal is not added to the "render traversal list", else it is. Such a traversal will be traverse() -ed in the order given. The getRenderOrder() is called only in the addTrav() method (so this is a static information).
Reimplemented from NL3D::CMOT.
Definition at line 161 of file scene.cpp. |
CTransformShape * NL3D::CScene::createInstance (
|
const std::string & shapeName ) [virtual]
|
|
|
Create a model, instance of the shape "shapename".
If not present, try to load "shapename" via the CPath. If fails, return NULL.
Definition at line 273 of file scene.cpp. |
void NL3D::CScene::createInstanceAsync (
|
const std::string & shapeName,
|
|
CTransformShape ** pInstance )
|
|
|
Create an instance, if the shape is not present, load the shape asynchronously.
The instance is really created when we process it in the rendering.
Definition at line 295 of file scene.cpp. |
|
Delete an instance via his pointer.
An instance is an entity which reference a shape.
Definition at line 313 of file scene.cpp. |
CCamera * NL3D::CScene::getCam (
|
) [inline]
|
|
IDriver * NL3D::CScene::getDriver (
|
) const
|
|
|
Get the driver of render Traversal.
Definition at line 249 of file scene.cpp. |
CViewport NL3D::CScene::getViewport (
|
) [inline]
|
|
void NL3D::CScene::initDefaultRoots (
|
)
|
|
|
Create/setRoot the defaults models roots: a CTransform and a CLightGroup.
Definition at line 149 of file scene.cpp. |
void NL3D::CScene::initDefaultTravs (
|
)
|
|
void NL3D::CScene::registerBasics (
|
) [static]
|
|
|
Register Basic models and observers.
Definition at line 54 of file scene.cpp. |
void NL3D::CScene::release (
|
void )
|
|
|
Release all relative to the scene (Models, traversals...)... Destroy the Basic traversals too.
Reimplemented from NL3D::CMOT.
Definition at line 84 of file scene.cpp. |
void NL3D::CScene::render (
|
bool doHrcPass = true )
|
|
|
Render the scene, via the registered ITravScene, from the CurrentCamera view.
NB: no Driver clear buffers (color or ZBuffer) are done.... This call t->traverse() function to registered render traversal following their order given. -
Parameters:
-
doHrcPass
|
set it to false to indicate that the CHrcTrav have not to be traversed. UseFull to optimize if you know that NONE of your models have moved (a good example is a shoot of the scene from different cameras). |
Definition at line 179 of file scene.cpp. |
void NL3D::CScene::setCam (
|
CCamera * cam ) [inline]
|
|
|
Set/Get the current camera/Viewport.
Definition at line 161 of file scene.h. |
void NL3D::CScene::setDriver (
|
IDriver * drv )
|
|
|
Set the driver to render Traversal.
Definition at line 242 of file scene.cpp. |
void NL3D::CScene::setShapeBank (
|
CShapeBank * pShapeBank )
|
|
|
Set the shape bank.
Definition at line 266 of file scene.cpp. |
void NL3D::CScene::setViewport (
|
const class CViewport & viewport ) [inline]
|
|
Member Data Documentation
CRefPtr< CCamera > NL3D::CScene::CurrentCamera [private]
|
|
|
The camera / Viewport.
Definition at line 199 of file scene.h. |
CHrcTrav * NL3D::CScene::HrcTrav [private]
|
|
TTravMap NL3D::CScene::RenderTraversals [private]
|
|
The documentation for this class was generated from the following files:
|
|