# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::IBaseClipObs Class Reference

The base interface for clip traversal. More...

#include <clip_trav.h>

Inheritance diagram for NL3D::IBaseClipObs

Inheritance graph
[legend]
Collaboration diagram for NL3D::IBaseClipObs:

Collaboration graph
[legend]
List of all members.

Public Methods

 IBaseClipObs ()
 Constructor. More...

virtual void init ()
 Build shortcut to HrcObs and RenderObs. More...

virtual bool isRenderable () const = 0
 Should return true if object has to be inserted in RenderTrav list. More...

virtual bool clip (IBaseClipObs *caller) = 0
 Should return true if object is visible (eg in frustum). More...

virtual void traverse (IObs *caller) = 0
 The base doit method. More...


Public Attributes

IBaseHrcObsHrcObs
 Shortcut to observers. More...

IBaseRenderObsRenderObs
bool Visible
 OUT variable (good after traverse()). More...


Detailed Description

The base interface for clip traversal.

Clip observers MUST derive from IBaseClipObs. This observer:

  • leave the notification system to DO NOTHING.
  • implement the init() method, to set shortcut to neighbor observers.
DERIVER RULES:
  • implement the notification system (see IObs and IObs() for details).
  • implement the clip() method.
  • implement the traverse(), which should call clip() and isRenderable(). see CTransform for an implementation.
  • possibly modify/extend the graph methods (such as a graph behavior).
See also:
CClipTrav
Author(s):
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 127 of file clip_trav.h.


Constructor & Destructor Documentation

NL3D::IBaseClipObs::IBaseClipObs ( ) [inline]
 

Constructor.

Definition at line 143 of file clip_trav.h.


Member Function Documentation

bool NL3D::IBaseClipObs::clip ( IBaseClipObs * caller ) [pure virtual]
 

Should return true if object is visible (eg in frustum).

Parameters:
caller   the caller obs (may NULL)

Reimplemented in NL3D::CDefaultClipObs, NL3D::CLandscapeClipObs, NL3D::CTransformClipObs, and NL3D::CTransformShapeClipObs.

void NL3D::IBaseClipObs::init ( ) [virtual]
 

Build shortcut to HrcObs and RenderObs.

Reimplemented from NL3D::IObs.

Definition at line 108 of file clip_trav.cpp.

bool NL3D::IBaseClipObs::isRenderable ( ) const [pure virtual]
 

Should return true if object has to be inserted in RenderTrav list.

eg: a mesh must be inserted in a render list, but not a light, or a NULL transform.

Reimplemented in NL3D::CDefaultClipObs, NL3D::CLandscapeClipObs, NL3D::CTransformClipObs, and NL3D::CTransformShapeClipObs.

void NL3D::IBaseClipObs::traverse ( IObs * caller ) [pure virtual]
 

The base doit method.

The default behavior should be:

  • test if HrcObs->WorldVis is visible.
  • test if the observer is clipped with clip()
  • if visible and not clipped, set Visible=true (else false).
  • if Visible==true, and renderable, add it to the RenderTraversal: RenderTrav->addRenderObs(RenderObs);
  • always traverseSons(), to clip the sons.

Reimplemented from NL3D::IObs.

Reimplemented in NL3D::CDefaultClipObs, and NL3D::CTransformClipObs.


Member Data Documentation

IBaseHrcObs * NL3D::IBaseClipObs::HrcObs
 

Shortcut to observers.

Definition at line 131 of file clip_trav.h.

IBaseRenderObs * NL3D::IBaseClipObs::RenderObs
 

Definition at line 132 of file clip_trav.h.

bool NL3D::IBaseClipObs::Visible
 

OUT variable (good after traverse()).

set to true is the object is visible (not clipped).

Definition at line 137 of file clip_trav.h.


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