<!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/vtkSphereHandleRepresentation.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/vtkSphereHandleRepresentation.h</h1><a href="a03736.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: vtkSphereHandleRepresentation.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="l00029"></a>00029 <span class="preprocessor">#ifndef __vtkSphereHandleRepresentation_h</span> <a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define __vtkSphereHandleRepresentation_h</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="a03692.html">vtkHandleRepresentation.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="a02663.html">vtkSphereSource.h</a>"</span> <span class="comment">// Needed for delegation to sphere</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="a01582.html" title="create a polygonal sphere centered at the origin">vtkSphereSource</a>; <a name="l00036"></a>00036 <span class="keyword">class </span><a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>; <a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="a00092.html" title="represents an object (geometry &amp; properties) in a rendered scene">vtkActor</a>; <a name="l00038"></a>00038 <span class="keyword">class </span><a class="code" href="a01265.html" title="map vtkPolyData to graphics primitives">vtkPolyDataMapper</a>; <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="a00251.html" title="select a cell by shooting a ray into graphics window">vtkCellPicker</a>; <a name="l00040"></a>00040 <a name="l00041"></a><a class="code" href="a01578.html">00041</a> <span class="keyword">class </span><a class="code" href="a02170.html#09e5ba6764f54642494e26907662d55f">VTK_WIDGETS_EXPORT</a> <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a> <a name="l00042"></a>00042 : <span class="keyword">public</span> <a class="code" href="a00678.html" title="abstract class for representing widget handles">vtkHandleRepresentation</a> <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="keyword">public</span>: <a name="l00046"></a>00046 <span class="keyword">static</span> <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a> *<a class="code" href="a01084.html#4d5b227267c076d6f9e38483370b6612">New</a>(); <a name="l00047"></a>00047 <a name="l00049"></a>00049 <a name="l00050"></a><a class="code" href="a01578.html#4991e607b4344145a7899dd3042c508e">00050</a> vtkTypeRevisionMacro(<a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>,<a class="code" href="a00678.html" title="abstract class for representing widget handles">vtkHandleRepresentation</a>); <a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="a00678.html#1cb17c998d1cbe60ce9a59b9663bd89c">PrintSelf</a>(ostream& os, <a class="code" href="a00869.html" title="a simple class to control print indentation">vtkIndent</a> indent); <a name="l00053"></a>00053 <a name="l00055"></a>00055 <a name="l00060"></a>00060 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00678.html#b63c49030b25d2eb13536386ea97690f">SetWorldPosition</a>(<span class="keywordtype">double</span> p[3]); <a name="l00061"></a>00061 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00678.html#83befe7ccbcb67611a92111d3f2b771a">SetDisplayPosition</a>(<span class="keywordtype">double</span> p[3]); <a name="l00063"></a>00063 <a name="l00065"></a>00065 <a name="l00071"></a>00071 vtkSetMacro(TranslationMode,<span class="keywordtype">int</span>); <a name="l00072"></a>00072 vtkGetMacro(TranslationMode,<span class="keywordtype">int</span>); <a name="l00073"></a>00073 vtkBooleanMacro(TranslationMode,<span class="keywordtype">int</span>); <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keywordtype">void</span> SetSphereRadius(<span class="keywordtype">double</span>); <a name="l00077"></a>00077 <span class="keywordtype">double</span> GetSphereRadius(); <a name="l00078"></a>00078 <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keywordtype">void</span> SetProperty(<a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>*); <a name="l00082"></a>00082 <span class="keywordtype">void</span> SetSelectedProperty(<a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>*); <a name="l00083"></a>00083 vtkGetObjectMacro(Property,<a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>); <a name="l00084"></a>00084 vtkGetObjectMacro(SelectedProperty,<a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a>); <a name="l00086"></a>00086 <a name="l00088"></a>00088 <a name="l00092"></a>00092 vtkSetClampMacro(HotSpotSize,<span class="keywordtype">double</span>,0.0,1.0); <a name="l00093"></a>00093 vtkGetMacro(HotSpotSize,<span class="keywordtype">double</span>); <a name="l00095"></a>00095 <a name="l00098"></a>00098 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#64db5b1135522d7db8d8df6025c1a60e">SetHandleSize</a>(<span class="keywordtype">double</span> <a class="code" href="a03761.html#c6551f7bf833e8254b2b3ecdaea0d210e3d5e7c015dff08d8daf72a0102e1444">size</a>); <a name="l00099"></a>00099 <a name="l00101"></a>00101 <a name="l00103"></a>00103 <span class="keyword">virtual</span> <span class="keywordtype">double</span> *<a class="code" href="a01877.html#32efe13a1f1627c90bde36414bd9df9a">GetBounds</a>(); <a name="l00104"></a>00104 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#a7dfbf5a2b39487c072266e0e1520ec7">BuildRepresentation</a>(); <a name="l00105"></a>00105 <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="l00106"></a>00106 <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="l00107"></a>00107 <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="l00108"></a>00108 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#dbe69d604d5e458504229326abeecd3b">PlaceWidget</a>(<span class="keywordtype">double</span> bounds[6]); <a name="l00110"></a>00110 <a name="l00112"></a>00112 <a name="l00113"></a>00113 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00678.html#ab3a6e7619ef179430840b84d4fd8131">ShallowCopy</a>(<a class="code" href="a01317.html" title="abstract superclass for all actors, volumes and annotations">vtkProp</a> *prop); <a name="l00114"></a>00114 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a01877.html#941529adca4ea1e3152ecbd7657aed6f">GetActors</a>(<a class="code" href="a01321.html" title="a list of Props">vtkPropCollection</a> *); <a name="l00115"></a>00115 <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="l00116"></a>00116 <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> *viewport); <a name="l00117"></a>00117 <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> *viewport); <a name="l00118"></a>00118 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="a01877.html#8b7761451b47996f96aacab32882ca25">HasTranslucentPolygonalGeometry</a>(); <a name="l00120"></a>00120 <a name="l00121"></a>00121 <span class="keyword">protected</span>: <a name="l00122"></a>00122 <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>(); <a name="l00123"></a>00123 ~<a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>(); <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="comment">// the cursor3D</span> <a name="l00126"></a><a class="code" href="a01578.html#1f2ffb181aaeafafd9f424e938bcb985">00126</a> <a class="code" href="a00092.html" title="represents an object (geometry &amp; properties) in a rendered scene">vtkActor</a> *Actor; <a name="l00127"></a><a class="code" href="a01578.html#c7b4c607d0c7721c555a48517dfb47a3">00127</a> <a class="code" href="a01265.html" title="map vtkPolyData to graphics primitives">vtkPolyDataMapper</a> *Mapper; <a name="l00128"></a><a class="code" href="a01578.html#e1f42ef97bb48d6fc4e90c3842db9d27">00128</a> <a class="code" href="a01582.html" title="create a polygonal sphere centered at the origin">vtkSphereSource</a> *<a class="code" href="a03761.html#88ade42854f67d6297898362e17a515f160e72e7e49fa08ea644aa53ba397cd5">Sphere</a>; <a name="l00129"></a>00129 <span class="keywordtype">void</span> <a class="code" href="a01877.html#4bccab4646d6c0f19d8888a3db9845ff">Highlight</a>(<span class="keywordtype">int</span> highlight); <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="comment">// Do the picking</span> <a name="l00132"></a><a class="code" href="a01578.html#a168196fd4e19921117dc90558093710">00132</a> <a class="code" href="a00251.html" title="select a cell by shooting a ray into graphics window">vtkCellPicker</a> *CursorPicker; <a name="l00133"></a><a class="code" href="a01578.html#5ce8d38b52715f30ca92a27a8d983192">00133</a> <span class="keywordtype">double</span> LastPickPosition[3]; <a name="l00134"></a><a class="code" href="a01578.html#d7881ec2727bb248db2cd084b771d960">00134</a> <span class="keywordtype">double</span> LastEventPosition[2]; <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="comment">// Methods to manipulate the cursor</span> <a name="l00137"></a><a class="code" href="a01578.html#a2320fea33ec33c3cb6b7ecbdd399961">00137</a> <span class="keywordtype">int</span> ConstraintAxis; <a name="l00138"></a>00138 <span class="keywordtype">void</span> Translate(<span class="keywordtype">double</span> *p1, <span class="keywordtype">double</span> *p2); <a name="l00139"></a>00139 <span class="keywordtype">void</span> Scale(<span class="keywordtype">double</span> *p1, <span class="keywordtype">double</span> *p2, <span class="keywordtype">double</span> eventPos[2]); <a name="l00140"></a>00140 <span class="keywordtype">void</span> MoveFocus(<span class="keywordtype">double</span> *p1, <span class="keywordtype">double</span> *p2); <a name="l00141"></a>00141 <span class="keywordtype">void</span> SizeBounds(); <a name="l00142"></a>00142 <a name="l00143"></a>00143 <span class="comment">// Properties used to control the appearance of selected objects and</span> <a name="l00144"></a>00144 <span class="comment">// the manipulator in general.</span> <a name="l00145"></a><a class="code" href="a01578.html#c6e40b5337106f7edb14fe36f4685958">00145</a> <a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a> *Property; <a name="l00146"></a><a class="code" href="a01578.html#2283e36e8d7e16d032ebed5cae9d4598">00146</a> <a class="code" href="a01322.html" title="represent surface properties of a geometric object">vtkProperty</a> *SelectedProperty; <a name="l00147"></a>00147 <span class="keywordtype">void</span> CreateDefaultProperties(); <a name="l00148"></a>00148 <a name="l00149"></a>00149 <span class="comment">// The size of the hot spot.</span> <a name="l00150"></a><a class="code" href="a01578.html#a369e1169751adbffd87b83c291d86b8">00150</a> <span class="keywordtype">double</span> HotSpotSize; <a name="l00151"></a>00151 <span class="keywordtype">int</span> DetermineConstraintAxis(<span class="keywordtype">int</span> constraint, <span class="keywordtype">double</span> *x); <a name="l00152"></a><a class="code" href="a01578.html#1935e3c6a998a594a3c24e10d9c8bc32">00152</a> <span class="keywordtype">int</span> WaitingForMotion; <a name="l00153"></a><a class="code" href="a01578.html#d6b1fa3337d430aa646c2b748b0723ac">00153</a> <span class="keywordtype">int</span> WaitCount; <a name="l00154"></a>00154 <a name="l00155"></a>00155 <span class="comment">// Current handle sized (may reflect scaling)</span> <a name="l00156"></a><a class="code" href="a01578.html#7afda42311a2dd0676d5a78e01f4782d">00156</a> <span class="keywordtype">double</span> CurrentHandleSize; <a name="l00157"></a>00157 <a name="l00158"></a>00158 <span class="comment">// Control how translation works</span> <a name="l00159"></a><a class="code" href="a01578.html#ca6dbacd1668de888d09bd15b203a5ff">00159</a> <span class="keywordtype">int</span> TranslationMode; <a name="l00160"></a>00160 <a name="l00161"></a>00161 <span class="keyword">private</span>: <a name="l00162"></a>00162 <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>(<span class="keyword">const</span> <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00163"></a>00163 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="a01578.html" title="A spherical rendition of point in 3D space.">vtkSphereHandleRepresentation</a>&); <span class="comment">//Not implemented</span> <a name="l00164"></a>00164 }; <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 3 18:35:54 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>