[vtkusers] How use vtkProgrammableSource in C++(Surface Reconstruction)

Amit Dhaduk amit at sahajanandsoftware.com
Sat Apr 2 04:28:25 EST 2005


Hi,

  I have points in cloud and want to generate surface reconstruction by vtk library. There is example in vtk in .py but I couldn't convert in C++ for below code. Any body can convert this few line code in c++. I have problem that how can I use SetExecuteMethod with my ReadFile function.


////////////////////////
pointSource = vtk.vtkProgrammableSource()

def readPoints():
    output = pointSource.GetPolyDataOutput()
    points = vtk.vtkPoints()
    output.SetPoints(points)

    file = open(os.path.normpath(os.path.join(VTK_DATA_ROOT, "Data/cactus.3337.pts")))

    line = file.readline()
    while line:
        data = string.split(line)
        if data and data[0] == 'p':
            x, y, z = float(data[1]), float(data[2]), float(data[3])
            points.InsertNextPoint(x, y, z)
        line = file.readline()


pointSource.SetExecuteMethod(readPoints) -- ???
//////////////////

Thanks 
Regard
Amit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050402/d92add6f/attachment.htm>


More information about the vtkusers mailing list