Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 942400fecdd956c4a42f319760a792c6 > files > 126

libQGLViewer-doc-2.3.9-1.fc16.noarch.rpm

<!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>libQGLViewer: Vec Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link rel="shortcut icon" href="../images/qglviewer.ico" type="image/x-icon" />
<link rel="icon" href="../images/qglviewer.icon.png" type="image/png" />
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>

      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div class="navpath">
    <ul>
      <li>Vec      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<h1>Vec Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="qglviewer::Vec" -->
<p>The Vec class represents 3D positions and 3D vectors.  
<a href="#_details">More...</a></p>

<p><a href="classqglviewer_1_1Vec-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#af88b946fb90d5f08b5fb740c70e98c10">x</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ab927965981178aa1fba979a37168db2a">y</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ab3e6ed577a7c669c19de1f9c1b46c872">z</a></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Setting the value</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a3ce512deca2281c1d19ac001ed44f7c6">Vec</a> (double X, double Y, double Z)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class C &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a4d1a636ad977799255e695ac5f870b2d">Vec</a> (const C &amp;c)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a9d105072fa3c0fc1e66c162ba083fee8">operator=</a> (const Vec &amp;v)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ab4794e5d9a45a51ab239593116c480aa">setValue</a> (double X, double Y, double Z)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Accessing the value</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a605b34d1fc87b2ccaf49a45419c2e46f">operator[]</a> (int i) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#af1a8c9c4769161714a5a1a2c7fad446b">operator[]</a> (int i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ad8df949331fe927b4cb5d9bf4685ed35">operator const double *</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a028d1a021933d2f2a576efd9b7c4a7e9">operator double *</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a54795c57f1d998af73b630d786de2932">operator const float *</a> () const </td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Algebraic computations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a3be0b4bc904d39b75329eae40177240e">operator+=</a> (const Vec &amp;a)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#afa0c39c7dfe9db8b942f01f330925571">operator-=</a> (const Vec &amp;a)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a60ede4c4ea0d28e41335732ee7500fe9">operator*=</a> (double k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a9909f96f977d8d0bfabeb0331f6a69e4">operator/=</a> (double k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a30d49f3d3753a7111fc67cdde253a43d">orthogonalVec</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#abc7a7829beaefabef78bbf1aa8aa69f7">operator+</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a84bd051b693ee420203ae5947ac38bdc">operator-</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a780b6fbbee93774c986eb645dc5c6373">operator-</a> (const Vec &amp;a)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ae579ff9811fb814a1c19526300feba52">operator*</a> (const Vec &amp;a, double k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ab1a8646ebc64cad8c3b98af9c33c16a9">operator*</a> (double k, const Vec &amp;a)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#aea982cdbaafc94cc70f99f176f431206">operator/</a> (const Vec &amp;a, double k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#aa694f4dad59f93a8b8364d1b9cbdfd54">operator!=</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#aa36a8f02bb5bd8f5ab8532a79ceb4e9f">operator==</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ae8b74b239e9752e017105b61239eb54e">operator*</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#af521e6619361cc97fff70ae3115e0317">operator^</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a835244f47bc3744aed547f6ae814e13e">cross</a> (const Vec &amp;a, const Vec &amp;b)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Norm of the vector</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a7dcf0710a7514d91ab4ba6aaefde110e">squaredNorm</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a0c08e460a130fd3b8eff7eb7484e878a">norm</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a05826e509c686f39baaec4656f1a7231">normalize</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Vec&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a7f3923a61bb70c53263379de9783d265">unit</a> () const </td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Projection</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a8c89e6f39afb5bd92e4cae4ffa6c3221">projectOnAxis</a> (const Vec &amp;direction)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a6ed4feca0d9a299bdc68632eb7db51b9">projectOnPlane</a> (const Vec &amp;normal)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
XML representation</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#ae789c3b0b8e39895b96f417a36db4b8a">Vec</a> (const QDomElement &amp;element)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QDomElement&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement</a> (const QString &amp;name, QDomDocument &amp;document) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement</a> (const QDomElement &amp;element)</td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Output stream</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classqglviewer_1_1Vec.html#a16d5f2f021103b05006b0c58fbd48796">operator&lt;&lt;</a> (std::ostream &amp;o, const qglviewer::Vec &amp;)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The Vec class represents 3D positions and 3D vectors. </p>
<p>Vec is used as a parameter and return type by many methods of the library. It provides classical algebraic computational methods and is compatible with OpenGL:</p>
<div class="fragment"><pre class="fragment">  <span class="comment">// Draws a point located at 3.0 OpenGL units in front of the camera</span>
  <a class="code" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> pos = camera()-&gt;position() + 3.0 * camera()-&gt;viewDirection();
  glBegin(GL_POINTS);
  glVertex3fv(pos);
  glEnd();
</pre></div><p>This makes of Vec a good candidate for representing positions and vectors in your programs. Since it is part of the <code>qglviewer</code> namespace, specify <code>qglviewer::Vec</code> or use the qglviewer namespace: </p>
<div class="fragment"><pre class="fragment">  <span class="keyword">using namespace </span>qglviewer;
</pre></div><h3>Interface with other vector classes</h3>
<p>Vec implements a universal explicit converter, based on the <code></code>[] <code>operator</code>. Everywhere a <code>const</code> <code>Vec&amp;</code> argument is expected, you can use your own vector type instead, as long as it implements this operator (see the <a class="el" href="classqglviewer_1_1Vec.html#a4d1a636ad977799255e695ac5f870b2d">Vec(const C&amp; c)</a> documentation).</p>
<p>See also the <a class="el" href="classqglviewer_1_1Quaternion.html" title="The Quaternion class represents 3D rotations and orientations.">Quaternion</a> and the <a class="el" href="classqglviewer_1_1Frame.html" title="The Frame class represents a coordinate system, defined by a position and an orientation.">Frame</a> documentations. </p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a82cf7e1c93ee9188fefb25b86fc6c5b0"></a><!-- doxytag: member="qglviewer::Vec::Vec" ref="a82cf7e1c93ee9188fefb25b86fc6c5b0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Default constructor. Value is set to (0,0,0). </p>

</div>
</div>
<a class="anchor" id="a3ce512deca2281c1d19ac001ed44f7c6"></a><!-- doxytag: member="qglviewer::Vec::Vec" ref="a3ce512deca2281c1d19ac001ed44f7c6" args="(double X, double Y, double Z)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>Z</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Standard constructor with the x, y and z values. </p>

</div>
</div>
<a class="anchor" id="a4d1a636ad977799255e695ac5f870b2d"></a><!-- doxytag: member="qglviewer::Vec::Vec" ref="a4d1a636ad977799255e695ac5f870b2d" args="(const C &amp;c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec </td>
          <td>(</td>
          <td class="paramtype">const C &amp;&#160;</td>
          <td class="paramname"> <em>c</em>&#160;)</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Universal explicit converter from any class to Vec. You can use your own vector class everywhere a <code>const</code> <code>Vec&amp;</code> parameter is required, as long as it implements the <code>operator</code>[ ]:</p>
<div class="fragment"><pre class="fragment">  <span class="keyword">class </span>MyVec
  {
    <span class="comment">// ...</span>
    <span class="keywordtype">double</span> <a class="code" href="classqglviewer_1_1Vec.html#a605b34d1fc87b2ccaf49a45419c2e46f">operator[]</a>(<span class="keywordtype">int</span> i)<span class="keyword"> const </span>{ returns <a class="code" href="classqglviewer_1_1Vec.html#af88b946fb90d5f08b5fb740c70e98c10">x</a>, y or <a class="code" href="classqglviewer_1_1Vec.html#ab3e6ed577a7c669c19de1f9c1b46c872">z</a> when i=0, 1 or 2; }
  }

  MyVec v(...);
  camera()-&gt;setPosition(v);
</pre></div><p>Note that standard vector types (STL, <code>double</code>[3], ...) implement this operator and can hence be used in place of Vec. See also operator const double*() . </p>

</div>
</div>
<a class="anchor" id="ae789c3b0b8e39895b96f417a36db4b8a"></a><!-- doxytag: member="qglviewer::Vec::Vec" ref="ae789c3b0b8e39895b96f417a36db4b8a" args="(const QDomElement &amp;element)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec </td>
          <td>(</td>
          <td class="paramtype">const QDomElement &amp;&#160;</td>
          <td class="paramname"> <em>element</em>&#160;)</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructs a Vec from a <code>QDomElement</code> representing an XML code of the form </p>
<div class="fragment"><pre class="fragment"> &lt; anyTagName x=<span class="stringliteral">&quot;..&quot;</span> y=<span class="stringliteral">&quot;..&quot;</span> <a class="code" href="classqglviewer_1_1Vec.html#ab3e6ed577a7c669c19de1f9c1b46c872">z</a>=<span class="stringliteral">&quot;..&quot;</span> /&gt;
</pre></div><p>If one of these attributes is missing or is not a number, a warning is displayed and the associated value is set to 0.0.</p>
<p>See also <a class="el" href="classqglviewer_1_1Vec.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a> and <a class="el" href="classqglviewer_1_1Vec.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement()</a>. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a48e0e2dd26cd96418c8b889ceabe80f6"></a><!-- doxytag: member="qglviewer::Vec::domElement" ref="a48e0e2dd26cd96418c8b889ceabe80f6" args="(const QString &amp;name, QDomDocument &amp;document) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QDomElement domElement </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QDomDocument &amp;&#160;</td>
          <td class="paramname"> <em>document</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an XML <code>QDomElement</code> that represents the Vec.</p>
<p><code>name</code> is the name of the QDomElement tag. <code>doc</code> is the <code>QDomDocument</code> factory used to create QDomElement.</p>
<p>When output to a file, the resulting QDomElement will look like: </p>
<div class="fragment"><pre class="fragment"> &lt;name x=<span class="stringliteral">&quot;..&quot;</span> y=<span class="stringliteral">&quot;..&quot;</span> <a class="code" href="classqglviewer_1_1Vec.html#ab3e6ed577a7c669c19de1f9c1b46c872">z</a>=<span class="stringliteral">&quot;..&quot;</span> /&gt;
</pre></div><p>Use <a class="el" href="classqglviewer_1_1Vec.html#acd13d2ddeca530cb9f26ead47f7d25d3">initFromDOMElement()</a> to restore the Vec state from the resulting <code>QDomElement</code>. See also the <a class="el" href="classqglviewer_1_1Vec.html#ae789c3b0b8e39895b96f417a36db4b8a">Vec(const QDomElement&amp;)</a> constructor.</p>
<p>Here is complete example that creates a QDomDocument and saves it into a <a href="file:">file:</a> </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> sunPos;
 QDomDocument document(<span class="stringliteral">&quot;myDocument&quot;</span>);
 QDomElement sunElement = document.createElement(<span class="stringliteral">&quot;Sun&quot;</span>);
 document.appendChild(sunElement);
 sunElement.setAttribute(<span class="stringliteral">&quot;brightness&quot;</span>, sunBrightness());
 sunElement.appendChild(sunPos.domElement(<span class="stringliteral">&quot;sunPosition&quot;</span>, document));
 <span class="comment">// Other additions to the document hierarchy...</span>

 <span class="comment">// Save doc document</span>
 QFile f(<span class="stringliteral">&quot;myFile.xml&quot;</span>);
 <span class="keywordflow">if</span> (f.open(IO_WriteOnly))
 {
   QTextStream out(&amp;f);
   document.save(out, 2);
   f.close();
 }
</pre></div><p>See also <a class="el" href="classqglviewer_1_1Quaternion.html#a48e0e2dd26cd96418c8b889ceabe80f6">Quaternion::domElement()</a>, <a class="el" href="classqglviewer_1_1Frame.html#a48e0e2dd26cd96418c8b889ceabe80f6">Frame::domElement()</a>, <a class="el" href="classqglviewer_1_1Camera.html#a48e0e2dd26cd96418c8b889ceabe80f6">Camera::domElement()</a>... </p>

</div>
</div>
<a class="anchor" id="acd13d2ddeca530cb9f26ead47f7d25d3"></a><!-- doxytag: member="qglviewer::Vec::initFromDOMElement" ref="acd13d2ddeca530cb9f26ead47f7d25d3" args="(const QDomElement &amp;element)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initFromDOMElement </td>
          <td>(</td>
          <td class="paramtype">const QDomElement &amp;&#160;</td>
          <td class="paramname"> <em>element</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Restores the Vec state from a <code>QDomElement</code> created by <a class="el" href="classqglviewer_1_1Vec.html#a48e0e2dd26cd96418c8b889ceabe80f6">domElement()</a>.</p>
<p>The <code>QDomElement</code> should contain <code>x</code>, <code>y</code> and <code>z</code> attributes. If one of these attributes is missing or is not a number, a warning is displayed and the associated value is set to 0.0.</p>
<p>To restore the Vec state from an xml file, use: </p>
<div class="fragment"><pre class="fragment"> <span class="comment">// Load DOM from file</span>
 QDomDocument doc;
 QFile f(<span class="stringliteral">&quot;myFile.xml&quot;</span>);
 <span class="keywordflow">if</span> (f.open(IO_ReadOnly))
 {
   doc.setContent(&amp;f);
   f.close();
 }
 <span class="comment">// Parse the DOM tree and initialize</span>
 QDomElement main=doc.documentElement();
 myVec.initFromDOMElement(main);
</pre></div><p>See also the <a class="el" href="classqglviewer_1_1Vec.html#ae789c3b0b8e39895b96f417a36db4b8a">Vec(const QDomElement&amp;)</a> constructor. </p>

</div>
</div>
<a class="anchor" id="a0c08e460a130fd3b8eff7eb7484e878a"></a><!-- doxytag: member="qglviewer::Vec::norm" ref="a0c08e460a130fd3b8eff7eb7484e878a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double norm </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the norm of the vector. </p>

</div>
</div>
<a class="anchor" id="a05826e509c686f39baaec4656f1a7231"></a><!-- doxytag: member="qglviewer::Vec::normalize" ref="a05826e509c686f39baaec4656f1a7231" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double normalize </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Normalizes the Vec and returns its original norm.</p>
<p>Normalizing a null vector will result in <code>NaN</code> values. </p>

</div>
</div>
<a class="anchor" id="ad8df949331fe927b4cb5d9bf4685ed35"></a><!-- doxytag: member="qglviewer::Vec::operator const double *" ref="ad8df949331fe927b4cb5d9bf4685ed35" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">operator const double * </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Conversion operator returning the memory address of the vector.</p>
<p>Very convenient to pass a Vec pointer as a parameter to OpenGL functions: </p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> pos, normal;
  glNormal3dv(normal);
  glVertex3dv(pos);
</pre></div> 
</div>
</div>
<a class="anchor" id="a54795c57f1d998af73b630d786de2932"></a><!-- doxytag: member="qglviewer::Vec::operator const float *" ref="a54795c57f1d998af73b630d786de2932" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">operator const float * </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Conversion operator returning the memory address of the vector.</p>
<p>Very convenient to pass a Vec pointer as a parameter to OpenGL functions: </p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> pos, normal;
  glNormal3fv(normal);
  glVertex3fv(pos);
</pre></div> <dl class="note"><dt><b>Note:</b></dt><dd>The returned float array is a static shared by all <code>Vec</code> instances. </dd></dl>

</div>
</div>
<a class="anchor" id="a028d1a021933d2f2a576efd9b7c4a7e9"></a><!-- doxytag: member="qglviewer::Vec::operator double *" ref="a028d1a021933d2f2a576efd9b7c4a7e9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">operator double * </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Non const conversion operator returning the memory address of the vector.</p>
<p>Useful to pass a Vec to a method that requires and fills a <code>double*</code>, as provided by certain libraries. </p>

</div>
</div>
<a class="anchor" id="a60ede4c4ea0d28e41335732ee7500fe9"></a><!-- doxytag: member="qglviewer::Vec::operator*=" ref="a60ede4c4ea0d28e41335732ee7500fe9" args="(double k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec&amp; operator*= </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>k</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Multiply the vector by a scalar <code>k</code>. </p>

</div>
</div>
<a class="anchor" id="a3be0b4bc904d39b75329eae40177240e"></a><!-- doxytag: member="qglviewer::Vec::operator+=" ref="a3be0b4bc904d39b75329eae40177240e" args="(const Vec &amp;a)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec&amp; operator+= </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds <code>a</code> to the vector. </p>

</div>
</div>
<a class="anchor" id="afa0c39c7dfe9db8b942f01f330925571"></a><!-- doxytag: member="qglviewer::Vec::operator&#45;=" ref="afa0c39c7dfe9db8b942f01f330925571" args="(const Vec &amp;a)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec&amp; operator-= </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Subtracts <code>a</code> to the vector. </p>

</div>
</div>
<a class="anchor" id="a9909f96f977d8d0bfabeb0331f6a69e4"></a><!-- doxytag: member="qglviewer::Vec::operator/=" ref="a9909f96f977d8d0bfabeb0331f6a69e4" args="(double k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec&amp; operator/= </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>k</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Divides the vector by a scalar <code>k</code>.</p>
<p>An absolute <code>k</code> value lower than 1E-10 will print a warning if the library was compiled with the "debug" Qt <code>CONFIG</code> flag. Otherwise, no test is performed for efficiency reasons. </p>

</div>
</div>
<a class="anchor" id="a16d5f2f021103b05006b0c58fbd48796"></a><!-- doxytag: member="qglviewer::Vec::operator&lt;&lt;" ref="a16d5f2f021103b05006b0c58fbd48796" args="(std::ostream &amp;o, const qglviewer::Vec &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::ostream&amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"> <em>o</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const qglviewer::Vec &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Output stream operator. Enables debugging code like: </p>
<div class="fragment"><pre class="fragment">  <a class="code" href="classqglviewer_1_1Vec.html#a82cf7e1c93ee9188fefb25b86fc6c5b0">Vec</a> pos(...);
  cout &lt;&lt; <span class="stringliteral">&quot;Position=&quot;</span> &lt;&lt; pos &lt;&lt; endl;
</pre></div> 
</div>
</div>
<a class="anchor" id="a9d105072fa3c0fc1e66c162ba083fee8"></a><!-- doxytag: member="qglviewer::Vec::operator=" ref="a9d105072fa3c0fc1e66c162ba083fee8" args="(const Vec &amp;v)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec&amp; operator= </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>v</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Equal operator. </p>

</div>
</div>
<a class="anchor" id="a605b34d1fc87b2ccaf49a45419c2e46f"></a><!-- doxytag: member="qglviewer::Vec::operator[]" ref="a605b34d1fc87b2ccaf49a45419c2e46f" args="(int i) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double operator[] </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>i</em>&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Bracket operator, with a constant return value. <code>i</code> must range in [0..2]. </p>

</div>
</div>
<a class="anchor" id="af1a8c9c4769161714a5a1a2c7fad446b"></a><!-- doxytag: member="qglviewer::Vec::operator[]" ref="af1a8c9c4769161714a5a1a2c7fad446b" args="(int i)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double&amp; operator[] </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>i</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Bracket operator returning an l-value. <code>i</code> must range in [0..2]. </p>

</div>
</div>
<a class="anchor" id="a30d49f3d3753a7111fc67cdde253a43d"></a><!-- doxytag: member="qglviewer::Vec::orthogonalVec" ref="a30d49f3d3753a7111fc67cdde253a43d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec orthogonalVec </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a Vec orthogonal to the Vec. Its <a class="el" href="classqglviewer_1_1Vec.html#a0c08e460a130fd3b8eff7eb7484e878a">norm()</a> depends on the Vec, but is zero only for a null Vec. Note that the function that associates an <a class="el" href="classqglviewer_1_1Vec.html#a30d49f3d3753a7111fc67cdde253a43d">orthogonalVec()</a> to a Vec is not continous. </p>

</div>
</div>
<a class="anchor" id="a8c89e6f39afb5bd92e4cae4ffa6c3221"></a><!-- doxytag: member="qglviewer::Vec::projectOnAxis" ref="a8c89e6f39afb5bd92e4cae4ffa6c3221" args="(const Vec &amp;direction)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void projectOnAxis </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>direction</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Projects the Vec on the axis of direction <code>direction</code> that passes through the origin.</p>
<p><code>direction</code> does not need to be normalized (but must be non null). </p>

</div>
</div>
<a class="anchor" id="a6ed4feca0d9a299bdc68632eb7db51b9"></a><!-- doxytag: member="qglviewer::Vec::projectOnPlane" ref="a6ed4feca0d9a299bdc68632eb7db51b9" args="(const Vec &amp;normal)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void projectOnPlane </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>normal</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Projects the Vec on the plane whose normal is <code>normal</code> that passes through the origin.</p>
<p><code>normal</code> does not need to be normalized (but must be non null). </p>

</div>
</div>
<a class="anchor" id="ab4794e5d9a45a51ab239593116c480aa"></a><!-- doxytag: member="qglviewer::Vec::setValue" ref="ab4794e5d9a45a51ab239593116c480aa" args="(double X, double Y, double Z)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void setValue </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>X</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>Y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>Z</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set the current value. May be faster than using <a class="el" href="classqglviewer_1_1Vec.html#a9d105072fa3c0fc1e66c162ba083fee8">operator=()</a> with a temporary Vec(x,y,z). </p>

</div>
</div>
<a class="anchor" id="a7dcf0710a7514d91ab4ba6aaefde110e"></a><!-- doxytag: member="qglviewer::Vec::squaredNorm" ref="a7dcf0710a7514d91ab4ba6aaefde110e" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double squaredNorm </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the <em>squared</em> norm of the Vec. </p>

</div>
</div>
<a class="anchor" id="a7f3923a61bb70c53263379de9783d265"></a><!-- doxytag: member="qglviewer::Vec::unit" ref="a7f3923a61bb70c53263379de9783d265" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec unit </td>
          <td>(</td>
          <td class="paramname">&#160;)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns a unitary (normalized) <em>representation</em> of the vector. The original Vec is not modified. </p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a835244f47bc3744aed547f6ae814e13e"></a><!-- doxytag: member="qglviewer::Vec::cross" ref="a835244f47bc3744aed547f6ae814e13e" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec cross </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Cross product of the two Vec. Mind the order ! </p>

</div>
</div>
<a class="anchor" id="aa694f4dad59f93a8b8364d1b9cbdfd54"></a><!-- doxytag: member="qglviewer::Vec::operator!=" ref="aa694f4dad59f93a8b8364d1b9cbdfd54" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator!= </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <code>true</code> only when the two vector are not equal (see <a class="el" href="classqglviewer_1_1Vec.html#aa36a8f02bb5bd8f5ab8532a79ceb4e9f">operator==()</a>). </p>

</div>
</div>
<a class="anchor" id="ae8b74b239e9752e017105b61239eb54e"></a><!-- doxytag: member="qglviewer::Vec::operator*" ref="ae8b74b239e9752e017105b61239eb54e" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double operator* </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Dot product of the two Vec. </p>

</div>
</div>
<a class="anchor" id="ab1a8646ebc64cad8c3b98af9c33c16a9"></a><!-- doxytag: member="qglviewer::Vec::operator*" ref="ab1a8646ebc64cad8c3b98af9c33c16a9" args="(double k, const Vec &amp;a)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator* </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the product of a scalar with the vector. </p>

</div>
</div>
<a class="anchor" id="ae579ff9811fb814a1c19526300feba52"></a><!-- doxytag: member="qglviewer::Vec::operator*" ref="ae579ff9811fb814a1c19526300feba52" args="(const Vec &amp;a, double k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator* </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the product of the vector with a scalar. </p>

</div>
</div>
<a class="anchor" id="abc7a7829beaefabef78bbf1aa8aa69f7"></a><!-- doxytag: member="qglviewer::Vec::operator+" ref="abc7a7829beaefabef78bbf1aa8aa69f7" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator+ </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the sum of the two vectors. </p>

</div>
</div>
<a class="anchor" id="a84bd051b693ee420203ae5947ac38bdc"></a><!-- doxytag: member="qglviewer::Vec::operator&#45;" ref="a84bd051b693ee420203ae5947ac38bdc" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator- </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the difference of the two vectors. </p>

</div>
</div>
<a class="anchor" id="a780b6fbbee93774c986eb645dc5c6373"></a><!-- doxytag: member="qglviewer::Vec::operator&#45;" ref="a780b6fbbee93774c986eb645dc5c6373" args="(const Vec &amp;a)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator- </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>&#160;)</td>
          <td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Unary minus operator. </p>

</div>
</div>
<a class="anchor" id="aea982cdbaafc94cc70f99f176f431206"></a><!-- doxytag: member="qglviewer::Vec::operator/" ref="aea982cdbaafc94cc70f99f176f431206" args="(const Vec &amp;a, double k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator/ </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"> <em>k</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the division of the vector with a scalar.</p>
<p>Too small <code>k</code> values are <em>not</em> tested (unless the library was compiled with the "debug" Qt <code>CONFIG</code> flag) and may result in <code>NaN</code> values. </p>

</div>
</div>
<a class="anchor" id="aa36a8f02bb5bd8f5ab8532a79ceb4e9f"></a><!-- doxytag: member="qglviewer::Vec::operator==" ref="aa36a8f02bb5bd8f5ab8532a79ceb4e9f" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns <code>true</code> when the <a class="el" href="classqglviewer_1_1Vec.html#a7dcf0710a7514d91ab4ba6aaefde110e">squaredNorm()</a> of the difference vector is lower than 1E-10. </p>

</div>
</div>
<a class="anchor" id="af521e6619361cc97fff70ae3115e0317"></a><!-- doxytag: member="qglviewer::Vec::operator^" ref="af521e6619361cc97fff70ae3115e0317" args="(const Vec &amp;a, const Vec &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Vec operator^ </td>
          <td>(</td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Vec &amp;&#160;</td>
          <td class="paramname"> <em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Cross product of the two vectors. Same as <a class="el" href="classqglviewer_1_1Vec.html#a835244f47bc3744aed547f6ae814e13e">cross()</a>. </p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="af88b946fb90d5f08b5fb740c70e98c10"></a><!-- doxytag: member="qglviewer::Vec::x" ref="af88b946fb90d5f08b5fb740c70e98c10" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classqglviewer_1_1Vec.html#af88b946fb90d5f08b5fb740c70e98c10">x</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The internal data representation is public. One can use v.x, v.y, v.z. See also <a class="el" href="classqglviewer_1_1Vec.html#a605b34d1fc87b2ccaf49a45419c2e46f">operator[]()</a>. </p>

</div>
</div>
<a class="anchor" id="ab927965981178aa1fba979a37168db2a"></a><!-- doxytag: member="qglviewer::Vec::y" ref="ab927965981178aa1fba979a37168db2a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classqglviewer_1_1Vec.html#ab927965981178aa1fba979a37168db2a">y</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ab3e6ed577a7c669c19de1f9c1b46c872"></a><!-- doxytag: member="qglviewer::Vec::z" ref="ab3e6ed577a7c669c19de1f9c1b46c872" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="classqglviewer_1_1Vec.html#ab3e6ed577a7c669c19de1f9c1b46c872">z</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Mon Dec 6 2010 01:42:48 for libQGLViewer by&#160;
<a href="http://www.doxygen.org/index.html">
doxygen</a> 1.7.2 </small></address>
</body>
</html>