[vtkusers] Reading data set from a file

Kevin H. Hobbs kevin.hobbs.1 at ohiou.edu
Wed Feb 1 14:30:17 EST 2006


On Wed, 2006-02-01 at 18:43 +0000, Kirthi Krishnamraju wrote:
>   
> Hi,
> 
> I am new to VTK. I am having problem in reading a dataset from a file
> and use it in the program.sample of my dataset is as follows
> -10.304059 -45.374859 -78.576840
> -12.567382 -47.687463 -79.794049
> 
> there r some 20,000 of such values. 
> I am using VC++ 6.0 n vtk4.2.
> 
> I am not understanding if i shud retrieve the data from the file just
> the way we do in vc++ or use the vtkPolyDataReader.
> 
> Can any1 pls help me. If there is any site tht has examples of
> programs tht use the files for reading and writing data, I would be
> happy if u gimme the link.
> 
> Regards,
> Kirthi

Are these data in a text file? I think there's a vtk example that does
this, but I did it myself too.  I read points in and triangulated them.
You can throw out that section of code. I also used C malloc because
that's what I know.  The #include "utility.c" is a hack because I'm also
no CMake expert.


-------------- next part --------------
PROJECT (vtk_mesh)

FIND_PACKAGE(VTK REQUIRED)
IF(NOT VTK_USE_RENDERING)
  MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
ENDIF(NOT VTK_USE_RENDERING)
INCLUDE(${VTK_USE_FILE})


ADD_EXECUTABLE(vtk_mesh vtk_mesh.cxx)

TARGET_LINK_LIBRARIES(vtk_mesh vtkRendering vtkGraphics)

ADD_EXECUTABLE(vtk_mesh_2d vtk_mesh_2d.cxx)

TARGET_LINK_LIBRARIES(vtk_mesh_2d vtkRendering vtkGraphics)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utility.c
Type: text/x-csrc
Size: 2094 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060201/88a2b7f3/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utility.h
Type: text/x-chdr
Size: 1599 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060201/88a2b7f3/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtk_mesh.cxx
Type: text/x-c++src
Size: 2307 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060201/88a2b7f3/attachment.cxx>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060201/88a2b7f3/attachment.pgp>


More information about the vtkusers mailing list