[vtkusers] Can VTK render huge data? How?
tom fogal
tfogal at apollo.sr.unh.edu
Fri Jun 17 14:54:00 EDT 2005
<BAY107-DAV109886E9A8126763E8DC80AFF40 at phx.gbl>"Hao Li" writes:
<snip>
>come from VTK user guide and textbook. I just made a little modification for
>trial run. Having compiled sampleMFC, I tried to use it to open some data
>files of *.vtk. There is no problem to open and view small data files, but
>if trying to read honolulu.vtk, it failed. I got the same problem with
>deciHama.tcl. Actually there is no any problem with honolulu.vtk because
>paraview can open it without any problem. I really don't know what is
>going on there. Can you give me a hint ?
I didn't really look at SampleMFC as I don't have windows; also I don't
have vtk wrapping setup for tcl either. But I wrote a simple C++ app to
check for myself:
#include "vtkPolyDataReader.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include <unistd.h>
int main() {
vtkPolyDataReader *reader = vtkPolyDataReader::New();
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
vtkActor *actor = vtkActor::New();
vtkRenderer *ren = vtkRenderer::New();
vtkRenderWindow *rw = vtkRenderWindow::New();
reader->SetFileName("tarballs/vtkdata/honolulu.vtk");
mapper->SetInput(reader->GetOutput());
actor->SetMapper(mapper);
ren->AddActor(actor);
rw->AddRenderer(ren);
rw->Render();
sleep(5);
}
The app displays what appears to be a beach. The only thing that I can
imagine you might have done wrong is telling VTK to render a wireframe
of the Actor instead of the actor -- is there any reason for that?
Sometimes a wireframe doesn't really make sense and you can end up with
thin lines that are hard to see or too small to be rendered.
Also I usually call RenderWindow->Render() because initializing a
RW-Interactor. I'm not sure if this is because its required or if I
just acquired that habit... (it doesn't \emph{seem} like it should be
required)
HTH,
-tom
>From: "tom fogal" <tfogal at apollo.sr.unh.edu>
>To: "Hao Li" <haoli2001 at hotmail.com>
>Cc: <vtkusers at vtk.org>
>Sent: Thursday, June 16, 2005 6:44 PM
>Subject: Re: [vtkusers] Can VTK render huge data? How?
>
>
>> <BAY107-DAV6108BF0601705C197E82DAFF50 at phx.gbl>"Hao Li" writes:
>> >Hi Guys,
>> >
>> >vtkPolyDataReader reader
>> >reader SetFileName "$env(VTK_TEXTBOOK_DATA)/honolulu.vtk"
>> >
>> >vtkPolyDataMapper hawaiiMapper
>> >
>> >hawaiiMapper SetInput [reader GetOutput]
>>
>> ... is that the whole script or was there a copy-paste error here?
>>
>> >I ended up with no any ploygon showing on my screen. Data file of
>> >honolulu.vtk is 15 M. I tried other large data. It seems that VTK has
>some
>> >problem with handling huge data. Can anybody tell me how to deal with
>huge
>> >data such as over 60M?
>>
>> unless you're missing part of your script above, this isn't because of
>> the size of the data file (actually, I'd say 60 meg is quite small).
>> VTK shouldn't have any problems with datasets of this size (it doesn't
>> for me, at least).
>>
>> The problem with the above script is that you never actually do any
>> rendering. After mapping a dataset into polydata, you'll want to
>> encapsulate that mapping in a vtkActor, and then setup a vtkRenderer to
>> render that (and maybe other) actors. Finally you'll probably want some
>> sort of vtkRenderWindow to display the rendered image, so that you can
>> see it.
>>
>> -tom
More information about the vtkusers
mailing list