def mergeToPolydataSerializer(parent, dataObject, dataObjectId, context, depth): dataset = None if dataObject.IsA('vtkCompositeDataSet'): dataMTime = dataObject.GetMTime() gf = vtkCompositeDataGeometryFilter() gf.SetInputData(dataObject) gf.Update() tempDS = gf.GetOutput() dataset = tempDS else: dataset = mapper.GetInput() return polydataSerializer(parent, dataset, dataObjectId, context, depth)
def mergeToPolydataSerializer(parent, dataObject, dataObjectId, context, depth): dataset = None if dataObject.IsA('vtkCompositeDataSet'): dataMTime = dataObject.GetMTime() gf = vtkCompositeDataGeometryFilter() gf.SetInputData(dataObject) gf.Update() tempDS = gf.GetOutput() dataset = tempDS else: dataset = mapper.GetInput() return polydataSerializer(parent, dataset, dataObjectId, context, depth)
def mergeToPolydataSerializer(parent, dataObject, dataObjectId, context, depth): dataset = None if dataObject.IsA('vtkCompositeDataSet'): gf = vtkCompositeDataGeometryFilter() gf.SetInputData(dataObject) gf.Update() dataset = gf.GetOutput() elif dataObject.IsA('vtkUnstructuredGrid'): gf = vtkGeometryFilter() gf.SetInputData(dataObject) gf.Update() dataset = gf.GetOutput() else: dataset = mapper.GetInput() return polydataSerializer(parent, dataset, dataObjectId, context, depth)
for rpIdx in range(renProps.GetNumberOfItems()): renProp = renProps.GetItemAsObject(rpIdx) if not renProp.GetVisibility(): continue if hasattr(renProp, 'GetMapper'): mapper = renProp.GetMapper() dataObject = mapper.GetInputDataObject(0, 0) dataset = None if dataObject.IsA('vtkCompositeDataSet'): if dataObject.GetNumberOfBlocks() == 1: dataset = dataObject.GetBlock(0) else: print('Apply geometry filter') gf = vtkCompositeDataGeometryFilter() gf.SetInputData(dataObject) gf.Update() dataset = gf.GetOutput() else: dataset = mapper.GetInput() if dataset and dataset.GetPoints(): componentName = getComponentName(renProp) scalarVisibility = mapper.GetScalarVisibility() arrayAccessMode = mapper.GetArrayAccessMode() colorArrayName = mapper.GetArrayName() if arrayAccessMode == 1 else mapper.GetArrayId() colorMode = mapper.GetColorMode() scalarMode = mapper.GetScalarMode() lookupTable = mapper.GetLookupTable()