<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Reece,<div><br></div><div>I don't know if this will accomplish everything you want to do, but the single block of data in your multi-block data set is an Unstructured Grid, which you can extract and it already contains points and cells and scalars (although the scalars aren't "active" yet). Then you can visualize the unstructured grid directly. You also don't need to create a camera manually. Here's a piece from the middle of your program that I modified:</div><div><br></div><div><div> tecR->SetFileName(fileName);</div><div> tecR->Update();</div><div><br></div><div> //read from</div><div> vtkMultiBlockDataSet *multiBDS =vtkMultiBlockDataSet::New ();</div><div> multiBDS=tecR->GetOutput();</div><div><br></div><div> vtkUnstructuredGrid *ug=vtkUnstructuredGrid::SafeDownCast(multiBDS->GetBlock(0));</div><div> ug->GetPointData()->SetActiveScalars("H");</div><div><br></div><div> // Now we'll look at it.</div><div> vtkDataSetMapper *cubeMapper = vtkDataSetMapper::New();</div><div> cubeMapper->SetInput(ug);</div><div> cubeMapper->SetScalarRange(0,7);</div><div> vtkActor *cubeActor = vtkActor::New();</div><div> cubeActor->SetMapper(cubeMapper);</div><div><br></div><div> vtkRenderer *renderer = vtkRenderer::New();</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span>renderer->AddActor(cubeActor);</div><div> <span class="Apple-tab-span" style="white-space:pre">        </span></div><div> vtkRenderWindow *renWin = vtkRenderWindow::New();</div><div> renWin->AddRenderer(renderer);</div><div><br></div><div> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</div><div> iren->SetRenderWindow(renWin);</div><div><br></div><div> renderer->AddActor(cubeActor);</div><div> renderer->ResetCamera();</div><div> </div><div> renWin->SetSize(300,300);</div><div><br></div><div> // interact with data</div><div> renWin->Render();</div><div> iren->Start();</div><div><br></div><div><br></div><div>This should at least be a start in the right direction,</div><div>-Eric</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">------------------------------------------------------<br>Eric E Monson<br>Duke Visualization Technology Group<br></span>
</div>
<div><br></div><br><div><div>On Sep 26, 2010, at 3:36 AM, 赖瑞勋 wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div> Hi! I am a novice at VTK.</div>
<div>I want to read my Tecplot data and show it using VTK.The data file(old_bridge.plt) and the result had been adjoined into attachment.</div>
<div>In the data file ,it has 8 nodes,6 cells with the type of triangle.</div>
<div>My code(showBridge.cxx) adjoined into attachment.And my trouble is how to transfer vtkMultiBlockDataSet to vtkPolyData. This code is the modification from the book "The Visualization Toolkit 3rd" in chapter 5.</div>
<div>Do you think my solution is right ? or there are some other ways to do this more effectively?</div>
<div>The on line help "vtkTecplotReader Class Reference" says:"<a class="el" title="A concrete class to read an ASCII Tecplot file." href="http://www.vtk.org/doc/release/5.6/html/a01927.html">vtkTecplotReader</a> parses an ASCII Tecplot file,and can extract <a class="el" title="represent and manipulate point attribute data" href="http://www.vtk.org/doc/release/5.6/html/a01422.html">vtkPointData</a> and / or <a class="el" title="represent and manipulate cell attribute data" href="http://www.vtk.org/doc/release/5.6/html/a00267.html">vtkCellData</a>".Unfortunately,there are not have additional details of how to extract the pointdata and celldata.</div>
<div>I have been puzzled by this problem for few days , after all,there are so many Classes <span>similar </span>in VTK.</div>
<div>Any suggestions are very glad.<br>Thanks!</div>
<div>Reece</div><br><br><span title="neteasefooter"><span id="netease_mail_footer"><hr>
<a href="http://yxp.163.com/photo/ep.html?sss=fromyx0911" target="_blank">全国最低价,天天在家冲照片,24小时发货上门!</a>
</span></span><span><showBridge.cxx></span><span><old_bridge.plt></span><span><result.jpg></span>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">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">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">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br></div></body></html>