def VtkDibujaIdsElementos(nmbUGrid, setName, renderer): # ****** Creamos las etiquetas para las celdas ******* ids= vtk.vtkIdFilter() ids.SetInput(nmbUGrid) ids.CellIdsOff() ids.PointIdsOff() VtkCargaIdsElem(nmbUGrid,setName)() # Dibuja las etiquetas de las líneas. cc= vtk.vtkCellCenters() cc.SetInput(ids) # Centroides de las celdas. visElems= vtk.vtkSelectVisiblePoints() visElems.SetInput(cc) visElems.SetRenderer(renderer) visElems.SelectionWindowOff() ''' Create the mapper to display the element ids. Specify the format to use for the labels. Also create the associated actor. ''' elemMapper= vtk.vtkLabeledShStrMapper() elemMapper.SetInput(visElems) elemMapper.LabelTextProperty.SetColor(0,0,0.9) elemLabels= vtk.vtkActor2D() elemLabels.SetMapper(elemMapper) renderer.AddActor2D(elemLabels)
def VtkDibujaIdsElementos(nmbUGrid, setName, renderer): # ****** Creamos las etiquetas para las celdas ******* ids = vtk.vtkIdFilter() ids.SetInput(nmbUGrid) ids.CellIdsOff() ids.PointIdsOff() VtkCargaIdsElem(nmbUGrid, setName)() # Dibuja las etiquetas de las líneas. cc = vtk.vtkCellCenters() cc.SetInput(ids) # Centroides de las celdas. visElems = vtk.vtkSelectVisiblePoints() visElems.SetInput(cc) visElems.SetRenderer(renderer) visElems.SelectionWindowOff() ''' Create the mapper to display the element ids. Specify the format to use for the labels. Also create the associated actor. ''' elemMapper = vtk.vtkLabeledShStrMapper() elemMapper.SetInput(visElems) elemMapper.LabelTextProperty.SetColor(0, 0, 0.9) elemLabels = vtk.vtkActor2D() elemLabels.SetMapper(elemMapper) renderer.AddActor2D(elemLabels)
def VtkDibujaIdsNodes(recordGrid, renderer): '''Display node labels (not implemented yet)''' ids = vtk.vtkIdFilter() ids.SetInput(recordGrid.uGrid) ids.CellIdsOff() ids.PointIdsOff() VtkCargaIdsNodes(recordGrid) visPts = vtk.vtkSelectVisiblePoints() visPts.SetInput("ids") visPts.SetRenderer(renderer) visPts.SelectionWindowOff() #Create the mapper to display the point ids. Specify the format to # use for the labels. Also create the associated actor. ldm = vtk.vtkLabeledShStrMapper() ldm.SetInput("visPts") ldm.LabelTextProperty().SetColor(0.1, 0.1, 0.1) nodeLabels = vtk.vtkActor2D().SetMapper(ldm) renderer.AddActor2D(nodeLabels)
def VtkDibujaIdsNodes(recordGrid, renderer): '''Display node labels''' ids= vtk.vtkIdFilter() ids.SetInput(recordGrid.uGrid) ids.CellIdsOff() ids.PointIdsOff() VtkCargaIdsNodes(recordGrid) visPts= vtk.vtkSelectVisiblePoints() visPts.SetInput("ids") visPts.SetRenderer(renderer) visPts.SelectionWindowOff() #Create the mapper to display the point ids. Specify the format to # use for the labels. Also create the associated actor. ldm= vtk.vtkLabeledShStrMapper() ldm.SetInput("visPts") ldm.LabelTextProperty().SetColor(0.1,0.1,0.1) nodeLabels= vtk.vtkActor2D().SetMapper(ldm) renderer.AddActor2D(nodeLabels)