NLPACS::CExteriorMesh Class Reference

#include <exterior_mesh.h>


Detailed Description

The external mesh of a interior local retriever.
Author:
Benjamin Legros

Nevrax France

Date:
2001

Definition at line 56 of file exterior_mesh.h.

Public Member Functions

void clear ()
void serial (NLMISC::IStream &f)
 Serializes the mesh.

Constructors
 CExteriorMesh ()
Selectors
const NLMISC::CAABBoxgetBBox () const
 Get the bbox of the mesh.

const CEdge getEdge (uint n) const
 Get the nth edge of the mesh.

const std::vector< CEdge > & getEdges () const
 Get the set of edges that forms the whole mesh.

const CLinkgetLink (uint n) const
 Get a specific link.

CLink getLinkFromEdge (uint edge) const
 Get the link on a specific edge.

const std::vector< CLink > & getLinks () const
 Get the links.

const COrderedEdgesgetOrderedEdges (uint n) const
 Get the nth set of ordered edges.

const std::vector< COrderedEdges > & getOrderedEdges () const
 Get the ordered edges.

Mutators/initialisation
void setEdges (const std::vector< CEdge > &edges)
 Set the edges.

void setLinks (const std::vector< CLink > &links)
 Set the links.


Protected Attributes

NLMISC::CAABBox _BBox
std::vector< CEdge_Edges
std::vector< CLink_Links
std::vector< COrderedEdges_OrderedEdges


Constructor & Destructor Documentation

NLPACS::CExteriorMesh::CExteriorMesh  ) 
 

Definition at line 60 of file exterior_mesh.cpp.

00060 { }


Member Function Documentation

void NLPACS::CExteriorMesh::clear void   )  [inline]
 

Definition at line 106 of file exterior_mesh.h.

References _Links, _OrderedEdges, and NLMISC::contReset().

Referenced by NLPACS::CLocalRetriever::clear().

00107         {
00108                 NLMISC::contReset(_Edges);
00109                 NLMISC::contReset(_OrderedEdges);
00110                 NLMISC::contReset(_Links);
00111         }

const NLMISC::CAABBox& NLPACS::CExteriorMesh::getBBox  )  const [inline]
 

Get the bbox of the mesh.

Definition at line 140 of file exterior_mesh.h.

00140 { return _BBox; }

const CEdge NLPACS::CExteriorMesh::getEdge uint  n  )  const [inline]
 

Get the nth edge of the mesh.

Definition at line 120 of file exterior_mesh.h.

References uint.

Referenced by NLPACS::computeRetriever(), NLPACS::CRetrieverInstance::linkEdgeQuad(), and NLPACS::CRetrieverInstance::testExteriorCollision().

00120 { return _Edges[n]; }

const std::vector<CEdge>& NLPACS::CExteriorMesh::getEdges  )  const [inline]
 

Get the set of edges that forms the whole mesh.

Definition at line 117 of file exterior_mesh.h.

Referenced by NLPACS::CEdgeQuad::build(), NLPACS::computeRetriever(), and NLPACS::linkExteriorToInterior().

00117 { return _Edges; }

const CLink& NLPACS::CExteriorMesh::getLink uint  n  )  const [inline]
 

Get a specific link.

Definition at line 133 of file exterior_mesh.h.

References _Links, and uint.

Referenced by NLPACS::CEdgeQuad::build(), NLPACS::CRetrieverInstance::linkEdgeQuad(), and NLPACS::CLocalRetriever::testCollision().

00133 { return _Links[n]; }

CLink NLPACS::CExteriorMesh::getLinkFromEdge uint  edge  )  const [inline]
 

Get the link on a specific edge.

Definition at line 136 of file exterior_mesh.h.

References _Links, and uint.

00136 { return (_Edges[edge].Link != -1) ? _Links[_Edges[edge].Link] : CLink(); }

const std::vector<CLink>& NLPACS::CExteriorMesh::getLinks  )  const [inline]
 

Get the links.

Definition at line 131 of file exterior_mesh.h.

References _Links.

