Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > eebc325dc36bd6e3b09b9b45133e42f8 > files > 2150

HippoDraw-devel-docs-1.21.1-10.fc13.i686.rpm

<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>HippoDraw Class Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="hippoApp.ico">
</head><body>
<!-- Generated by Doxygen 1.6.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_d71d549033b3d00bbeb107001643b90a.html">xml</a>
  </div>
</div>
<div class="contents">
<h1>TupleCutXML.cxx</h1><a href="TupleCutXML_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00012"></a>00012 <span class="comment">// for iterator member defect</span>
<a name="l00013"></a>00013 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#include &quot;msdevstudio/MSconfig.h&quot;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#endif</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &quot;<a class="code" href="TupleCutXML_8h.html" title="TupleCutXML class interface.">TupleCutXML.h</a>&quot;</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="XmlController_8h.html" title="XmlController class interface.">XmlController.h</a>&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &quot;<a class="code" href="XmlDocument_8h.html" title="XmlDocument class interface.">XmlDocument.h</a>&quot;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="XmlElement_8h.html" title="XmlElement class interface.">XmlElement.h</a>&quot;</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="TupleCut_8h.html" title="hippodraw::TupleCut class interface">datasrcs//TupleCut.h</a>&quot;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;cassert&gt;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">using namespace </span>hippodraw;
<a name="l00028"></a>00028 
<a name="l00029"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#a6a8b3e442f042ea9e40afa222b8afa2f">00029</a> TupleCutXML::TupleCutXML ( <a class="code" href="classhippodraw_1_1XmlController.html" title="A base class that is the interface between GUI and the XML serialization and deserialization...">XmlController</a> * controller )
<a name="l00030"></a>00030   : <a class="code" href="classhippodraw_1_1BaseXML.html" title="A base class of XML element controllers.">BaseXML</a> ( <span class="stringliteral">&quot;TupleCut&quot;</span>, controller ),
<a name="l00031"></a>00031     m_low ( <span class="stringliteral">&quot;low&quot;</span> ),
<a name="l00032"></a>00032     m_high ( <span class="stringliteral">&quot;high&quot;</span> ),
<a name="l00033"></a>00033     m_invert ( <span class="stringliteral">&quot;invert&quot;</span> ),
<a name="l00034"></a>00034     m_column ( <span class="stringliteral">&quot;column&quot;</span> ),
<a name="l00035"></a>00035     m_dim ( <span class="stringliteral">&quot;dimension&quot;</span> ),
<a name="l00036"></a>00036     m_axis ( <span class="stringliteral">&quot;axis&quot;</span> )
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 }
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> *
<a name="l00041"></a>00041 <a class="code" href="classhippodraw_1_1BaseXML.html#afa1d42a894a8739e0d120ed9c4383d38" title="Creates a new element node.">TupleCutXML::</a>
<a name="l00042"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#ae2d9c3e359897002d0357b07f5693eec">00042</a> <a class="code" href="classhippodraw_1_1BaseXML.html#afa1d42a894a8739e0d120ed9c4383d38" title="Creates a new element node.">createElement</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i, <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> &amp; cut )
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044   <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * tag = <a class="code" href="classhippodraw_1_1BaseXML.html#afa1d42a894a8739e0d120ed9c4383d38" title="Creates a new element node.">BaseXML::createElement</a> ();
<a name="l00045"></a>00045 
<a name="l00046"></a>00046   <span class="keyword">const</span> <span class="keywordtype">void</span> * addr = reinterpret_cast &lt; <span class="keyword">const</span> <span class="keywordtype">void</span> * &gt; ( &amp; cut );
<a name="l00047"></a>00047   <span class="keywordtype">int</span> <span class="keywordtype">id</span> = <a class="code" href="classhippodraw_1_1BaseXML.html#ae50d78be58d5938b4434515f4f037ece" title="The singleton XML controller object.">m_controller</a> -&gt; getId ( addr );
<a name="l00048"></a>00048   <a class="code" href="classhippodraw_1_1BaseXML.html#aba09fa4e77f2c85cc12df1116cb5f31e" title="Sets the unique identification of the object.">setId</a> ( *tag, <span class="keywordtype">id</span> );
<a name="l00049"></a>00049 
<a name="l00050"></a>00050   tag -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a74a4adfdadd3ccbcb8b7a76bf9706b68" title="The number of dimension attribute name.">m_dim</a>, -1 ); <span class="comment">// to flag not obsolete TupleCut</span>
<a name="l00051"></a>00051   <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * element 
<a name="l00052"></a>00052     = <a class="code" href="classhippodraw_1_1XmlController.html#a88c79c54a5590febd08ff65135a4a17d" title="The current document being generated or read.">XmlController::m_xml_doc</a> -&gt; <a class="code" href="classhippodraw_1_1BaseXML.html#afa1d42a894a8739e0d120ed9c4383d38" title="Creates a new element node.">createElement</a> ( <span class="stringliteral">&quot;TupleCutAxis&quot;</span> );
<a name="l00053"></a>00053   element -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a3d53f427a722775ec41ae83421fe5fa2" title="The axis attribute name.">m_axis</a>, i );
<a name="l00054"></a>00054 
<a name="l00055"></a>00055   <span class="keywordtype">int</span> tmp = cut.<a class="code" href="classhippodraw_1_1TupleCut.html#aea97b4984052ef147b95bb435d8c5a80" title="Returns the state of the inversion for the axis.">getInversion</a> () ? 1 : 0;
<a name="l00056"></a>00056   element -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#af8a91ea8806e992b9ca786b9a2b63a0d" title="The inversion attribute name.">m_invert</a>, tmp );
<a name="l00057"></a>00057 
<a name="l00058"></a>00058   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1Range.html" title="Expresses a range of values.">Range</a> &amp; range = cut.<a class="code" href="classhippodraw_1_1TupleCut.html#a401b9ceaf58d9b40bb1a926067d1d74f" title="Returns a reference to the range for each dimension.">getRange</a> ();
<a name="l00059"></a>00059   element -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a3f2cec569d47e147250bc4baaf222076" title="The low end of Range attribute name.">m_low</a>,  range.<a class="code" href="classhippodraw_1_1Range.html#a3865c37c86de4e4eafc43b6b40ef05b9" title="Returns the minimum of the range object.">low</a>()  );
<a name="l00060"></a>00060   element -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#ae243830d7acb4a0cca6ab1a5a9e2b438" title="The high end of Range attribute name.">m_high</a>, range.<a class="code" href="classhippodraw_1_1Range.html#a10f7231db7f0fe0855fc344e98575714" title="Returns the maximum of the range object.">high</a>() );
<a name="l00061"></a>00061 
<a name="l00062"></a>00062   <span class="keywordtype">int</span> col = cut.<a class="code" href="classhippodraw_1_1TupleCut.html#a0035603802c53109ab0581ac39239932" title="Returns the column index used in the DataSource.">getColumn</a> ( );
<a name="l00063"></a>00063   element -&gt; setAttribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a48c34bfc5f91264c28760fefd10e8d20" title="The column index attribute name.">m_column</a>, col );
<a name="l00064"></a>00064 
<a name="l00065"></a>00065   tag -&gt; appendChild ( *element );
<a name="l00066"></a>00066   <span class="keyword">delete</span> element;
<a name="l00067"></a>00067 
<a name="l00068"></a>00068   <span class="keywordflow">return</span> tag;
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070 
<a name="l00071"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#a65f5e7afa289a0bef9fe415b538598f7">00071</a> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * <a class="code" href="classhippodraw_1_1TupleCutXML.html#a65f5e7afa289a0bef9fe415b538598f7" title="Creates an TupleCut object and sets its properties from the XmlElement.">TupleCutXML::getObject</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> &amp; tag )<span class="keyword"> const</span>
<a name="l00072"></a>00072 <span class="keyword"></span>{
<a name="l00073"></a>00073   <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * cut = 0; <span class="comment">// will create one of correct dim in function below</span>
<a name="l00074"></a>00074   <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6c9ed8a6e9820910a1e4dc7d02f1257b" title="Sets the attributes of the TupleCut object plotter from the information in the XmlElement...">setAttributes</a> ( cut, &amp;tag );
<a name="l00075"></a>00075 
<a name="l00076"></a>00076   <span class="keywordflow">return</span> cut; 
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078 
<a name="l00081"></a>00081 <span class="keywordtype">void</span>
<a name="l00082"></a>00082 <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">TupleCutXML::</a>
<a name="l00083"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0">00083</a> <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">setAxisAttributes</a> ( <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * cut,
<a name="l00084"></a>00084                     <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7" title="Axes constants.">hippodraw::Axes::Type</a>,
<a name="l00085"></a>00085                     <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * element )<span class="keyword"> const</span>
<a name="l00086"></a>00086 <span class="keyword"></span>{
<a name="l00087"></a>00087   <span class="keywordtype">int</span> value;
<a name="l00088"></a>00088   <span class="keywordtype">bool</span> ok = element-&gt;<a class="code" href="classhippodraw_1_1XmlElement.html#afa83a3518bac3d6ae2bc519084071fad" title="Sets value to the attribute name&amp;#39;s value.">attribute</a> ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#af8a91ea8806e992b9ca786b9a2b63a0d" title="The inversion attribute name.">m_invert</a>, value );
<a name="l00089"></a>00089   <span class="keywordflow">if</span> ( ok &amp;&amp; ( value == 1 ) )  cut -&gt; setInversion( <span class="keyword">true</span> );
<a name="l00090"></a>00090 
<a name="l00091"></a>00091   <span class="keywordtype">double</span> low = 0.0;
<a name="l00092"></a>00092   ok = element-&gt;<a class="code" href="classhippodraw_1_1XmlElement.html#afa83a3518bac3d6ae2bc519084071fad" title="Sets value to the attribute name&amp;#39;s value.">attribute</a>( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a3f2cec569d47e147250bc4baaf222076" title="The low end of Range attribute name.">m_low</a>, low );
<a name="l00093"></a>00093   <span class="keywordtype">double</span> high = 0.0;
<a name="l00094"></a>00094   ok = element-&gt;<a class="code" href="classhippodraw_1_1XmlElement.html#afa83a3518bac3d6ae2bc519084071fad" title="Sets value to the attribute name&amp;#39;s value.">attribute</a>( <a class="code" href="classhippodraw_1_1TupleCutXML.html#ae243830d7acb4a0cca6ab1a5a9e2b438" title="The high end of Range attribute name.">m_high</a>, high );
<a name="l00095"></a>00095 
<a name="l00096"></a>00096   <a class="code" href="classhippodraw_1_1Range.html" title="Expresses a range of values.">Range</a> range ( low, high );
<a name="l00097"></a>00097 
<a name="l00098"></a>00098   cut-&gt;<a class="code" href="classhippodraw_1_1TupleCut.html#a1c320b45450e1172b1b079f03664d3ef" title="Sets the range of the cut.">setRange</a>( range );
<a name="l00099"></a>00099 
<a name="l00100"></a>00100   <span class="keywordtype">int</span> col = -2;
<a name="l00101"></a>00101   ok = element-&gt;<a class="code" href="classhippodraw_1_1XmlElement.html#afa83a3518bac3d6ae2bc519084071fad" title="Sets value to the attribute name&amp;#39;s value.">attribute</a> ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a48c34bfc5f91264c28760fefd10e8d20" title="The column index attribute name.">m_column</a>, col );
<a name="l00102"></a>00102   cut-&gt;<a class="code" href="classhippodraw_1_1TupleCut.html#aa4204fa6fd749b0f3717e6f6feba816e" title="Sets the column in the DataSource to be used.">setColumn</a>( col );
<a name="l00103"></a>00103 }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105 <span class="keywordtype">bool</span>
<a name="l00106"></a>00106 <a class="code" href="classhippodraw_1_1TupleCutXML.html#ab30cf435a2c7e6950c3649b96006ebce" title="Returns true if element contains old style NTuple, i.e.">TupleCutXML::</a>
<a name="l00107"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#ab30cf435a2c7e6950c3649b96006ebce">00107</a> <a class="code" href="classhippodraw_1_1TupleCutXML.html#ab30cf435a2c7e6950c3649b96006ebce" title="Returns true if element contains old style NTuple, i.e.">hasMultiDimTupleCut</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * element )<span class="keyword"> const</span>
<a name="l00108"></a>00108 <span class="keyword"></span>{
<a name="l00109"></a>00109   <span class="keywordtype">bool</span> yes = <span class="keyword">true</span>;
<a name="l00110"></a>00110   <span class="keywordtype">int</span> dim;
<a name="l00111"></a>00111   <span class="keywordtype">bool</span> ok = element -&gt; attribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a74a4adfdadd3ccbcb8b7a76bf9706b68" title="The number of dimension attribute name.">m_dim</a>, dim );
<a name="l00112"></a>00112   <span class="keywordflow">if</span> ( ok &amp;&amp; dim &lt; 0 ) yes = <span class="keyword">false</span>;
<a name="l00113"></a>00113 
<a name="l00114"></a>00114   <span class="keywordflow">return</span> yes;
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="keywordtype">void</span>
<a name="l00118"></a>00118 <a class="code" href="classhippodraw_1_1TupleCutXML.html#a4b0ff4374a1371d38a0bd3ab55275363" title="Creates TupleCut objects from old style multidimensional TupleCut.">TupleCutXML::</a>
<a name="l00119"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#a4b0ff4374a1371d38a0bd3ab55275363">00119</a> <a class="code" href="classhippodraw_1_1TupleCutXML.html#a4b0ff4374a1371d38a0bd3ab55275363" title="Creates TupleCut objects from old style multidimensional TupleCut.">getObjects</a> ( <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * element, std::vector &lt;TupleCut * &gt; &amp; cuts )
<a name="l00120"></a>00120 {
<a name="l00121"></a>00121   <span class="keywordtype">int</span> dim;
<a name="l00122"></a>00122   <span class="keywordtype">bool</span> ok = element -&gt; attribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a74a4adfdadd3ccbcb8b7a76bf9706b68" title="The number of dimension attribute name.">m_dim</a>, dim );
<a name="l00123"></a>00123   <span class="keywordflow">if</span> ( ! ok ) { <span class="comment">// very old documents forgot the Y axis </span>
<a name="l00124"></a>00124     <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * cut = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> ();
<a name="l00125"></a>00125     <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">setAxisAttributes</a> ( cut, <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a>, element );
<a name="l00126"></a>00126     cuts.push_back ( cut );
<a name="l00127"></a>00127   }
<a name="l00128"></a>00128   <span class="keywordflow">else</span> { <span class="comment">// multidemension style</span>
<a name="l00129"></a>00129     <a class="code" href="classhippodraw_1_1XmlElement.html#aa8a1870e639225c355d8fd36b03500e7" title="The type of container used to store XmlElement nodes.">XmlElement::NodeList_t</a> nodelist;
<a name="l00130"></a>00130     element -&gt; <a class="code" href="classhippodraw_1_1BaseXML.html#a5341ca7744d304c2746a8f5564ce237b" title="Fills the nodelist with immediate child nodes of element with nodes that can be handled...">fillNodeList</a> ( <span class="stringliteral">&quot;TupleCutAxis&quot;</span>, nodelist );
<a name="l00131"></a>00131     assert ( nodelist.empty () == false );
<a name="l00132"></a>00132     XmlElement::NodeList_t::const_iterator first = nodelist.begin();
<a name="l00133"></a>00133 
<a name="l00134"></a>00134     <span class="keywordflow">while</span> ( first != nodelist.end() ) {
<a name="l00135"></a>00135       <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * node = *first++;
<a name="l00136"></a>00136       <span class="keywordtype">int</span> axis;
<a name="l00137"></a>00137       <span class="keywordtype">bool</span> ok = node -&gt; attribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a3d53f427a722775ec41ae83421fe5fa2" title="The axis attribute name.">m_axis</a>, axis );
<a name="l00138"></a>00138       assert ( ok );
<a name="l00139"></a>00139       <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7" title="Axes constants.">Axes::Type</a> axis_t = axis == 0 ? <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a> : <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>;
<a name="l00140"></a>00140       <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * cut = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> ();
<a name="l00141"></a>00141       <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">setAxisAttributes</a> ( cut, axis_t, node );
<a name="l00142"></a>00142       cuts.push_back ( cut );
<a name="l00143"></a>00143     }
<a name="l00144"></a>00144   }
<a name="l00145"></a>00145 }
<a name="l00146"></a>00146 
<a name="l00147"></a><a class="code" href="classhippodraw_1_1TupleCutXML.html#a6c9ed8a6e9820910a1e4dc7d02f1257b">00147</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6c9ed8a6e9820910a1e4dc7d02f1257b" title="Sets the attributes of the TupleCut object plotter from the information in the XmlElement...">TupleCutXML::setAttributes</a> ( <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> * &amp; cut,
<a name="l00148"></a>00148                                   <span class="keyword">const</span> <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * element )<span class="keyword"> const</span>
<a name="l00149"></a>00149 <span class="keyword"></span>{
<a name="l00150"></a>00150   <span class="keywordtype">int</span> dim;
<a name="l00151"></a>00151   <span class="keywordtype">bool</span> ok = element-&gt;<a class="code" href="classhippodraw_1_1XmlElement.html#afa83a3518bac3d6ae2bc519084071fad" title="Sets value to the attribute name&amp;#39;s value.">attribute</a> ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a74a4adfdadd3ccbcb8b7a76bf9706b68" title="The number of dimension attribute name.">m_dim</a>, dim );
<a name="l00152"></a>00152 
<a name="l00153"></a>00153   <span class="keywordflow">if</span> ( ! ok ) { <span class="comment">// older documents forgot Y axis</span>
<a name="l00154"></a>00154     cut = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> ();
<a name="l00155"></a>00155     <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">setAxisAttributes</a> ( cut, <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a>, element );
<a name="l00156"></a>00156   }
<a name="l00157"></a>00157   <span class="keywordflow">else</span> { <span class="comment">// new style</span>
<a name="l00158"></a>00158     cut = <span class="keyword">new</span> <a class="code" href="classhippodraw_1_1TupleCut.html" title="The class expresses a cut on a DataSource, i.e.">TupleCut</a> ( );
<a name="l00159"></a>00159     <a class="code" href="classhippodraw_1_1XmlElement.html#aa8a1870e639225c355d8fd36b03500e7" title="The type of container used to store XmlElement nodes.">XmlElement::NodeList_t</a> nodelist;
<a name="l00160"></a>00160     element -&gt; <a class="code" href="classhippodraw_1_1BaseXML.html#a5341ca7744d304c2746a8f5564ce237b" title="Fills the nodelist with immediate child nodes of element with nodes that can be handled...">fillNodeList</a> ( <span class="stringliteral">&quot;TupleCutAxis&quot;</span>, nodelist );
<a name="l00161"></a>00161     assert ( nodelist.empty () == false );
<a name="l00162"></a>00162     XmlElement::NodeList_t::const_iterator first = nodelist.begin();
<a name="l00163"></a>00163 
<a name="l00164"></a>00164     <span class="keywordflow">while</span> ( first != nodelist.end() ) {
<a name="l00165"></a>00165       <a class="code" href="classhippodraw_1_1XmlElement.html" title="A pure virtual base class of XML element wrapper.">XmlElement</a> * node = *first++;
<a name="l00166"></a>00166       <span class="keywordtype">int</span> axis;
<a name="l00167"></a>00167       <span class="keywordtype">bool</span> ok = node -&gt; attribute ( <a class="code" href="classhippodraw_1_1TupleCutXML.html#a3d53f427a722775ec41ae83421fe5fa2" title="The axis attribute name.">m_axis</a>, axis );
<a name="l00168"></a>00168       assert ( ok );
<a name="l00169"></a>00169       <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7" title="Axes constants.">Axes::Type</a> axis_t = axis == 0 ? <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a58833a3110c570fb05130d40c365d1e4" title="X axis.">Axes::X</a> : <a class="code" href="namespacehippodraw_1_1Axes.html#a1d1cfd8ffb84e947f82999c682b666a7a5596231eabd6cf29050967d5ac83ad84" title="Y axis.">Axes::Y</a>;
<a name="l00170"></a>00170       <a class="code" href="classhippodraw_1_1TupleCutXML.html#a6b1b8c3cf43de98ca5a906869533f8d0" title="Sets the attributes for each axis of the TupleCut.">setAxisAttributes</a> ( cut, axis_t, node );
<a name="l00171"></a>00171     }
<a name="l00172"></a>00172   }
<a name="l00173"></a>00173 }
</pre></div></div>
<hr size="1"><address style="align: right;"><small>
Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0>
</a> </small></address>
</body>
</html>