<P>
Hello everybody,<BR>
Thanks you all for the help you have done for me.<BR>
<BR>
Iam working on a class that uses vtk. the code goes like this<BR>
<BR>
//all tehe #includes are here<BR>
class cdraw<BR>
{<BR>
vtkLineSource **ls;<BR>
vtkPolyDataMapper **map;<BR>
vtkActor **act;<BR>
vtkRenderer *rnd;<BR>
vtkRenderWindowInteractor *rwi;<BR>
vtkRenderWindow *rw<BR>
int count;<BR>
<BR>
public:<BR>
cdraw(int cnt)<BR>
{<BR>
count=cnt;<BR>
int i;<BR>
ls=new vtkLineSource *[cnt];<BR>
act=new vtkActor *[cnt];<BR>
map=new vtkPolyDataMapper *[cnt];<BR>
<BR>
rnd=vtkRenderer::New();<BR>
<BR>
for (i=0;i<cnt;i++)<BR>
{<BR>
ls[i]=vtkLineSource::New();<BR>
act[i]=vtkActor::New();<BR>
map[i]=vtkPolyDataMapper::New();<BR>
<BR>
ls[i]->SetPoint1((float)i,0.0,0.0);<BR>
ls[i]->SetPoint2((float)i,10.0,0.0);<BR>
map[i]->SetInput(ls[i]->GetOutput()); <BR>
act[i]->SetMapper(map[i]);<BR>
rnd->AddActor(act[i]);<BR>
<BR>
}<BR>
<BR>
<BR>
rw=vtkRenderWindow::New();<BR>
rw->AddRenderer(rnd);<BR>
<BR>
rwi=vtkRenderWindowInteractor::New();<BR>
rwi->SetRenderWindow(rw);<BR>
<BR>
}<BR>
<BR>
void render()<BR>
{<BR>
rwi->Initialize();<BR>
rnd->Render();<BR>
rwi->Start();<BR>
}<BR>
<BR>
~cdraw()<BR>
{<BR>
for (i=0;i<cnt;i++)<BR>
{<BR>
ls[i]->Delete();<BR>
act[i]->Delete();<BR>
map[i]->Delete();<BR>
}<BR>
delete[] ls;<BR>
delete[] act;<BR>
delete[] map;<BR>
<BR>
rnd->Delete();<BR>
rwi->Delete();<BR>
rw->Delete();<BR>
<BR>
}<BR>
<BR>
};<BR>
<BR>
<BR>
<BR>
void main()<BR>
{<BR>
cdraw *c;<BR>
c=new cdraw(5);<BR>
c->render();<BR>
<BR>
delete c;<BR>
}<BR>
<BR>
<BR>
when i exit from the code pressing "q" i get a window which displays the message<BR>
"trying to delete object with non zero refernce count"<BR>
<BR>
please help<BR>
thanking you for the help<BR>
david michell
</P>
<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=0 VSPACE=0 HSPACE=0 HEIGHT=74 WIDTH=496></a>