# 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::CInstanceGroupUser Class Reference

Implementation of the user interface managing instance groups. More...

#include <instance_group_user.h>

Inheritance diagram for NL3D::CInstanceGroupUser:

NL3D::UInstanceGroup List of all members.

Public Methods

 CInstanceGroupUser ()
bool init (const std::string &instanceGroup)
CInstanceGroupgetInternalIG ()

Private Methods

void setTransformNameCallback (ITransformName *pTN)
 Set up the callback used at loading and instanciating of the instanceGroup. More...

void setAddRemoveInstanceCallback (IAddRemoveInstance *callback)
 set a callback to know when an instance has been added / removed from scene. More...

void setIGAddBeginCallback (IIGAddBegin *callback)
 Set a callback to know when an instance group is being created, and how many instances it contains. More...

void addToScene (class UScene &scene, UDriver *driver)
 Add all the instances to the scene. More...

void addToScene (class CScene &scene, IDriver *driver)
void addToSceneAsync (class UScene &scene, UDriver *driver)
TState getAddToSceneState ()
void stopAddToSceneAsync ()
virtual void setDistMax (uint instance, float dist)
virtual float getDistMax (uint instance) const
virtual void setCoarseMeshDist (uint instance, float dist)
virtual float getCoarseMeshDist (uint instance) const
void removeFromScene (class UScene &scene)
 remove this instance group from the given scene. More...

uint getNumInstance () const
 Return the count of shape instance in this group. More...

const std::string & getShapeName (uint instanceNb) const
 Return the name of the shape refered by an instance of the group. More...

const std::string & getInstanceName (uint instanceNb) const
 Return the name of an instance of the group. More...

virtual void getInstanceMatrix (uint instanceNb, NLMISC::CMatrix &dest) const
 Return the transformation matrix of an instance in the group NB no pivot is added. More...

const NLMISC::CVectorgetInstancePos (uint instanceNb) const
 Return the position of an instance of the group. More...

const NLMISC::CQuatgetInstanceRot (uint instanceNb) const
 Return the rotation of an instance of the group. More...

const NLMISC::CVectorgetInstanceScale (uint instanceNb) const
 Return the scale of an instance of the group. More...

UInstancegetByName (std::string &name)
 Return the instance at a given position. More...

const UInstancegetByName (std::string &name) const
 Return the instance at a given position (const version). More...

void setLightFactor (const std::string &LightName, NLMISC::CRGBA nFactor)
 Control a lightmap. More...

void setBlendShapeFactor (const std::string &bsName, float rFactor)
 Control a blendshape. More...

void createRoot (UScene &scene)
 Create the link between scene and instance group before the addToScene to allow the instance group to be moved without being linked to a father cluster system. More...

void setClusterSystem (UInstanceGroup *pClusterSystem)
 All the instances must be checked against the following cluster system. More...

bool linkToParentCluster (UInstanceGroup *father)
 Link this ig clusters as sons of clusters of 'ig' that conatains them. More...

void getDynamicPortals (std::vector< std::string > &names)
 Get all dynamic portals in the instance group. More...

void setDynamicPortal (std::string &name, bool opened)
 Set the state of a dynamic portal. More...

bool getDynamicPortal (std::string &name)
 Get the state of a dynamic portal. More...

void setPos (const NLMISC::CVector &pos)
 Set the position of the instance group Take care if the instance group is a cluster system, you must not move it outside its father cluster which is assigned at addToScene moment. More...

void setRotQuat (const NLMISC::CQuat &q)
 Set the rotation of the instance group. More...

void setPointLightFactor (const std::string &lightGroupName, NLMISC::CRGBA nFactor)
 set the Light factor for all pointLights of "lightGroupName". More...

bool getStaticLightSetup (const std::string &retrieverIdentifier, sint surfaceId, const NLMISC::CVector &localPos, std::vector< CPointLightInfluence > &pointLightList, uint8 &sunContribution, NLMISC::CRGBA &localAmbient)
 get the StaticLightSetup for a model at position localPos/retrieverIdentifier/surfaceId. More...

NLMISC::CVector getPos ()
 Get the position. More...

NLMISC::CQuat getRotQuat ()
 Get the rotation. More...

virtual void freezeHRC ()
 see UTransform::freezeHRC(). Do it for all instances (not clusters), and for the root of the IG. More...

virtual void unfreezeHRC ()
 see UTransform::unfreezeHRC(). Do it for all instances (not clusters), and for the root of the IG. More...


Private Attributes

CInstanceGroup _InstanceGroup
std::map< std::string, CInstanceUser * > _Instances
TState _AddToSceneState
UScene_AddToSceneTempScene
UDriver_AddToSceneTempDriver

Friends

class CTransformUser
class CSceneUser

