[vtkusers] vtkDelaunay3D does'nt work in C++?

Sentil Balaji profbalse at yahoo.co.in
Thu Feb 5 01:37:48 EST 2004


Hey,

   I tried the Delaunay3D exampli in Tcl , it worked
fine.But, when I programmed it in C++ I get
errors[listed below].Also, I did not find the header
file "vtkUnstructuredGridVolumeMapper.h".It is not in
the CD-ROM that comes with the VTK Users' Guide.
-----
CODE
----
	vtkRenderWindow *w=vtkRenderWindow::New();
	vtkRenderWindowInteractor
*in=vtkRenderWindowInteractor::New();
	vtkRenderer *r=vtkRenderer::New();
	vtkActor *a=vtkActor::New();
	vtkDelaunay3D *d=vtkDelaunay3D::New();
	vtkPoints *p=vtkPoints::New();
	vtkPolyData *pd=vtkPolyData::New();
	vtkPolyDataMapper *pdm=vtkPolyDataMapper::New();
	vtkExtractEdges *e=vtkExtractEdges::New();
	vtkDataSetMapper *dsm=vtkDataSetMapper::New();
	vtkShrinkFilter *sfil=vtkShrinkFilter::New();
	vtkMath *math=vtkMath::New();
	vtkUnstructuredGridToPolyDataFilter *pdfil;
	for(i=1;i<=M;i++)
		p->InsertPoint(i,I[i]);
	pd->SetPoints(p);
	d->SetInput(pd);
	d->SetTolerance(0.001);
	sfil->SetInput(d->GetOutput());
	dsm->SetInput(sfil->GetOutput());
	a->SetMapper(dsm);
	in->SetRenderWindow(w);
	w->AddRenderer(r);
	r->AddActor(a);
	w->Render();
	in->Start();
	w->Delete();
	in->Delete();
	r->Delete();
	a->Delete();
	pdm->Delete();
	pd->Delete();
	p->Delete();
-------
ERROR
-------
:\vtkbase\ren1.cpp(52) : error C2664: 'SetInput' :
cannot convert parameter 1 from 'class
vtkUnstructuredGrid *' to 'class vtkDataSet *'
        Types pointed to are unrelated; conversion
requires reinterpret_cast, C-style cast or
function-style cast
d:\vtkbase\ren1.cpp(53) : error C2664: 'SetInput' :
cannot convert parameter 1 from 'class
vtkUnstructuredGrid *' to 'class vtkDataSet *'
        Types pointed to are unrelated; conversion
requires reinterpret_cast, C-style cast or
function-style cast
Error executing cl.exe.

REN1.exe - 2 error(s), 0 warning(s)
---------------------------------------------------

Awaiting reply for both the questions..Thanks

Cheers

BeeJay



________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com



More information about the vtkusers mailing list