# 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  

NLPACS::CRetrieverInstance Class Reference

An instance of a local retriever. More...

#include <retriever_instance.h>

List of all members.

Public Methods

 CRetrieverInstance ()
 Default constructor. More...

void reset ()
 Resets the instance. This doesn't affect any neighboring instances... More...

void resetLinks (uint32 id)
 Resets links to the given instance. This doesn't affect any neighbor. More...

void resetLinks ()
 Resets links of the instance. This doesn't affect any neighboring instances... More...

sint32 getInstanceId () const
 Returns the id of this instance. More...

sint32 getRetrieverId () const
 Returns the id of the retriever associated to this instance. More...

uint8 getOrientation () const
 Returns the orientation of the instance in relation to the retriever. More...

NLMISC::CVector getOrigin () const
 Returns the origin translation of this instance. More...

CLocalRetriever::EType getType () const
 Returns the type of the instance. More...

std::vector< sint32getNeighbors () const
 Gets the neighbors. More...

sint32 getNeighbor (uint n) const
 Gets the id of the neighbor on the edge. More...

const std::vector< CLink > & getBorderChainLinks () const
 Gets the ids of the neighbor chains on the given edge. More...

CLink getBorderChainLink (uint n) const
 Gets the id of the nth neighbor chain on the given edge. More...

uint8 getInstanceEdge (uint8 retrieverEdge) const
 Returns the number of the edge on the instance corresponding to the edge on the retriever. More...

uint8 getRetrieverEdge (uint8 instanceEdge) const
 Returns the number of the edge on the retriever corresponding to the edge on the instance. More...

const NLMISC::CAABBoxgetBBox () const
 Returns the bbox of the instance (using the translation and orientation of the retriever). More...

void init (const CLocalRetriever &retriever)
 Inits the instance (after a serial for instance.). More...

