[vtkusers] !PolyData->CopyCells method?

Terence Lim tlim at mda.ca
Tue Oct 16 15:24:48 EDT 2001


-----Original Message-----
From:
Sent: October 16, 2001 12:08 PM
To: 'Jingyi Jin'
Subject: RE: [vtkusers] Is there a better way to delete cells from
PolyData then....


Hi there,

Sorry to bother you.  If you aren't too busy, perhaps I may have a moment of
your time. I am trying to implement what you have suggested.  The problem is
that I get an error everytime I try to call CopyCells.

Here is a piece of my code:


vtkIdList *CellidList = vtkIdList::New();	//list to keep track of all the
cell ids
CellidList->InsertNextId(0);
.
.
.
CellidList->InsertNextId(17);

vtkPolyData *testPD = vtkPolyData::New();
testPD = Delaunay->GetMesh();			//GetMesh returns a PolyData *

cout<<CellidList->GetClassName();		//prints out "vtkIdList"
cout<<testPD->GetClassName();			//prints out "vtkPolyData"

vtkPolyData *test = vtkPolyData::New();
test->CopyCells(testPD,CellidList); 	//results in an error?!

What am I doing wrong here?
I have tried creating a vtkPointLocator *pl = vtkPointLocator::New();
and then the call test->CopyCells(testPD,CellidList,pl); 	but this still
resulted in an error?

Any ideas? Thanks for your time,

Terence.


-----Original Message-----
From: Jingyi Jin [mailto:jinjingyi at yahoo.com]
Sent: October 12, 2001 6:45 PM
To: tlim at mda.ca; vtkusers at public.kitware.com
Subject: Re: [vtkusers] Is there a better way to delete cells from
PolyData then....


Or you can declare an IdList to keep the cellIds of
the original mesh, then delete ID from it whenever you
want to delete a cell. At the end you can call

newMesh->CopyCells(oldMesh, IdList);

This way, only the cells in the IdList will be copied
to the new mesh.

Jingyi

--- Terence Lim <tlim at mda.ca> wrote:
> Is there a better way to delete cells from PolyData?
> or is this the best
> method available?
>
> using vtkDecimatePro:
>
> -First do BuildCells().
> -Then mark cells to delete with DeleteCell().
> -Finally test every cell GetCellType() and copy to a
> second vtkCellArray if
> type is VTK_TRIANGLE.
>
> I've searched through the archives and this was the
> best advice I could
> find. Does anyone have any other ideas? Thanks.
>
> -Terence
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com




More information about the vtkusers mailing list