示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
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)