Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 9347541fe87a5ea3f3b8dbc50f660e8e > files > 274

libQGLViewer-devel-1.3.6-1mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libQGLViewer: MouseGrabber class Reference</title>
<link href="qglviewer.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="../index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="functions.html">All&nbsp;functions</a> | <a class="qindex" doxygen="_cgi:http://www-imagis.imag.fr/cgi-bin/DOXYGEN/search.cgi" href="http://www-imagis.imag.fr/cgi-bin/DOXYGEN/search.cgi">Search</a></div>
<h1>MouseGrabber Class Reference</h1>Abstract class for mouse interactive objects.  
<a href="#_details">More...</a>
<p>
Inherited by <a class="el" href="classqglviewer_1_1ManipulatedFrame.html">ManipulatedFrame</a>.
<p>
<a href="classqglviewer_1_1MouseGrabber-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Mouse detection</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse</a> (int x, int y, const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const camera)=0</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse</a> (const bool flag)</td></tr>

<tr><td colspan=2><br><h2>MouseGrabber pool</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_0">isInMouseGrabberPool</a> () const</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_1">addInMouseGrabberPool</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_2">removeFromMouseGrabberPool</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_3">clearMouseGrabberPool</a> (bool autoDelete=false)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>const QPtrList&lt; <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> &gt; &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool</a> ()</td></tr>

