[vtkusers] Problem with reader->Update();

Veerapuram Varadhan v.varadhan at californiadigital.com
Tue Apr 6 05:57:08 EDT 2004


Hi Arun,

After reader->SetFileName("test.vtk") you have to call reader->Update() to
actually read the contents of the file.

mapper->SetInput(reader->GetOutput()); fails because reader->GetOutput()
will be essentially NULL (IIRC) since the content is not yet read in your
case.

Try adding the line
    reader->Update();

before

    mapper->SetInput(reader->GetOutput());

HTH,

V. Varadhan.

> Dear All:
>
> I am using VTK4.2 with Borland Builder 5.0.
>
> I am trying the following code and getting an
> exception ('Exception Object Address:0xC0FEE6')in the
> line
>
>    mapper->SetInput(reader->GetOutput());
>
> and it is pointing to
>
>     USEFACET.H routine.
>
> I'll be glad if somebody could give me an idea to get
> around with this problem. (I am also giving the
> 'test.vtk' data file at the end of the mail).
>
> Thanks a lot.
> -AK
>
> ****code**
>
>   vtkDataSetReader               *reader;
>   vtkDataSetMapper               *mapper;
>   vtkActor                       *outlineActor;
>
>   reader = vtkDataSetReader::New();
>   reader->SetFileName("test.vtk");
>
>   mapper = vtkDataSetMapper::New();
>   mapper->SetInput(reader->GetOutput());
>
> ----
> ----
> *** end of code **
>
> test.vtk
>
> # vtk DataFile Version 2.0
> Volume example
> ASCII
> DATASET STRUCTURED_POINTS
> DIMENSIONS 3 4 6
> ASPECT_RATIO 1 1 1
> ORIGIN 0 0 0
> POINT_DATA 72
> SCALARS volume_scalars char 1
> LOOKUP_TABLE default
> 0 0 0 0 0 0 0 0 0 0 0 0
> 0 5 10 15 20 25 25 20 15 10 5 0
> 0 10 20 30 40 50 50 40 30 20 10 0
> 0 10 20 30 40 50 50 40 30 20 10 0
> 0 5 10 15 20 25 25 20 15 10 5 0
> 0 0 0 0 0 0 0 0 0 0 0 0
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Small Business $15K Web Design Giveaway
> http://promotions.yahoo.com/design_giveaway/
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list