<!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> </DIV>
<DIV><FONT size=2 face=Arial>Have you considered adding an observer to the
render window interactor for <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> </DIV>
<DIV><FONT size=2 face=Arial>HTH</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </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< daviddoria+vtk@gmail.com ><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>> Hello,<BR>><BR>> I dont
know mush about wrapping the code. It would be nice if anyone helps<BR>>
me out. Here is my code to display vectors<BR>> <BR>> unsigned int
num_pts = x.size();<BR>><BR>> vtkPoints *pts =
vtkPoints::New();<BR>>
pts->SetNumberOfPoints(num_pts);<BR>><BR>> vtkDoubleArray *vecArr =
vtkDoubleArray::New();<BR>> vecArr->SetNumberOfComponents(3);<BR>>
vecArr->SetNumberOfTuples(num_pts);<BR>><BR>> for( unsigned int
i=0; i < num_pts; i++)<BR>> {<BR>> pts->InsertPoint(i, x(i),
y(i), 0);<BR>> vecArr->InsertTuple2(i, vel_u(i), vel_v(i));<BR>>
}<BR>><BR>> unsigned int num_cells = elem.rows(); // elem is a matrix
that contains the<BR>> index of nodes of elements in the
mesh<BR>><BR>> vtkCellArray *cellA = vtlCellArray::New();<BR>>
cellA->SetNumberOfCells(num_cells);<BR>><BR>> for (unsigned int
i=0; i < num_cells; i++)<BR>> {<BR>>
cellA->InsertNextCell(3);<BR>> cellA->InsertCellPoint( elem(i, 0)
);<BR>> cellA->InsertCellPoint( elem(i, 1) );<BR>>
cellA->InsertCellPoint( elem(i, 2) );<BR>> }<BR>><BR>>
vtkUnstructuredGrid *uGrid = vtkUnstructuredGrid::New();<BR>>
uGrid->Allocate(num_cells, num_cells);<BR>> uGrid->SetCells(
VTK_TRIANGLE, cellA);<BR>> uGrid->SetPoints(pts);<BR>>
uGrid->GetPointData()->SetVector(vecArr);<BR>><BR>> vtkGlyph2D
*glyph = vtkGlyph2D::New();<BR>> glyph->SetInput(uGrid);<BR>>
glyph->SetColorModeToColorByVector();<BR>>
glyph->OrientOn();<BR>> glyph->SetScaleFactor(1);<BR>><BR>>
vtkGlyphSource2D *glyphSource = vtkGlyphSource2D::New();<BR>>
glyphSource->FilledOff();<BR>>
glyphSource->SetGlyphTypeToArrow();<BR>><BR>>
glyph->SetInputConnection(1,
glyphSource->GetOutputPort());<BR>><BR>> vtkPolyDataMapper *gMapper
= vtkPolyDataMapper::New();<BR>> gMapper->SetInput(
glyph->GetOutput());<BR>> gMapper->ScalarVisibilityOn();<BR>>
gMapper->SetScalarRange(uGrid->GetScalarRange());<BR>><BR>>
vtkActor *gactor = vtkActor::New();< br>>
gactor->SetMapper(gMapper);<BR>><BR>>
pRenderer->AddActor(gactor);<BR>><BR>> pRenderer->Rese
tCamera();<BR>><BR>> Do i need to derive a class from vtkActor and
override RenderOpaqueGeometry<BR>> code..?? If so, then how do i scale
the glyphs..?? and which part will this<BR>> code come into picture. Am
not that much expert in C++ but can manage with a<BR>>
guidance.<BR>><BR>> Thanks<BR>><BR>> Regards<BR>><BR>>
---------- Original message ----------<BR>> From:Karthik Krishnan<
karthik.krishnan@kitware.com ><BR>> Date: 25 Jan 10 17:08:12<BR>>
Subject: Re: [vtkusers] Vector arrows form a solid patch. How to
rectify??<BR>> To: Rakesh Patil<BR>><BR>> You'll have to write your
own actor wrapping around your existing code<BR>> and overriding
RenderOpaqueGeometry. Its not hard. See several actors<BR>> in
VTK/Rendering that scale their font size based on the size of the<BR>>
viewport etc. Yo u may have to do something similar scaling your
glyphs<BR>> based on the parallel scale / view angle.<BR>><BR>> On
Sat, Jan 23, 2010 at 12:49 PM, Rakesh Patil wrote:<BR>>>
hello,<BR>>><BR>>> When i display a vector plot using vtk, it is
shown very small like a dot.<BR>>> And when i zoom into it, it gets
more visible and big. But, i want it in<BR>>> such a way, that when i
display it, at the initial stage itself, the<BR>>> vectors<BR>>>
must be big enough that can be seen. And when we zoom into it, then
the<BR>>> arrow size must proportionately become small. I Used
setscalefactor for<BR>>> glyph object and got the arrow size
increased.<BR>>><BR>>> But where the data is very dense, there a
solid patch is formed due to<BR>>> which<BR>>> i cannot make out
whats the length of the arrow. So as we zoom in, the<BR>>>
arrow<BR>>> size must be reduced so that at the denser location, i ca
n differentiate<BR>>> among two vectors. How can i do
this..??<BR>>><BR>>> Thanks in advance<BR>>><BR>>>
Regards<BR>>> Rakesh<BR>>><BR>>> Get Yourself a cool,
short @in.com Email ID now!<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<BR>>> <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:<BR>>> <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>>> <A
href="http://www.vtk.org/mailman/listinfo/vtkusers"
target='\"_blank\"'>http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>><BR>>
_________________________________<BR>> 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><
/blockquote> <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&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>