<!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/Widgets/vtkWidgetRepresentation.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/Widgets/vtkWidgetRepresentation.h</h1><a href="a03750.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: vtkWidgetRepresentation.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="l00041"></a>00041 <span class="preprocessor">#ifndef __vtkWidgetRepresentation_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define __vtkWidgetRepresentation_h</span> <a name="l00043"></a>00043 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="a02113.html">vtkProp.h</a>"</span> <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>; <a name="l00047"></a>00047 <a name="l00048"></a>00048 <a name="l00049"></a><a class="code" href="a01877.html">00049</a> <span class="keyword">class </span><a class="code" href="a02170.html#09e5ba6764f54642494e26907662d55f">VTK_WIDGETS_EXPORT</a> <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a> : <span class="keyword">public</span> <a class="code" href="a01317.html" title="abstract superclass for all actors, volumes and annotations">vtkProp</a> <a name="l00050"></a>00050 { <a name="l00051"></a>00051 <span class="keyword">public</span>: <a name="l00053"></a>00053 <a name="l00054"></a><a class="code" href="a01877.html#7b6d273bf22eec5f99a88a0e81cde112">00054</a> vtkTypeRevisionMacro(<a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>,<a class="code" href="a01317.html" title="abstract superclass for all actors, volumes and annotations">vtkProp</a>); <a name="l00055"></a>00055 <span class="keywordtype">void</span> <a class="code" href="a01317.html#68159056e27c3e2c4b372f6bd253e3f9">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00057"></a>00057 <a name="l00059"></a>00059 <a name="l00067"></a>00067 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetRenderer(<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *ren); <a name="l00068"></a>00068 vtkGetObjectMacro(Renderer,<a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a>); <a name="l00069"></a>00069 <span class="keyword">virtual</span> <span class="keywordtype">void</span> BuildRepresentation() = 0; <a name="l00071"></a>00071 <a name="l00073"></a>00073 <a name="l00099"></a><a class="code" href="a01877.html#dbe69d604d5e458504229326abeecd3b">00099</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> PlaceWidget(<span class="keywordtype">double</span>* vtkNotUsed(bounds[6])) {} <a name="l00100"></a><a class="code" href="a01877.html#9aece0d7ff74c1fcfd5f427088cab77b">00100</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> StartWidgetInteraction(<span class="keywordtype">double</span> eventPos[2]) { (void)eventPos; } <a name="l00101"></a><a class="code" href="a01877.html#73adbf84d1745e1393eda384a5f31d52">00101</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> WidgetInteraction(<span class="keywordtype">double</span> newEventPos[2]) { (void)newEventPos; } <a name="l00102"></a><a class="code" href="a01877.html#879e55c5bac3cc9a471140addd500900">00102</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> EndWidgetInteraction(<span class="keywordtype">double</span> newEventPos[2]) { (void)newEventPos; } <a name="l00103"></a>00103 <span class="keyword">virtual</span> <span class="keywordtype">int</span> ComputeInteractionState(<span class="keywordtype">int</span> X, <span class="keywordtype">int</span> Y, <span class="keywordtype">int</span> modify=0); <a name="l00104"></a><a class="code" href="a01877.html#0994e3df6b10aa489984e308480d3c26">00104</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> GetInteractionState() <a name="l00105"></a>00105 {<span class="keywordflow">return</span> this->InteractionState;} <a name="l00106"></a><a class="code" href="a01877.html#4bccab4646d6c0f19d8888a3db9845ff">00106</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> Highlight(<span class="keywordtype">int</span> vtkNotUsed(highlightOn)) {} <a name="l00108"></a>00108 <a name="l00110"></a>00110 <a name="l00116"></a>00116 vtkSetClampMacro(PlaceFactor,<span class="keywordtype">double</span>,0.01,<a class="code" href="a02149.html#a933eb1ff8ef089de59cce7b41e21261">VTK_DOUBLE_MAX</a>); <a name="l00117"></a>00117 vtkGetMacro(PlaceFactor,<span class="keywordtype">double</span>); <a name="l00119"></a>00119 <a name="l00121"></a>00121 <a name="l00129"></a>00129 vtkSetClampMacro(HandleSize,<span class="keywordtype">double</span>,0.001,1000); <a name="l00130"></a>00130 vtkGetMacro(HandleSize,<span class="keywordtype">double</span>); <a name="l00132"></a>00132 <a name="l00134"></a>00134 <a name="l00136"></a>00136 vtkGetMacro( NeedToRender, <span class="keywordtype">int</span> ); <a name="l00137"></a>00137 vtkSetClampMacro( NeedToRender, <span class="keywordtype">int</span>, 0, 1 ); <a name="l00138"></a>00138 vtkBooleanMacro( NeedToRender, <span class="keywordtype">int</span> ); <a name="l00140"></a>00140 <a name="l00142"></a>00142 <a name="l00149"></a><a class="code" href="a01877.html#32efe13a1f1627c90bde36414bd9df9a">00149</a> <span class="keyword">virtual</span> <span class="keywordtype">double</span> *<a class="code" href="a01317.html#7e1d63e4282aa0a2f78c8bb3cc835368">GetBounds</a>() {<span class="keywordflow">return</span> NULL;} <a name="l00150"></a>00150 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01317.html#e35249f4300af02ba868489ff25f3a2b">ShallowCopy</a>(<a class="code" href="a01317.html" title="abstract superclass for all actors, volumes and annotations">vtkProp</a> *prop); <a name="l00151"></a><a class="code" href="a01877.html#941529adca4ea1e3152ecbd7657aed6f">00151</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01317.html#d4cbf8fa634a622b9e1419d897a4bd7f">GetActors</a>(<a class="code" href="a01321.html" title="a list of Props">vtkPropCollection</a> *) {} <a name="l00152"></a><a class="code" href="a01877.html#deb781ee0b2e05240de3b1d099346714">00152</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01317.html#f8df3a3e67b6d97748bb1a6505265218">GetActors2D</a>(<a class="code" href="a01321.html" title="a list of Props">vtkPropCollection</a> *) {} <a name="l00153"></a><a class="code" href="a01877.html#2dd9b9e03f7cdde3c032a0f6a27d5f63">00153</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01317.html#d8504a3b3d437b0fba4cb3ada9110604">GetVolumes</a>(<a class="code" href="a01321.html" title="a list of Props">vtkPropCollection</a> *) {} <a name="l00154"></a><a class="code" href="a01877.html#a5428644337fcf61013390e6d619ff9f">00154</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01317.html#f2034bece75524dfa42553396d208a22">ReleaseGraphicsResources</a>(<a class="code" href="a01886.html" title="window superclass for vtkRenderWindow">vtkWindow</a> *) {} <a name="l00155"></a><a class="code" href="a01877.html#01e90cbe6f75838c27c1d1c0c5e37521">00155</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01317.html#d7e0fa1336c19247f11a73b4ebaddf13">RenderOverlay</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a> *vtkNotUsed(viewport)) {<span class="keywordflow">return</span> 0;} <a name="l00156"></a><a class="code" href="a01877.html#5db136973bcd6232d212eeb1afcd0354">00156</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01317.html#4d7c8be45744400fba096728ce81f33a">RenderOpaqueGeometry</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a> *vtkNotUsed(viewport)) {<span class="keywordflow">return</span> 0;} <a name="l00157"></a><a class="code" href="a01877.html#72c591ce53e9320977850735a4057870">00157</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01317.html#cf64ca8da81629df108f095c6535548e">RenderTranslucentPolygonalGeometry</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a> *vtkNotUsed(viewport)) {<span class="keywordflow">return</span> 0;} <a name="l00158"></a><a class="code" href="a01877.html#ad30968d6bf3c9749ca16e2231a6b04a">00158</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01317.html#b7b90eeef384ac8072748f42d2c25ff2">RenderVolumetricGeometry</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a> *vtkNotUsed(viewport)) {<span class="keywordflow">return</span> 0;} <a name="l00159"></a><a class="code" href="a01877.html#8b7761451b47996f96aacab32882ca25">00159</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01317.html#6e32af79f4756a287a61017b7c2f7364">HasTranslucentPolygonalGeometry</a>() { <span class="keywordflow">return</span> 0; } <a name="l00161"></a>00161 <a name="l00162"></a>00162 <span class="keyword">protected</span>: <a name="l00163"></a>00163 <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>(); <a name="l00164"></a>00164 ~<a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>(); <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="comment">// The renderer in which this widget is placed</span> <a name="l00167"></a><a class="code" href="a01877.html#4fb4ea74970391cff668ee67e1ed77ee">00167</a> <a class="code" href="a01480.html" title="abstract specification for renderers">vtkRenderer</a> *Renderer; <a name="l00168"></a>00168 <a name="l00169"></a>00169 <span class="comment">// The state of this representation based on a recent event</span> <a name="l00170"></a><a class="code" href="a01877.html#8cfc168ec7a4ff6910fff77389d227b4">00170</a> <span class="keywordtype">int</span> InteractionState; <a name="l00171"></a>00171 <a name="l00172"></a>00172 <span class="comment">// These are used to track the beginning of interaction with the representation</span> <a name="l00173"></a>00173 <span class="comment">// It's dimensioned [3] because some events re processed in 3D.</span> <a name="l00174"></a><a class="code" href="a01877.html#127e9c0daf1706092fdc94685b271112">00174</a> <span class="keywordtype">double</span> StartEventPosition[3]; <a name="l00175"></a>00175 <a name="l00176"></a>00176 <span class="comment">// Instance variable and members supporting suclasses</span> <a name="l00177"></a><a class="code" href="a01877.html#e036d819f70ac213ae6ab2a092f2dadb">00177</a> <span class="keywordtype">double</span> PlaceFactor; <span class="comment">// Used to control how widget is placed around bounding box</span> <a name="l00178"></a><a class="code" href="a01877.html#3be39c801577684ce9cf5fffa2617b74">00178</a> <span class="keywordtype">int</span> Placed; <span class="comment">// Indicate whether widget has been placed</span> <a name="l00179"></a>00179 <span class="keywordtype">void</span> AdjustBounds(<span class="keywordtype">double</span> bounds[6], <span class="keywordtype">double</span> newBounds[6], <span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d2107cf190fdac7e1fa1890c67ec92d414d6">center</a>[3]); <a name="l00180"></a><a class="code" href="a01877.html#97801d972522ee77ab738c1c8fdc1450">00180</a> <span class="keywordtype">double</span> InitialBounds[6]; <span class="comment">//initial bounds on place widget (valid after PlaceWidget)</span> <a name="l00181"></a><a class="code" href="a01877.html#784978ba895aca13bea5dbb8080f73e6">00181</a> <span class="keywordtype">double</span> InitialLength; <span class="comment">//initial length on place widget</span> <a name="l00182"></a>00182 <a name="l00183"></a>00183 <span class="comment">// Sizing handles is tricky because the procedure requires information</span> <a name="l00184"></a>00184 <span class="comment">// relative to the last pick, as well as a live renderer to perform</span> <a name="l00185"></a>00185 <span class="comment">// coordinate conversions. In some cases, a pick is never made so handle</span> <a name="l00186"></a>00186 <span class="comment">// sizing has to follow a different path. The following ivars help with</span> <a name="l00187"></a>00187 <span class="comment">// this process.</span> <a name="l00188"></a><a class="code" href="a01877.html#c1b1fb8c9d98930617afaa2e6c63448e">00188</a> <span class="keywordtype">int</span> ValidPick; <span class="comment">//indicate when valid picks are made</span> <a name="l00189"></a>00189 <a name="l00190"></a>00190 <span class="comment">// Members use to control handle size. The two methods return a "radius"</span> <a name="l00191"></a>00191 <span class="comment">// in world coordinates. Note that the HandleSize data member is used</span> <a name="l00192"></a>00192 <span class="comment">// internal to the SizeHandles__() methods.</span> <a name="l00193"></a><a class="code" href="a01877.html#be2f42f49970424b9f35d0d20d646770">00193</a> <span class="keywordtype">double</span> HandleSize; <span class="comment">//controlling relative size of widget handles</span> <a name="l00194"></a>00194 <span class="keywordtype">double</span> SizeHandlesRelativeToViewport(<span class="keywordtype">double</span> factor, <span class="keywordtype">double</span> pos[3]); <a name="l00195"></a>00195 <span class="keywordtype">double</span> SizeHandlesInPixels(<span class="keywordtype">double</span> factor,<span class="keywordtype">double</span> pos[3]); <a name="l00196"></a>00196 <a name="l00197"></a>00197 <span class="comment">// Try and reduce multiple renders</span> <a name="l00198"></a><a class="code" href="a01877.html#3826597677ee1830436ab0500b1bb2d7">00198</a> <span class="keywordtype">int</span> NeedToRender; <a name="l00199"></a>00199 <a name="l00200"></a>00200 <span class="comment">// This is the time that the representation was built. This data member</span> <a name="l00201"></a>00201 <span class="comment">// can be used to reduce the time spent building the widget.</span> <a name="l00202"></a><a class="code" href="a01877.html#b1dc7e72b346a9bc71f92caf46a29807">00202</a> <a class="code" href="a01719.html" title="record modification and/or execution time">vtkTimeStamp</a> BuildTime; <a name="l00203"></a>00203 <a name="l00204"></a>00204 <span class="keyword">private</span>: <a name="l00205"></a>00205 <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>(<span class="keyword">const</span> <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00206"></a>00206 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00207"></a>00207 }; <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:57 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>