# 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 <base_clip_obs.h>

Inheritance diagram for NL3D::IBaseClipObs:

NL3D::IObs NLMISC::CRefCount NL3D::CClusterClipObs NL3D::CDefaultClipObs NL3D::CQuadGridClipClusterClipObs NL3D::CRootModelClipObs NL3D::CSkipModelClipObs NL3D::CTransformClipObs NL3D::CCoarseMeshClipObs NL3D::CLandscapeClipObs NL3D::CParticleSystemClipObs NL3D::CTransformShapeClipObs NL3D::CVegetableBlendLayerClipObs NL3D::CMeshMultiLodClipObs List of all members.

Public Types

enum  TClipReason { FrustumClip = 0, DistMaxClip, countClip }

Public Methods

 IBaseClipObs ()
 Constructor. More...

virtual ~IBaseClipObs ()
virtual void init ()
 Build shortcut to HrcObs and RenderObs. 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...

virtual void forceClip (TClipReason clipReason)
 This method is called when a father want to clip all his sons (eg: QuadGridClipCluster) The default behavior is just to call this method on observer sons. More...

virtual bool isTreeNode ()
 Because the clip traversal is a graph of observer not a hierarchy. More...


Public Attributes

IBaseHrcObsHrcObs
 Shortcut to observers. More...

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


Private Attributes

sint _IndexInVisibleList

Friends

class CClipTrav

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(). see CTransform for an implementation.
  • possibly modify/extend the graph methods (such as a graph behavior).
See also:
CClipTrav
Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 62 of file base_clip_obs.h.


Member Enumeration Documentation

enum NL3D::IBaseClipObs::TClipReason
 

Enumeration values:
FrustumClip 
DistMaxClip 
countClip 

Definition at line 76 of file base_clip_obs.h.


Constructor & Destructor Documentation

NL3D::IBaseClipObs::IBaseClipObs   [inline]
 

Constructor.

Definition at line 82 of file base_clip_obs.h.

References _IndexInVisibleList, HrcObs, RenderObs, and Visible.

Referenced by NL3D::CVegetableBlendLayerClipObs::clip, NL3D::CTransformClipObs::clip, NL3D::CSkipModelClipObs::clip, NL3D::CRootModelClipObs::clip, NL3D::CQuadGridClipClusterClipObs::clip, NL3D::CDefaultClipObs::clip, forceClip, and NL3D::CTransformClipObs::traverse.

NL3D::IBaseClipObs::~IBaseClipObs   [virtual]
 

Definition at line 52 of file base_clip_obs.cpp.

References _IndexInVisibleList, CClipTrav, nlassert, and NL3D::IObs::Trav.


Member Function Documentation

virtual 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)

Implemented in NL3D::CDefaultClipObs.

void NL3D::IBaseClipObs::forceClip TClipReason    clipReason [virtual]
 

This method is called when a father want to clip all his sons (eg: QuadGridClipCluster) The default behavior is just to call this method on observer sons.

Parameters:
TClipReason  is the reason of the forced clip. either a frustrum clip or a DistMax Clip

Reimplemented in NL3D::CMeshMultiLodClipObs.

Definition at line 82 of file base_clip_obs.cpp.

References NL3D::IObs::getFirstChild, NL3D::IObs::getNextChild, IBaseClipObs, and NL3D::IObs::IObs.

Referenced by NL3D::CQuadGridClipClusterClipObs::traverse.

void NL3D::IBaseClipObs::init   [virtual]
 

Build shortcut to HrcObs and RenderObs.

Reimplemented from NL3D::IObs.

Reimplemented in NL3D::CLandscapeClipObs.

Definition at line 67 of file base_clip_obs.cpp.

References AnimDetailObs, NL3D::AnimDetailTravId, NL3D::IObs::getObs, HrcObs, NL3D::HrcTravId, LoadBalancingObs, NL3D::LoadBalancingTravId, nlassert, RenderObs, and NL3D::RenderTravId.

virtual bool NL3D::IBaseClipObs::isTreeNode   [inline, virtual]
 

Because the clip traversal is a graph of observer not a hierarchy.

Reimplemented from NL3D::IObs.

Definition at line 123 of file base_clip_obs.h.

virtual 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, add it to the post-clip traversals which need it (if renderable, animDetailable etc...)
  • always traverseSons(), to clip the sons.

Implements NL3D::IObs.

Implemented in NL3D::CDefaultClipObs.


Friends And Related Function Documentation

friend class CClipTrav [friend]
 

Definition at line 126 of file base_clip_obs.h.

Referenced by ~IBaseClipObs.


Member Data Documentation

sint NL3D::IBaseClipObs::_IndexInVisibleList [private]
 

Definition at line 129 of file base_clip_obs.h.

Referenced by IBaseClipObs, and ~IBaseClipObs.

IBaseAnimDetailObs* NL3D::IBaseClipObs::AnimDetailObs
 

Definition at line 68 of file base_clip_obs.h.

Referenced by init, NL3D::CParticleSystemClipObs::insertInVisibleList, and NL3D::CTransformClipObs::traverse.

IBaseHrcObs* NL3D::IBaseClipObs::HrcObs
 

Shortcut to observers.

Definition at line 66 of file base_clip_obs.h.

Referenced by NL3D::CTransformShapeClipObs::clip, IBaseClipObs, init, NL3D::CTransformClipObs::traverse, and NL3D::CParticleSystemClipObs::traverse.

IBaseLoadBalancingObs* NL3D::IBaseClipObs::LoadBalancingObs
 

Definition at line 69 of file base_clip_obs.h.

Referenced by init, NL3D::CParticleSystemClipObs::insertInVisibleList, and NL3D::CTransformClipObs::traverse.

IBaseRenderObs* NL3D::IBaseClipObs::RenderObs
 

Definition at line 67 of file base_clip_obs.h.

Referenced by IBaseClipObs, init, and NL3D::CTransformClipObs::traverse.

bool NL3D::IBaseClipObs::Visible
 

OUT variable (good after traverse()).

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

Definition at line 74 of file base_clip_obs.h.

Referenced by IBaseClipObs, NL3D::CTransformClipObs::traverse, and NL3D::CParticleSystemClipObs::traverse.


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