[vtkusers] about Delaunay2D

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Sep 28 00:53:44 EDT 2001


hi,

>>>>> "HX" == Xiaoping Huang <Huang> writes:

    HX> + create a polydata with points Can I use
    HX> "SetInput(vtkPointSet *input)" to deliver points data to
    HX> vtkDelaunay2D instance ?  If can, then I should create a
    HX> vtkPointSet to include all my points and use it as the
    HX> parameter of that function, is that right?

vtkPolyData IsA 'vtkPointSet' so I dont think you need to worry.

    HX> + create a vtkDelaunay2D instance and set its input to the
    HX> polydata But I have not found a function can input polydata to
    HX> vtkDelaunay2D. You mean vtkPointSet?

Look at the vtk 3.x version's examples.  A relavant python example is:

graphics/examplesPython/Delaunay2D.py which reads:

--------------------------------------------------
profile = vtkPolyData()
profile.SetPoints(points)

# triangulate them
#
delny = vtkDelaunay2D()
delny.SetInput(profile)
delny.BoundingTriangulationOn()
delny.SetTolerance(0.001)
delny.SetAlpha(0.0)
delny.Update()
    
shrink = vtkShrinkPolyData()
shrink.SetInput(delny.GetOutput())

map = vtkPolyDataMapper()
map.SetInput(shrink.GetOutput())
--------------------------------------------------


    HX> + invoke "Update()" on the delaunay2D instance
    HX> vtkSource::Update()?  Why not vtkDelaunay2D::Execute()?

Because Execute is a protected method that the end user isn't suppsed
to see/touch.  Execute is called internally when Update is called.

    HX> + get the output using the GetOutput() method vtkPolyData
    HX> *vtkPolyDataSource::GetOutput()? Then I should prepare a
    HX> vtkPolyData to save the triangulation result, is that righ?
 
Nope, as seen in the example the polydata is created for you - you
just use it for the next segment of the pipeline.

Generally to get help I suggest you search through the header files
and also look here:

http://public.kitware.com/vtk-docs/

and then also search through the examples that ship with VTK.  They
are incredibly useful.

prabhu



More information about the vtkusers mailing list