<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GEOS: GraphComponent.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>GraphComponent.h</h1> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************************************************</span> <a name="l00002"></a>00002 <span class="comment"> * $Id: GraphComponent.h 2563 2009-06-08 15:43:40Z strk $</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * GEOS - Geometry Engine Open Source</span> <a name="l00005"></a>00005 <span class="comment"> * http://geos.refractions.net</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * Copyright (C) 2001-2002 Vivid Solutions Inc.</span> <a name="l00008"></a>00008 <span class="comment"> * Copyright (C) 2005-2006 Refractions Research Inc.</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * This is free software; you can redistribute and/or modify it under</span> <a name="l00011"></a>00011 <span class="comment"> * the terms of the GNU Lesser General Public Licence as published</span> <a name="l00012"></a>00012 <span class="comment"> * by the Free Software Foundation. </span> <a name="l00013"></a>00013 <span class="comment"> * See the COPYING file for more information.</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> **********************************************************************</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> * Last port: planargraph/GraphComponent.java rev. 1.7 (JTS-1.7)</span> <a name="l00018"></a>00018 <span class="comment"> *</span> <a name="l00019"></a>00019 <span class="comment"> **********************************************************************/</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef GEOS_PLANARGRAPH_GRAPHCOMPONENT_H</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define GEOS_PLANARGRAPH_GRAPHCOMPONENT_H</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <geos/export.h></span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="keyword">namespace </span>geos { <a name="l00027"></a>00027 <span class="keyword">namespace </span>planargraph { <span class="comment">// geos.planargraph</span> <a name="l00028"></a>00028 <a name="l00047"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html">00047</a> <span class="keyword">class </span>GEOS_DLL <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html" title="The base class for all graph component classes.">GraphComponent</a> { <a name="l00048"></a>00048 <a name="l00049"></a>00049 <span class="keyword">protected</span>: <a name="l00050"></a>00050 <a name="l00052"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a9e577ef12e6139e5ade4f7a543250141">00052</a> <span class="keywordtype">bool</span> isMarkedVar; <a name="l00053"></a>00053 <a name="l00055"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#aaec8b2fc9af6093c7921ab1dd9e2fd4b">00055</a> <span class="keywordtype">bool</span> isVisitedVar; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keyword">public</span>: <a name="l00058"></a>00058 <a name="l00059"></a>00059 <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html" title="The base class for all graph component classes.">GraphComponent</a>() <a name="l00060"></a>00060 : <a name="l00061"></a>00061 isMarkedVar(false), <a name="l00062"></a>00062 isVisitedVar(false) <a name="l00063"></a>00063 {} <a name="l00064"></a>00064 <a name="l00065"></a>00065 <span class="keyword">virtual</span> ~<a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html" title="The base class for all graph component classes.">GraphComponent</a>() {}; <a name="l00066"></a>00066 <a name="l00073"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#aede7319ab2fb1d8ed89ed8f59d58d594">00073</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#aede7319ab2fb1d8ed89ed8f59d58d594" title="Tests if a component has been visited during the course of a graph algorithm.">isVisited</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> isVisitedVar; } <a name="l00074"></a>00074 <a name="l00079"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ab72ec2a37b8ae14542098471f05ac147">00079</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ab72ec2a37b8ae14542098471f05ac147" title="Sets the visited flag for this component.">setVisited</a>(<span class="keywordtype">bool</span> isVisited) { isVisitedVar=isVisited; } <a name="l00080"></a>00080 <a name="l00089"></a>00089 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <a name="l00090"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a8ff4b23f0099d27e340f4d11de1f4f82">00090</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a8ff4b23f0099d27e340f4d11de1f4f82" title="Sets the Visited state for the elements of a container, from start to end iterator.">setVisited</a>(T start, T end, <span class="keywordtype">bool</span> visited) { <a name="l00091"></a>00091 <span class="keywordflow">for</span>(T i=start; i!=end; ++i) { <a name="l00092"></a>00092 (*i)->setVisited(visited); <a name="l00093"></a>00093 } <a name="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00104"></a>00104 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <a name="l00105"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a3a552229e72e062862e1a36936f962f5">00105</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a3a552229e72e062862e1a36936f962f5" title="Sets the Visited state for the values of each map container element, from start to end iterator...">setVisitedMap</a>(T start, T end, <span class="keywordtype">bool</span> visited) { <a name="l00106"></a>00106 <span class="keywordflow">for</span>(T i=start; i!=end; ++i) { <a name="l00107"></a>00107 i->second->setVisited(visited); <a name="l00108"></a>00108 } <a name="l00109"></a>00109 } <a name="l00110"></a>00110 <a name="l00119"></a>00119 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <a name="l00120"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a3f576f83191374136c3a20bd1b326ec3">00120</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#a3f576f83191374136c3a20bd1b326ec3" title="Sets the Marked state for the elements of a container, from start to end iterator.">setMarked</a>(T start, T end, <span class="keywordtype">bool</span> marked) { <a name="l00121"></a>00121 <span class="keywordflow">for</span>(T i=start; i!=end; ++i) { <a name="l00122"></a>00122 (*i)->setMarked(marked); <a name="l00123"></a>00123 } <a name="l00124"></a>00124 } <a name="l00125"></a>00125 <a name="l00126"></a>00126 <a name="l00135"></a>00135 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <a name="l00136"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ac16da02a410319c86214a59c140deb86">00136</a> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ac16da02a410319c86214a59c140deb86" title="Sets the Marked state for the values of each map container element, from start to end iterator...">setMarkedMap</a>(T start, T end, <span class="keywordtype">bool</span> marked) { <a name="l00137"></a>00137 <span class="keywordflow">for</span>(T i=start; i!=end; ++i) { <a name="l00138"></a>00138 i->second->setMarked(marked); <a name="l00139"></a>00139 } <a name="l00140"></a>00140 } <a name="l00141"></a>00141 <a name="l00147"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ad65b94ca5210399c42b248d20a475e10">00147</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ad65b94ca5210399c42b248d20a475e10" title="Tests if a component has been marked at some point during the processing involving this graph...">isMarked</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> isMarkedVar; } <a name="l00148"></a>00148 <a name="l00153"></a><a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ac2d86b046fcd76cefaa264d8487f43e2">00153</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classgeos_1_1planargraph_1_1GraphComponent.html#ac2d86b046fcd76cefaa264d8487f43e2" title="Sets the marked flag for this component.">setMarked</a>(<span class="keywordtype">bool</span> isMarked) { isMarkedVar=isMarked; } <a name="l00154"></a>00154 <a name="l00155"></a>00155 }; <a name="l00156"></a>00156 <a name="l00157"></a>00157 <span class="comment">// For backward compatibility</span> <a name="l00158"></a>00158 <span class="comment">//typedef GraphComponent planarGraphComponent;</span> <a name="l00159"></a>00159 <a name="l00160"></a>00160 } <span class="comment">// namespace geos::planargraph</span> <a name="l00161"></a>00161 } <span class="comment">// namespace geos</span> <a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="preprocessor">#endif // GEOS_PLANARGRAPH_GRAPHCOMPONENT_H</span> <a name="l00164"></a>00164 <span class="preprocessor"></span> <a name="l00165"></a>00165 <span class="comment">/**********************************************************************</span> <a name="l00166"></a>00166 <span class="comment"> * $Log$</span> <a name="l00167"></a>00167 <span class="comment"> * Revision 1.1 2006/03/21 21:42:54 strk</span> <a name="l00168"></a>00168 <span class="comment"> * planargraph.h header split, planargraph:: classes renamed to match JTS symbols</span> <a name="l00169"></a>00169 <span class="comment"> *</span> <a name="l00170"></a>00170 <span class="comment"> **********************************************************************/</span> <a name="l00171"></a>00171 </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Jul 22 2010 for GEOS by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>