NLPACS::COrderedChain3f Class Reference

#include <chain.h>


Detailed Description

A list of ordered vertices, partially delimiting 2 different surfaces. In the vertex list, we consider the following order v1 < v2 iff v1.x < v2.x || v1.x == v2.x && v1.y < v2.y || v1.x == v2.x && v1.y == v2.y && v1.z < v2.z The vertices composing the chain are actual CVector (12 bytes per vertex.)
Author:
Benjamin Legros

Nevrax France

Date:
2001

Definition at line 48 of file chain.h.

Public Member Functions

uint16 getIndexInParent () const
 Returns the index of the ochain within the parent chain.

uint16 getParentId () const
 Returns the parent chain Id of this ordered chain.

const std::vector< NLMISC::CVector > & getVertices () const
 Returns the vertices of the chain.

bool isForward () const
 Returns true if the chain should be accessed forward within the parent CChain (see _Forward.).

const NLMISC::CVectoroperator[] (uint n) const
void serial (NLMISC::IStream &f)
void translate (const NLMISC::CVector &translation)
void unpack (const COrderedChain &ochain)

Protected Attributes

bool _Forward
 Set if the chain should be read forward within the parent CChain (for sequential access to vertices.).

uint16 _IndexInParent
 The index of the ochain within the parent chain.

uint16 _ParentId
 The parent chain Id.

std::vector< NLMISC::CVector_Vertices
 The vertices of the chain, ordered following x growth.


Friends

class CChain
class CRetrievableSurface


Member Function Documentation

uint16 NLPACS::COrderedChain3f::getIndexInParent  )  const [inline]
 

Returns the index of the ochain within the parent chain.

Definition at line 77 of file chain.h.

References _IndexInParent, and uint16.

Referenced by NLPACS::CLocalRetriever::dumpSurface(), and NLPACS::COrderedChain::pack().

00077 { return _IndexInParent; }

uint16 NLPACS::COrderedChain3f::getParentId  )  const [inline]
 

Returns the parent chain Id of this ordered chain.

Definition at line 74 of file chain.h.

References _ParentId, and uint16.

Referenced by NLPACS::CLocalRetriever::dumpSurface(), and NLPACS::COrderedChain::pack().

00074 { return _ParentId; }

const std::vector<NLMISC::CVector>& NLPACS::COrderedChain3f::getVertices  )  const [inline]
 

Returns the vertices of the chain.

Definition at line 68 of file chain.h.

Referenced by NLPACS::CLocalRetriever::build3dSurfacePolygons(), NLPACS::CLocalRetriever::dumpSurface(), NLPACS::CLocalRetriever::getStartVector(), NLPACS::CLocalRetriever::getStopVector(), NLPACS::linkExteriorToInterior(), and NLPACS::COrderedChain::pack().

00068 { return _Vertices; }

bool NLPACS::COrderedChain3f::isForward  )  const [inline]
 

Returns true if the chain should be accessed forward within the parent CChain (see _Forward.).

Definition at line 71 of file chain.h.

References _Forward.

Referenced by NLPACS::CLocalRetriever::build3dSurfacePolygons(), NLPACS::CLocalRetriever::dumpSurface(), NLPACS::CLocalRetriever::getStartVector(), NLPACS::CLocalRetriever::getStopVector(), and NLPACS::COrderedChain::pack().

00071 { return _Forward; }

const NLMISC::CVector& NLPACS::COrderedChain3f::operator[] uint  n  )  const [inline]
 

Definition at line 80 of file chain.h.

References uint.

00080 { return _Vertices[n]; }

void NLPACS::COrderedChain3f::serial NLMISC::IStream f  ) 
 

Definition at line 64 of file chain.cpp.

References _Forward, _IndexInParent, _ParentId, NLMISC::IStream::serial(), NLMISC::IStream::serialCont(), and NLMISC::IStream::serialVersion().

00065 {
00066         /*
00067         Version 0:
00068                 - base version.
00069         */
00070         (void)f.serialVersion(0);
00071 
00072         f.serialCont(_Vertices);
00073         f.serial(_Forward);
00074         f.serial(_ParentId);
00075         f.serial(_IndexInParent);
00076 }

void NLPACS::COrderedChain3f::translate const NLMISC::CVector translation  )  [inline]
 

Definition at line 86 of file chain.h.

References uint.

00087         {
00088                 uint    i;
00089                 for (i=0; i<_Vertices.size(); ++i)
00090                         _Vertices[i] += translation;
00091         }

void NLPACS::COrderedChain3f::unpack const COrderedChain ochain  )  [inline]
 

Definition at line 330 of file chain.h.

References _Forward, _IndexInParent, _ParentId, NLPACS::COrderedChain::getIndexInParent(), NLPACS::COrderedChain::getParentId(), NLPACS::COrderedChain::getVertices(), NLPACS::COrderedChain::isForward(), uint, and z.

00331 {
00332         uint    i, mx;
00333         const std::vector<CVector2s>    &vertices = chain.getVertices();
00334         mx = _Vertices.size();
00335         _Vertices.resize(vertices.size());
00336         _Forward = chain.isForward();
00337         _ParentId = chain.getParentId();
00338         _IndexInParent = chain.getIndexInParent();
00339         for (i=0; i<vertices.size(); ++i)
00340         {
00341                 _Vertices[i] = vertices[i].unpack3f(i >= mx ? 0.0f : _Vertices[i].z);
00342         }
00343 }


Friends And Related Function Documentation

friend class CChain [friend]
 

Definition at line 51 of file chain.h.

friend class CRetrievableSurface [friend]
 

Definition at line 52 of file chain.h.


Field Documentation

bool NLPACS::COrderedChain3f::_Forward [protected]
 

Set if the chain should be read forward within the parent CChain (for sequential access to vertices.).

Definition at line 58 of file chain.h.

Referenced by isForward(), NLPACS::CChain::make(), serial(), and unpack().

uint16 NLPACS::COrderedChain3f::_IndexInParent [protected]
 

The index of the ochain within the parent chain.

Definition at line 64 of file chain.h.

Referenced by getIndexInParent(), NLPACS::CChain::make(), serial(), and unpack().

uint16 NLPACS::COrderedChain3f::_ParentId [protected]
 

The parent chain Id.

Definition at line 61 of file chain.h.

Referenced by getParentId(), NLPACS::CChain::make(), serial(), and unpack().

std::vector<NLMISC::CVector> NLPACS::COrderedChain3f::_Vertices [protected]
 

The vertices of the chain, ordered following x growth.

Definition at line 55 of file chain.h.

Referenced by NLPACS::CChain::make().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 14:19:46 2004 for NeL by doxygen 1.3.6