[vtkusers] FW: Rectilinear grid & StreamTube

tom fogal tfogal at apollo.sr.unh.edu
Wed Nov 17 09:07:36 EST 2004


 <EXCH01SMTP11wNIRt1F00016531 at exch01smtp11.hdi.tvcabo>"ivo.leitao" writes:
>I have a rectilinear grid with wind speed at certain
>latitudes/longitudes/days and that grid contains only vector data.
>
>I was able to build a stream tube to represent the data without =
>problems,
>but now I need to use another file with the temperature data (also on a
>rectilinear grid) at those same latitude/longitude/days to colorize the
>stream tube. Since I do not have any scalar data on the initial file =
>I=92ve
>tried to use the Merge Filter to do it but I was unable to colorize de =
>data
>tube.

I believe that you need the scalar data to be part of the same
rectilinear grid that you give to vtkStreamLine, which appears to be
your 'wineSpeedRectililnearGridReader' object. Specifically, the
object you give to the streamline generator needs to return something
for 'object->GetOutput()->GetPointData()->GetScalars()', I *think*, but
am not 100% sure.

Thus you could try doing the merge earlier and merging into your
windSpeed... object.

Also consider switching to the 'vtkStreamTracer' interface.

-tom

>I have tried to do something like this:
>
>=20
>
># Streamline
>
>vtkRungeKutta4 integ
>
>vtkStreamLine streamLine
>
>            streamLine SetInput [windSpeedRectilinearGridReader =
>GetOutput]
>
>  streamLine SetStartPosition 0 30 61
>
>  streamLine SetMaximumPropagationTime 44
>
>  streamLine SetStepLength 0.01
>
>  streamLine SetIntegrationStepLength 0.01
>
>  streamLine SetIntegrationDirectionToForward
>
>  streamLine OrientationScalarsOff
>
>  streamLine SpeedScalarsOff
>
>  streamLine SetIntegrator integ
>
> =20
>
># Streamtube
>
>vtkTubeFilter streamTube
>
>            streamTube SetInput [streamLine GetOutput]
>
>  streamTube SetRadius 1
>
>  streamTube SetNumberOfSides 12
>
>  streamTube SetVaryRadiusToVaryRadiusByVector
>
> =20
>
>vtkMergeFilter mergeFilter
>
>  mergeFilter SetGeometry [streamTube GetOutput]
>
>  mergeFilter SetScalars  [temperatureRectilinearGridReader GetOutput]
>
> =20
>
>vtkPolyDataMapper polyDataMapper
>
>  polyDataMapper SetInput [mergeFilter GetOutput]
>
>  polyDataMapper ScalarVisibilityOn
>
>  eval polyDataMapper SetScalarRange =
>[[[[temperatureRectilinearGridReader
>GetOutput] GetPointData] GetScalars] GetRange]
>
> =20
>
>vtkActor actor
>
>            actor SetMapper polyDataMapper
>
>=20
>
>It didn=92t work, so can anynone help me with this ? How do I colorize =
>the
>stream tube with external scalar data ?
>
>=20
>
>Tnks for any answer concerning this subject
>
>Best Regars, Ivo Leit=E3o
>
>
>------=_NextPart_000_000E_01C4CC46.9AB0EDC0
>Content-Type: text/html;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
>xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
>xmlns=3D"http://www.w3.org/TR/REC-html40">
>
><head>
><meta http-equiv=3DContent-Type content=3D"text/html; =
>charset=3Diso-8859-1">
><meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
><style>
><!--
> /* Font Definitions */
> @font-face
>	{font-family:SimSun;
>	panose-1:2 1 6 0 3 1 1 1 1 1;}
>@font-face
>	{font-family:"\@SimSun";
>	panose-1:2 1 6 0 3 1 1 1 1 1;}
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
>	{margin:0cm;
>	margin-bottom:.0001pt;
>	font-size:12.0pt;
>	font-family:"Times New Roman";}
>a:link, span.MsoHyperlink
>	{color:blue;
>	text-decoration:underline;}
>a:visited, span.MsoHyperlinkFollowed
>	{color:purple;
>	text-decoration:underline;}
>span.EmailStyle17
>	{mso-style-type:personal;
>	font-family:Arial;
>	color:windowtext;}
>span.EmailStyle18
>	{mso-style-type:personal-reply;
>	font-family:Arial;
>	color:navy;}
>@page Section1
>	{size:612.0pt 792.0pt;
>	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
>div.Section1
>	{page:Section1;}
>-->
></style>
>
></head>
>
><body lang=3DEN-US link=3Dblue vlink=3Dpurple>
>
><div class=3DSection1>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DPT =
>style=3D'font-size:10.0pt;
>font-family:Arial'>Hi !<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DPT =
>style=3D'font-size:10.0pt;
>font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>I have a rectilinear grid with wind speed at certain
>latitudes/longitudes/days and that grid contains only vector =
>data.<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>I was able to build a stream tube to represent the =
>data
>without problems, but now I need to use another file with the =
>temperature data
>(also on a rectilinear grid) at those same latitude/longitude/days to =
>colorize
>the stream tube. Since I do not have any scalar data on the initial file
>I&#8217;ve tried to use the Merge Filter to do it but I was unable to =
>colorize
>de data tube.<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>I have tried to do something like =
>this:<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'># Streamline<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkRungeKutta4 integ<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkStreamLine streamLine<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
>&nbsp;&nbsp;
>streamLine SetInput [windSpeedRectilinearGridReader =
>GetOutput]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine SetStartPosition 0 30 =
>61<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine SetMaximumPropagationTime =
>44<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine SetStepLength =
>0.01<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine SetIntegrationStepLength =
>0.01<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine =
>SetIntegrationDirectionToForward<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine =
>OrientationScalarsOff<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine =
>SpeedScalarsOff<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamLine SetIntegrator =
>integ<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; <o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'># Streamtube<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkTubeFilter streamTube<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
>&nbsp;&nbsp;
>streamTube SetInput [streamLine GetOutput]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamTube SetRadius =
>1<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamTube SetNumberOfSides =
>12<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; streamTube =
>SetVaryRadiusToVaryRadiusByVector<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; <o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkMergeFilter =
>mergeFilter<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; mergeFilter SetGeometry [streamTube =
>GetOutput]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; mergeFilter SetScalars&nbsp;
>[temperatureRectilinearGridReader =
>GetOutput]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; <o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkPolyDataMapper =
>polyDataMapper<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; polyDataMapper SetInput [mergeFilter =
>GetOutput]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; polyDataMapper =
>ScalarVisibilityOn<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; eval polyDataMapper SetScalarRange
>[[[[temperatureRectilinearGridReader GetOutput] GetPointData] =
>GetScalars]
>GetRange]<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp; <o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>vtkActor actor<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
>&nbsp;&nbsp;
>actor SetMapper polyDataMapper<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>It didn&#8217;t work, so can anynone help me with =
>this ? How
>do I colorize the stream tube with external scalar data =
>?<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>Tnks for any answer concerning this =
>subject<o:p></o:p></span></font></p>
>
><p class=3DMsoNormal><font size=3D2 face=3DArial><span =
>style=3D'font-size:10.0pt;
>font-family:Arial'>Best Regars, Ivo =
>Leit=E3o<o:p></o:p></span></font></p>
>
></div>
>
></body>
>
></html>
>
>------=_NextPart_000_000E_01C4CC46.9AB0EDC0--
>
>
>--===============0452531482==
>Content-Type: text/plain; charset="us-ascii"
>MIME-Version: 1.0
>Content-Transfer-Encoding: 7bit
>Content-Disposition: inline
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: &lt;http://www.vtk.org/Wiki/V
>TK_FAQ&gt;
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>--===============0452531482==--



More information about the vtkusers mailing list