Detailed Description

Implementation of the user interface managing instance groups.

Author:
Cyril 'Hulud' Corvazier , Nevrax France
Date:
2001

Definition at line 55 of file instance_group_user.h.


Constructor & Destructor Documentation

NL3D::CInstanceGroupUser::CInstanceGroupUser  
 

Definition at line 90 of file instance_group_user.cpp.

References _AddToSceneState, and NL3D::UInstanceGroup::StateNotAdded.

Referenced by setClusterSystem.


Member Function Documentation

void NL3D::CInstanceGroupUser::addToScene class CScene   scene,
IDriver   driver
[private]
 

Definition at line 175 of file instance_group_user.cpp.

References _InstanceGroup, and _Instances.

void NL3D::CInstanceGroupUser::addToScene class UScene   scene,
UDriver   driver
[private, virtual]
 

Add all the instances to the scene.

By default, freezeHRC() those instances and the root.

Parameters:
scene  is the scene in which you want to add the instance group.
driver  is a pointer to a driver. If this pointer is not NULL, the textures used by the shapes will be preloaded in this driver. If the pointer is NULL (default), textures will ve loaded when the shape will be used.

Implements NL3D::UInstanceGroup.

Definition at line 156 of file instance_group_user.cpp.

References CSceneUser.

void NL3D::CInstanceGroupUser::addToSceneAsync class UScene   scene,
UDriver   driver
[private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 194 of file instance_group_user.cpp.

References _AddToSceneState, _AddToSceneTempDriver, _AddToSceneTempScene, _InstanceGroup, CSceneUser, and NL3D::UInstanceGroup::StateAdding.

void NL3D::CInstanceGroupUser::createRoot UScene   scene [private, virtual]
 

Create the link between scene and instance group before the addToScene to allow the instance group to be moved without being linked to a father cluster system.

Implements NL3D::UInstanceGroup.

Definition at line 356 of file instance_group_user.cpp.

References _InstanceGroup, and CSceneUser.

void NL3D::CInstanceGroupUser::freezeHRC   [private, virtual]
 

see UTransform::freezeHRC(). Do it for all instances (not clusters), and for the root of the IG.

Implements NL3D::UInstanceGroup.

Definition at line 433 of file instance_group_user.cpp.

References _InstanceGroup.

UInstanceGroup::TState NL3D::CInstanceGroupUser::getAddToSceneState   [private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 213 of file instance_group_user.cpp.

References _AddToSceneState, _AddToSceneTempScene, _InstanceGroup, _Instances, CSceneUser, NL3D::UInstanceGroup::StateAdded, and NL3D::UInstanceGroup::StateAdding.

const UInstance * NL3D::CInstanceGroupUser::getByName std::string &    name const [private, virtual]
 

Return the instance at a given position (const version).

Implements NL3D::UInstanceGroup.

Definition at line 329 of file instance_group_user.cpp.

References _Instances.

UInstance * NL3D::CInstanceGroupUser::getByName std::string &    name [private, virtual]
 

Return the instance at a given position.

Implements NL3D::UInstanceGroup.

Definition at line 317 of file instance_group_user.cpp.

References _Instances.

float NL3D::CInstanceGroupUser::getCoarseMeshDist uint    instance const [private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 503 of file instance_group_user.cpp.

References _InstanceGroup, and nlwarning.

float NL3D::CInstanceGroupUser::getDistMax uint    instance const [private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 476 of file instance_group_user.cpp.

References _InstanceGroup, and nlwarning.

bool NL3D::CInstanceGroupUser::getDynamicPortal std::string &    name [private, virtual]
 

Get the state of a dynamic portal.

Returns:
the state (true=opened, false=closed) of a dynamic portal

Implements NL3D::UInstanceGroup.

Definition at line 397 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::getDynamicPortals std::vector< std::string > &    names [private, virtual]
 

Get all dynamic portals in the instance group.

Returns:
a vector of portal names

Implements NL3D::UInstanceGroup.

Definition at line 383 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::getInstanceMatrix uint    instanceNb,
NLMISC::CMatrix   dest
const [private, virtual]
 

Return the transformation matrix of an instance in the group NB no pivot is added.

Implements NL3D::UInstanceGroup.

Definition at line 167 of file instance_group_user.cpp.

References _InstanceGroup.

const std::string & NL3D::CInstanceGroupUser::getInstanceName uint    instanceNb const [private, virtual]
 

Return the name of an instance of the group.

Parameters:
instanceNb  is the number of the instance.
Returns:
the name of the instance.

Implements NL3D::UInstanceGroup.

Definition at line 271 of file instance_group_user.cpp.

References _InstanceGroup, and nlerror.

const NLMISC::CVector & NL3D::CInstanceGroupUser::getInstancePos uint    instanceNb const [private, virtual]
 

Return the position of an instance of the group.

Parameters:
instanceNb  is the number of the instance.
Returns:
the position of the instance.

Implements NL3D::UInstanceGroup.

Definition at line 282 of file instance_group_user.cpp.

References _InstanceGroup, and nlerror.

const NLMISC::CQuat & NL3D::CInstanceGroupUser::getInstanceRot uint    instanceNb const [private, virtual]
 

Return the rotation of an instance of the group.

Parameters:
instanceNb  is the number of the instance.
Returns:
the rotation of the instance.

Implements NL3D::UInstanceGroup.

Definition at line 293 of file instance_group_user.cpp.

References _InstanceGroup, and nlerror.

const NLMISC::CVector & NL3D::CInstanceGroupUser::getInstanceScale uint    instanceNb const [private, virtual]
 

Return the scale of an instance of the group.

Parameters:
instanceNb  is the number of the instance.
Returns:
the scale of the instance.

Implements NL3D::UInstanceGroup.

Definition at line 304 of file instance_group_user.cpp.

References _InstanceGroup, and nlerror.

CInstanceGroup& NL3D::CInstanceGroupUser::getInternalIG   [inline]
 

Definition at line 134 of file instance_group_user.h.

References _InstanceGroup, and NL3D_MEM_IG.

uint NL3D::CInstanceGroupUser::getNumInstance   const [private, virtual]
 

Return the count of shape instance in this group.

Implements NL3D::UInstanceGroup.

Definition at line 252 of file instance_group_user.cpp.

References _InstanceGroup.

CVector NL3D::CInstanceGroupUser::getPos   [private, virtual]
 

Get the position.

Implements NL3D::UInstanceGroup.

Definition at line 418 of file instance_group_user.cpp.

References _InstanceGroup.

CQuat NL3D::CInstanceGroupUser::getRotQuat   [private, virtual]
 

Get the rotation.

Implements NL3D::UInstanceGroup.

Definition at line 425 of file instance_group_user.cpp.

References _InstanceGroup.

const std::string & NL3D::CInstanceGroupUser::getShapeName uint    instanceNb const [private, virtual]
 

Return the name of the shape refered by an instance of the group.

Parameters:
instanceNb  is the number of the instance.
Returns:
the name of the shape.

Implements NL3D::UInstanceGroup.

Definition at line 260 of file instance_group_user.cpp.

References _InstanceGroup, and nlerror.

bool NL3D::CInstanceGroupUser::getStaticLightSetup const std::string &    retrieverIdentifier,
sint    surfaceId,
const NLMISC::CVector   localPos,
std::vector< CPointLightInfluence > &    pointLightList,
uint8   sunContribution,
NLMISC::CRGBA   localAmbient
[private, virtual]
 

get the StaticLightSetup for a model at position localPos/retrieverIdentifier/surfaceId.

NB: all are get with help of UGlobalPosition. localPos= gp.LocalPosition.Estimated

Implements NL3D::UInstanceGroup.

Definition at line 455 of file instance_group_user.cpp.

References _InstanceGroup.

bool NL3D::CInstanceGroupUser::init const std::string &    instanceGroup
 

Definition at line 97 of file instance_group_user.cpp.

References _InstanceGroup, and file.

bool NL3D::CInstanceGroupUser::linkToParentCluster UInstanceGroup   father [private, virtual]
 

Link this ig clusters as sons of clusters of 'ig' that conatains them.

Returns:
true if the link succeeded

Implements NL3D::UInstanceGroup.

Definition at line 370 of file instance_group_user.cpp.

References _InstanceGroup, and nlwarning.

void NL3D::CInstanceGroupUser::removeFromScene class UScene   scene [private, virtual]
 

remove this instance group from the given scene.

Implements NL3D::UInstanceGroup.

Definition at line 237 of file instance_group_user.cpp.

References _InstanceGroup, _Instances, and CSceneUser.

void NL3D::CInstanceGroupUser::setAddRemoveInstanceCallback IAddRemoveInstance   callback [private, virtual]
 

set a callback to know when an instance has been added / removed from scene.

Implements NL3D::UInstanceGroup.

Definition at line 139 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setBlendShapeFactor const std::string &    bsName,
float    rFactor
[private, virtual]
 

Control a blendshape.

Implements NL3D::UInstanceGroup.

Definition at line 348 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setClusterSystem UInstanceGroup   pClusterSystem [private, virtual]
 

All the instances must be checked against the following cluster system.

Implements NL3D::UInstanceGroup.

Definition at line 363 of file instance_group_user.cpp.

References _InstanceGroup, and CInstanceGroupUser.

void NL3D::CInstanceGroupUser::setCoarseMeshDist uint    instance,
float    dist
[private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 488 of file instance_group_user.cpp.

References _InstanceGroup, and nlwarning.

void NL3D::CInstanceGroupUser::setDistMax uint    instance,
float    dist
[private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 465 of file instance_group_user.cpp.

References _InstanceGroup, and nlwarning.

void NL3D::CInstanceGroupUser::setDynamicPortal std::string &    name,
bool    opened
[private, virtual]
 

Set the state of a dynamic portal.

Parameters:
name  is the name of the dynamic portal to open or close
opened  is the state the portal will have (true=opened, false=closed)

Implements NL3D::UInstanceGroup.

Definition at line 390 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setIGAddBeginCallback IIGAddBegin   callback [private, virtual]
 

Set a callback to know when an instance group is being created, and how many instances it contains.

Implements NL3D::UInstanceGroup.

Definition at line 147 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setLightFactor const std::string &    LightName,
NLMISC::CRGBA    nFactor
[private, virtual]
 

Control a lightmap.

Implements NL3D::UInstanceGroup.

Definition at line 341 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setPointLightFactor const std::string &    lightGroupName,
NLMISC::CRGBA    nFactor
[private, virtual]
 

set the Light factor for all pointLights of "lightGroupName".

Implements NL3D::UInstanceGroup.

Definition at line 448 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setPos const NLMISC::CVector   pos [private, virtual]
 

Set the position of the instance group Take care if the instance group is a cluster system, you must not move it outside its father cluster which is assigned at addToScene moment.

Implements NL3D::UInstanceGroup.

Definition at line 404 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::setRotQuat const NLMISC::CQuat   q [private, virtual]
 

Set the rotation of the instance group.

Implements NL3D::UInstanceGroup.

Definition at line 411 of file instance_group_user.cpp.

References _InstanceGroup, and q.

void NL3D::CInstanceGroupUser::setTransformNameCallback ITransformName   pTN [private, virtual]
 

Set up the callback used at loading and instanciating of the instanceGroup.

Parameters:
pTN  is the transformName class that hold the callback

Implements NL3D::UInstanceGroup.

Definition at line 131 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::stopAddToSceneAsync   [private, virtual]
 

Implements NL3D::UInstanceGroup.

Definition at line 206 of file instance_group_user.cpp.

References _InstanceGroup.

void NL3D::CInstanceGroupUser::unfreezeHRC   [private, virtual]
 

see UTransform::unfreezeHRC(). Do it for all instances (not clusters), and for the root of the IG.

Implements NL3D::UInstanceGroup.

Definition at line 440 of file instance_group_user.cpp.

References _InstanceGroup.


Friends And Related Function Documentation

friend class CSceneUser [friend]
 

Definition at line 130 of file instance_group_user.h.

Referenced by addToScene, addToSceneAsync, createRoot, getAddToSceneState, and removeFromScene.

friend class CTransformUser [friend]
 

Definition at line 129 of file instance_group_user.h.


Member Data Documentation

TState NL3D::CInstanceGroupUser::_AddToSceneState [private]
 

Definition at line 122 of file instance_group_user.h.

Referenced by addToSceneAsync, CInstanceGroupUser, and getAddToSceneState.

UDriver* NL3D::CInstanceGroupUser::_AddToSceneTempDriver [private]
 

Definition at line 124 of file instance_group_user.h.

Referenced by addToSceneAsync.

UScene* NL3D::CInstanceGroupUser::_AddToSceneTempScene [private]
 

Definition at line 123 of file instance_group_user.h.

Referenced by addToSceneAsync, and getAddToSceneState.

CInstanceGroup NL3D::CInstanceGroupUser::_InstanceGroup [private]
 

Definition at line 119 of file instance_group_user.h.

Referenced by addToScene, addToSceneAsync, createRoot, freezeHRC, getAddToSceneState, getCoarseMeshDist, getDistMax, getDynamicPortal, getDynamicPortals, getInstanceMatrix, getInstanceName, getInstancePos, getInstanceRot, getInstanceScale, getInternalIG, getNumInstance, getPos, getRotQuat, getShapeName, getStaticLightSetup, init, linkToParentCluster, removeFromScene, setAddRemoveInstanceCallback, setBlendShapeFactor, setClusterSystem, setCoarseMeshDist, setDistMax, setDynamicPortal, setIGAddBeginCallback, setLightFactor, setPointLightFactor, setPos, setRotQuat, setTransformNameCallback, stopAddToSceneAsync, and unfreezeHRC.

std::map<std::string,CInstanceUser*> NL3D::CInstanceGroupUser::_Instances [private]
 

Definition at line 120 of file instance_group_user.h.

Referenced by addToScene, getAddToSceneState, getByName, and removeFromScene.


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