Referenced by NLPACS::CLocalRetriever::testCollision().

00131 { return _Links; }

const COrderedEdges& NLPACS::CExteriorMesh::getOrderedEdges uint  n  )  const [inline]
 

Get the nth set of ordered edges.

Definition at line 127 of file exterior_mesh.h.

References _OrderedEdges, and uint.

00127 { return _OrderedEdges[n]; }

const std::vector<COrderedEdges>& NLPACS::CExteriorMesh::getOrderedEdges  )  const [inline]
 

Get the ordered edges.

Definition at line 124 of file exterior_mesh.h.

References _OrderedEdges.

00124 { return _OrderedEdges; }

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

Serializes the mesh.

Definition at line 98 of file exterior_mesh.cpp.

References _Links, _OrderedEdges, NLMISC::IStream::serial(), NLMISC::IStream::serialCont(), and NLMISC::IStream::serialVersion().

00099         {
00100                 /*
00101                 Version 0:
00102                         - base version.
00103                 */
00104                 (void)f.serialVersion(0);
00105 
00106                 f.serialCont(_Edges);
00107                 f.serialCont(_OrderedEdges);
00108                 f.serialCont(_Links);
00109                 f.serial(_BBox);
00110         }

void NLPACS::CExteriorMesh::setEdges const std::vector< CEdge > &  edges  ) 
 

Set the edges.

Definition at line 62 of file exterior_mesh.cpp.

References _OrderedEdges, NLPACS::CExteriorMesh::COrderedEdges::End, NLPACS::CExteriorMesh::COrderedEdges::Forward, NLPACS::isStrictlyGreater(), NLPACS::isStrictlyLess(), NLPACS::CExteriorMesh::COrderedEdges::Start, and uint.

Referenced by NLPACS::buildExteriorMesh(), and NLPACS::linkExteriorToInterior().

00063         {
00064                 _Edges = edges;
00065                 _OrderedEdges.clear();
00066 
00067                 uint    i;
00068                 for (i=0; i+1<_Edges.size(); )
00069                 {
00070                         _OrderedEdges.resize(_OrderedEdges.size()+1);
00071                         COrderedEdges   &edges = _OrderedEdges.back();
00072                         edges.Start = i;
00073                         if (isStrictlyLess(_Edges[i].Start, _Edges[i+1].Start))
00074                         {
00075                                 edges.Forward = true;
00076                                 do
00077                                 {
00078                                         ++i;
00079                                 }
00080                                 while (i+1<_Edges.size() && _Edges[i].Link != -2 && isStrictlyLess(_Edges[i].Start, _Edges[i+1].Start));
00081                         }
00082                         else
00083                         {
00084                                 edges.Forward = false;
00085                                 do
00086                                 {
00087                                         ++i;
00088                                 }
00089                                 while (i+1<_Edges.size() && _Edges[i].Link != -2 && isStrictlyGreater(_Edges[i].Start, _Edges[i+1].Start));
00090                         }
00091                         edges.End = i;
00092 
00093                         if (_Edges[i].Link == -2)
00094                                 ++i;
00095                 }
00096         }

void NLPACS::CExteriorMesh::setLinks const std::vector< CLink > &  links  )  [inline]
 

Set the links.

Definition at line 152 of file exterior_mesh.h.

References _Links.

Referenced by NLPACS::linkExteriorToInterior().

00152 { _Links = links; }


Field Documentation

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

Definition at line 95 of file exterior_mesh.h.

std::vector<CEdge> NLPACS::CExteriorMesh::_Edges [protected]
 

Definition at line 90 of file exterior_mesh.h.

std::vector<CLink> NLPACS::CExteriorMesh::_Links [protected]
 

Definition at line 93 of file exterior_mesh.h.

Referenced by clear(), getLink(), getLinkFromEdge(), getLinks(), serial(), and setLinks().

std::vector<COrderedEdges> NLPACS::CExteriorMesh::_OrderedEdges [protected]
 

Definition at line 91 of file exterior_mesh.h.

Referenced by clear(), getOrderedEdges(), serial(), and setEdges().


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