[vtkusers] Have Problems with rendering images?

Sentil Balaji profbalse at yahoo.co.in
Sat Jan 10 01:12:33 EST 2004


Hey,

   I created a volume with a set of images using my
first data set.Later, I used a different set of images
but I did not obtain a different volume .The volume
merged with the previous one.I think its a  memory
leak.I used Delete() with every pointer...I dunno how
I got into this trouble...
   Besides, when I move the mouse ..the rotation is
pretty slow..The code is below::

#include<VTK\vtkRenderWindow.H>
#include<VTK\vtkRenderer.H>
#include<VTK\vtkVolume16Reader.H>
#include<VTK\vtkRenderWindowInteractor.H>
#include<VTK\vtkDataSetMapper.H>
#include<VTK\vtkActor.H>
#include<VTK\vtkPolyDataNormals.H>
#include<VTK\vtkContourFilter.h>
#include<VTK\vtkCamera.H>

void main()
{
	vtkRenderWindow *w=vtkRenderWindow ::New();
	vtkRenderer *r=vtkRenderer::New();
	vtkRenderWindowInteractor
*i=vtkRenderWindowInteractor::New();
	vtkVolume16Reader *vr=vtkVolume16Reader::New();
	vtkActor *a=vtkActor::New();
	vtkDataSetMapper *p=vtkDataSetMapper::New();
	w->AddRenderer(r);
	i->SetRenderWindow(w);
        vr->SetDataDimensions(126,126);
	vr->SetFilePrefix("C:\\p");
	vr->SetFilePattern("%s.%d.bmp");
	vr->SetImageRange(0,5);
	vr->SetDataByteOrderToLittleEndian();
        vr->SetDataSpacing (3.2, 3.2,8.5);
        p->SetInput((vtkDataSet *)vr->GetOutput());
        a->SetMapper(p);
	r->AddActor(a);
	w->Render();
        i->Start();
	w->Delete();
        r->Delete();
	i->Delete();
	vr->Delete();
	a->Delete();
	p->Delete();

	
}  

Awaiting your reply...

THANKS

Ciao

Cheers

BeeJay


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



More information about the vtkusers mailing list