<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>VTK: dox/Rendering/vtkInteractorObserver.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <h1>dox/Rendering/vtkInteractorObserver.h</h1><a href="a03423.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Visualization Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: vtkInteractorObserver.h,v $</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment"> Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen</span> <a name="l00007"></a>00007 <span class="comment"> All rights reserved.</span> <a name="l00008"></a>00008 <span class="comment"> See Copyright.txt or http://www.kitware.com/Copyright.htm for details.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even</span> <a name="l00011"></a>00011 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</span> <a name="l00012"></a>00012 <span class="comment"> PURPOSE. See the above copyright notice for more information.</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment">=========================================================================*/</span> <a name="l00047"></a>00047 <span class="preprocessor">#ifndef __vtkInteractorObserver_h</span> <a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define __vtkInteractorObserver_h</span> <a name="l00049"></a>00049 <span class="preprocessor"></span> <a name="l00050"></a>00050 <span class="preprocessor">#include "<a class="code" href="a02079.html">vtkObject.h</a>"</span> <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keyword">class </span><a class="code" href="a01491.html" title="platform-independent render window interaction including picking and frame rate control...">vtkRenderWindowInteractor</a>; <a name="l00053"></a>00053 <span class="keyword">class </span><a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>; <a name="l00054"></a>00054 <span class="keyword">class </span><a class="code" href="a00226.html" title="supports function callbacks">vtkCallbackCommand</a>; <a name="l00055"></a>00055 <span class="keyword">class </span><a class="code" href="a01091.html" title="manage contention for cursors and other resources">vtkObserverMediator</a>; <a name="l00056"></a>00056 <a name="l00057"></a>00057 <a name="l00058"></a><a class="code" href="a00902.html">00058</a> <span class="keyword">class </span><a class="code" href="a02170.html#4019f67b2e7d601f2cf984e448308dbb">VTK_RENDERING_EXPORT</a> <a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a> : <span class="keyword">public</span> <a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a> <a name="l00059"></a>00059 { <a name="l00060"></a>00060 <span class="keyword">public</span>: <a name="l00061"></a><a class="code" href="a00902.html#30ef163999105e35a0e83723c7233228">00061</a> vtkTypeRevisionMacro(<a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>,<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>); <a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="a01084.html#bf3dbb4154289b56a12483eee3866263">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00063"></a>00063 <a name="l00065"></a>00065 <a name="l00071"></a><a class="code" href="a00902.html#b43191e675e294441a76efa7e4f884d9">00071</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetEnabled(<span class="keywordtype">int</span>) {}; <a name="l00072"></a><a class="code" href="a00902.html#37aa7d2d0b651dbe7d0f4d5d46c910f8">00072</a> <span class="keywordtype">int</span> GetEnabled() {<span class="keywordflow">return</span> this->Enabled;} <a name="l00073"></a><a class="code" href="a00902.html#1e1599a365ba9662c0e7263617e839e0">00073</a> <span class="keywordtype">void</span> EnabledOn() {this->SetEnabled(1);} <a name="l00074"></a><a class="code" href="a00902.html#0dd21e1f9c916b37e2d4601203f321be">00074</a> <span class="keywordtype">void</span> EnabledOff() {this->SetEnabled(0);} <a name="l00075"></a><a class="code" href="a00902.html#e2e2fe8d3357ce76c75f056aecae30f2">00075</a> <span class="keywordtype">void</span> On() {this->SetEnabled(1);} <a name="l00076"></a><a class="code" href="a00902.html#cbb83598302fe928e1be539efe934f11">00076</a> <span class="keywordtype">void</span> Off() {this->SetEnabled(0);} <a name="l00078"></a>00078 <a name="l00080"></a>00080 <a name="l00085"></a>00085 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetInteractor(<a class="code" href="a01491.html" title="platform-independent render window interaction including picking and frame rate control...">vtkRenderWindowInteractor</a>* iren); <a name="l00086"></a>00086 vtkGetObjectMacro(Interactor, <a class="code" href="a01491.html" title="platform-independent render window interaction including picking and frame rate control...">vtkRenderWindowInteractor</a>); <a name="l00088"></a>00088 <a name="l00090"></a>00090 <a name="l00098"></a>00098 vtkSetClampMacro(Priority,<span class="keywordtype">float</span>,0.0f,1.0f); <a name="l00099"></a>00099 vtkGetMacro(Priority,<span class="keywordtype">float</span>); <a name="l00101"></a>00101 <a name="l00103"></a>00103 <a name="l00107"></a>00107 vtkSetMacro(KeyPressActivation,<span class="keywordtype">int</span>); <a name="l00108"></a>00108 vtkGetMacro(KeyPressActivation,<span class="keywordtype">int</span>); <a name="l00109"></a>00109 vtkBooleanMacro(KeyPressActivation,<span class="keywordtype">int</span>); <a name="l00111"></a>00111 <a name="l00113"></a>00113 <a name="l00119"></a>00119 vtkSetMacro(KeyPressActivationValue,<span class="keywordtype">char</span>); <a name="l00120"></a>00120 vtkGetMacro(KeyPressActivationValue,<span class="keywordtype">char</span>); <a name="l00122"></a>00122 <a name="l00124"></a>00124 <a name="l00130"></a>00130 vtkGetObjectMacro(DefaultRenderer,<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>); <a name="l00131"></a>00131 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetDefaultRenderer(<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>*); <a name="l00133"></a>00133 <a name="l00135"></a>00135 <a name="l00143"></a>00143 vtkGetObjectMacro(CurrentRenderer,<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>); <a name="l00144"></a>00144 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetCurrentRenderer(<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>*); <a name="l00146"></a>00146 <a name="l00148"></a>00148 <span class="keyword">virtual</span> <span class="keywordtype">void</span> OnChar(); <a name="l00149"></a>00149 <a name="l00151"></a>00151 <a name="l00153"></a>00153 <span class="keyword">static</span> <span class="keywordtype">void</span> ComputeDisplayToWorld(<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren, <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <a name="l00154"></a>00154 <span class="keywordtype">double</span> z, <span class="keywordtype">double</span> worldPt[4]); <a name="l00155"></a>00155 <span class="keyword">static</span> <span class="keywordtype">void</span> ComputeWorldToDisplay(<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren, <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <a name="l00156"></a>00156 <span class="keywordtype">double</span> z, <span class="keywordtype">double</span> displayPt[3]); <a name="l00158"></a>00158 <a name="l00160"></a>00160 <a name="l00168"></a>00168 <span class="keywordtype">void</span> GrabFocus(<a class="code" href="a00291.html" title="superclass for callback/observer methods">vtkCommand</a> *mouseEvents, <a class="code" href="a00291.html" title="superclass for callback/observer methods">vtkCommand</a> *keypressEvents=NULL); <a name="l00169"></a>00169 <span class="keywordtype">void</span> ReleaseFocus(); <a name="l00170"></a>00170 <span class="comment">//ETX</span> <a name="l00172"></a>00172 <span class="comment"></span> <a name="l00173"></a>00173 <span class="keyword">protected</span>: <a name="l00174"></a>00174 <a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>(); <a name="l00175"></a>00175 ~<a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>(); <a name="l00176"></a>00176 <a name="l00178"></a>00178 <a name="l00181"></a>00181 <span class="keyword">virtual</span> <span class="keywordtype">void</span> StartInteraction(); <a name="l00182"></a>00182 <span class="keyword">virtual</span> <span class="keywordtype">void</span> EndInteraction(); <a name="l00184"></a>00184 <a name="l00186"></a>00186 <a name="l00188"></a>00188 <span class="keyword">static</span> <span class="keywordtype">void</span> ProcessEvents(<a class="code" href="a01084.html" title="abstract base class for most VTK objects">vtkObject</a>* <span class="keywordtype">object</span>, <a name="l00189"></a>00189 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> event, <a name="l00190"></a>00190 <span class="keywordtype">void</span>* clientdata, <a name="l00191"></a>00191 <span class="keywordtype">void</span>* calldata); <a name="l00193"></a>00193 <a name="l00195"></a>00195 <a name="l00196"></a>00196 <span class="keywordtype">void</span> ComputeDisplayToWorld(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z, <a name="l00197"></a>00197 <span class="keywordtype">double</span> worldPt[4]); <a name="l00198"></a>00198 <span class="keywordtype">void</span> ComputeWorldToDisplay(<span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y, <span class="keywordtype">double</span> z, <a name="l00199"></a>00199 <span class="keywordtype">double</span> displayPt[3]); <a name="l00201"></a>00201 <a name="l00202"></a>00202 <span class="comment">// The state of the widget, whether on or off (observing events or not)</span> <a name="l00203"></a><a class="code" href="a00902.html#6f627f6aabcdd64c205183239098e1bf">00203</a> <span class="keywordtype">int</span> Enabled; <a name="l00204"></a>00204 <a name="l00205"></a>00205 <span class="comment">// Used to process events</span> <a name="l00206"></a><a class="code" href="a00902.html#23c69f660da15293fdcdb0aac8a18f81">00206</a> <a class="code" href="a00226.html" title="supports function callbacks">vtkCallbackCommand</a>* EventCallbackCommand; <span class="comment">//subclasses use one</span> <a name="l00207"></a><a class="code" href="a00902.html#700270dde62a29f97e8254f02faa5558">00207</a> <a class="code" href="a00226.html" title="supports function callbacks">vtkCallbackCommand</a>* KeyPressCallbackCommand; <span class="comment">//listens to key activation</span> <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="comment">// Priority at which events are processed</span> <a name="l00210"></a><a class="code" href="a00902.html#e4837790785a1158efbf62191506564b">00210</a> <span class="keywordtype">float</span> Priority; <a name="l00211"></a>00211 <a name="l00212"></a>00212 <span class="comment">// Keypress activation controls</span> <a name="l00213"></a><a class="code" href="a00902.html#0b3e5ee9edb9e4c7e016e628872130f3">00213</a> <span class="keywordtype">int</span> KeyPressActivation; <a name="l00214"></a><a class="code" href="a00902.html#7f89a1783e34ba9684c8e8b300641bb2">00214</a> <span class="keywordtype">char</span> KeyPressActivationValue; <a name="l00215"></a>00215 <a name="l00216"></a>00216 <span class="comment">// Used to associate observers with the interactor</span> <a name="l00217"></a><a class="code" href="a00902.html#ee5ce6d55d8ea88fa0f210f46bfa6d68">00217</a> <a class="code" href="a01491.html" title="platform-independent render window interaction including picking and frame rate control...">vtkRenderWindowInteractor</a> *Interactor; <a name="l00218"></a>00218 <a name="l00219"></a>00219 <span class="comment">// Internal ivars for processing events</span> <a name="l00220"></a><a class="code" href="a00902.html#3ef2c29da4b1916d4c50cf5f6a81c5fe">00220</a> <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *CurrentRenderer; <a name="l00221"></a><a class="code" href="a00902.html#6c23d97509e04a1d274903f0a652a280">00221</a> <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *DefaultRenderer; <a name="l00222"></a>00222 <a name="l00223"></a><a class="code" href="a00902.html#9d13954f425a8561d93878296258af8c">00223</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> CharObserverTag; <a name="l00224"></a><a class="code" href="a00902.html#b7372f7c33b787f43f84c29c92255bdf">00224</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> DeleteObserverTag; <a name="l00225"></a>00225 <a name="l00226"></a>00226 <span class="comment">// The mediator used to request resources from the interactor.</span> <a name="l00227"></a><a class="code" href="a00902.html#a0119f13cc5bad77b0a7bc18a65e3bdc">00227</a> <a class="code" href="a01091.html" title="manage contention for cursors and other resources">vtkObserverMediator</a> *ObserverMediator; <a name="l00228"></a>00228 <span class="keywordtype">int</span> RequestCursorShape(<span class="keywordtype">int</span> requestedShape); <a name="l00229"></a>00229 <a name="l00230"></a>00230 <span class="keyword">private</span>: <a name="l00231"></a>00231 <a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>(<span class="keyword">const</span> <a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>&); <span class="comment">// Not implemented.</span> <a name="l00232"></a>00232 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00902.html" title="an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor...">vtkInteractorObserver</a>&); <span class="comment">// Not implemented.</span> <a name="l00233"></a>00233 <a name="l00234"></a>00234 }; <a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:46 2009 for VTK by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> </body> </html>