<!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/vtkBorderRepresentation.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/vtkBorderRepresentation.h</h1><a href="a03663.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: vtkBorderRepresentation.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 __vtkBorderRepresentation_h</span> <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define __vtkBorderRepresentation_h</span> <a name="l00043"></a>00043 <span class="preprocessor"></span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="a03750.html">vtkWidgetRepresentation.h</a>"</span> <a name="l00045"></a>00045 <span class="preprocessor">#include "<a class="code" href="a02219.html">vtkCoordinate.h</a>"</span> <span class="comment">//Because of the viewport coordinate macro</span> <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">class </span><a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a>; <a name="l00048"></a>00048 <span class="keyword">class </span><a class="code" href="a01260.html" title="concrete dataset represents vertices, lines, polygons, and triangle strips">vtkPolyData</a>; <a name="l00049"></a>00049 <span class="keyword">class </span><a class="code" href="a01723.html" title="describes linear transformations via a 4x4 matrix">vtkTransform</a>; <a name="l00050"></a>00050 <span class="keyword">class </span><a class="code" href="a01731.html" title="transform points and associated normals and vectors for polygonal dataset">vtkTransformPolyDataFilter</a>; <a name="l00051"></a>00051 <span class="keyword">class </span><a class="code" href="a01266.html" title="draw vtkPolyData onto the image plane">vtkPolyDataMapper2D</a>; <a name="l00052"></a>00052 <span class="keyword">class </span><a class="code" href="a00093.html" title="a actor that draws 2D data">vtkActor2D</a>; <a name="l00053"></a>00053 <span class="keyword">class </span><a class="code" href="a01323.html" title="represent surface properties of a 2D image">vtkProperty2D</a>; <a name="l00054"></a>00054 <a name="l00055"></a>00055 <a name="l00056"></a><a class="code" href="a00191.html">00056</a> <span class="keyword">class </span><a class="code" href="a02170.html#09e5ba6764f54642494e26907662d55f">VTK_WIDGETS_EXPORT</a> <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a> : <span class="keyword">public</span> <a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a> <a name="l00057"></a>00057 { <a name="l00058"></a>00058 <span class="keyword">public</span>: <a name="l00060"></a>00060 <span class="keyword">static</span> <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>(); <a name="l00061"></a>00061 <a name="l00063"></a>00063 <a name="l00064"></a><a class="code" href="a00191.html#0e71b6e6ffff5c3fe1c4114e5d4604b8">00064</a> vtkTypeRevisionMacro(<a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>,<a class="code" href="a01877.html" title="abstract class defines interface between the widget and widget representation classes...">vtkWidgetRepresentation</a>); <a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="a01877.html#dea6d0138ff965f86cac0a91553ad78f">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00067"></a>00067 <a name="l00069"></a>00069 <a name="l00077"></a>00077 vtkViewportCoordinateMacro(Position); <a name="l00078"></a>00078 vtkViewportCoordinateMacro(Position2); <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="comment">//BTX</span> <a name="l00082"></a><a class="code" href="a00191.html#1566a2b8bd31b00c4e425f4c56e6c9e1b444476ffcedd54ae8b4d1f3a1d54da8">00082</a> <span class="keyword">enum</span> {BORDER_OFF=0,BORDER_ON,BORDER_ACTIVE}; <a name="l00083"></a>00083 <span class="comment">//ETX</span> <a name="l00085"></a>00085 <span class="comment"></span> <a name="l00090"></a>00090 vtkSetClampMacro(ShowBorder,<span class="keywordtype">int</span>,BORDER_OFF,BORDER_ACTIVE); <a name="l00091"></a>00091 vtkGetMacro(ShowBorder,<span class="keywordtype">int</span>); <a name="l00092"></a><a class="code" href="a00191.html#f693ad970674b0c020c2673bc529a6de">00092</a> <span class="keywordtype">void</span> SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);} <a name="l00093"></a><a class="code" href="a00191.html#8fd45b08524bdc0e4302171da04dadc1">00093</a> <span class="keywordtype">void</span> SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);} <a name="l00094"></a><a class="code" href="a00191.html#38b6ce711f991527902df85681241423">00094</a> <span class="keywordtype">void</span> SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);} <a name="l00096"></a>00096 <a name="l00098"></a>00098 <a name="l00099"></a>00099 vtkGetObjectMacro(BorderProperty,<a class="code" href="a01323.html" title="represent surface properties of a 2D image">vtkProperty2D</a>); <a name="l00101"></a>00101 <a name="l00103"></a>00103 <a name="l00108"></a>00108 vtkSetMacro(ProportionalResize,<span class="keywordtype">int</span>); <a name="l00109"></a>00109 vtkGetMacro(ProportionalResize,<span class="keywordtype">int</span>); <a name="l00110"></a>00110 vtkBooleanMacro(ProportionalResize,<span class="keywordtype">int</span>); <a name="l00112"></a>00112 <a name="l00114"></a>00114 <a name="l00117"></a>00117 vtkSetVector2Macro(MinimumSize,<span class="keywordtype">int</span>); <a name="l00118"></a>00118 vtkGetVector2Macro(MinimumSize,<span class="keywordtype">int</span>); <a name="l00119"></a>00119 vtkSetVector2Macro(MaximumSize,<span class="keywordtype">int</span>); <a name="l00120"></a>00120 vtkGetVector2Macro(MaximumSize,<span class="keywordtype">int</span>); <a name="l00122"></a>00122 <a name="l00124"></a>00124 <a name="l00127"></a>00127 vtkSetClampMacro(Tolerance,<span class="keywordtype">int</span>,1,10); <a name="l00128"></a>00128 vtkGetMacro(Tolerance,<span class="keywordtype">int</span>); <a name="l00130"></a>00130 <a name="l00132"></a>00132 <a name="l00134"></a>00134 vtkGetVectorMacro(SelectionPoint,<span class="keywordtype">double</span>,2); <a name="l00136"></a>00136 <a name="l00138"></a>00138 <a name="l00141"></a>00141 vtkSetMacro(Moving,<span class="keywordtype">int</span>); <a name="l00142"></a>00142 vtkGetMacro(Moving,<span class="keywordtype">int</span>); <a name="l00143"></a>00143 vtkBooleanMacro(Moving,<span class="keywordtype">int</span>); <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="comment">//BTX</span> <a name="l00148"></a>00148 <span class="comment"></span> <a name="l00149"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979">00149</a> <span class="keyword">enum</span> <a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979">_InteractionState</a> <a name="l00150"></a>00150 { <a name="l00151"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a2939798437af23d5f80fc558fdeba612cc2bd5">00151</a> Outside=0, <a name="l00152"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979f02642e652b6e4b22672e7ddb25c2233">00152</a> Inside, <a name="l00153"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979dcb1d823da81de77072c6ace39ed8b17">00153</a> AdjustingP0, <a name="l00154"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a2939799d1548c457dc49ac7dcd45fd190d8d36">00154</a> AdjustingP1, <a name="l00155"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979348092d1db65435d7808fc1fd72b5e28">00155</a> AdjustingP2, <a name="l00156"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979fc21acbf73941f38d7381a5e96904aaa">00156</a> AdjustingP3, <a name="l00157"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a2939793699d55a2dc2bc78760802a563378e23">00157</a> AdjustingE0, <a name="l00158"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979f0ce93762ac968797c37addcfb7f400e">00158</a> AdjustingE1, <a name="l00159"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a293979b926640d0abaa632e2b8e65637e93355">00159</a> AdjustingE2, <a name="l00160"></a><a class="code" href="a00191.html#391ce68a5b81ff5f9e8fa4bc8a2939792efd3ed9ab9e2078ffa43305ca373421">00160</a> AdjustingE3 <a name="l00161"></a>00161 }; <a name="l00163"></a>00163 <span class="comment">//ETX</span> <a name="l00164"></a>00164 <a name="l00166"></a>00166 <a name="l00168"></a>00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#a7dfbf5a2b39487c072266e0e1520ec7">BuildRepresentation</a>(); <a name="l00169"></a>00169 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#9aece0d7ff74c1fcfd5f427088cab77b">StartWidgetInteraction</a>(<span class="keywordtype">double</span> eventPos[2]); <a name="l00170"></a>00170 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#73adbf84d1745e1393eda384a5f31d52">WidgetInteraction</a>(<span class="keywordtype">double</span> eventPos[2]); <a name="l00171"></a><a class="code" href="a00191.html#05011db793b24bea2b33def2fad40fff">00171</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> GetSize(<span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e3d5e7c015dff08d8daf72a0102e1444">size</a>[2]) <a name="l00172"></a>00172 {size[0]=1.0; size[1]=1.0;} <a name="l00173"></a>00173 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#b0aeed71d0331ae3e5c6472572f3900b">ComputeInteractionState</a>(<span class="keywordtype">int</span> X, <span class="keywordtype">int</span> Y, <span class="keywordtype">int</span> modify=0); <a name="l00175"></a>00175 <a name="l00177"></a>00177 <a name="l00179"></a>00179 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#deb781ee0b2e05240de3b1d099346714">GetActors2D</a>(<a class="code" href="a01321.html" title="a list of Props">vtkPropCollection</a>*); <a name="l00180"></a>00180 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#a5428644337fcf61013390e6d619ff9f">ReleaseGraphicsResources</a>(<a class="code" href="a01886.html" title="window superclass for vtkRenderWindow">vtkWindow</a>*); <a name="l00181"></a>00181 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#01e90cbe6f75838c27c1d1c0c5e37521">RenderOverlay</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a>*); <a name="l00182"></a>00182 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#5db136973bcd6232d212eeb1afcd0354">RenderOpaqueGeometry</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a>*); <a name="l00183"></a>00183 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#72c591ce53e9320977850735a4057870">RenderTranslucentPolygonalGeometry</a>(<a class="code" href="a01833.html" title="abstract specification for Viewports">vtkViewport</a>*); <a name="l00184"></a>00184 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#8b7761451b47996f96aacab32882ca25">HasTranslucentPolygonalGeometry</a>(); <a name="l00186"></a>00186 <a name="l00187"></a>00187 <span class="keyword">protected</span>: <a name="l00188"></a>00188 <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>(); <a name="l00189"></a>00189 ~<a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>(); <a name="l00190"></a>00190 <a name="l00191"></a>00191 <span class="comment">// Ivars</span> <a name="l00192"></a><a class="code" href="a00191.html#77683cbd8492f57ae260b0eddeaf1d07">00192</a> <span class="keywordtype">int</span> ShowBorder; <a name="l00193"></a><a class="code" href="a00191.html#ec967c9821c70a627053db8f44dc2853">00193</a> <a class="code" href="a01323.html" title="represent surface properties of a 2D image">vtkProperty2D</a> *BorderProperty; <a name="l00194"></a><a class="code" href="a00191.html#f2dea39928e2a6785560ac7d4ef22181">00194</a> <span class="keywordtype">int</span> ProportionalResize; <a name="l00195"></a><a class="code" href="a00191.html#0ac132267bea9f00d3e1de68ce93d24d">00195</a> <span class="keywordtype">int</span> Tolerance; <a name="l00196"></a><a class="code" href="a00191.html#8aadb86d7322eea6d4f3b44e9db63302">00196</a> <span class="keywordtype">int</span> Moving; <a name="l00197"></a><a class="code" href="a00191.html#c35a1a55eb60c99d7900aa3f3f8f8932">00197</a> <span class="keywordtype">double</span> SelectionPoint[2]; <a name="l00198"></a>00198 <a name="l00199"></a>00199 <span class="comment">// Layout (position of lower left and upper right corners of border)</span> <a name="l00200"></a><a class="code" href="a00191.html#6b336b8a7d32cf529cda884654cd457b">00200</a> <a class="code" href="a00335.html" title="perform coordinate transformation, and represent position, in a variety of vtk coordinate...">vtkCoordinate</a> *PositionCoordinate; <a name="l00201"></a><a class="code" href="a00191.html#5aeefd6b14b941bbeb2a67671187fa82">00201</a> <a class="code" href="a00335.html" title="perform coordinate transformation, and represent position, in a variety of vtk coordinate...">vtkCoordinate</a> *Position2Coordinate; <a name="l00202"></a>00202 <a name="l00203"></a>00203 <span class="comment">// Sometimes subclasses must negotiate with their superclasses</span> <a name="l00204"></a>00204 <span class="comment">// to achieve the correct layout.</span> <a name="l00205"></a><a class="code" href="a00191.html#cc79ca98739e2f037a5f53e74adf97b8">00205</a> <span class="keywordtype">int</span> Negotiated; <a name="l00206"></a>00206 <span class="keyword">virtual</span> <span class="keywordtype">void</span> NegotiateLayout(); <a name="l00207"></a>00207 <a name="l00208"></a>00208 <span class="comment">// Keep track of start position when moving border</span> <a name="l00209"></a><a class="code" href="a00191.html#7b460bd04f758d60bdd774cf4e93e30e">00209</a> <span class="keywordtype">double</span> StartPosition[2]; <a name="l00210"></a>00210 <a name="l00211"></a>00211 <span class="comment">// Border representation. Subclasses may use the BWTransform class</span> <a name="l00212"></a>00212 <span class="comment">// to transform their geometry into the region surrounded by the border.</span> <a name="l00213"></a><a class="code" href="a00191.html#092e35908ce9d717d6f332d3407b7a8f">00213</a> <a class="code" href="a01250.html" title="represent and manipulate 3D points">vtkPoints</a> *BWPoints; <a name="l00214"></a><a class="code" href="a00191.html#cfea770d8a29fbdedda9f2c391bdf7e1">00214</a> <a class="code" href="a01260.html" title="concrete dataset represents vertices, lines, polygons, and triangle strips">vtkPolyData</a> *BWPolyData; <a name="l00215"></a><a class="code" href="a00191.html#4fa82e1e9a1de0d266954cc57f7baac5">00215</a> <a class="code" href="a01723.html" title="describes linear transformations via a 4x4 matrix">vtkTransform</a> *BWTransform; <a name="l00216"></a><a class="code" href="a00191.html#78063c3cc3ae201df5d20ee4d3613f9e">00216</a> <a class="code" href="a01731.html" title="transform points and associated normals and vectors for polygonal dataset">vtkTransformPolyDataFilter</a> *BWTransformFilter; <a name="l00217"></a><a class="code" href="a00191.html#3297e5a205983309189b5e6c46fcb2cf">00217</a> <a class="code" href="a01266.html" title="draw vtkPolyData onto the image plane">vtkPolyDataMapper2D</a> *BWMapper; <a name="l00218"></a><a class="code" href="a00191.html#6674e2aab1311b064c30cc3b48ec3db1">00218</a> <a class="code" href="a00093.html" title="a actor that draws 2D data">vtkActor2D</a> *BWActor; <a name="l00219"></a>00219 <a name="l00220"></a>00220 <span class="comment">// Constraints on size</span> <a name="l00221"></a><a class="code" href="a00191.html#0cef42222c00518ed1d2502843da6564">00221</a> <span class="keywordtype">int</span> MinimumSize[2]; <a name="l00222"></a><a class="code" href="a00191.html#978872d56ebd6ef2056b9f27f88463fa">00222</a> <span class="keywordtype">int</span> MaximumSize[2]; <a name="l00223"></a>00223 <a name="l00224"></a>00224 <span class="keyword">private</span>: <a name="l00225"></a>00225 <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>(<span class="keyword">const</span> <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00226"></a>00226 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a00191.html" title="represent a vtkBorderWidget">vtkBorderRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00227"></a>00227 }; <a name="l00228"></a>00228 <a name="l00229"></a>00229 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:52 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>