diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02450.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02450.html | 1539 |
1 files changed, 1539 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02450.html b/docs/doxygen/nel/a02450.html new file mode 100644 index 00000000..cf457a47 --- /dev/null +++ b/docs/doxygen/nel/a02450.html @@ -0,0 +1,1539 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLPACS::CEdgeQuad class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLPACS::CEdgeQuad Class Reference</h1><code>#include <<a class="el" href="a05667.html">edge_quad.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +a quadgrid of list of edge chain. <dl compact><dt><b>Author:</b></dt><dd>Benjamin Legros <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00061">61</a> of file <a class="el" href="a05667.html">edge_quad.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada0">build</a> (const <a class="el" href="a02492.html">CExteriorMesh</a> &em, const <a class="el" href="a02588.html">CGlobalRetriever</a> &global, <a class="el" href="a02387.html">CCollisionSurfaceTemp</a> &cst, <a class="el" href="a04558.html#a11">uint32</a> thisInstance)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">build a chain quad, with a list of exterior Edges and the global retriever <a href="#NLPACS_1_1CEdgeQuada0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada1">CEdgeQuad</a> (const <a class="el" href="a02450.html">CEdgeQuad</a> &o)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy Constructor. <a href="#NLPACS_1_1CEdgeQuada1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada2">CEdgeQuad</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLPACS_1_1CEdgeQuada2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada3">clear</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">clear <a href="#NLPACS_1_1CEdgeQuada3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector< <a class="el" href="a02491.html">CExteriorEdgeEntry</a> > & </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada4">getEdgeEntries</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the whole set of edge entries. <a href="#NLPACS_1_1CEdgeQuada4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02491.html">CExteriorEdgeEntry</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada5">getEdgeEntry</a> (<a class="el" href="a04558.html#a15">uint</a> entry) const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a single edge entry. <a href="#NLPACS_1_1CEdgeQuada5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02450.html">CEdgeQuad</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada6">operator=</a> (const <a class="el" href="a02450.html">CEdgeQuad</a> &o)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">operator=. <a href="#NLPACS_1_1CEdgeQuada6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada7">removeLinks</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada8">removeLinks</a> (<a class="el" href="a04558.html#a10">sint32</a> instanceId)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada9">selectEdges</a> (<a class="el" href="a03128.html">CVector</a> start, <a class="el" href="a03128.html">CVector</a> end, <a class="el" href="a02387.html">CCollisionSurfaceTemp</a> &cst) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a14">sint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada10">selectEdges</a> (const <a class="el" href="a02156.html">NLMISC::CAABBox</a> &bbox, <a class="el" href="a02387.html">CCollisionSurfaceTemp</a> &cst) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada11">serial</a> (<a class="el" href="a02270.html">NLMISC::IStream</a> &f)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">serial. <a href="#NLPACS_1_1CEdgeQuada11"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuada12">~CEdgeQuad</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#NLPACS_1_1CEdgeQuada12"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadd0">getGridBounds</a> (<a class="el" href="a04558.html#a10">sint32</a> &x0, <a class="el" href="a04558.html#a10">sint32</a> &y0, <a class="el" href="a04558.html#a10">sint32</a> &x1, <a class="el" href="a04558.html#a10">sint32</a> &y1, const <a class="el" href="a03128.html">CVector</a> &minP, const <a class="el" href="a03128.html">CVector</a> &maxP) const </td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02491.html">CExteriorEdgeEntry</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The real exterior edge entries. <a href="#NLPACS_1_1CEdgeQuadr0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr1">_Height</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Height of the quadgrid. <a href="#NLPACS_1_1CEdgeQuadr1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a7">uint8</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Single memory block of <a class="el" href="a02491.html">CExteriorEdgeEntry</a> chains. <a href="#NLPACS_1_1CEdgeQuadr3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">size (in byte) of _QuadData. <a href="#NLPACS_1_1CEdgeQuadr4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Width of the quadgrid. <a href="#NLPACS_1_1CEdgeQuadr5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Postion of the chainquad. <a href="#NLPACS_1_1CEdgeQuadr6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a10">sint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Postion of the chainquad. <a href="#NLPACS_1_1CEdgeQuadr7"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Static Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const float </td><td class="memItemRight" valign=bottom><a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a> = 4</td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLPACS_1_1CEdgeQuada2" doxytag="NLPACS::CEdgeQuad::CEdgeQuad" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLPACS::CEdgeQuad::CEdgeQuad </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00044">44</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +<div class="fragment"><pre>00045 { +00046 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00047 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= 0; +00048 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada1" doxytag="NLPACS::CEdgeQuad::CEdgeQuad" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLPACS::CEdgeQuad::CEdgeQuad </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02450.html">CEdgeQuad</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>o</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Copy Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00055">55</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +<div class="fragment"><pre>00056 { +00057 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00058 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= 0; +00059 *<span class="keyword">this</span>= o; +00060 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada12" doxytag="NLPACS::CEdgeQuad::~CEdgeQuad" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLPACS::CEdgeQuad::~<a class="el" href="a02450.html">CEdgeQuad</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Destructor. +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00050">50</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05666.html#l00100">clear()</a>. +<p> +<div class="fragment"><pre>00051 { +00052 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuada3">clear</a>(); +00053 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLPACS_1_1CEdgeQuada0" doxytag="NLPACS::CEdgeQuad::build" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::build </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02492.html">CExteriorMesh</a> & </td> + <td class="mdname" nowrap> <em>em</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02588.html">CGlobalRetriever</a> & </td> + <td class="mdname" nowrap> <em>global</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02387.html">CCollisionSurfaceTemp</a> & </td> + <td class="mdname" nowrap> <em>cst</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname" nowrap> <em>thisInstance</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +build a chain quad, with a list of exterior Edges and the global retriever +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00130">130</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, <a class="el" href="a05578.html#l00106">NLPACS::CCollisionSurfaceDesc::ContactSurface</a>, <a class="el" href="a05578.html#l00103">NLPACS::CCollisionSurfaceDesc::ContactTime</a>, <a class="el" href="a05384.html#l00215">NLMISC::CAABBox::extend()</a>, <a class="el" href="a05693.html#l00117">NLPACS::CExteriorMesh::getEdges()</a>, <a class="el" href="a05666.html#l00115">getGridBounds()</a>, <a class="el" href="a05762.html#l00208">NLPACS::CGlobalRetriever::getInstance()</a>, <a class="el" href="a05693.html#l00133">NLPACS::CExteriorMesh::getLink()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a06338.html#l00176">NLPACS::CRetrieverInstance::getOrigin()</a>, <a class="el" href="a06605.html#l00083">NLPACS::UGlobalPosition::InstanceId</a>, <a class="el" href="a05646.html#l00235">len</a>, <a class="el" href="a06605.html#l00086">NLPACS::UGlobalPosition::LocalPosition</a>, <a class="el" href="a06682.html#l00192">NLMISC::CVector::maxof()</a>, <a class="el" href="a06682.html#l00186">NLMISC::CVector::minof()</a>, <a class="el" href="a05622.html#l00154">nlerror</a>, <a class="el" href="a05622.html#l00111">nlinfo</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05761.html#l00482">NLPACS::CGlobalRetriever::retrievePosition()</a>, <a class="el" href="a05578.html#l00069">NLPACS::CSurfaceIdent::RetrieverInstanceId</a>, <a class="el" href="a05385.html#l00066">NLMISC::CAABBox::setCenter()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a06605.html#l00048">NLPACS::ULocalPosition::Surface</a>, <a class="el" href="a05578.html#l00071">NLPACS::CSurfaceIdent::SurfaceId</a>, <a class="el" href="a05578.html#l00110">NLPACS::TCollisionSurfaceDescVector</a>, <a class="el" href="a05761.html#l01864">NLPACS::CGlobalRetriever::testCylinderMove()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a05981.html#l00100">uint32</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05762.html#l00461">NLPACS::CGlobalRetriever::updateHeight()</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00139">NLPACS::CRetrieverInstance::initEdgeQuad()</a>. +<p> +<div class="fragment"><pre>00134 { +00135 <span class="keyword">const</span> std::vector<CExteriorMesh::CEdge> &edges = em.getEdges(); +00136 +00137 vector< list<uint16> > tempQuad; +00138 <a class="code" href="a04558.html#a14">sint</a> i, j; +00139 +00140 <span class="comment">// first, clear any pr-build.</span> +00141 <a class="code" href="a05378.html#a381">contReset</a>(_Quad); +00142 <span class="keyword">delete</span> [] <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00143 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00144 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= 0; +00145 +00146 <span class="comment">// don't care about the origin of the instance</span> +00147 CVector origin = global.getInstance(thisInstance).getOrigin(); +00148 +00149 <span class="comment">// 0. Find BBox of the grid. Allocate grid.</span> +00150 <span class="comment">//=========================================</span> +00151 <span class="keywordtype">bool</span> first=<span class="keyword">true</span>; +00152 <a class="code" href="a02156.html">CAABBox</a> chainquadBBox; +00153 <span class="comment">// run all chains.</span> +00154 <span class="keywordflow">for</span> (i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)edges.size()-1; i++) +00155 { +00156 <span class="comment">// enlarge bbox.</span> +00157 <span class="keywordflow">if</span> (first) +00158 first= <span class="keyword">false</span>, chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1902_1">setCenter</a>(edges[i].Start); +00159 <span class="keywordflow">else</span> +00160 chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxExtz1902_0">extend</a>(edges[i].Start); +00161 } +00162 +00163 <span class="comment">// compute X,Y,Width, Height.</span> +00164 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>= (<a class="code" href="a04558.html#a10">sint32</a>)floor(chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>().x / <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a>); +00165 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>= (<a class="code" href="a04558.html#a10">sint32</a>)floor(chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>().y / <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a>); +00166 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>= (<a class="code" href="a04558.html#a10">sint32</a>)ceil(chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>().x / <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a>) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>; +00167 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr1">_Height</a>= (<a class="code" href="a04558.html#a10">sint32</a>)ceil(chainquadBBox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>().y / <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a>) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>; +00168 +00169 tempQuad.resize(_Width*_Height); +00170 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.resize(_Width*_Height, NULL); +00171 +00172 +00173 <span class="comment">// 1. For each edge, add them to the quadgrid.</span> +00174 <span class="comment">//=========================================</span> +00175 <span class="comment">// run all chains.</span> +00176 <span class="keywordflow">for</span> (i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)edges.size()-1; i++) +00177 { +00178 <span class="keywordflow">if</span> (edges[i].Link == -2) +00179 <span class="keywordflow">continue</span>; +00180 +00181 <span class="keywordtype">float</span> dnorm = (edges[i+1].Start-edges[i].Start).norm(); +00182 <a class="code" href="a04558.html#a15">uint</a> numStep = (<a class="code" href="a04558.html#a15">uint</a>)(dnorm/0.1f)+1; +00183 <a class="code" href="a04558.html#a15">uint</a> step; +00184 +00185 CVector pbegin = edges[i].Start+origin, +00186 pend = edges[i+1].Start+origin; +00187 +00188 CVector opbegin = edges[i].Start, +00189 opend = edges[i+1].Start; +00190 +00191 <span class="keywordflow">for</span> (step=0; step<numStep; ++step) +00192 { +00193 <span class="keywordtype">float</span> lambda0 = (<span class="keywordtype">float</span>)(step)/(<span class="keywordtype">float</span>)(numStep); +00194 <span class="keywordtype">float</span> lambda1 = (<span class="keywordtype">float</span>)(step+1)/(<span class="keywordtype">float</span>)(numStep); +00195 CVector p0 = pbegin*(1.0f-lambda0)+pend*(lambda0), +00196 p1 = pbegin*(1.0f-lambda1)+pend*(lambda1); +00197 CVector op0 = opbegin*(1.0f-lambda0)+opend*(lambda0), +00198 op1 = opbegin*(1.0f-lambda1)+opend*(lambda1); +00199 CVector s0, s1, +00200 mins, maxs; +00201 +00202 <a class="code" href="a04558.html#a15">uint</a> prevEdge = (i-1)%(edges.size()-1); +00203 <span class="keywordtype">bool</span> prio0 = (edges[i].Link!=-1) || (edges[prevEdge].Link!=-1); +00204 +00205 UGlobalPosition gp0 = global.retrievePosition(p0); +00206 global.updateHeight(gp0); +00207 UGlobalPosition gp1 = global.retrievePosition(p1); +00208 global.updateHeight(gp1); +00209 +00210 <span class="keywordflow">if</span> (!prio0) +00211 { +00212 swap(p0, p1); +00213 swap(op0, op1); +00214 swap(gp0, gp1); +00215 } +00216 +00217 <span class="keywordflow">if</span> (gp0.InstanceId == -1) +00218 { +00219 swap(p0, p1); +00220 swap(op0, op1); +00221 swap(gp0, gp1); +00222 } +00223 +00224 <span class="keyword">const</span> <a class="code" href="a05380.html#a0">TCollisionSurfaceDescVector</a> *pcd = global.testCylinderMove(gp0, p1-p0, 0.01f, cst); +00225 +00226 <span class="keywordflow">if</span> (pcd == NULL) +00227 { +00228 <span class="comment">// nlwarning("in CEdgeQuad::build(): testCylinderMove() returned NULL");</span> +00229 <span class="keywordflow">continue</span>; +00230 } +00231 +00232 <a class="code" href="a05380.html#a0">TCollisionSurfaceDescVector</a> cd = (*pcd); +00233 +00234 <span class="keywordflow">if</span> (edges[i].Link != -1 && cd.size() > 0) +00235 { +00236 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"In NLPACS::CEdgeQuad::build()"</span>); +00237 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"ERROR: exterior edge %d with interior link crosses some surfaces"</span>, i); +00238 cd.clear (); +00239 } +00240 +00241 <span class="comment">// add start surface to the collision description</span> +00242 CCollisionSurfaceDesc stcd; +00243 stcd.ContactTime = 0.0f; +00244 stcd.ContactSurface.RetrieverInstanceId = gp0.InstanceId; +00245 stcd.ContactSurface.SurfaceId = gp0.LocalPosition.Surface; +00246 cd.insert(cd.begin(), stcd); +00247 +00248 <span class="comment">// get the surface, chain ...</span> +00249 <a class="code" href="a04558.html#a14">sint</a> edgeId = i; +00250 <a class="code" href="a04558.html#a9">uint16</a> chainId; +00251 +00252 CSurfaceIdent interior; +00253 <span class="keywordflow">if</span> (edges[i].Link == -1) +00254 { +00255 interior.RetrieverInstanceId = -1; +00256 interior.SurfaceId = -1; +00257 chainId = 0xFFFF; +00258 } +00259 <span class="keywordflow">else</span> +00260 { +00261 interior.RetrieverInstanceId = thisInstance; +00262 interior.SurfaceId = em.getLink(edges[i].Link).SurfaceId; +00263 chainId = em.getLink(edges[i].Link).ChainId; +00264 } +00265 +00266 +00267 <span class="comment">// add end point to the collision description</span> +00268 stcd = cd.back(); +00269 stcd.ContactTime = 1.0f; +00270 cd.push_back(stcd); +00271 +00272 <span class="keywordflow">for</span> (j=0; j<(<a class="code" href="a04558.html#a14">sint</a>)cd.size()-1; ++j) +00273 { +00274 s0 = op0*(<span class="keywordtype">float</span>)(1.0-cd[j].ContactTime) + op1*(<span class="keywordtype">float</span>)(cd[j].ContactTime); +00275 s1 = op0*(<span class="keywordtype">float</span>)(1.0-cd[j+1].ContactTime) + op1*(<span class="keywordtype">float</span>)(cd[j+1].ContactTime); +00276 +00277 mins.minof(s0, s1); +00278 maxs.maxof(s0, s1); +00279 +00280 <span class="comment">// PrecisionPb: extend a little this edge. This is important for special case like borders on zones.</span> +00281 <span class="keywordflow">if</span>(mins.x-maxs.x==0) +00282 mins.x-=0.001f, maxs.x+=0.001f; +00283 <span class="keywordflow">if</span>(mins.y-maxs.y==0) +00284 mins.y-=0.001f, maxs.y+=0.001f; +00285 +00286 <span class="comment">// get bounding coordinate of this edge in the quadgrid.</span> +00287 <a class="code" href="a04558.html#a10">sint32</a> x0, y0, x1, y1; +00288 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>; +00289 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadd0">getGridBounds</a>(x0, y0, x1, y1, mins, maxs); +00290 +00291 CSurfaceIdent exterior = cd[j].ContactSurface; +00292 +00293 <a class="code" href="a04558.html#a15">uint</a> entry; +00294 <span class="keywordflow">for</span> (entry=0; entry<<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.size(); ++entry) +00295 { +00296 <span class="keywordflow">if</span> (<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[entry].EdgeId == edgeId && +00297 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[entry].Exterior == exterior) +00298 { +00299 <span class="keywordflow">if</span> (_EdgeEntries[entry].ChainId != chainId || +00300 _EdgeEntries[entry].Interior != interior) +00301 { +00302 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"In NLPACS::CEdgeQuad::build()"</span>); +00303 <a class="code" href="a04199.html#a3">nlerror</a>(<span class="stringliteral">"exterior edge %d has different interior linkage"</span>, edgeId); +00304 } +00305 +00306 <span class="keywordflow">break</span>; +00307 } +00308 } +00309 +00310 <span class="comment">// if this entry didn't exist before create a new one...</span> +00311 <span class="keywordflow">if</span> (entry == <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.size()) +00312 { +00313 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.push_back(CExteriorEdgeEntry()); +00314 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.back().EdgeId = edgeId; +00315 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.back().ChainId = chainId; +00316 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.back().Interior = interior; +00317 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.back().Exterior = exterior; +00318 } +00319 +00320 <span class="comment">// add this edge to all the quadnode it touches.</span> +00321 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a573">y</a>=y0; <a class="code" href="a04223.html#a573">y</a><y1; <a class="code" href="a04223.html#a573">y</a>++) +00322 { +00323 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a572">x</a>=x0; <a class="code" href="a04223.html#a572">x</a><x1; <a class="code" href="a04223.html#a572">x</a>++) +00324 { +00325 <span class="comment">// check we don't push this entry twice</span> +00326 <a class="code" href="a03889.html">list<uint16></a>::iterator it; +00327 <span class="keywordflow">for</span> (it=tempQuad[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>].begin(); it!=tempQuad[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>].end(); ++it) +00328 <span class="keywordflow">if</span> (entry == *it) +00329 <span class="keywordflow">break</span>; +00330 <span class="keywordflow">if</span> (it == tempQuad[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>].end()) +00331 tempQuad[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>].push_back(entry); +00332 } +00333 } +00334 } +00335 } +00336 +00337 } +00338 +00339 <a class="code" href="a04199.html#a1">nlinfo</a>(<span class="stringliteral">"Built ExteriorEdgeQuad, linked following doors:"</span>); +00340 <span class="keywordflow">for</span> (i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.size(); ++i) +00341 { +00342 <span class="keywordflow">if</span> (edges[<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].EdgeId].Link != -1 && +00343 (_EdgeEntries[i].Interior.RetrieverInstanceId == -1 || _EdgeEntries[i].Interior.SurfaceId == -1 || +00344 _EdgeEntries[i].Exterior.RetrieverInstanceId == -1 || _EdgeEntries[i].Exterior.SurfaceId == -1)) +00345 { +00346 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"In NLPACS::CEdgeQuad::build(): exterior door %d has corrupted link"</span>, i); +00347 } +00348 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (edges[_EdgeEntries[i].EdgeId].Link != -1) +00349 { +00350 <a class="code" href="a04199.html#a1">nlinfo</a>(<span class="stringliteral">"Inst=%d ExtEdge=%d IntInst=%d IntSurf=%d IntChain=%d ExtInst=%d ExtSurf=%d"</span>, thisInstance, _EdgeEntries[i].EdgeId, +00351 _EdgeEntries[i].Interior.RetrieverInstanceId, _EdgeEntries[i].Interior.SurfaceId, _EdgeEntries[i].ChainId, +00352 _EdgeEntries[i].Exterior.RetrieverInstanceId, _EdgeEntries[i].Exterior.SurfaceId); +00353 } +00354 } +00355 +00356 <span class="comment">// 2. Mem optimisation: Use only 1 block for ALL quads of the grid.</span> +00357 <span class="comment">//=========================================</span> +00358 <a class="code" href="a04558.html#a14">sint</a> memSize= 0; +00359 <span class="comment">// run all quads.</span> +00360 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tempQuad.size();i++) +00361 { +00362 <a class="code" href="a03889.html">list<uint16></a> &quadNode= tempQuad[i]; +00363 +00364 <span class="keywordflow">if</span>(!quadNode.empty()) +00365 { +00366 <span class="comment">// add an entry for Len.</span> +00367 memSize+= <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00368 <span class="comment">// add N entry of CEdgeChainEntry.</span> +00369 memSize+= quadNode.size()*<span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00370 } +00371 } +00372 +00373 <span class="comment">// allocate.</span> +00374 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= (<a class="code" href="a04558.html#a7">uint8</a>*)<span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[memSize]; +00375 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= memSize; +00376 +00377 +00378 <span class="comment">// 3. Fill _QuadData with lists.</span> +00379 <span class="comment">//=========================================</span> +00380 <a class="code" href="a04558.html#a7">uint8</a> *ptr= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00381 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tempQuad.size();i++) +00382 { +00383 <a class="code" href="a03889.html">list<uint16></a> &srcQuadNode= tempQuad[i]; +00384 <a class="code" href="a03889.html">list<uint16></a>::iterator it; +00385 +00386 <span class="keywordflow">if</span>(!srcQuadNode.empty()) +00387 { +00388 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[i]= ptr; +00389 +00390 <span class="comment">// write len.</span> +00391 <a class="code" href="a04558.html#a9">uint16</a> <a class="code" href="a04223.html#a571">len</a>= srcQuadNode.size(); +00392 *((<a class="code" href="a04558.html#a9">uint16</a>*)ptr)= <a class="code" href="a04223.html#a571">len</a>; +00393 ptr+= <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00394 +00395 <span class="comment">// add entries.</span> +00396 it= srcQuadNode.begin(); +00397 <span class="keywordflow">for</span>(j=0; j<<a class="code" href="a04223.html#a571">len</a>; j++, it++) +00398 { +00399 *((<a class="code" href="a04558.html#a9">uint16</a> *)ptr)= *it; +00400 ptr+= <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00401 } +00402 } +00403 } +00404 +00405 <span class="comment">// End.</span> +00406 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada3" doxytag="NLPACS::CEdgeQuad::clear" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::clear </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +clear +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00100">100</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00072">NLPACS::CRetrieverInstance::reset()</a>, and <a class="el" href="a05666.html#l00050">~CEdgeQuad()</a>. +<p> +<div class="fragment"><pre>00101 { +00102 <span class="keyword">delete</span> [] <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00103 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00104 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= 0; +00105 +00106 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.clear(); +00107 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.clear(); +00108 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a> = 0; +00109 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr1">_Height</a> = 0; +00110 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a> = 0; +00111 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a> = 0; +00112 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada4" doxytag="NLPACS::CEdgeQuad::getEdgeEntries" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const std::vector<<a class="el" href="a02491.html">CExteriorEdgeEntry</a>>& NLPACS::CEdgeQuad::getEdgeEntries </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the whole set of edge entries. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00104">104</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00152">NLPACS::CRetrieverInstance::linkEdgeQuad()</a>. +<p> +<div class="fragment"><pre>00104 { <span class="keywordflow">return</span> <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada5" doxytag="NLPACS::CEdgeQuad::getEdgeEntry" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const <a class="el" href="a02491.html">CExteriorEdgeEntry</a>& NLPACS::CEdgeQuad::getEdgeEntry </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>entry</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get a single edge entry. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00106">106</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00635">NLPACS::CRetrieverInstance::testExteriorCollision()</a>. +<p> +<div class="fragment"><pre>00106 { <span class="keywordflow">return</span> <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[entry]; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadd0" doxytag="NLPACS::CEdgeQuad::getGridBounds" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::getGridBounds </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> & </td> + <td class="mdname" nowrap> <em>x0</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a10">sint32</a> & </td> + <td class="mdname" nowrap> <em>y0</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a10">sint32</a> & </td> + <td class="mdname" nowrap> <em>x1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a10">sint32</a> & </td> + <td class="mdname" nowrap> <em>y1</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>minP</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>maxP</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const<code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00115">115</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00130">build()</a>, and <a class="el" href="a05666.html#l00410">selectEdges()</a>. +<p> +<div class="fragment"><pre>00116 { +00117 x0= (<a class="code" href="a04558.html#a10">sint32</a>)floor(minP.x / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>; +00118 y0= (<a class="code" href="a04558.html#a10">sint32</a>)floor(minP.y / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>; +00119 x1= (<a class="code" href="a04558.html#a10">sint32</a>) ceil(maxP.x / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>; +00120 y1= (<a class="code" href="a04558.html#a10">sint32</a>) ceil(maxP.y / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>; +00121 x0= max(x0, (<a class="code" href="a04558.html#a10">sint32</a>)0); +00122 y0= max(y0, (<a class="code" href="a04558.html#a10">sint32</a>)0); +00123 x1= <a class="code" href="a04061.html#a0">min</a>(x1, (<a class="code" href="a04558.html#a10">sint32</a>)_Width); +00124 y1= <a class="code" href="a04061.html#a0">min</a>(y1, (<a class="code" href="a04558.html#a10">sint32</a>)_Height); +00125 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada6" doxytag="NLPACS::CEdgeQuad::operator=" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a02450.html">CEdgeQuad</a> & NLPACS::CEdgeQuad::operator= </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02450.html">CEdgeQuad</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>o</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +operator=. +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00062">62</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, <a class="el" href="a05667.html#l00149">_Height</a>, <a class="el" href="a05667.html#l00143">_Quad</a>, <a class="el" href="a05667.html#l00153">_QuadData</a>, <a class="el" href="a05667.html#l00155">_QuadDataLen</a>, <a class="el" href="a05667.html#l00147">_Width</a>, <a class="el" href="a05667.html#l00151">_X</a>, <a class="el" href="a05667.html#l00151">_Y</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +<div class="fragment"><pre>00063 { +00064 <span class="comment">// Alloc good quaddata.</span> +00065 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>= o._QuadDataLen; +00066 <span class="keyword">delete</span> [] <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00067 <span class="keywordflow">if</span>(<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>>0) +00068 { +00069 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= (<a class="code" href="a04558.html#a7">uint8</a>*)<span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>]; +00070 <span class="comment">// copy contents.</span> +00071 memcpy(_QuadData, o._QuadData, _QuadDataLen); +00072 } +00073 <span class="keywordflow">else</span> +00074 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00075 +00076 <span class="comment">// copy infos.</span> +00077 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>= o._Width; +00078 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr1">_Height</a>= o._Height; +00079 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>= o._X; +00080 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>= o._Y; +00081 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a> = o._EdgeEntries; +00082 +00083 <span class="comment">// copy good pointers.</span> +00084 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.clear(); +00085 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.resize(o._Quad.size(), NULL); +00086 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> i=0; i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.size(); i++) +00087 { +00088 <span class="keywordflow">if</span>(o._Quad[i]) +00089 { +00090 <a class="code" href="a04558.html#a11">uint32</a> off= (<a class="code" href="a04558.html#a11">uint32</a>)(o._Quad[i]-o._QuadData); +00091 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[i]= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>+off; +00092 } +00093 } +00094 +00095 +00096 <span class="keywordflow">return</span> *<span class="keyword">this</span>; +00097 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada7" doxytag="NLPACS::CEdgeQuad::removeLinks" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::removeLinks </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00127">127</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>00128 { +00129 <a class="code" href="a04558.html#a15">uint</a> i; +00130 <span class="keywordflow">for</span> (i=0; i<<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.size(); ++i) +00131 { +00132 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].Exterior.RetrieverInstanceId = -1; +00133 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].Exterior.SurfaceId = -1; +00134 } +00135 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada8" doxytag="NLPACS::CEdgeQuad::removeLinks" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::removeLinks </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a10">sint32</a> </td> + <td class="mdname1" valign="top" nowrap> <em>instanceId</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00113">113</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00042">NLPACS::CRetrieverInstance::resetLinks()</a>. +<p> +<div class="fragment"><pre>00114 { +00115 <a class="code" href="a04558.html#a15">uint</a> i; +00116 <span class="keywordflow">for</span> (i=0; i<<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>.size(); ++i) +00117 { +00118 <span class="keywordflow">if</span> (<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].Exterior.RetrieverInstanceId == instanceId) +00119 { +00120 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].Exterior.RetrieverInstanceId = -1; +00121 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr0">_EdgeEntries</a>[i].Exterior.SurfaceId = -1; +00122 } +00123 } +00124 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada9" doxytag="NLPACS::CEdgeQuad::selectEdges" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> NLPACS::CEdgeQuad::selectEdges </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03128.html">CVector</a> </td> + <td class="mdname" nowrap> <em>start</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03128.html">CVector</a> </td> + <td class="mdname" nowrap> <em>end</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02387.html">CCollisionSurfaceTemp</a> & </td> + <td class="mdname" nowrap> <em>cst</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +look in the quad to select a list of chain from a line. NB: The outpout do not contains any redundant edge. An edge appears only one time in the result. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>start</em> </td><td>the starting point of the selection segment. </td></tr> + <tr><td valign=top><em>end</em> </td><td>the ending point of the selection segment. </td></tr> + <tr><td valign=top><em>cst</em> </td><td>the array of <a class="el" href="a02491.html">CExteriorEdgeEntry</a> to fill. contain also OChainLUT, an array for internal use. In: must be filled with 0xFFFF. Out: still filled with 0xFFFF. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>number of exterioredge found. stored in cst.ExteriorEdgeEntries (array cleared first).</dd></dl> + +<p> +Definition at line <a class="el" href="a05666.html#l00465">465</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05583.html#l00288">NLPACS::CCollisionSurfaceTemp::ExteriorEdgeIndexes</a>, <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a05583.html#l00286">NLPACS::CCollisionSurfaceTemp::OChainLUT</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05646.html#l00236">x</a>, <a class="el" href="a06673.html#l00051">NLMISC::CVector::x</a>, <a class="el" href="a05646.html#l00236">y</a>, and <a class="el" href="a06673.html#l00051">NLMISC::CVector::y</a>. +<p> +<div class="fragment"><pre>00466 { +00467 <a class="code" href="a04558.html#a14">sint</a> nRes=0; +00468 <a class="code" href="a04558.html#a14">sint</a> i; +00469 <a class="code" href="a04558.html#a9">uint16</a> *indexLUT= cst.OChainLUT; +00470 +00471 <span class="comment">// start: no edge found.</span> +00472 cst.ExteriorEdgeIndexes.clear(); +00473 +00474 <span class="keywordflow">if</span> (end.x < start.x) +00475 swap(start, end); +00476 +00477 <span class="keywordtype">float</span> minx = <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadv0">_QuadElementSize</a>, +00478 miny = <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>*_QuadElementSize, +00479 maxx = minx + <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>*_QuadElementSize, +00480 maxy = miny + <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr1">_Height</a>*_QuadElementSize; +00481 +00482 <span class="keywordflow">if</span> (start.x > maxx || end.x < minx || start.y > maxy || end.y < miny) +00483 <span class="keywordflow">return</span> nRes; +00484 +00485 <span class="keywordflow">if</span> (start.x < minx) +00486 { +00487 start.y = start.y+(end.y-start.y)*(minx-start.x)/(end.x-start.x); +00488 start.x = minx; +00489 } +00490 +00491 <span class="keywordflow">if</span> (start.y < miny) +00492 { +00493 start.x = start.x+(end.x-start.x)*(miny-start.y)/(end.y-start.y); +00494 start.y = miny; +00495 } +00496 +00497 <span class="keywordflow">if</span> (end.x > maxx) +00498 { +00499 end.y = start.y+(end.y-start.y)*(minx-start.x)/(end.x-start.x); +00500 end.x = maxx; +00501 } +00502 +00503 <span class="keywordflow">if</span> (end.y > maxy) +00504 { +00505 end.x = start.x+(end.x-start.x)*(miny-start.y)/(end.y-start.y); +00506 end.y = maxy; +00507 } +00508 +00509 <a class="code" href="a04558.html#a10">sint32</a> x0, x1, ya, yb; +00510 <a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>, <a class="code" href="a04223.html#a573">y</a>; +00511 <span class="keywordtype">float</span> fx, fxa, fxb, fya, fyb; +00512 +00513 x0 = (<a class="code" href="a04558.html#a10">sint32</a>)floor(start.x / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>; +00514 x1 = (<a class="code" href="a04558.html#a10">sint32</a>)ceil(end.x / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>; +00515 fx = (x0+<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr6">_X</a>)*_QuadElementSize; +00516 +00517 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a572">x</a>=x0; <a class="code" href="a04223.html#a572">x</a><x1; ++<a class="code" href="a04223.html#a572">x</a>) +00518 { +00519 fxa = (fx < start.x) ? start.x : fx; +00520 fxb = (fx+_QuadElementSize > end.x) ? end.x : fx+_QuadElementSize; +00521 +00522 fya = start.y+(end.y-start.y)*(fxa-start.x)/(end.x-start.x); +00523 fyb = start.y+(end.y-start.y)*(fxb-start.x)/(end.x-start.x); +00524 +00525 <span class="keywordflow">if</span> (fya > fyb) +00526 swap (fya, fyb); +00527 +00528 ya = (<a class="code" href="a04558.html#a10">sint32</a>)floor(fya / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>; +00529 yb = (<a class="code" href="a04558.html#a10">sint32</a>)ceil(fyb / _QuadElementSize) - <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr7">_Y</a>; +00530 +00531 fx += _QuadElementSize; +00532 +00533 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a573">y</a>=ya; <a class="code" href="a04223.html#a573">y</a><yb; ++<a class="code" href="a04223.html#a573">y</a>) +00534 { +00535 <a class="code" href="a04558.html#a7">uint8</a> *quadNode= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>]; +00536 +00537 <span class="comment">// no edgechain entry??</span> +00538 <span class="keywordflow">if</span>(!quadNode) +00539 <span class="keywordflow">continue</span>; +00540 +00541 <span class="comment">// get edgechain entries</span> +00542 <a class="code" href="a04558.html#a14">sint</a> numExteriorEdgeIndexes= *((<a class="code" href="a04558.html#a9">uint16</a> *)quadNode); +00543 quadNode+= <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00544 <a class="code" href="a04558.html#a9">uint16</a> *ptrExteriorEdgeIndex = (<a class="code" href="a04558.html#a9">uint16</a> *)quadNode; +00545 +00546 <span class="comment">// For each one, add it to the result list.</span> +00547 <span class="keywordflow">for</span>(i=0;i<numExteriorEdgeIndexes;i++) +00548 { +00549 <a class="code" href="a04558.html#a9">uint16</a> <a class="code" href="a04223.html#a566">index</a> = ptrExteriorEdgeIndex[i]; +00550 +00551 <span class="comment">// if ochain not yet inserted.</span> +00552 <span class="keywordflow">if</span>(indexLUT[<a class="code" href="a04223.html#a566">index</a>]==0xFFFF) +00553 { +00554 <span class="comment">// inc the list.</span> +00555 indexLUT[<a class="code" href="a04223.html#a566">index</a>]= nRes; +00556 cst.ExteriorEdgeIndexes.push_back(ptrExteriorEdgeIndex[i]); +00557 nRes++; +00558 } +00559 } +00560 } +00561 } +00562 +00563 <span class="comment">// reset LUT to 0xFFFF for all ochains selected.</span> +00564 <span class="keywordflow">for</span>(i=0;i<nRes;i++) +00565 indexLUT[cst.ExteriorEdgeIndexes[i]]= 0xFFFF; +00566 +00567 <span class="keywordflow">return</span> nRes; +00568 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada10" doxytag="NLPACS::CEdgeQuad::selectEdges" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a14">sint</a> NLPACS::CEdgeQuad::selectEdges </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02156.html">NLMISC::CAABBox</a> & </td> + <td class="mdname" nowrap> <em>bbox</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02387.html">CCollisionSurfaceTemp</a> & </td> + <td class="mdname" nowrap> <em>cst</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +look in the quad to select a list of chain from a bbox. NB: The outpout do not contains any redundant edge. An edge appears only one time in the result. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>bbox</em> </td><td>the area of interest. </td></tr> + <tr><td valign=top><em>cst</em> </td><td>the array of <a class="el" href="a02491.html">CExteriorEdgeEntry</a> to fill. contain also OChainLUT, an array for internal use. In: must be filled with 0xFFFF. Out: still filled with 0xFFFF. </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>number of exterioredge found. stored in cst.ExteriorEdgeEntries (array cleared first).</dd></dl> + +<p> +Definition at line <a class="el" href="a05666.html#l00410">410</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05583.html#l00288">NLPACS::CCollisionSurfaceTemp::ExteriorEdgeIndexes</a>, <a class="el" href="a05666.html#l00115">getGridBounds()</a>, <a class="el" href="a05385.html#l00087">NLMISC::CAABBox::getMax()</a>, <a class="el" href="a05385.html#l00086">NLMISC::CAABBox::getMin()</a>, <a class="el" href="a05646.html#l00225">index</a>, <a class="el" href="a05583.html#l00286">NLPACS::CCollisionSurfaceTemp::OChainLUT</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05646.html#l00236">x</a>, and <a class="el" href="a05646.html#l00236">y</a>. +<p> +Referenced by <a class="el" href="a06337.html#l00635">NLPACS::CRetrieverInstance::testExteriorCollision()</a>. +<p> +<div class="fragment"><pre>00411 { +00412 <a class="code" href="a04558.html#a14">sint</a> nRes=0; +00413 <a class="code" href="a04558.html#a14">sint</a> i; +00414 <a class="code" href="a04558.html#a9">uint16</a> *indexLUT = cst.OChainLUT; +00415 +00416 <span class="comment">// start: no edge found.</span> +00417 cst.ExteriorEdgeIndexes.clear(); +00418 +00419 <span class="comment">// get bounding coordinate of this bbox in the quadgrid.</span> +00420 <a class="code" href="a04558.html#a10">sint32</a> x0, y0, x1, y1; +00421 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadd0">getGridBounds</a>(x0, y0, x1, y1, bbox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_5">getMin</a>(), bbox.<a class="code" href="a02156.html#NLMISC_1_1CAABBoxz1904_3">getMax</a>()); +00422 +00423 +00424 <span class="comment">// run all intersected quads.</span> +00425 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a573">y</a>= y0; <a class="code" href="a04223.html#a573">y</a><y1; <a class="code" href="a04223.html#a573">y</a>++) +00426 { +00427 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a14">sint</a> <a class="code" href="a04223.html#a572">x</a>= x0; <a class="code" href="a04223.html#a572">x</a><x1; <a class="code" href="a04223.html#a572">x</a>++) +00428 { +00429 <a class="code" href="a04558.html#a7">uint8</a> *quadNode= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[<a class="code" href="a04223.html#a573">y</a>*<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr5">_Width</a>+<a class="code" href="a04223.html#a572">x</a>]; +00430 +00431 <span class="comment">// no edgechain entry??</span> +00432 <span class="keywordflow">if</span>(!quadNode) +00433 <span class="keywordflow">continue</span>; +00434 +00435 <span class="comment">// get edgechain entries</span> +00436 <a class="code" href="a04558.html#a14">sint</a> numExteriorEdgeIndexes= *((<a class="code" href="a04558.html#a9">uint16</a>*)quadNode); +00437 quadNode+= <span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a9">uint16</a>); +00438 <a class="code" href="a04558.html#a9">uint16</a> *ptrExteriorEdgeIndex= (<a class="code" href="a04558.html#a9">uint16</a>*)quadNode; +00439 +00440 <span class="comment">// For each one, add it to the result list.</span> +00441 <span class="keywordflow">for</span> (i=0;i<numExteriorEdgeIndexes;i++) +00442 { +00443 <a class="code" href="a04558.html#a9">uint16</a> <a class="code" href="a04223.html#a566">index</a> = ptrExteriorEdgeIndex[i]; +00444 +00445 <span class="comment">// if ochain not yet inserted.</span> +00446 <span class="keywordflow">if</span> (indexLUT[<a class="code" href="a04223.html#a566">index</a>]==0xFFFF) +00447 { +00448 <span class="comment">// inc the list.</span> +00449 indexLUT[<a class="code" href="a04223.html#a566">index</a>]= nRes; +00450 cst.ExteriorEdgeIndexes.push_back(index); +00451 nRes++; +00452 } +00453 } +00454 } +00455 } +00456 +00457 +00458 <span class="comment">// reset LUT to 0xFFFF for all ochains selected.</span> +00459 <span class="keywordflow">for</span>(i=0;i<nRes;i++) +00460 indexLUT[cst.ExteriorEdgeIndexes[i]]= 0xFFFF; +00461 +00462 <span class="keywordflow">return</span> nRes; +00463 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuada11" doxytag="NLPACS::CEdgeQuad::serial" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLPACS::CEdgeQuad::serial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02270.html">NLMISC::IStream</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>f</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +serial. +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00571">571</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. +<p> +References <a class="el" href="a05667.html#l00145">_EdgeEntries</a>, <a class="el" href="a06463.html#l00064">NLMISC::IStream::isReading()</a>, <a class="el" href="a05646.html#l00235">len</a>, <a class="el" href="a06462.html#l00232">NLMISC::IStream::serial()</a>, <a class="el" href="a06462.html#l00324">NLMISC::IStream::serialCont()</a>, <a class="el" href="a06461.html#l00266">NLMISC::IStream::serialVersion()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00098">uint16</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +<div class="fragment"><pre>00572 { +00573 <span class="comment">/*</span> +00574 <span class="comment"> Version 0:</span> +00575 <span class="comment"> - base version.</span> +00576 <span class="comment"> */</span> +00577 (<span class="keywordtype">void</span>)f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_8">serialVersion</a>(0); +00578 <a class="code" href="a04558.html#a15">uint</a> i; +00579 +00580 <span class="comment">// serial basics.</span> +00581 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(_X, _Y, _Width, _Height, _QuadDataLen); +00582 f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a>(_EdgeEntries); +00583 +00584 <span class="comment">// serial _QuadData.</span> +00585 <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +00586 { +00587 <span class="keyword">delete</span> [] <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00588 <span class="keywordflow">if</span>(<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>>0) +00589 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= (<a class="code" href="a04558.html#a7">uint8</a>*)<span class="keyword">new</span> <a class="code" href="a04558.html#a7">uint8</a>[<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>]; +00590 <span class="keywordflow">else</span> +00591 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>= NULL; +00592 } +00593 <span class="comment">// Since we have only uint16 (see CEdgeChainEntry), serial them in a single block.</span> +00594 <a class="code" href="a04558.html#a9">uint16</a> *ptrQData= (<a class="code" href="a04558.html#a9">uint16</a>*)<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>; +00595 <span class="keywordflow">for</span>(i=0;i<<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr4">_QuadDataLen</a>/2; i++, ptrQData++) +00596 { +00597 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(*ptrQData); +00598 } +00599 +00600 +00601 <span class="comment">// serial _Quad.</span> +00602 std::vector<uint32> offsets; +00603 <a class="code" href="a04558.html#a11">uint32</a> <a class="code" href="a04223.html#a571">len</a>; +00604 <a class="code" href="a04558.html#a11">uint32</a> val; +00605 <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +00606 { +00607 <span class="comment">// len/resize.</span> +00608 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(len); +00609 offsets.resize(len); +00610 <a class="code" href="a05378.html#a381">contReset</a>(_Quad); +00611 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.resize(len); +00612 +00613 <span class="comment">// read offsets -> ptrs.</span> +00614 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a04223.html#a571">len</a>; i++) +00615 { +00616 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(val); +00617 <span class="keywordflow">if</span>(val== 0xFFFFFFFF) +00618 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[i]= NULL; +00619 <span class="keywordflow">else</span> +00620 <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[i]= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>+val; +00621 } +00622 } +00623 <span class="keywordflow">else</span> +00624 { +00625 <span class="comment">// len/resize.</span> +00626 <a class="code" href="a04223.html#a571">len</a>= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>.size(); +00627 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(len); +00628 +00629 <span class="comment">// write offsets.</span> +00630 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a04223.html#a571">len</a>; i++) +00631 { +00632 <a class="code" href="a04558.html#a7">uint8</a> *ptr= <a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr2">_Quad</a>[i]; +00633 <span class="keywordflow">if</span>(ptr==NULL) +00634 val= 0xFFFFFFFF; +00635 <span class="keywordflow">else</span> +00636 val= (<a class="code" href="a04558.html#a11">uint32</a>)(ptr-<a class="code" href="a02450.html#NLPACS_1_1CEdgeQuadr3">_QuadData</a>); +00637 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a>(val); +00638 } +00639 } +00640 +00641 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr0" doxytag="NLPACS::CEdgeQuad::_EdgeEntries" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a02491.html">CExteriorEdgeEntry</a>> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr0">NLPACS::CEdgeQuad::_EdgeEntries</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The real exterior edge entries. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00145">145</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00130">build()</a>, <a class="el" href="a05666.html#l00100">clear()</a>, <a class="el" href="a05667.html#l00104">getEdgeEntries()</a>, <a class="el" href="a05667.html#l00106">getEdgeEntry()</a>, <a class="el" href="a05666.html#l00062">operator=()</a>, <a class="el" href="a05667.html#l00113">removeLinks()</a>, and <a class="el" href="a05666.html#l00571">serial()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr1" doxytag="NLPACS::CEdgeQuad::_Height" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr1">NLPACS::CEdgeQuad::_Height</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Height of the quadgrid. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00149">149</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr2" doxytag="NLPACS::CEdgeQuad::_Quad" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::vector<<a class="el" href="a04558.html#a7">uint8</a>*> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr2">NLPACS::CEdgeQuad::_Quad</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +W*H pointers on array of <a class="el" href="a02491.html">CExteriorEdgeEntry</a> indexes. NULL if no edge in this quad. Each array is 1xuint16(LEN) + LEN*CExteriorEdgeEntryIndex(16 bits). +<p> +Definition at line <a class="el" href="a05667.html#l00143">143</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr3" doxytag="NLPACS::CEdgeQuad::_QuadData" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a7">uint8</a>* <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr3">NLPACS::CEdgeQuad::_QuadData</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Single memory block of <a class="el" href="a02491.html">CExteriorEdgeEntry</a> chains. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00153">153</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr4" doxytag="NLPACS::CEdgeQuad::_QuadDataLen" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr4">NLPACS::CEdgeQuad::_QuadDataLen</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +size (in byte) of _QuadData. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00155">155</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadv0" doxytag="NLPACS::CEdgeQuad::_QuadElementSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const float <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadv0">NLPACS::CEdgeQuad::_QuadElementSize</a> = 4<code> [static, private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05666.html#l00040">40</a> of file <a class="el" href="a05666.html">edge_quad.cpp</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr5" doxytag="NLPACS::CEdgeQuad::_Width" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr5">NLPACS::CEdgeQuad::_Width</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Width of the quadgrid. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00147">147</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr6" doxytag="NLPACS::CEdgeQuad::_X" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr6">NLPACS::CEdgeQuad::_X</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Postion of the chainquad. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00151">151</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLPACS_1_1CEdgeQuadr7" doxytag="NLPACS::CEdgeQuad::_Y" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a10">sint32</a> <a class="el" href="a02450.html#NLPACS_1_1CEdgeQuadr7">NLPACS::CEdgeQuad::_Y</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Postion of the chainquad. +<p> + +<p> +Definition at line <a class="el" href="a05667.html#l00151">151</a> of file <a class="el" href="a05667.html">edge_quad.h</a>. +<p> +Referenced by <a class="el" href="a05666.html#l00062">operator=()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05667.html">edge_quad.h</a><li><a class="el" href="a05666.html">edge_quad.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 14:12:46 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |