classpp_1_1_point.html revision cedac228d2dd51db4b79ea1e72c7f249408ee061
1{{+bindTo:partials.standard_nacl_api}} 2<h1>pp::Point Class Reference</h1> 3<div id="doxygen-ref"> 4{{- dummy div to appease doxygen -}} 5 <div> 6<!-- Generated by Doxygen 1.7.6.1 --> 7 8 9 10</div> 11<!--header--> 12<div class="contents"> 13<!-- doxytag: class="pp::Point" --> 14<p><a href="classpp_1_1_point-members.html">List of all members.</a></p> 15<h2> 16Public Member Functions</h2><table class="memberdecls"> 17 18<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a0175483c538fdf65c7bd056f0dc25b90">Point</a> ()</td></tr> 19<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a18c7d4691920879ed45bde20b79c8d76">Point</a> (int32_t in_x, int32_t in_y)</td></tr> 20<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a3d572a358d2f3ce860bc7d0406e1c1da">Point</a> (const PP_Point &point)</td></tr> 21<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#abd093db1c01b63642cf8a8b73620626e">~Point</a> ()</td></tr> 22<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a2d5803331cba5ef9f6fea1dca3fb0773">operator PP_Point</a> () const </td></tr> 23<tr><td class="memItemLeft" align="right" valign="top">const PP_Point & </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a1e25e160421a213924a4956a1d8da8b8">pp_point</a> () const </td></tr> 24<tr><td class="memItemLeft" align="right" valign="top">PP_Point & </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#afff81b0164d11767c03a49e8e6ee3509">pp_point</a> ()</td></tr> 25<tr><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a802963acd6223e5520c4e93a0ae7c1ab">x</a> () const </td></tr> 26<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a1282f3331d3565beafd7e939d6ffcac7">set_x</a> (int32_t in_x)</td></tr> 27<tr><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a870a9bfcf7a54c18f4e5f382f69fc60d">y</a> () const </td></tr> 28<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#af3e1a26a8dd635d8c77c5f86d81deb3c">set_y</a> (int32_t in_y)</td></tr> 29<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_point.html">Point</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a7f2e778a029a9c6303f9606c165bcd73">operator+</a> (const <a class="el" href="classpp_1_1_point.html">Point</a> &other) const </td></tr> 30<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_point.html">Point</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a098ba0a739056bec9da6706e7be28f2b">operator-</a> (const <a class="el" href="classpp_1_1_point.html">Point</a> &other) const </td></tr> 31<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_point.html">Point</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a560a8ea46bd77f995f201437e78c26a9">operator+=</a> (const <a class="el" href="classpp_1_1_point.html">Point</a> &other)</td></tr> 32<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_point.html">Point</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a94cb2c93b7ab92c441bb4fc49a4223a3">operator-=</a> (const <a class="el" href="classpp_1_1_point.html">Point</a> &other)</td></tr> 33<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_point.html#a197414e35cbd23b762fb04cb39bb2296">swap</a> (<a class="el" href="classpp_1_1_point.html">Point</a> &other)</td></tr> 34</table> 35<hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 36<div class="textblock"><p>A 2 dimensional point with 0,0 being the upper-left starting coordinate. </p> 37</div><hr /><h2>Constructor & Destructor Documentation</h2> 38<a class="anchor" id="a0175483c538fdf65c7bd056f0dc25b90"></a><!-- doxytag: member="pp::Point::Point" ref="a0175483c538fdf65c7bd056f0dc25b90" args="()" --> 39<div class="memitem"> 40<div class="memproto"> 41<table class="memname"> 42<tr> 43<td class="memname"><a class="el" href="classpp_1_1_point.html#a0175483c538fdf65c7bd056f0dc25b90">pp::Point::Point</a> </td> 44<td>(</td> 45<td class="paramname"></td><td>)</td> 46<td><code> [inline]</code></td> 47</tr> 48</table> 49</div> 50<div class="memdoc"> 51<p>The default constructor for a point at 0,0. </p> 52</div> 53</div> 54<a class="anchor" id="a18c7d4691920879ed45bde20b79c8d76"></a><!-- doxytag: member="pp::Point::Point" ref="a18c7d4691920879ed45bde20b79c8d76" args="(int32_t in_x, int32_t in_y)" --> 55<div class="memitem"> 56<div class="memproto"> 57<table class="memname"> 58<tr> 59<td class="memname"><a class="el" href="classpp_1_1_point.html#a0175483c538fdf65c7bd056f0dc25b90">pp::Point::Point</a> </td> 60<td>(</td> 61<td class="paramtype">int32_t </td> 62<td class="paramname"><em>in_x</em>, </td> 63</tr> 64<tr> 65<td class="paramkey"></td> 66<td></td> 67<td class="paramtype">int32_t </td> 68<td class="paramname"><em>in_y</em> </td> 69</tr> 70<tr> 71<td></td> 72<td>)</td> 73<td></td><td><code> [inline]</code></td> 74</tr> 75</table> 76</div> 77<div class="memdoc"> 78<p>A constructor accepting two int32_t values for x and y and converting them to a <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </p> 79<dl class="params"><dt><b>Parameters:</b></dt><dd> 80<table class="params"> 81<tr><td class="paramdir">[in]</td><td class="paramname">in_x</td><td>An int32_t value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate. </td></tr> 82<tr><td class="paramdir">[in]</td><td class="paramname">in_y</td><td>An int32_t value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate. </td></tr> 83</table> 84</dd> 85</dl> 86</div> 87</div> 88<a class="anchor" id="a3d572a358d2f3ce860bc7d0406e1c1da"></a><!-- doxytag: member="pp::Point::Point" ref="a3d572a358d2f3ce860bc7d0406e1c1da" args="(const PP_Point &point)" --> 89<div class="memitem"> 90<div class="memproto"> 91<table class="memname"> 92<tr> 93<td class="memname"><a class="el" href="classpp_1_1_point.html#a0175483c538fdf65c7bd056f0dc25b90">pp::Point::Point</a> </td> 94<td>(</td> 95<td class="paramtype">const PP_Point & </td> 96<td class="paramname"><em>point</em></td><td>)</td> 97<td><code> [inline]</code></td> 98</tr> 99</table> 100</div> 101<div class="memdoc"> 102<p>A constructor accepting a pointer to a PP_Point and converting the PP_Point to a <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </p> 103<p>This is an implicit conversion constructor.</p> 104<dl class="params"><dt><b>Parameters:</b></dt><dd> 105<table class="params"> 106<tr><td class="paramdir">[in]</td><td class="paramname">point</td><td>A pointer to a PP_Point. </td></tr> 107</table> 108</dd> 109</dl> 110</div> 111</div> 112<a class="anchor" id="abd093db1c01b63642cf8a8b73620626e"></a><!-- doxytag: member="pp::Point::~Point" ref="abd093db1c01b63642cf8a8b73620626e" args="()" --> 113<div class="memitem"> 114<div class="memproto"> 115<table class="memname"> 116<tr> 117<td class="memname"><a class="el" href="classpp_1_1_point.html#abd093db1c01b63642cf8a8b73620626e">pp::Point::~Point</a> </td> 118<td>(</td> 119<td class="paramname"></td><td>)</td> 120<td><code> [inline]</code></td> 121</tr> 122</table> 123</div> 124<div class="memdoc"> 125<p>Destructor. </p> 126</div> 127</div> 128<hr /><h2>Member Function Documentation</h2> 129<a class="anchor" id="a2d5803331cba5ef9f6fea1dca3fb0773"></a><!-- doxytag: member="pp::Point::operator PP_Point" ref="a2d5803331cba5ef9f6fea1dca3fb0773" args="() const " --> 130<div class="memitem"> 131<div class="memproto"> 132<table class="memname"> 133<tr> 134<td class="memname">pp::Point::operator PP_Point </td> 135<td>(</td> 136<td class="paramname"></td><td>)</td> 137<td> const<code> [inline]</code></td> 138</tr> 139</table> 140</div> 141<div class="memdoc"> 142<p>A function allowing implicit conversion of a <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> to a PP_Point. </p> 143<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </dd></dl> 144</div> 145</div> 146<a class="anchor" id="a7f2e778a029a9c6303f9606c165bcd73"></a><!-- doxytag: member="pp::Point::operator+" ref="a7f2e778a029a9c6303f9606c165bcd73" args="(const Point &other) const " --> 147<div class="memitem"> 148<div class="memproto"> 149<table class="memname"> 150<tr> 151<td class="memname"><a class="el" href="classpp_1_1_point.html">Point</a> pp::Point::operator+ </td> 152<td>(</td> 153<td class="paramtype">const <a class="el" href="classpp_1_1_point.html">Point</a> & </td> 154<td class="paramname"><em>other</em></td><td>)</td> 155<td> const<code> [inline]</code></td> 156</tr> 157</table> 158</div> 159<div class="memdoc"> 160<p>Adds two Points (this and other) together by adding their x values and y values. </p> 161<dl class="params"><dt><b>Parameters:</b></dt><dd> 162<table class="params"> 163<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>.</td></tr> 164</table> 165</dd> 166</dl> 167<dl class="return"><dt><b>Returns:</b></dt><dd>A new <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> containing the result. </dd></dl> 168</div> 169</div> 170<a class="anchor" id="a560a8ea46bd77f995f201437e78c26a9"></a><!-- doxytag: member="pp::Point::operator+=" ref="a560a8ea46bd77f995f201437e78c26a9" args="(const Point &other)" --> 171<div class="memitem"> 172<div class="memproto"> 173<table class="memname"> 174<tr> 175<td class="memname"><a class="el" href="classpp_1_1_point.html">Point</a>& pp::Point::operator+= </td> 176<td>(</td> 177<td class="paramtype">const <a class="el" href="classpp_1_1_point.html">Point</a> & </td> 178<td class="paramname"><em>other</em></td><td>)</td> 179<td><code> [inline]</code></td> 180</tr> 181</table> 182</div> 183<div class="memdoc"> 184<p>Adds two Points (this and other) together by adding their x and y values. </p> 185<p>Returns this point as the result.</p> 186<dl class="params"><dt><b>Parameters:</b></dt><dd> 187<table class="params"> 188<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>.</td></tr> 189</table> 190</dd> 191</dl> 192<dl class="return"><dt><b>Returns:</b></dt><dd>This <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> containing the result. </dd></dl> 193</div> 194</div> 195<a class="anchor" id="a098ba0a739056bec9da6706e7be28f2b"></a><!-- doxytag: member="pp::Point::operator-" ref="a098ba0a739056bec9da6706e7be28f2b" args="(const Point &other) const " --> 196<div class="memitem"> 197<div class="memproto"> 198<table class="memname"> 199<tr> 200<td class="memname"><a class="el" href="classpp_1_1_point.html">Point</a> pp::Point::operator- </td> 201<td>(</td> 202<td class="paramtype">const <a class="el" href="classpp_1_1_point.html">Point</a> & </td> 203<td class="paramname"><em>other</em></td><td>)</td> 204<td> const<code> [inline]</code></td> 205</tr> 206</table> 207</div> 208<div class="memdoc"> 209<p>Subtracts one <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> from another <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> by subtracting their x values and y values. </p> 210<p>Returns a new point with the result.</p> 211<dl class="params"><dt><b>Parameters:</b></dt><dd> 212<table class="params"> 213<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>.</td></tr> 214</table> 215</dd> 216</dl> 217<dl class="return"><dt><b>Returns:</b></dt><dd>A new <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> containing the result. </dd></dl> 218</div> 219</div> 220<a class="anchor" id="a94cb2c93b7ab92c441bb4fc49a4223a3"></a><!-- doxytag: member="pp::Point::operator-=" ref="a94cb2c93b7ab92c441bb4fc49a4223a3" args="(const Point &other)" --> 221<div class="memitem"> 222<div class="memproto"> 223<table class="memname"> 224<tr> 225<td class="memname"><a class="el" href="classpp_1_1_point.html">Point</a>& pp::Point::operator-= </td> 226<td>(</td> 227<td class="paramtype">const <a class="el" href="classpp_1_1_point.html">Point</a> & </td> 228<td class="paramname"><em>other</em></td><td>)</td> 229<td><code> [inline]</code></td> 230</tr> 231</table> 232</div> 233<div class="memdoc"> 234<p>Subtracts one <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> from another <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> by subtracting their x values and y values. </p> 235<p>Returns this point as the result.</p> 236<dl class="params"><dt><b>Parameters:</b></dt><dd> 237<table class="params"> 238<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>.</td></tr> 239</table> 240</dd> 241</dl> 242<dl class="return"><dt><b>Returns:</b></dt><dd>This <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a> containing the result. </dd></dl> 243</div> 244</div> 245<a class="anchor" id="a1e25e160421a213924a4956a1d8da8b8"></a><!-- doxytag: member="pp::Point::pp_point" ref="a1e25e160421a213924a4956a1d8da8b8" args="() const " --> 246<div class="memitem"> 247<div class="memproto"> 248<table class="memname"> 249<tr> 250<td class="memname">const PP_Point& <a class="el" href="classpp_1_1_point.html#a1e25e160421a213924a4956a1d8da8b8">pp::Point::pp_point</a> </td> 251<td>(</td> 252<td class="paramname"></td><td>)</td> 253<td> const<code> [inline]</code></td> 254</tr> 255</table> 256</div> 257<div class="memdoc"> 258<p>Getter function for returning the internal PP_Point struct. </p> 259<dl class="return"><dt><b>Returns:</b></dt><dd>A const reference to the internal PP_Point struct. </dd></dl> 260</div> 261</div> 262<a class="anchor" id="afff81b0164d11767c03a49e8e6ee3509"></a><!-- doxytag: member="pp::Point::pp_point" ref="afff81b0164d11767c03a49e8e6ee3509" args="()" --> 263<div class="memitem"> 264<div class="memproto"> 265<table class="memname"> 266<tr> 267<td class="memname">PP_Point& <a class="el" href="classpp_1_1_point.html#a1e25e160421a213924a4956a1d8da8b8">pp::Point::pp_point</a> </td> 268<td>(</td> 269<td class="paramname"></td><td>)</td> 270<td><code> [inline]</code></td> 271</tr> 272</table> 273</div> 274<div class="memdoc"> 275<p>Getter function for returning the internal PP_Point struct. </p> 276<dl class="return"><dt><b>Returns:</b></dt><dd>A mutable reference to the PP_Point struct. </dd></dl> 277</div> 278</div> 279<a class="anchor" id="a1282f3331d3565beafd7e939d6ffcac7"></a><!-- doxytag: member="pp::Point::set_x" ref="a1282f3331d3565beafd7e939d6ffcac7" args="(int32_t in_x)" --> 280<div class="memitem"> 281<div class="memproto"> 282<table class="memname"> 283<tr> 284<td class="memname">void <a class="el" href="classpp_1_1_point.html#a1282f3331d3565beafd7e939d6ffcac7">pp::Point::set_x</a> </td> 285<td>(</td> 286<td class="paramtype">int32_t </td> 287<td class="paramname"><em>in_x</em></td><td>)</td> 288<td><code> [inline]</code></td> 289</tr> 290</table> 291</div> 292<div class="memdoc"> 293<p>Setter function for setting the value of x. </p> 294<dl class="params"><dt><b>Parameters:</b></dt><dd> 295<table class="params"> 296<tr><td class="paramdir">[in]</td><td class="paramname">in_x</td><td>A new x value. </td></tr> 297</table> 298</dd> 299</dl> 300</div> 301</div> 302<a class="anchor" id="af3e1a26a8dd635d8c77c5f86d81deb3c"></a><!-- doxytag: member="pp::Point::set_y" ref="af3e1a26a8dd635d8c77c5f86d81deb3c" args="(int32_t in_y)" --> 303<div class="memitem"> 304<div class="memproto"> 305<table class="memname"> 306<tr> 307<td class="memname">void <a class="el" href="classpp_1_1_point.html#af3e1a26a8dd635d8c77c5f86d81deb3c">pp::Point::set_y</a> </td> 308<td>(</td> 309<td class="paramtype">int32_t </td> 310<td class="paramname"><em>in_y</em></td><td>)</td> 311<td><code> [inline]</code></td> 312</tr> 313</table> 314</div> 315<div class="memdoc"> 316<p>Setter function for setting the value of y. </p> 317<dl class="params"><dt><b>Parameters:</b></dt><dd> 318<table class="params"> 319<tr><td class="paramdir">[in]</td><td class="paramname">in_y</td><td>A new y value. </td></tr> 320</table> 321</dd> 322</dl> 323</div> 324</div> 325<a class="anchor" id="a197414e35cbd23b762fb04cb39bb2296"></a><!-- doxytag: member="pp::Point::swap" ref="a197414e35cbd23b762fb04cb39bb2296" args="(Point &other)" --> 326<div class="memitem"> 327<div class="memproto"> 328<table class="memname"> 329<tr> 330<td class="memname">void <a class="el" href="classpp_1_1_point.html#a197414e35cbd23b762fb04cb39bb2296">pp::Point::swap</a> </td> 331<td>(</td> 332<td class="paramtype"><a class="el" href="classpp_1_1_point.html">Point</a> & </td> 333<td class="paramname"><em>other</em></td><td>)</td> 334<td><code> [inline]</code></td> 335</tr> 336</table> 337</div> 338<div class="memdoc"> 339<p>Swaps the coordinates of two Points. </p> 340<dl class="params"><dt><b>Parameters:</b></dt><dd> 341<table class="params"> 342<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </td></tr> 343</table> 344</dd> 345</dl> 346</div> 347</div> 348<a class="anchor" id="a802963acd6223e5520c4e93a0ae7c1ab"></a><!-- doxytag: member="pp::Point::x" ref="a802963acd6223e5520c4e93a0ae7c1ab" args="() const " --> 349<div class="memitem"> 350<div class="memproto"> 351<table class="memname"> 352<tr> 353<td class="memname">int32_t <a class="el" href="classpp_1_1_point.html#a802963acd6223e5520c4e93a0ae7c1ab">pp::Point::x</a> </td> 354<td>(</td> 355<td class="paramname"></td><td>)</td> 356<td> const<code> [inline]</code></td> 357</tr> 358</table> 359</div> 360<div class="memdoc"> 361<p>Getter function for returning the value of x. </p> 362<dl class="return"><dt><b>Returns:</b></dt><dd>The value of x for this <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </dd></dl> 363</div> 364</div> 365<a class="anchor" id="a870a9bfcf7a54c18f4e5f382f69fc60d"></a><!-- doxytag: member="pp::Point::y" ref="a870a9bfcf7a54c18f4e5f382f69fc60d" args="() const " --> 366<div class="memitem"> 367<div class="memproto"> 368<table class="memname"> 369<tr> 370<td class="memname">int32_t <a class="el" href="classpp_1_1_point.html#a870a9bfcf7a54c18f4e5f382f69fc60d">pp::Point::y</a> </td> 371<td>(</td> 372<td class="paramname"></td><td>)</td> 373<td> const<code> [inline]</code></td> 374</tr> 375</table> 376</div> 377<div class="memdoc"> 378<p>Getter function for returning the value of y. </p> 379<dl class="return"><dt><b>Returns:</b></dt><dd>The value of y for this <a class="el" href="classpp_1_1_point.html" title="A 2 dimensional point with 0,0 being the upper-left starting coordinate.">Point</a>. </dd></dl> 380</div> 381</div> 382<hr />The documentation for this class was generated from the following file:<ul> 383<li><a class="el" href="point_8h.html">point.h</a></li> 384</ul> 385</div><!-- contents --> 386</div> 387{{/partials.standard_nacl_api}} 388