<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi Rakesh,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Have you considered adding an observer to the 
render window interactor for&nbsp;<FONT size=2>EndInteractionEvent? I use this 
event to redraw glyphs to a fixed screen scale so they do not get larger as you 
zoom in.</FONT></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>HTH</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>John.</FONT></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px" 
dir=ltr>
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=rakeshthp@in.com href="mailto:rakeshthp@in.com">Rakesh Patil</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=daviddoria+vtk@gmail.com 
  href="mailto:daviddoria+vtk@gmail.com">David Doria</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=vtkusers@vtk.org 
  href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, January 28, 2010 4:53 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers]Vector arrows form 
  a solid patch. How to rectify??</DIV>
  <DIV><BR></DIV><BR>i guess, the way i explained the problem was not correct.. 
  here it goes,<BR><BR>for a large area, if i draw vecot of actual size, it will 
  be visible as a small dot. So i need to scale and make it <BR>large enough 
  that it is visible properly.. And as i zoom in, and go closer to them, they 
  must slowly,<BR>shrink to their actual size... <BR><BR>As kaarthik said, i 
  think i need to write my own actor . But how to do it, am not able to 
  understand..<BR>can anyone guide me..??<BR><BR>Thanks<BR>Regards<BR>
  <BLOCKQUOTE><BR>---------- Original message ----------<BR>From:David 
    Doria&lt; daviddoria+vtk@gmail.com &gt;<BR>Date: 27 Jan 10 
    19:54:04<BR>Subject: Re: [vtkusers] Vector arrows form a solid patch. How to 
    rectify??<BR>To: rakeshthp@in.com<BR><BR>On Wed, Jan 27, 2010 at 8:56 AM, 
    Rakesh Patil <RAKESHTHP@IN.COM>wrote:<BR>&gt; Hello,<BR>&gt;<BR>&gt; I dont 
    know mush about wrapping the code. It would be nice if anyone helps<BR>&gt; 
    me out. Here is my code to display vectors<BR>&gt; <BR>&gt; unsigned int 
    num_pts = x.size();<BR>&gt;<BR>&gt; vtkPoints *pts = 
    vtkPoints::New();<BR>&gt; 
    pts-&gt;SetNumberOfPoints(num_pts);<BR>&gt;<BR>&gt; vtkDoubleArray *vecArr = 
    vtkDoubleArray::New();<BR>&gt; vecArr-&gt;SetNumberOfComponents(3);<BR>&gt; 
    vecArr-&gt;SetNumberOfTuples(num_pts);<BR>&gt;<BR>&gt; for( unsigned int 
    i=0; i &lt; num_pts; i++)<BR>&gt; {<BR>&gt; pts-&gt;InsertPoint(i, x(i), 
    y(i), 0);<BR>&gt; vecArr-&gt;InsertTuple2(i, vel_u(i), vel_v(i));<BR>&gt; 
    }<BR>&gt;<BR>&gt; unsigned int num_cells = elem.rows(); // elem is a matrix 
    that contains the<BR>&gt; index of nodes of elements in the 
    mesh<BR>&gt;<BR>&gt; vtkCellArray *cellA = vtlCellArray::New();<BR>&gt; 
    cellA-&gt;SetNumberOfCells(num_cells);<BR>&gt;<BR>&gt; for (unsigned int 
    i=0; i &lt; num_cells; i++)<BR>&gt; {<BR>&gt; 
    cellA-&gt;InsertNextCell(3);<BR>&gt; cellA-&gt;InsertCellPoint( elem(i, 0) 
    );<BR>&gt; cellA-&gt;InsertCellPoint( elem(i, 1) );<BR>&gt; 
    cellA-&gt;InsertCellPoint( elem(i, 2) );<BR>&gt; }<BR>&gt;<BR>&gt; 
    vtkUnstructuredGrid *uGrid = vtkUnstructuredGrid::New();<BR>&gt; 
    uGrid-&gt;Allocate(num_cells, num_cells);<BR>&gt; uGrid-&gt;SetCells( 
    VTK_TRIANGLE, cellA);<BR>&gt; uGrid-&gt;SetPoints(pts);<BR>&gt; 
    uGrid-&gt;GetPointData()-&gt;SetVector(vecArr);<BR>&gt;<BR>&gt; vtkGlyph2D 
    *glyph = vtkGlyph2D::New();<BR>&gt; glyph-&gt;SetInput(uGrid);<BR>&gt; 
    glyph-&gt;SetColorModeToColorByVector();<BR>&gt; 
    glyph-&gt;OrientOn();<BR>&gt; glyph-&gt;SetScaleFactor(1);<BR>&gt;<BR>&gt; 
    vtkGlyphSource2D *glyphSource = vtkGlyphSource2D::New();<BR>&gt; 
    glyphSource-&gt;FilledOff();<BR>&gt; 
    glyphSource-&gt;SetGlyphTypeToArrow();<BR>&gt;<BR>&gt; 
    glyph-&gt;SetInputConnection(1, 
    glyphSource-&gt;GetOutputPort());<BR>&gt;<BR>&gt; vtkPolyDataMapper *gMapper 
    = vtkPolyDataMapper::New();<BR>&gt; gMapper-&gt;SetInput( 
    glyph-&gt;GetOutput());<BR>&gt; gMapper-&gt;ScalarVisibilityOn();<BR>&gt; 
    gMapper-&gt;SetScalarRange(uGrid-&gt;GetScalarRange());<BR>&gt;<BR>&gt; 
    vtkActor *gactor = vtkActor::New();&lt; br&gt;&gt; 
    gactor-&gt;SetMapper(gMapper);<BR>&gt;<BR>&gt; 
    pRenderer-&gt;AddActor(gactor);<BR>&gt;<BR>&gt; pRenderer-&gt;Rese 
    tCamera();<BR>&gt;<BR>&gt; Do i need to derive a class from vtkActor and 
    override RenderOpaqueGeometry<BR>&gt; code..?? If so, then how do i scale 
    the glyphs..?? and which part will this<BR>&gt; code come into picture. Am 
    not that much expert in C++ but can manage with a<BR>&gt; 
    guidance.<BR>&gt;<BR>&gt; Thanks<BR>&gt;<BR>&gt; Regards<BR>&gt;<BR>&gt; 
    ---------- Original message ----------<BR>&gt; From:Karthik Krishnan&lt; 
    karthik.krishnan@kitware.com &gt;<BR>&gt; Date: 25 Jan 10 17:08:12<BR>&gt; 
    Subject: Re: [vtkusers] Vector arrows form a solid patch. How to 
    rectify??<BR>&gt; To: Rakesh Patil<BR>&gt;<BR>&gt; You'll have to write your 
    own actor wrapping around your existing code<BR>&gt; and overriding 
    RenderOpaqueGeometry. Its not hard. See several actors<BR>&gt; in 
    VTK/Rendering that scale their font size based on the size of the<BR>&gt; 
    viewport etc. Yo u may have to do something similar scaling your 
    glyphs<BR>&gt; based on the parallel scale / view angle.<BR>&gt;<BR>&gt; On 
    Sat, Jan 23, 2010 at 12:49 PM, Rakesh Patil wrote:<BR>&gt;&gt; 
    hello,<BR>&gt;&gt;<BR>&gt;&gt; When i display a vector plot using vtk, it is 
    shown very small like a dot.<BR>&gt;&gt; And when i zoom into it, it gets 
    more visible and big. But, i want it in<BR>&gt;&gt; such a way, that when i 
    display it, at the initial stage itself, the<BR>&gt;&gt; vectors<BR>&gt;&gt; 
    must be big enough that can be seen. And when we zoom into it, then 
    the<BR>&gt;&gt; arrow size must proportionately become small. I Used 
    setscalefactor for<BR>&gt;&gt; glyph object and got the arrow size 
    increased.<BR>&gt;&gt;<BR>&gt;&gt; But where the data is very dense, there a 
    solid patch is formed due to<BR>&gt;&gt; which<BR>&gt;&gt; i cannot make out 
    whats the length of the arrow. So as we zoom in, the<BR>&gt;&gt; 
    arrow<BR>&gt;&gt; size must be reduced so that at the denser location, i ca 
    n differentiate<BR>&gt;&gt; among two vectors. How can i do 
    this..??<BR>&gt;&gt;<BR>&gt;&gt; Thanks in advance<BR>&gt;&gt;<BR>&gt;&gt; 
    Regards<BR>&gt;&gt; Rakesh<BR>&gt;&gt;<BR>&gt;&gt; Get Yourself a cool, 
    short @in.com Email ID now!<BR>&gt;&gt; 
    _______________________________________ ________<BR>&gt;&gt; Powered by <A 
    href="http://www.kitware.com" 
    target='\"_blank\"'>www.kitware.com</A><BR>&gt;&gt;<BR>&gt;&gt; Visit other 
    Kitware open-source projects at<BR>&gt;&gt; <A 
    href="http://www.kitware.com/opensource/opensource.html" 
    target='\"_blank\"'>http://www.kitware.com/opensource/opensource.html</A><BR>&gt;&gt;<BR>&gt;&gt; 
    Please keep messages on-topic and check the VTK FAQ at:<BR>&gt;&gt; <A 
    href="http://www.vtk.org/Wiki/VTK_FAQ" 
    target='\"_blank\"'>http://www.vtk.org/Wiki/VTK_FAQ</A><BR>&gt;&gt;<BR>&gt;&gt; 
    Follow this link to subscribe/unsubscribe:<BR>&gt;&gt; <A 
    href="http://www.vtk.org/mailman/listinfo/vtkusers" 
    target='\"_blank\"'>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>&gt;<BR>&gt; 
    _________________________________<BR>&gt; Karthik Krishnan<BR><BR>This is 
    only a very partial answer, but you can scale an arrow using<BR>the 
    vtkTransformFilter like 
    this:<BR><BR>http://www.vtk.org/Wiki/VTK/Examples/TransformFilter<BR><BR>Thanks,<BR><BR>David<BR>_______________________________________________<BR>Powered 
    by <A href="http://www.kitware.com" 
    target='\"_blank\"'>www.kitware.com</A><BR><BR>Visit other Kitware 
    open-source projects at <A 
    href="http://www.kitware.com/opensource/opensource.html" 
    target='\"_blank\"'>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please 
    keep messages on-topic and check the VTK FAQ at: <A 
    href="http://www.vtk.org/Wiki/VTK_FAQ" 
    target='\"_blank\"'>http://www.vtk.org/Wiki/VTK_FAQ</A><BR><BR>Follow this 
    link to 
    subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></RAKESHTHP@IN.COM>&lt; 
    /blockquote&gt; <BR><BR>
    <DIV 
    style="BORDER-BOTTOM: #ccc 1px dashed; PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; BORDER-TOP: #ccc 1px dashed; PADDING-TOP: 5px"><A 
    style="FONT: 13px arial; COLOR: #1e56a1; TEXT-DECORATION: none" 
    href="http://mail.in.com/mails/new_reg.php?utm_source=invite&amp;utm_medium=outgoing">Get 
    Yourself a cool, short <B>@in.com</B> Email ID now!</A></DIV>
    <P>
    <HR>

    <P></P>_______________________________________________<BR>Powered by 
    www.kitware.com<BR><BR>Visit other Kitware open-source projects at 
    http://www.kitware.com/opensource/opensource.html<BR><BR>Please keep 
    messages on-topic and check the VTK FAQ at: 
    http://www.vtk.org/Wiki/VTK_FAQ<BR><BR>Follow this link to 
    subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>