예제 #1
0
파일: ioUtils.py 프로젝트: caomw/director
def readMultiBlock(filename):
    '''Reads a .vtm file and returns a list of vtkPolyData objects'''

    reader = vtk.vtkXMLMultiBlockDataReader()
    reader.SetFileName(filename)
    reader.Update()

    polyDataList = []
    mb = reader.GetOutput()
    for i in xrange(mb.GetNumberOfBlocks()):
        polyData = vtk.vtkPolyData.SafeDownCast(mb.GetBlock(i))
        if polyData and polyData.GetNumberOfPoints():
            polyDataList.append(shallowCopy(polyData))

    return polyDataList
예제 #2
0
def readMultiBlock(filename):
    '''Reads a .vtm file and returns a list of vtkPolyData objects'''

    reader = vtk.vtkXMLMultiBlockDataReader()
    reader.SetFileName(filename)
    reader.Update()

    polyDataList = []
    mb = reader.GetOutput()
    for i in xrange(mb.GetNumberOfBlocks()):
        polyData = vtk.vtkPolyData.SafeDownCast(mb.GetBlock(i))
        if polyData and polyData.GetNumberOfPoints():
            polyDataList.append(shallowCopy(polyData))

    return polyDataList