Marching Tetrahedron

Will Schroeder will.schroeder at kitware.com
Mon Aug 23 08:51:29 EDT 1999


Hi Yashodhan-

There are two approaches that occur to me: create a new type of dataset or place your data inside of VTK data arrays.

To create a new dataset type (the harder of the two aproaches), you'd subclass vtkDataSet and implement all the pure virtual functions in that class. Then the contour filter would operate on it unchanged.

Another way:
         - create a vtkFloatArray, assign a pointer to an array of floats (assumed xyz-xyz-xyz-...)
         using the vtkFloatArray::SetArray() method (make sure to set number of components to 3),
         create an instance of   vtkPoints, and use the vtkPoint::SetData() method to assign the 
         vtkFloatArray as the data representation for the points. Note that the array of floats is assumed
         to be your coordinate data.

         - create an instance of vtkUnstructuredGrid and assign the points to it
         aGrid->SetPoints(yourPoints);

         - Invoke the method vtkUnstructuredGrid::SetCells() method to define the tetrahedron. This 
         method requires that you define types and cell connectivity. If you're lucky you can pass
         pointers to your data to do this, more likely you'll have make a copy in the appropriate format.
         Alternatively, you could invoke InsertNextCell() for each of your tetrahedra.

Whichever way you try, then feed the data into the contour filter and it will process it.

Will

At 08:16 PM 8/21/99 -0400, Yashodhan Kusurkar wrote:
>Hi,
>
>Thanks for the response.
>However, I have another question.
>On reading the documenatation, I found out that I can run the contour by
>giving the
>unstructured grid filename as input.
>I have the list of tetrahedrons  along with the node values in memory.
>I do not wish to write this to a file (in VTK format) and again read the
>same.
>Is there any way in which I can pass this list at run-time to the vtkContour
>and get
>the list of polygons.
>
>Please advise.
>Thanks.
>
>Regards,
>Yashodhan
>
>
>Bill Lorensen wrote:
>
> > Yes. Just run vtkContourFilter on a dataset that contains tetrahedra. Now,
> > if you're looking for a filter that converts hex's to tet's, then that's
> > another story...
> >
> > Bill
> >
> > At 07:55 PM 8/16/99 -0400, Yashodhan Kusurkar wrote:
> > >Hi
> > >
> > >Can anyone tell me if there is a Marching tetrahedron implementation in
> > >VTK.
> > >
> > >Thanks
> > >Regards
> > >Yashodhan
> > >
> > >
> > >--
> > >
> > >**********************************************
> > >  Yashodhan Kusurkar
> > >  Rutgers,The State University of New Jersey
> > >  23702 BPO Way
> > >  Piscataway
> > >  New Jersey 08854-8137
> > >  USA
> > >  Email kusurkar at caip.rutgers.edu
> > >  Tel: (732) 878-1804
> > >  Fax no: (810) 963-8454
> > >**********************************************
>
>--
>
>**********************************************
>  Yashodhan Kusurkar
>  Rutgers,The State University of New Jersey
>  23702 BPO Way
>  Piscataway
>  New Jersey 08854-8137
>  USA
>  Email kusurkar at caip.rutgers.edu
>  Tel: (732) 878-1804
>  Fax no: (810) 963-8454
>**********************************************
>
>
>
>
>
>-----------------------------------------------------------------------------
>This is the private VTK discussion list.  Please keep messages on-topic.
>Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at gsao.med.ge.com>.  For help, send message body containing
>"info vtkusers" to the same address.     Live long and prosper.
>-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list