[vtkusers] need help in using vtkPolyDataReader

Dan Lee vtkdli at yahoo.com
Tue Mar 2 22:38:10 EST 2004


Dear vtk users,
 
   I'm new in using vtk. When I tried to use vtkPolyDataReader to input .vtk format data in an exercise, I run into trouble and  got following compiling problem: 
 
--------------------Configuration: StrSph2 - Win32 Debug--------------------
Linking...
StrSph2.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class vtkPolyData * __thiscall vtkPolyDataReader::GetOutput(void)" (__imp_?GetOutput at vtkPolyDataReader@@QAEPAVvtkPolyData@@XZ)
StrSph2.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class vtkPolyDataReader * __cdecl vtkPolyDataReader::New(void)" (__imp_?New at vtkPolyDataReader@@SAPAV1 at XZ)
Debug/StrSph2.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
ALL_BUILD - 3 error(s), 0 warning(s)

 
My code is following. Any help is highly appreciated.
 
Thanks.
 
Dan
 
 
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkSphereSource.h"
#include "vtkPolyDataReader.h"
#include "vtkElevationFilter.h"
#include "vtkLookupTable.h"
#include "vtkDataSetMapper.h"
#include "vtkActor.h"
void main ()
{
  vtkRenderer *renderer = vtkRenderer::New();
  vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer(renderer);
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);
 
 
  vtkPolyDataReader *polydata = vtkPolyDataReader::New();
    polydata->SetFileName("honolulu.vtk");
    
  vtkElevationFilter *colorIt = vtkElevationFilter::New();
  colorIt->SetInput((vtkDataSet *)polydata->GetOutput());
    colorIt->SetLowPoint(0,0,-1);
    colorIt->SetHighPoint(0,0,1);
  vtkLookupTable *lut = vtkLookupTable::New();
    lut->SetHueRange(0,0);
    lut->SetSaturationRange(0,0);
    lut->SetValueRange(.1,1);
  vtkDataSetMapper *mapper = vtkDataSetMapper::New();
    mapper->SetLookupTable(lut);
    mapper->SetInput(colorIt->GetOutput());
  vtkActor *actor = vtkActor::New();
    actor->SetMapper(mapper);
  renderer->AddActor(actor);
  renderer->SetBackground(1,1,1);
  renWin->SetSize(450,450);
  renWin->Render();
  // interact with data
  iren->Start();
  // Clean up
  renderer->Delete();
  renWin->Delete();
  iren->Delete();
  colorIt->Delete();
  lut->Delete();
  mapper->Delete();
  actor->Delete();
}

 


---------------------------------
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040302/7c984371/attachment.htm>


More information about the vtkusers mailing list