<div>Hi Romy,</div>
<div>Here is a bit of code I use - it is just a function based on the Tcl example in the VTK widget stuff.</div>
<div>In view of the fact that this question arises so often, perhaps this code snippet could go on in the Wiki. I would be glad to put it up if someone can tell me the procedure, or someone else can do it for me.</div>
<div> </div>
<div>Obviously you can fiddle with the commented out areas. If you need the cube bits, look at the Tcl example.</div>
<div> </div>
<div>Andrew</div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 9/23/06, <b class="gmail_sendername">Romy Schneider</b> <<a href="mailto:romy@tacc.utexas.edu">romy@tacc.utexas.edu</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="WORD-WRAP: break-word">Dean,
<div><br>
<div>Thanks for the reply. I'm probably using this widget incorrectly, but what I want is a small set of 3D axes in the lower left hand corner, like Paraview has. I don't want any sort of axes around the data. The issue is, I can produce the small set of axes in the corner just as I want them (small, non-interactive, etc), but I also have a set of axes drawn near my data set. Actually, what VTK draws is really tiny axes with huge axes labels. Calls to SetFontSize( i ) have absolutely no effect (although I can change the font type, bold, italicize, etc: I'm running VTK with Carbon on an Intel MacBook Pro, I figure this is just a bug). Here's my code (I'm just starting out at VTK...).
</div>
<div><br> </div>
<div>...</div>
<div><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"># add orientation axes</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">vtkAxesActor axes</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">vtkOrientationMarkerWidget marker</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">marker SetOrientationMarker axes</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">marker SetViewport </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">0.0</span></font><font face="Monaco" size="2">
<span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">0.0</span></font><font face="Monaco" size="2"><span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#0000ff" size="2">
<span style="FONT-SIZE: 10px">0.15</span></font><font face="Monaco" size="2"><span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">0.2</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px">#</span></font><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#236e25" size="2">
<span style="FONT-SIZE: 10px">RENDERER</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">vtkRenderer ren1</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">ren1 AddActor imageActor</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">ren1 AddActor axes</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">ren1 SetBackground </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">0.0</span></font><font face="Monaco" size="2">
<span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">0.0</span></font><font face="Monaco" size="2"><span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#0000ff" size="2">
<span style="FONT-SIZE: 10px">0.0</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px">#</span></font><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"> </span></font><font face="Monaco" color="#236e25" size="2">
<span style="FONT-SIZE: 10px">RENDER WINDOW</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">vtkRenderWindow renWin</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">renWin AddRenderer ren1</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">set vtkw [vtkTkRenderWidget .ren -width </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">600</span>
</font><font face="Monaco" size="2"><span style="FONT-SIZE: 10px"> -height </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">600</span></font><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">
-rw renWin]</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"># launch the vtk/tk interactor (command line) window</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">wm deiconify .vtkInteract</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px">#</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"># Setup Tk bindings and VTK observers for that widget.</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px">#</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">::vtk::bind_tk_render_widget $vtkw</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" color="#236e25" size="2"><span style="FONT-SIZE: 10px"># set interactor for the render widget and orientation marker?</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">set iact [[$vtkw GetRenderWindow] GetInteractor]</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">vtkInteractorStyleTrackballCamera style</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">$iact SetInteractorStyle style</span></font></div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">marker SetInteractor $iact</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">marker SetEnabled </span></font><font face="Monaco" color="#0000ff" size="2"><span style="FONT-SIZE: 10px">1</span></font></div>
<div style="MARGIN: 0px"><font face="Monaco" size="2"><span style="FONT-SIZE: 10px">marker InteractiveOff</span></font></div>
<div>...</div>
<div><br> </div>
<div><br> </div>
<div>I've attached a screenshot, but I'm not sure if it will come through (I haven't seen any other attachments in the mailinglist). The unwanted axes appear right next to the data slice, there's a small green dot (for the incredibly tiny axes it's drawing) and large white X, Y, Z, overlain on each other. So, how do I make those go away while keeping the small orientation marker in the lower left hand corner?
</div>
<div><br> </div>
<div>Thanks for your help!</div>
<div><br> </div>
<div>Romy</div>
<div><br> </div>
<div><br> </div>
<div><img></div>
<div><br> </div>
<div><br>
<div>
<div>On Sep 21, 2006, at 9:43 PM, Dean Inglis wrote:</div><br>
<blockquote type="cite">
<div style="MARGIN: 0px">Hi Romy,</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">I'm not sure what you want here.<span> </span>The axes actor has<span> </span></div>
<div style="MARGIN: 0px">3D polydata representing the axes as tubes with cones</div>
<div style="MARGIN: 0px">for arrows and text for labels.<span> </span>The axes are</div>
<div style="MARGIN: 0px">the "marker" that marks out the orientation.<span> </span>You can</div>
<div style="MARGIN: 0px">also have a marker that is a cube with labels for</div>
<div style="MARGIN: 0px">different directions.<span> </span>The whole idea when I wrote this</div>
<div style="MARGIN: 0px">class was to use the widget to accommodate the x-y-z arrow axes<span> </span></div>
<div style="MARGIN: 0px">as seen in ParaView and the cube with anatomical direction labels</div>
<div style="MARGIN: 0px">as seen in VolView.<span> </span>the widget allows the user to move it</div>
<div style="MARGIN: 0px">around the render window for interactive placement.</div>
<div style="MARGIN: 0px">Can you be a bit more specific about what you want to visualize?</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<div style="MARGIN: 0px">Dean</div>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div>
<blockquote type="cite">
<div style="MARGIN: 0px">however I don't want the main set of axes visible, just the <span> </span></div>
<div style="MARGIN: 0px">orientation marker.<span> </span>How do I accomplish this?<span> </span>When I set the <span> </span></div>
<div style="MARGIN: 0px">vtkAxesActor visibility off with VisibilityOff(), the orientation <span> </span></div>
<div style="MARGIN: 0px">maker widget goes away as well.<span> </span>I searched around and tinkered a <span> </span></div></blockquote>
<div style="MIN-HEIGHT: 14px; MARGIN: 0px"><br> </div></blockquote></div><br> </div></div></div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at:
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">
http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br><br clear="all"></blockquote></div><br><br clear="all"><br>-- <br><br>___________________________________________<br>Andrew J. P. Maclean<br>Centre for Autonomous Systems
<br>The Rose Street Building J04<br>The University of Sydney 2006 NSW<br>AUSTRALIA<br>Ph: +61 2 9351 3283<br>Fax: +61 2 9351 7474<br>URL: <a href="http://www.cas.edu.au/">http://www.cas.edu.au/</a><br>___________________________________________
<br>