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

yessine yengui.yessine at gmail.com
Thu Apr 12 11:42:48 EDT 2007


Hi,

  I have points in cloud and I want to generate surface reconstruction by
vtk library. There is example in vtk in .py but I couldn't convert it in C++
for below code. Can you help me to convert this few line code in c++. I have
problem with the use of SetExecuteMethod fonction.


////////////////////////
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
 

-- 
View this message in context: http://www.nabble.com/How-use-vtkProgrammableSource-in-C%2B%2B%28Surface-Reconstruction%29-tf3566169.html#a9961793
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list