void initEdgeQuad (CGlobalRetriever &gr)
 Inits the edgequad (only for Interior instances, and only after all the landscape instances have been built. More...

void linkEdgeQuad (CGlobalRetriever &gr)
 link the edge quad of the interior with the the landscape instances. More...

void make (sint32 instanceId, sint32 retrieverId, const CLocalRetriever &retriever, uint8 orientation, const NLMISC::CVector &origin)
 Builds the instance. More...

void link (CRetrieverInstance &neighbor, const std::vector< CLocalRetriever > &retrievers)
 Links the instance to a given neighbor on the given edge. More...

void unlink (std::vector< CRetrieverInstance > &instances)
 Unlinks the instance. The neighbor instance are AFFECTED. More...

void retrievePosition (const NLMISC::CVector &estimated, const CLocalRetriever &retriever, CCollisionSurfaceTemp &cst) const
 Retrieves the position in the instance from an estimated position. More...

void retrievePosition (const NLMISC::CVectorD &estimated, const CLocalRetriever &retriever, CCollisionSurfaceTemp &cst) const
 Retrieves the position in the instance from an estimated position (double instead.) WARNING: the estimated position is a GLOBAL position, and the returned position is a LOCAL position (to the retriever). More...

void snapToInteriorGround (ULocalPosition &position, const CLocalRetriever &retriever) const
 For the interior instances, snaps the point to the ground. More...

void snap (ULocalPosition &position, const CLocalRetriever &retriever) const
void serial (NLMISC::IStream &f)
 Serialises this CRetrieverInstance. More...

NLMISC::CVector getLocalPosition (const NLMISC::CVector &globalPosition) const
 Computes the position in the local axis of the retriever from a global position. More...

NLMISC::CVector getLocalPosition (const NLMISC::CVectorD &globalPosition) const
 Computes the position in the local axis of the retriever from a global position. More...

NLMISC::CVector getGlobalPosition (const NLMISC::CVector &localPosition) const
 Computes the position in the global axis from a local position (in the retriever axis). More...

NLMISC::CVectorD getDoubleGlobalPosition (const NLMISC::CVector &localPosition) const
 Computes the position (as double) in the global axis from a local position (in the retriever axis). More...

Collision part
void testExteriorCollision (CCollisionSurfaceTemp &cst, const NLMISC::CAABBox &bboxMoveLocal, const NLMISC::CVector2f &transBase, const CLocalRetriever &localRetriever) const
 Test for collisions with the exterior mesh of an interior instance. More...


Static Public Methods

Vector Snapping.
void snapVector (CVector &v)
 Snap a vector at 1mm (1/1024). More...

void snapVector (CVector2f &v)
 Snap a vector at 1mm (1/1024). More...


Protected Attributes

std::vector< CAStarNodeInfo_NodesInformation
sint32 _InstanceId
 The id of this instance. More...

sint32 _RetrieverId
 The id of the retrievable surface pattern. More...

CLocalRetriever::EType _Type
 The type of the instance (see CLocalRetriever::_Type). More...

Instance displacement.
uint8 _Orientation
NLMISC::CVector _Origin
NLMISC::CAABBox _BBox
 The BBox of the instance. More...

Instance linkage.
std::vector< sint32_Neighbors
 The instance ids of the neighbors. More...

std::vector< CLink_BorderChainLinks
 The neighbor chains on the border. More...

Interior instance coolision management.
CEdgeQuad _ExteriorEdgeQuad
 The edges of the exterior collision mesh, stored in a quad grid. More...


Friends

class CGlobalRetriever


Detailed Description

An instance of a local retriever.

It defines a physical/geographic zone of landscape.

Author:
Benjamin Legros , Nevrax France
Date:
2001

Definition at line 56 of file retriever_instance.h.


Constructor & Destructor Documentation

NLPACS::CRetrieverInstance::CRetrieverInstance  
 

Default constructor.

Definition at line 36 of file retriever_instance.cpp.

References reset.


Member Function Documentation

const NLMISC::CAABBox& NLPACS::CRetrieverInstance::getBBox   const [inline]
 

Returns the bbox of the instance (using the translation and orientation of the retriever).

Definition at line 196 of file retriever_instance.h.

CLink NLPACS::CRetrieverInstance::getBorderChainLink uint    n const [inline]
 

Gets the id of the nth neighbor chain on the given edge.

Definition at line 188 of file retriever_instance.h.

References _BorderChainLinks.

const std::vector<CLink>& NLPACS::CRetrieverInstance::getBorderChainLinks   const [inline]
 

Gets the ids of the neighbor chains on the given edge.

Definition at line 186 of file retriever_instance.h.

References _BorderChainLinks.

CVectorD NLPACS::CRetrieverInstance::getDoubleGlobalPosition const NLMISC::CVector   localPosition const
 

Computes the position (as double) in the global axis from a local position (in the retriever axis).

Definition at line 584 of file retriever_instance.cpp.

References _Orientation, _Origin, nlerror, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

CVector NLPACS::CRetrieverInstance::getGlobalPosition const NLMISC::CVector   localPosition const
 

Computes the position in the global axis from a local position (in the retriever axis).

Definition at line 562 of file retriever_instance.cpp.

References _Orientation, _Origin, nlerror, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

Referenced by init.

uint8 NLPACS::CRetrieverInstance::getInstanceEdge uint8    retrieverEdge const [inline]
 

Returns the number of the edge on the instance corresponding to the edge on the retriever.

Definition at line 191 of file retriever_instance.h.

References _Orientation.

sint32 NLPACS::CRetrieverInstance::getInstanceId   const [inline]
 

Returns the id of this instance.

Definition at line 170 of file retriever_instance.h.

References _InstanceId.

CVector NLPACS::CRetrieverInstance::getLocalPosition const NLMISC::CVectorD   globalPosition const
 

Computes the position in the local axis of the retriever from a global position.

Definition at line 540 of file retriever_instance.cpp.

References _Orientation, _Origin, nlerror, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

CVector NLPACS::CRetrieverInstance::getLocalPosition const NLMISC::CVector   globalPosition const
 

Computes the position in the local axis of the retriever from a global position.

Definition at line 518 of file retriever_instance.cpp.

References _Orientation, _Origin, nlerror, nlwarning, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

Referenced by retrievePosition.

sint32 NLPACS::CRetrieverInstance::getNeighbor uint    n const [inline]
 

Gets the id of the neighbor on the edge.

Definition at line 183 of file retriever_instance.h.

References _Neighbors.

std::vector<sint32> NLPACS::CRetrieverInstance::getNeighbors   const [inline]
 

Gets the neighbors.

Definition at line 181 of file retriever_instance.h.

References _Neighbors.

uint8 NLPACS::CRetrieverInstance::getOrientation   const [inline]
 

Returns the orientation of the instance in relation to the retriever.

Definition at line 174 of file retriever_instance.h.

References _Orientation.

NLMISC::CVector NLPACS::CRetrieverInstance::getOrigin   const [inline]
 

Returns the origin translation of this instance.

Definition at line 176 of file retriever_instance.h.

uint8 NLPACS::CRetrieverInstance::getRetrieverEdge uint8    instanceEdge const [inline]
 

Returns the number of the edge on the retriever corresponding to the edge on the instance.

Definition at line 193 of file retriever_instance.h.

References _Orientation.

sint32 NLPACS::CRetrieverInstance::getRetrieverId   const [inline]
 

Returns the id of the retriever associated to this instance.

Definition at line 172 of file retriever_instance.h.

References _RetrieverId.

CLocalRetriever::EType NLPACS::CRetrieverInstance::getType void    const [inline]
 

Returns the type of the instance.

Definition at line 178 of file retriever_instance.h.

References _Type.

void NLPACS::CRetrieverInstance::init const CLocalRetriever   retriever
 

Inits the instance (after a serial for instance.).

Definition at line 89 of file retriever_instance.cpp.

References _BorderChainLinks, _NodesInformation, _Type, and getGlobalPosition.

Referenced by make.

void NLPACS::CRetrieverInstance::initEdgeQuad CGlobalRetriever   gr
 

Inits the edgequad (only for Interior instances, and only after all the landscape instances have been built.

Definition at line 135 of file retriever_instance.cpp.

References _ExteriorEdgeQuad, _InstanceId, _RetrieverId, NLPACS::CGlobalRetriever::getInternalCST, NLPACS::CGlobalRetriever::getRetriever, and nlerror.

void NLPACS::CRetrieverInstance::link CRetrieverInstance &    neighbor,
const std::vector< CLocalRetriever > &    retrievers
 

Links the instance to a given neighbor on the given edge.

Referenced by linkEdgeQuad.

void NLPACS::CRetrieverInstance::linkEdgeQuad CGlobalRetriever   gr
 

link the edge quad of the interior with the the landscape instances.

Definition at line 148 of file retriever_instance.cpp.

References _BorderChainLinks, _ExteriorEdgeQuad, _InstanceId, _RetrieverId, NLPACS::CGlobalRetriever::getRetriever, link, and nlwarning.

void NLPACS::CRetrieverInstance::make sint32    instanceId,
sint32    retrieverId,
const CLocalRetriever   retriever,
uint8    orientation,
const NLMISC::CVector   origin
 

Builds the instance.

Definition at line 105 of file retriever_instance.cpp.

References _BBox, _InstanceId, _Orientation, _Origin, _RetrieverId, NLMISC::CAABBox::getCenter, NLMISC::CAABBox::getHalfSize, init, nlerror, nlwarning, NLMISC::CAABBox::setCenter, and NLMISC::CAABBox::setHalfSize.

void NLPACS::CRetrieverInstance::reset  
 

Resets the instance. This doesn't affect any neighboring instances...

Definition at line 72 of file retriever_instance.cpp.

References _BorderChainLinks, _ExteriorEdgeQuad, _InstanceId, _NodesInformation, _Orientation, _Origin, _RetrieverId, _Type, and resetLinks.

Referenced by CRetrieverInstance.

void NLPACS::CRetrieverInstance::resetLinks  
 

Resets links of the instance. This doesn't affect any neighboring instances...

Definition at line 42 of file retriever_instance.cpp.

References _BorderChainLinks, _ExteriorEdgeQuad, and _Neighbors.

Referenced by reset, and unlink.

void NLPACS::CRetrieverInstance::resetLinks uint32    id
 

Resets links to the given instance. This doesn't affect any neighbor.

Definition at line 55 of file retriever_instance.cpp.

References _BorderChainLinks, _ExteriorEdgeQuad, _Neighbors, and id.

void NLPACS::CRetrieverInstance::retrievePosition const NLMISC::CVectorD   estimated,
const CLocalRetriever   retriever,
CCollisionSurfaceTemp   cst
const
 

Retrieves the position in the instance from an estimated position (double instead.) WARNING: the estimated position is a GLOBAL position, and the returned position is a LOCAL position (to the retriever).

Definition at line 374 of file retriever_instance.cpp.

References _InstanceId, _Type, getLocalPosition, nlerror, nlwarning, NLMISC::CVectorD::x, NLMISC::CVectorD::y, and NLMISC::CVectorD::z.

void NLPACS::CRetrieverInstance::retrievePosition const NLMISC::CVector   estimated,
const CLocalRetriever   retriever,
CCollisionSurfaceTemp   cst
const
 

Retrieves the position in the instance from an estimated position.

WARNING: the estimated position is a GLOBAL position, and the returned position is a LOCAL position (to the retriever).

Definition at line 281 of file retriever_instance.cpp.

void NLPACS::CRetrieverInstance::serial NLMISC::IStream   f
 

Serialises this CRetrieverInstance.

Definition at line 703 of file retriever_instance.cpp.

References _BBox, _BorderChainLinks, _ExteriorEdgeQuad, _InstanceId, _Neighbors, _NodesInformation, _Orientation, _Origin, _RetrieverId, _Type, NLMISC::IStream::isReading, NLMISC::IStream::serial, NLMISC::IStream::serialCont, NLMISC::IStream::serialEnum, and NLMISC::IStream::serialVersion.

void NLPACS::CRetrieverInstance::snap ULocalPosition   position,
const CLocalRetriever   retriever
const
 

Definition at line 484 of file retriever_instance.cpp.

References _InstanceId, _Type, NLPACS::ULocalPosition::Estimation, NLPACS::CLocalRetriever::getSurfaces, nlwarning, NLPACS::CLocalRetriever::snapToInteriorGround, NLPACS::ULocalPosition::Surface, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

void NLPACS::CRetrieverInstance::snapToInteriorGround ULocalPosition   position,
const CLocalRetriever   retriever
const
 

For the interior instances, snaps the point to the ground.

Definition at line 477 of file retriever_instance.cpp.

References NLPACS::CLocalRetriever::snapToInteriorGround.

void NLPACS::CRetrieverInstance::snapVector CVector2f &    v [inline, static]
 

Snap a vector at 1mm (1/1024).

v must be a local position (ie range from -80 to +240). Doing this, we are sure we have precision of 9+10 bits, which is enough for 24 bits float precision.

Definition at line 270 of file retriever_instance.h.

References NLPACS::SnapPrecision, and v.

void NLPACS::CRetrieverInstance::snapVector CVector &    v [inline, static]
 

Snap a vector at 1mm (1/1024).

v must be a local position (ie range from -80 to +240). Doing this, we are sure we have precision of 9+10 bits, which is enough for 24 bits float precision. NB: z is not snapped.

Definition at line 262 of file retriever_instance.h.

References NLPACS::SnapPrecision, and v.

Referenced by NLPACS::CLocalRetriever::insurePosition.

void NLPACS::CRetrieverInstance::testExteriorCollision CCollisionSurfaceTemp   cst,
const NLMISC::CAABBox   bboxMoveLocal,
const NLMISC::CVector2f   transBase,
const CLocalRetriever   localRetriever
const
 

Test for collisions with the exterior mesh of an interior instance.

This only works for interior instances !! see also testCollision() in CLocalRetriever

Definition at line 609 of file retriever_instance.cpp.

References _ExteriorEdgeQuad, NLPACS::CLocalRetriever::_ExteriorMesh, NLPACS::CCollisionSurfaceTemp::allocEdgeCollideNode, NLPACS::CCollisionSurfaceTemp::CollisionChains, NLPACS::CCollisionSurfaceTemp::ExteriorEdgeIndexes, NLPACS::CCollisionSurfaceTemp::getEdgeCollideNode, and NLPACS::CCollisionSurfaceTemp::OChainLUT.

void NLPACS::CRetrieverInstance::unlink std::vector< CRetrieverInstance > &    instances
 

Unlinks the instance. The neighbor instance are AFFECTED.

Definition at line 268 of file retriever_instance.cpp.

References _InstanceId, _Neighbors, and resetLinks.


Friends And Related Function Documentation

friend class CGlobalRetriever [friend]
 

Definition at line 76 of file retriever_instance.h.


Member Data Documentation

NLMISC::CAABBox NLPACS::CRetrieverInstance::_BBox [protected]
 

The BBox of the instance.

Definition at line 134 of file retriever_instance.h.

Referenced by make, and serial.

std::vector<CLink> NLPACS::CRetrieverInstance::_BorderChainLinks [protected]
 

The neighbor chains on the border.

Definition at line 145 of file retriever_instance.h.

Referenced by getBorderChainLink, getBorderChainLinks, init, linkEdgeQuad, reset, resetLinks, and serial.

CEdgeQuad NLPACS::CRetrieverInstance::_ExteriorEdgeQuad [protected]
 

The edges of the exterior collision mesh, stored in a quad grid.

The edges are stored in the instance rather than in the local retriever.

Definition at line 154 of file retriever_instance.h.

Referenced by initEdgeQuad, linkEdgeQuad, reset, resetLinks, serial, and testExteriorCollision.

sint32 NLPACS::CRetrieverInstance::_InstanceId [protected]
 

The id of this instance.

Definition at line 120 of file retriever_instance.h.

Referenced by getInstanceId, initEdgeQuad, linkEdgeQuad, make, reset, retrievePosition, serial, snap, and unlink.

std::vector<sint32> NLPACS::CRetrieverInstance::_Neighbors [protected]
 

The instance ids of the neighbors.

Definition at line 142 of file retriever_instance.h.

Referenced by getNeighbor, getNeighbors, resetLinks, serial, and unlink.

std::vector<CAStarNodeInfo> NLPACS::CRetrieverInstance::_NodesInformation [protected]
 

Definition at line 116 of file retriever_instance.h.

Referenced by init, reset, and serial.

uint8 NLPACS::CRetrieverInstance::_Orientation [protected]
 

Definition at line 130 of file retriever_instance.h.

Referenced by getDoubleGlobalPosition, getGlobalPosition, getInstanceEdge, getLocalPosition, getOrientation, getRetrieverEdge, make, reset, and serial.

NLMISC::CVector NLPACS::CRetrieverInstance::_Origin [protected]
 

Definition at line 131 of file retriever_instance.h.

Referenced by getDoubleGlobalPosition, getGlobalPosition, getLocalPosition, make, reset, and serial.

sint32 NLPACS::CRetrieverInstance::_RetrieverId [protected]
 

The id of the retrievable surface pattern.

Definition at line 123 of file retriever_instance.h.

Referenced by getRetrieverId, initEdgeQuad, linkEdgeQuad, make, reset, and serial.

CLocalRetriever::EType NLPACS::CRetrieverInstance::_Type [protected]
 

The type of the instance (see CLocalRetriever::_Type).

Definition at line 126 of file retriever_instance.h.

Referenced by getType, init, reset, retrievePosition, serial, and snap.


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