<tr><td colspan=2><br><h2>Mouse event handlers</h2></td></tr>
<tr><td colspan=2>The different functions called by the <a class="el" href="classQGLViewer.html">QGLViewer</a> when the MouseGrabber grabsMouse(). <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent</a> (QMouseEvent *const, <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_1">mouseDoubleClickEvent</a> (QMouseEvent *const, <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_2">mouseReleaseEvent</a> (QMouseEvent *const, <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_3">mouseMoveEvent</a> (QMouseEvent *const, const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_4">wheelEvent</a> (QWheelEvent *const, const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const)</td></tr>

<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#a0">MouseGrabber</a> ()</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classqglviewer_1_1MouseGrabber.html#a1">~MouseGrabber</a> ()</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Abstract class for mouse interactive objects. 
<p>
<a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> are object which react to the mouse cursor, usually when it get close to them. Their actual behavior is arbitrary and has to be defined in a derived class : this class only provides a common interface for all these objects.<p>
All the created <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> objects are grouped in a <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>. All the QGLViewers parse this pool, calling all the MouseGrabbers' <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> functions to determine if one of the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a>. Individual MouseGrabbers can be removed from this pool using <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_2">removeFromMouseGrabberPool()</a> if you want to (temporarily) disable them.<p>
When a <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a>, it becomes the <a class="el" href="classQGLViewer.html#z95_0">QGLViewer::mouseGrabber()</a>. All the mouse events (<a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent()</a>, <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_2">mouseReleaseEvent()</a>, <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_3">mouseMoveEvent()</a>, <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_1">mouseDoubleClickEvent()</a> and <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_4">wheelEvent()</a>) are then transmitted to the <a class="el" href="classQGLViewer.html#z95_0">QGLViewer::mouseGrabber()</a> instead of being normally processed.<p>
<a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> is still called after each mouse motion to check if the <a class="el" href="classQGLViewer.html#z95_0">QGLViewer::mouseGrabber()</a> still grabs the mouse.<p>
In order to make <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> react to mouse events, the mouse tracking option has to be activated in the QGLViewers which want to use MouseGrabbers: <div class="fragment"><pre>  init() { setMouseTracking(<span class="keyword">true</span>); }
</pre></div>Call <code>QGLViewer::hasMouseTracking()</code> to get the current state of this flag.<p>
The <code>camera</code> parameter of the different functions is a pointer to the <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> used by the <a class="el" href="classQGLViewer.html">QGLViewer</a> which calls the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>. It can be used to compute 2D to 3D coordinates conversion using <a class="el" href="classqglviewer_1_1Camera.html#z19_0">Camera::projectedCoordinatesOf()</a> and <a class="el" href="classqglviewer_1_1Camera.html#z19_2">Camera::unprojectedCoordinatesOf()</a>.<p>
Very complex behaviors can be implemented using this framework: auto-selected objects (no need to press a key to use them), automatic drop-down menus, 3D GUI, spinners using the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_4">wheelEvent()</a>, and whatever your imagination creates.<p>
See the <a href="../examples/mouseGrabber.html">mouseGrabber example</a> for an illustration. Note that <a class="el" href="classqglviewer_1_1ManipulatedFrame.html">ManipulatedFrame</a> are <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> : see the <a href="../examples/keyFrames.html">keyFrame example</a> for an illustration. Every created <a class="el" href="classqglviewer_1_1ManipulatedFrame.html">ManipulatedFrame</a> is hence inserted in the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a> (note however that <a class="el" href="classqglviewer_1_1ManipulatedCameraFrame.html">ManipulatedCameraFrame</a> are <em>not</em> inserted).<p>
Here is for instance a draft version of a movableObject class. Instances of these class can freely be moved on screen using the mouse. A possible application would be movable post-it-like notes.<p>
<div class="fragment"><pre>  <span class="keyword">class </span>movableObject : <span class="keyword">public</span> <a class="code" href="classqglviewer_1_1MouseGrabber.html#a0">MouseGrabber</a>
  {
    movableObject() : posX(0), posY(0), moved(false) {};

    <span class="keywordtype">void</span> <a class="code" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keyword">const</span> <a class="code" href="classqglviewer_1_1Camera.html">qglviewer::Camera</a>* <span class="keyword">const</span>)
    {
      <span class="comment">// Active in a region of 5 pixel. Criterion should depend on object's shape.</span>
      <a class="code" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse</a>( sqrt((x-posX)*(x-posX) + (y-posY)*(y-posY)) &lt; 5 );
    }

    <span class="keywordtype">void</span> <a class="code" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent</a>(QMouseEvent *, Camera* <span class="keyword">const</span>)   { moved = <span class="keyword">true</span>; }
    <span class="keywordtype">void</span> <a class="code" href="classqglviewer_1_1MouseGrabber.html#z81_2">mouseReleaseEvent</a>(QMouseEvent *, Camera* <span class="keyword">const</span>) { moved = <span class="keyword">false</span>; }
    
    <span class="keywordtype">void</span> <a class="code" href="classqglviewer_1_1MouseGrabber.html#z81_3">mouseMoveEvent</a>(QMouseEvent *e, Camera* <span class="keyword">const</span>)
    {
      <span class="keywordflow">if</span> (moved)
      {
        posX = e-&gt;x();
        posY = e-&gt;y();
      }
    }

    <span class="keywordtype">void</span> draw()
    {
      <span class="keywordflow">if</span> (<a class="code" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse</a>())
        <span class="keywordflow">if</span> (moved)
          <span class="comment">// Object being moved, maybe a transparent display</span>
        <span class="keywordflow">else</span>
          <span class="comment">// Visual feedback (highlight) : object ready to be grabbed </span>
      <span class="keywordflow">else</span>
        <span class="comment">// Normal display</span>
    }
  };
</pre></div>
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="qglviewer::MouseGrabber::MouseGrabber"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Adds the created <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> in the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>. <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> set to <code>false</code>.     </td>
  </tr>
</table>
<a name="a1" doxytag="qglviewer::MouseGrabber::~MouseGrabber"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual ~<a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Virtual destructor. Removes object from the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>.     </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="z79_1" doxytag="qglviewer::MouseGrabber::addInMouseGrabberPool"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void addInMouseGrabberPool </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Adds the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> in the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>. Note that all <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> are automatically added in the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a> by the constructor. Trying to add a <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> that already <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_0">isInMouseGrabberPool()</a> has no effect.<p>
Use <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_2">removeFromMouseGrabberPool()</a> to remove the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> from the list, so that it is no longer tested with <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> by the <a class="el" href="classQGLViewer.html">QGLViewer</a>. Use <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_0">isInMouseGrabberPool()</a> to know the current state of the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>.     </td>
  </tr>
</table>
<a name="z77_0" doxytag="qglviewer::MouseGrabber::checkIfGrabsMouse"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void checkIfGrabsMouse </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname" nowrap> <em>x</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap> <em>y</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *const&nbsp;</td>
          <td class="mdname" nowrap> <em>camera</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [pure virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is the core function of the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>. It has to be overloaded and defined in your derived classes. Its goal is to update the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> flag according to the mouse current positon, using <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse()</a>.<p>
<a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> should be set to <code>true</code> when the mouse cursor is close enough to the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> position (or whatever is appropriate). It also <em>must</em> be set to <code>false</code> as soon as the mouse cursor leaves this region in order to release the mouse focus for the other parts of the application.<p>
A typical implementation will look like: <div class="fragment"><pre>    <span class="comment">// (posX,posY) is the position of the MouseGrabber on screen (origin in the \e upper left corner).</span>
    <span class="comment">// Here, distance to mouse must be less than 10 pixels to activate the MouseGrabber.</span>
    <a class="code" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse</a>( sqrt((x-posX)*(x-posX) + (y-posY)*(y-posY)) &lt; 10);
</pre></div><p>
If the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> position is defined in 3D. Project it on screen and then compare the projected coordinates: <div class="fragment"><pre>    Vec proj = camera-&gt;projectedCoordinatesOf(myObject-&gt;frame()-&gt;position());
    <a class="code" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse</a>((fabs(x-proj.x) &lt; 5) &amp;&amp; (fabs(y-proj.y) &lt; 2));
</pre></div><p>
More complex behavior can be obtained using extra flags, for instance related to <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent()</a> and <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_2">mouseReleaseEvent()</a>. See the detailed description section and the <a href="../examples/mouseGrabber.html">mouseGrabber example</a>. 
<p>
Implemented in <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#z75_0">ManipulatedFrame</a>.    </td>
  </tr>
</table>
<a name="z79_3" doxytag="qglviewer::MouseGrabber::clearMouseGrabberPool"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void clearMouseGrabberPool </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">bool&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>autoDelete</em> = false          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Clears the mouseGrabberPool(). Consider using QGLViewer::setMouseTracking(false) to disable all mouse grabbers.<p>
When <code>autoDelete</code> is set to <code>true</code>, all the MouseGrabbers themselves are actually deleted (use this only if you're sure of what you do).     </td>
  </tr>
</table>
<a name="z77_1" doxytag="qglviewer::MouseGrabber::grabsMouse"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool grabsMouse </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns <code>true</code> when the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> grabs the mouse and hence receives all the QGLViewer's mouse events. This flag is set with <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_2">setGrabsMouse()</a> by the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> function.     </td>
  </tr>
</table>
<a name="z79_0" doxytag="qglviewer::MouseGrabber::isInMouseGrabberPool"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool isInMouseGrabberPool </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns <code>true</code> if the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> is currently in the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>. Default value is <code>true</code>. When set to false using <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_2">removeFromMouseGrabberPool()</a>, the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> is no longer <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> by QGLViewers. See also <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_1">addInMouseGrabberPool()</a>.     </td>
  </tr>
</table>
<a name="z81_1" doxytag="qglviewer::MouseGrabber::mouseDoubleClickEvent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void mouseDoubleClickEvent </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QMouseEvent *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See the associated QGLWidget documentation. See also <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent()</a>.     </td>
  </tr>
</table>
<a name="z79_4" doxytag="qglviewer::MouseGrabber::MouseGrabberPool"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> const QPtrList&lt;<a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>&gt;&amp; MouseGrabberPool </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, static]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This list contains all the created <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>. Used by the <a class="el" href="classQGLViewer.html">QGLViewer</a> to check if any of them <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> using <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a>.<p>
You should not have to directly use this list. In case you want to, use code like: <div class="fragment"><pre>    QPtrListIterator&lt;MouseGrabber&gt; it(MouseGrabber::MouseGrabberPool());
    <span class="keywordflow">for</span> (<a class="code" href="classqglviewer_1_1MouseGrabber.html#a0">MouseGrabber</a>* mg; (mg = it.current()) != NULL; ++it)
      mg-&gt;anyAction(); <span class="comment">// possible dynamic_cast here.</span>
</pre></div>    </td>
  </tr>
</table>
<a name="z81_3" doxytag="qglviewer::MouseGrabber::mouseMoveEvent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void mouseMoveEvent </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QMouseEvent *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See the associated QGLWidget documentation. Probably useful to update the state of the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> between a <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_0">mousePressEvent()</a> and a <a class="el" href="classqglviewer_1_1MouseGrabber.html#z81_2">mouseReleaseEvent()</a>. See the detailed description section for an example. 
<p>
Reimplemented in <a class="el" href="classqglviewer_1_1ManipulatedCameraFrame.html#z65_1">ManipulatedCameraFrame</a>, and <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#z73_2">ManipulatedFrame</a>.    </td>
  </tr>
</table>
<a name="z81_0" doxytag="qglviewer::MouseGrabber::mousePressEvent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void mousePressEvent </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QMouseEvent *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See the associated QGLWidget documentation. The <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> will probably start an action or change its state when a mouse button is pressed. See the detailed description section for an example. 
<p>
Reimplemented in <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#z73_0">ManipulatedFrame</a>.    </td>
  </tr>
</table>
<a name="z81_2" doxytag="qglviewer::MouseGrabber::mouseReleaseEvent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void mouseReleaseEvent </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QMouseEvent *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See the associated QGLWidget documentation. A probable use of this function will be to desactivate the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a>. See the detailed description section for an example. 
<p>
Reimplemented in <a class="el" href="classqglviewer_1_1ManipulatedCameraFrame.html#z65_0">ManipulatedCameraFrame</a>, and <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#z73_1">ManipulatedFrame</a>.    </td>
  </tr>
</table>
<a name="z79_2" doxytag="qglviewer::MouseGrabber::removeFromMouseGrabberPool"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void removeFromMouseGrabberPool </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Removes the <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> from the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a>. See <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_1">addInMouseGrabberPool()</a> for details. Removing a <a class="el" href="classqglviewer_1_1MouseGrabber.html">MouseGrabber</a> that is not in <a class="el" href="classqglviewer_1_1MouseGrabber.html#z79_4">MouseGrabberPool()</a> has no effect.     </td>
  </tr>
</table>
<a name="z77_2" doxytag="qglviewer::MouseGrabber::setGrabsMouse"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void setGrabsMouse </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const bool&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>flag</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, protected]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The protected method is used to define the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> flag. See the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_1">grabsMouse()</a> and the <a class="el" href="classqglviewer_1_1MouseGrabber.html#z77_0">checkIfGrabsMouse()</a> documentations.     </td>
  </tr>
</table>
<a name="z81_4" doxytag="qglviewer::MouseGrabber::wheelEvent"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void wheelEvent </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">QWheelEvent *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>const <a class="el" href="classqglviewer_1_1Camera.html">Camera</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>const</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
See the associated QGLWidget documentation. Can be useful to implement spinners. 
<p>
Reimplemented in <a class="el" href="classqglviewer_1_1ManipulatedCameraFrame.html#z65_2">ManipulatedCameraFrame</a>, and <a class="el" href="classqglviewer_1_1ManipulatedFrame.html#z73_3">ManipulatedFrame</a>.    </td>
  </tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Wed Feb 11 17:22:07 2004 for libQGLViewer by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.3 </small></address>
</body>
</html>