diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03735.html | 594 |
1 files changed, 594 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03735.html b/docs/doxygen/nel/a03735.html new file mode 100644 index 00000000..a6ca3b67 --- /dev/null +++ b/docs/doxygen/nel/a03735.html @@ -0,0 +1,594 @@ +<!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: NL3D::CZoneCornerSmoother 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>NL3D::CZoneCornerSmoother Class Reference</h1><code>#include <<a class="el" href="a06765.html">zone_corner_smoother.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A class used to setup CornerSmoothFlag in <a class="el" href="a03057.html">CPatch</a>. NB: it works with a compiled <a class="el" href="a03730.html">CZone</a> (ie added in a landscape, and got with landscape->getZone()). NB: it changes values directly in <a class="el" href="a03057.html">CPatch</a> (which it should not be permitted...), but don't except see the changes in realtime. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <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="a06765.html#l00051">51</a> of file <a class="el" href="a06765.html">zone_corner_smoother.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="a03735.html#NL3D_1_1CZoneCornerSmoothera0">computeAllCornerSmoothFlags</a> (<a class="el" href="a03730.html">CZone</a> *zone, std::vector< <a class="el" href="a03730.html">CZone</a> * > neighborZones)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothera1">CZoneCornerSmoother</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CZoneCornerSmoothera1"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TIdVertexMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">ItIdVertexMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TVertexMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery1">ItVertexMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< const <a class="el" href="a03482.html">CTessVertex</a> *,<br> + <a class="el" href="a04558.html#a14">sint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a04558.html#a14">sint</a>, <a class="el" href="a03736.html">CVertexSmoothInfo</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a></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="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a> (<a class="el" href="a03057.html">CPatch</a> &pa, const <a class="el" href="a03731.html">CZone::CPatchConnect</a> &pc, bool smoothEdge[4], bool cornerOnBind[4])</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a> (<a class="el" href="a04558.html#a15">uint</a> idVert, <a class="el" href="a04558.html#a15">uint</a> corner, bool smoothEdge[4], bool cornerOnBind[4])</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery0" doxytag="NL3D::CZoneCornerSmoother::ItIdVertexMap" ></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"> typedef TIdVertexMap::iterator <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">NL3D::CZoneCornerSmoother::ItIdVertexMap</a><code> [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="a06765.html#l00095">95</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. +<p> +Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery1" doxytag="NL3D::CZoneCornerSmoother::ItVertexMap" ></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"> typedef TVertexMap::iterator <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery1">NL3D::CZoneCornerSmoother::ItVertexMap</a><code> [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="a06765.html#l00092">92</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery2" doxytag="NL3D::CZoneCornerSmoother::TIdVertexMap" ></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"> typedef std::map<const <a class="el" href="a03482.html">CTessVertex</a> *, <a class="el" href="a04558.html#a14">sint</a>> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery2">NL3D::CZoneCornerSmoother::TIdVertexMap</a><code> [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="a06765.html#l00094">94</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothery3" doxytag="NL3D::CZoneCornerSmoother::TVertexMap" ></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"> typedef std::map<<a class="el" href="a04558.html#a14">sint</a>, <a class="el" href="a03736.html">CVertexSmoothInfo</a>> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmoothery3">NL3D::CZoneCornerSmoother::TVertexMap</a><code> [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="a06765.html#l00091">91</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothera1" doxytag="NL3D::CZoneCornerSmoother::CZoneCornerSmoother" ></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"> NL3D::CZoneCornerSmoother::CZoneCornerSmoother </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="a06764.html#l00036">36</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>. +<p> +<div class="fragment"><pre>00037 { +00038 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CZoneCornerSmootherd0" doxytag="NL3D::CZoneCornerSmoother::buildPatchBindInfo" ></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 NL3D::CZoneCornerSmoother::buildPatchBindInfo </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03057.html">CPatch</a> & </td> + <td class="mdname" nowrap> <em>pa</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03731.html">CZone::CPatchConnect</a> & </td> + <td class="mdname" nowrap> <em>pc</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>smoothEdge</em>[4], </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>cornerOnBind</em>[4]</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><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="a06764.html#l00042">42</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>. +<p> +References <a class="el" href="a06165.html#l00038">NL3D::CPatchUVLocator::build()</a>, <a class="el" href="a06155.html#l02213">NL3D::CPatch::getBindNeighbor()</a>, <a class="el" href="a06156.html#l00579">NL3D::CPatch::getSmoothFlag()</a>, <a class="el" href="a06156.html#l00318">NL3D::CPatch::CBindInfo::MultipleBindId</a>, <a class="el" href="a06156.html#l00316">NL3D::CPatch::CBindInfo::MultipleBindNum</a>, <a class="el" href="a06166.html#l00066">NL3D::CPatchUVLocator::sameEdgeOrder()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a06156.html#l00309">NL3D::CPatch::CBindInfo::Zone</a>. +<p> +Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. +<p> +<div class="fragment"><pre>00043 { +00044 <a class="code" href="a04558.html#a15">uint</a> edge, corner; +00045 +00046 <span class="comment">/*</span> +00047 <span class="comment"> Some terminology here: an edge is supposed going from Corner=edge, to corner=(edge+1)&3.</span> +00048 <span class="comment"> eg: edge 0 goes from corner0 to corner1.</span> +00049 <span class="comment"> */</span> +00050 +00051 <span class="keywordflow">for</span>(corner=0; corner<4; corner++) +00052 cornerOnBind[corner]= <span class="keyword">false</span>; +00053 +00054 <span class="comment">// for 4 edges.</span> +00055 <span class="keywordflow">for</span>(edge=0; edge<4; edge++) +00056 { +00057 <span class="comment">// Is this edge smoothed??</span> +00058 smoothEdge[edge]= pa.getSmoothFlag(edge); +00059 +00060 <span class="comment">// build bindInfo.</span> +00061 CPatch::CBindInfo bindInfo; +00062 CPatchUVLocator patchUvLocator; +00063 pa.getBindNeighbor(edge, bindInfo); +00064 <span class="comment">// if neighbor(s) is present.</span> +00065 <span class="keywordflow">if</span>(bindInfo.Zone) +00066 { +00067 patchUvLocator.build(&pa, edge, bindInfo); +00068 <span class="comment">// if not sameEdgeOnOrder (NB: all special cases of bind 1/X X/1 managed :) ), not smoothed!</span> +00069 <span class="keywordflow">if</span>( !patchUvLocator.sameEdgeOrder() ) +00070 smoothEdge[edge]= <span class="keyword">false</span>; +00071 +00072 <span class="comment">// Manage bind 1/4 for the 2 patchs on the center of the bind.</span> +00073 <span class="keywordflow">if</span>(bindInfo.MultipleBindNum==4 && (bindInfo.MultipleBindId==1 || bindInfo.MultipleBindId==2) ) +00074 { +00075 <span class="comment">// easy, this edge starts and ends on a bind...</span> +00076 cornerOnBind[edge]= <span class="keyword">true</span>; +00077 cornerOnBind[(edge+1)&3]= <span class="keyword">true</span>; +00078 } +00079 <span class="comment">// else for case bind 1/2, and for case of patch 0 and patch 3 of the bind 1/4.</span> +00080 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(bindInfo.MultipleBindNum>=2) +00081 { +00082 <span class="comment">// Beware of the mirroring!! (make a draw...)</span> +00083 <span class="comment">/*</span> +00084 <span class="comment"> ----------|-----------</span> +00085 <span class="comment"> | </span> +00086 <span class="comment"> | | </span> +00087 <span class="comment"> 1 | | </span> +00088 <span class="comment"> ^ | v </span> +00089 <span class="comment"> | | </span> +00090 <span class="comment"> | *-----------</span> +00091 <span class="comment"> | | </span> +00092 <span class="comment"> | | | </span> +00093 <span class="comment"> 0 | | </span> +00094 <span class="comment"> | v </span> +00095 <span class="comment"> | </span> +00096 <span class="comment"> ----------|-----------</span> +00097 <span class="comment"> */</span> +00098 <span class="comment">// If we are the patch0 on the neighbor, then we start on a bind, else we ends.</span> +00099 <span class="keywordflow">if</span>(bindInfo.MultipleBindId==0) +00100 cornerOnBind[edge]= <span class="keyword">true</span>; +00101 <span class="keywordflow">else</span> +00102 cornerOnBind[(edge+1)&3]= <span class="keyword">true</span>; +00103 } +00104 +00105 } +00106 } +00107 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmoothera0" doxytag="NL3D::CZoneCornerSmoother::computeAllCornerSmoothFlags" ></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 NL3D::CZoneCornerSmoother::computeAllCornerSmoothFlags </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03730.html">CZone</a> * </td> + <td class="mdname" nowrap> <em>zone</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a03730.html">CZone</a> * > </td> + <td class="mdname" nowrap> <em>neighborZones</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> +the doit method. this Zone and his 8 neighbors should be added into a landscape. this method call setCornerSmoothFlag() on all <a class="el" href="a03057.html">CPatch</a> of the zone. All corner smooth are set to false but if:<ul> +<li>the corner is a vertex on a bind 1/X OR the vertex has exaclty 4 patch around him. AND</li><li>All edges sharing this corner must be smoothed getSmoothFlag()==true. AND</li><li>All edges sharing this corner must be "SameEdgeOrder", ie the patchs sharing this edge must have same number of tiles along this edge.</li></ul> +<p> +This is important for noise computing, and lighting. +<p> +Definition at line <a class="el" href="a06764.html#l00134">134</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>. +<p> +References <a class="el" href="a06760.html#l00306">NL3D::CZone::CPatchConnect::BaseVertices</a>, <a class="el" href="a06764.html#l00042">buildPatchBindInfo()</a>, <a class="el" href="a06156.html#l00659">NL3D::CPatch::getCornerVertex()</a>, <a class="el" href="a06760.html#l00489">NL3D::CZone::getNumPatchs()</a>, <a class="el" href="a06760.html#l00507">NL3D::CZone::getPatchConnect()</a>, <a class="el" href="a06765.html#l00100">IdVertexMap</a>, <a class="el" href="a06765.html#l00095">ItIdVertexMap</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06765.html#l00077">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::NPatchShared</a>, <a class="el" href="a06158.html#l00951">NL3D::CPatch::setCornerSmoothFlag()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a06765.html#l00079">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::Smoothed</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06764.html#l00111">updateVertex()</a>, <a class="el" href="a06765.html#l00099">VertexMap</a>, and <a class="el" href="a06765.html#l00078">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::VertexOnBind</a>. +<p> +<div class="fragment"><pre>00135 { +00136 <a class="code" href="a04199.html#a6">nlassert</a>(zone); +00137 <a class="code" href="a04558.html#a14">sint</a> npatchs= zone->getNumPatchs(); +00138 <a class="code" href="a04558.html#a14">sint</a> i; +00139 +00140 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>.clear(); +00141 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.clear(); +00142 +00143 <span class="comment">// for all patchs of the center zone, build the vertexMap.</span> +00144 <span class="comment">//==================</span> +00145 <span class="keywordflow">for</span>(i=0; i<npatchs; i++) +00146 { +00147 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)zone)->getPatch(i)); +00148 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(zone->getPatchConnect(i)); +00149 <a class="code" href="a04558.html#a15">uint</a> corner; +00150 +00151 <span class="comment">// build bind info for 4 edges and 4 vertices.</span> +00152 <span class="keywordtype">bool</span> smoothEdge[4]; +00153 <span class="keywordtype">bool</span> cornerOnBind[4]; +00154 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a>(pa, pc, smoothEdge, cornerOnBind); +00155 +00156 <span class="comment">// for 4 corners.</span> +00157 <span class="keywordflow">for</span>(corner=0; corner<4; corner++) +00158 { +00159 <span class="comment">// get the vertex id for this patch.</span> +00160 <a class="code" href="a04558.html#a15">uint</a> idVert= pc.BaseVertices[corner]; +00161 +00162 <span class="comment">// update this vertex smooth info.</span> +00163 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a>(idVert, corner, smoothEdge, cornerOnBind); +00164 +00165 <span class="comment">// for Bind with neighbor zones, must insert it in the map CTessVertex* -> VertexId.</span> +00166 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>[pa.getCornerVertex(corner)]= idVert; +00167 } +00168 } +00169 +00170 +00171 <span class="comment">// for all patchs of all neigbhors zone, update for vertices that are connected to the centerZone.</span> +00172 <span class="comment">//==================</span> +00173 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> nbZone=0; nbZone<neighborZones.size(); nbZone++) +00174 { +00175 CZone *neighborZone= neighborZones[nbZone]; +00176 <a class="code" href="a04199.html#a6">nlassert</a>(neighborZone); +00177 <span class="keywordflow">for</span>(i=0; i<neighborZone->getNumPatchs(); i++) +00178 { +00179 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)neighborZone)->getPatch(i)); +00180 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(neighborZone->getPatchConnect(i)); +00181 <a class="code" href="a04558.html#a15">uint</a> corner; +00182 +00183 <span class="comment">// build bind info for 4 edges and 4 vertices.</span> +00184 <span class="keywordtype">bool</span> smoothEdge[4]; +00185 <span class="keywordtype">bool</span> cornerOnBind[4]; +00186 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd0">buildPatchBindInfo</a>(pa, pc, smoothEdge, cornerOnBind); +00187 +00188 <span class="comment">// for 4 corners.</span> +00189 <span class="keywordflow">for</span>(corner=0; corner<4; corner++) +00190 { +00191 <span class="comment">// try to find the vertex of the centerZone binded to this corner.</span> +00192 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmoothery0">ItIdVertexMap</a> it= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.find(pa.getCornerVertex(corner)); +00193 +00194 <span class="comment">// If this patch is binded on a vertex of the centerZone, must update this vertex.</span> +00195 <span class="keywordflow">if</span>(it != <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">IdVertexMap</a>.end()) +00196 { +00197 <span class="comment">// get the vertex id for this patch.</span> +00198 <a class="code" href="a04558.html#a15">uint</a> idVert= it->second; +00199 +00200 <span class="comment">// update this vertex smooth info.</span> +00201 <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherd1">updateVertex</a>(idVert, corner, smoothEdge, cornerOnBind); +00202 } +00203 +00204 } +00205 } +00206 } +00207 +00208 +00209 <span class="comment">// for all patchs of the center zone, build the finalSmooth.</span> +00210 <span class="comment">//==================</span> +00211 <span class="keywordflow">for</span>(i=0; i<npatchs; i++) +00212 { +00213 CPatch &pa= (CPatch&)*(((<span class="keyword">const</span> CZone*)zone)->getPatch(i)); +00214 <span class="keyword">const</span> CZone::CPatchConnect &pc= *(zone->getPatchConnect(i)); +00215 <a class="code" href="a04558.html#a15">uint</a> corner; +00216 +00217 <span class="comment">// for 4 corners.</span> +00218 <span class="keywordflow">for</span>(corner=0; corner<4; corner++) +00219 { +00220 <a class="code" href="a04558.html#a15">uint</a> idVert= pc.BaseVertices[corner]; +00221 <span class="comment">// get from map.</span> +00222 CVertexSmoothInfo &vert= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>[idVert]; +00223 +00224 <span class="comment">// the vertex is smoothed if all edges around him are smoothed, AND</span> +00225 <span class="comment">// if it has 4 patchs around him or if it is a bind.</span> +00226 <span class="keywordtype">bool</span> finalSmooth; +00227 finalSmooth= vert.Smoothed && (vert.VertexOnBind || vert.NPatchShared==4); +00228 +00229 <span class="comment">// update the patch.</span> +00230 pa.setCornerSmoothFlag(corner, finalSmooth); +00231 } +00232 +00233 } +00234 +00235 +00236 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmootherd1" doxytag="NL3D::CZoneCornerSmoother::updateVertex" ></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 NL3D::CZoneCornerSmoother::updateVertex </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="mdname" nowrap> <em>idVert</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>corner</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>smoothEdge</em>[4], </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>cornerOnBind</em>[4]</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><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="a06764.html#l00111">111</a> of file <a class="el" href="a06764.html">zone_corner_smoother.cpp</a>. +<p> +References <a class="el" href="a06765.html#l00077">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::NPatchShared</a>, <a class="el" href="a06765.html#l00079">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::Smoothed</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06765.html#l00099">VertexMap</a>, and <a class="el" href="a06765.html#l00078">NL3D::CZoneCornerSmoother::CVertexSmoothInfo::VertexOnBind</a>. +<p> +Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. +<p> +<div class="fragment"><pre>00112 { +00113 <span class="comment">// get or insert into map (with default).</span> +00114 CVertexSmoothInfo &vert= <a class="code" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">VertexMap</a>[idVert]; +00115 +00116 <span class="comment">// inc the number of patch binded to this point.</span> +00117 vert.NPatchShared++; +00118 +00119 <span class="comment">// get the smooth flag of edge before and after this corner.</span> +00120 <a class="code" href="a04558.html#a15">uint</a> e0= (4+corner-1)&3; +00121 <a class="code" href="a04558.html#a15">uint</a> e1= corner; +00122 <span class="comment">// if any one of those edge is not smoothed, then this vertex is not smoothed.</span> +00123 <span class="keywordflow">if</span>( !smoothEdge[e0] || !smoothEdge[e1] ) +00124 vert.Smoothed= <span class="keyword">false</span>; +00125 +00126 +00127 <span class="comment">// Are we a vertex on a bind??</span> +00128 <span class="keywordflow">if</span>(cornerOnBind[corner]) +00129 vert.VertexOnBind= <span class="keyword">true</span>; +00130 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CZoneCornerSmootherr0" doxytag="NL3D::CZoneCornerSmoother::IdVertexMap" ></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="a03735.html#NL3D_1_1CZoneCornerSmoothery2">TIdVertexMap</a> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr0">NL3D::CZoneCornerSmoother::IdVertexMap</a><code> [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="a06765.html#l00100">100</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. +<p> +Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CZoneCornerSmootherr1" doxytag="NL3D::CZoneCornerSmoother::VertexMap" ></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="a03735.html#NL3D_1_1CZoneCornerSmoothery3">TVertexMap</a> <a class="el" href="a03735.html#NL3D_1_1CZoneCornerSmootherr1">NL3D::CZoneCornerSmoother::VertexMap</a><code> [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="a06765.html#l00099">99</a> of file <a class="el" href="a06765.html">zone_corner_smoother.h</a>. +<p> +Referenced by <a class="el" href="a06764.html#l00134">computeAllCornerSmoothFlags()</a>, and <a class="el" href="a06764.html#l00111">updateVertex()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06765.html">zone_corner_smoother.h</a><li><a class="el" href="a06764.html">zone_corner_smoother.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:34:16 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> |