Exemplo n.º 1
0
def createAxesPolyData(scale, useTube, tubeWidth=0.002):
    axes = vtk.vtkAxes()
    axes.SetComputeNormals(0)
    axes.SetScaleFactor(scale)
    axes.Update()

    if useTube:
        tube = vtk.vtkTubeFilter()
        tube.SetInputConnection(axes.GetOutputPort())
        tube.SetRadius(tubeWidth)
        tube.SetNumberOfSides(12)
        tube.Update()
        axes = tube

    return shallowCopy(axes.GetOutput())
Exemplo n.º 2
0
    def _createAxes(self, scale, useTube):
        axes = vtk.vtkAxes()
        axes.SetComputeNormals(0)
        axes.SetScaleFactor(scale)
        axes.Update()

        if useTube:
            tube = vtk.vtkTubeFilter()
            tube.SetInput(axes.GetOutput())
            tube.SetRadius(0.002)
            tube.SetNumberOfSides(12)
            tube.Update()
            axes = tube

        return shallowCopy(axes.GetOutput())
Exemplo n.º 3
0
    def _createAxes(self, scale, useTube):
        axes = vtk.vtkAxes()
        axes.SetComputeNormals(0)
        axes.SetScaleFactor(scale)
        axes.Update()

        if useTube:
            tube = vtk.vtkTubeFilter()
            tube.SetInput(axes.GetOutput())
            tube.SetRadius(0.002)
            tube.SetNumberOfSides(12)
            tube.Update()
            axes = tube

        return shallowCopy(axes.GetOutput())
Exemplo n.º 4
0
def createAxesPolyData(scale, useTube, tubeWidth=0.002):
    axes = vtk.vtkAxes()
    axes.SetComputeNormals(0)
    axes.SetScaleFactor(scale)
    axes.Update()

    if useTube:
        tube = vtk.vtkTubeFilter()
        tube.SetInputConnection(axes.GetOutputPort())
        tube.SetRadius(tubeWidth)
        tube.SetNumberOfSides(12)
        tube.Update()
        axes = tube

    return shallowCopy(axes.GetOutput())
Exemplo n.º 5
0
 def addFrame(self, frame, scale, tubeRadius=0.0):
     axes = vtk.vtkAxes()
     axes.ComputeNormalsOff()
     axes.SetScaleFactor(scale)
     transformFilter = vtk.vtkTransformPolyDataFilter()
     transformFilter.SetTransform(frame)
     transformFilter.SetInputConnection(axes.GetOutputPort())
     transformFilter.Update()
     polyData = transformFilter.GetOutput()
     colors = np.array([[255, 0, 0], [255, 0, 0], [0, 255, 0], [0, 255, 0],
                        [0, 0, 255], [0, 0, 255]],
                       dtype=np.uint8)
     vnp.addNumpyToVtk(polyData, colors, 'RGB255')
     if tubeRadius:
         polyData = applyTubeFilter(polyData, tubeRadius)
     self.addPolyData(polyData, color=None)
Exemplo n.º 6
0
 def addFrame(self, frame, scale, tubeRadius=0.0):
     axes = vtk.vtkAxes()
     axes.ComputeNormalsOff()
     axes.SetScaleFactor(scale)
     transformFilter=vtk.vtkTransformPolyDataFilter()
     transformFilter.SetTransform(frame)
     transformFilter.SetInputConnection(axes.GetOutputPort())
     transformFilter.Update()
     polyData = transformFilter.GetOutput()
     colors = np.array(
         [[255, 0, 0], [255, 0, 0],
         [0, 255, 0], [0, 255, 0],
         [0, 0, 255], [0, 0, 255]], dtype=np.uint8)
     vnp.addNumpyToVtk(polyData, colors, 'RGB255')
     if tubeRadius:
         polyData = applyTubeFilter(polyData, tubeRadius)
     self.addPolyData(polyData, color=None)