diff --git a/.gitmodules b/.gitmodules index b121779..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "rag-components"] - path = rag-components - url = git@gitlab.kitware.com:christos.tsolakis/rag-components.git diff --git a/data/examples/Annotation/MultiLineText.md b/data/examples/Annotation/MultiLineText.md deleted file mode 100644 index 10c7151..0000000 --- a/data/examples/Annotation/MultiLineText.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example demonstrates the use of multiline 2D text using -vtkTextMapper. It shows several justifications as well as -single-line and multiple-line text inputs. diff --git a/data/examples/Annotation/MultiLineText.py b/data/examples/Annotation/MultiLineText.py deleted file mode 100755 index 91748a0..0000000 --- a/data/examples/Annotation/MultiLineText.py +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor2D, - vtkCoordinate, - vtkPolyDataMapper2D, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - font_size = 24 - - # Create the text mappers and the associated Actor2Ds. - # The font and text properties (except justification) are the same for - # each single line mapper. Let's create a common text property object - singleLineTextProp = vtkTextProperty() - singleLineTextProp.SetFontSize(font_size) - singleLineTextProp.SetFontFamilyToArial() - singleLineTextProp.BoldOff() - singleLineTextProp.ItalicOff() - singleLineTextProp.ShadowOff() - - # The font and text properties (except justification) are the same for - # each multi line mapper. Let's create a common text property object - multiLineTextProp = vtkTextProperty() - multiLineTextProp.ShallowCopy(singleLineTextProp) - multiLineTextProp.BoldOn() - multiLineTextProp.ItalicOn() - multiLineTextProp.ShadowOn() - multiLineTextProp.SetLineSpacing(0.8) - - colors = vtkNamedColors() - - # The text is on a single line and bottom-justified. - singleLineTextB = vtkTextMapper() - singleLineTextB.SetInput('Single line (bottom)') - tprop = singleLineTextB.GetTextProperty() - tprop.ShallowCopy(singleLineTextProp) - tprop.SetVerticalJustificationToBottom() - tprop.SetColor(colors.GetColor3d('Tomato')) - - singleLineTextActorB = vtkActor2D() - singleLineTextActorB.SetMapper(singleLineTextB) - singleLineTextActorB.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorB.GetPositionCoordinate().SetValue(0.05, 0.85) - - # The text is on a single line and center-justified (vertical justification). - singleLineTextC = vtkTextMapper() - singleLineTextC.SetInput('Single line (centered)') - tprop = singleLineTextC.GetTextProperty() - tprop.ShallowCopy(singleLineTextProp) - tprop.SetVerticalJustificationToCentered() - tprop.SetColor(colors.GetColor3d('DarkGreen')) - singleLineTextActorC = vtkActor2D() - - singleLineTextActorC.SetMapper(singleLineTextC) - singleLineTextActorC.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorC.GetPositionCoordinate().SetValue(0.05, 0.75) - - # The text is on a single line and top-justified. - singleLineTextT = vtkTextMapper() - singleLineTextT.SetInput('Single line (top)') - tprop = singleLineTextT.GetTextProperty() - tprop.ShallowCopy(singleLineTextProp) - tprop.SetVerticalJustificationToTop() - tprop.SetColor(colors.GetColor3d('Peacock')) - - singleLineTextActorT = vtkActor2D() - singleLineTextActorT.SetMapper(singleLineTextT) - singleLineTextActorT.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorT.GetPositionCoordinate().SetValue(0.05, 0.65) - - # The text is on multiple lines and left- and top-justified. - textMapperL = vtkTextMapper() - textMapperL.SetInput('This is\nmulti-line\ntext output\n(left-top)') - tprop = textMapperL.GetTextProperty() - tprop.ShallowCopy(multiLineTextProp) - tprop.SetJustificationToLeft() - tprop.SetVerticalJustificationToTop() - tprop.SetColor(colors.GetColor3d('Tomato')) - - textActorL = vtkActor2D() - textActorL.SetMapper(textMapperL) - textActorL.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorL.GetPositionCoordinate().SetValue(0.05, 0.5) - - # The text is on multiple lines and center-justified (both horizontal and vertical). - textMapperC = vtkTextMapper() - textMapperC.SetInput('This is\nmulti-line\ntext output\n(centered)') - tprop = textMapperC.GetTextProperty() - tprop.ShallowCopy(multiLineTextProp) - tprop.SetJustificationToCentered() - tprop.SetVerticalJustificationToCentered() - tprop.SetColor(colors.GetColor3d('DarkGreen')) - - textActorC = vtkActor2D() - textActorC.SetMapper(textMapperC) - textActorC.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorC.GetPositionCoordinate().SetValue(0.5, 0.5) - - # The text is on multiple lines and right- and bottom-justified. - textMapperR = vtkTextMapper() - textMapperR.SetInput('This is\nmulti-line\ntext output\n(right-bottom)') - tprop = textMapperR.GetTextProperty() - tprop.ShallowCopy(multiLineTextProp) - tprop.SetJustificationToRight() - tprop.SetVerticalJustificationToBottom() - tprop.SetColor(colors.GetColor3d('Peacock')) - - textActorR = vtkActor2D() - textActorR.SetMapper(textMapperR) - textActorR.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorR.GetPositionCoordinate().SetValue(0.95, 0.5) - - # Draw the grid to demonstrate the placement of the text. - - # Set up the necessary points. - Pts = vtkPoints() - Pts.InsertNextPoint(0.05, 0.0, 0.0) - Pts.InsertNextPoint(0.05, 1.0, 0.0) - Pts.InsertNextPoint(0.5, 0.0, 0.0) - Pts.InsertNextPoint(0.5, 1.0, 0.0) - Pts.InsertNextPoint(0.95, 0.0, 0.0) - Pts.InsertNextPoint(0.95, 1.0, 0.0) - Pts.InsertNextPoint(0.0, 0.5, 0.0) - Pts.InsertNextPoint(1.0, 0.5, 0.0) - Pts.InsertNextPoint(0.00, 0.85, 0.0) - Pts.InsertNextPoint(0.50, 0.85, 0.0) - Pts.InsertNextPoint(0.00, 0.75, 0.0) - Pts.InsertNextPoint(0.50, 0.75, 0.0) - Pts.InsertNextPoint(0.00, 0.65, 0.0) - Pts.InsertNextPoint(0.50, 0.65, 0.0) - - # Set up the lines that use these points. - Lines = vtkCellArray() - Lines.InsertNextCell(2) - Lines.InsertCellPoint(0) - Lines.InsertCellPoint(1) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(2) - Lines.InsertCellPoint(3) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(4) - Lines.InsertCellPoint(5) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(6) - Lines.InsertCellPoint(7) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(8) - Lines.InsertCellPoint(9) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(10) - Lines.InsertCellPoint(11) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(12) - Lines.InsertCellPoint(13) - - # Create a grid that uses these points and lines. - Grid = vtkPolyData() - Grid.SetPoints(Pts) - Grid.SetLines(Lines) - # Set up the coordinate system. - normCoords = vtkCoordinate() - normCoords.SetCoordinateSystemToNormalizedViewport() - - # Set up the mapper and actor (2D) for the grid. - mapper = vtkPolyDataMapper2D() - mapper.SetInputData(Grid) - mapper.SetTransformCoordinate(normCoords) - gridActor = vtkActor2D() - gridActor.SetMapper(mapper) - gridActor.GetProperty().SetColor(colors.GetColor3d('DimGray')) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer set the background and size zoom in closer to the image render - renderer.AddActor2D(textActorL) - renderer.AddActor2D(textActorC) - renderer.AddActor2D(textActorR) - renderer.AddActor2D(singleLineTextActorB) - renderer.AddActor2D(singleLineTextActorC) - renderer.AddActor2D(singleLineTextActorT) - renderer.AddActor2D(gridActor) - - renderer.SetBackground(colors.GetColor3d('Silver')) - renderWindow.SetSize(640, 480) - renderer.GetActiveCamera().Zoom(1.5) - - # Enable user interface interactor - interactor.Initialize() - renderWindow.SetWindowName('MultiLineText') - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Annotation/TextOrigin.md b/data/examples/Annotation/TextOrigin.md deleted file mode 100644 index f99f053..0000000 --- a/data/examples/Annotation/TextOrigin.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example demonstrates the use of vtkVectorText and vtkFollower. -vtkVectorText is used to create 3D annotation. vtkFollower is used to -position the 3D text and to ensure that the text always faces the -renderer's active camera (i.e., the text is always readable). diff --git a/data/examples/Annotation/TextOrigin.py b/data/examples/Annotation/TextOrigin.py deleted file mode 100755 index 0e82efa..0000000 --- a/data/examples/Annotation/TextOrigin.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkAxes -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkFollower, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - colors = vtkNamedColors() - - # Create the axes and the associated mapper and actor. - axes = vtkAxes() - axes.SetOrigin(0, 0, 0) - axesMapper = vtkPolyDataMapper() - axesMapper.SetInputConnection(axes.GetOutputPort()) - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Create the 3D text and the associated mapper and follower (a type of actor). Position the text so it is displayed over the origin of the axes. - atext = vtkVectorText() - atext.SetText('Origin') - textMapper = vtkPolyDataMapper() - textMapper.SetInputConnection(atext.GetOutputPort()) - textActor = vtkFollower() - textActor.SetMapper(textMapper) - textActor.SetScale(0.2, 0.2, 0.2) - textActor.AddPosition(0, -0.1, 0) - textActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Add the actors to the renderer. - renderer.AddActor(axesActor) - renderer.AddActor(textActor) - - renderer.SetBackground(colors.GetColor3d('Silver')) - - # Zoom in closer. - renderer.ResetCamera() - renderer.GetActiveCamera().Zoom(1.6) - - renderer.SetBackground(colors.GetColor3d('Silver')) - - # Reset the clipping range of the camera; set the camera of the follower; render. - renderer.ResetCameraClippingRange() - textActor.SetCamera(renderer.GetActiveCamera()) - - interactor.Initialize() - renderWindow.SetWindowName('TextOrigin') - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Arrays/GetValues.md b/data/examples/Arrays/GetValues.md deleted file mode 100644 index 1ae8797..0000000 --- a/data/examples/Arrays/GetValues.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Get values from a vtkPolyData source, normals in this case. diff --git a/data/examples/Arrays/GetValues.py b/data/examples/Arrays/GetValues.py deleted file mode 100755 index 0eeaad2..0000000 --- a/data/examples/Arrays/GetValues.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersSources import vtkSphereSource - - -def main(): - # setup sphere - sphereSource = vtkSphereSource() - sphereSource.Update() - - polydata = vtkPolyData() - polydata.ShallowCopy(sphereSource.GetOutput()) - - normals = polydata.GetPointData().GetNormals() - normal0 = normals.GetTuple3(0) - - print('Normal0: {:3.1f} {:3.1f} {:3.1f}'.format(normal0[0], normal0[1], normal0[2])) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Arrays/RenameArray.md b/data/examples/Arrays/RenameArray.md deleted file mode 100644 index 8f59960..0000000 --- a/data/examples/Arrays/RenameArray.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Renaming the normals array. diff --git a/data/examples/Arrays/RenameArray.py b/data/examples/Arrays/RenameArray.py deleted file mode 100755 index e041226..0000000 --- a/data/examples/Arrays/RenameArray.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def main(): - # setup sphere - sphereSource = vtkSphereSource() - sphereSource.Update() - - polydata = vtkPolyData() - polydata.ShallowCopy(sphereSource.GetOutput()) - - normals = polydata.GetPointData().GetNormals() - normals.SetName('TestN') - - writer = vtkXMLPolyDataWriter() - writer.SetFileName('Test.vtp') - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/CompositeData/CompositePolyDataMapper.py b/data/examples/CompositeData/CompositePolyDataMapper.py deleted file mode 100755 index 9471ab8..0000000 --- a/data/examples/CompositeData/CompositePolyDataMapper.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkMultiBlockDataSet -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCompositeDataDisplayAttributes, - vtkCompositePolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create Sphere 1. - sphere1 = vtkSphereSource() - sphere1.SetRadius(3) - sphere1.SetCenter(0, 0, 0) - sphere1.Update() - - # Create Sphere 2. - sphere2 = vtkSphereSource() - sphere2.SetRadius(2) - sphere2.SetCenter(2, 0, 0) - sphere2.Update() - - mbds = vtkMultiBlockDataSet() - mbds.SetNumberOfBlocks(3) - mbds.SetBlock(0, sphere1.GetOutput()) - # Leave block 1 NULL. NULL blocks are valid and should be handled by - # algorithms that process multiblock datasets. Especially when - # running in parallel where the blocks owned by other processes are - # NULL in this process. - mbds.SetBlock(2, sphere2.GetOutput()) - - # Use vtkCompositePolyDataMapper2 if VTK Version < 90020230516 - mapper = vtkCompositePolyDataMapper() - mapper.SetInputDataObject(mbds) - cdsa = vtkCompositeDataDisplayAttributes() - mapper.SetCompositeDataDisplayAttributes(cdsa) - - # You can use the vtkCompositeDataDisplayAttributes to set the color, - # opacity and visibiliy of individual blocks of the multiblock dataset. - # Attributes are mapped by block pointers (vtkDataObject*), so these can - # be queried by their flat index through a convenience function in the - # attribute class (vtkCompositeDataDisplayAttributes::DataObjectFromIndex). - # Alternatively, one can set attributes directly through the mapper using - # flat indices. - # - # This sets the block at flat index 3 red - # Note that the index is the flat index in the tree, so the whole multiblock - # is index 0 and the blocks are flat indexes 1, 2 and 3. This affects - # the block returned by mbds.GetBlock(2). - mapper.SetBlockColor(3, colors.GetColor3d('Red')) - # Color the spheres. - mapper.SetBlockColor(1, colors.GetColor3d('LavenderBlush')) - mapper.SetBlockColor(2, colors.GetColor3d('Lavender')) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Enable user interface interactor. - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SteelBlue')) - renderWindow.SetWindowName('CompositePolyDataMapper') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/CompositeData/MultiBlockDataSet.py b/data/examples/CompositeData/MultiBlockDataSet.py deleted file mode 100755 index 60a1e23..0000000 --- a/data/examples/CompositeData/MultiBlockDataSet.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkMultiBlockDataSet - -# vtkExtractEdges moved from vtkFiltersExtraction to vtkFiltersCore in -# VTK commit d9981b9aeb93b42d1371c6e295d76bfdc18430bd -try: - from vtkmodules.vtkFiltersCore import vtkExtractEdges -except ImportError: - from vtkmodules.vtkFiltersExtraction import vtkExtractEdges -from vtkmodules.vtkFiltersGeometry import vtkCompositeDataGeometryFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # PART 1 Make some Data. - # Make a tree. - root = vtkMultiBlockDataSet() - - branch = vtkMultiBlockDataSet() - root.SetBlock(0, branch) - - # Make some leaves. - leaf1 = vtkSphereSource() - leaf1.SetCenter(0, 0, 0) - leaf1.Update() - branch.SetBlock(0, leaf1.GetOutput()) - - leaf2 = vtkSphereSource() - leaf2.SetCenter(1.75, 2.5, 0) - leaf2.SetRadius(1.5) - leaf2.Update() - branch.SetBlock(1, leaf2.GetOutput()) - - leaf3 = vtkSphereSource() - leaf3.SetCenter(4, 0, 0) - leaf3.SetRadius(2) - leaf3.Update() - root.SetBlock(1, leaf3.GetOutput()) - - # PART 2 Do something with the data - # a non composite aware filter, the pipeline will iterate - edges = vtkExtractEdges() - edges.SetInputData(root) - - # PART 3 Show the data - # also demonstrate a composite aware filter - # this filter aggregates all blocks into one polydata - # this is handy for display, although fairly limited. - polydata = vtkCompositeDataGeometryFilter() - polydata.SetInputConnection(edges.GetOutputPort()) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(0, polydata.GetOutputPort(0)) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - actor.GetProperty().SetLineWidth(2) - actor.SetMapper(mapper) - - # Enable user interface interactor. - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('CornflowerBlue')) - renderWindow.SetWindowName('MultiBlockDataSet') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/CompositeData/OverlappingAMR.py b/data/examples/CompositeData/OverlappingAMR.py deleted file mode 100755 index 48ffaf9..0000000 --- a/data/examples/CompositeData/OverlappingAMR.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import ( - vtkAMRBox, - vtkOverlappingAMR, - vtkSphere, - vtkUniformGrid -) -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersGeometry import vtkCompositeDataGeometryFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def MakeScalars(dims, origin, spacing, scalars): - # Implicit function used to compute scalars - sphere = vtkSphere() - sphere.SetRadius(3) - sphere.SetCenter(5, 5, 5) - scalars.SetNumberOfTuples(dims[0] * dims[1] * dims[2]) - for k in range(0, dims[2]): - z = origin[2] + spacing[2] * k - for j in range(0, dims[1]): - y = origin[1] + spacing[1] * j - for i in range(0, dims[0]): - x = origin[0] + spacing[0] * i - scalars.SetValue(k * dims[0] * dims[1] + j * dims[0] + i, sphere.EvaluateFunction(x, y, z)) - - -def main(): - colors = vtkNamedColors() - - # Create and populate the AMR dataset - # The dataset should look like - # Level 0 - # uniform grid, dimensions 11, 11, 11, AMR box (0, 0, 0) - (9, 9, 9) - # Level 1 - refinement ratio : 2 - # uniform grid, dimensions 11, 11, 11, AMR box (0, 0, 0) - (9, 9, 9) - # uniform grid, dimensions 11, 11, 11, AMR box (10, 10, 10) - (19, 19, 19) - # Use MakeScalars() above to fill the scalar arrays - - amr = vtkOverlappingAMR() - blocksPerLevel = [1, 2] - amr.Initialize(2, blocksPerLevel) - - origin = [0.0, 0.0, 0.0] - spacing = [1.0, 1.0, 1.0] - dims = [11, 11, 11] - - ug1 = vtkUniformGrid() - # Geometry - ug1.SetOrigin(origin) - ug1.SetSpacing(spacing) - ug1.SetDimensions(dims) - - # Data - scalars = vtkFloatArray() - ug1.GetPointData().SetScalars(scalars) - MakeScalars(dims, origin, spacing, scalars) - - lo = [0, 0, 0] - hi = [9, 9, 9] - box1 = vtkAMRBox() - amr.SetAMRBox(0, 0, box1) - amr.SetDataSet(0, 0, ug1) - - spacing2 = [0.5, 0.5, 0.5] - ug2 = vtkUniformGrid() - # Geometry - ug2.SetOrigin(origin) - ug2.SetSpacing(spacing2) - ug2.SetDimensions(dims) - - # Data - scalars2 = vtkFloatArray() - ug2.GetPointData().SetScalars(scalars2) - MakeScalars(dims, origin, spacing2, scalars2) - - lo2 = [0, 0, 0] - hi2 = [9, 9, 9] - box2 = vtkAMRBox() - amr.SetAMRBox(1, 0, box2) - amr.SetDataSet(1, 0, ug2) - - origin3 = [5, 5, 5] - ug3 = vtkUniformGrid() - - # Geometry - ug3.SetOrigin(origin3) - ug3.SetSpacing(spacing2) - ug3.SetDimensions(dims) - - # Data - scalars3 = vtkFloatArray() - ug3.GetPointData().SetScalars(scalars3) - MakeScalars(dims, origin3, spacing2, scalars3) - - lo3 = [10, 10, 10] - hi3 = [19, 19, 19] - box3 = vtkAMRBox() - amr.SetAMRBox(1, 1, box3) - amr.SetDataSet(1, 1, ug3) - amr.SetRefinementRatio(0, 2) - - # Render the amr data here. - of = vtkOutlineFilter() - of.SetInputData(amr) - - geomFilter = vtkCompositeDataGeometryFilter() - geomFilter.SetInputConnection(of.GetOutputPort()) - - # Create an iso-surface - at 10. - cf = vtkContourFilter() - cf.SetInputData(amr) - cf.SetNumberOfContours(1) - cf.SetValue(0, 10.0) - - geomFilter2 = vtkCompositeDataGeometryFilter() - geomFilter2.SetInputConnection(cf.GetOutputPort()) - - # Create the render window, renderer, and interactor. - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Associate the geometry with a mapper and the mapper to an actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(of.GetOutputPort()) - actor1 = vtkActor() - actor1.GetProperty().SetColor(colors.GetColor3d('Yellow')) - actor1.SetMapper(mapper) - - # Associate the geometry with a mapper and the mapper to an actor. - mapper2 = vtkPolyDataMapper() - mapper2.SetInputConnection(geomFilter2.GetOutputPort()) - actor2 = vtkActor() - actor2.SetMapper(mapper2) - - # Add the actor to the renderer and start handling events. - aren.AddActor(actor1) - aren.AddActor(actor2) - aren.SetBackground(colors.GetColor3d('CornflowerBlue')) - renWin.SetWindowName('OverlappingAMR') - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/DataManipulation/LineOnMesh.md b/data/examples/DataManipulation/LineOnMesh.md deleted file mode 100644 index e120043..0000000 --- a/data/examples/DataManipulation/LineOnMesh.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Create a terrain with regularly spaced points and smooth the terrain (see [SmoothMeshgrid](../../PolyData/SmoothMeshGrid). -Then, a vtkCellLocator is used to find the intersection between vertical lines and the surface (using the IntersectWithLine method). Each intersection is saved as x, y, z coordinates and used to plot a spline on the surface. - -* Contributed by Michka Popoff diff --git a/data/examples/DataManipulation/LineOnMesh.py b/data/examples/DataManipulation/LineOnMesh.py deleted file mode 100755 index b8a8bc2..0000000 --- a/data/examples/DataManipulation/LineOnMesh.py +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env python3 - -import numpy as np - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import vtkParametricSpline -from vtkmodules.vtkCommonCore import ( - mutable, - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkCellLocator, - vtkPolyData, - vtkTriangle -) -from vtkmodules.vtkFiltersCore import vtkCleanPolyData -from vtkmodules.vtkFiltersModeling import vtkLoopSubdivisionFilter -from vtkmodules.vtkFiltersSources import vtkParametricFunctionSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - named_colors = vtkNamedColors() - - # Make a 32 x 32 grid. - size = 32 - - # Define z values for the topography. - # Comment out the following line if you want a different random - # distribution each time the script is run. - np.random.seed(3) - topography = np.random.randint(0, 5, (size, size)) - - # Define points, triangles and colors - colors = vtkUnsignedCharArray() - colors.SetNumberOfComponents(3) - points = vtkPoints() - triangles = vtkCellArray() - - # Build the meshgrid manually. - count = 0 - for i in range(size - 1): - for j in range(size - 1): - z1 = topography[i][j] - z2 = topography[i][j + 1] - z3 = topography[i + 1][j] - - # Triangle 1 - points.InsertNextPoint(i, j, z1) - points.InsertNextPoint(i, (j + 1), z2) - points.InsertNextPoint((i + 1), j, z3) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, count) - triangle.GetPointIds().SetId(1, count + 1) - triangle.GetPointIds().SetId(2, count + 2) - - triangles.InsertNextCell(triangle) - - z1 = topography[i][j + 1] - z2 = topography[i + 1][j + 1] - z3 = topography[i + 1][j] - - # Triangle 2 - points.InsertNextPoint(i, (j + 1), z1) - points.InsertNextPoint((i + 1), (j + 1), z2) - points.InsertNextPoint((i + 1), j, z3) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, count + 3) - triangle.GetPointIds().SetId(1, count + 4) - triangle.GetPointIds().SetId(2, count + 5) - - count += 6 - - triangles.InsertNextCell(triangle) - - # Add some color. - r = [int(i / float(size) * 255), int(j / float(size) * 255), 0] - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - - # Create a polydata object. - trianglePolyData = vtkPolyData() - - # Add the geometry and topology to the polydata. - trianglePolyData.SetPoints(points) - trianglePolyData.GetPointData().SetScalars(colors) - trianglePolyData.SetPolys(triangles) - - # Clean the polydata so that the edges are shared! - cleanPolyData = vtkCleanPolyData() - cleanPolyData.SetInputData(trianglePolyData) - - # Use a filter to smooth the data (will add triangles and smooth). - smooth_loop = vtkLoopSubdivisionFilter() - smooth_loop.SetNumberOfSubdivisions(3) - smooth_loop.SetInputConnection(cleanPolyData.GetOutputPort()) - - # Create a mapper and actor for smoothed dataset. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(smooth_loop.GetOutputPort()) - actor_loop = vtkActor() - actor_loop.SetMapper(mapper) - actor_loop.GetProperty().SetInterpolationToFlat() - - # Update the pipeline so that vtkCellLocator finds cells! - smooth_loop.Update() - - # Define a cellLocator to be able to compute intersections between lines. - # and the surface - locator = vtkCellLocator() - locator.SetDataSet(smooth_loop.GetOutput()) - locator.BuildLocator() - - maxloop = 1000 - dist = 20.0 / maxloop - tolerance = 0.001 - - # Make a list of points. Each point is the intersection of a vertical line - # defined by p1 and p2 and the surface. - points = vtkPoints() - for i in range(maxloop): - p1 = [2 + i * dist, 16, -1] - p2 = [2 + i * dist, 16, 6] - - # Outputs (we need only pos which is the x, y, z position - # of the intersection) - t = mutable(0) - pos = [0.0, 0.0, 0.0] - pcoords = [0.0, 0.0, 0.0] - subId = mutable(0) - locator.IntersectWithLine(p1, p2, tolerance, t, pos, pcoords, subId) - - # Add a slight offset in z. - pos[2] += 0.01 - # Add the x, y, z position of the intersection. - points.InsertNextPoint(pos) - - # Create a spline and add the points - spline = vtkParametricSpline() - spline.SetPoints(points) - functionSource = vtkParametricFunctionSource() - functionSource.SetUResolution(maxloop) - functionSource.SetParametricFunction(spline) - - # Map the spline - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(functionSource.GetOutputPort()) - - # Define the line actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(named_colors.GetColor3d('Red')) - actor.GetProperty().SetLineWidth(3) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add actors and render - renderer.AddActor(actor) - renderer.AddActor(actor_loop) - - renderer.SetBackground(named_colors.GetColor3d('Cornsilk')) - renderWindow.SetSize(800, 800) - renderWindow.Render() - renderer.GetActiveCamera().SetPosition(-32.471276, 53.258788, 61.209332) - renderer.GetActiveCamera().SetFocalPoint(15.500000, 15.500000, 2.000000) - renderer.GetActiveCamera().SetViewUp(0.348057, -0.636740, 0.688055) - renderer.ResetCameraClippingRange() - renderWindow.SetWindowName('LineOnMesh') - renderWindow.Render() - - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/DataManipulation/MeshLabelImageColor.md b/data/examples/DataManipulation/MeshLabelImageColor.md deleted file mode 100644 index 7ef2fc4..0000000 --- a/data/examples/DataManipulation/MeshLabelImageColor.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example takes a label image in Meta format and meshes a single label of it. It then smooths the mesh and colours the vertices according to the displacement error introduced by the smoothing. The whole thing is then displayed. diff --git a/data/examples/DataManipulation/MeshLabelImageColor.py b/data/examples/DataManipulation/MeshLabelImageColor.py deleted file mode 100755 index 696ffeb..0000000 --- a/data/examples/DataManipulation/MeshLabelImageColor.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataNormals, - vtkWindowedSincPolyDataFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkDiscreteFlyingEdges3D, - vtkDiscreteMarchingCubes -) -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkExtractVOI -from vtkmodules.vtkRenderingCore import ( - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingLOD import vtkLODActor - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - ifn, index = get_program_parameters() - - # Prepare to read the file. - reader_volume = vtkMetaImageReader() - reader_volume.SetFileName(ifn) - reader_volume.Update() - - # Extract the region of interest. - voi = vtkExtractVOI() - voi.SetInputConnection(reader_volume.GetOutputPort()) - voi.SetVOI(0, 517, 0, 228, 0, 392) - voi.SetSampleRate(1, 1, 1) - voi.Update() # Necessary for GetScalarRange(). - srange = voi.GetOutput().GetScalarRange() # Needs Update() before! - print('Range', srange) - - # Prepare surface generation. - # For label images. - if use_flying_edges: - try: - contour = vtkDiscreteFlyingEdges3D() - except AttributeError: - contour = vtkDiscreteMarchingCubes() - else: - contour = vtkDiscreteMarchingCubes() - contour.SetInputConnection(voi.GetOutputPort()) - # contour.ComputeNormalsOn() - - print('Doing label', index) - - contour.SetValue(0, index) - contour.Update() # Needed for GetNumberOfPolys()!!! - - smoother = vtkWindowedSincPolyDataFilter() - smoother.SetInputConnection(contour.GetOutputPort()) - smoother.SetNumberOfIterations(30) # This has little effect on the error! - # smoother.BoundarySmoothingOff() - # smoother.FeatureEdgeSmoothingOff() - # smoother.SetFeatureAngle(120.0) - # smoother.SetPassBand(0.001) # This increases the error a lot! - smoother.NonManifoldSmoothingOn() - smoother.NormalizeCoordinatesOn() - smoother.GenerateErrorScalarsOn() - # smoother.GenerateErrorVectorsOn() - smoother.Update() - - # Find min and max of the smoother error. - se_range = smoother.GetOutput().GetPointData().GetScalars().GetRange() - print('Smoother error range:', se_range) - if se_range[1] > 1: - print('Big smoother error: min/max:', se_range[0], se_range[1]) - - lut = get_diverging_lut(4) - - # Calculate cell normals. - normals = vtkPolyDataNormals() - normals.SetInputConnection(smoother.GetOutputPort()) - normals.ComputeCellNormalsOn() - normals.ComputePointNormalsOff() - normals.ConsistencyOn() - normals.AutoOrientNormalsOn() - normals.Update() # Creates vtkPolyData. - normals.SetFeatureAngle(60.0) - - mapper = vtkPolyDataMapper() - # mapper.SetInputConnection(smoother.GetOutputPort()) # This has no normals. - mapper.SetInputConnection(normals.GetOutputPort()) # This is better for visibility.) - mapper.ScalarVisibilityOn() # Show colour. - mapper.SetScalarRange(se_range) - # mapper.SetScalarModeToUseCellData() # Contains the label eg. 31 - mapper.SetScalarModeToUsePointData() # The smoother error relates to the verts. - mapper.SetLookupTable(lut) - - # Take the isosurface data and create geometry. - actor = vtkLODActor() - actor.SetNumberOfCloudPoints(100000) - actor.SetMapper(mapper) - - # Create the renderer. - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('DimGray')) - ren.AddActor(actor) - - # Create a window for the renderer of size 600X600 - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetSize(600, 600) - ren_win.SetWindowName('MeshLabelImageColor') - ren_win.Render() - - # Set a user interface interactor for the render window. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Start the initialization and rendering. - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'MeshLabelImageColor.' - epilogue = ''' - Takes a label image in Meta format and meshes a single label of it. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='labels.mhd') - parser.add_argument('label', nargs='?', const=1, type=int, default=31, help='The label to use e.g 31') - args = parser.parse_args() - return args.filename, args.label - - -def get_diverging_lut(ct=0): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - - :param ct: The index of the color map to use. - :return: The lookup table. - """ - - cm = dict() - # Start point = 0.0, mid point = 0.5 and end point = 1.0. - # Each value is a list with three sublists corresponding to the start point, - # mid point and end point along with the rgb color values for the respective point. - # cool to warm - cm[0] = [[0.0, 0.230, 0.299, 0.754], [0.5, 0.865, 0.865, 0.865], [1.0, 0.706, 0.016, 0.150]] - # purple to orange - cm[1] = [[0.0, 0.436, 0.308, 0.631], [0.5, 0.865, 0.865, 0.865], [1.0, 0.759, 0.334, 0.046]] - # green to purple - cm[2] = [[0.0, 0.085, 0.532, 0.201], [0.5, 0.865, 0.865, 0.865], [1.0, 0.436, 0.308, 0.631]] - # blue to brown - cm[3] = [[0.0, 0.217, 0.525, 0.910], [0.5, 0.865, 0.865, 0.865], [1.0, 0.677, 0.492, 0.093]] - # green to red - cm[4] = [[0.0, 0.085, 0.532, 0.201], [0.5, 0.865, 0.865, 0.865], [1.0, 0.758, 0.214, 0.233]] - - ct = abs(ct) - if ct > len(cm) - 1: - ct = 0 - print('The selected diverging color map is unavailable. Using the default cool to warm one.') - - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - for scheme in cm[ct]: - ctf.AddRGBPoint(*scheme) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/GeometricObjects/ParametricObjects.md b/data/examples/Deprecated/GeometricObjects/ParametricObjects.md deleted file mode 100644 index 74a61c2..0000000 --- a/data/examples/Deprecated/GeometricObjects/ParametricObjects.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description -See [Parametric Equations for Surfaces](http://www.vtk.org/wp-content/uploads/2015/11/ParametricSurfaces.pdf) by Andrew Maclean for an excellent description of these beautiful parametric surfaces. - -You can edit the following code by selecting any one of the functions and the corresponding object will be displayed. diff --git a/data/examples/Deprecated/GeometricObjects/ParametricObjects.py b/data/examples/Deprecated/GeometricObjects/ParametricObjects.py deleted file mode 100755 index 3fd5f0b..0000000 --- a/data/examples/Deprecated/GeometricObjects/ParametricObjects.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import vtkmodules.all as vtk - - -def main(): - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - # Uncomment one of the following. - # parametricObject = vtk.vtkParametricBoy() - # parametricObject = vtk.vtkParametricConicSpiral() - # parametricObject = vtk.vtkParametricCrossCap() - # parametricObject = vtk.vtkParametricDini() - # parametricObject = vtk.vtkParametricEllipsoid() - # parametricObject = vtk.vtkParametricEnneper() - parametricObject = vtk.vtkParametricFigure8Klein() - # parametricObject = vtk.vtkParametricKlein() - # parametricObject = vtk.vtkParametricMobius() - # parametricObject = vtk.vtkParametricRandomHills() - # parametricObject = vtk.vtkParametricRoman() - # parametricObject = vtk.vtkParametricSpline() - # parametricObject = vtk.vtkParametricSuperEllipsoid() - # parametricObject = vtk.vtkParametricSuperToroid() - # parametricObject = vtk.vtkParametricTorus() - - parametricFunctionSource = vtk.vtkParametricFunctionSource() - parametricFunctionSource.SetParametricFunction(parametricObject) - parametricFunctionSource.Update() - - # Visualize - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - mapper = vtk.vtkPolyDataMapper() - mapper.SetInputConnection(parametricFunctionSource.GetOutputPort()) - - # Create an actor for the contours - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - actor.SetBackfaceProperty(backProperty) - renderer = vtk.vtkRenderer() - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects") - renderWindow.AddRenderer(renderer) - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("BkgColor")) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.md b/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.md deleted file mode 100644 index 2231efd..0000000 --- a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description -See: [Parametric Equations for Surfaces](http://www.vtk.org/wp-content/uploads/2015/11/ParametricSurfaces.pdf) - -This example also demonstrates how to manipulate lists of VTK objects using lists. Notice how parameters of the various Parametric Objects are accessed and set in the parametricObjects list. diff --git a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.py b/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.py deleted file mode 100755 index 6fa31e2..0000000 --- a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo.py +++ /dev/null @@ -1,145 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -import vtkmodules.all as vtk - - -def main(): - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBoy()) - parametricObjects.append(vtk.vtkParametricConicSpiral()) - parametricObjects.append(vtk.vtkParametricCrossCap()) - parametricObjects.append(vtk.vtkParametricDini()) - - parametricObjects.append(vtk.vtkParametricEllipsoid()) - parametricObjects[-1].SetXRadius(0.5) - parametricObjects[-1].SetYRadius(2.0) - parametricObjects.append(vtk.vtkParametricEnneper()) - parametricObjects.append(vtk.vtkParametricFigure8Klein()) - parametricObjects.append(vtk.vtkParametricKlein()) - - parametricObjects.append(vtk.vtkParametricMobius()) - parametricObjects[-1].SetRadius(2) - parametricObjects[-1].SetMinimumV(-0.5) - parametricObjects[-1].SetMaximumV(0.5) - parametricObjects.append(vtk.vtkParametricRandomHills()) - parametricObjects[-1].AllowRandomGenerationOff() - parametricObjects.append(vtk.vtkParametricRoman()) - parametricObjects.append(vtk.vtkParametricSuperEllipsoid()) - parametricObjects[-1].SetN1(0.5) - parametricObjects[-1].SetN2(0.1) - - parametricObjects.append(vtk.vtkParametricSuperToroid()) - parametricObjects[-1].SetN1(0.2) - parametricObjects[-1].SetN2(3.0) - parametricObjects.append(vtk.vtkParametricTorus()) - parametricObjects.append(vtk.vtkParametricSpline()) - # Add some points to the parametric spline. - inputPoints = vtk.vtkPoints() - rng = vtk.vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - for i in range(0, 10): - rng.Next() - x = rng.GetRangeValue(0.0, 1.0) - rng.Next() - y = rng.GetRangeValue(0.0, 1.0) - rng.Next() - z = rng.GetRangeValue(0.0, 1.0) - inputPoints.InsertNextPoint(x, y, z) - parametricObjects[-1].SetPoints(inputPoints) - - parametricFunctionSources = list() - renderers = list() - mappers = list() - actors = list() - textmappers = list() - textactors = list() - - # Create one text property for all - textProperty = vtk.vtkTextProperty() - textProperty.SetFontSize(12) - textProperty.SetJustificationToCentered() - - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - # Create a parametric function source, renderer, mapper, and actor - # for each object - for i in range(0, len(parametricObjects)): - parametricFunctionSources.append(vtk.vtkParametricFunctionSource()) - parametricFunctionSources[i].SetParametricFunction(parametricObjects[i]) - parametricFunctionSources[i].SetUResolution(51) - parametricFunctionSources[i].SetVResolution(51) - parametricFunctionSources[i].SetWResolution(51) - parametricFunctionSources[i].Update() - - mappers.append(vtk.vtkPolyDataMapper()) - mappers[i].SetInputConnection(parametricFunctionSources[i].GetOutputPort()) - - actors.append(vtk.vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d("Banana")) - actors[i].GetProperty().SetSpecular(.5) - actors[i].GetProperty().SetSpecularPower(20) - actors[i].SetBackfaceProperty(backProperty) - - textmappers.append(vtk.vtkTextMapper()) - textmappers[i].SetInput(parametricObjects[i].GetClassName()) - textmappers[i].SetTextProperty(textProperty) - - textactors.append(vtk.vtkActor2D()) - textactors[i].SetMapper(textmappers[i]) - textactors[i].SetPosition(100, 16) - - renderers.append(vtk.vtkRenderer()) - renderers[i].AddActor(actors[i]) - renderers[i].AddActor(textactors[i]) - renderers[i].SetBackground(colors.GetColor3d("BkgColor")) - - # Setup the viewports - xGridDimensions = 4 - yGridDimensions = 4 - rendererSize = 200 - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects Demonstration") - renderWindow.SetSize(rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): - index = row * xGridDimensions + col - - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, - float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, - float(yGridDimensions - row) / yGridDimensions] - - if index > (len(actors) - 1): - # Add a renderer even if there is no actor. - # This makes the render window background all the same color. - ren = vtk.vtkRenderer() - ren.SetBackground(colors.GetColor3d("BkgColor")) - ren.SetViewport(viewport) - renderWindow.AddRenderer(ren) - continue - - renderers[index].SetViewport(viewport) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(-30) - renderers[index].GetActiveCamera().Zoom(0.9) - renderers[index].ResetCameraClippingRange() - renderWindow.AddRenderer(renderers[index]) - - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo2.py b/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo2.py deleted file mode 100755 index 5fcd6cf..0000000 --- a/data/examples/Deprecated/GeometricObjects/ParametricObjectsDemo2.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import vtkmodules.all as vtk - - -def main(): - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBohemianDome()) - parametricObjects[-1].SetA(5.0) - parametricObjects[-1].SetB(1.0) - parametricObjects[-1].SetC(2.0) - parametricObjects.append(vtk.vtkParametricBour()) - parametricObjects.append(vtk.vtkParametricCatalanMinimal()) - parametricObjects.append(vtk.vtkParametricHenneberg()) - parametricObjects.append(vtk.vtkParametricKuen()) - parametricObjects.append(vtk.vtkParametricPluckerConoid()) - parametricObjects.append(vtk.vtkParametricPseudosphere()) - - parametricFunctionSources = list() - renderers = list() - mappers = list() - actors = list() - textmappers = list() - textactors = list() - - # Create one text property for all - textProperty = vtk.vtkTextProperty() - textProperty.SetFontSize(12) - textProperty.SetJustificationToCentered() - - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - # Create a parametric function source, renderer, mapper, and actor - # for each object - for i in range(0, len(parametricObjects)): - parametricFunctionSources.append( - vtk.vtkParametricFunctionSource()) - parametricFunctionSources[i].SetParametricFunction(parametricObjects[i]) - parametricFunctionSources[i].Update() - - mappers.append(vtk.vtkPolyDataMapper()) - mappers[i].SetInputConnection( - parametricFunctionSources[i].GetOutputPort()) - - actors.append(vtk.vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d("Banana")) - actors[i].GetProperty().SetSpecular(.5) - actors[i].GetProperty().SetSpecularPower(20) - actors[i].SetBackfaceProperty(backProperty) - - textmappers.append(vtk.vtkTextMapper()) - textmappers[i].SetInput(parametricObjects[i].GetClassName()) - textmappers[i].SetTextProperty(textProperty) - - textactors.append(vtk.vtkActor2D()) - textactors[i].SetMapper(textmappers[i]) - textactors[i].SetPosition(100, 16) - - renderers.append(vtk.vtkRenderer()) - renderers[i].AddActor(actors[i]) - renderers[i].AddActor(textactors[i]) - renderers[i].SetBackground(colors.GetColor3d("BkgColor")) - - # Setup the viewports - xGridDimensions = 4 - yGridDimensions = 2 - rendererSize = 200 - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects Demonstration2") - renderWindow.SetSize(rendererSize * xGridDimensions, - rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): - index = row * xGridDimensions + col - - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, - float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, - float(yGridDimensions - row) / yGridDimensions] - - if index > (len(actors) - 1): - # Add a renderer even if there is no actor. - # This makes the render window background all the same color. - ren = vtk.vtkRenderer() - ren.SetBackground(colors.GetColor3d("BkgColor")) - ren.SetViewport(viewport) - renderWindow.AddRenderer(ren) - continue - - renderers[index].SetViewport(viewport) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(-30) - renderers[index].GetActiveCamera().Zoom(0.9) - renderers[index].ResetCameraClippingRange() - renderWindow.AddRenderer(renderers[index]) - - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/GeometricObjects/ReadMe.md b/data/examples/Deprecated/GeometricObjects/ReadMe.md deleted file mode 100644 index 2c15102..0000000 --- a/data/examples/Deprecated/GeometricObjects/ReadMe.md +++ /dev/null @@ -1,15 +0,0 @@ -# Deprecated GeometricObjects - -## ParametricObjects - -These examples: - -- ParametricObjects -- ParametricObjectsDemo -- ParametricObjectsDemo2 - -Have been replaced by a single example - -- ParametricObjectsDemo - -That encompasses all the functionality of the deprecated examples. diff --git a/data/examples/Deprecated/Geovis/GeoAssignCoordinates.md b/data/examples/Deprecated/Geovis/GeoAssignCoordinates.md deleted file mode 100644 index cfc03e7..0000000 --- a/data/examples/Deprecated/Geovis/GeoAssignCoordinates.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - - -* Contributed by Jim McCusker - - -!!! note - The vtkGeovisCore classes as well as the module vtkViewsGeovis have been deprecated for VTK 8.2 and will be removed in a future version. - See [VTK Merge Request 4395](https://gitlab.kitware.com/vtk/vtk/merge_requests/4395) diff --git a/data/examples/Deprecated/Geovis/GeoAssignCoordinates.py b/data/examples/Deprecated/Geovis/GeoAssignCoordinates.py deleted file mode 100755 index f6ee717..0000000 --- a/data/examples/Deprecated/Geovis/GeoAssignCoordinates.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python - -import vtkmodules.all as vtk - - -def main(): - colors = vtk.vtkNamedColors() - - g = vtk.vtkMutableDirectedGraph() - latitude = vtk.vtkDoubleArray() - latitude.SetName('latitude') - longitude = vtk.vtkDoubleArray() - longitude.SetName('longitude') - for i in range(-90, 90, 10): - for j in range(-180, 180, 20): - g.AddVertex() - latitude.InsertNextValue(i) - longitude.InsertNextValue(j) - g.GetVertexData().AddArray(latitude) - g.GetVertexData().AddArray(longitude) - - assign = vtk.vtkGeoAssignCoordinates() - assign.SetInputData(g) - - assign.SetLatitudeArrayName('latitude') - assign.SetLongitudeArrayName('longitude') - assign.SetGlobeRadius(1.0) - assign.Update() - - mapper = vtk.vtkGraphMapper() - mapper.SetInputConnection(assign.GetOutputPort()) - actor = vtk.vtkActor() - actor.SetMapper(mapper) - ren = vtk.vtkRenderer() - ren.AddActor(actor) - iren = vtk.vtkRenderWindowInteractor() - renWin = vtk.vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetInteractor(iren) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) - ren.ResetCamera() - ren.GetActiveCamera().SetPosition(-1.02, -4.6, 3.45) - ren.GetActiveCamera().SetViewUp(0.12, 0.78, 0.61) - ren.GetActiveCamera().SetDistance(4.53) - - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/Geovis/GeoGraticle.md b/data/examples/Deprecated/Geovis/GeoGraticle.md deleted file mode 100644 index ebade02..0000000 --- a/data/examples/Deprecated/Geovis/GeoGraticle.md +++ /dev/null @@ -1,3 +0,0 @@ -vtkGeoGraticle generates polydata to illustrate the distortions introduced by a map projection. -The level parameter specifies the number of lines to be drawn. Poles are treated differently than other regions; hence the use of a Level parameter instead of a NumberOfLines parameter. The latitude and longitude are specified as half-open intervals with units of degrees. -By default the latitude bounds are (-90,90) and the longitude bounds are (0,180). diff --git a/data/examples/Deprecated/Geovis/GeoGraticle.py b/data/examples/Deprecated/Geovis/GeoGraticle.py deleted file mode 100755 index c9de1a1..0000000 --- a/data/examples/Deprecated/Geovis/GeoGraticle.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -import vtkmodules.all as vtk - - -def main(): - colors = vtk.vtkNamedColors() - - geoGraticle = vtk.vtkGeoGraticule() - transformProjection = vtk.vtkGeoTransform() - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() - transformGraticle = vtk.vtkTransformFilter() - - reader = vtk.vtkXMLPolyDataReader() - transformReader = vtk.vtkTransformFilter() - graticleMapper = vtk.vtkPolyDataMapper() - readerMapper = vtk.vtkPolyDataMapper() - graticleActor = vtk.vtkActor() - readerActor = vtk.vtkActor() - - geoGraticle.SetGeometryType(geoGraticle.POLYLINES) - geoGraticle.SetLatitudeLevel(2) - geoGraticle.SetLongitudeLevel(2) - geoGraticle.SetLongitudeBounds(-180, 180) - geoGraticle.SetLatitudeBounds(-90, 90) - - # destinationProjection defaults to latlong. - destinationProjection.SetName('rouss') - destinationProjection.SetCentralMeridian(0.) - transformProjection.SetSourceProjection(sourceProjection) - transformProjection.SetDestinationProjection(destinationProjection) - transformGraticle.SetInputConnection(geoGraticle.GetOutputPort()) - transformGraticle.SetTransform(transformProjection) - graticleMapper.SetInputConnection(transformGraticle.GetOutputPort()) - graticleActor.SetMapper(graticleMapper) - - renderWindow = vtk.vtkRenderWindow() - renderer = vtk.vtkRenderer() - interactor = vtk.vtkRenderWindowInteractor() - renderWindow.SetInteractor(interactor) - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderer.SetBackground(colors.GetColor3d('BurlyWood')) - - renderer.AddActor(readerActor) - renderer.AddActor(graticleActor) - - renderWindow.Render() - interactor.Initialize() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Deprecated/ReadMe.md b/data/examples/Deprecated/ReadMe.md deleted file mode 100644 index bb3d9c2..0000000 --- a/data/examples/Deprecated/ReadMe.md +++ /dev/null @@ -1,3 +0,0 @@ -# Deprecated examples - -In this folder you will find examples that have been deprecated. diff --git a/data/examples/ExplicitStructuredGrid/CreateESGrid.md b/data/examples/ExplicitStructuredGrid/CreateESGrid.md deleted file mode 100644 index 6182c77..0000000 --- a/data/examples/ExplicitStructuredGrid/CreateESGrid.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example demonstrates how (1) to create an explicit structured grid and (2) to convert an explicit structured grid into an unstructured grid or vice versa. diff --git a/data/examples/ExplicitStructuredGrid/CreateESGrid.py b/data/examples/ExplicitStructuredGrid/CreateESGrid.py deleted file mode 100755 index 800c877..0000000 --- a/data/examples/ExplicitStructuredGrid/CreateESGrid.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkExplicitStructuredGrid -) -from vtkmodules.vtkFiltersCore import ( - vtkExplicitStructuredGridToUnstructuredGrid, - vtkUnstructuredGridToExplicitStructuredGrid -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleRubberBandPick -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def create_explicit_structured_grid(dimensions, spacing=(1, 1, 1)): - """Create an explicit structured grid. - - Parameters - ---------- - dimensions : tuple(int, int, int) - The number of points in the I, J and K directions. - spacing : tuple(int, int, int) - The spacing between points in the I, J and K directions. - - Returns - ------- - grid : vtkExplicitStructuredGrid - An explicit structured grid. - - """ - ni, nj, nk = dimensions - si, sj, sk = spacing - - points = vtkPoints() - for z in range(0, nk * sk, sk): - for y in range(0, nj * sj, sj): - for x in range(0, ni * si, si): - points.InsertNextPoint((x, y, z)) - - cells = vtkCellArray() - for k in range(0, nk - 1): - for j in range(0, nj - 1): - for i in range(0, ni - 1): - multi_index = ([i, i + 1, i + 1, i, i, i + 1, i + 1, i], - [j, j, j + 1, j + 1, j, j, j + 1, j + 1], - [k, k, k, k, k + 1, k + 1, k + 1, k + 1]) - pts = np.ravel_multi_index(multi_index, dimensions, order='F') - cells.InsertNextCell(8, pts) - - grid = vtkExplicitStructuredGrid() - grid.SetDimensions(ni, nj, nk) - grid.SetPoints(points) - grid.SetCells(cells) - return grid - - -def convert_to_unstructured_grid(grid): - """Convert explicit structured grid to unstructured grid. - - Parameters - ---------- - grid : vtkExplicitStructuredGrid - An explicit structured grid. - - Returns - ------- - vtkUnstructuredGrid - An unstructured grid. - - """ - converter = vtkExplicitStructuredGridToUnstructuredGrid() - converter.SetInputData(grid) - converter.Update() - return converter.GetOutput() - - -def convert_to_explicit_structured_grid(grid): - """Convert unstructured grid to explicit structured grid. - - Parameters - ---------- - grid : UnstructuredGrid - An unstructured grid. - - Returns - ------- - vtkExplicitStructuredGrid - An explicit structured grid. The ``'BLOCK_I'``, ``'BLOCK_J'`` and - ``'BLOCK_K'`` cell arrays are required. - - """ - converter = vtkUnstructuredGridToExplicitStructuredGrid() - converter.SetInputData(grid) - converter.SetInputArrayToProcess(0, 0, 0, 1, 'BLOCK_I') - converter.SetInputArrayToProcess(1, 0, 0, 1, 'BLOCK_J') - converter.SetInputArrayToProcess(2, 0, 0, 1, 'BLOCK_K') - converter.Update() - return converter.GetOutput() - - -def main(): - grid = create_explicit_structured_grid((5, 6, 7), (20, 10, 1)) - grid = convert_to_unstructured_grid(grid) - grid = convert_to_explicit_structured_grid(grid) - - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - - colors = vtkNamedColors() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().LightingOff() - actor.GetProperty().SetColor(colors.GetColor3d('Seashell')) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - window = vtkRenderWindow() - window.AddRenderer(renderer) - window.SetWindowName('CreateESGrid') - window.SetSize(1024, 768) - window.Render() - - camera = renderer.GetActiveCamera() - camera.SetPosition(8.383354, -72.468670, 94.262605) - camera.SetFocalPoint(42.295234, 21.111537, -0.863606) - camera.SetViewUp(0.152863, 0.676710, 0.720206) - camera.SetDistance(137.681759) - camera.SetClippingRange(78.173985, 211.583658) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(window) - interactor.SetInteractorStyle(vtkInteractorStyleRubberBandPick()) - window.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ExplicitStructuredGrid/LoadESGrid.md b/data/examples/ExplicitStructuredGrid/LoadESGrid.md deleted file mode 100644 index 2915887..0000000 --- a/data/examples/ExplicitStructuredGrid/LoadESGrid.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example displays the [UNISIM-II-D reservoir model](https://www.unisim.cepetro.unicamp.br/benchmarks/en/unisim-ii/unisim-ii-d) using the vtkExplicitStructuredGrid class. diff --git a/data/examples/ExplicitStructuredGrid/LoadESGrid.py b/data/examples/ExplicitStructuredGrid/LoadESGrid.py deleted file mode 100755 index 45d686a..0000000 --- a/data/examples/ExplicitStructuredGrid/LoadESGrid.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkUnstructuredGridToExplicitStructuredGrid -from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridReader -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleRubberBandPick -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(argv): - import argparse - description = 'Load an explicit structured grid from a file' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('fn', help='The explicit structured grid file name e.g. UNISIM-II-D.vtu.') - args = parser.parse_args() - return args.fn - - -def main(fn): - reader = vtkXMLUnstructuredGridReader() - reader.SetFileName(fn) - reader.Update() - - converter = vtkUnstructuredGridToExplicitStructuredGrid() - converter.GlobalWarningDisplayOff() # hide VTK errors - converter.SetInputConnection(reader.GetOutputPort()) - converter.SetInputArrayToProcess(0, 0, 0, 1, 'BLOCK_I') - converter.SetInputArrayToProcess(1, 0, 0, 1, 'BLOCK_J') - converter.SetInputArrayToProcess(2, 0, 0, 1, 'BLOCK_K') - converter.Update() - - grid = converter.GetOutput() - grid.ComputeFacesConnectivityFlagsArray() - grid.GetCellData().SetActiveScalars('ConnectivityFlags') - - scalars = grid.GetCellData().GetArray('ConnectivityFlags') - - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - mapper.SetColorModeToMapScalars() - mapper.SetScalarRange(scalars.GetRange()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - - colors = vtkNamedColors() - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DimGray')) - - window = vtkRenderWindow() - window.AddRenderer(renderer) - window.SetWindowName('LoadESGrid') - window.SetSize(1024, 768) - window.Render() - - camera = renderer.GetActiveCamera() - camera.SetPosition(312452.407650, 7474760.406373, 3507.364723) - camera.SetFocalPoint(314388.388434, 7481520.509575, -2287.477388) - camera.SetViewUp(0.089920, 0.633216, 0.768734) - camera.SetDistance(9111.926908) - camera.SetClippingRange(595.217338, 19595.429475) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(window) - interactor.SetInteractorStyle(vtkInteractorStyleRubberBandPick()) - window.Render() - interactor.Start() - - -if __name__ == '__main__': - import sys - - fn = get_program_parameters(sys.argv) - main(fn) diff --git a/data/examples/Filtering/AppendFilter.md b/data/examples/Filtering/AppendFilter.md deleted file mode 100644 index 3540344..0000000 --- a/data/examples/Filtering/AppendFilter.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example loads points into a polydata and an unstructured grid then combines them. - -The example should be extended to show cells being combined as well. diff --git a/data/examples/Filtering/AppendFilter.py b/data/examples/Filtering/AppendFilter.py deleted file mode 100755 index 2c30b56..0000000 --- a/data/examples/Filtering/AppendFilter.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkPolyData, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkAppendFilter -from vtkmodules.vtkFiltersSources import ( - vtkPointSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkGlyph3DMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create 5 points (vtkPolyData) - pointSource = vtkPointSource() - pointSource.SetNumberOfPoints(5) - pointSource.Update() - - polydata = pointSource.GetOutput() - - print('There are', polydata.GetNumberOfPoints(), 'points in the polydata.') - - # Create 2 points in a vtkUnstructuredGrid - points = vtkPoints() - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0, 0, 1) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - print('There are', ug.GetNumberOfPoints(), 'points in the unstructured.') - - # Combine the two data sets - appendFilter = vtkAppendFilter() - appendFilter.AddInputData(polydata) - appendFilter.AddInputData(ug) - appendFilter.Update() - - combined = vtkUnstructuredGrid() - - combined = appendFilter.GetOutput() - print('There are', combined.GetNumberOfPoints(), 'points combined.') - - # Create a mapper and actor - mapper = vtkDataSetMapper() - mapper.SetInputConnection(appendFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(5) - - # Map the points to spheres - sphereActor = point_to_glyph(appendFilter.GetOutput().GetPoints(), 0.05) - sphereActor.GetProperty().SetColor(colors.GetColor3d("Gold")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.AddActor(sphereActor) - renderer.SetBackground(colors.GetColor3d('RoyalBlue')) - - # Render and interact - renderWindow.SetWindowName('AppendFilter') - renderWindow.Render() - renderWindowInteractor.Start() - - -def point_to_glyph(points, scale): - """ - Convert points to glyphs. - :param points: The points to glyph. - :param scale: The scale, used to determine the size of the - glyph representing the point, expressed as a - fraction of the largest side of the bounding - box surrounding the points. e.g. 0.05 - :return: The actor. - """ - - bounds = points.GetBounds() - max_len = 0.0 - for i in range(0, 3): - max_len = max(bounds[i + 1] - bounds[i], max_len) - - sphere_source = vtkSphereSource() - sphere_source.SetRadius(scale * max_len) - - pd = vtkPolyData() - pd.SetPoints(points) - - mapper = vtkGlyph3DMapper() - mapper.SetInputData(pd) - mapper.SetSourceConnection(sphere_source.GetOutputPort()) - mapper.ScalarVisibilityOff() - mapper.ScalingOff() - - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/CombinePolyData.md b/data/examples/Filtering/CombinePolyData.md deleted file mode 100644 index 4e61cb0..0000000 --- a/data/examples/Filtering/CombinePolyData.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -This example reads two .vtp files (or produces them if not specified as command line arguments), combines them, and -displays the result to the screen. diff --git a/data/examples/Filtering/CombinePolyData.py b/data/examples/Filtering/CombinePolyData.py deleted file mode 100755 index 9ba1515..0000000 --- a/data/examples/Filtering/CombinePolyData.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkCleanPolyData -) -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [0.3, 0.2, 0.1, 1.0]) - - input1 = vtkPolyData() - input2 = vtkPolyData() - - sphereSource = vtkSphereSource() - sphereSource.SetCenter(5, 0, 0) - sphereSource.Update() - - input1.ShallowCopy(sphereSource.GetOutput()) - - coneSource = vtkConeSource() - coneSource.Update() - - input2.ShallowCopy(coneSource.GetOutput()) - - # Append the two meshes - appendFilter = vtkAppendPolyData() - appendFilter.AddInputData(input1) - appendFilter.AddInputData(input2) - - appendFilter.Update() - - # Remove any duplicate points. - cleanFilter = vtkCleanPolyData() - cleanFilter.SetInputConnection(appendFilter.GetOutputPort()) - cleanFilter.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cleanFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - - # Render and interact - renderWindowInteractor.Initialize() - renderWindow.Render() - renderWindow.SetWindowName('CombinePolyData') - renderer.SetBackground(colors.GetColor3d('deep_ochre')) - renderer.GetActiveCamera().Zoom(0.9) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/ConnectivityFilter.py b/data/examples/Filtering/ConnectivityFilter.py deleted file mode 100755 index 64d86e3..0000000 --- a/data/examples/Filtering/ConnectivityFilter.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkAppendFilter, - vtkConnectivityFilter, - vtkDelaunay3D -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphereSource1 = vtkSphereSource() - sphereSource1.Update() - - delaunay1 = vtkDelaunay3D() - delaunay1.SetInputConnection(sphereSource1.GetOutputPort()) - delaunay1.Update() - - sphereSource2 = vtkSphereSource() - sphereSource2.SetCenter(5, 0, 0) - sphereSource2.Update() - - delaunay2 = vtkDelaunay3D() - delaunay2.SetInputConnection(sphereSource2.GetOutputPort()) - delaunay2.Update() - - appendFilter = vtkAppendFilter() - appendFilter.AddInputConnection(delaunay1.GetOutputPort()) - appendFilter.AddInputConnection(delaunay2.GetOutputPort()) - appendFilter.Update() - - connectivityFilter = vtkConnectivityFilter() - connectivityFilter.SetInputConnection(appendFilter.GetOutputPort()) - connectivityFilter.SetExtractionModeToAllRegions() - connectivityFilter.ColorRegionsOn() - connectivityFilter.Update() - - # Visualize - mapper = vtkDataSetMapper() - mapper.SetInputConnection(connectivityFilter.GetOutputPort()) - mapper.Update() - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - - # renWindow = vtkRenderWindow() - # renWindow.AddRenderer(renderer) - # iren = vtkRenderWindowInteractor() - # iren.SetRenderWindow(renWindow) - # iren.Initialize() - # iren.Start() - renWindow = vtkRenderWindow() - renWindow.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWindow) - - iren.Initialize() - renWindow.Render() - renWindow.SetWindowName('ConnectivityFilter') - renderer.SetBackground(colors.GetColor3d('deep_ochre')) - renderer.GetActiveCamera().Zoom(0.9) - renWindow.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/ConstrainedDelaunay2D.md b/data/examples/Filtering/ConstrainedDelaunay2D.md deleted file mode 100644 index 9c4b7bc..0000000 --- a/data/examples/Filtering/ConstrainedDelaunay2D.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -Perform a 2D Delaunay triangulation respecting a specified boundary. This examples constructs a 10x10 grid of points. It -then defines a polygon that uses the points in the grid. We want to triangulate all of the points except the region -inside the boundary of the polygon. We expect a rectangular hole of size 4x3 in the resulting triangulated plane. diff --git a/data/examples/Filtering/ConstrainedDelaunay2D.py b/data/examples/Filtering/ConstrainedDelaunay2D.py deleted file mode 100755 index c165865..0000000 --- a/data/examples/Filtering/ConstrainedDelaunay2D.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolygon -) -from vtkmodules.vtkFiltersCore import vtkDelaunay2D -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Generate a 10 x 10 grid of points - points = vtkPoints() - gridSize = 10 - seed = 0 - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.Initialize(seed) - for x in range(gridSize): - for y in range(gridSize): - d1 = randomSequence.GetValue() / 2.0 - 0.25 - randomSequence.Next() - d2 = randomSequence.GetValue() / 2.0 - 0.25 - randomSequence.Next() - points.InsertNextPoint(x + d1, y + d2, 0) - - aPolyData = vtkPolyData() - aPolyData.SetPoints(points) - - # Create a cell array to store the polygon in - aCellArray = vtkCellArray() - - # Define a polygonal hole with a clockwise polygon - aPolygon = vtkPolygon() - - aPolygon.GetPointIds().InsertNextId(22) - aPolygon.GetPointIds().InsertNextId(23) - aPolygon.GetPointIds().InsertNextId(24) - aPolygon.GetPointIds().InsertNextId(25) - aPolygon.GetPointIds().InsertNextId(35) - aPolygon.GetPointIds().InsertNextId(45) - aPolygon.GetPointIds().InsertNextId(44) - aPolygon.GetPointIds().InsertNextId(43) - aPolygon.GetPointIds().InsertNextId(42) - aPolygon.GetPointIds().InsertNextId(32) - - aCellArray.InsertNextCell(aPolygon) - - # Create a polydata to store the boundary. The points must be the - # same as the points we will triangulate. - boundary = vtkPolyData() - boundary.SetPoints(aPolyData.GetPoints()) - boundary.SetPolys(aCellArray) - - # Triangulate the grid points - delaunay = vtkDelaunay2D() - delaunay.SetInputData(aPolyData) - delaunay.SetSourceData(boundary) - - # Visualize - meshMapper = vtkPolyDataMapper() - meshMapper.SetInputConnection(delaunay.GetOutputPort()) - - meshActor = vtkActor() - meshActor.SetMapper(meshMapper) - meshActor.GetProperty().EdgeVisibilityOn() - meshActor.GetProperty().SetEdgeColor(colors.GetColor3d('Peacock')) - meshActor.GetProperty().SetInterpolationToFlat() - - boundaryMapper = vtkPolyDataMapper() - boundaryMapper.SetInputData(boundary) - - boundaryActor = vtkActor() - boundaryActor.SetMapper(boundaryMapper) - boundaryActor.GetProperty().SetColor(colors.GetColor3d('Raspberry')) - boundaryActor.GetProperty().SetLineWidth(3) - boundaryActor.GetProperty().EdgeVisibilityOn() - boundaryActor.GetProperty().SetEdgeColor(colors.GetColor3d('Red')) - boundaryActor.GetProperty().SetRepresentationToWireframe() - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(meshActor) - renderer.AddActor(boundaryActor) - renderer.SetBackground(colors.GetColor3d('Mint')) - - # Render and interact - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('ConstrainedDelaunay2D') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/Delaunay2D.py b/data/examples/Filtering/Delaunay2D.py deleted file mode 100755 index 1e3b91a..0000000 --- a/data/examples/Filtering/Delaunay2D.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkDelaunay2D -from vtkmodules.vtkFiltersGeneral import vtkVertexGlyphFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a set of heights on a grid. - # This is often called a "terrain map". - points = vtkPoints() - - grid_size = 10 - for x in range(grid_size): - for y in range(grid_size): - points.InsertNextPoint(x, y, int((x + y) / (y + 1))) - - # Add the grid points to a polydata object. - polydata = vtkPolyData() - polydata.SetPoints(points) - - delaunay = vtkDelaunay2D() - delaunay.SetInputData(polydata) - - # Visualize - mesh_mapper = vtkPolyDataMapper() - mesh_mapper.SetInputConnection(delaunay.GetOutputPort()) - - mesh_actor = vtkActor() - mesh_actor.SetMapper(mesh_mapper) - mesh_actor.GetProperty().SetColor(colors.GetColor3d('LightGoldenrodYellow')) - mesh_actor.GetProperty().EdgeVisibilityOn() - mesh_actor.GetProperty().SetEdgeColor(colors.GetColor3d('CornflowerBlue')) - mesh_actor.GetProperty().SetLineWidth(3) - mesh_actor.GetProperty().RenderLinesAsTubesOn() - - glyph_filter = vtkVertexGlyphFilter() - glyph_filter.SetInputData(polydata) - - point_mapper = vtkPolyDataMapper() - point_mapper.SetInputConnection(glyph_filter.GetOutputPort()) - - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.GetProperty().SetColor(colors.GetColor3d('DeepPink')) - point_actor.GetProperty().SetPointSize(10) - point_actor.GetProperty().RenderPointsAsSpheresOn() - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('PowderBlue')) - render_window = vtkRenderWindow() - render_window.SetSize(600, 600) - render_window.SetWindowName('Delaunay2D') - render_window.AddRenderer(renderer) - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - renderer.AddActor(mesh_actor) - renderer.AddActor(point_actor) - - render_window_interactor.Initialize() - render_window.Render() - render_window_interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/GaussianSplat.py b/data/examples/Filtering/GaussianSplat.py deleted file mode 100755 index 10f5c18..0000000 --- a/data/examples/Filtering/GaussianSplat.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkImagingHybrid import vtkGaussianSplatter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Create points on a sphere - sphereSource = vtkSphereSource() - sphereSource.Update() - - colors = vtkNamedColors() - - polydata = vtkPolyData() - polydata.SetPoints(sphereSource.GetOutput().GetPoints()) - - splatter = vtkGaussianSplatter() - splatter.SetInputData(polydata) - splatter.SetSampleDimensions(50, 50, 50) - splatter.SetRadius(0.5) - splatter.ScalarWarpingOff() - - surface = vtkContourFilter() - surface.SetInputConnection(splatter.GetOutputPort()) - surface.SetValue(0, 0.01) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SteelBlue')) - - renderWindow.SetWindowName('GaussianSplat') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/Glyph2D.md b/data/examples/Filtering/Glyph2D.md deleted file mode 100644 index b5dcf1c..0000000 --- a/data/examples/Filtering/Glyph2D.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Copy a polydata to every point in the input set. We use a hexagon for the demo. diff --git a/data/examples/Filtering/Glyph2D.py b/data/examples/Filtering/Glyph2D.py deleted file mode 100755 index 6061798..0000000 --- a/data/examples/Filtering/Glyph2D.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkGlyph2D -from vtkmodules.vtkFiltersSources import vtkRegularPolygonSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(2, 2, 0) - - polydata = vtkPolyData() - polydata.SetPoints(points) - - # Create anything you want here, we will use a polygon for the demo. - polygonSource = vtkRegularPolygonSource() # default is 6 sides - - glyph2D = vtkGlyph2D() - glyph2D.SetSourceConnection(polygonSource.GetOutputPort()) - glyph2D.SetInputData(polydata) - glyph2D.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph2D.GetOutputPort()) - mapper.Update() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - style = vtkInteractorStyleImage() - renderWindowInteractor.SetInteractorStyle(style) - - renderWindow.SetWindowName('Glyph2D'); - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/Glyph3D.md b/data/examples/Filtering/Glyph3D.md deleted file mode 100644 index 560989e..0000000 --- a/data/examples/Filtering/Glyph3D.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example applies an object at every point. We use a cube for the demo. diff --git a/data/examples/Filtering/Glyph3D.py b/data/examples/Filtering/Glyph3D.py deleted file mode 100755 index e2a9ada..0000000 --- a/data/examples/Filtering/Glyph3D.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(2, 2, 2) - - polydata = vtkPolyData() - polydata.SetPoints(points) - - # Create anything you want here, we will use a cube for the demo. - cubeSource = vtkCubeSource() - - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(cubeSource.GetOutputPort()) - glyph3D.SetInputData(polydata) - glyph3D.Update() - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph3D.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) # Background Slate Gray - - renderWindow.SetWindowName('Glyph2D'); - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/IterativeClosestPoints.py b/data/examples/Filtering/IterativeClosestPoints.py deleted file mode 100755 index 37f943f..0000000 --- a/data/examples/Filtering/IterativeClosestPoints.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkIterativeClosestPointTransform, - vtkPolyData -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter - - -def main(): - # ============ create source points ============== - print("Creating source points...") - sourcePoints = vtkPoints() - sourceVertices = vtkCellArray() - - sp_id = sourcePoints.InsertNextPoint(1.0, 0.1, 0.0) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(sp_id) - - sp_id = sourcePoints.InsertNextPoint(0.1, 1.1, 0.0) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(sp_id) - - sp_id = sourcePoints.InsertNextPoint(0.0, 0.1, 1.0) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(sp_id) - - source = vtkPolyData() - source.SetPoints(sourcePoints) - source.SetVerts(sourceVertices) - - print("Displaying source points...") - # ============ display source points ============== - pointCount = 3 - for index in range(pointCount): - point = [0, 0, 0] - sourcePoints.GetPoint(index, point) - print("source point[%s]=%s" % (index, point)) - - # ============ create target points ============== - print("Creating target points...") - targetPoints = vtkPoints() - targetVertices = vtkCellArray() - - tp_id = targetPoints.InsertNextPoint(1.0, 0.0, 0.0) - targetVertices.InsertNextCell(1) - targetVertices.InsertCellPoint(tp_id) - - tp_id = targetPoints.InsertNextPoint(0.0, 1.0, 0.0) - targetVertices.InsertNextCell(1) - targetVertices.InsertCellPoint(tp_id) - - tp_id = targetPoints.InsertNextPoint(0.0, 0.0, 1.0) - targetVertices.InsertNextCell(1) - targetVertices.InsertCellPoint(tp_id) - - target = vtkPolyData() - target.SetPoints(targetPoints) - target.SetVerts(targetVertices) - - # ============ display target points ============== - print("Displaying target points...") - pointCount = 3 - for index in range(pointCount): - point = [0, 0, 0] - targetPoints.GetPoint(index, point) - print("target point[%s]=%s" % (index, point)) - - print("Running ICP ----------------") - # ============ run ICP ============== - icp = vtkIterativeClosestPointTransform() - icp.SetSource(source) - icp.SetTarget(target) - icp.GetLandmarkTransform().SetModeToRigidBody() - # icp.DebugOn() - icp.SetMaximumNumberOfIterations(20) - icp.StartByMatchingCentroidsOn() - icp.Modified() - icp.Update() - - icpTransformFilter = vtkTransformPolyDataFilter() - icpTransformFilter.SetInputData(source) - - icpTransformFilter.SetTransform(icp) - icpTransformFilter.Update() - - transformedSource = icpTransformFilter.GetOutput() - - # ============ display transformed points ============== - pointCount = 3 - for index in range(pointCount): - point = [0, 0, 0] - transformedSource.GetPoint(index, point) - print("transformed source point[%s]=%s" % (index, point)) - - -if __name__ == "__main__": - main() diff --git a/data/examples/Filtering/PerlinNoise.py b/data/examples/Filtering/PerlinNoise.py deleted file mode 100755 index 77e0abf..0000000 --- a/data/examples/Filtering/PerlinNoise.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPerlinNoise -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - perlinNoise = vtkPerlinNoise() - perlinNoise.SetFrequency(2, 1.25, 1.5) - perlinNoise.SetPhase(0, 0, 0) - - sample = vtkSampleFunction() - sample.SetImplicitFunction(perlinNoise) - sample.SetSampleDimensions(65, 65, 20) - sample.ComputeNormalsOff() - - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('SteelBlue')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer, set the background and size - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - renderWindow.SetWindowName('PerlinNoise') - renderWindow.SetSize(300, 300) - renderer.ResetCamera() - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/TransformPolyData.md b/data/examples/Filtering/TransformPolyData.md deleted file mode 100644 index 67f3059..0000000 --- a/data/examples/Filtering/TransformPolyData.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example demonstrates how to apply a transform to a data set. It uses vtkTransformPolyDataFilter, but it can be -replaced with vtkTransformFilter for different types of data sets, including vtkUnstructuredGrid and vtkStructuredGrid. -vtkTransformFilter will work with vtkPolyData, too). diff --git a/data/examples/Filtering/TransformPolyData.py b/data/examples/Filtering/TransformPolyData.py deleted file mode 100755 index b30dd65..0000000 --- a/data/examples/Filtering/TransformPolyData.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the polydata geometry - sphereSource = vtkSphereSource() - sphereSource.Update() - - # Set up the actor to display the untransformed polydata - originalMapper = vtkPolyDataMapper() - originalMapper.SetInputConnection(sphereSource.GetOutputPort()) - - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetColor(colors.GetColor3d('Blue')) - - # Set up the transform filter - translation = vtkTransform() - translation.Translate(1.0, 2.0, 3.0) - - transformFilter = vtkTransformPolyDataFilter() - transformFilter.SetInputConnection(sphereSource.GetOutputPort()) - transformFilter.SetTransform(translation) - transformFilter.Update() - - # Set up the actor to display the transformed polydata - transformedMapper = vtkPolyDataMapper() - transformedMapper.SetInputConnection(transformFilter.GetOutputPort()) - - transformedActor = vtkActor() - transformedActor.SetMapper(transformedMapper) - transformedActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Set up the rest of the visualization pipeline - renderer = vtkRenderer() - renderer.AddActor(originalActor) - renderer.AddActor(transformedActor) - renderer.SetBackground(colors.GetColor3d('Green')) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderWindow.SetWindowName('TransformPolyData') - renderWindow.Render() - - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/TriangulateTerrainMap.md b/data/examples/Filtering/TriangulateTerrainMap.md deleted file mode 100644 index 0f28889..0000000 --- a/data/examples/Filtering/TriangulateTerrainMap.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example generates heights (z-values) on a 10x10 grid (a terrain map) and triangulates the points. diff --git a/data/examples/Filtering/TriangulateTerrainMap.py b/data/examples/Filtering/TriangulateTerrainMap.py deleted file mode 100755 index ef75e27..0000000 --- a/data/examples/Filtering/TriangulateTerrainMap.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkDelaunay2D -from vtkmodules.vtkFiltersGeneral import vtkVertexGlyphFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - # Create points on an XY grid with random Z coordinate - points = vtkPoints() - gridSize = 10 - seed = 0 - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.Initialize(seed) - for x in range(0, gridSize): - for y in range(0, gridSize): - d = randomSequence.GetValue() - randomSequence.Next() - points.InsertNextPoint(x, y, d * 3) - - # Add the grid points to a polydata object - polydata = vtkPolyData() - polydata.SetPoints(points) - - glyphFilter = vtkVertexGlyphFilter() - glyphFilter.SetInputData(polydata) - glyphFilter.Update() - - # Create a mapper and actor - pointsMapper = vtkPolyDataMapper() - pointsMapper.SetInputConnection(glyphFilter.GetOutputPort()) - - pointsActor = vtkActor() - pointsActor.SetMapper(pointsMapper) - pointsActor.GetProperty().SetPointSize(3) - pointsActor.GetProperty().SetColor(colors.GetColor3d("Red")) - - # Triangulate the grid points - delaunay = vtkDelaunay2D() - delaunay.SetInputData(polydata) - delaunay.Update() - - # Create a mapper and actor - triangulatedMapper = vtkPolyDataMapper() - triangulatedMapper.SetInputConnection(delaunay.GetOutputPort()) - - triangulatedActor = vtkActor() - triangulatedActor.SetMapper(triangulatedMapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(pointsActor) - renderer.AddActor(triangulatedActor) - renderer.SetBackground(colors.GetColor3d("Green")) # Background color green - - # Render and interact - renderWindow.SetWindowName('TriangulateTerrainMap') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/VertexGlyphFilter.md b/data/examples/Filtering/VertexGlyphFilter.md deleted file mode 100644 index 18a656f..0000000 --- a/data/examples/Filtering/VertexGlyphFilter.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a set of points and adds a vertex at each point using vtkVertexGlyphFilter. diff --git a/data/examples/Filtering/VertexGlyphFilter.py b/data/examples/Filtering/VertexGlyphFilter.py deleted file mode 100755 index 1782311..0000000 --- a/data/examples/Filtering/VertexGlyphFilter.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersGeneral import vtkVertexGlyphFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(2, 2, 2) - - polydata = vtkPolyData() - polydata.SetPoints(points) - - vertexGlyphFilter = vtkVertexGlyphFilter() - vertexGlyphFilter.AddInputData(polydata) - vertexGlyphFilter.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(vertexGlyphFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(10) - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Green')) - - # Render and interact - renderWindow.SetWindowName('VertexGlyphFilter') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Filtering/WarpTo.py b/data/examples/Filtering/WarpTo.py deleted file mode 100755 index 588c92d..0000000 --- a/data/examples/Filtering/WarpTo.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkTubeFilter -from vtkmodules.vtkFiltersGeneral import vtkWarpTo -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - # Create the RenderWindow, Renderer and both Actors - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Create a line - lineSource = vtkLineSource() - lineSource.SetPoint1(0.0, 0.0, 0.0) - lineSource.SetPoint2(0.0, 1.0, 0.0) - lineSource.SetResolution(20) - lineSource.Update() - - # Create a tube (cylinder) around the line - tubeFilter = vtkTubeFilter() - tubeFilter.SetInputConnection(lineSource.GetOutputPort()) - tubeFilter.SetRadius(.01) # default is .5 - tubeFilter.SetNumberOfSides(50) - tubeFilter.Update() - - warpTo = vtkWarpTo() - warpTo.SetInputConnection(tubeFilter.GetOutputPort()) - warpTo.SetPosition(10, 1, 0) - warpTo.SetScaleFactor(5) - warpTo.AbsoluteOn() - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(warpTo.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - renderer.SetBackground(colors.GetColor3d('Green')) - renderer.AddActor(actor) - - renderWindow.SetWindowName('WarpTo') - renderWindow.Render() - - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Arrow.md b/data/examples/GeometricObjects/Arrow.md deleted file mode 100644 index 2aa8142..0000000 --- a/data/examples/GeometricObjects/Arrow.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -vtkArrowSource object appends a cylinder to a cone to form an arrow. - -The shaft base is always at (0,0,0). The arrow tip is always at (1,0,0). If "Invert" is true, then the ends are flipped -i.e. tip is at (0,0,0) while base is at (1, 0, 0). - -The resolution of the cone and shaft can be set and default to 6. - -The radius of the cone and shaft can be set and default to 0.03 and 0.1. The length of the tip can also be set, and -defaults to 0.35. diff --git a/data/examples/GeometricObjects/Arrow.py b/data/examples/GeometricObjects/Arrow.py deleted file mode 100755 index d6f1bd6..0000000 --- a/data/examples/GeometricObjects/Arrow.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkArrowSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - arrowSource = vtkArrowSource() - # arrowSource.SetShaftRadius(0.01) - # arrowSource.SetTipLength(.9) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(arrowSource.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Arrow') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - - renderWindow.SetWindowName('Arrow') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Axes.md b/data/examples/GeometricObjects/Axes.md deleted file mode 100644 index 8634528..0000000 --- a/data/examples/GeometricObjects/Axes.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -This example shows how to position an vtkAxesActor in 3D. Notice that position and orientation of the vtkAxesActor is -done with a user transform. - -!!! seealso - [DisplayCoordinateAxes](../../Visualization/DisplayCoordinateAxes). diff --git a/data/examples/GeometricObjects/Axes.py b/data/examples/GeometricObjects/Axes.py deleted file mode 100755 index 57bef89..0000000 --- a/data/examples/GeometricObjects/Axes.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a Sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(0.5) - - # create a mapper - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphereSource.GetOutputPort()) - - # create an actor - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - - # a renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Axes') - renderWindow.AddRenderer(renderer) - - # an interactor - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # add the actors to the scene - renderer.AddActor(sphereActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - transform = vtkTransform() - transform.Translate(1.0, 0.0, 0.0) - - axes = vtkAxesActor() - # The axes are positioned with a user transform - axes.SetUserTransform(transform) - - # properties of the axes labels can be set as follows - # this sets the x axis label to red - # axes.GetXAxisCaptionActor2D().GetCaptionTextProperty().SetColor(colors.GetColor3d('Red')); - - # the actual text of the axis label can be changed: - # axes->SetXAxisLabelText('test'); - - renderer.AddActor(axes) - - renderer.GetActiveCamera().Azimuth(50) - renderer.GetActiveCamera().Elevation(-30) - - renderer.ResetCamera() - renderWindow.SetWindowName('Axes') - renderWindow.Render() - - # begin mouse interaction - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Cell3DDemonstration.md b/data/examples/GeometricObjects/Cell3DDemonstration.md deleted file mode 100644 index 92db36c..0000000 --- a/data/examples/GeometricObjects/Cell3DDemonstration.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -This is a demonstration of how to construct and display geometric objects using the classes derived from vtkCell3D. For -each object we specify the points and cell Ids. - -From this we create an unstructured grid. In some cases a vtkCellArray is used and the result is added to the -unstructured grid, see: *MakePolyhedron()* and *MakeTetrahedron()*. - -Also demonstrated is the use of vectors to hold the unstructured grids, mappers, actors and renderers. - -The resultant objects are then displayed in a grid. diff --git a/data/examples/GeometricObjects/Cell3DDemonstration.py b/data/examples/GeometricObjects/Cell3DDemonstration.py deleted file mode 100755 index 1784837..0000000 --- a/data/examples/GeometricObjects/Cell3DDemonstration.py +++ /dev/null @@ -1,457 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkIdList, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - VTK_POLYHEDRON, - VTK_TETRA, - vtkCellArray, - vtkHexagonalPrism, - vtkHexahedron, - vtkPentagonalPrism, - vtkPyramid, - vtkTetra, - vtkUnstructuredGrid, - vtkVoxel, - vtkWedge -) -from vtkmodules.vtkIOImage import vtkPNGWriter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty, - vtkWindowToImageFilter -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - titles = list() - textMappers = list() - textActors = list() - - uGrids = list() - mappers = list() - actors = list() - renderers = list() - - uGrids.append(MakeHexagonalPrism()) - titles.append('Hexagonal Prism') - uGrids.append(MakeHexahedron()) - titles.append('Hexahedron') - uGrids.append(MakePentagonalPrism()) - titles.append('Pentagonal Prism') - - uGrids.append(MakePolyhedron()) - titles.append('Polyhedron') - uGrids.append(MakePyramid()) - titles.append('Pyramid') - uGrids.append(MakeTetrahedron()) - titles.append('Tetrahedron') - - uGrids.append(MakeVoxel()) - titles.append('Voxel') - uGrids.append(MakeWedge()) - titles.append('Wedge') - - renWin = vtkRenderWindow() - renWin.SetWindowName('Cell3DDemonstration') - - iRen = vtkRenderWindowInteractor() - iRen.SetRenderWindow(renWin) - - # Create one text property for all - textProperty = vtkTextProperty() - textProperty.SetFontSize(16) - textProperty.SetJustificationToCentered() - textProperty.SetColor(colors.GetColor3d('LightGoldenrodYellow')) - - # Create and link the mappers actors and renderers together. - for i in range(0, len(uGrids)): - textMappers.append(vtkTextMapper()) - textActors.append(vtkActor2D()) - - mappers.append(vtkDataSetMapper()) - actors.append(vtkActor()) - renderers.append(vtkRenderer()) - - mappers[i].SetInputData(uGrids[i]) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - renderers[i].AddViewProp(actors[i]) - - textMappers[i].SetInput(titles[i]) - textMappers[i].SetTextProperty(textProperty) - - textActors[i].SetMapper(textMappers[i]) - textActors[i].SetPosition(120, 16) - renderers[i].AddViewProp(textActors[i]) - - renWin.AddRenderer(renderers[i]) - - gridDimensions = 3 - rendererSize = 300 - - renWin.SetSize(rendererSize * gridDimensions, - rendererSize * gridDimensions) - - for row in range(0, gridDimensions): - for col in range(0, gridDimensions): - index = row * gridDimensions + col - - # (xmin, ymin, xmax, ymax) - viewport = [ - float(col) * rendererSize / - (gridDimensions * rendererSize), - float(gridDimensions - (row + 1)) * rendererSize / - (gridDimensions * rendererSize), - float(col + 1) * rendererSize / - (gridDimensions * rendererSize), - float(gridDimensions - row) * rendererSize / - (gridDimensions * rendererSize)] - - if index > len(actors) - 1: - # Add a renderer even if there is no actor. - # This makes the render window background all the same color. - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('BkgColor')) - ren.SetViewport(viewport) - renWin.AddRenderer(ren) - continue - - renderers[index].SetViewport(viewport) - renderers[index].SetBackground(colors.GetColor3d('BkgColor')) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(-30) - renderers[index].GetActiveCamera().Zoom(0.85) - renderers[index].ResetCameraClippingRange() - - iRen.Initialize() - renWin.SetWindowName('Cell3DDemonstration') - renWin.Render() - iRen.Start() - - -def MakeHexagonalPrism(): - """ - 3D: hexagonal prism: a wedge with an hexagonal base. - Be careful, the base face ordering is different from wedge. - """ - - numberOfVertices = 12 - - points = vtkPoints() - - points.InsertNextPoint(0.0, 0.0, 1.0) - points.InsertNextPoint(1.0, 0.0, 1.0) - points.InsertNextPoint(1.5, 0.5, 1.0) - points.InsertNextPoint(1.0, 1.0, 1.0) - points.InsertNextPoint(0.0, 1.0, 1.0) - points.InsertNextPoint(-0.5, 0.5, 1.0) - - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(1.5, 0.5, 0.0) - points.InsertNextPoint(1.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - points.InsertNextPoint(-0.5, 0.5, 0.0) - - hexagonalPrism = vtkHexagonalPrism() - for i in range(0, numberOfVertices): - hexagonalPrism.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.InsertNextCell(hexagonalPrism.GetCellType(), - hexagonalPrism.GetPointIds()) - ug.SetPoints(points) - - return ug - - -def MakeHexahedron(): - """ - A regular hexagon (cube) with all faces square and three squares around - each vertex is created below. - - Setup the coordinates of eight points - (the two faces must be in counter clockwise - order as viewed from the outside). - - As an exercise you can modify the coordinates of the points to create - seven topologically distinct convex hexahedras. - """ - numberOfVertices = 8 - - # Create the points - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 0.0, 1.0) - points.InsertNextPoint(1.0, 0.0, 1.0) - points.InsertNextPoint(1.0, 1.0, 1.0) - points.InsertNextPoint(0.0, 1.0, 1.0) - - # Create a hexahedron from the points - hex_ = vtkHexahedron() - for i in range(0, numberOfVertices): - hex_.GetPointIds().SetId(i, i) - - # Add the points and hexahedron to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(hex_.GetCellType(), hex_.GetPointIds()) - - return uGrid - - -def MakePentagonalPrism(): - numberOfVertices = 10 - - # Create the points - points = vtkPoints() - points.InsertNextPoint(11, 10, 10) - points.InsertNextPoint(13, 10, 10) - points.InsertNextPoint(14, 12, 10) - points.InsertNextPoint(12, 14, 10) - points.InsertNextPoint(10, 12, 10) - points.InsertNextPoint(11, 10, 14) - points.InsertNextPoint(13, 10, 14) - points.InsertNextPoint(14, 12, 14) - points.InsertNextPoint(12, 14, 14) - points.InsertNextPoint(10, 12, 14) - - # Pentagonal Prism - pentagonalPrism = vtkPentagonalPrism() - for i in range(0, numberOfVertices): - pentagonalPrism.GetPointIds().SetId(i, i) - - # Add the points and hexahedron to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(pentagonalPrism.GetCellType(), - pentagonalPrism.GetPointIds()) - - return uGrid - - -def MakePolyhedron(): - """ - Make a regular dodecahedron. It consists of twelve regular pentagonal - faces with three faces meeting at each vertex. - """ - # numberOfVertices = 20 - numberOfFaces = 12 - # numberOfFaceVertices = 5 - - points = vtkPoints() - points.InsertNextPoint(1.21412, 0, 1.58931) - points.InsertNextPoint(0.375185, 1.1547, 1.58931) - points.InsertNextPoint(-0.982247, 0.713644, 1.58931) - points.InsertNextPoint(-0.982247, -0.713644, 1.58931) - points.InsertNextPoint(0.375185, -1.1547, 1.58931) - points.InsertNextPoint(1.96449, 0, 0.375185) - points.InsertNextPoint(0.607062, 1.86835, 0.375185) - points.InsertNextPoint(-1.58931, 1.1547, 0.375185) - points.InsertNextPoint(-1.58931, -1.1547, 0.375185) - points.InsertNextPoint(0.607062, -1.86835, 0.375185) - points.InsertNextPoint(1.58931, 1.1547, -0.375185) - points.InsertNextPoint(-0.607062, 1.86835, -0.375185) - points.InsertNextPoint(-1.96449, 0, -0.375185) - points.InsertNextPoint(-0.607062, -1.86835, -0.375185) - points.InsertNextPoint(1.58931, -1.1547, -0.375185) - points.InsertNextPoint(0.982247, 0.713644, -1.58931) - points.InsertNextPoint(-0.375185, 1.1547, -1.58931) - points.InsertNextPoint(-1.21412, 0, -1.58931) - points.InsertNextPoint(-0.375185, -1.1547, -1.58931) - points.InsertNextPoint(0.982247, -0.713644, -1.58931) - - # Dimensions are [numberOfFaces][numberOfFaceVertices] - dodechedronFace = [ - [0, 1, 2, 3, 4], - [0, 5, 10, 6, 1], - [1, 6, 11, 7, 2], - [2, 7, 12, 8, 3], - [3, 8, 13, 9, 4], - [4, 9, 14, 5, 0], - [15, 10, 5, 14, 19], - [16, 11, 6, 10, 15], - [17, 12, 7, 11, 16], - [18, 13, 8, 12, 17], - [19, 14, 9, 13, 18], - [19, 18, 17, 16, 15] - ] - - dodechedronFacesIdList = vtkIdList() - # Number faces that make up the cell. - dodechedronFacesIdList.InsertNextId(numberOfFaces) - for face in dodechedronFace: - # Number of points in the face == numberOfFaceVertices - dodechedronFacesIdList.InsertNextId(len(face)) - # Insert the pointIds for that face. - [dodechedronFacesIdList.InsertNextId(i) for i in face] - - uGrid = vtkUnstructuredGrid() - uGrid.InsertNextCell(VTK_POLYHEDRON, dodechedronFacesIdList) - uGrid.SetPoints(points) - - return uGrid - - -def MakePyramid(): - """ - Make a regular square pyramid. - """ - numberOfVertices = 5 - - points = vtkPoints() - - p = [ - [1.0, 1.0, 0.0], - [-1.0, 1.0, 0.0], - [-1.0, -1.0, 0.0], - [1.0, -1.0, 0.0], - [0.0, 0.0, 1.0] - ] - for pt in p: - points.InsertNextPoint(pt) - - pyramid = vtkPyramid() - for i in range(0, numberOfVertices): - pyramid.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(pyramid.GetCellType(), pyramid.GetPointIds()) - - return ug - - -def MakeTetrahedron(): - """ - Make a tetrahedron. - """ - numberOfVertices = 4 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 1, 1) - - tetra = vtkTetra() - for i in range(0, numberOfVertices): - tetra.GetPointIds().SetId(i, i) - - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - - unstructuredGrid = vtkUnstructuredGrid() - unstructuredGrid.SetPoints(points) - unstructuredGrid.SetCells(VTK_TETRA, cellArray) - - return unstructuredGrid - - -def MakeVoxel(): - """ - A voxel is a representation of a regular grid in 3-D space. - """ - numberOfVertices = 8 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, 1) - points.InsertNextPoint(0, 1, 1) - points.InsertNextPoint(1, 1, 1) - - voxel = vtkVoxel() - for i in range(0, numberOfVertices): - voxel.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(voxel.GetCellType(), voxel.GetPointIds()) - - return ug - - -def MakeWedge(): - """ - A wedge consists of two triangular ends and three rectangular faces. - """ - - numberOfVertices = 6 - - points = vtkPoints() - - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0, .5, .5) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(1, 0.0, 0.0) - points.InsertNextPoint(1, .5, .5) - - wedge = vtkWedge() - for i in range(0, numberOfVertices): - wedge.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(wedge.GetCellType(), wedge.GetPointIds()) - - return ug - - -def WritePNG(renWin, fn, magnification=1): - """ - Screenshot - - Write out a png corresponding to the render window. - - :param: renWin - the render window. - :param: fn - the file name. - :param: magnification - the magnification. - """ - windowToImageFilter = vtkWindowToImageFilter() - windowToImageFilter.SetInput(renWin) - windowToImageFilter.SetMagnification(magnification) - # Record the alpha (transparency) channel - # windowToImageFilter.SetInputBufferTypeToRGBA() - windowToImageFilter.SetInputBufferTypeToRGB() - # Read from the back buffer - windowToImageFilter.ReadFrontBufferOff() - windowToImageFilter.Update() - - writer = vtkPNGWriter() - writer.SetFileName(fn) - writer.SetInputConnection(windowToImageFilter.GetOutputPort()) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/CellTypeSource.md b/data/examples/GeometricObjects/CellTypeSource.md deleted file mode 100644 index f0abd44..0000000 --- a/data/examples/GeometricObjects/CellTypeSource.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -This example uses vtkCellTypeSource to generate a vtkUnstructuredGrid. If a cell does not fill a rectangular area or -volume, then multiple cells will be generated. For example, a vtkTetra requires 12 cells to fill a cube. A vtkTriangle -requires two cells to fill a square. vtkCellTypeSource generates a uniform set of coordinates. The example perturbs -those coordinates to illustrate the results of the vtkTessellatorFilter. Also, each cell is passed through -vtkShrinkFilter to help identify the cells. Each generated cell also has a unique color. - -The example takes an optional argument, a vtkCell name. - -For example, to generate vtkTriangles, run - -``` bash -CellTypeSource vtkTriangle -``` diff --git a/data/examples/GeometricObjects/CellTypeSource.py b/data/examples/GeometricObjects/CellTypeSource.py deleted file mode 100755 index 2521ad3..0000000 --- a/data/examples/GeometricObjects/CellTypeSource.py +++ /dev/null @@ -1,202 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import ( - vtkIntArray, - vtkLookupTable, - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - VTK_CUBIC_LINE, - VTK_HEXAHEDRON, - VTK_LINE, - VTK_PYRAMID, - VTK_QUAD, - VTK_QUADRATIC_EDGE, - VTK_QUADRATIC_HEXAHEDRON, - VTK_QUADRATIC_PYRAMID, - VTK_QUADRATIC_QUAD, - VTK_QUADRATIC_TETRA, - VTK_QUADRATIC_TRIANGLE, - VTK_QUADRATIC_WEDGE, - VTK_TETRA, - VTK_TRIANGLE, - VTK_WEDGE, - vtkCellTypes -) -from vtkmodules.vtkFiltersGeneral import ( - vtkShrinkFilter, - vtkTessellatorFilter -) -from vtkmodules.vtkFiltersSources import vtkCellTypeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - cellName = get_program_parameters() - - # Store the cell class names in a dictionary. - cellMap = dict() - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_LINE)] = VTK_LINE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_EDGE)] = VTK_QUADRATIC_EDGE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_CUBIC_LINE)] = VTK_CUBIC_LINE - - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_TRIANGLE)] = VTK_TRIANGLE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_TRIANGLE)] = VTK_QUADRATIC_TRIANGLE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUAD)] = VTK_QUAD - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_QUAD)] = VTK_QUADRATIC_QUAD - - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_TETRA)] = VTK_TETRA - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_HEXAHEDRON)] = VTK_HEXAHEDRON - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_WEDGE)] = VTK_WEDGE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_PYRAMID)] = VTK_PYRAMID - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_WEDGE)] = VTK_QUADRATIC_WEDGE - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_PYRAMID)] = VTK_QUADRATIC_PYRAMID - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_HEXAHEDRON)] = VTK_QUADRATIC_HEXAHEDRON - cellMap[vtkCellTypes.GetClassNameFromTypeId(VTK_QUADRATIC_TETRA)] = VTK_QUADRATIC_TETRA - - if cellName not in cellMap: - print('Cell type ', cellName, ' is not supported.') - return - source = vtkCellTypeSource() - source.SetCellType(cellMap[cellName]) - source.Update() - print('Cell: ', cellName) - - originalPoints = source.GetOutput().GetPoints() - points = vtkPoints() - points.SetNumberOfPoints(source.GetOutput().GetNumberOfPoints()) - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(5070) # for testing - for i in range(0, points.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() - perturbation[j] = rng.GetRangeValue(-0.1, 0.1) - currentPoint = [0.0] * 3 - originalPoints.GetPoint(i, currentPoint) - points.SetPoint(i, currentPoint[0] + perturbation[0], - currentPoint[1] + perturbation[1], - currentPoint[2] + perturbation[2]) - source.GetOutput().SetPoints(points) - - numCells = source.GetOutput().GetNumberOfCells() - print('Number of cells: ', numCells) - idArray = vtkIntArray() - idArray.SetNumberOfTuples(numCells) - for i in range(0, numCells): - idArray.InsertTuple1(i, i + 1) - idArray.SetName('Ids') - source.GetOutput().GetCellData().AddArray(idArray) - source.GetOutput().GetCellData().SetActiveScalars('Ids') - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(source.GetOutputPort()) - shrink.SetShrinkFactor(.8) - - tessellate = vtkTessellatorFilter() - tessellate.SetInputConnection(shrink.GetOutputPort()) - tessellate.SetMaximumNumberOfSubdivisions(3) - - # Create a lookup table to map cell data to colors. - lut = vtkLookupTable() - - colorSeries = vtkColorSeries() - seriesEnum = colorSeries.BREWER_QUALITATIVE_SET3 - colorSeries.SetColorScheme(seriesEnum) - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - - # Fill in a few known colors, the rest will be generated if needed. - colors = vtkNamedColors() - - # Create a mapper and actor. - mapper = vtkDataSetMapper() - mapper.SetInputConnection(source.GetOutputPort()) - mapper.SetInputConnection(shrink.GetOutputPort()) - mapper.SetScalarRange(0, numCells + 1) - mapper.SetLookupTable(lut) - mapper.SetScalarModeToUseCellData() - mapper.SetResolveCoincidentTopologyToPolygonOffset() - if (source.GetCellType() == VTK_QUADRATIC_PYRAMID or - source.GetCellType() == VTK_QUADRATIC_WEDGE): - mapper.SetInputConnection(shrink.GetOutputPort()) - else: - mapper.SetInputConnection(tessellate.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - # actor.GetProperty().SetLineWidth(3) - - textProperty = vtkTextProperty() - textProperty.SetFontSize(20) - textProperty.SetJustificationToCentered() - textProperty.SetColor(colors.GetColor3d('Lamp_Black')) - - textMapper = vtkTextMapper() - textMapper.SetInput(cellName) - textMapper.SetTextProperty(textProperty) - - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(320, 20) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('CellTypeSource') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene. - renderer.AddViewProp(textActor) - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - # Render and interact. - renderWindow.SetSize(640, 480) - renderWindow.Render() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Cell Type Source.' - epilogue = ''' - You can supply an optional argument consisting of a vtkCell name e.g: vtkTriangle. - The default is vtkTetra. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('cell_name', nargs='?', const='vtkTetra', default='vtkTetra', type=str, help='The cell name.') - args = parser.parse_args() - return args.cell_name - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Circle.md b/data/examples/GeometricObjects/Circle.md deleted file mode 100644 index 3ada0e8..0000000 --- a/data/examples/GeometricObjects/Circle.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -A circle is simply the limiting case of a regular polygon. We use vtkRegularPolygonSource with a large number of Sides -to approximate a circle. diff --git a/data/examples/GeometricObjects/Circle.py b/data/examples/GeometricObjects/Circle.py deleted file mode 100755 index 71184b8..0000000 --- a/data/examples/GeometricObjects/Circle.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkRegularPolygonSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a circle - polygonSource = vtkRegularPolygonSource() - # Comment this line to generate a disk instead of a circle. - polygonSource.GeneratePolygonOff() - polygonSource.SetNumberOfSides(50) - polygonSource.SetRadius(5.0) - polygonSource.SetCenter(0.0, 0.0, 0.0) - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(polygonSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Circle") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - renderWindow.SetWindowName('Circle') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ColoredLines.md b/data/examples/GeometricObjects/ColoredLines.md deleted file mode 100644 index 2daad46..0000000 --- a/data/examples/GeometricObjects/ColoredLines.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Displays two lines, each with a different color. - -!!! seealso - [LongLine](../LongLine). diff --git a/data/examples/GeometricObjects/ColoredLines.py b/data/examples/GeometricObjects/ColoredLines.py deleted file mode 100755 index 8653d2c..0000000 --- a/data/examples/GeometricObjects/ColoredLines.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Create the polydata where we will store all the geometric data - linesPolyData = vtkPolyData() - - # Create three points - origin = [0.0, 0.0, 0.0] - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] - - # Create a vtkPoints container and store the points in it - pts = vtkPoints() - pts.InsertNextPoint(origin) - pts.InsertNextPoint(p0) - pts.InsertNextPoint(p1) - - # Add the points to the polydata container - linesPolyData.SetPoints(pts) - - # Create the first line (between Origin and P0) - line0 = vtkLine() - line0.GetPointIds().SetId(0, 0) # the second 0 is the index of the Origin in linesPolyData's points - line0.GetPointIds().SetId(1, 1) # the second 1 is the index of P0 in linesPolyData's points - - # Create the second line (between Origin and P1) - line1 = vtkLine() - line1.GetPointIds().SetId(0, 0) # the second 0 is the index of the Origin in linesPolyData's points - line1.GetPointIds().SetId(1, 2) # 2 is the index of P1 in linesPolyData's points - - # Create a vtkCellArray container and store the lines in it - lines = vtkCellArray() - lines.InsertNextCell(line0) - lines.InsertNextCell(line1) - - # Add the lines to the polydata container - linesPolyData.SetLines(lines) - - namedColors = vtkNamedColors() - - # Create a vtkUnsignedCharArray container and store the colors in it - colors = vtkUnsignedCharArray() - colors.SetNumberOfComponents(3) - try: - colors.InsertNextTupleValue(namedColors.GetColor3ub("Tomato")) - colors.InsertNextTupleValue(namedColors.GetColor3ub("Mint")) - except AttributeError: - # For compatibility with new VTK generic data arrays. - colors.InsertNextTypedTuple(namedColors.GetColor3ub("Tomato")) - colors.InsertNextTypedTuple(namedColors.GetColor3ub("Mint")) - - # Color the lines. - # SetScalars() automatically associates the values in the data array passed as parameter - # to the elements in the same indices of the cell data array on which it is called. - # This means the first component (red) of the colors array - # is matched with the first component of the cell array (line 0) - # and the second component (green) of the colors array - # is matched with the second component of the cell array (line 1) - linesPolyData.GetCellData().SetScalars(colors) - - # Setup the visualization pipeline - mapper = vtkPolyDataMapper() - mapper.SetInputData(linesPolyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(namedColors.GetColor3d("SlateGray")) - - window = vtkRenderWindow() - window.SetWindowName("ColoredLines") - window.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(window) - - # Visualize - window.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Cone.md b/data/examples/GeometricObjects/Cone.md deleted file mode 100644 index 69dee9c..0000000 --- a/data/examples/GeometricObjects/Cone.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -vtkConeSource object creates a cone centered at a specified point and pointing in a specified direction. (By default, -the center is the origin and the direction is the x-axis.) - -Depending upon the resolution of this object, different representations are created. If resolution=0 a line is created; -if resolution=1, a single triangle is created; if resolution=2, two crossed triangles are created. - -For resolution > 2, a 3D cone (with resolution number of sides) is created. - -It also is possible to control whether the bottom of the cone is capped with a (resolution-sided) polygon, and to -specify the height and radius of the cone. diff --git a/data/examples/GeometricObjects/Cone.py b/data/examples/GeometricObjects/Cone.py deleted file mode 100755 index e926724..0000000 --- a/data/examples/GeometricObjects/Cone.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - coneSource = vtkConeSource() - # coneSource.SetResolution(60) - # coneSource.SetCenter(-2,0,0) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(coneSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('bisque')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Salmon')) - - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('Cone') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ConvexPointSet.md b/data/examples/GeometricObjects/ConvexPointSet.md deleted file mode 100644 index 0835cd2..0000000 --- a/data/examples/GeometricObjects/ConvexPointSet.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -vtkConvexPointSet object represents a 3D cell defined by a convex set of points. An example of such a cell is an -octant (from an octree). - -vtkConvexPointSet uses the ordered triangulations approach (vtkOrderedTriangulator) to create triangulations guaranteed -to be compatible across shared faces. diff --git a/data/examples/GeometricObjects/ConvexPointSet.py b/data/examples/GeometricObjects/ConvexPointSet.py deleted file mode 100755 index 00055ed..0000000 --- a/data/examples/GeometricObjects/ConvexPointSet.py +++ /dev/null @@ -1,105 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkConvexPointSet, - vtkPolyData, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkGlyph3DMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - cps = vtkConvexPointSet() - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, 1) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(0, 1, 1) - points.InsertNextPoint(0.5, 0, 0) - points.InsertNextPoint(1, 0.5, 0) - points.InsertNextPoint(0.5, 1, 0) - points.InsertNextPoint(0, 0.5, 0) - points.InsertNextPoint(0.5, 0.5, 0) - - for i in range(0, 13): - cps.GetPointIds().InsertId(i, i) - - ug = vtkUnstructuredGrid() - ug.Allocate(1, 1) - ug.InsertNextCell(cps.GetCellType(), cps.GetPointIds()) - ug.SetPoints(points) - - colors = vtkNamedColors() - - mapper = vtkDataSetMapper() - mapper.SetInputData(ug) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - actor.GetProperty().SetLineWidth(3) - actor.GetProperty().EdgeVisibilityOn() - - # Glyph the points - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) - sphere.SetRadius(.03) - - # Create a polydata to store everything in - polyData = vtkPolyData() - polyData.SetPoints(points) - - pointMapper = vtkGlyph3DMapper() - pointMapper.SetInputData(polyData) - pointMapper.SetSourceConnection(sphere.GetOutputPort()) - - pointActor = vtkActor() - pointActor.SetMapper(pointMapper) - pointActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("ConvexPointSet") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.AddActor(pointActor) - renderer.SetBackground(colors.GetColor3d("Silver")) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(210) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - # Render and interact - renderWindow.SetSize(640, 480) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Cube.md b/data/examples/GeometricObjects/Cube.md deleted file mode 100644 index 8461188..0000000 --- a/data/examples/GeometricObjects/Cube.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This is based on the C++ -example [Examples/DataManipulation/Cxx/Cube.cxx](http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/DataManipulation/Cxx/Cube.cxx) -in the VTK source distribution. - -It illustrates the manual use of vtkPolyData to construct a cube and differs from the Wiki -examples [Cube1.cxx](../../../Cxx/GeometricObjects/Cube1) and [Cube1.py](../Cube1), which use vtkCubeSource. diff --git a/data/examples/GeometricObjects/Cube.py b/data/examples/GeometricObjects/Cube.py deleted file mode 100755 index 80414ad..0000000 --- a/data/examples/GeometricObjects/Cube.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python - -""" -This is (almost) a direct C++ to Python transliteration of - /Examples/DataManipulation/Cxx/Cube.cxx from the VTK - source distribution, which "shows how to manually create vtkPolyData" - -A convenience function, mkVtkIdList(), has been added and one if/else - so the example also works in version 6 or later. -If your VTK version is 5.x then remove the line: colors = vtkNamedColors() - and replace the set background parameters with (1.0, 0.9688, 0.8594) - -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkIdList, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def mkVtkIdList(it): - """ - Makes a vtkIdList from a Python iterable. I'm kinda surprised that - this is necessary, since I assumed that this kind of thing would - have been built into the wrapper and happen transparently, but it - seems not. - - :param it: A python iterable. - :return: A vtkIdList - """ - vil = vtkIdList() - for i in it: - vil.InsertNextId(int(i)) - return vil - - -def main(): - colors = vtkNamedColors() - - # x = array of 8 3-tuples of float representing the vertices of a cube: - x = [(0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (1.0, 1.0, 0.0), (0.0, 1.0, 0.0), - (0.0, 0.0, 1.0), (1.0, 0.0, 1.0), (1.0, 1.0, 1.0), (0.0, 1.0, 1.0)] - - # pts = array of 6 4-tuples of vtkIdType (int) representing the faces - # of the cube in terms of the above vertices - pts = [(0, 3, 2, 1), (4, 5, 6, 7), (0, 1, 5, 4), - (1, 2, 6, 5), (2, 3, 7, 6), (3, 0, 4, 7)] - - # We'll create the building blocks of polydata including data attributes. - cube = vtkPolyData() - points = vtkPoints() - polys = vtkCellArray() - scalars = vtkFloatArray() - - # Load the point, cell, and data attributes. - for i, xi in enumerate(x): - points.InsertPoint(i, xi) - for pt in pts: - polys.InsertNextCell(mkVtkIdList(pt)) - for i, _ in enumerate(x): - scalars.InsertTuple1(i, i) - - # We now assign the pieces to the vtkPolyData. - cube.SetPoints(points) - cube.SetPolys(polys) - cube.GetPointData().SetScalars(scalars) - - # Now we'll look at it. - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputData(cube) - cubeMapper.SetScalarRange(cube.GetScalarRange()) - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - - # The usual rendering stuff. - camera = vtkCamera() - camera.SetPosition(1, 1, 1) - camera.SetFocalPoint(0, 0, 0) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - renderer.AddActor(cubeActor) - renderer.SetActiveCamera(camera) - renderer.ResetCamera() - renderer.SetBackground(colors.GetColor3d("Cornsilk")) - - renWin.SetSize(600, 600) - renWin.SetWindowName("Cube") - - # interact with data - renWin.Render() - iren.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/GeometricObjects/Cube1.md b/data/examples/GeometricObjects/Cube1.md deleted file mode 100644 index 239b850..0000000 --- a/data/examples/GeometricObjects/Cube1.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -Display a cube. - -A nice simple example that demonstrates the operation of the VTK pipeline. diff --git a/data/examples/GeometricObjects/Cube1.py b/data/examples/GeometricObjects/Cube1.py deleted file mode 100755 index 0acce53..0000000 --- a/data/examples/GeometricObjects/Cube1.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a rendering window and renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('Cube1') - renWin.AddRenderer(ren) - - # Create a renderwindowinteractor. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create cube. - cube = vtkCubeSource() - cube.Update() - - # mapper - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputData(cube.GetOutput()) - - # Actor. - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - cubeActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - # Assign actor to the renderer. - ren.AddActor(cubeActor) - - ren.ResetCamera() - ren.GetActiveCamera().Azimuth(30) - ren.GetActiveCamera().Elevation(30) - ren.ResetCameraClippingRange() - ren.SetBackground(colors.GetColor3d('Silver')) - - # Enable user interface interactor. - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Cylinder.md b/data/examples/GeometricObjects/Cylinder.md deleted file mode 100644 index 3b4bca6..0000000 --- a/data/examples/GeometricObjects/Cylinder.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -vtkCylinderSource object creates a polygonal cylinder centered at Center. - -The axis of the cylinder is aligned along the global y-axis. The height and radius of the cylinder can be specified, as -well as the number of sides. - -It is also possible to control whether the cylinder is open-ended or capped. If you have the end points of the cylinder, -you should use a vtkLineSource followed by a vtkTubeFilter instead of the vtkCylinderSource. diff --git a/data/examples/GeometricObjects/Cylinder.py b/data/examples/GeometricObjects/Cylinder.py deleted file mode 100755 index ec18085..0000000 --- a/data/examples/GeometricObjects/Cylinder.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkCylinderSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a sphere - cylinderSource = vtkCylinderSource() - cylinderSource.SetCenter(0.0, 0.0, 0.0) - cylinderSource.SetRadius(5.0) - cylinderSource.SetHeight(7.0) - cylinderSource.SetResolution(100) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cylinderSource.GetOutputPort()) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Cylinder') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/CylinderExample.md b/data/examples/GeometricObjects/CylinderExample.md deleted file mode 100644 index 0e7f698..0000000 --- a/data/examples/GeometricObjects/CylinderExample.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example creates a minimal visualization program, demonstrating VTK's basic rendering and pipeline creation. - -!!! note - This original C++ source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/73465690278158b9e89661cd6aed26bead781378/Examples/Rendering/Cxx/Cylinder.cxx). diff --git a/data/examples/GeometricObjects/CylinderExample.py b/data/examples/GeometricObjects/CylinderExample.py deleted file mode 100755 index 109a639..0000000 --- a/data/examples/GeometricObjects/CylinderExample.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -# This simple example shows how to do basic rendering and pipeline -# creation. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkCylinderSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - # Set the background color. - bkg = map(lambda x: x / 255.0, [26, 51, 102, 255]) - colors.SetColor("BkgColor", *bkg) - - # This creates a polygonal cylinder model with eight circumferential - # facets. - cylinder = vtkCylinderSource() - cylinder.SetResolution(8) - - # The mapper is responsible for pushing the geometry into the graphics - # library. It may also do color mapping, if scalars or other - # attributes are defined. - cylinderMapper = vtkPolyDataMapper() - cylinderMapper.SetInputConnection(cylinder.GetOutputPort()) - - # The actor is a grouping mechanism: besides the geometry (mapper), it - # also has a property, transformation matrix, and/or texture map. - # Here we set its color and rotate it -22.5 degrees. - cylinderActor = vtkActor() - cylinderActor.SetMapper(cylinderMapper) - cylinderActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - cylinderActor.RotateX(30.0) - cylinderActor.RotateY(-45.0) - - # Create the graphics structure. The renderer renders into the render - # window. The render window interactor captures mouse events and will - # perform appropriate camera or actor manipulation depending on the - # nature of the events. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - ren.AddActor(cylinderActor) - ren.SetBackground(colors.GetColor3d("BkgColor")) - renWin.SetSize(300, 300) - renWin.SetWindowName('CylinderExample') - - # This allows the interactor to initalize itself. It has to be - # called before an event loop. - iren.Initialize() - - # We'll zoom in a little by accessing the camera and invoking a "Zoom" - # method on it. - ren.ResetCamera() - ren.GetActiveCamera().Zoom(1.5) - renWin.Render() - - # Start the event loop. - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Disk.md b/data/examples/GeometricObjects/Disk.md deleted file mode 100644 index c524eb3..0000000 --- a/data/examples/GeometricObjects/Disk.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -vtkDiskSource objects creates a polygonal disk with a hole in the center. - -The disk has zero height. The user can specify the inner and outer radius of the disk, and the radial and -circumferential resolution of the polygonal representation. diff --git a/data/examples/GeometricObjects/Disk.py b/data/examples/GeometricObjects/Disk.py deleted file mode 100755 index e53b8a1..0000000 --- a/data/examples/GeometricObjects/Disk.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkDiskSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - diskSource = vtkDiskSource() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(diskSource.GetOutputPort()) - - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("Cornsilk")) - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Disk") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("DarkGreen")) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Dodecahedron.py b/data/examples/GeometricObjects/Dodecahedron.py deleted file mode 100755 index dea256c..0000000 --- a/data/examples/GeometricObjects/Dodecahedron.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyhedron -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - dodecahedron = MakeDodecahedron() - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputData(dodecahedron.GetPolyData()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor( - colors.GetColor3d('PapayaWhip')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Dodecahedron') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('CadetBlue')) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - renderer.ResetCamera() - - renderWindow.Render() - renderWindowInteractor.Start() - - -def MakeDodecahedron(): - aDodecahedron = vtkPolyhedron() - - for i in range(0, 20): - aDodecahedron.GetPointIds().InsertNextId(i) - - aDodecahedron.GetPoints().InsertNextPoint(1.21412, 0, 1.58931) - aDodecahedron.GetPoints().InsertNextPoint(0.375185, 1.1547, 1.58931) - aDodecahedron.GetPoints().InsertNextPoint(-0.982247, 0.713644, 1.58931) - aDodecahedron.GetPoints().InsertNextPoint(-0.982247, -0.713644, 1.58931) - aDodecahedron.GetPoints().InsertNextPoint(0.375185, -1.1547, 1.58931) - aDodecahedron.GetPoints().InsertNextPoint(1.96449, 0, 0.375185) - aDodecahedron.GetPoints().InsertNextPoint(0.607062, 1.86835, 0.375185) - aDodecahedron.GetPoints().InsertNextPoint(-1.58931, 1.1547, 0.375185) - aDodecahedron.GetPoints().InsertNextPoint(-1.58931, -1.1547, 0.375185) - aDodecahedron.GetPoints().InsertNextPoint(0.607062, -1.86835, 0.375185) - aDodecahedron.GetPoints().InsertNextPoint(1.58931, 1.1547, -0.375185) - aDodecahedron.GetPoints().InsertNextPoint(-0.607062, 1.86835, -0.375185) - aDodecahedron.GetPoints().InsertNextPoint(-1.96449, 0, -0.375185) - aDodecahedron.GetPoints().InsertNextPoint(-0.607062, -1.86835, -0.375185) - aDodecahedron.GetPoints().InsertNextPoint(1.58931, -1.1547, -0.375185) - aDodecahedron.GetPoints().InsertNextPoint(0.982247, 0.713644, -1.58931) - aDodecahedron.GetPoints().InsertNextPoint(-0.375185, 1.1547, -1.58931) - aDodecahedron.GetPoints().InsertNextPoint(-1.21412, 0, -1.58931) - aDodecahedron.GetPoints().InsertNextPoint(-0.375185, -1.1547, -1.58931) - aDodecahedron.GetPoints().InsertNextPoint(0.982247, -0.713644, -1.58931) - - faces = [12, # number of faces - 5, 0, 1, 2, 3, 4, # number of ids on face, ids - 5, 0, 5, 10, 6, 1, - 5, 1, 6, 11, 7, 2, - 5, 2, 7, 12, 8, 3, - 5, 3, 8, 13, 9, 4, - 5, 4, 9, 14, 5, 0, - 5, 15, 10, 5, 14, 19, - 5, 16, 11, 6, 10, 15, - 5, 17, 12, 7, 11, 16, - 5, 18, 13, 8, 12, 17, - 5, 19, 14, 9, 13, 18, - 5, 19, 18, 17, 16, 15] - - aDodecahedron.SetFaces(faces) - aDodecahedron.Initialize() - - return aDodecahedron - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/EarthSource.py b/data/examples/GeometricObjects/EarthSource.py deleted file mode 100755 index bb215e5..0000000 --- a/data/examples/GeometricObjects/EarthSource.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersHybrid import vtkEarthSource -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Earth source - earthSource = vtkEarthSource() - earthSource.OutlineOn() - earthSource.Update() - r = earthSource.GetRadius() - - # Create a sphere - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(100) - sphere.SetRadius(earthSource.GetRadius()) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(earthSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.AddActor(sphereActor) - renderer.SetBackground(colors.GetColor3d('Black')) - - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('EarthSource') - - # Render and interact - renderWindow.Render() - - # # screenshot code: - # w2if = vtkWindowToImageFilter() - # w2if.SetInput(renderWindow) - # w2if.Update() - # - # writer = vtkPNGWriter() - # writer.SetFileName('TestEarthSource.png') - # writer.SetInputConnection(w2if.GetOutputPort()) - # writer.Write() - - # begin interaction - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/EllipticalCylinder.md b/data/examples/GeometricObjects/EllipticalCylinder.md deleted file mode 100644 index ac28284..0000000 --- a/data/examples/GeometricObjects/EllipticalCylinder.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -The example creates an elliptical cross-section and stores it in a vtkPolyData. Then, the vtkLinearExtrusionFilter -creates an elliptical cylinder by extruding the vtkPolyLine along a vector. The example sets the backface property of -the vtkActor to show the front and back face of the cylinder. - -!!! seealso - [EllipticalCylinderDemo](../EllipticalCylinderDemo) to see the vtkPolyLine and the vector represented as an oriented -arrow. diff --git a/data/examples/GeometricObjects/EllipticalCylinder.py b/data/examples/GeometricObjects/EllipticalCylinder.py deleted file mode 100755 index 91ff6d4..0000000 --- a/data/examples/GeometricObjects/EllipticalCylinder.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMath, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine -) -from vtkmodules.vtkFiltersModeling import vtkLinearExtrusionFilter -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - angle = 0 - r1 = 50 - r2 = 30 - centerX = 10.0 - centerY = 5.0 - - points = vtkPoints() - idx = 0 - while angle <= 2.0 * vtkMath.Pi() + (vtkMath.Pi() / 60.0): - points.InsertNextPoint(r1 * math.cos(angle) + centerX, - r2 * math.sin(angle) + centerY, - 0.0) - angle = angle + (vtkMath.Pi() / 60.0) - idx += 1 - - line = vtkPolyLine() - line.GetPointIds().SetNumberOfIds(idx) - for i in range(0, idx): - line.GetPointIds().SetId(i, i) - - lines = vtkCellArray() - lines.InsertNextCell(line) - - polyData = vtkPolyData() - polyData.SetPoints(points) - polyData.SetLines(lines) - - extrude = vtkLinearExtrusionFilter() - extrude.SetInputData(polyData) - extrude.SetExtrusionTypeToNormalExtrusion() - extrude.SetVector(0, 0, 100.0) - extrude.Update() - - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputData(polyData) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(extrude.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d("Tomato")) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.SetBackfaceProperty(back) - - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d("SlateGray")) - ren.AddActor(actor) - ren.AddActor(lineActor) - - renWin = vtkRenderWindow() - renWin.SetWindowName("EllipticalCylinder") - renWin.AddRenderer(ren) - renWin.SetSize(600, 600) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(30) - camera.Elevation(30) - - ren.SetActiveCamera(camera) - ren.ResetCamera() - ren.ResetCameraClippingRange() - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/EllipticalCylinderDemo.md b/data/examples/GeometricObjects/EllipticalCylinderDemo.md deleted file mode 100644 index 781ac58..0000000 --- a/data/examples/GeometricObjects/EllipticalCylinderDemo.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -The example shows the vtkPolyLine that forms the base of the elliptical cylinder and an oriented arrow that represents -the vector that vtkLinearExtrusionFilter uses to create the cylinder. The example takes an optional triple that defines -the vector for the filter. The length of the vector is the height of the cylinder. diff --git a/data/examples/GeometricObjects/EllipticalCylinderDemo.py b/data/examples/GeometricObjects/EllipticalCylinderDemo.py deleted file mode 100755 index a492b47..0000000 --- a/data/examples/GeometricObjects/EllipticalCylinderDemo.py +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMath, - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine -) -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkTubeFilter -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkLinearExtrusionFilter -from vtkmodules.vtkFiltersSources import vtkArrowSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - nx, ny, nz = get_program_parameters() - colors = vtkNamedColors() - - angle = 0 - r1 = 50 - r2 = 30 - centerX = 10.0 - centerY = 5.0 - - points = vtkPoints() - idx = 0 - while angle <= 2.0 * vtkMath.Pi() + (vtkMath.Pi() / 60.0): - points.InsertNextPoint(r1 * math.cos(angle) + centerX, - r2 * math.sin(angle) + centerY, - 0.0) - angle = angle + (vtkMath.Pi() / 60.0) - idx += 1 - - line = vtkPolyLine() - line.GetPointIds().SetNumberOfIds(idx) - for i in range(0, idx): - line.GetPointIds().SetId(i, i) - - lines = vtkCellArray() - lines.InsertNextCell(line) - - polyData = vtkPolyData() - polyData.SetPoints(points) - polyData.SetLines(lines) - - extrude = vtkLinearExtrusionFilter() - extrude.SetInputData(polyData) - extrude.SetExtrusionTypeToNormalExtrusion() - extrude.SetVector(nx, ny, nz) - extrude.Update() - - # Create an oriented arrow - startPoint = [0.0] * 3 - endPoint = [0.0] * 3 - startPoint[0] = centerX - startPoint[1] = centerY - startPoint[2] = 0.0 - for i in range(0, 3): - endPoint[i] = startPoint[i] + extrude.GetVector()[i] - - # Compute a basis - normalizedX = [0.0] * 3 - normalizedY = [0.0] * 3 - normalizedZ = [0.0] * 3 - - # The X axis is a vector from start to end - vtkMath.Subtract(endPoint, startPoint, normalizedX) - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - max_r = 10.0 - - # The Z axis is an arbitrary vector cross X - arbitrary = [0.0] * 3 - for i in range(0, 3): - arbitrary[i] = rng.GetRangeValue(-max_r, max_r) - rng.Next() - vtkMath.Cross(normalizedX, arbitrary, normalizedZ) - vtkMath.Normalize(normalizedZ) - - # The Y axis is Z cross X - vtkMath.Cross(normalizedZ, normalizedX, normalizedY) - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) - matrix.SetElement(i, 1, normalizedY[i]) - matrix.SetElement(i, 2, normalizedZ[i]) - - # Apply the transforms - transform = vtkTransform() - transform.Translate(startPoint) - transform.Concatenate(matrix) - transform.Scale(length, length, length) - - arrowSource = vtkArrowSource() - arrowSource.SetTipResolution(31) - arrowSource.SetShaftResolution(21) - - # Transform the polydata - transformPD = vtkTransformPolyDataFilter() - transformPD.SetTransform(transform) - transformPD.SetInputConnection(arrowSource.GetOutputPort()) - - # Create a mapper and actor for the arrow - arrowMapper = vtkPolyDataMapper() - arrowMapper.SetInputConnection(transformPD.GetOutputPort()) - - arrowActor = vtkActor() - arrowActor.SetMapper(arrowMapper) - arrowActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - - tubes = vtkTubeFilter() - tubes.SetInputData(polyData) - tubes.SetRadius(2.0) - tubes.SetNumberOfSides(21) - - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputConnection(tubes.GetOutputPort()) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(extrude.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetOpacity(.7) - - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d("SlateGray")) - ren.AddActor(actor) - ren.AddActor(lineActor) - ren.AddActor(arrowActor) - - renWin = vtkRenderWindow() - renWin.SetWindowName("Elliptical Cylinder Demo") - renWin.AddRenderer(ren) - renWin.SetSize(600, 600) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(30) - camera.Elevation(30) - - ren.SetActiveCamera(camera) - ren.ResetCamera() - ren.ResetCameraClippingRange() - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Elliptical Cylinder Demo.' - epilogue = ''' -The example shows the vtkPolyLine that forms the base of the elliptical cylinder - and an oriented arrow that represents the vector that vtkLinearExtrusionFilter - uses to create the cylinder. -The example takes an optional triple that defines the vector for the filter. -The length of the vector is the height of the cylinder. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-nx', nargs='?', const=0.0, default=0.0, type=float) - parser.add_argument('-ny', nargs='?', const=0.0, default=0.0, type=float) - parser.add_argument('-nz', nargs='?', const=100.0, default=100.0, type=float) - args = parser.parse_args() - return args.nx, args.ny, args.nz - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Frustum.md b/data/examples/GeometricObjects/Frustum.md deleted file mode 100644 index 4f00dff..0000000 --- a/data/examples/GeometricObjects/Frustum.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example gets the frustum from a camera and displays it on the screen. diff --git a/data/examples/GeometricObjects/Frustum.py b/data/examples/GeometricObjects/Frustum.py deleted file mode 100755 index 3ec45dd..0000000 --- a/data/examples/GeometricObjects/Frustum.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPlanes -from vtkmodules.vtkFiltersGeneral import vtkShrinkPolyData -from vtkmodules.vtkFiltersSources import vtkFrustumSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - camera = vtkCamera() - camera.SetClippingRange(0.1, 0.4) - planesArray = [0] * 24 - - camera.GetFrustumPlanes(1.0, planesArray) - - planes = vtkPlanes() - planes.SetFrustumPlanes(planesArray) - - frustumSource = vtkFrustumSource() - frustumSource.ShowLinesOff() - frustumSource.SetPlanes(planes) - - shrink = vtkShrinkPolyData() - shrink.SetInputConnection(frustumSource.GetOutputPort()) - shrink.SetShrinkFactor(.9) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d("Tomato")) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.SetBackfaceProperty(back) - - # a renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Frustum") - renderWindow.AddRenderer(renderer) - - # an interactor - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("Silver")) - - # Position the camera so that we can see the frustum - renderer.GetActiveCamera().SetPosition(1, 0, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 1, 0) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCamera() - - # render an image (lights and cameras are created automatically) - renderWindow.Render() - - # begin mouse interaction - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/GeometricObjectsDemo.py b/data/examples/GeometricObjects/GeometricObjectsDemo.py deleted file mode 100755 index 205c858..0000000 --- a/data/examples/GeometricObjects/GeometricObjectsDemo.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkConeSource, - vtkCubeSource, - vtkCylinderSource, - vtkDiskSource, - vtkLineSource, - vtkRegularPolygonSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - # Create container to hold the 3D object generators (sources) - geometricObjectSources = list() - - # Populate the container with the various object sources to be demonstrated - geometricObjectSources.append(vtkArrowSource()) - geometricObjectSources.append(vtkConeSource()) - geometricObjectSources.append(vtkCubeSource()) - geometricObjectSources.append(vtkCylinderSource()) - geometricObjectSources.append(vtkDiskSource()) - geometricObjectSources.append(vtkLineSource()) - geometricObjectSources.append(vtkRegularPolygonSource()) - geometricObjectSources.append(vtkSphereSource()) - - # Create containers for the remaining nodes of each pipeline - mappers = list() - actors = list() - textmappers = list() - textactors = list() - - # Create a common text property. - textProperty = vtkTextProperty() - textProperty.SetFontSize(16) - textProperty.SetJustificationToCentered() - textProperty.SetColor(colors.GetColor3d('LightGoldenrodYellow')) - - # Create a mapper and actor for each object and the corresponding text label - for i in range(0, len(geometricObjectSources)): - geometricObjectSources[i].Update() - - mappers.append(vtkPolyDataMapper()) - mappers[i].SetInputConnection(geometricObjectSources[i].GetOutputPort()) - - actors.append(vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - textmappers.append(vtkTextMapper()) - textmappers[i].SetInput( - geometricObjectSources[i].GetClassName()) # set text label to the name of the object source - textmappers[i].SetTextProperty(textProperty) - - textactors.append(vtkActor2D()) - textactors[i].SetMapper(textmappers[i]) - textactors[i].SetPosition(120, 16) # Note: the position of an Actor2D is specified in display coordinates - - # Define size of the grid that will hold the objects - gridCols = 3 - gridRows = 3 - # Define side length (in pixels) of each renderer square - rendererSize = 300 - - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('GeometricObjectsDemo') - renderWindow.SetSize(rendererSize * gridCols, rendererSize * gridRows) - - # Set up a grid of viewports for each renderer - for row in range(0, gridRows): - for col in range(0, gridCols): - index = row * gridCols + col - - # Create a renderer for this grid cell - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('BkgColor')) - - # Set the renderer's viewport dimensions (xmin, ymin, xmax, ymax) within the render window. - # Note that for the Y values, we need to subtract the row index from gridRows - # because the viewport Y axis points upwards, but we want to draw the grid from top to down - viewport = [ - float(col) / gridCols, - float(gridRows - row - 1) / gridRows, - float(col + 1) / gridCols, - float(gridRows - row) / gridRows - ] - renderer.SetViewport(viewport) - - # Add the corresponding actor and label for this grid cell, if they exist - if index < len(geometricObjectSources): - renderer.AddActor(actors[index]) - renderer.AddActor(textactors[index]) - renderer.ResetCameraClippingRange() - - renderWindow.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Hexahedron.md b/data/examples/GeometricObjects/Hexahedron.md deleted file mode 100644 index ed28d2d..0000000 --- a/data/examples/GeometricObjects/Hexahedron.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -The hexahedron is a primary three-dimensional cell consisting of six quadrilateral faces, twelve edges, and eight -vertices. The hexahedron is defined by an ordered list of eight points. The faces and edges must not intersect any other -faces and edges, and the hexahedron must be convex. diff --git a/data/examples/GeometricObjects/Hexahedron.py b/data/examples/GeometricObjects/Hexahedron.py deleted file mode 100755 index 534cee9..0000000 --- a/data/examples/GeometricObjects/Hexahedron.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkHexahedron, - vtkUnstructuredGrid -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - # For the hexahedron setup the coordinates of eight points. - # The two faces must be in counter clockwise order as viewed from the - # outside. - pointCoordinates = list() - pointCoordinates.append([0.0, 0.0, 0.0]) # Face 1 - pointCoordinates.append([1.0, 0.0, 0.0]) - pointCoordinates.append([1.0, 1.0, 0.0]) - pointCoordinates.append([0.0, 1.0, 0.0]) - pointCoordinates.append([0.0, 0.0, 1.0]) # Face 2 - pointCoordinates.append([1.0, 0.0, 1.0]) - pointCoordinates.append([1.0, 1.0, 1.0]) - pointCoordinates.append([0.0, 1.0, 1.0]) - - # Create the points. - points = vtkPoints() - - # Create a hexahedron from the points. - hexahedron = vtkHexahedron() - - for i in range(0, len(pointCoordinates)): - points.InsertNextPoint(pointCoordinates[i]) - hexahedron.GetPointIds().SetId(i, i) - - # Add the hexahedron to a cell array. - hexs = vtkCellArray() - hexs.InsertNextCell(hexahedron) - - # Add the points and hexahedron to an unstructured grid. - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(hexahedron.GetCellType(), hexahedron.GetPointIds()) - - # Visualize. - mapper = vtkDataSetMapper() - mapper.SetInputData(uGrid) - - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("PeachPuff")) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Hexahedron") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("BkgColor")) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/IsoparametricCellsDemo.md b/data/examples/GeometricObjects/IsoparametricCellsDemo.md deleted file mode 100644 index 32dc37d..0000000 --- a/data/examples/GeometricObjects/IsoparametricCellsDemo.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -This example shows the isoparametric cells supported by the VTK. These cells are nonlinear and contain one or more -mid-side vertices. Isoparametric elements are typically used -in [finite element analysis](https://en.wikipedia.org/wiki/Finite_element_method). The term isoparametric is derived -from the use of the same shape functions (or interpolation functions) to define the element's geometric shape as are -used to define the displacements within the element. - -Options are provided to show a wire frame (`-w`) or to add a back face color (`-b`). You can also remove the plinth with the (`-n`) option. -If you want a single object, use `-o` followed by the object number. - -This example illustrates each cell's representation using its parametric coordinates (pcoords) as the vertices of the -cell. In practice, the vertices will correspond to physical points in a finite element model. Use vtkTessellatorFilter -to better see the shape of the cell. See for example, [QuadraticHexahedronDemo](../QuadraticHexahedronDemo) -and [QuadraticTetraDemo](../QuadraticTetraDemo). diff --git a/data/examples/GeometricObjects/IsoparametricCellsDemo.py b/data/examples/GeometricObjects/IsoparametricCellsDemo.py deleted file mode 100755 index b0cd767..0000000 --- a/data/examples/GeometricObjects/IsoparametricCellsDemo.py +++ /dev/null @@ -1,567 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - vtkBiQuadraticQuad, - vtkBiQuadraticQuadraticHexahedron, - vtkBiQuadraticQuadraticWedge, - vtkBiQuadraticTriangle, - vtkCubicLine, - vtkQuadraticEdge, - vtkQuadraticHexahedron, - vtkQuadraticLinearQuad, - vtkQuadraticLinearWedge, - vtkQuadraticPolygon, - vtkQuadraticPyramid, - vtkQuadraticQuad, - vtkQuadraticTetra, - vtkQuadraticTriangle, - vtkQuadraticWedge, - vtkTriQuadraticHexahedron, - vtkUnstructuredGrid -) -# noinspection PyUnresolvedReferences -from vtkmodules.vtkCommonTransforms import vtkTransform -# noinspection PyUnresolvedReferences -from vtkmodules.vtkFiltersGeneral import vtkTransformFilter -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkGlyph3DMapper, - vtkLightKit, - vtkPolyDataMapper, - vtkProperty, - vtkRenderer, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkTextMapper, - vtkTextProperty -) -from vtkmodules.vtkRenderingLabel import vtkLabeledDataMapper - - -def get_program_parameters(): - import argparse - description = 'Demonstrate the isoparametric cell types found in VTK.' - epilogue = ''' - The numbers define the ordering of the points making the cell. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - group1 = parser.add_mutually_exclusive_group() - group1.add_argument('-w', '--wireframe', action='store_true', - help='Render a wireframe.') - group1.add_argument('-b', '--backface', action='store_true', - help='Display the back face in a different colour.') - - parser.add_argument('-o', '--object_number', type=int, default=None, - help='The number corresponding to the object.') - parser.add_argument('-n', '--no_plinth', action='store_true', - help='Remove the plinth.') - args = parser.parse_args() - return args.wireframe, args.backface, args.object_number, args.no_plinth - - -def main(): - wireframe_on, backface_on, object_num, plinth_off = get_program_parameters() - - objects = specify_objects() - # The order here should match the order in specify_objects(). - object_order = list(objects.keys()) - - # Check for a single object. - single_object = None - if object_num: - if object_num in object_order: - single_object = True - else: - print('Object not found.\nPlease enter the number corresponding to the object.') - print('Available objects are:') - for obj in object_order: - print(f'{objects[obj]} (={str(obj)})') - return - - colors = vtkNamedColors() - - # Create one sphere for all. - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) - sphere.SetRadius(0.04) - - cells = get_unstructured_grids() - # The text to be displayed in the viewport. - names = list() - # The keys of the objects selected for display. - keys = list() - if single_object: - names.append(f'{objects[object_num]} (={str(object_num)})') - keys.append(object_num) - else: - for obj in object_order: - names.append(f'{objects[obj]} (={str(obj)})') - keys.append(obj) - - add_plinth = (24, 25, 12, 26, 27, 29, 31, 32, 33) - lines = (21, 35) - - # Set up the viewports. - grid_column_dimensions = 4 - grid_row_dimensions = 4 - renderer_size = 300 - if single_object: - grid_column_dimensions = 1 - grid_row_dimensions = 1 - renderer_size = 1200 - window_size = (grid_column_dimensions * renderer_size, grid_row_dimensions * renderer_size) - - viewports = dict() - blank = len(cells) - blank_viewports = list() - - for row in range(0, grid_row_dimensions): - for col in range(0, grid_column_dimensions): - index = row * grid_column_dimensions + col - # Set the renderer's viewport dimensions (xmin, ymin, xmax, ymax) within the render window. - # Note that for the Y values, we need to subtract the row index from grid_rows - # because the viewport Y axis points upwards, and we want to draw the grid from top to down. - viewport = (float(col) / grid_column_dimensions, - float(grid_row_dimensions - (row + 1)) / grid_row_dimensions, - float(col + 1) / grid_column_dimensions, - float(grid_row_dimensions - row) / grid_row_dimensions) - - if index < blank: - viewports[keys[index]] = viewport - else: - s = f'vp_{col:d}_{row:d}' - viewports[s] = viewport - blank_viewports.append(s) - - ren_win = vtkRenderWindow() - ren_win.SetSize(window_size) - ren_win.SetWindowName('IsoparametricCellsDemo') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - # Since we always import vtkmodules.vtkInteractionStyle we can do this - # because vtkInteractorStyleSwitch is automatically imported: - iren.GetInteractorStyle().SetCurrentStyleToTrackballCamera() - - renderers = dict() - - # Create and link the mappers, actors and renderers together. - single_object_key = None - for idx, key in enumerate(keys): - print('Creating:', names[idx]) - - if single_object: - single_object_key = key - - text_property = get_text_property() - if single_object: - text_property.SetFontSize(renderer_size // 28) - else: - text_property.SetFontSize(renderer_size // 24) - - text_mapper = vtkTextMapper() - text_mapper.SetTextProperty(text_property) - text_mapper.SetInput(names[idx]) - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - - if wireframe_on or key in lines: - actor.GetProperty().SetRepresentationToWireframe() - actor.GetProperty().SetLineWidth(2) - actor.GetProperty().SetOpacity(1) - actor.GetProperty().SetColor(colors.GetColor3d('Black')) - else: - if backface_on: - actor.SetBackfaceProperty(get_back_face_property()) - - # Label the points. - label_property = get_label_property() - if single_object: - label_property.SetFontSize(renderer_size // 36) - else: - label_property.SetFontSize(renderer_size // 16) - - label_mapper = vtkLabeledDataMapper() - label_mapper.SetInputData(cells[key][0]) - label_mapper.SetLabelTextProperty(label_property) - - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) - point_mapper.SetSourceConnection(sphere.GetOutputPort()) - point_mapper.ScalingOn() - point_mapper.ScalarVisibilityOff() - - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.SetProperty(get_point_actor_property()) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('LightSteelBlue')) - renderer.SetViewport(viewports[key]) - - light_kit = vtkLightKit() - light_kit.AddLightsToRenderer(renderer) - - renderer.AddActor(text_actor) - renderer.AddActor(actor) - renderer.AddActor(label_actor) - renderer.AddActor(point_actor) - if not plinth_off: - # Add a plinth. - if key in add_plinth: - tile_actor = make_tile(cells[key][0].GetBounds(), - expansion_factor=0.5, thickness_ratio=0.01, shift_y=-0.05) - tile_actor.SetProperty(get_tile_property()) - renderer.AddActor(tile_actor) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(cells[key][1]) - renderer.GetActiveCamera().Elevation(cells[key][2]) - renderer.GetActiveCamera().Dolly(cells[key][3]) - renderer.ResetCameraClippingRange() - - renderers[key] = renderer - ren_win.AddRenderer(renderers[key]) - - for name in blank_viewports: - viewport = viewports[name] - renderer = vtkRenderer() - renderer.SetBackground = colors.GetColor3d('LightSteelBlue') - renderer.SetViewport(viewport) - - renderers[name] = renderer - ren_win.AddRenderer(renderers[name]) - - if single_object: - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderers[single_object_key]) - cam_orient_manipulator.SetInteractor(iren) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(iren) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - ren_win.Render() - iren.Initialize() - iren.Start() - - -def specify_objects(): - """ - Link the unstructured grid number to the unstructured grid name. - - :return: A dictionary: {index number: unstructured grid name}. - """ - objects = { - 21: 'VTK_QUADRATIC_EDGE', - 22: 'VTK_QUADRATIC_TRIANGLE', - 23: 'VTK_QUADRATIC_QUAD', - 36: 'VTK_QUADRATIC_POLYGON', - 24: 'VTK_QUADRATIC_TETRA', - 25: 'VTK_QUADRATIC_HEXAHEDRON', - 26: 'VTK_QUADRATIC_WEDGE', - 27: 'VTK_QUADRATIC_PYRAMID', - 28: 'VTK_BIQUADRATIC_QUAD', - 29: 'VTK_TRIQUADRATIC_HEXAHEDRON', - 30: 'VTK_QUADRATIC_LINEAR_QUAD', - 31: 'VTK_QUADRATIC_LINEAR_WEDGE', - 32: 'VTK_BIQUADRATIC_QUADRATIC_WEDGE', - 33: 'VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON', - 34: 'VTK_BIQUADRATIC_TRIANGLE', - 35: 'VTK_CUBIC_LINE', - } - return objects - - -def get_unstructured_grids(): - """ - Get the unstructured grid names, the unstructured grid and initial orientations. - - Get the unstructured grid names, the unstructured grid and initial orientations. - - :return: A dictionary: {index number: (unstructured grid, azimuth, elevation and dolly)}. - """ - - return { - 21: (make_ug(vtkQuadraticEdge()), 0, 0, 0.8), - 22: (make_ug(vtkQuadraticTriangle()), 0, 0, 0), - 23: (make_ug(vtkQuadraticQuad()), 0, 0, 0), - 36: (make_quadratic_polygon(), 0, 0, 0), - 24: (make_ug(vtkQuadraticTetra()), 20, 20, 1.0), - 25: (make_ug(vtkQuadraticHexahedron()), -30, 12, 0.95), - 26: (make_ug(vtkQuadraticWedge()), 45, 15, 1.0), - 27: (make_quadratic_pyramid(), -110, 8, 1.0), - 28: (make_ug(vtkBiQuadraticQuad()), 0, 0, 0), - 29: (make_ug(vtkTriQuadraticHexahedron()), -15, 15, 0.95), - 30: (make_ug(vtkQuadraticLinearQuad()), 0, 0, 0), - 31: (make_ug(vtkQuadraticLinearWedge()), 60, 22.5, 1.0), - 32: (make_ug(vtkBiQuadraticQuadraticWedge()), 70, 22.5, 1.0), - 33: (make_ug(vtkBiQuadraticQuadraticHexahedron()), -15, 15, 0.95), - 34: (make_ug(vtkBiQuadraticTriangle()), 0, 0, 0), - 35: (make_ug(vtkCubicLine()), 0, 0, 0.85), - } - - -# These functions return a vtkUnstructured grid corresponding to the object. - -def make_ug(cell): - pcoords = cell.GetParametricCoords() - for i in range(0, cell.number_of_points): - cell.point_ids.SetId(i, i) - cell.points.SetPoint(i, (pcoords[3 * i]), (pcoords[3 * i + 1]), (pcoords[3 * i + 2])) - - ug = vtkUnstructuredGrid() - ug.SetPoints(cell.GetPoints()) - ug.InsertNextCell(cell.cell_type, cell.point_ids) - return ug - - -def make_quadratic_polygon(): - number_of_vertices = 8 - - quadratic_polygon = vtkQuadraticPolygon() - - quadratic_polygon.points.SetNumberOfPoints(8) - - quadratic_polygon.points.SetPoint(0, 0.0, 0.0, 0.0) - quadratic_polygon.points.SetPoint(1, 2.0, 0.0, 0.0) - quadratic_polygon.points.SetPoint(2, 2.0, 2.0, 0.0) - quadratic_polygon.points.SetPoint(3, 0.0, 2.0, 0.0) - quadratic_polygon.points.SetPoint(4, 1.0, 0.0, 0.0) - quadratic_polygon.points.SetPoint(5, 2.0, 1.0, 0.0) - quadratic_polygon.points.SetPoint(6, 1.0, 2.0, 0.0) - quadratic_polygon.points.SetPoint(7, 0.0, 1.0, 0.0) - quadratic_polygon.points.SetPoint(5, 3.0, 1.0, 0.0) - - quadratic_polygon.point_ids.SetNumberOfIds(number_of_vertices) - for i in range(0, number_of_vertices): - quadratic_polygon.point_ids.SetId(i, i) - - ug = vtkUnstructuredGrid(points=quadratic_polygon.points) - ug.SetPoints(quadratic_polygon.GetPoints()) - ug.InsertNextCell(quadratic_polygon.cell_type, quadratic_polygon.point_ids) - - return ug - - -def make_quadratic_pyramid(): - cell = vtkQuadraticPyramid() - pcoords = cell.GetParametricCoords() - for i in range(0, cell.number_of_points): - cell.point_ids.SetId(i, i) - cell.points.SetPoint(i, (pcoords[3 * i]), (pcoords[3 * i + 1]), (pcoords[3 * i + 2])) - - ug = vtkUnstructuredGrid(points=cell.points) - ug.SetPoints(cell.GetPoints()) - ug.InsertNextCell(cell.cell_type, cell.point_ids) - - t = vtkTransform() - t.RotateX(-90) - t.Translate(0, 0, 0) - - tf = vtkTransformFilter() - tf.SetTransform(t) - tf.SetInputData(ug) - tf.Update() - - # Put the transformed points back. - ug.SetPoints(tf.GetOutput().GetPoints()) - - return ug - - -def make_tile(bounds, expansion_factor=0.5, thickness_ratio=0.05, shift_y=-0.05): - """ - Make a tile slightly larger or smaller than the bounds in the - X and Z directions and thinner or thicker in the Y direction. - - A thickness_ratio of zero reduces the tile to an XZ plane. - - :param bounds: The bounds for the tile. - :param expansion_factor: The expansion factor in the XZ plane. - :param thickness_ratio: The thickness ratio in the Y direction, >= 0. - :param shift_y: Used to shift the centre of the plinth in the Y-direction. - :return: An actor corresponding to the tile. - """ - - d_xyz = ( - bounds[1] - bounds[0], - bounds[3] - bounds[2], - bounds[5] - bounds[4] - ) - thickness = d_xyz[2] * abs(thickness_ratio) - center = ((bounds[1] + bounds[0]) / 2.0, - bounds[2] - thickness / 2.0 + shift_y, - (bounds[5] + bounds[4]) / 2.0) - x_length = bounds[1] - bounds[0] + (d_xyz[0] * expansion_factor) - z_length = bounds[5] - bounds[4] + (d_xyz[2] * expansion_factor) - plane = vtkCubeSource() - plane.SetCenter(center) - plane.SetXLength(x_length) - plane.SetYLength(thickness) - plane.SetZLength(z_length) - - plane_mapper = vtkPolyDataMapper() - plane_mapper.SetInputConnection(plane.GetOutputPort()) - - tile_actor = vtkActor() - tile_actor.SetMapper(plane_mapper) - - return tile_actor - - -def get_text_property(): - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('Black')) - return pty - - -def get_label_property(): - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.ShadowOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('DeepPink')) - return pty - - -def get_back_face_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('LightSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('OrangeRed')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.2) - pty.SetDiffuse(1.0) - pty.SetAmbient(0.2) - pty.SetSpecularPower(20.0) - pty.SetOpacity(1.0) - return pty - - -def get_actor_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('DarkSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('Seashell')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(0.9) - pty.EdgeVisibilityOn() - pty.SetLineWidth(3) - return pty - - -def get_point_actor_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('Gold')) - pty.SetDiffuseColor(colors.GetColor3d('Yellow')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(1.0) - return pty - - -def get_tile_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('SteelBlue')) - pty.SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(0.8) - pty.EdgeVisibilityOn() - pty.SetLineWidth(1) - return pty - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Line.md b/data/examples/GeometricObjects/Line.md deleted file mode 100644 index 6e4c502..0000000 --- a/data/examples/GeometricObjects/Line.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -The line is a primary one-dimensional cell. It is defined by two points. The direction along the line is from the first -point to the second point. diff --git a/data/examples/GeometricObjects/Line.py b/data/examples/GeometricObjects/Line.py deleted file mode 100755 index ed94b05..0000000 --- a/data/examples/GeometricObjects/Line.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Create two points, P0 and P1 - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] - - lineSource = vtkLineSource() - lineSource.SetPoint1(p0) - lineSource.SetPoint2(p1) - - # Visualize - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(lineSource.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - actor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Line") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.SetBackground(colors.GetColor3d("Silver")) - renderer.AddActor(actor) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/LinearCellsDemo.md b/data/examples/GeometricObjects/LinearCellsDemo.md deleted file mode 100644 index e282861..0000000 --- a/data/examples/GeometricObjects/LinearCellsDemo.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -Linear cell types found in VTK. - -The numbers define the ordering of the defining points. - -Options are provided to show a wire frame (`-w`) or to add a back face color (`-b`). You can also remove the plinth with the (`-n`) option. -If you want a single object, use `-o` followed by the object number. - -With the back face option selected, the back face color will be visible as the objects are semitransparent. diff --git a/data/examples/GeometricObjects/LinearCellsDemo.py b/data/examples/GeometricObjects/LinearCellsDemo.py deleted file mode 100755 index a952599..0000000 --- a/data/examples/GeometricObjects/LinearCellsDemo.py +++ /dev/null @@ -1,916 +0,0 @@ -# !/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints, - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - VTK_TETRA, - vtkCellArray, - vtkHexagonalPrism, - vtkHexahedron, - vtkLine, - vtkPentagonalPrism, - vtkPixel, - vtkPolyLine, - vtkPolyVertex, - vtkPolygon, - vtkPyramid, - vtkQuad, - vtkTetra, - vtkTriangle, - vtkTriangleStrip, - vtkUnstructuredGrid, - vtkVertex, - vtkVoxel, - vtkWedge -) -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkGlyph3DMapper, - vtkLightKit, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) -from vtkmodules.vtkRenderingLabel import vtkLabeledDataMapper - - -def get_program_parameters(): - import argparse - description = 'Demonstrate the linear cell types found in VTK.' - epilogue = ''' - The numbers define the ordering of the points making the cell. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - group1 = parser.add_mutually_exclusive_group() - group1.add_argument('-w', '--wireframe', action='store_true', - help='Render a wireframe.') - group1.add_argument('-b', '--backface', action='store_true', - help='Display the back face in a different colour.') - - parser.add_argument('-o', '--object_number', type=int, default=None, - help='The number corresponding to the object.') - parser.add_argument('-n', '--no_plinth', action='store_true', - help='Remove the plinth.') - args = parser.parse_args() - return args.wireframe, args.backface, args.object_number, args.no_plinth - - -def main(): - wireframe_on, backface_on, object_num, plinth_off = get_program_parameters() - - objects = specify_objects() - # The order here should match the order in specify_objects(). - object_order = list(objects.keys()) - - # Check for a single object. - single_object = None - if object_num: - if object_num in object_order: - single_object = True - else: - print('Object not found.\nPlease enter the number corresponding to the object.') - print('Available objects are:') - for obj in object_order: - print(f'{objects[obj]} (={str(obj)})') - return - - colors = vtkNamedColors() - - # Create one sphere for all. - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) - sphere.SetRadius(0.04) - - cells = get_unstructured_grids() - # The text to be displayed in the viewport. - names = list() - # The keys of the objects selected for display. - keys = list() - if single_object: - names.append(f'{objects[object_num]} (={str(object_num)})') - keys.append(object_num) - else: - for obj in object_order: - names.append(f'{objects[obj]} (={str(obj)})') - keys.append(obj) - - add_plinth = (10, 11, 12, 13, 14, 15, 16,) - lines = (3, 4) - - # Set up the viewports. - grid_column_dimensions = 4 - grid_row_dimensions = 4 - renderer_size = 300 - if single_object: - grid_column_dimensions = 1 - grid_row_dimensions = 1 - renderer_size = 1200 - window_size = (grid_column_dimensions * renderer_size, grid_row_dimensions * renderer_size) - - viewports = dict() - blank = len(cells) - blank_viewports = list() - - for row in range(0, grid_row_dimensions): - if row == grid_row_dimensions - 1: - last_row = True - for col in range(0, grid_column_dimensions): - if col == grid_column_dimensions - 1: - last_col = True - index = row * grid_column_dimensions + col - # Set the renderer's viewport dimensions (xmin, ymin, xmax, ymax) within the render window. - # Note that for the Y values, we need to subtract the row index from grid_rows - # because the viewport Y axis points upwards, and we want to draw the grid from top to down. - viewport = (float(col) / grid_column_dimensions, - float(grid_row_dimensions - (row + 1)) / grid_row_dimensions, - float(col + 1) / grid_column_dimensions, - float(grid_row_dimensions - row) / grid_row_dimensions) - - if index < blank: - viewports[keys[index]] = viewport - else: - s = f'vp_{col:d}_{row:d}' - viewports[s] = viewport - blank_viewports.append(s) - - ren_win = vtkRenderWindow() - ren_win.SetSize(window_size) - ren_win.SetWindowName('LinearCellsDemo') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - # Since we always import vtkmodules.vtkInteractionStyle we can do this - # because vtkInteractorStyleSwitch is automatically imported: - iren.GetInteractorStyle().SetCurrentStyleToTrackballCamera() - - renderers = dict() - - # Create and link the mappers, actors and renderers together. - single_object_key = None - for idx, key in enumerate(keys): - print('Creating:', names[idx]) - - if single_object: - single_object_key = key - - text_property = get_text_property() - if single_object: - text_property.SetFontSize(renderer_size // 28) - else: - text_property.SetFontSize(renderer_size // 24) - - text_mapper = vtkTextMapper() - text_mapper.SetTextProperty(text_property) - text_mapper.SetInput(names[idx]) - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - - if wireframe_on or key in lines: - actor.GetProperty().SetRepresentationToWireframe() - actor.GetProperty().SetLineWidth(2) - actor.GetProperty().SetOpacity(1) - actor.GetProperty().SetColor(colors.GetColor3d('Black')) - else: - if backface_on: - actor.SetBackfaceProperty(get_back_face_property()) - - # Label the points. - label_property = get_label_property() - if single_object: - label_property.SetFontSize(renderer_size // 36) - else: - label_property.SetFontSize(renderer_size // 16) - - label_mapper = vtkLabeledDataMapper() - label_mapper.SetInputData(cells[key][0]) - label_mapper.SetLabelTextProperty(label_property) - - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) - point_mapper.SetSourceConnection(sphere.GetOutputPort()) - point_mapper.ScalingOn() - point_mapper.ScalarVisibilityOff() - - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.SetProperty(get_point_actor_property()) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('LightSteelBlue')) - renderer.SetViewport(viewports[key]) - - light_kit = vtkLightKit() - light_kit.AddLightsToRenderer(renderer) - - renderer.AddActor(text_actor) - renderer.AddActor(actor) - renderer.AddActor(label_actor) - renderer.AddActor(point_actor) - if not plinth_off: - # Add a plinth. - if key in add_plinth: - tile_actor = make_tile(cells[key][0].GetBounds(), - expansion_factor=0.5, thickness_ratio=0.01, shift_y=-0.05) - tile_actor.SetProperty(get_tile_property()) - renderer.AddActor(tile_actor) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(cells[key][1]) - renderer.GetActiveCamera().Elevation(cells[key][2]) - renderer.GetActiveCamera().Dolly(cells[key][3]) - renderer.ResetCameraClippingRange() - - renderers[key] = renderer - ren_win.AddRenderer(renderers[key]) - - for name in blank_viewports: - viewport = viewports[name] - renderer = vtkRenderer() - renderer.SetBackground = colors.GetColor3d('LightSteelBlue') - renderer.SetViewport(viewport) - - renderers[name] = renderer - ren_win.AddRenderer(renderers[name]) - - if single_object: - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderers[single_object_key]) - cam_orient_manipulator.SetInteractor(iren) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(iren) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - ren_win.Render() - iren.Initialize() - iren.Start() - - -def specify_objects(): - """ - Link the unstructured grid number to the unstructured grid name. - - :return: A dictionary: {index number: unstructured grid name}. - """ - return { - 1: 'VTK_VERTEX', - 2: 'VTK_POLY_VERTEX', - 3: 'VTK_LINE', - 4: 'VTK_POLY_LINE', - 5: 'VTK_TRIANGLE', - 6: 'VTK_TRIANGLE_STRIP', - 7: 'VTK_POLYGON', - 8: 'VTK_PIXEL', - 9: 'VTK_QUAD', - 10: 'VTK_TETRA', - 11: 'VTK_VOXEL', - 12: 'VTK_HEXAHEDRON', - 13: 'VTK_WEDGE', - 14: 'VTK_PYRAMID', - 15: 'VTK_PENTAGONAL_PRISM', - 16: 'VTK_HEXAGONAL_PRISM', - } - - -def get_unstructured_grids(): - """ - Get the unstructured grid names, the unstructured grid and initial orientations. - - :return: A dictionary: {index number: (unstructured grid, azimuth, elevation and dolly)}. - """ - return { - 1: (make_vertex(), 30, -30, 0.1), - 2: (make_poly_vertex(), 30, -30, 0.8), - 3: (make_line(), 30, -30, 0.4), - 4: (make_polyline(), 30, -30, 1.0), - 5: (make_triangle(), 30, -30, 0.7), - 6: (make_triangle_strip(), 30, -30, 1.1), - 7: (make_polygon(), 0, -45, 1.0), - 8: (make_pixel(), 0, -45, 1.0), - 9: (make_quad(), 0, -45, 1.0), - 10: (make_tetra(), 20, 20, 1.0), - 11: (make_voxel(), -22.5, 15, 0.95), - 12: (make_hexahedron(), -22.5, 15, 0.95), - 13: (make_wedge(), -30, 15, 1.0), - 14: (make_pyramid(), -60, 15, 1.0), - 15: (make_pentagonal_prism(), -60, 10, 1.0), - 16: (make_hexagonal_prism(), -60, 15, 1.0) - } - - -# These functions return an vtkUnstructured grid corresponding to the object. - -def make_vertex(): - # A vertex is a cell that represents a 3D point. - number_of_vertices = 1 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - - vertex = vtkVertex() - for i in range(0, number_of_vertices): - vertex.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(vertex.GetCellType(), vertex.GetPointIds()) - - return ug - - -def make_poly_vertex(): - # A polyvertex is a cell that represents a set of 0D vertices. - number_of_vertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, 0.4) - points.InsertNextPoint(0, 1, 0.6) - - poly_vertex = vtkPolyVertex() - poly_vertex.GetPointIds().SetNumberOfIds(number_of_vertices) - - for i in range(0, number_of_vertices): - poly_vertex.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(poly_vertex.GetCellType(), poly_vertex.GetPointIds()) - - return ug - - -def make_line(): - # A line is a cell that represents a 1D point. - number_of_vertices = 2 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0.5, 0.5, 0) - - line = vtkLine() - for i in range(0, number_of_vertices): - line.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(line.GetCellType(), line.GetPointIds()) - - return ug - - -def make_polyline(): - # A polyline is a cell that represents a set of 1D lines. - number_of_vertices = 5 - - points = vtkPoints() - points.InsertNextPoint(0, 0.5, 0) - points.InsertNextPoint(0.5, 0, 0) - points.InsertNextPoint(1, 0.3, 0) - points.InsertNextPoint(1.5, 0.4, 0) - points.InsertNextPoint(2.0, 0.4, 0) - - polyline = vtkPolyLine() - polyline.GetPointIds().SetNumberOfIds(number_of_vertices) - - for i in range(0, number_of_vertices): - polyline.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyline.GetCellType(), polyline.GetPointIds()) - - return ug - - -def make_triangle(): - # A triangle is a cell that represents a triangle. - number_of_vertices = 3 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0.5, 0.5, 0) - points.InsertNextPoint(.2, 1, 0) - - triangle = vtkTriangle() - for i in range(0, number_of_vertices): - triangle.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(triangle.GetCellType(), triangle.GetPointIds()) - - return ug - - -def make_triangle_strip(): - # A triangle strip is a cell that represents a triangle strip. - number_of_vertices = 10 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(0.5, 1, 0) - points.InsertNextPoint(2.0, -0.1, 0) - points.InsertNextPoint(1.5, 0.8, 0) - points.InsertNextPoint(3.0, 0, 0) - points.InsertNextPoint(2.5, 0.9, 0) - points.InsertNextPoint(4.0, -0.2, 0) - points.InsertNextPoint(3.5, 0.8, 0) - points.InsertNextPoint(4.5, 1.1, 0) - - triangle_strip = vtkTriangleStrip() - triangle_strip.GetPointIds().SetNumberOfIds(number_of_vertices) - for i in range(0, number_of_vertices): - triangle_strip.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(triangle_strip.GetCellType(), triangle_strip.GetPointIds()) - - return ug - - -def make_polygon(): - # A polygon is a cell that represents a polygon. - number_of_vertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, -0.1, 0) - points.InsertNextPoint(0.8, 0.5, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0.6, 1.2, 0) - points.InsertNextPoint(0, 0.8, 0) - - polygon = vtkPolygon() - polygon.GetPointIds().SetNumberOfIds(number_of_vertices) - for i in range(0, number_of_vertices): - polygon.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polygon.GetCellType(), polygon.GetPointIds()) - - return ug - - -def make_pixel(): - # A pixel is a cell that represents a pixel - number_of_vertices = 4 - - pixel = vtkPixel() - pixel.GetPoints().SetPoint(0, 0, 0, 0) - pixel.GetPoints().SetPoint(1, 1, 0, 0) - pixel.GetPoints().SetPoint(2, 0, 1, 0) - pixel.GetPoints().SetPoint(3, 1, 1, 0) - - for i in range(0, number_of_vertices): - pixel.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(pixel.GetPoints()) - ug.InsertNextCell(pixel.GetCellType(), pixel.GetPointIds()) - - return ug - - -def make_quad(): - # A quad is a cell that represents a quad - number_of_vertices = 4 - - quad = vtkQuad() - quad.GetPoints().SetPoint(0, 0, 0, 0) - quad.GetPoints().SetPoint(1, 1, 0, 0) - quad.GetPoints().SetPoint(2, 1, 1, 0) - quad.GetPoints().SetPoint(3, 0, 1, 0) - - for i in range(0, number_of_vertices): - quad.point_ids.SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(quad.GetPoints()) - ug.InsertNextCell(quad.GetCellType(), quad.GetPointIds()) - - return ug - - -def make_tetra(): - # Make a tetrahedron. - number_of_vertices = 4 - - points = vtkPoints() - # points.InsertNextPoint(0, 0, 0) - # points.InsertNextPoint(1, 0, 0) - # points.InsertNextPoint(1, 1, 0) - # points.InsertNextPoint(0, 1, 1) - - # Rotate the above points -90° about the X-axis. - points.InsertNextPoint((0.0, 0.0, 0.0)) - points.InsertNextPoint((1.0, 0.0, 0.0)) - points.InsertNextPoint((1.0, 0.0, -1.0)) - points.InsertNextPoint((0.0, 1.0, -1.0)) - - tetra = vtkTetra() - for i in range(0, number_of_vertices): - tetra.GetPointIds().SetId(i, i) - - cell_array = vtkCellArray() - cell_array.InsertNextCell(tetra) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.SetCells(VTK_TETRA, cell_array) - - return ug - - -def make_voxel(): - # A voxel is a representation of a regular grid in 3-D space. - number_of_vertices = 8 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, 1) - points.InsertNextPoint(0, 1, 1) - points.InsertNextPoint(1, 1, 1) - - voxel = vtkVoxel() - for i in range(0, number_of_vertices): - voxel.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(voxel.GetCellType(), voxel.GetPointIds()) - - return ug - - -def make_hexahedron(): - """ - A regular hexagon (cube) with all faces square and three squares - around each vertex is created below. - - Set up the coordinates of eight points, (the two faces must be - in counter-clockwise order as viewed from the outside). - - :return: - """ - - number_of_vertices = 8 - - # Create the points. - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, 1) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(0, 1, 1) - - # Create a hexahedron from the points. - hexahedron = vtkHexahedron() - for i in range(0, number_of_vertices): - hexahedron.GetPointIds().SetId(i, i) - - # Add the points and hexahedron to an unstructured grid - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(hexahedron.GetCellType(), hexahedron.GetPointIds()) - - return ug - - -def make_wedge(): - # A wedge consists of two triangular ends and three rectangular faces. - - number_of_vertices = 6 - - points = vtkPoints() - - # points.InsertNextPoint(0, 1, 0) - # points.InsertNextPoint(0, 0, 0) - # points.InsertNextPoint(0, 0.5, 0.5) - # points.InsertNextPoint(1, 1, 0) - # points.InsertNextPoint(1, 0.0, 0.0) - # points.InsertNextPoint(1, 0.5, 0.5) - - # Rotate the above points -90° about the X-axis - # and translate -1 along the Y-axis. - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 0, 1.0) - points.InsertNextPoint(0.0, 0.5, 0.5) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0, 1.0) - points.InsertNextPoint(1.0, 0.5, 0.5) - - wedge = vtkWedge() - for i in range(0, number_of_vertices): - wedge.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(wedge.GetCellType(), wedge.GetPointIds()) - - return ug - - -def make_pyramid(): - # Make a regular square pyramid. - number_of_vertices = 5 - - points = vtkPoints() - - # p0 = [1.0, 1.0, 0.0] - # p1 = [-1.0, 1.0, 0.0] - # p2 = [-1.0, -1.0, 0.0] - # p3 = [1.0, -1.0, 0.0] - # p4 = [0.0, 0.0, 1.0] - - # Rotate the above points -90° about the X-axis. - p0 = (1.0, 0, -1.0) - p1 = (-1.0, 0, -1.0) - p2 = (-1.0, 0, 1.0) - p3 = (1.0, 0, 1.0) - p4 = (0.0, 2.0, 0) - - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - points.InsertNextPoint(p4) - - pyramid = vtkPyramid() - for i in range(0, number_of_vertices): - pyramid.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(pyramid.GetCellType(), pyramid.GetPointIds()) - - return ug - - -def make_pentagonal_prism(): - number_of_vertices = 10 - - pentagonal_prism = vtkPentagonalPrism() - - scale = 2.0 - pentagonal_prism.GetPoints().SetPoint(0, 11 / scale, 10 / scale, 10 / scale) - pentagonal_prism.GetPoints().SetPoint(1, 13 / scale, 10 / scale, 10 / scale) - pentagonal_prism.GetPoints().SetPoint(2, 14 / scale, 12 / scale, 10 / scale) - pentagonal_prism.GetPoints().SetPoint(3, 12 / scale, 14 / scale, 10 / scale) - pentagonal_prism.GetPoints().SetPoint(4, 10 / scale, 12 / scale, 10 / scale) - pentagonal_prism.GetPoints().SetPoint(5, 11 / scale, 10 / scale, 14 / scale) - pentagonal_prism.GetPoints().SetPoint(6, 13 / scale, 10 / scale, 14 / scale) - pentagonal_prism.GetPoints().SetPoint(7, 14 / scale, 12 / scale, 14 / scale) - pentagonal_prism.GetPoints().SetPoint(8, 12 / scale, 14 / scale, 14 / scale) - pentagonal_prism.GetPoints().SetPoint(9, 10 / scale, 12 / scale, 14 / scale) - - for i in range(0, number_of_vertices): - pentagonal_prism.point_ids.SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(pentagonal_prism.GetPoints()) - ug.InsertNextCell(pentagonal_prism.GetCellType(), pentagonal_prism.GetPointIds()) - - return ug - - -def make_hexagonal_prism(): - number_of_vertices = 12 - - hexagonal_prism = vtkHexagonalPrism() - - scale = 2.0 - hexagonal_prism.GetPoints().SetPoint(0, 11 / scale, 10 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(1, 13 / scale, 10 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(2, 14 / scale, 12 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(3, 13 / scale, 14 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(4, 11 / scale, 14 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(5, 10 / scale, 12 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(6, 11 / scale, 10 / scale, 14 / scale) - hexagonal_prism.GetPoints().SetPoint(7, 13 / scale, 10 / scale, 14 / scale) - hexagonal_prism.GetPoints().SetPoint(8, 14 / scale, 12 / scale, 14 / scale) - hexagonal_prism.GetPoints().SetPoint(9, 13 / scale, 14 / scale, 14 / scale) - hexagonal_prism.GetPoints().SetPoint(10, 11 / scale, 14 / scale, 14 / scale) - hexagonal_prism.GetPoints().SetPoint(11, 10 / scale, 12 / scale, 14 / scale) - - for i in range(0, number_of_vertices): - hexagonal_prism.point_ids.SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(hexagonal_prism.GetPoints()) - ug.InsertNextCell(hexagonal_prism.GetCellType(), hexagonal_prism.GetPointIds()) - - return ug - - -def make_tile(bounds, expansion_factor=0.5, thickness_ratio=0.05, shift_y=-0.05): - """ - Make a tile slightly larger or smaller than the bounds in the - X and Z directions and thinner or thicker in the Y direction. - - A thickness_ratio of zero reduces the tile to an XZ plane. - - :param bounds: The bounds for the tile. - :param expansion_factor: The expansion factor in the XZ plane. - :param thickness_ratio: The thickness ratio in the Y direction, >= 0. - :param shift_y: Used to shift the centre of the plinth in the Y-direction. - :return: An actor corresponding to the tile. - """ - - d_xyz = ( - bounds[1] - bounds[0], - bounds[3] - bounds[2], - bounds[5] - bounds[4] - ) - thickness = d_xyz[2] * abs(thickness_ratio) - center = ((bounds[1] + bounds[0]) / 2.0, - bounds[2] - thickness / 2.0 + shift_y, - (bounds[5] + bounds[4]) / 2.0) - x_length = bounds[1] - bounds[0] + (d_xyz[0] * expansion_factor) - z_length = bounds[5] - bounds[4] + (d_xyz[2] * expansion_factor) - plane = vtkCubeSource() - plane.SetCenter(center) - plane.SetXLength(x_length) - plane.SetYLength(thickness) - plane.SetZLength(z_length) - - plane_mapper = vtkPolyDataMapper() - plane_mapper.SetInputConnection(plane.GetOutputPort()) - - tile_actor = vtkActor() - tile_actor.SetMapper(plane_mapper) - - return tile_actor - - -def get_text_property(): - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('Black')) - return pty - - -def get_label_property(): - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.ShadowOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('DeepPink')) - return pty - - -def get_back_face_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('LightSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('OrangeRed')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.2) - pty.SetDiffuse(1.0) - pty.SetAmbient(0.2) - pty.SetSpecularPower(20.0) - pty.SetOpacity(1.0) - return pty - - -def get_actor_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('DarkSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('Seashell')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(0.8) - pty.EdgeVisibilityOn() - pty.SetLineWidth(3) - return pty - - -def get_point_actor_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('Gold')) - pty.SetDiffuseColor(colors.GetColor3d('Yellow')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(1.0) - return pty - - -def get_tile_property(): - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('SteelBlue')) - pty.SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - pty.SetSpecularColor(colors.GetColor3d('White')) - pty.SetSpecular(0.5) - pty.SetDiffuse(0.7) - pty.SetAmbient(0.5) - pty.SetSpecularPower(20.0) - pty.SetOpacity(0.8) - pty.EdgeVisibilityOn() - pty.SetLineWidth(1) - return pty - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/LongLine.md b/data/examples/GeometricObjects/LongLine.md deleted file mode 100644 index 453afea..0000000 --- a/data/examples/GeometricObjects/LongLine.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Connect several points with a line. - -!!! seealso - [ColoredLines](../ColoredLines). diff --git a/data/examples/GeometricObjects/LongLine.py b/data/examples/GeometricObjects/LongLine.py deleted file mode 100755 index 67f28d4..0000000 --- a/data/examples/GeometricObjects/LongLine.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Create five points. - origin = [0.0, 0.0, 0.0] - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] - p2 = [0.0, 1.0, 2.0] - p3 = [1.0, 2.0, 3.0] - - # Create a vtkPoints object and store the points in it - points = vtkPoints() - points.InsertNextPoint(origin) - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - - # Create a cell array to store the lines in and add the lines to it - lines = vtkCellArray() - - for i in range(0, 3): - line = vtkLine() - line.GetPointIds().SetId(0, i) - line.GetPointIds().SetId(1, i + 1) - lines.InsertNextCell(line) - - # Create a polydata to store everything in - linesPolyData = vtkPolyData() - - # Add the points to the dataset - linesPolyData.SetPoints(points) - - # Add the lines to the dataset - linesPolyData.SetLines(lines) - - # Setup actor and mapper - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(linesPolyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - actor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('LongLine') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - renderer.AddActor(actor) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - renderer.SetBackground(colors.GetColor3d('Silver')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/OrientedArrow.md b/data/examples/GeometricObjects/OrientedArrow.md deleted file mode 100644 index fc76954..0000000 --- a/data/examples/GeometricObjects/OrientedArrow.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description - -This example illustrates how to create and display an arrow that passes through two points. - -It demonstrates two different ways to apply the transform: - -1. Use vtkTransformPolyDataFilter to create a new transformed polydata. This method is useful if the transformed - polydata is needed later in the pipeline, e.g. vtkGlyph3DFilter. - -2. Apply the transform directly to the actor using vtkProp3D's SetUserMatrix. No new data is produced. - -Switch between the two methods by #defining USER_MATRIX or leaving out the #define. - -!!! seealso - Compare this example with [OrientedCylinder](../OrientedCylinder). The transform is different because the cylinder -height direction is along the y-axis and the arrow height is along the x axis. diff --git a/data/examples/GeometricObjects/OrientedArrow.py b/data/examples/GeometricObjects/OrientedArrow.py deleted file mode 100755 index f80b50a..0000000 --- a/data/examples/GeometricObjects/OrientedArrow.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMath, - vtkMinimalStandardRandomSequence -) -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -""" -There are two alternative ways to apply the transform. - 1) Use vtkTransformPolyDataFilter to create a new transformed polydata. - This method is useful if the transformed polydata is needed - later in the pipeline - To do this, set USER_MATRIX = True - 2) Apply the transform directly to the actor using vtkProp3D's SetUserMatrix. - No new data is produced. - To do this, set USER_MATRIX = False -""" -USER_MATRIX = True - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create an arrow. - arrowSource = vtkArrowSource() - - # Generate a random start and end point - startPoint = [0] * 3 - endPoint = [0] * 3 - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) # For testing. - for i in range(0, 3): - rng.Next() - startPoint[i] = rng.GetRangeValue(-10, 10) - rng.Next() - endPoint[i] = rng.GetRangeValue(-10, 10) - - # Compute a basis - normalizedX = [0] * 3 - normalizedY = [0] * 3 - normalizedZ = [0] * 3 - - # The X axis is a vector from start to end - vtkMath.Subtract(endPoint, startPoint, normalizedX) - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - # The Z axis is an arbitrary vector cross X - arbitrary = [0] * 3 - for i in range(0, 3): - rng.Next() - arbitrary[i] = rng.GetRangeValue(-10, 10) - vtkMath.Cross(normalizedX, arbitrary, normalizedZ) - vtkMath.Normalize(normalizedZ) - - # The Y axis is Z cross X - vtkMath.Cross(normalizedZ, normalizedX, normalizedY) - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) - matrix.SetElement(i, 1, normalizedY[i]) - matrix.SetElement(i, 2, normalizedZ[i]) - - # Apply the transforms - transform = vtkTransform() - transform.Translate(startPoint) - transform.Concatenate(matrix) - transform.Scale(length, length, length) - - # Transform the polydata - transformPD = vtkTransformPolyDataFilter() - transformPD.SetTransform(transform) - transformPD.SetInputConnection(arrowSource.GetOutputPort()) - - # Create a mapper and actor for the arrow - mapper = vtkPolyDataMapper() - actor = vtkActor() - if USER_MATRIX: - mapper.SetInputConnection(arrowSource.GetOutputPort()) - actor.SetUserMatrix(transform.GetMatrix()) - else: - mapper.SetInputConnection(transformPD.GetOutputPort()) - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Cyan')) - - # Create spheres for start and end point - sphereStartSource = vtkSphereSource() - sphereStartSource.SetCenter(startPoint) - sphereStartSource.SetRadius(0.8) - sphereStartMapper = vtkPolyDataMapper() - sphereStartMapper.SetInputConnection(sphereStartSource.GetOutputPort()) - sphereStart = vtkActor() - sphereStart.SetMapper(sphereStartMapper) - sphereStart.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - sphereEndSource = vtkSphereSource() - sphereEndSource.SetCenter(endPoint) - sphereEndSource.SetRadius(0.8) - sphereEndMapper = vtkPolyDataMapper() - sphereEndMapper.SetInputConnection(sphereEndSource.GetOutputPort()) - sphereEnd = vtkActor() - sphereEnd.SetMapper(sphereEndMapper) - sphereEnd.GetProperty().SetColor(colors.GetColor3d('Magenta')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('OrientedArrow') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.AddActor(sphereStart) - renderer.AddActor(sphereEnd) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/OrientedCylinder.md b/data/examples/GeometricObjects/OrientedCylinder.md deleted file mode 100644 index 00a5646..0000000 --- a/data/examples/GeometricObjects/OrientedCylinder.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description - -This example illustrates how to create and display a cylinder that passes through two points. - -It demonstrates two different ways to apply the transform: - -1. Use vtkTransformPolyDataFilter to create a new transformed polydata. This method is useful if the transformed - polydata is needed later in the pipeline, e.g. vtkGlyph3DFilter. - -2. Apply the transform directly to the actor using vtkProp3D's SetUserMatrix. No new data is produced. - -Switch between the two methods by setting USER_MATRIX to **True** or **False**. - -!!! seealso - Compare this example with [OrientedArrow](../OrientedArrow). The transform is different because the cylinder height -direction is along the y-axis and the arrow height is along the x axis. diff --git a/data/examples/GeometricObjects/OrientedCylinder.py b/data/examples/GeometricObjects/OrientedCylinder.py deleted file mode 100755 index 007ae93..0000000 --- a/data/examples/GeometricObjects/OrientedCylinder.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMath, - vtkMinimalStandardRandomSequence -) -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import ( - vtkCylinderSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -""" -There are two alternative ways to apply the transform. - 1) Use vtkTransformPolyDataFilter to create a new transformed polydata. - This method is useful if the transformed polydata is needed - later in the pipeline - To do this, set USER_MATRIX = True - 2) Apply the transform directly to the actor using vtkProp3D's SetUserMatrix. - No new data is produced. - To do this, set USER_MATRIX = False -""" -USER_MATRIX = True - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create a cylinder. - # Cylinder height vector is (0,1,0). - # Cylinder center is in the middle of the cylinder - cylinderSource = vtkCylinderSource() - cylinderSource.SetResolution(15) - - # Generate a random start and end point - startPoint = [0] * 3 - endPoint = [0] * 3 - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) # For testing. - for i in range(0, 3): - rng.Next() - startPoint[i] = rng.GetRangeValue(-10, 10) - rng.Next() - endPoint[i] = rng.GetRangeValue(-10, 10) - - # Compute a basis - normalizedX = [0] * 3 - normalizedY = [0] * 3 - normalizedZ = [0] * 3 - - # The X axis is a vector from start to end - vtkMath.Subtract(endPoint, startPoint, normalizedX) - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - # The Z axis is an arbitrary vector cross X - arbitrary = [0] * 3 - for i in range(0, 3): - rng.Next() - arbitrary[i] = rng.GetRangeValue(-10, 10) - vtkMath.Cross(normalizedX, arbitrary, normalizedZ) - vtkMath.Normalize(normalizedZ) - - # The Y axis is Z cross X - vtkMath.Cross(normalizedZ, normalizedX, normalizedY) - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) - matrix.SetElement(i, 1, normalizedY[i]) - matrix.SetElement(i, 2, normalizedZ[i]) - - # Apply the transforms - transform = vtkTransform() - transform.Translate(startPoint) # translate to starting point - transform.Concatenate(matrix) # apply direction cosines - transform.RotateZ(-90.0) # align cylinder to x axis - transform.Scale(1.0, length, 1.0) # scale along the height vector - transform.Translate(0, .5, 0) # translate to start of cylinder - - # Transform the polydata - transformPD = vtkTransformPolyDataFilter() - transformPD.SetTransform(transform) - transformPD.SetInputConnection(cylinderSource.GetOutputPort()) - - # Create a mapper and actor for the arrow - mapper = vtkPolyDataMapper() - actor = vtkActor() - if USER_MATRIX: - mapper.SetInputConnection(cylinderSource.GetOutputPort()) - actor.SetUserMatrix(transform.GetMatrix()) - else: - mapper.SetInputConnection(transformPD.GetOutputPort()) - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Cyan')) - - # Create spheres for start and end point - sphereStartSource = vtkSphereSource() - sphereStartSource.SetCenter(startPoint) - sphereStartSource.SetRadius(0.8) - sphereStartMapper = vtkPolyDataMapper() - sphereStartMapper.SetInputConnection(sphereStartSource.GetOutputPort()) - sphereStart = vtkActor() - sphereStart.SetMapper(sphereStartMapper) - sphereStart.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - sphereEndSource = vtkSphereSource() - sphereEndSource.SetCenter(endPoint) - sphereEndSource.SetRadius(0.8) - sphereEndMapper = vtkPolyDataMapper() - sphereEndMapper.SetInputConnection(sphereEndSource.GetOutputPort()) - sphereEnd = vtkActor() - sphereEnd.SetMapper(sphereEndMapper) - sphereEnd.GetProperty().SetColor(colors.GetColor3d('Magenta')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('Oriented Cylinder') - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.AddActor(sphereStart) - renderer.AddActor(sphereEnd) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ParametricKuenDemo.md b/data/examples/GeometricObjects/ParametricKuenDemo.md deleted file mode 100644 index 33254e8..0000000 --- a/data/examples/GeometricObjects/ParametricKuenDemo.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -The example shows interaction with the vtkParametricKuen vtkParametricFunctionSource. -The [Kuen Surface](http://mathworld.wolfram.com/KuenSurface.html) This surface of constant Gaussian curvature K = -1 was -discovered early. It is very popular because of its beauty. - -Here's the embedded video: -
- diff --git a/data/examples/GeometricObjects/ParametricKuenDemo.py b/data/examples/GeometricObjects/ParametricKuenDemo.py deleted file mode 100755 index 04ee871..0000000 --- a/data/examples/GeometricObjects/ParametricKuenDemo.py +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import vtkParametricKuen -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkMath -) -from vtkmodules.vtkFiltersSources import vtkParametricFunctionSource -from vtkmodules.vtkInteractionWidgets import ( - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricKuen() - source = vtkParametricFunctionSource() - - renderer = vtkRenderer() - mapper = vtkPolyDataMapper() - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor - source.SetParametricFunction(surface) - - mapper.SetInputConnection(source.GetOutputPort()) - - actor.SetMapper(mapper) - actor.SetBackfaceProperty(backProperty) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('ParametricKuenDemo') - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Setup a slider widget for each varying parameter - tubeWidth = 0.008 - sliderLength = 0.008 - titleHeight = 0.02 - labelHeight = 0.02 - - sliderRepMinimumU = vtkSliderRepresentation2D() - - sliderRepMinimumU.SetMinimumValue(-4.5) - sliderRepMinimumU.SetMaximumValue(4.5) - sliderRepMinimumU.SetValue(-4.5) - sliderRepMinimumU.SetTitleText('U min') - - sliderRepMinimumU.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumU.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepMinimumU.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumU.GetPoint2Coordinate().SetValue(.9, .1) - - sliderRepMinimumU.SetTubeWidth(tubeWidth) - sliderRepMinimumU.SetSliderLength(sliderLength) - sliderRepMinimumU.SetTitleHeight(titleHeight) - sliderRepMinimumU.SetLabelHeight(labelHeight) - - sliderWidgetMinimumU = vtkSliderWidget() - sliderWidgetMinimumU.SetInteractor(interactor) - sliderWidgetMinimumU.SetRepresentation(sliderRepMinimumU) - sliderWidgetMinimumU.SetAnimationModeToAnimate() - sliderWidgetMinimumU.EnabledOn() - - sliderWidgetMinimumU.AddObserver('InteractionEvent', SliderCallbackMinimumU(surface)) - - sliderRepMaximumU = vtkSliderRepresentation2D() - - sliderRepMaximumU.SetMinimumValue(-4.5) - sliderRepMaximumU.SetMaximumValue(4.5) - sliderRepMaximumU.SetValue(4.5) - sliderRepMaximumU.SetTitleText('U max') - - sliderRepMaximumU.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMaximumU.GetPoint1Coordinate().SetValue(.1, .9) - sliderRepMaximumU.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMaximumU.GetPoint2Coordinate().SetValue(.9, .9) - - sliderRepMaximumU.SetTubeWidth(tubeWidth) - sliderRepMaximumU.SetSliderLength(sliderLength) - sliderRepMaximumU.SetTitleHeight(titleHeight) - sliderRepMaximumU.SetLabelHeight(labelHeight) - - sliderWidgetMaximumU = vtkSliderWidget() - sliderWidgetMaximumU.SetInteractor(interactor) - sliderWidgetMaximumU.SetRepresentation(sliderRepMaximumU) - sliderWidgetMaximumU.SetAnimationModeToAnimate() - sliderWidgetMaximumU.EnabledOn() - - sliderWidgetMaximumU.AddObserver('InteractionEvent', SliderCallbackMaximumU(surface)) - - sliderRepMinimumV = vtkSliderRepresentation2D() - - sliderRepMinimumV.SetMinimumValue(0.05) - sliderRepMinimumV.SetMaximumValue(vtkMath.Pi()) - sliderRepMinimumV.SetValue(0.0) - sliderRepMinimumV.SetTitleText('V min') - - sliderRepMinimumV.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepMinimumV.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint2Coordinate().SetValue(.1, .9) - - sliderRepMinimumV.SetTubeWidth(tubeWidth) - sliderRepMinimumV.SetSliderLength(sliderLength) - sliderRepMinimumV.SetTitleHeight(titleHeight) - sliderRepMinimumV.SetLabelHeight(labelHeight) - - sliderWidgetMinimumV = vtkSliderWidget() - sliderWidgetMinimumV.SetInteractor(interactor) - sliderWidgetMinimumV.SetRepresentation(sliderRepMinimumV) - sliderWidgetMinimumV.SetAnimationModeToAnimate() - sliderWidgetMinimumV.EnabledOn() - - sliderWidgetMinimumV.AddObserver(vtkCommand.InteractionEvent, SliderCallbackMinimumV(surface)) - - sliderRepMaximumV = vtkSliderRepresentation2D() - - sliderRepMaximumV.SetMinimumValue(0.05) - sliderRepMaximumV.SetMaximumValue(vtkMath.Pi() - .05) - sliderRepMaximumV.SetValue(vtkMath.Pi()) - sliderRepMaximumV.SetTitleText('V max') - - sliderRepMaximumV.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMaximumV.GetPoint1Coordinate().SetValue(.9, .1) - sliderRepMaximumV.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMaximumV.GetPoint2Coordinate().SetValue(.9, .9) - sliderRepMaximumV.SetTubeWidth(tubeWidth) - sliderRepMaximumV.SetSliderLength(sliderLength) - sliderRepMaximumV.SetTitleHeight(titleHeight) - sliderRepMaximumV.SetLabelHeight(labelHeight) - - sliderWidgetMaximumV = vtkSliderWidget() - sliderWidgetMaximumV.SetInteractor(interactor) - sliderWidgetMaximumV.SetRepresentation(sliderRepMaximumV) - sliderWidgetMaximumV.SetAnimationModeToAnimate() - sliderWidgetMaximumV.EnabledOn() - - sliderWidgetMaximumV.AddObserver(vtkCommand.InteractionEvent, SliderCallbackMaximumV(surface)) - - surface.SetMinimumU(-4.5) - surface.SetMaximumU(4.5) - surface.SetMinimumV(0.05) - surface.SetMaximumV(vtkMath.Pi() - .05) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - renderWindow.Render() - - interactor.Initialize() - - interactor.Start() - - -# These callbacks do the actual work. -# Callbacks for the interactions -class SliderCallbackMinimumU(): - def __init__(self, kuen): - self.kuen = kuen - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - if value > 0.9 * self.kuen.GetMaximumU(): - value = 0.99 * self.kuen.GetMaximumU() - sliderWidget.GetRepresentation().SetValue(value) - self.kuen.SetMinimumU(value) - - -class SliderCallbackMaximumU(): - def __init__(self, kuen): - self.kuen = kuen - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - if value < self.kuen.GetMinimumU() + .01: - value = self.kuen.GetMinimumU() + .01 - sliderWidget.GetRepresentation().SetValue(value) - self.kuen.SetMaximumU(value) - - -class SliderCallbackMinimumV(): - def __init__(self, kuen): - self.kuen = kuen - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - if value > 0.9 * self.kuen.GetMaximumV(): - value = 0.99 * self.kuen.GetMaximumV() - sliderWidget.GetRepresentation().SetValue(value) - self.kuen.SetMinimumV(value) - - -class SliderCallbackMaximumV(): - def __init__(self, kuen): - self.kuen = kuen - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - if value < self.kuen.GetMinimumV() + .01: - value = self.kuen.GetMinimumV() + .01 - sliderWidget.GetRepresentation().SetValue(value) - self.kuen.SetMaximumV(value) - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ParametricObjectsDemo.md b/data/examples/GeometricObjects/ParametricObjectsDemo.md deleted file mode 100644 index 1c8bc7d..0000000 --- a/data/examples/GeometricObjects/ParametricObjectsDemo.md +++ /dev/null @@ -1,29 +0,0 @@ -### Description - -Demonstrates the Parametric classes added by Andrew Maclean and additional classes added by Tim Meehan. The parametric spline is also included. - -Options are provided to: - -- Specify a single surface (**-s SURFACE_NAME**) -- Color the back-face (**-b**) -- Add normals (**-n**) -- Display the geometric bounds of the object (**-l**) - -You can save a screenshot by pressing "k". - -With respect to your VTK build you may need to specify one or more of: - -```bash --DVTK_MODULE_ENABLE_VTK_cli11=WANT --DVTK_MODULE_ENABLE_VTK_fmt=WANT -``` - -If `-DVTK_BUILD_TESTING=ON` is specified when building VTK then `VTK:cli11` and `VTK::fmt` will be automatically enabled. - -!!! Note - To really appreciate the complexity of some of these surfaces, select a single surface, and use the options `-b -n`. Also try specifying wireframe (toggle "w" on the keyboard) and zooming in and out. -!!! Tip - If you color the back face, the three-dimensional orientable surfaces will only show backface coloring inside the surface e.g `ConicSpiral` or `Torus`. For three dimensional non-orientable surfaces; backface coloring is visible because of the twisting used to generate these surfaces e.g `Boy` or `Figure8Klein`. - -!!! Cite - See: [Parametric Equations for Surfaces](http://www.vtk.org/wp-content/uploads/2015/11/ParametricSurfaces.pdf), for more information. This paper provides a description of fifteen surfaces, including their parametric equations and derivatives. Also provided is an example of how to create your own surface, namely the Figure-8 Torus. diff --git a/data/examples/GeometricObjects/ParametricObjectsDemo.py b/data/examples/GeometricObjects/ParametricObjectsDemo.py deleted file mode 100755 index 43be06b..0000000 --- a/data/examples/GeometricObjects/ParametricObjectsDemo.py +++ /dev/null @@ -1,416 +0,0 @@ -#!/usr/bin/env python3 - -""" - Demonstrate all the parametric objects. -""" - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBohemianDome, - vtkParametricBour, - vtkParametricBoy, - vtkParametricCatalanMinimal, - vtkParametricConicSpiral, - vtkParametricCrossCap, - vtkParametricDini, - vtkParametricEllipsoid, - vtkParametricEnneper, - vtkParametricFigure8Klein, - vtkParametricHenneberg, - vtkParametricKlein, - vtkParametricKuen, - vtkParametricMobius, - vtkParametricPluckerConoid, - vtkParametricPseudosphere, - vtkParametricRandomHills, - vtkParametricRoman, - vtkParametricSpline, - vtkParametricSuperEllipsoid, - vtkParametricSuperToroid, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkFiltersCore import ( - vtkGlyph3D, - vtkMaskPoints -) -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkParametricFunctionSource -) -from vtkmodules.vtkIOImage import ( - vtkPNGWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty, - vtkWindowToImageFilter -) - - -def get_program_parameters(): - import argparse - description = 'Display the parametric surfaces.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-s', '--surface_name', default=None, help='The name of the surface.') - parser.add_argument('-b', '--back_face', action='store_true', help='Color the back face.') - parser.add_argument('-n', '--normals', action='store_true', help='Display normals.') - parser.add_argument('-l', '--limits', action='store_true', help='Display the geometric bounds of the object..') - args = parser.parse_args() - return args.surface_name, args.back_face, args.normals, args.limits - - -def main(): - surface_name, back_face, normals, limits = get_program_parameters() - - # Get the parametric functions and build the pipeline - pfn = get_parametric_functions() - - # Check for a single surface. - single_surface = [None, False] - if surface_name: - sn = surface_name.lower() - for t in pfn.keys(): - if sn == t.lower(): - single_surface[0] = t - single_surface[1] = True - if surface_name and not single_surface[1]: - print('Nonexistent surface:', surface_name) - return - - if single_surface[1]: - renderer_size = 1000 - grid_column_dimensions = 1 - grid_row_dimensions = 1 - else: - renderer_size = 200 - grid_column_dimensions = 5 - grid_row_dimensions = 5 - - colors = vtkNamedColors() - - # Create one text property for all. - text_property = vtkTextProperty() - text_property.SetJustificationToCentered() - text_property.SetFontSize(int(renderer_size / 12)) - text_property.SetColor(colors.GetColor3d("LavenderBlush")) - - # Create a parametric function source, renderer, mapper, and actor - # for each object. - pfn_srcs = [] - renderers = [] - mappers = [] - actors = [] - text_mappers = [] - text_actors = [] - - # Glyph the normals. - mask_pts = [] - arrow = [] - glyph = [] - glyph_mapper = [] - glyph_actor = [] - - back_property = vtkProperty() - if back_face: - back_property.SetColor(colors.GetColor3d("Peru")) - - # Now decide on the surfaces to build. - surfaces = dict() - if single_surface[1]: - surfaces[single_surface[0]] = pfn[single_surface[0]] - else: - surfaces = pfn - - # The bounding boxes for each object. - bounding_boxes = dict() - indexed_names = dict() - # The index of each parametric object. - obj_idx = -1 - sorted_names = list() - for obj in sorted(surfaces.keys()): - obj_idx += 1 - indexed_names[obj_idx] = obj - pfn_srcs.append(vtkParametricFunctionSource()) - pfn_srcs[obj_idx].SetParametricFunction(surfaces[obj]) - pfn_srcs[obj_idx].SetUResolution(51) - pfn_srcs[obj_idx].SetVResolution(51) - pfn_srcs[obj_idx].SetWResolution(51) - pfn_srcs[obj_idx].Update() - - mappers.append(vtkPolyDataMapper()) - mappers[obj_idx].SetInputConnection(pfn_srcs[obj_idx].GetOutputPort()) - - actors.append(vtkActor()) - actors[obj_idx].SetMapper(mappers[obj_idx]) - actors[obj_idx].GetProperty().SetColor(colors.GetColor3d("NavajoWhite")) - if back_face: - actors[obj_idx].SetBackfaceProperty(back_property) - - text_mappers.append(vtkTextMapper()) - text_mappers[obj_idx].SetInput(obj) - text_mappers[obj_idx].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[obj_idx].SetMapper(text_mappers[obj_idx]) - text_actors[obj_idx].SetPosition(renderer_size / 2.0, 8) - - renderers.append(vtkRenderer()) - renderers[obj_idx].SetBackground(colors.GetColor3d("MidnightBlue")) - - bounds = pfn_srcs[obj_idx].GetOutput().GetBounds() - bounding_boxes[obj] = bounds - - if normals: - # Glyphing - mask_pts.append(vtkMaskPoints()) - mask_pts[obj_idx].RandomModeOn() - mask_pts[obj_idx].SetMaximumNumberOfPoints(150) - mask_pts[obj_idx].SetInputConnection(pfn_srcs[obj_idx].GetOutputPort()) - - arrow.append(vtkArrowSource()) - arrow[obj_idx].SetTipResolution(16) - arrow[obj_idx].SetTipLength(0.3) - arrow[obj_idx].SetTipRadius(0.1) - - glyph_scale = get_maximum_length(bounding_boxes[obj]) - - glyph.append(vtkGlyph3D()) - glyph[obj_idx].SetSourceConnection(arrow[obj_idx].GetOutputPort()) - glyph[obj_idx].SetInputConnection(mask_pts[obj_idx].GetOutputPort()) - glyph[obj_idx].SetVectorModeToUseNormal() - glyph[obj_idx].SetScaleFactor(glyph_scale / 10.0) - glyph[obj_idx].OrientOn() - glyph[obj_idx].Update() - - glyph_mapper.append(vtkPolyDataMapper()) - glyph_mapper[obj_idx].SetInputConnection( - glyph[obj_idx].GetOutputPort()) - - glyph_actor.append(vtkActor()) - glyph_actor[obj_idx].SetMapper(glyph_mapper[obj_idx]) - glyph_actor[obj_idx].GetProperty().SetColor(colors.GetColor3d("GreenYellow")) - - # Need a renderer even if there is no actor. - for i in range(obj_idx + 1, grid_column_dimensions * grid_row_dimensions): - renderers.append(vtkRenderer()) - renderers[i].SetBackground(colors.GetColor3d("MidnightBlue")) - sorted_names.append(None) - - ren_win = vtkRenderWindow() - ren_win.SetSize(renderer_size * grid_column_dimensions, renderer_size * grid_row_dimensions) - - for row in range(0, grid_row_dimensions): - for col in range(0, grid_column_dimensions): - index = row * grid_column_dimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [ - float(col) * renderer_size / (grid_column_dimensions * renderer_size), - float(grid_row_dimensions - (row + 1)) * renderer_size / (grid_row_dimensions * renderer_size), - float(col + 1) * renderer_size / (grid_column_dimensions * renderer_size), - float(grid_row_dimensions - row) * renderer_size / (grid_row_dimensions * renderer_size)] - ren_win.AddRenderer(renderers[index]) - renderers[index].SetViewport(viewport) - if index > obj_idx: - continue - renderers[index].AddActor(actors[index]) - # Normals can only be computed for polygons and triangle strips. - # The Spline is a line. - if normals and indexed_names[index] != 'Spline': - renderers[index].AddActor(glyph_actor[index]) - renderers[index].AddActor(text_actors[index]) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(-30) - renderers[index].GetActiveCamera().Zoom(0.9) - renderers[index].ResetCameraClippingRange() - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - if limits: - for k, v in bounding_boxes.items(): - display_bounding_box_and_center(k, v) - - if surface_name: - fn = single_surface[0] - else: - fn = 'ParametricObjectsDemo' - ren_win.SetWindowName(fn) - - print_callback = PrintCallback(iren, fn, 1, False) - iren.AddObserver('KeyPressEvent', print_callback) - - iren.Initialize() - iren.Start() - - -def get_parametric_functions(): - """ - Create a map of the parametric functions and set some parameters. - The first key groups the parametric functions and the - second key is the name of the function. - - :return: The map of functions. - """ - pfn = dict() - pfn['Boy'] = vtkParametricBoy() - pfn['ConicSpiral'] = vtkParametricConicSpiral() - pfn['CrossCap'] = vtkParametricCrossCap() - pfn['Dini'] = vtkParametricDini() - pfn['Ellipsoid'] = vtkParametricEllipsoid() - pfn['Enneper'] = vtkParametricEnneper() - pfn['Figure8Klein'] = vtkParametricFigure8Klein() - pfn['Klein'] = vtkParametricKlein() - pfn['Mobius'] = vtkParametricMobius() - pfn['RandomHills'] = vtkParametricRandomHills() - pfn['Roman'] = vtkParametricRoman() - pfn['SuperEllipsoid'] = vtkParametricSuperEllipsoid() - pfn['SuperToroid'] = vtkParametricSuperToroid() - pfn['Torus'] = vtkParametricTorus() - pfn['Spline'] = vtkParametricSpline() - # Extra parametric surfaces. - pfn['BohemianDome'] = vtkParametricBohemianDome() - pfn['Bour'] = vtkParametricBour() - pfn['CatalanMinimal'] = vtkParametricCatalanMinimal() - pfn['Henneberg'] = vtkParametricHenneberg() - pfn['Kuen'] = vtkParametricKuen() - pfn['PluckerConoid'] = vtkParametricPluckerConoid() - pfn['Pseudosphere'] = vtkParametricPseudosphere() - # Now set some parameters. - pfn["Ellipsoid"].SetXRadius(0.5) - pfn["Ellipsoid"].SetYRadius(2.0) - pfn["Mobius"].SetRadius(2.0) - pfn["Mobius"].SetMinimumV(-0.5) - pfn["Mobius"].SetMaximumV(0.5) - pfn["RandomHills"].AllowRandomGenerationOn() - pfn["RandomHills"].SetRandomSeed(1) - pfn["RandomHills"].SetNumberOfHills(30) - pfn["SuperEllipsoid"].SetN1(0.5) - pfn["SuperEllipsoid"].SetN2(0.4) - pfn["SuperToroid"].SetN1(0.5) - pfn["SuperToroid"].SetN2(3.0) - # The spline needs points - spline_points = vtkPoints() - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - for p in range(0, 10): - xyz = [None] * 3 - for idx in range(0, len(xyz)): - xyz[idx] = rng.GetRangeValue(-1.0, 1.0) - rng.Next() - spline_points.InsertNextPoint(xyz) - - pfn["Spline"].SetPoints(spline_points) - # Extra parametric surfaces. - pfn["BohemianDome"].SetA(5.0) - pfn["BohemianDome"].SetB(1.0) - pfn["BohemianDome"].SetC(2.0) - pfn["Kuen"].SetDeltaV0(0.001) - - return pfn - - -def get_centre(bounds): - """ - Get the centre of the object from the bounding box. - - :param bounds: The bounding box of the object. - :return: - """ - if len(bounds) != 6: - return None - return [bounds[i] - (bounds[i] - bounds[i - 1]) / 2.0 for i in range(1, len(bounds), 2)] - - -def get_maximum_length(bounds): - """ - Calculate the maximum length of the side bounding box. - - :param bounds: The bounding box of the object. - :return: - """ - if len(bounds) != 6: - return None - return max([bounds[i] - bounds[i - 1] for i in range(1, len(bounds), 2)]) - - -def display_bounding_box_and_center(name, bounds): - """ - Display the dimensions of the bounding box, maximum diagonal length - and coordinates of the centre. - - :param name: The name of the object. - :param bounds: The bounding box of the object. - :return: - """ - if len(bounds) != 6: - return - max_len = get_maximum_length(bounds) - centre = get_centre(bounds) - s = '{:21s}\n'.format(name) - s += '{:21s}{:1s}'.format(' Bounds (min, max)', ':') - s += '{:s}({:6.2f}, {:6.2f})'.format(' x:', bounds[0], bounds[1]) - s += '{:s}({:6.2f}, {:6.2f})'.format(' y:', bounds[2], bounds[3]) - s += '{:s}({:6.2f}, {:6.2f})\n'.format(' z:', bounds[4], bounds[5]) - if max_len: - s += ' Maximum side length: {:6.2f}\n'.format(max_len) - if centre: - s += ' Centre (x, y, z) : ({:6.2f}, {:6.2f}, {:6.2f})\n'.format(centre[0], centre[1], centre[2]) - print(s) - - -class PrintCallback: - def __init__(self, caller, file_name, image_quality=1, rgba=True): - self.caller = caller - self.image_quality = image_quality - # rgba is the the buffer type, - # (if true, there is no background in the screenshot). - self.rgba = rgba - parent = Path(file_name).resolve().parent - pth = Path(parent) / file_name - self.path = Path(str(pth)).with_suffix('.png') - - def __call__(self, caller, ev): - # Save the screenshot. - if caller.GetKeyCode() == "k": - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: - w2if.SetInputBufferTypeToRGB() - # Read from the front buffer. - w2if.ReadFrontBufferOn() - w2if.Update() - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path.name) - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ParametricSuperEllipsoidDemo.py b/data/examples/GeometricObjects/ParametricSuperEllipsoidDemo.py deleted file mode 100755 index 4c12079..0000000 --- a/data/examples/GeometricObjects/ParametricSuperEllipsoidDemo.py +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import vtkParametricSuperEllipsoid -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkMath -) -from vtkmodules.vtkFiltersSources import vtkParametricFunctionSource -from vtkmodules.vtkInteractionWidgets import ( - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricSuperEllipsoid() - source = vtkParametricFunctionSource() - - renderer = vtkRenderer() - mapper = vtkPolyDataMapper() - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor - source.SetParametricFunction(surface) - - mapper.SetInputConnection(source.GetOutputPort()) - - actor.SetMapper(mapper) - actor.SetBackfaceProperty(backProperty) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('ParametricSuperEllipsoidDemo') - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Setup a slider widget for each varying parameter - tubeWidth = 0.008 - sliderLength = 0.008 - titleHeight = 0.04 - labelHeight = 0.04 - - sliderRepN1 = vtkSliderRepresentation2D() - - sliderRepN1.SetMinimumValue(0.0) - sliderRepN1.SetMaximumValue(4.0) - sliderRepN1.SetValue(1.0) - sliderRepN1.SetTitleText('Z squareness') - - sliderRepN1.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN1.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepN1.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN1.GetPoint2Coordinate().SetValue(.9, .1) - - sliderRepN1.SetTubeWidth(tubeWidth) - sliderRepN1.SetSliderLength(sliderLength) - sliderRepN1.SetTitleHeight(titleHeight) - sliderRepN1.SetLabelHeight(labelHeight) - - sliderWidgetN1 = vtkSliderWidget() - sliderWidgetN1.SetInteractor(interactor) - sliderWidgetN1.SetRepresentation(sliderRepN1) - sliderWidgetN1.SetAnimationModeToAnimate() - sliderWidgetN1.EnabledOn() - - sliderWidgetN1.AddObserver(vtkCommand.InteractionEvent, SliderCallbackN1(surface)) - - sliderRepN2 = vtkSliderRepresentation2D() - - sliderRepN2.SetMinimumValue(0.0001) - sliderRepN2.SetMaximumValue(4.0) - sliderRepN2.SetValue(1.0) - sliderRepN2.SetTitleText('XY squareness') - - sliderRepN2.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN2.GetPoint1Coordinate().SetValue(.1, .9) - sliderRepN2.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN2.GetPoint2Coordinate().SetValue(.9, .9) - - sliderRepN2.SetTubeWidth(tubeWidth) - sliderRepN2.SetSliderLength(sliderLength) - sliderRepN2.SetTitleHeight(titleHeight) - sliderRepN2.SetLabelHeight(labelHeight) - - sliderWidgetN2 = vtkSliderWidget() - sliderWidgetN2.SetInteractor(interactor) - sliderWidgetN2.SetRepresentation(sliderRepN2) - sliderWidgetN2.SetAnimationModeToAnimate() - sliderWidgetN2.EnabledOn() - - sliderWidgetN2.AddObserver(vtkCommand.InteractionEvent, SliderCallbackN2(surface)) - - sliderRepMinimumV = vtkSliderRepresentation2D() - - sliderRepN1.SetMinimumValue(.0001) - sliderRepMinimumV.SetMaximumValue(.9999 * vtkMath.Pi()) - sliderRepMinimumV.SetValue(.0001) - sliderRepMinimumV.SetTitleText('V min') - - sliderRepMinimumV.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepMinimumV.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint2Coordinate().SetValue(.1, .9) - - sliderRepMinimumV.SetTubeWidth(tubeWidth) - sliderRepMinimumV.SetSliderLength(sliderLength) - sliderRepMinimumV.SetTitleHeight(titleHeight) - sliderRepMinimumV.SetLabelHeight(labelHeight) - - surface.SetN1(1.0) - surface.SetN2(1.0) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - renderWindow.Render() - - interactor.Initialize() - - interactor.Start() - - -# These callbacks do the actual work. -# Callbacks for the interactions - -class SliderCallbackN1(): - def __init__(self, superEllipsoid): - self.superEllipsoid = superEllipsoid - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.superEllipsoid.SetN1(value) - - -class SliderCallbackN2(): - def __init__(self, superEllipsoid): - self.superEllipsoid = superEllipsoid - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.superEllipsoid.SetN2(value) - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ParametricSuperToroidDemo.py b/data/examples/GeometricObjects/ParametricSuperToroidDemo.py deleted file mode 100755 index c5f6cf5..0000000 --- a/data/examples/GeometricObjects/ParametricSuperToroidDemo.py +++ /dev/null @@ -1,182 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import vtkParametricSuperToroid -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkMath -) -from vtkmodules.vtkFiltersSources import vtkParametricFunctionSource -from vtkmodules.vtkInteractionWidgets import ( - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricSuperToroid() - source = vtkParametricFunctionSource() - - renderer = vtkRenderer() - mapper = vtkPolyDataMapper() - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor - source.SetParametricFunction(surface) - - mapper.SetInputConnection(source.GetOutputPort()) - - actor.SetMapper(mapper) - actor.SetBackfaceProperty(backProperty) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('ParametricSuperToroidDemo') - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Setup a slider widget for each varying parameter - tubeWidth = 0.008 - sliderLength = 0.008 - titleHeight = 0.04 - labelHeight = 0.04 - - sliderRepN1 = vtkSliderRepresentation2D() - - sliderRepN1.SetMinimumValue(0.0) - sliderRepN1.SetMaximumValue(4.0) - sliderRepN1.SetValue(1.0) - sliderRepN1.SetTitleText('Z squareness') - - sliderRepN1.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN1.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepN1.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN1.GetPoint2Coordinate().SetValue(.9, .1) - - sliderRepN1.SetTubeWidth(tubeWidth) - sliderRepN1.SetSliderLength(sliderLength) - sliderRepN1.SetTitleHeight(titleHeight) - sliderRepN1.SetLabelHeight(labelHeight) - - sliderWidgetN1 = vtkSliderWidget() - sliderWidgetN1.SetInteractor(interactor) - sliderWidgetN1.SetRepresentation(sliderRepN1) - sliderWidgetN1.SetAnimationModeToAnimate() - sliderWidgetN1.EnabledOn() - - sliderWidgetN1.AddObserver(vtkCommand.InteractionEvent, SliderCallbackN1(surface)) - - sliderRepN2 = vtkSliderRepresentation2D() - - sliderRepN2.SetMinimumValue(0.0001) - sliderRepN2.SetMaximumValue(4.0) - sliderRepN2.SetValue(1.0) - sliderRepN2.SetTitleText('XY squareness') - - sliderRepN2.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN2.GetPoint1Coordinate().SetValue(.1, .9) - sliderRepN2.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepN2.GetPoint2Coordinate().SetValue(.9, .9) - - sliderRepN2.SetTubeWidth(tubeWidth) - sliderRepN2.SetSliderLength(sliderLength) - sliderRepN2.SetTitleHeight(titleHeight) - sliderRepN2.SetLabelHeight(labelHeight) - - sliderWidgetN2 = vtkSliderWidget() - sliderWidgetN2.SetInteractor(interactor) - sliderWidgetN2.SetRepresentation(sliderRepN2) - sliderWidgetN2.SetAnimationModeToAnimate() - sliderWidgetN2.EnabledOn() - - sliderWidgetN2.AddObserver(vtkCommand.InteractionEvent, SliderCallbackN2(surface)) - - sliderRepMinimumV = vtkSliderRepresentation2D() - - sliderRepN1.SetMinimumValue(.0001) - sliderRepMinimumV.SetMaximumValue(.9999 * vtkMath.Pi()) - sliderRepMinimumV.SetValue(.0001) - sliderRepMinimumV.SetTitleText('V min') - - sliderRepMinimumV.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint1Coordinate().SetValue(.1, .1) - sliderRepMinimumV.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepMinimumV.GetPoint2Coordinate().SetValue(.1, .9) - - sliderRepMinimumV.SetTubeWidth(tubeWidth) - sliderRepMinimumV.SetSliderLength(sliderLength) - sliderRepMinimumV.SetTitleHeight(titleHeight) - sliderRepMinimumV.SetLabelHeight(labelHeight) - - surface.SetN1(1.0) - surface.SetN2(1.0) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Zoom(0.9) - renderer.ResetCameraClippingRange() - renderWindow.Render() - - interactor.Initialize() - - interactor.Start() - - -# These callbacks do the actual work. -# Callbacks for the interactions - -class SliderCallbackN1(): - def __init__(self, superToroid): - self.superToroid = superToroid - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.superToroid.SetN1(value) - - -class SliderCallbackN2(): - def __init__(self, superToroid): - self.superToroid = superToroid - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.superToroid.SetN2(value) - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Plane.md b/data/examples/GeometricObjects/Plane.md deleted file mode 100644 index 835c912..0000000 --- a/data/examples/GeometricObjects/Plane.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -vtkPlaneSource object creates an m x n array of quadrilaterals arranged as a regular tiling in a plane. - -The plane is defined by specifying an origin point, and then two other points that, together with the origin, define two -axes for the plane. These axes do not have to be orthogonal - so you can create a parallelogram. (The axes must not be -parallel.) The resolution of the plane (i.e., number of subdivisions) is controlled by the ivars XResolution and -YResolution. - -By default, the plane is centered at the origin and perpendicular to the z-axis, with width and height of length 1 and -resolutions set to 1. diff --git a/data/examples/GeometricObjects/Plane.py b/data/examples/GeometricObjects/Plane.py deleted file mode 100755 index 4098759..0000000 --- a/data/examples/GeometricObjects/Plane.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create a plane - planeSource = vtkPlaneSource() - planeSource.SetCenter(1.0, 0.0, 0.0) - planeSource.SetNormal(1.0, 0.0, 1.0) - planeSource.Update() - - plane = planeSource.GetOutput() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputData(plane) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - # Create a renderer, render window and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Plane') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('BkgColor')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Planes.py b/data/examples/GeometricObjects/Planes.py deleted file mode 100755 index 6d8b056..0000000 --- a/data/examples/GeometricObjects/Planes.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkPlanes, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import vtkHull -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - colors = vtkNamedColors() - - planes = list() - titles = list() - - # Using frustum planes. - titles.append('Using frustum planes') - camera = vtkCamera() - planes_array = [0] * 24 - camera.GetFrustumPlanes(1, planes_array) - planes.append(vtkPlanes()) - planes[0].SetFrustumPlanes(planes_array) - - # Using bounds. - titles.append('Using bounds') - sphere_source = vtkSphereSource() - sphere_source.Update() - bounds = [0] * 6 - sphere_source.GetOutput().GetBounds(bounds) - planes.append(vtkPlanes()) - planes[1].SetBounds(bounds) - - # At this point we have the planes created by both of the methods above. - # You can do whatever you want with them. - - # For visualisation we will produce an n-sided convex hull - # and visualise it. - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(16) - text_property.SetJustificationToCentered() - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.SetWindowName('Planes') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - hulls = list() - pds = list() - mappers = list() - actors = list() - renderers = list() - text_mappers = list() - text_actors = list() - for i in range(0, len(planes)): - hulls.append(vtkHull()) - hulls[i].SetPlanes(planes[i]) - - pds.append(vtkPolyData()) - - # To generate the convex hull we supply a vtkPolyData object and a bounding box. - # We define the bounding box to be where we expect the resulting polyhedron to lie. - # Make it a generous fit as it is only used to create the initial - # polygons that are eventually clipped. - hulls[i].GenerateHull(pds[i], -200, 200, -200, 200, -200, 200) - - mappers.append(vtkPolyDataMapper()) - mappers[i].SetInputData(pds[i]) - - actors.append(vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d('Moccasin')) - actors[i].GetProperty().SetSpecular(0.8) - actors[i].GetProperty().SetSpecularPower(30) - - renderers.append(vtkRenderer()) - renderers[i].AddActor(actors[i]) - - text_mappers.append(vtkTextMapper()) - text_mappers[i].SetInput(titles[i]) - text_mappers[i].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[i].SetMapper(text_mappers[i]) - text_actors[i].SetPosition(100, 10) - renderers[i].AddViewProp(text_actors[i]) - - ren_win.AddRenderer(renderers[i]) - - # Setup the viewports - x_grid_dimensions = 2 - y_grid_dimensions = 1 - renderer_size = 300 - ren_win.SetSize(renderer_size * x_grid_dimensions, renderer_size * y_grid_dimensions) - for row in range(0, y_grid_dimensions): - for col in range(0, x_grid_dimensions): - index = row * x_grid_dimensions + col - - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / x_grid_dimensions, - float(y_grid_dimensions - (row + 1)) / y_grid_dimensions, - float(col + 1) / x_grid_dimensions, - float(y_grid_dimensions - row) / y_grid_dimensions] - - if index > (len(actors) - 1): - # Add a renderer even if there is no actor. - # This makes the render window background all the same color. - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('DarkSlateGray')) - ren.SetViewport(viewport) - ren_win.AddRenderer(ren) - continue - - renderers[index].SetViewport(viewport) - renderers[index].SetBackground(colors.GetColor3d('DarkSlateGray')) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(-30) - renderers[index].ResetCameraClippingRange() - - iren.Initialize() - ren_win.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/PlanesIntersection.py b/data/examples/GeometricObjects/PlanesIntersection.py deleted file mode 100755 index 694a138..0000000 --- a/data/examples/GeometricObjects/PlanesIntersection.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPlanesIntersection -from vtkmodules.vtkFiltersSources import vtkSphereSource - -def main(): - - sphereSource = vtkSphereSource() - sphereSource.Update() - - bounds = [0 for i in range(6)] - sphereSource.GetOutput().GetBounds(bounds) - - box = vtkPoints() - - box.SetNumberOfPoints(8) - - xMin = bounds[0] - xMax = bounds[1] - yMin = bounds[2] - yMax = bounds[3] - zMin = bounds[4] - zMax = bounds[5] - - box.SetPoint(0, xMax, yMin, zMax) - box.SetPoint(1, xMax, yMin, zMin) - box.SetPoint(2, xMax, yMax, zMin) - box.SetPoint(3, xMax, yMax, zMax) - box.SetPoint(4, xMin, yMin, zMax) - box.SetPoint(5, xMin, yMin, zMin) - box.SetPoint(6, xMin, yMax, zMin) - box.SetPoint(7, xMin, yMax, zMax) - - planesIntersection = vtkPlanesIntersection() - planesIntersection.SetBounds(bounds) - - intersects = planesIntersection.IntersectsRegion(box) - if intersects == 1: - res = 'Yes' - else: - res = 'No' - print('Intersects? ', res) - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/PlatonicSolids.md b/data/examples/GeometricObjects/PlatonicSolids.md deleted file mode 100644 index ae524ad..0000000 --- a/data/examples/GeometricObjects/PlatonicSolids.md +++ /dev/null @@ -1,20 +0,0 @@ -### Description - -Display all five Platonic solids in a grid. - -Platonic solids are regular, convex polyhedrons. They are constructed by congruent (identical in shape and size) -regular (all angles equal and all sides equal) polygonal faces with the same number of faces meeting at each vertex. - -Five solids satisfy the above criteria: - -| Figure | Tetrahedron | Cube | Octahedron| Icosahedron | Dodecahedron| -| :------: | :------: | :------: | :------: | :------: | :------: | -| Vertices | 4 | 8 | 6 (2 × 3) | 12 (4 × 3) | 20 (8 + 4 × 3) | -| Edges | 6 | 12 | 12| 30 | 30 | -| Faces | 4 |6 | 8 | 20 | 12| - -The relationship between vertices, edges and faces is given by Euler's formula: - -``` text -V - E + F = 2 -``` diff --git a/data/examples/GeometricObjects/PlatonicSolids.py b/data/examples/GeometricObjects/PlatonicSolids.py deleted file mode 100755 index 5e3dba6..0000000 --- a/data/examples/GeometricObjects/PlatonicSolids.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env python - -from collections import namedtuple - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersSources import vtkPlatonicSolidSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - colors = vtkNamedColors() - - mappers = list() - actors = list() - text_mappers = list() - text_actors = list() - renderers = list() - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(16) - text_property.SetJustificationToCentered() - - # Create the render window and interactor. - ren_win = vtkRenderWindow() - ren_win.SetWindowName('PlatonicSolids') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - name_orientation = get_name_orientation() - lut = get_platonic_lut() - platonic_solids = list() - - for i in range(0, len(name_orientation)): - platonic_solids.append(vtkPlatonicSolidSource()) - platonic_solids[i].SetSolidType(i) - - mappers.append(vtkPolyDataMapper()) - mappers[i].SetInputConnection(platonic_solids[i].GetOutputPort()) - mappers[i].SetLookupTable(lut) - mappers[i].SetScalarRange(0, 19) - - actors.append(vtkActor()) - actors[i].SetMapper(mappers[i]) - - text_mappers.append(vtkTextMapper()) - text_mappers[i].SetInput(name_orientation[i].name) - text_mappers[i].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[i].SetMapper(text_mappers[i]) - text_actors[i].SetPosition(120, 16) - - renderers.append(vtkRenderer()) - renderers[i].AddActor(actors[i]) - renderers[i].AddViewProp(text_actors[i]) - - ren_win.AddRenderer(renderers[i]) - - # Set up the viewports. - grid_dimension_x = 3 - grid_dimension_y = 2 - renderer_size = 300 - ren_win.SetSize(renderer_size * grid_dimension_x, renderer_size * grid_dimension_y) - for row in range(0, grid_dimension_y): - for col in range(0, grid_dimension_x): - index = row * grid_dimension_x + col - - # (x_min, y_min, x_max, y_max) - viewport = [float(col) / grid_dimension_x, - float(grid_dimension_y - (row + 1)) / grid_dimension_y, - float(col + 1) / grid_dimension_x, - float(grid_dimension_y - row) / grid_dimension_y] - - if index > (len(actors) - 1): - # Add a renderer even if there is no actor. - # This makes the render window background all the same color. - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('SlateGray')) - ren.SetViewport(viewport) - ren_win.AddRenderer(ren) - continue - - renderers[index].SetViewport(viewport) - renderers[index].SetBackground(colors.GetColor3d('SlateGray')) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(name_orientation[index].azimuth) - renderers[index].GetActiveCamera().Elevation(name_orientation[index].elevation) - renderers[index].GetActiveCamera().Zoom(name_orientation[index].zoom) - renderers[index].ResetCameraClippingRange() - - iren.Initialize() - ren_win.Render() - iren.Start() - - -def get_name_orientation(): - """ - Get the platonic solid names and initial orientations. - - :return: The solids and their initial orientations. - """ - - # [[name, azimuth, elevation, zoom] ...] - res = [['Tetrahedron', 45.0, 30.0, 1.0], - ['Cube', -60.0, 45.0, 0.8], - ['Octahedron', -15.0, 10.0, 1.0], - ['Icosahedron', 4.5, 18.0, 1.0], - ['Dodecahedron', 171.0, 22.0, 1.0]] - - platonic_solids = namedtuple('platonic_solids', ('name', 'azimuth', 'elevation', 'zoom')) - # Convert res to a list of named tuples. - res = [platonic_solids(*row) for row in res] - return res - - -def get_platonic_lut(): - """ - Get a specialised lookup table for the platonic solids. - - Since each face of a vtkPlatonicSolidSource has a different - cell scalar, we create a lookup table with a different colour - for each face. - The colors have been carefully chosen so that adjacent cells - are colored distinctly. - - :return: The lookup table. - """ - lut = vtkLookupTable() - lut.SetNumberOfTableValues(20) - lut.SetTableRange(0.0, 19.0) - lut.Build() - lut.SetTableValue(0, 0.1, 0.1, 0.1) - lut.SetTableValue(1, 0, 0, 1) - lut.SetTableValue(2, 0, 1, 0) - lut.SetTableValue(3, 0, 1, 1) - lut.SetTableValue(4, 1, 0, 0) - lut.SetTableValue(5, 1, 0, 1) - lut.SetTableValue(6, 1, 1, 0) - lut.SetTableValue(7, 0.9, 0.7, 0.9) - lut.SetTableValue(8, 0.5, 0.5, 0.5) - lut.SetTableValue(9, 0.0, 0.0, 0.7) - lut.SetTableValue(10, 0.5, 0.7, 0.5) - lut.SetTableValue(11, 0, 0.7, 0.7) - lut.SetTableValue(12, 0.7, 0, 0) - lut.SetTableValue(13, 0.7, 0, 0.7) - lut.SetTableValue(14, 0.7, 0.7, 0) - lut.SetTableValue(15, 0, 0, 0.4) - lut.SetTableValue(16, 0, 0.4, 0) - lut.SetTableValue(17, 0, 0.4, 0.4) - lut.SetTableValue(18, 0.4, 0, 0) - lut.SetTableValue(19, 0.4, 0, 0.4) - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Point.md b/data/examples/GeometricObjects/Point.md deleted file mode 100644 index b1b21d9..0000000 --- a/data/examples/GeometricObjects/Point.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -vtkPoints object represents 3D points. The data model for vtkPoints is an array of vx-vy-vz triplets accessible by ( -point or cell) id. diff --git a/data/examples/GeometricObjects/Point.py b/data/examples/GeometricObjects/Point.py deleted file mode 100755 index a81ad28..0000000 --- a/data/examples/GeometricObjects/Point.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the geometry of a point (the coordinate) - points = vtkPoints() - p = [1.0, 2.0, 3.0] - - # Create the topology of the point (a vertex) - vertices = vtkCellArray() - # We need an an array of point id's for InsertNextCell. - pid = [0] - pid[0] = points.InsertNextPoint(p) - vertices.InsertNextCell(1, pid) - - # Create a polydata object - point = vtkPolyData() - - # Set the points and vertices we created as the geometry and topology of the polydata - point.SetPoints(points) - point.SetVerts(vertices) - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputData(point) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - actor.GetProperty().SetPointSize(20) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Point') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/PolyLine.md b/data/examples/GeometricObjects/PolyLine.md deleted file mode 100644 index 430be10..0000000 --- a/data/examples/GeometricObjects/PolyLine.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -The polyline is a composite one-dimensional cell consisting of one or more connected lines. The polyline is defined by -an ordered list of n+1 points, where n is the number of lines in the polyline. Each pair of points (i, i+1) defines a -line. diff --git a/data/examples/GeometricObjects/PolyLine.py b/data/examples/GeometricObjects/PolyLine.py deleted file mode 100755 index 72a110b..0000000 --- a/data/examples/GeometricObjects/PolyLine.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create five points. - origin = [0.0, 0.0, 0.0] - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] - p2 = [0.0, 1.0, 2.0] - p3 = [1.0, 2.0, 3.0] - - # Create a vtkPoints object and store the points in it - points = vtkPoints() - points.InsertNextPoint(origin) - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - - polyLine = vtkPolyLine() - polyLine.GetPointIds().SetNumberOfIds(5) - for i in range(0, 5): - polyLine.GetPointIds().SetId(i, i) - - # Create a cell array to store the lines in and add the lines to it - cells = vtkCellArray() - cells.InsertNextCell(polyLine) - - # Create a polydata to store everything in - polyData = vtkPolyData() - - # Add the points to the dataset - polyData.SetPoints(points) - - # Add the lines to the dataset - polyData.SetLines(cells) - - # Setup actor and mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('PolyLine') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkOliveGreen')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/PolyLine1.py b/data/examples/GeometricObjects/PolyLine1.py deleted file mode 100755 index a05a534..0000000 --- a/data/examples/GeometricObjects/PolyLine1.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# This example demonstrates how to create a polyline through several ordered points. - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # vtkPoints represents 3D points. The data model for vtkPoints is an array of - # vx-vy-vz triplets accessible by (point or cell) id. - points = vtkPoints() - points.SetNumberOfPoints(6) - c = math.cos(math.pi / 6) # helper variable - points.SetPoint(0, 0.0, -1.0, 0.0) - points.SetPoint(1, c, -0.5, 0.0) - points.SetPoint(2, c, 0.5, 0.0) - points.SetPoint(3, 0.0, 1.0, 0.0) - points.SetPoint(4, -c, 0.5, 0.0) - points.SetPoint(5, -c, -0.5, 0.0) - - # vtkCellArray is a supporting object that explicitly represents cell connectivity. - # The cell array structure is a raw integer list of the form: - # (n,id1,id2,...,idn, n,id1,id2,...,idn, ...) where n is the number of points in - # the cell, and id is a zero-offset index into an associated point list. - lines = vtkCellArray() - lines.InsertNextCell(7) - lines.InsertCellPoint(0) - lines.InsertCellPoint(1) - lines.InsertCellPoint(2) - lines.InsertCellPoint(3) - lines.InsertCellPoint(4) - lines.InsertCellPoint(5) - lines.InsertCellPoint(0) - - # vtkPolyData is a data object that is a concrete implementation of vtkDataSet. - # vtkPolyData represents a geometric structure consisting of vertices, lines, - # polygons, and/or triangle strips - polygon = vtkPolyData() - polygon.SetPoints(points) - polygon.SetLines(lines) - - # vtkPolyDataMapper is a class that maps polygonal data (i.e., vtkPolyData) - # to graphics primitives - polygonMapper = vtkPolyDataMapper() - polygonMapper.SetInputData(polygon) - polygonMapper.Update() - - # Create an actor to represent the polygon. The actor orchestrates rendering of - # the mapper's graphics primitives. An actor also refers to properties via a - # vtkProperty instance, and includes an internal transformation matrix. We - # set this actor's mapper to be polygonMapper which we created above. - polygonActor = vtkActor() - polygonActor.SetMapper(polygonMapper) - polygonActor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is - # responsible for drawing the actors it has. We also set the - # background color here. - ren = vtkRenderer() - ren.AddActor(polygonActor) - ren.SetBackground(colors.GetColor3d('BkgColor')) - - # Automatically set up the camera based on the visible actors. - # The camera will reposition itself to view the center point of the actors, - # and move along its initial view plane normal - # (i.e., vector defined from camera position to focal point) so that all of the - # actors can be seen. - ren.ResetCamera() - - # Finally we create the render window which will show up on the screen - # We put our renderer into the render window using AddRenderer. We - # also set the size to be 300 pixels by 300. - renWin = vtkRenderWindow() - renWin.SetWindowName('PolyLine1') - renWin.AddRenderer(ren) - renWin.SetSize(300, 300) - - # The vtkRenderWindowInteractor class watches for events (e.g., keypress, - # mouse) in the vtkRenderWindow. These events are translated into - # event invocations that VTK understands (see VTK/Common/vtkCommand.h - # for all events that VTK processes). Then observers of these VTK - # events can process them as appropriate. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Polygon.md b/data/examples/GeometricObjects/Polygon.md deleted file mode 100644 index 85b8b93..0000000 --- a/data/examples/GeometricObjects/Polygon.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -The polygon is a primary two-dimensional cell. The polygon is defined by an ordered list of three or more points lying -in a plane. The polygon normal is implicitly defined by a counterclockwise ordering of its points using the right-hand -rule. - -The polygon may be nonconvex, but may not have internal loops, and it cannot self-intersect. The polygon has n edges, -where n is the number of points in the polygon. diff --git a/data/examples/GeometricObjects/Polygon.py b/data/examples/GeometricObjects/Polygon.py deleted file mode 100755 index 57d9604..0000000 --- a/data/examples/GeometricObjects/Polygon.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolygon -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Setup four points - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - - # Create the polygon - polygon = vtkPolygon() - polygon.GetPointIds().SetNumberOfIds(4) # make a quad - polygon.GetPointIds().SetId(0, 0) - polygon.GetPointIds().SetId(1, 1) - polygon.GetPointIds().SetId(2, 2) - polygon.GetPointIds().SetId(3, 3) - - # Add the polygon to a list of polygons - polygons = vtkCellArray() - polygons.InsertNextCell(polygon) - - # Create a PolyData - polygonPolyData = vtkPolyData() - polygonPolyData.SetPoints(points) - polygonPolyData.SetPolys(polygons) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputData(polygonPolyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Polygon') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Salmon')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/PolygonIntersection.py b/data/examples/GeometricObjects/PolygonIntersection.py deleted file mode 100755 index 7de37be..0000000 --- a/data/examples/GeometricObjects/PolygonIntersection.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import ( - mutable, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPolygon - - -def main(): - # Create a square in the x-y plane. - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - - # Create the polygon - polygon = vtkPolygon() - polygon.GetPoints().DeepCopy(points) - polygon.GetPointIds().SetNumberOfIds(4) # The 4 corners of the square - for i in range(4): - polygon.GetPointIds().SetId(i, i) - - # Inputs - p1 = [0.1, 0, -1.0] - p2 = [0.1, 0, 1.0] - tolerance = 0.001 - - # Outputs - t = mutable(0) # Parametric coordinate of intersection (0 (corresponding to p1) to 1 (corresponding to p2)) - x = [0.0, 0.0, 0.0] - pcoords = [0.0, 0.0, 0.0] - subId = mutable(0) - iD = polygon.IntersectWithLine(p1, p2, tolerance, t, x, pcoords, subId) - - print('intersected? ', 'Yes' if iD == 1 else 'No') - print('intersection: ', x) - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Polyhedron.py b/data/examples/GeometricObjects/Polyhedron.py deleted file mode 100755 index 83d391d..0000000 --- a/data/examples/GeometricObjects/Polyhedron.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkIdList, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - VTK_POLYHEDRON, - vtkUnstructuredGrid -) -from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridWriter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create polyhedron (cube) - # The point Ids are: [0, 1, 2, 3, 4, 5, 6, 7] - - points = vtkPoints() - points.InsertNextPoint(-1.0, -1.0, -1.0) - points.InsertNextPoint(1.0, -1.0, -1.0) - points.InsertNextPoint(1.0, 1.0, -1.0) - points.InsertNextPoint(-1.0, 1.0, -1.0) - points.InsertNextPoint(-1.0, -1.0, 1.0) - points.InsertNextPoint(1.0, -1.0, 1.0) - points.InsertNextPoint(1.0, 1.0, 1.0) - points.InsertNextPoint(-1.0, 1.0, 1.0) - - # These are the point ids corresponding to each face. - faces = [[0, 3, 2, 1], [0, 4, 7, 3], [4, 5, 6, 7], [5, 1, 2, 6], [0, 1, 5, 4], [2, 3, 7, 6]] - faceId = vtkIdList() - faceId.InsertNextId(6) # Six faces make up the cell. - for face in faces: - faceId.InsertNextId(len(face)) # The number of points in the face. - [faceId.InsertNextId(i) for i in face] - - ugrid = vtkUnstructuredGrid() - ugrid.SetPoints(points) - ugrid.InsertNextCell(VTK_POLYHEDRON, faceId) - - # Here we write out the cube. - writer = vtkXMLUnstructuredGridWriter() - writer.SetInputData(ugrid) - writer.SetFileName('polyhedron.vtu') - writer.SetDataModeToAscii() - writer.Update() - - # Create a mapper and actor - mapper = vtkDataSetMapper() - mapper.SetInputData(ugrid) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor( - colors.GetColor3d('Silver')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Polyhedron') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Salmon')) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Pyramid.py b/data/examples/GeometricObjects/Pyramid.py deleted file mode 100755 index 6aa7668..0000000 --- a/data/examples/GeometricObjects/Pyramid.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPyramid, - vtkUnstructuredGrid -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - - p0 = [1.0, 1.0, 1.0] - p1 = [-1.0, 1.0, 1.0] - p2 = [-1.0, -1.0, 1.0] - p3 = [1.0, -1.0, 1.0] - p4 = [0.0, 0.0, 0.0] - - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - points.InsertNextPoint(p4) - - pyramid = vtkPyramid() - pyramid.GetPointIds().SetId(0, 0) - pyramid.GetPointIds().SetId(1, 1) - pyramid.GetPointIds().SetId(2, 2) - pyramid.GetPointIds().SetId(3, 3) - pyramid.GetPointIds().SetId(4, 4) - - cells = vtkCellArray() - cells.InsertNextCell(pyramid) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(pyramid.GetCellType(), pyramid.GetPointIds()) - - # Create an actor and mapper - mapper = vtkDataSetMapper() - mapper.SetInputData(ug) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Pyramid") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - - # Create a nice view - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(180) - renderer.GetActiveCamera().Elevation(-20) - renderer.ResetCameraClippingRange() - - renderer.SetBackground(colors.GetColor3d("Silver")) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Quad.py b/data/examples/GeometricObjects/Quad.py deleted file mode 100755 index 6fb2771..0000000 --- a/data/examples/GeometricObjects/Quad.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkQuad -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create four points (must be in counter clockwise order) - p0 = [0.0, 0.0, 0.0] - p1 = [1.0, 0.0, 0.0] - p2 = [1.0, 1.0, 0.0] - p3 = [0.0, 1.0, 0.0] - - # Add the points to a vtkPoints object - points = vtkPoints() - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - - # Create a quad on the four points - quad = vtkQuad() - quad.GetPointIds().SetId(0, 0) - quad.GetPointIds().SetId(1, 1) - quad.GetPointIds().SetId(2, 2) - quad.GetPointIds().SetId(3, 3) - - # Create a cell array to store the quad in - quads = vtkCellArray() - quads.InsertNextCell(quad) - - # Create a polydata to store everything in - polydata = vtkPolyData() - - # Add the points and quads to the dataset - polydata.SetPoints(points) - polydata.SetPolys(quads) - - # Setup actor and mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(polydata) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Quad') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Salmon')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/QuadraticHexahedron.py b/data/examples/GeometricObjects/QuadraticHexahedron.py deleted file mode 100755 index a68f557..0000000 --- a/data/examples/GeometricObjects/QuadraticHexahedron.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkQuadraticHexahedron, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersGeneral import vtkTessellatorFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticHexahedron() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) - tessellate.SetMaximumNumberOfSubdivisions(2) - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) - actor.GetProperty().EdgeVisibilityOn() - - sphereSource = vtkSphereSource() - sphereSource.SetRadius(0.02) - - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('QuadraticHexahedron') - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.AddActor(glyph3DActor) - renderer.SetBackground(namedColors.GetColor3d('SlateGray')) - - renderWindow.Render() - interactor.Start() - - -def MakeQuadraticHexahedron(): - aHexahedron = vtkQuadraticHexahedron() - points = vtkPoints() - - pcoords = aHexahedron.GetParametricCoords() - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aHexahedron.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aHexahedron.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() - perturbation[j] = rng.GetRangeValue(-0.1, 0.1) - aHexahedron.GetPointIds().SetId(i, i) - points.SetPoint(i, pcoords[3 * i] + perturbation[0], - pcoords[3 * i + 1] + perturbation[1], - pcoords[3 * i + 2] + perturbation[2]) - - # Add the points and hexahedron to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(aHexahedron.GetCellType(), aHexahedron.GetPointIds()) - - return uGrid - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/QuadraticHexahedronDemo.md b/data/examples/GeometricObjects/QuadraticHexahedronDemo.md deleted file mode 100644 index 583595e..0000000 --- a/data/examples/GeometricObjects/QuadraticHexahedronDemo.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows the effect of changing the chord length error for a vtkQuadraticHexahedron. diff --git a/data/examples/GeometricObjects/QuadraticHexahedronDemo.py b/data/examples/GeometricObjects/QuadraticHexahedronDemo.py deleted file mode 100755 index 73cc646..0000000 --- a/data/examples/GeometricObjects/QuadraticHexahedronDemo.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkGenericCell, - vtkQuadraticHexahedron, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersGeneral import vtkTessellatorFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionWidgets import ( - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticHexahedron() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) - tessellate.SetChordError(0.035) - tessellate.Update() - - cellMap = dict() - - numTets = 0 - cell = vtkGenericCell() - it = tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets - numTets += 1 - it.GoToNextCell() - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) - actor.GetProperty().EdgeVisibilityOn() - - sphereSource = vtkSphereSource() - sphereSource.SetRadius(0.02) - - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - textProperty = vtkTextProperty() - textProperty.SetFontSize(24) - - ss = '# of Tetras: ' + str(numTets) - textMapper = vtkTextMapper() - textMapper.SetInput(ss) - textMapper.SetTextProperty(textProperty) - - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('QuadraticHexahedronDemo') - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 512) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - widget = vtkSliderWidget() - MakeWidget(widget, tessellate, textMapper, interactor) - - renderer.AddActor(actor) - renderer.AddActor(glyph3DActor) - renderer.AddViewProp(textActor) - renderer.SetBackground(namedColors.GetColor3d('SlateGray')) - - renderWindow.Render() - - interactor.Start() - - -class SliderCallbackChordError(): - def __init__(self, tessellate, textMapper): - self.tessellate = tessellate - self.textMapper = textMapper - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.tessellate.SetChordError(value) - self.tessellate.SetMaximumNumberOfSubdivisions(4) - self.tessellate.Update() - - cellMap = dict() - - numTets = 0 - cell = vtkGenericCell() - it = self.tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets - numTets += 1 - it.GoToNextCell() - ss = '# of Tetras: ' + str(numTets) - self.textMapper.SetInput(ss) - - -def MakeWidget(widget, tessellate, textMapper, interactor): - # Setup a slider widget for each varying parameter - tubeWidth = 0.008 - sliderLength = 0.008 - titleHeight = 0.04 - labelHeight = 0.04 - - sliderRepChordError = vtkSliderRepresentation2D() - - sliderRepChordError.SetMinimumValue(0.0) - sliderRepChordError.SetMaximumValue(0.07) - sliderRepChordError.SetValue(tessellate.GetChordError()) - sliderRepChordError.SetTitleText('Chord error') - - sliderRepChordError.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepChordError.GetPoint1Coordinate().SetValue(0.1, 0.1) - sliderRepChordError.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepChordError.GetPoint2Coordinate().SetValue(0.9, 0.1) - - sliderRepChordError.SetTubeWidth(tubeWidth) - sliderRepChordError.SetSliderLength(sliderLength) - sliderRepChordError.SetTitleHeight(titleHeight) - sliderRepChordError.SetLabelHeight(labelHeight) - - widget.SetInteractor(interactor) - widget.SetRepresentation(sliderRepChordError) - widget.SetAnimationModeToAnimate() - widget.EnabledOn() - - widget.AddObserver(vtkCommand.InteractionEvent, SliderCallbackChordError(tessellate, textMapper)) - - -def MakeQuadraticHexahedron(): - aHexahedron = vtkQuadraticHexahedron() - points = vtkPoints() - - pcoords = aHexahedron.GetParametricCoords() - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aHexahedron.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aHexahedron.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() - perturbation[j] = rng.GetRangeValue(-0.1, 0.1) - aHexahedron.GetPointIds().SetId(i, i) - points.SetPoint(i, pcoords[3 * i] + perturbation[0], - pcoords[3 * i + 1] + perturbation[1], - pcoords[3 * i + 2] + perturbation[2]) - - # Add the points and hexahedron to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(aHexahedron.GetCellType(), aHexahedron.GetPointIds()) - - return uGrid - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/QuadraticTetra.md b/data/examples/GeometricObjects/QuadraticTetra.md deleted file mode 100644 index ca99468..0000000 --- a/data/examples/GeometricObjects/QuadraticTetra.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -The quadratic tetrahedron is a primary three-dimensional cell. It is defined by ten points. The first four points are -located at the vertices of the tetrahedron; the next six are located in the middle of each of the six edges. diff --git a/data/examples/GeometricObjects/QuadraticTetra.py b/data/examples/GeometricObjects/QuadraticTetra.py deleted file mode 100755 index 52c7714..0000000 --- a/data/examples/GeometricObjects/QuadraticTetra.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkQuadraticTetra, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersGeneral import vtkTessellatorFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticTetra() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) - actor.GetProperty().EdgeVisibilityOn() - - sphereSource = vtkSphereSource() - sphereSource.SetRadius(0.02) - - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('QuadraticTetra') - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.AddActor(glyph3DActor) - renderer.SetBackground(namedColors.GetColor3d('SlateGray')) - - renderWindow.Render() - interactor.Start() - - -def MakeQuadraticTetra(): - aTetra = vtkQuadraticTetra() - points = vtkPoints() - - pcoords = aTetra.GetParametricCoords() - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aTetra.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aTetra.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() - perturbation[j] = rng.GetRangeValue(-0.1, 0.1) - aTetra.GetPointIds().SetId(i, i) - points.SetPoint(i, pcoords[3 * i] + perturbation[0], - pcoords[3 * i + 1] + perturbation[1], - pcoords[3 * i + 2] + perturbation[2]) - - # Add the points and tetra to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(aTetra.GetCellType(), aTetra.GetPointIds()) - - return uGrid - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/QuadraticTetraDemo.md b/data/examples/GeometricObjects/QuadraticTetraDemo.md deleted file mode 100644 index 6ba2693..0000000 --- a/data/examples/GeometricObjects/QuadraticTetraDemo.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows the effect of changing the chord length error for a vtkQuadraticTetra. diff --git a/data/examples/GeometricObjects/QuadraticTetraDemo.py b/data/examples/GeometricObjects/QuadraticTetraDemo.py deleted file mode 100755 index 7e90887..0000000 --- a/data/examples/GeometricObjects/QuadraticTetraDemo.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkGenericCell, - vtkQuadraticTetra, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersGeneral import vtkTessellatorFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionWidgets import ( - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticTetra() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) - tessellate.SetChordError(.035) - tessellate.Update() - - cellMap = dict() - - numTets = 0 - cell = vtkGenericCell() - it = tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets - numTets += 1 - it.GoToNextCell() - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) - actor.GetProperty().EdgeVisibilityOn() - - sphereSource = vtkSphereSource() - sphereSource.SetRadius(0.02) - - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - textProperty = vtkTextProperty() - textProperty.SetFontSize(24) - - ss = '# of Tetras: ' + str(numTets) - textMapper = vtkTextMapper() - textMapper.SetInput(ss) - textMapper.SetTextProperty(textProperty) - - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('QuadraticTetraDemo') - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 512) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - widget = vtkSliderWidget() - MakeWidget(widget, tessellate, textMapper, interactor) - - renderer.AddActor(actor) - renderer.AddActor(glyph3DActor) - renderer.AddViewProp(textActor) - renderer.SetBackground(namedColors.GetColor3d('SlateGray')) - - renderWindow.Render() - - interactor.Start() - - -class SliderCallbackChordError(): - def __init__(self, tessellate, textMapper): - self.tessellate = tessellate - self.textMapper = textMapper - - def __call__(self, caller, ev): - sliderWidget = caller - value = sliderWidget.GetRepresentation().GetValue() - self.tessellate.SetChordError(value) - self.tessellate.SetMaximumNumberOfSubdivisions(5) - self.tessellate.Update() - - cellMap = dict() - - numTets = 0 - cell = vtkGenericCell() - it = self.tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets - numTets += 1 - it.GoToNextCell() - ss = '# of Tetras: ' + str(numTets) - self.textMapper.SetInput(ss) - - -def MakeWidget(widget, tessellate, textMapper, interactor): - # Setup a slider widget for each varying parameter - tubeWidth = 0.008 - sliderLength = 0.008 - titleHeight = 0.04 - labelHeight = 0.04 - - sliderRepChordError = vtkSliderRepresentation2D() - - sliderRepChordError.SetMinimumValue(0.0) - sliderRepChordError.SetMaximumValue(0.07) - sliderRepChordError.SetValue(tessellate.GetChordError()) - sliderRepChordError.SetTitleText('Chord error') - - sliderRepChordError.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepChordError.GetPoint1Coordinate().SetValue(0.1, 0.1) - sliderRepChordError.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - sliderRepChordError.GetPoint2Coordinate().SetValue(0.9, 0.1) - - sliderRepChordError.SetTubeWidth(tubeWidth) - sliderRepChordError.SetSliderLength(sliderLength) - sliderRepChordError.SetTitleHeight(titleHeight) - sliderRepChordError.SetLabelHeight(labelHeight) - - widget.SetInteractor(interactor) - widget.SetRepresentation(sliderRepChordError) - widget.SetAnimationModeToAnimate() - widget.EnabledOn() - - widget.AddObserver(vtkCommand.InteractionEvent, SliderCallbackChordError(tessellate, textMapper)) - - -def MakeQuadraticTetra(): - aTetra = vtkQuadraticTetra() - points = vtkPoints() - - pcoords = aTetra.GetParametricCoords() - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aTetra.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aTetra.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() - perturbation[j] = rng.GetRangeValue(-0.2, 0.2) - aTetra.GetPointIds().SetId(i, i) - points.SetPoint(i, pcoords[3 * i] + perturbation[0], - pcoords[3 * i + 1] + perturbation[1], - pcoords[3 * i + 2] + perturbation[2]) - - # Add the points and tetra to an unstructured grid - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(aTetra.GetCellType(), aTetra.GetPointIds()) - - return uGrid - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/RegularPolygonSource.md b/data/examples/GeometricObjects/RegularPolygonSource.md deleted file mode 100644 index c6b9d98..0000000 --- a/data/examples/GeometricObjects/RegularPolygonSource.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a pentagon. diff --git a/data/examples/GeometricObjects/RegularPolygonSource.py b/data/examples/GeometricObjects/RegularPolygonSource.py deleted file mode 100755 index 44d4803..0000000 --- a/data/examples/GeometricObjects/RegularPolygonSource.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkShrinkPolyData -from vtkmodules.vtkFiltersSources import vtkRegularPolygonSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a pentagon - polygonSource = vtkRegularPolygonSource() - polygonSource.SetNumberOfSides(5) - polygonSource.SetRadius(5) - polygonSource.SetCenter(0, 0, 0) - - shrink = vtkShrinkPolyData() - shrink.SetInputConnection(polygonSource.GetOutputPort()) - shrink.SetShrinkFactor(0.9) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Tomato')) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetLineWidth(5) - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('RegularPolygonSource') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/ShrinkCube.md b/data/examples/GeometricObjects/ShrinkCube.md deleted file mode 100644 index 87ac361..0000000 --- a/data/examples/GeometricObjects/ShrinkCube.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -Generates a cube using vtkCubeSource, then a shrink filter is applied. - -vtkShrinkFilter object shrinks cells composing an arbitrary data set towards their centroid. The centroid of a cell is computed as the average position of the cell points. Shrinking results in disconnecting the cells from one another. - -!!! seealso - [TessellatedBoxSource](../TessellatedBoxSource) generates multiple quads or triangles per side. - -!!! info - See [Figure 5-17](../../../VTKBook/05Chapter5/#Figure%205-17) in [Chapter 5](../../../VTKBook/05Chapter5) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/GeometricObjects/ShrinkCube.py b/data/examples/GeometricObjects/ShrinkCube.py deleted file mode 100755 index 82d41d3..0000000 --- a/data/examples/GeometricObjects/ShrinkCube.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a cube. - cubeSource = vtkCubeSource() - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(cubeSource.GetOutputPort()) - shrink.SetShrinkFactor(0.9) - - # Create a mapper and actor. - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Tomato')) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - # Render and interact - renderWindow.SetWindowName('ShrinkCube') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/SourceObjectsDemo.md b/data/examples/GeometricObjects/SourceObjectsDemo.md deleted file mode 100644 index f60dc4f..0000000 --- a/data/examples/GeometricObjects/SourceObjectsDemo.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Examples of source objects that procedurally generate polygonal models. These nine images represent just some of the -capability of VTK. From upper left in reading order: sphere, cone, cylinder, cube, plane, text, random point cloud, -disk (with or without hole), and line source. - -!!! info - See [Figure 3-26](../../../VTKBook/03Chapter3/#Figure%203-26) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/GeometricObjects/SourceObjectsDemo.py b/data/examples/GeometricObjects/SourceObjectsDemo.py deleted file mode 100755 index b19f85d..0000000 --- a/data/examples/GeometricObjects/SourceObjectsDemo.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkCylinderSource, - vtkDiskSource, - vtkLineSource, - vtkPlaneSource, - vtkPointSource, - vtkSphereSource, - vtkTextSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - sourceObjects = list() - sourceObjects.append(vtkSphereSource()) - sourceObjects[-1].SetPhiResolution(21) - sourceObjects[-1].SetThetaResolution(21) - - sourceObjects.append(vtkConeSource()) - sourceObjects[-1].SetResolution(51) - - sourceObjects.append(vtkCylinderSource()) - sourceObjects[-1].SetResolution(51) - - sourceObjects.append(vtkCubeSource()) - sourceObjects.append(vtkPlaneSource()) - sourceObjects.append(vtkTextSource()) - sourceObjects[-1].SetText('Hello') - sourceObjects[-1].BackingOff() - - sourceObjects.append(vtkPointSource()) - sourceObjects[-1].SetNumberOfPoints(500) - - sourceObjects.append(vtkDiskSource()) - sourceObjects[-1].SetCircumferentialResolution(51) - - sourceObjects.append(vtkLineSource()) - - renderers = list() - mappers = list() - actors = list() - textmappers = list() - textactors = list() - - # Create one text property for all. - textProperty = vtkTextProperty() - textProperty.SetFontSize(16) - textProperty.SetJustificationToCentered() - textProperty.SetColor(colors.GetColor3d('LightGoldenrodYellow')) - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a source, renderer, mapper, and actor - # for each object. - for i in range(0, len(sourceObjects)): - mappers.append(vtkPolyDataMapper()) - mappers[i].SetInputConnection(sourceObjects[i].GetOutputPort()) - - actors.append(vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actors[i].SetBackfaceProperty(backProperty) - - textmappers.append(vtkTextMapper()) - textmappers[i].SetInput(sourceObjects[i].GetClassName()) - textmappers[i].SetTextProperty(textProperty) - - textactors.append(vtkActor2D()) - textactors[i].SetMapper(textmappers[i]) - textactors[i].SetPosition(120, 16) - renderers.append(vtkRenderer()) - - gridDimensions = 3 - - # We need a renderer even if there is no actor. - for i in range(len(sourceObjects), gridDimensions ** 2): - renderers.append(vtkRenderer()) - - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('SourceObjectsDemo') - rendererSize = 300 - renderWindow.SetSize(rendererSize * gridDimensions, rendererSize * gridDimensions) - - for row in range(0, gridDimensions): - for col in range(0, gridDimensions): - index = row * gridDimensions + col - x0 = float(col) / gridDimensions - y0 = float(gridDimensions - row - 1) / gridDimensions - x1 = float(col + 1) / gridDimensions - y1 = float(gridDimensions - row) / gridDimensions - renderWindow.AddRenderer(renderers[index]) - renderers[index].SetViewport(x0, y0, x1, y1) - - if index > (len(sourceObjects) - 1): - continue - - renderers[index].AddActor(actors[index]) - renderers[index].AddActor(textactors[index]) - renderers[index].SetBackground(colors.GetColor3d('BkgColor')) - renderers[index].ResetCamera() - renderers[index].GetActiveCamera().Azimuth(30) - renderers[index].GetActiveCamera().Elevation(30) - renderers[index].GetActiveCamera().Zoom(0.8) - renderers[index].ResetCameraClippingRange() - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Sphere.md b/data/examples/GeometricObjects/Sphere.md deleted file mode 100644 index b3b65b0..0000000 --- a/data/examples/GeometricObjects/Sphere.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -vtkSphereSource object creates a sphere (represented by polygons) of specified radius centered at the origin. - -The resolution (polygonal discretization) in both the latitude (phi) and longitude (theta) directions can be specified. - -It also is possible to create partial spheres by specifying maximum phi and theta angles. By default, the surface -tessellation of the sphere uses triangles; however you can set LatLongTessellation to produce a tessellation using -quadrilaterals. diff --git a/data/examples/GeometricObjects/Sphere.py b/data/examples/GeometricObjects/Sphere.py deleted file mode 100755 index cbff514..0000000 --- a/data/examples/GeometricObjects/Sphere.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(5.0) - # Make the surface smooth. - sphereSource.SetPhiResolution(100) - sphereSource.SetThetaResolution(100) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphereSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Cornsilk")) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Sphere") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("DarkGreen")) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/TessellatedBoxSource.md b/data/examples/GeometricObjects/TessellatedBoxSource.md deleted file mode 100644 index 59b7b0b..0000000 --- a/data/examples/GeometricObjects/TessellatedBoxSource.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -Generates a box(cube) using vtkTessellatedBoxSource with 6 sides. The faces of the box can be subdivided into multiple -triangles or quads. - -!!! seealso - [Cube](../Cube) generates multiple quads or triangles per side. diff --git a/data/examples/GeometricObjects/TessellatedBoxSource.py b/data/examples/GeometricObjects/TessellatedBoxSource.py deleted file mode 100755 index 5ee3eb0..0000000 --- a/data/examples/GeometricObjects/TessellatedBoxSource.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonExecutionModel import vtkAlgorithm -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersSources import vtkTessellatedBoxSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - bounds = [-10.0, 10.0, 10.0, 20.0, -5.0, 5.0] - - boxSource = vtkTessellatedBoxSource() - boxSource.SetLevel(3) - boxSource.QuadsOn() - boxSource.SetBounds(bounds) - boxSource.SetOutputPointsPrecision(vtkAlgorithm.SINGLE_PRECISION) - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(boxSource.GetOutputPort()) - shrink.SetShrinkFactor(.8) - - # Create a mapper and actor. - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Tomato')) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene. - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - # Render and interact. - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('TessellatedBoxSource') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Tetrahedron.md b/data/examples/GeometricObjects/Tetrahedron.md deleted file mode 100644 index b9dd550..0000000 --- a/data/examples/GeometricObjects/Tetrahedron.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -Tetrahedron. The tetrahedron is a primary three-dimensional cell. The tetrahedron is defined by a list of four nonplanar -points. The tetrahedron has six edges and four triangular faces. diff --git a/data/examples/GeometricObjects/Tetrahedron.py b/data/examples/GeometricObjects/Tetrahedron.py deleted file mode 100755 index 5663b57..0000000 --- a/data/examples/GeometricObjects/Tetrahedron.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - VTK_TETRA, - vtkCellArray, - vtkTetra, - vtkUnstructuredGrid -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 1, 1) - - points.InsertNextPoint(2, 2, 2) - points.InsertNextPoint(3, 2, 2) - points.InsertNextPoint(3, 3, 2) - points.InsertNextPoint(2, 3, 3) - - # The first tetrahedron - unstructuredGrid1 = vtkUnstructuredGrid() - unstructuredGrid1.SetPoints(points) - - tetra = vtkTetra() - - tetra.GetPointIds().SetId(0, 0) - tetra.GetPointIds().SetId(1, 1) - tetra.GetPointIds().SetId(2, 2) - tetra.GetPointIds().SetId(3, 3) - - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - unstructuredGrid1.SetCells(VTK_TETRA, cellArray) - - # The second tetrahedron - unstructuredGrid2 = vtkUnstructuredGrid() - unstructuredGrid2.SetPoints(points) - - tetra = vtkTetra() - - tetra.GetPointIds().SetId(0, 4) - tetra.GetPointIds().SetId(1, 5) - tetra.GetPointIds().SetId(2, 6) - tetra.GetPointIds().SetId(3, 7) - - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - unstructuredGrid2.SetCells(VTK_TETRA, cellArray) - - # Create a mapper and actor - mapper1 = vtkDataSetMapper() - mapper1.SetInputData(unstructuredGrid1) - - actor1 = vtkActor() - actor1.SetMapper(mapper1) - actor1.GetProperty().SetColor(colors.GetColor3d("Cyan")) - - # Create a mapper and actor - mapper2 = vtkDataSetMapper() - mapper2.SetInputData(unstructuredGrid2) - - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().SetColor(colors.GetColor3d("Yellow")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Tetrahedron") - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor1) - renderer.AddActor(actor2) - renderer.SetBackground(colors.GetColor3d("DarkGreen")) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(-10) - renderer.GetActiveCamera().Elevation(-20) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/TextActor.py b/data/examples/GeometricObjects/TextActor.py deleted file mode 100755 index 259795a..0000000 --- a/data/examples/GeometricObjects/TextActor.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextActor -) - - -def main(): - colors = vtkNamedColors() - - # Create a rendering window and renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('TextActor') - renWin.AddRenderer(ren) - - # Create a render window interactor. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create a text actor. - txt = vtkTextActor() - txt.SetInput('Hello World!') - txtprop = txt.GetTextProperty() - txtprop.SetFontFamilyToArial() - txtprop.BoldOn() - txtprop.SetFontSize(36) - txtprop.ShadowOn() - txtprop.SetShadowOffset(4, 4) - txtprop.SetColor(colors.GetColor3d('Cornsilk')) - txt.SetDisplayPosition(20, 30) - - # Assign actor to the renderer. - ren.AddActor(txt) - ren.SetBackground(colors.GetColor3d('DarkGreen')) - - # Enable user interface interactor. - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Triangle.md b/data/examples/GeometricObjects/Triangle.md deleted file mode 100644 index 6f93a14..0000000 --- a/data/examples/GeometricObjects/Triangle.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -The triangle is a primary two-dimensional cell. The triangle is defined by a counterclockwise ordered list of three -points. The order of the points specifies the direction of the surface normal using the right-hand rule. diff --git a/data/examples/GeometricObjects/Triangle.py b/data/examples/GeometricObjects/Triangle.py deleted file mode 100755 index d1689f1..0000000 --- a/data/examples/GeometricObjects/Triangle.py +++ /dev/null @@ -1,73 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangle -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a triangle - points = vtkPoints() - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, 0) - triangle.GetPointIds().SetId(1, 1) - triangle.GetPointIds().SetId(2, 2) - - triangles = vtkCellArray() - triangles.InsertNextCell(triangle) - - # Create a polydata object - trianglePolyData = vtkPolyData() - - # Add the geometry and topology to the polydata - trianglePolyData.SetPoints(points) - trianglePolyData.SetPolys(triangles) - - # Create mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputData(trianglePolyData) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actor.SetMapper(mapper) - - # Create a renderer, render window, and an interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Triangle') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/TriangleStrip.md b/data/examples/GeometricObjects/TriangleStrip.md deleted file mode 100644 index c0b82b4..0000000 --- a/data/examples/GeometricObjects/TriangleStrip.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -The triangle strip is a composite two-dimensional cell consisting of one or more triangles. The points defining the -triangle strip need not lie in a plane. The triangle strip is defined by an ordered list of n+2 points, where n is the -number of triangles. The ordering of the points is such that each set of three points defines a triangle. - -!!! info - See [this wikipedia article](http://en.wikipedia.org/wiki/Triangle_strip) for an explanation. diff --git a/data/examples/GeometricObjects/TriangleStrip.py b/data/examples/GeometricObjects/TriangleStrip.py deleted file mode 100755 index 2857765..0000000 --- a/data/examples/GeometricObjects/TriangleStrip.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangleStrip -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1.5, 1, 0) - - triangleStrip = vtkTriangleStrip() - triangleStrip.GetPointIds().SetNumberOfIds(4) - triangleStrip.GetPointIds().SetId(0, 0) - triangleStrip.GetPointIds().SetId(1, 1) - triangleStrip.GetPointIds().SetId(2, 2) - triangleStrip.GetPointIds().SetId(3, 3) - - cells = vtkCellArray() - cells.InsertNextCell(triangleStrip) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetStrips(cells) - - # Create an actor and mapper - mapper = vtkDataSetMapper() - mapper.SetInputData(polydata) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actor.GetProperty().SetRepresentationToWireframe() - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('TriangleStrip') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/GeometricObjects/Vertex.md b/data/examples/GeometricObjects/Vertex.md deleted file mode 100644 index 561eb52..0000000 --- a/data/examples/GeometricObjects/Vertex.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -The vertex is a primary zero-dimensional cell. It is defined by a single point. diff --git a/data/examples/GeometricObjects/Vertex.py b/data/examples/GeometricObjects/Vertex.py deleted file mode 100755 index cb367cf..0000000 --- a/data/examples/GeometricObjects/Vertex.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkVertex -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - - vertex = vtkVertex() - vertex.GetPointIds().SetId(0, 0) - - vertices = vtkCellArray() - vertices.InsertNextCell(vertex) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetVerts(vertices) - - # Setup actor and mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(polydata) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(30) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('Vertex') - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ColorEdges.py b/data/examples/Graphs/ColorEdges.py deleted file mode 100755 index 8e0dee8..0000000 --- a/data/examples/Graphs/ColorEdges.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkIntArray, - vtkLookupTable -) -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkViewsCore import vtkViewTheme -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - graph = vtkMutableDirectedGraph() - # Create a graph - v1 = graph.AddVertex() - v2 = graph.AddVertex() - v3 = graph.AddVertex() - - graph.AddGraphEdge(v1, v2) - graph.AddGraphEdge(v2, v3) - - # Create the color array - edgeColors = vtkIntArray() - edgeColors.SetNumberOfComponents(1) - edgeColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) - lookupTable.SetTableValue(0, colors.GetColor4d('Red')) - lookupTable.SetTableValue(1, colors.GetColor4d('Lime')) - lookupTable.Build() - - edgeColors.InsertNextValue(0) - edgeColors.InsertNextValue(1) - - # Add the color array to the graph - graph.GetEdgeData().AddArray(edgeColors) - - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetLayoutStrategy('Simple 2D') - graphLayoutView.GetLayoutStrategy().SetEdgeWeightField('Graphs') - graphLayoutView.GetLayoutStrategy().SetWeightEdges(1) - graphLayoutView.SetEdgeColorArrayName('Color') - graphLayoutView.SetEdgeLabelVisibility(1) - graphLayoutView.ColorEdgesOn() - - theme = vtkViewTheme() - theme.SetCellLookupTable(lookupTable) - - graphLayoutView.ApplyViewTheme(theme) - graphLayoutView.ResetCamera() - graphLayoutView.GetRenderer().GetActiveCamera().Zoom(0.8) - graphLayoutView.Render() - graphLayoutView.GetLayoutStrategy().SetRandomSeed(0) - graphLayoutView.GetInteractor().Initialize() - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ColorVertexLabels.py b/data/examples/Graphs/ColorVertexLabels.py deleted file mode 100755 index 6f37920..0000000 --- a/data/examples/Graphs/ColorVertexLabels.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIntArray -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkViewsInfovis import ( - vtkGraphLayoutView, - vtkRenderedGraphRepresentation -) - - -def main(): - colors = vtkNamedColors() - - # Create a graph - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddVertex() - graph.AddEdge(v1, v2) - - # Create an array for the vertex labels - vertexIDs = vtkIntArray() - vertexIDs.SetNumberOfComponents(1) - vertexIDs.SetName('VertexIDs') - - # Set the vertex labels - vertexIDs.InsertNextValue(0) - vertexIDs.InsertNextValue(1) - - # Add the array to the graph - graph.GetVertexData().AddArray(vertexIDs) - - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetVertexLabelVisibility(1) - - rGraph = vtkRenderedGraphRepresentation() - rGraph.SafeDownCast(graphLayoutView.GetRepresentation()).GetVertexLabelTextProperty().SetColor( - colors.GetColor3d('Red')) - graphLayoutView.SetLayoutStrategyToSimple2D() - graphLayoutView.SetVertexLabelArrayName('VertexIDs') - graphLayoutView.SetVertexLabelVisibility(True) - graphLayoutView.ResetCamera() - graphLayoutView.GetRenderer().GetActiveCamera().Zoom(0.8) - graphLayoutView.Render() - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ColorVerticesLookupTable.py b/data/examples/Graphs/ColorVerticesLookupTable.py deleted file mode 100755 index ecaa7ef..0000000 --- a/data/examples/Graphs/ColorVerticesLookupTable.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkIntArray, - vtkLookupTable, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkViewsCore import vtkViewTheme -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - # Create a graph - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddVertex() - v3 = graph.AddVertex() - graph.AddEdge(v1, v2) - graph.AddEdge(v2, v3) - - # Manually set the position of the vertices - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(2, 0, 0) - - graph.SetPoints(points) - - # Create the color array - vertexColors = vtkIntArray() - vertexColors.SetNumberOfComponents(1) - vertexColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(3) - lookupTable.SetTableValue(0, colors.GetColor4d('Red')) - lookupTable.SetTableValue(1, colors.GetColor4d('White')) - lookupTable.SetTableValue(2, colors.GetColor4d('Lime')) - lookupTable.Build() - - vertexColors.InsertNextValue(0) - vertexColors.InsertNextValue(1) - vertexColors.InsertNextValue(2) - - # Add the color array to the graph - graph.GetVertexData().AddArray(vertexColors) - - # Visualize - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetLayoutStrategyToPassThrough() - graphLayoutView.SetVertexColorArrayName('Color') - graphLayoutView.ColorVerticesOn() - - theme = vtkViewTheme() - theme.SetPointLookupTable(lookupTable) - - graphLayoutView.ApplyViewTheme(theme) - graphLayoutView.ResetCamera() - graphLayoutView.GetInteractor().Initialize() - graphLayoutView.GetRenderer().GetActiveCamera().Zoom(0.8) - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ConstructGraph.md b/data/examples/Graphs/ConstructGraph.md deleted file mode 100644 index c0cce53..0000000 --- a/data/examples/Graphs/ConstructGraph.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows how to construct a simple graph. diff --git a/data/examples/Graphs/ConstructGraph.py b/data/examples/Graphs/ConstructGraph.py deleted file mode 100755 index b9d716d..0000000 --- a/data/examples/Graphs/ConstructGraph.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkMutableUndirectedGraph -from vtkmodules.vtkInfovisLayout import vtkForceDirectedLayoutStrategy -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddEdge(v1, v2) - print('Number of vertices:', g.GetNumberOfVertices()) - print('Number of edges:', g.GetNumberOfEdges()) - - g.AddEdge(v1, v2) - print('Number of vertices:', g.GetNumberOfVertices()) - print('Number of edges:', g.GetNumberOfEdges()) - - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.ResetCamera() - graph_layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - graph_layout_view.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - graph_layout_view.GetRenderWindow().SetWindowName('ConstructGraph') - graph_layout_view.Render() - graph_layout_view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ConstructTree.py b/data/examples/Graphs/ConstructTree.py deleted file mode 100755 index 0b0a781..0000000 --- a/data/examples/Graphs/ConstructTree.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import ( - vtkMutableDirectedGraph, - vtkTree -) -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddChild(v1) - graph.AddChild(v1) - graph.AddChild(v2) - - # equivalent to: - # V1 = g.AddVertex() - # V2 = g.AddVertex() - # V3 = g.AddVertex() - # V4 = g.AddVertex() - - # g.AddEdge ( V1, V2 ) - # g.AddEdge ( V1, V3 ) - # g.AddEdge ( V2, V4 ) - - tree = vtkTree() - success = tree.CheckedShallowCopy(graph) - print('Success?', success) - # std::cout << 'Success? ' << success << std::endl - - treeLayoutView = vtkGraphLayoutView() - treeLayoutView.AddRepresentationFromInput(tree) - treeLayoutView.SetLayoutStrategyToTree() - treeLayoutView.ResetCamera() - treeLayoutView.Render() - treeLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/CreateTree.md b/data/examples/Graphs/CreateTree.md deleted file mode 100644 index 662953b..0000000 --- a/data/examples/Graphs/CreateTree.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -We create the tree, and label the vertices and edges. - -!!! info - This is an update of the original example found in `vtk/Examples/Infovis/Cxx/CreateTree.cxx`. diff --git a/data/examples/Graphs/CreateTree.py b/data/examples/Graphs/CreateTree.py deleted file mode 100755 index 22e964d..0000000 --- a/data/examples/Graphs/CreateTree.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -# This example creates a tree and labels the vertices and edges. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkStringArray -from vtkmodules.vtkCommonDataModel import ( - vtkMutableDirectedGraph, - vtkTree -) -from vtkmodules.vtkViewsCore import vtkViewTheme -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - graph = vtkMutableDirectedGraph() - - a = graph.AddVertex() - b = graph.AddChild(a) - c = graph.AddChild(a) - d = graph.AddChild(b) - e = graph.AddChild(c) - f = graph.AddChild(c) - - vertex_labels = vtkStringArray() - vertex_labels.SetName('VertexLabel') - vertex_labels.InsertValue(a, 'a') - vertex_labels.InsertValue(b, 'b') - vertex_labels.InsertValue(c, 'c') - vertex_labels.InsertValue(d, 'd') - vertex_labels.InsertValue(e, 'e') - vertex_labels.InsertValue(f, 'f') - graph.GetVertexData().AddArray(vertex_labels) - edge_labels = vtkStringArray() - edge_labels.SetName('EdgeLabel') - edge_labels.InsertValue(graph.GetEdgeId(a, b), 'a -> b') - edge_labels.InsertValue(graph.GetEdgeId(a, c), 'a -> c') - edge_labels.InsertValue(graph.GetEdgeId(b, d), 'b -> d') - edge_labels.InsertValue(graph.GetEdgeId(c, e), 'c -> e') - edge_labels.InsertValue(graph.GetEdgeId(c, f), 'c -> f') - graph.GetEdgeData().AddArray(edge_labels) - - tree = vtkTree() - valid_tree = tree.CheckedShallowCopy(graph) - if not valid_tree: - print('Invalid tree') - return - - view = vtkGraphLayoutView() - view.SetRepresentationFromInput(tree) - # Apply a theme to the views - theme = vtkViewTheme() - view.ApplyViewTheme(theme.CreateMellowTheme()) - view.SetVertexColorArrayName('VertexDegree') - view.SetColorVertices(True) - view.SetVertexLabelArrayName('VertexLabel') - view.SetVertexLabelVisibility(True) - view.SetEdgeLabelArrayName('EdgeLabel') - view.SetEdgeLabelVisibility(True) - view.SetLayoutStrategyToTree() - - view.ResetCamera() - view.GetRenderWindow().SetSize(600, 600) - view.GetRenderWindow().SetWindowName('CreateTree') - view.GetRenderWindow().Render() - view.GetInteractor().Initialize() - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/EdgeWeights.md b/data/examples/Graphs/EdgeWeights.md deleted file mode 100644 index 6ab66b0..0000000 --- a/data/examples/Graphs/EdgeWeights.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -* Contributed by Jim McCusker diff --git a/data/examples/Graphs/EdgeWeights.py b/data/examples/Graphs/EdgeWeights.py deleted file mode 100755 index e17b9b2..0000000 --- a/data/examples/Graphs/EdgeWeights.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkInfovisLayout import vtkForceDirectedLayoutStrategy -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - g = vtkMutableDirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() - - # Create a fully connected graph - g.AddGraphEdge(v1, v2) - g.AddGraphEdge(v2, v3) - g.AddGraphEdge(v1, v3) - - # Create the edge weight array - weights = vtkDoubleArray() - weights.SetNumberOfComponents(1) - weights.SetName('Weights') - - # Set the edge weights - weights.InsertNextValue(1.0) - weights.InsertNextValue(1.0) - weights.InsertNextValue(2.0) - - # Add the edge weight array to the graph - g.GetEdgeData().AddArray(weights) - - print('Number of edges:', g.GetNumberOfEdges()) - - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.AddRepresentationFromInput(g) - graph_layout_view.GetLayoutStrategy().SetEdgeWeightField('Weights') - graph_layout_view.GetLayoutStrategy().SetWeightEdges(1) - graph_layout_view.SetEdgeLabelArrayName('Weights') - graph_layout_view.EdgeLabelVisibilityOn() - graph_layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - graph_layout_view.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - graph_layout_view.GetRenderWindow().SetWindowName('EdgeWeights') - graph_layout_view.ResetCamera() - graph_layout_view.Render() - graph_layout_view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/GraphToPolyData.md b/data/examples/Graphs/GraphToPolyData.md deleted file mode 100644 index c0e1d38..0000000 --- a/data/examples/Graphs/GraphToPolyData.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a simple graph and then converts it to a polydata for visualization using Paraview. diff --git a/data/examples/Graphs/GraphToPolyData.py b/data/examples/Graphs/GraphToPolyData.py deleted file mode 100755 index c03e421..0000000 --- a/data/examples/Graphs/GraphToPolyData.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkMutableUndirectedGraph -from vtkmodules.vtkFiltersSources import vtkGraphToPolyData -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - # Create a graph - g = vtkMutableUndirectedGraph() - - # Add 4 vertices to the graph - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() - v4 = g.AddVertex() - - # Add 3 edges to the graph - g.AddEdge(v1, v2) - g.AddEdge(v1, v3) - g.AddEdge(v1, v4) - - # Create 4 points - one for each vertex - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - points.InsertNextPoint(0.0, 0.0, 1.0) - - # Add the coordinates of the points to the graph - g.SetPoints(points) - - # Convert the graph to a polydata - graphToPolyData = vtkGraphToPolyData() - graphToPolyData.SetInputData(g) - graphToPolyData.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(graphToPolyData.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Green')) - - # Render and interact - renderWindow.SetWindowName('GraphToPolyData') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/LabelVerticesAndEdges.md b/data/examples/Graphs/LabelVerticesAndEdges.md deleted file mode 100644 index 2c69f42..0000000 --- a/data/examples/Graphs/LabelVerticesAndEdges.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example sets and displays labels of vertices and edges of a graph. diff --git a/data/examples/Graphs/LabelVerticesAndEdges.py b/data/examples/Graphs/LabelVerticesAndEdges.py deleted file mode 100755 index 7f2a03e..0000000 --- a/data/examples/Graphs/LabelVerticesAndEdges.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkIntArray -) -from vtkmodules.vtkCommonDataModel import vtkMutableUndirectedGraph -from vtkmodules.vtkInfovisLayout import vtkCircularLayoutStrategy -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() - - # Create a fully connected graph - g.AddEdge(v1, v2) - g.AddEdge(v2, v3) - g.AddEdge(v1, v3) - - # Create the edge weight array - weights = vtkDoubleArray() - weights.SetNumberOfComponents(1) - weights.SetName('Weights') - - # Set the edge weights - weights.InsertNextValue(1.0) - weights.InsertNextValue(1.0) - weights.InsertNextValue(2.0) - - # Create an array for the vertex labels - vertexIDs = vtkIntArray() - vertexIDs.SetNumberOfComponents(1) - vertexIDs.SetName('VertexIDs') - - # Set the vertex labels - vertexIDs.InsertNextValue(0) - vertexIDs.InsertNextValue(1) - vertexIDs.InsertNextValue(2) - - # Add the edge weight array to the graph - g.GetEdgeData().AddArray(weights) - g.GetVertexData().AddArray(vertexIDs) - - circularLayoutStrategy = vtkCircularLayoutStrategy() - - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(g) - - graphLayoutView.SetLayoutStrategy(circularLayoutStrategy) - graphLayoutView.SetVertexLabelVisibility(1) - graphLayoutView.SetEdgeLabelVisibility(1) - graphLayoutView.SetEdgeLabelArrayName('Weights') # default is 'labels' - graphLayoutView.SetVertexLabelArrayName('VertexIDs') # default is 'labels' - graphLayoutView.GetRepresentation().GetVertexLabelTextProperty().SetColor( - colors.GetColor3d('Yellow')) - graphLayoutView.GetRepresentation().GetEdgeLabelTextProperty().SetColor( - colors.GetColor3d('Lime')) - graphLayoutView.ResetCamera() - graphLayoutView.Render() - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/NOVCAGraph.md b/data/examples/Graphs/NOVCAGraph.md deleted file mode 100644 index 0fbf97e..0000000 --- a/data/examples/Graphs/NOVCAGraph.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - - - -* This example shows how to construct a graph to visualize it in ParaView/VisIt using the VTK output file testVertex.vtu. - -* Contributed by Sanjaya Gajurel, Case Western Reserve University diff --git a/data/examples/Graphs/NOVCAGraph.py b/data/examples/Graphs/NOVCAGraph.py deleted file mode 100755 index dcfe517..0000000 --- a/data/examples/Graphs/NOVCAGraph.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import ( - vtkIntArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - VTK_LINE, - vtkCellArray, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOXML import vtkXMLUnstructuredGridWriter - - -def get_program_parameters(): - import argparse - description = 'Building a graph using Unstructured Grid & dumping it into a vtk file.' - epilogue = ''' - Building a graph using Unstructured Grid & dumping it into a vtk file, to be visualized using ParaView. - - The generated file can then be used in ParaView/VisIt. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtk filename, e.g. vertex.vtu.', nargs='?', const='vertex.vtu', - type=str, default='testVertex.vtu') - args = parser.parse_args() - return args.filename - - -def main(): - fn = get_program_parameters() - - pointSource = vtkPointSource() - pointSource.Update() - - # Create an integer array to store vertex id data & link it with its degree value as a scalar. - degree = vtkIntArray() - degree.SetNumberOfComponents(1) - degree.SetName('degree') - degree.SetNumberOfTuples(7) - degree.SetValue(0, 2) - degree.SetValue(1, 1) - degree.SetValue(2, 3) - degree.SetValue(3, 3) - degree.SetValue(4, 4) - degree.SetValue(5, 2) - degree.SetValue(6, 1) - - pointSource.GetOutput().GetPointData().AddArray(degree) - - # Assign co-ordinates for vertices - Points = vtkPoints() - Points.InsertNextPoint(0, 1, 0) - Points.InsertNextPoint(0, 0, 0) - Points.InsertNextPoint(1, 1, 0) - Points.InsertNextPoint(1, 0, 0) - Points.InsertNextPoint(2, 1, 0) - Points.InsertNextPoint(2, 0, 0) - Points.InsertNextPoint(3, 0, 0) - - # Establish the specified edges using CellArray - line = vtkCellArray() - line.Allocate(8) - line.InsertNextCell(2) - line.InsertCellPoint(0) - line.InsertCellPoint(1) - line.InsertNextCell(2) - line.InsertCellPoint(0) - line.InsertCellPoint(2) - line.InsertNextCell(2) - line.InsertCellPoint(2) - line.InsertCellPoint(3) - line.InsertNextCell(2) - line.InsertCellPoint(2) - line.InsertCellPoint(4) - line.InsertNextCell(2) - line.InsertCellPoint(3) - line.InsertCellPoint(4) - line.InsertNextCell(2) - line.InsertCellPoint(3) - line.InsertCellPoint(5) - line.InsertNextCell(2) - line.InsertCellPoint(4) - line.InsertCellPoint(5) - line.InsertNextCell(2) - line.InsertCellPoint(4) - line.InsertCellPoint(6) - - # Add the vertices and edges to unstructured Grid - G = vtkUnstructuredGrid() - G.GetPointData().SetScalars(degree) - G.SetPoints(Points) - G.SetCells(VTK_LINE, line) - - # Dump the graph in VTK unstructured format (.vtu) - gw = vtkXMLUnstructuredGridWriter() - gw.SetFileName(fn) - gw.SetInputData(G) - gw.Write() - print('---> ') - - print('Feed the vertex.vtu file in ParaView/VisIt.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/RandomGraphSource.py b/data/examples/Graphs/RandomGraphSource.py deleted file mode 100755 index 30487de..0000000 --- a/data/examples/Graphs/RandomGraphSource.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkInfovisCore import vtkRandomGraphSource -from vtkmodules.vtkInfovisLayout import vtkForceDirectedLayoutStrategy -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - random_graph_source = vtkRandomGraphSource() - random_graph_source.SetNumberOfVertices(5) - random_graph_source.SetNumberOfEdges(4) - # This ensures repeatable results for testing. Turn this off for real use. - random_graph_source.SetSeed(123) - random_graph_source.Update() - - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(random_graph_source.GetOutput()) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - graph_layout_view.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - graph_layout_view.GetRenderWindow().SetWindowName('RandomGraphSource') - graph_layout_view.Render() - graph_layout_view.ResetCamera() - graph_layout_view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/ScaleVertices.md b/data/examples/Graphs/ScaleVertices.md deleted file mode 100644 index 523d70a..0000000 --- a/data/examples/Graphs/ScaleVertices.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Scale the vertices based on a data array. diff --git a/data/examples/Graphs/ScaleVertices.py b/data/examples/Graphs/ScaleVertices.py deleted file mode 100755 index 186d2b3..0000000 --- a/data/examples/Graphs/ScaleVertices.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkIntArray, - vtkLookupTable -) -from vtkmodules.vtkCommonDataModel import vtkMutableUndirectedGraph -from vtkmodules.vtkInfovisLayout import vtkForceDirectedLayoutStrategy -from vtkmodules.vtkRenderingCore import vtkGraphToGlyphs -from vtkmodules.vtkViewsCore import vtkViewTheme -from vtkmodules.vtkViewsInfovis import ( - vtkGraphLayoutView, - vtkRenderedGraphRepresentation -) - - -def main(): - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddEdge(v1, v2) - g.AddEdge(v1, v2) - - scales = vtkFloatArray() - scales.SetNumberOfComponents(1) - scales.SetName('Scales') - scales.InsertNextValue(2.0) - scales.InsertNextValue(5.0) - - # Add the scale array to the graph - g.GetVertexData().AddArray(scales) - - # Create the color array - vertexColors = vtkIntArray() - vertexColors.SetNumberOfComponents(1) - vertexColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) - lookupTable.SetTableValue(0, colors.GetColor4d('Yellow')) - lookupTable.SetTableValue(1, colors.GetColor4d('Lime')) - lookupTable.Build() - - vertexColors.InsertNextValue(0) - vertexColors.InsertNextValue(1) - - # Add the color array to the graph - g.GetVertexData().AddArray(vertexColors) - - theme = vtkViewTheme() - theme.SetPointLookupTable(lookupTable) - - force_directed = vtkForceDirectedLayoutStrategy() - - layout_view = vtkGraphLayoutView() - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - layout_view.SetLayoutStrategyToForceDirected() - layout_view.AddRepresentationFromInput(g) - layout_view.ApplyViewTheme(theme) - layout_view.ScaledGlyphsOn() - layout_view.SetScalingArrayName('Scales') - layout_view.SetVertexColorArrayName('Color') - layout_view.ColorVerticesOn() - rGraph = vtkRenderedGraphRepresentation() - gGlyph = vtkGraphToGlyphs() - rGraph.SafeDownCast(layout_view.GetRepresentation()).SetGlyphType(gGlyph.CIRCLE) - layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - layout_view.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - layout_view.GetRenderWindow().SetWindowName('ScaleVertices') - layout_view.Render() - layout_view.ResetCamera() - layout_view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/SelectedVerticesAndEdges.md b/data/examples/Graphs/SelectedVerticesAndEdges.md deleted file mode 100644 index bb077a1..0000000 --- a/data/examples/Graphs/SelectedVerticesAndEdges.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -* Contributed by Eric Monson diff --git a/data/examples/Graphs/SelectedVerticesAndEdges.py b/data/examples/Graphs/SelectedVerticesAndEdges.py deleted file mode 100755 index 6d4c37d..0000000 --- a/data/examples/Graphs/SelectedVerticesAndEdges.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkInfovisCore import vtkRandomGraphSource -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - -source = vtkRandomGraphSource() -source.Update() - -view = vtkGraphLayoutView() -view.AddRepresentationFromInputConnection(source.GetOutputPort()) - - -def selectionCallback(caller, event): - # In C++ there is some extra data passed to the callback, but in Python - # the callback data is lost... - - # There should be two selection nodes, but which one is vertices and which - # is edges does not seem to be guaranteed... - sel = caller.GetCurrentSelection() - node0 = sel.GetNode(0) - node0_field_type = node0.GetFieldType() - sel_list0 = caller.GetCurrentSelection().GetNode(0).GetSelectionList() - node1 = sel.GetNode(1) - node1_field_type = node1.GetFieldType() - sel_list1 = caller.GetCurrentSelection().GetNode(1).GetSelectionList() - - if (sel_list0.GetNumberOfTuples() > 0): - printFieldType(node0_field_type) - for ii in range(sel_list0.GetNumberOfTuples()): - print('\t', sel_list0.GetValue(ii)) - - if (sel_list1.GetNumberOfTuples() > 0): - printFieldType(node1_field_type) - for ii in range(sel_list1.GetNumberOfTuples()): - print('\t', sel_list1.GetValue(ii)) - - print('- - -') - - -def printFieldType(field_type): - if field_type == 3: - print('Vertices Selected:') - elif field_type == 4: - print('Edges Selected:') - else: - print('Unknown type:') - - -def main(): - rep = view.GetRepresentation(0) - - # The vtkRenderedGraphRepresentation should already have a vtkAnnotationLink, - # so we just want to grab it and add an observer with our callback function - # attached - link = rep.GetAnnotationLink() - link.AddObserver('AnnotationChangedEvent', selectionCallback) - - view.GetRenderWindow().SetSize(600, 600) - view.ResetCamera() - view.Render() - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/SideBySideGraphs.py b/data/examples/Graphs/SideBySideGraphs.py deleted file mode 100755 index 13fdcbb..0000000 --- a/data/examples/Graphs/SideBySideGraphs.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkMutableUndirectedGraph -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor -) -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - # Create the first graph - g0 = vtkMutableUndirectedGraph() - - v1 = g0.AddVertex() - v2 = g0.AddVertex() - v3 = g0.AddVertex() - - g0.AddEdge(v1, v2) - g0.AddEdge(v2, v3) - g0.AddEdge(v1, v3) - - # Create points - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 1.0, 0.0) - - # Add the coordinates of the points to the graph - g0.SetPoints(points) - - # Create the second graph - g1 = vtkMutableUndirectedGraph() - - v1 = g1.AddVertex() - v2 = g1.AddVertex() - - g1.AddEdge(v1, v2) - - # Create points - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - - # Add the coordinates of the points to the graph - g1.SetPoints(points) - - # There will be one render window - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 300) - ren_win.SetWindowName('SideBySideGraphs') - - iren = vtkRenderWindowInteractor() - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - left_viewport = [0.0, 0.0, 0.5, 1.0] - right_viewport = [0.5, 0.0, 1.0, 1.0] - - graph_layout_view0 = vtkGraphLayoutView() - graph_layout_view0.SetRenderWindow(ren_win) - graph_layout_view0.SetInteractor(iren) - graph_layout_view0.GetRenderer().SetViewport(left_viewport) - graph_layout_view0.AddRepresentationFromInput(g0) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view0.SetLayoutStrategy(force_directed) - graph_layout_view0.SetLayoutStrategyToForceDirected() - graph_layout_view0.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - graph_layout_view0.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - graph_layout_view0.Render() - graph_layout_view0.ResetCamera() - - graph_layout_view1 = vtkGraphLayoutView() - graph_layout_view1.SetRenderWindow(ren_win) - graph_layout_view1.SetInteractor(iren) - graph_layout_view1.GetRenderer().SetViewport(right_viewport) - graph_layout_view1.AddRepresentationFromInput(g0) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view1.SetLayoutStrategy(force_directed) - graph_layout_view1.SetLayoutStrategyToForceDirected() - graph_layout_view1.AddRepresentationFromInput(g1) - graph_layout_view1.GetRenderer().SetBackground(colors.GetColor3d('DarkGreen')) - graph_layout_view1.GetRenderer().SetBackground2(colors.GetColor3d('ForestGreen')) - graph_layout_view1.Render() - graph_layout_view1.ResetCamera() - - # graph_layout_view0.GetInteractor().Start() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/VisualizeDirectedGraph.py b/data/examples/Graphs/VisualizeDirectedGraph.py deleted file mode 100755 index 6363ff5..0000000 --- a/data/examples/Graphs/VisualizeDirectedGraph.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersSources import ( - vtkGlyphSource2D, - vtkGraphToPolyData -) -from vtkmodules.vtkInfovisLayout import ( - vtkGraphLayout, - vtkSimple2DLayoutStrategy -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper -) -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - g = vtkMutableDirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() - - g.AddEdge(v1, v2) - g.AddEdge(v2, v3) - g.AddEdge(v3, v1) - - # Do layout manually before handing graph to the view. - # This allows us to know the positions of edge arrows. - graphLayoutView = vtkGraphLayoutView() - - layout = vtkGraphLayout() - strategy = vtkSimple2DLayoutStrategy() - layout.SetInputData(g) - layout.SetLayoutStrategy(strategy) - - # Tell the view to use the vertex layout we provide - graphLayoutView.SetLayoutStrategyToPassThrough() - # The arrows will be positioned on a straight line between two - # vertices so tell the view not to draw arcs for parallel edges - graphLayoutView.SetEdgeLayoutStrategyToPassThrough() - - # Add the graph to the view. This will render vertices and edges, - # but not edge arrows. - graphLayoutView.AddRepresentationFromInputConnection(layout.GetOutputPort()) - - # Manually create an actor containing the glyphed arrows. - graphToPoly = vtkGraphToPolyData() - graphToPoly.SetInputConnection(layout.GetOutputPort()) - graphToPoly.EdgeGlyphOutputOn() - - # Set the position (0: edge start, 1: edge end) where - # the edge arrows should go. - graphToPoly.SetEdgeGlyphPosition(0.98) - - # Make a simple edge arrow for glyphing. - arrowSource = vtkGlyphSource2D() - arrowSource.SetGlyphTypeToEdgeArrow() - arrowSource.SetScale(0.1) - arrowSource.Update() - - # Use Glyph3D to repeat the glyph on all edges. - arrowGlyph = vtkGlyph3D() - arrowGlyph.SetInputConnection(0, graphToPoly.GetOutputPort(1)) - arrowGlyph.SetInputConnection(1, arrowSource.GetOutputPort()) - - # Add the edge arrow actor to the view. - arrowMapper = vtkPolyDataMapper() - arrowMapper.SetInputConnection(arrowGlyph.GetOutputPort()) - arrowActor = vtkActor() - arrowActor.SetMapper(arrowMapper) - graphLayoutView.GetRenderer().AddActor(arrowActor) - - graphLayoutView.ResetCamera() - graphLayoutView.Render() - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Graphs/VisualizeGraph.md b/data/examples/Graphs/VisualizeGraph.md deleted file mode 100644 index e7a1b78..0000000 --- a/data/examples/Graphs/VisualizeGraph.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -* Contributed by Jim McCusker - -!!! note - AddEdge() is not enabled through python, but AddGraphEdge() is. diff --git a/data/examples/Graphs/VisualizeGraph.py b/data/examples/Graphs/VisualizeGraph.py deleted file mode 100755 index eb1b56e..0000000 --- a/data/examples/Graphs/VisualizeGraph.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import vtkMutableDirectedGraph -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - g = vtkMutableDirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddGraphEdge(v1, v2) - g.AddGraphEdge(v1, v2) - - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(g) - graphLayoutView.SetLayoutStrategy('Simple 2D') - graphLayoutView.ResetCamera() - graphLayoutView.Render() - - graphLayoutView.GetLayoutStrategy().SetRandomSeed(0) - - graphLayoutView.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/HyperTreeGrid/HyperTreeGridSource.py b/data/examples/HyperTreeGrid/HyperTreeGridSource.py deleted file mode 100755 index 77d7c40..0000000 --- a/data/examples/HyperTreeGrid/HyperTreeGridSource.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersHyperTree import vtkHyperTreeGridToUnstructuredGrid -from vtkmodules.vtkFiltersSources import vtkHyperTreeGridSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - # Create hyper tree grid source - - descriptor = 'RRR .R. .RR ..R ..R .R.|R.......................... ' \ - '........................... ........................... ' \ - '.............R............. ....RR.RR........R......... ' \ - '.....RRRR.....R.RR......... ........................... ' \ - '........................... ' \ - '...........................|........................... ' \ - '........................... ........................... ' \ - '...RR.RR.......RR.......... ........................... ' \ - 'RR......................... ........................... ' \ - '........................... ........................... ' \ - '........................... ........................... ' \ - '........................... ........................... ' \ - '............RRR............|........................... ' \ - '........................... .......RR.................. ' \ - '........................... ........................... ' \ - '........................... ........................... ' \ - '........................... ........................... ' \ - '........................... ' \ - '...........................|........................... ' \ - '...........................' - - source = vtkHyperTreeGridSource() - source.SetMaximumLevel(6) - source.SetDimensions(4, 4, 3) # GridCell 3, 3, 2 - source.SetGridScale(1.5, 1.0, 0.7) - source.SetBranchFactor(4) - source.SetDescriptor(descriptor) - source.Update() - - # Hyper tree grid to unstructured grid filter - htg2ug = vtkHyperTreeGridToUnstructuredGrid() - htg2ug.SetInputConnection(source.GetOutputPort()) - htg2ug.Update() - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(htg2ug.GetOutputPort()) - shrink.SetShrinkFactor(.8) - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Burlywood')) - - # Create the RenderWindow, Renderer and Interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.AddActor(actor) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(150) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCameraClippingRange() - - renderWindow.SetSize(640, 480) - renderWindow.Render() - renderWindow.SetWindowName('HyperTreeGridSource') - - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/3DSImporter.md b/data/examples/IO/3DSImporter.md deleted file mode 100644 index 3f56470..0000000 --- a/data/examples/IO/3DSImporter.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example illustrates Importing files in VTK. An importer creates a vtkRenderWindow that describes the scene. - -!!! info - See [Figure 4-13](../../../VTKBook/04Chapter4/#Figure%204-13) in [Chapter 4](../../../VTKBook/04Chapter4) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/IO/3DSImporter.py b/data/examples/IO/3DSImporter.py deleted file mode 100755 index c294f35..0000000 --- a/data/examples/IO/3DSImporter.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImport import vtk3DSImporter -from vtkmodules.vtkRenderingCore import ( - vtkCamera, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - importer = vtk3DSImporter() - importer.SetFileName(fileName) - importer.ComputeNormalsOn() - - colors = vtkNamedColors() - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - - renWin.AddRenderer(renderer) - renderer.SetBackground2(colors.GetColor3d('Gold')) - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.GradientBackgroundOn() - - iren.SetRenderWindow(renWin) - importer.SetRenderWindow(renWin) - importer.Update() - - # actors = vtkActorCollection() - actors = renderer.GetActors() - print('There are', actors.GetNumberOfItems(), 'actors.') - - renWin.SetWindowName('3DSImporter') - renWin.Render() - camera = vtkCamera() - camera.SetPosition(0, -1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(150) - camera.Elevation(30) - - renderer.SetActiveCamera(camera) - renderer.ResetCamera() - renderer.ResetCameraClippingRange() - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Importing a 3ds file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='iflamingo.3ds.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/CSVReadEdit.md b/data/examples/IO/CSVReadEdit.md deleted file mode 100644 index 1c34240..0000000 --- a/data/examples/IO/CSVReadEdit.md +++ /dev/null @@ -1,47 +0,0 @@ -### Description - -This example loads a CSV file, edits it and visualises the result. - -It demonstrates the use of [pandas](https://pandas.pydata.org/) to read and edit the CSV input file, then use [numpy](https://numpy.org/) and the vtk-numpy interface for building the resultant vtkPolyData object based on the options selected. - -The key thing about `pandas` is it can read/write data in various formats: CSV and text files, Microsoft Excel, SQL databases, and the fast HDF5 format. It is highly optimized for performance and the DataFrame object allows for extensive row/column manipulation. So we can edit the data, creating new columns, and, finally, select only relevant columns for further analysis by VTK. - -In this case we select columns using numpy to create the three-dimensional point data array data. The numpy objects are then converted to vtk data structures and integrated into a vtkPolyData object. - -The process is this: - -``` text -CSV->pandas(read/edit/select)->numpy->numpy_to_vtk->vtkPolyData -``` - -Note how easy it is the get the three-dimensional coordinates using numpy. - -The files used to generate the example are: - -``` text -/LakeGininderra.csv -/LakeGininderra.kmz -``` - -Where: - -- `` is the path to `?vtk-?examples/src/Testing/Data` -- `LakeGininderra.csv` is the CSV file used by this program. -- `LakeGininderra.kmz` can be loaded into Google Earth to display the track. - -The parameters for typical usage are something like this: - -``` text -/LakeGininderra.csv -u -c -pResults -``` - -
- -
A Google Earth image of the track.
-
- -Further information: - -- [Easy Data Conversion to VTK with Python](https://www.kitware.com/easy-data-conversion-to-vtk-with-python/). -- [Installing pandas](https://pandas.pydata.org/docs/getting_started/install.html). -- [VTK Examples - New CSV Examples](https://discourse.vtk.org/t/vtk-examples-new-csv-examples/11632) diff --git a/data/examples/IO/CSVReadEdit.py b/data/examples/IO/CSVReadEdit.py deleted file mode 100755 index 82af7c6..0000000 --- a/data/examples/IO/CSVReadEdit.py +++ /dev/null @@ -1,344 +0,0 @@ -#!/usr/bin/env python3 - -from pathlib import Path - -import pandas as pd -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtk.util import numpy_support -from vtkmodules.vtkCommonColor import ( - vtkNamedColors -) -from vtkmodules.vtkCommonCore import vtkLookupTable, vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget, vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor, vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Edit data from a CSV file and visualise it.' - epilogue = ''' - This program selects ECEF, Geographic or UTM coordinates from the input file and: - 1) Visualises the resultant ECEF or UTM points and lines. - 2) If ECEF or UTM is selected, optionally creates and saves a VTP file for further analysis. - 3) Optionally saves the CSV file. - If Geographic coordinates are selected, only the resultant CSV file can be saved. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('file_name', help='The CSV file containing the data.') - parser.add_argument('-c', '--csv', action='store_true', help='Save the resultant CSV file.') - parser.add_argument('-v', '--vtp', action='store_true', help='Save the .vtp file.') - parser.add_argument('-p', '--path', default='.', - help='The path to be appended to the .vtp and optional .csv file') - - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('-e', '--ecef', action='store_true', help='Use ECEF coordinates.') - group.add_argument('-u', '--utm', action='store_true', help='Use UTM coordinates.') - group.add_argument('-g', '--geo', action='store_true', help='Use geographic coordinates (latitude/longitude).') - - args = parser.parse_args() - return args.file_name, args.csv, args.vtp, args.path, args.ecef, args.utm, args.geo - - -def main(): - ifn, csv, vtp, sp, ecef, utm, geo = get_program_parameters() - file_name = Path(ifn) - if not file_name.is_file(): - print('Unable to read:', file_name) - return - pth = Path(sp) - if not pth.is_dir(): - if pth.is_file(): - print(sp, ' must be a path') - return - pth.mkdir(parents=True, exist_ok=True) - - # Build the output paths. - csv_fn = Path(pth / Path(ifn).stem).with_suffix('.csv') - vtp_fn = Path(pth / Path(ifn).stem).with_suffix('.vtp') - if ecef: - vtp_fn = vtp_fn.with_stem(vtp_fn.stem + '_ecef') - if utm: - vtp_fn = vtp_fn.with_stem(vtp_fn.stem + '_utm') - - # Create a DataFrame from the csv file. - df = pd.read_csv(file_name) - - # Use the column called 'Index' as the index. - # This ensures that we can trace back each row to the original data. - df.set_index('Index', inplace=True) - - # For ECEF coordinates, we want to look down from the zenith. - # So calculate the mid-point of the latitude. - lat_details = df['Latitude'].describe() - lat_mid_pt = (lat_details['max'] + lat_details['min']) / 2 - - dfv = None - # Copy what we want to a new DataFrame and drop any rows with missing values. - if ecef: - dfv = df[['X(m)', 'Y(m)', 'Z(m)', 'Elevation(m)']].dropna( - subset=['X(m)', 'Y(m)', 'Z(m)']) - if csv: - ecef_csv_fn = csv_fn.with_stem(csv_fn.stem + '_ecef') - dfv.to_csv(ecef_csv_fn, index=True, index_label='Index', header=True) - elif utm: - dfv = df[['Easting(m)', 'Northing(m)', 'Elevation(m)']].dropna( - subset=['Easting(m)', 'Northing(m)', 'Elevation(m)']) - # Duplicate the elevation column, this will become the z-coordinate when UTM is selected. - dfv['Elev'] = dfv.loc[:, 'Elevation(m)'] - if csv: - utm_csv_fn = csv_fn.with_stem(csv_fn.stem + '_utm') - dfv.to_csv(utm_csv_fn, index=True, index_label='Index', header=True) - else: - df_geo = df[['Longitude', 'Latitude', 'Elevation(m)']].dropna( - subset=['Longitude', 'Latitude', 'Elevation(m)']) - geo_csv_fn = csv_fn.with_stem(csv_fn.stem + '_geo') - df_geo.to_csv(geo_csv_fn, index=True, index_label='Index', header=True) - - if ecef: - xyz = dfv[['X(m)', 'Y(m)', 'Z(m)']].to_numpy() - elif utm: - xyz = dfv[['Easting(m)', 'Northing(m)', 'Elevation(m)']].to_numpy() - else: - print('Only ECEF or UTM coordinates can be visualised.') - return - - elev = df[['Elevation(m)']].to_numpy() - - # Create the poly data. - poly_data = vtkPolyData() - points = vtkPoints() - points.SetData(numpy_support.numpy_to_vtk(xyz)) - poly_data.SetPoints(points) - - # Set an index - idx = numpy_support.numpy_to_vtk(elev) - idx.SetName('Index') - poly_data.GetPointData().AddArray(idx) - - # We use the elevation as the active scalars. - scal = numpy_support.numpy_to_vtk(elev) - scal.SetName('Elevation(m)') - poly_data.GetPointData().SetScalars(scal) - poly_data.GetPointData().SetActiveScalars('Elevation(m)') - elev_range = poly_data.GetPointData().GetScalars().GetRange() - - num_pts = poly_data.GetNumberOfPoints() - poly_line = vtkPolyLine() - poly_line.GetPointIds().SetNumberOfIds(num_pts) - for i in range(0, num_pts): - poly_line.GetPointIds().SetId(i, i) - - # Create a cell array to store the lines in and add the lines to it. - cells = vtkCellArray() - cells.InsertNextCell(poly_line) - - # Add the lines to the dataset - poly_data.SetLines(cells) - - poly_data.Modified() - - # Rotate the ECEF coordinates - # into VTK coordinates so that on the screen: - # Y points North, X points East and Z points up. - transform = vtkTransform() - if utm: - # Scale the elevation. - transform.Scale(1, 1, 1) - if ecef: - # Rotate the ECEF coordinates - # into VTK coordinates so that on the screen: - # Y points North, X points East and Z points up. - transform.RotateX(-(90 - lat_mid_pt)) - transform.RotateY(0) - transform.RotateZ(90 - lat_mid_pt) - - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputDataObject(poly_data) - transform_filter.SetTransform(transform) - transform_filter.Update() - - if vtp: - writer = vtkXMLPolyDataWriter() - writer.SetFileName(vtp_fn) - writer.SetInputConnection(transform_filter.GetOutputPort()) - writer.SetDataModeToBinary() - writer.Write() - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - lut = get_diverging_lut('cool_warm') - # lut = get_diverging_lut1('DarkRed', 'Gainsboro', 'Green') - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(transform_filter.GetOutputPort()) - mapper.SetScalarRange(elev_range) - mapper.SetLookupTable(lut) - mapper.ScalarVisibilityOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 1024 - window_height = 1024 - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle('Elevation') - scalar_bar.UnconstrainedFontSizeOff() - scalar_bar.SetNumberOfLabels(6) - scalar_bar.SetVerticalTitleSeparation(50) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 2) - scalar_bar.SetBarRatio(scalar_bar.GetBarRatio() * 0.5) - scalar_bar.SetPosition(0.87, 0.1) - - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(window_width, window_height) - if ecef: - ren_win.SetWindowName('ECEF') - elif utm: - ren_win.SetWindowName('UTM') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer.AddActor(actor) - renderer.AddActor(scalar_bar) - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - cam_orient_manipulator.On() - - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') - axes.SetYAxisLabelText('North') - # Zenith - axes.SetZAxisLabelText('Zenith') - - widget = vtkOrientationMarkerWidget() - rgba = [0] * 4 - colors.GetColor('Carrot', rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(iren) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.SetEnabled(1) - widget.InteractiveOn() - - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(0) - - iren.Initialize() - - ren_win.Render() - iren.Start() - - -def get_diverging_lut(color_map: str, table_size: int = 256): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start-point mid-point end-point\n - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150\n - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046\n - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631\n - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093\n - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233\n - - :param color_map: The color map to use e.g. cool_warm. - :param table_size: The table size. - :return: - """ - color_maps = dict() - color_maps['cool_warm'] = {'start': (0.230, 0.299, 0.754), 'mid': (0.865, 0.865, 0.865), - 'end': (0.706, 0.016, 0.150)} - color_maps['purple_orange'] = {'start': (0.436, 0.308, 0.631), 'mid': (0.865, 0.865, 0.865), - 'end': (0.759, 0.334, 0.046)} - color_maps['green_purple'] = {'start': (0.085, 0.532, 0.201), 'mid': (0.865, 0.865, 0.865), - 'end': (0.436, 0.308, 0.631)} - color_maps['blue_brown'] = {'start': (0.217, 0.525, 0.910), 'mid': (0.865, 0.865, 0.865), - 'end': (0.677, 0.492, 0.093)} - color_maps['green_red'] = {'start': (0.085, 0.532, 0.201), 'mid': (0.865, 0.865, 0.865), - 'end': (0.758, 0.214, 0.233)} - - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - cm = color_maps[color_map] - - ctf.AddRGBPoint(0.0, *cm['start']) - ctf.AddRGBPoint(0.5, *cm['mid']) - ctf.AddRGBPoint(1.0, *cm['end']) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def get_diverging_lut1(start: str, mid: str, end: str, table_size: int = 256): - """ - Create a diverging lookup table from three named colors. - - :param start: The start-point point color. - :param mid: The mid-point color. - :param end: The end-point color. - :param table_size: The table size. - :return: - """ - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) - p3 = [1.0] + list(colors.GetColor3d(end)) - ctf.AddRGBPoint(*p1) - ctf.AddRGBPoint(*p2) - ctf.AddRGBPoint(*p3) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/CSVReadEdit1.md b/data/examples/IO/CSVReadEdit1.md deleted file mode 100644 index df22ea6..0000000 --- a/data/examples/IO/CSVReadEdit1.md +++ /dev/null @@ -1,47 +0,0 @@ -### Description - -This example loads a CSV file, edits it and visualises the result. - -It demonstrates the use of [pandas](https://pandas.pydata.org/) to read and edit the CSV input file, then create a temporary file containing the desired columns. This temporary file is subsequently read and parsed using vtkDelimitedTextReader. - -The key thing about `pandas` is it can read/write data in various formats: CSV and text files, Microsoft Excel, SQL databases, and the fast HDF5 format. It is highly optimized for performance and the DataFrame object allows for extensive row/column manipulation. So we can edit the data, creating new columns, and, finally, select only relevant columns for further analysis by VTK. - -In this case we create a temporary CSV file of selected columns and read this with vtkDelimitedTextReader. - -The process is this: - -``` text -CSV->pandas(read/edit/select)->CSV->vtkDelimitedTextReader->vtkPolyData -``` - -By going down this route we don't overload the delimited text reader with the effort of processing any unneeded columns of data. - -The files used to generate the example are: - -``` text -/LakeGininderra.csv -/LakeGininderra.kmz -``` - -Where: - -- `` is the path to `?vtk-?examples/src/Testing/Data` -- `LakeGininderra.csv` is the CSV file used by this program. -- `LakeGininderra.kmz` can be loaded into Google Earth to display the track. - -The parameters for typical usage are something like this: - -``` text -/LakeGininderra.csv -e -c -pResults -``` - -
- -
A Google Earth image of the track.
-
- -Further information: - -- [Easy Data Conversion to VTK with Python](https://www.kitware.com/easy-data-conversion-to-vtk-with-python/). -- [Installing pandas](https://pandas.pydata.org/docs/getting_started/install.html). -- [VTK Examples - New CSV Examples](https://discourse.vtk.org/t/vtk-examples-new-csv-examples/11632) diff --git a/data/examples/IO/CSVReadEdit1.py b/data/examples/IO/CSVReadEdit1.py deleted file mode 100755 index 62c6c63..0000000 --- a/data/examples/IO/CSVReadEdit1.py +++ /dev/null @@ -1,356 +0,0 @@ -#!/usr/bin/env python3 - -import tempfile -from pathlib import Path - -import pandas as pd -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkNamedColors -) -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyLine -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTableToPolyData, vtkTransformPolyDataFilter -from vtkmodules.vtkIOInfovis import vtkDelimitedTextReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget, vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor, vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Edit data from a CSV file and visualise it.' - epilogue = ''' - This program selects ECEF, Geographic or UTM coordinates from the input file and: - 1) Visualises the resultant ECEF or UTM points and lines. - 2) If ECEF or UTM is selected, optionally creates and saves a VTP file for further analysis. - 3) Optionally saves the CSV file. - If Geographic coordinates are selected, only the resultant CSV file can be saved. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('file_name', help='The CSV file containing the data.') - parser.add_argument('-c', '--csv', action='store_true', help='Save the resultant CSV file.') - parser.add_argument('-v', '--vtp', action='store_true', help='Save the .vtp file.') - parser.add_argument('-p', '--path', default='.', - help='The path to be appended to the .vtp and optional .csv file') - - group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('-e', '--ecef', action='store_true', help='Use ECEF coordinates.') - group.add_argument('-u', '--utm', action='store_true', help='Use UTM coordinates.') - group.add_argument('-g', '--geo', action='store_true', help='Use geographic coordinates (latitude/longitude).') - - args = parser.parse_args() - return args.file_name, args.csv, args.vtp, args.path, args.ecef, args.utm, args.geo - - -def main(): - ifn, csv, vtp, sp, ecef, utm, geo = get_program_parameters() - file_name = Path(ifn) - if not file_name.is_file(): - print('Unable to read:', file_name) - return - pth = Path(sp) - if not pth.is_dir(): - if pth.is_file(): - print(sp, ' must be a path') - return - pth.mkdir(parents=True, exist_ok=True) - - # Build the output paths. - csv_fn = Path(pth / Path(ifn).stem).with_suffix('.csv') - vtp_fn = Path(pth / Path(ifn).stem).with_suffix('.vtp') - if ecef: - vtp_fn = vtp_fn.with_stem(vtp_fn.stem + '_ecef') - if utm: - vtp_fn = vtp_fn.with_stem(vtp_fn.stem + '_utm') - - # Create a DataFrame from the csv file. - df = pd.read_csv(file_name) - - # Use the column called 'Index' as the index. - # This ensures that we can trace back each row to the original data. - df.set_index('Index', inplace=True) - - # For ECEF coordinates, we want to look down from the zenith. - # So calculate the mid-point of the latitude. - lat_details = df['Latitude'].describe() - lat_mid_pt = (lat_details['max'] + lat_details['min']) / 2 - - # Create a temporary csv file with just the needed columns. - tmp_dir = tempfile.gettempdir() - if tmp_dir is None: - print('Unable to find', tmp_dir) - return - tmp_path = Path(tmp_dir, f'tmp_{file_name.name}') - - dfv = None - # Copy what we want to a new DataFrame and drop any rows with missing values. - if ecef: - dfv = df[['X(m)', 'Y(m)', 'Z(m)', 'Elevation(m)']].dropna( - subset=['X(m)', 'Y(m)', 'Z(m)']) - if csv: - ecef_csv_fn = csv_fn.with_stem(csv_fn.stem + '_ecef') - dfv.to_csv(ecef_csv_fn, index=True, index_label='Index', header=True) - elif utm: - dfv = df[['Easting(m)', 'Northing(m)', 'Elevation(m)']].dropna( - subset=['Easting(m)', 'Northing(m)', 'Elevation(m)']) - # Duplicate the elevation column, this will become the z-coordinate when UTM is selected. - dfv['Elev'] = dfv.loc[:, 'Elevation(m)'] - if csv: - utm_csv_fn = csv_fn.with_stem(csv_fn.stem + '_utm') - dfv.to_csv(utm_csv_fn, index=True, index_label='Index', header=True) - else: - df_geo = df[['Longitude', 'Latitude', 'Elevation(m)']].dropna( - subset=['Longitude', 'Latitude', 'Elevation(m)']) - geo_csv_fn = csv_fn.with_stem(csv_fn.stem + '_geo') - df_geo.to_csv(geo_csv_fn, index=True, index_label='Index', header=True) - - if ecef or utm: - # Write out the DataFrame. - dfv.to_csv(tmp_path, index=True, index_label='Index', header=True) - - points_reader = vtkDelimitedTextReader() - points_reader.SetFileName(tmp_path) - points_reader.DetectNumericColumnsOn() - points_reader.SetFieldDelimiterCharacters(',') - points_reader.SetHaveHeaders(True) - - table_pd = vtkTableToPolyData() - table_pd.SetInputConnection(points_reader.GetOutputPort()) - if ecef: - table_pd.SetXColumn('X(m)') - table_pd.SetYColumn('Y(m)') - table_pd.SetZColumn('Z(m)') - elif utm: - table_pd.SetXColumn('Easting(m)') - table_pd.SetYColumn('Northing(m)') - table_pd.SetZColumn('Elev') - else: - # Remove the temporary file, it is not needed any more. - tmp_path.unlink(missing_ok=True) - print('Only ECEF or UTM coordinates can be visualised.') - return - table_pd.Update() - - # Remove the temporary file, it is not needed any more. - tmp_path.unlink(missing_ok=True) - - poly_data = table_pd.GetOutput() - # poly_data = transform_filter.GetOutput() - # We use the elevation as the active scalars. - poly_data.GetPointData().SetActiveScalars('Elevation(m)') - elev_range = poly_data.GetPointData().GetScalars().GetRange() - - num_pts = poly_data.GetNumberOfPoints() - - poly_line = vtkPolyLine() - poly_line.GetPointIds().SetNumberOfIds(num_pts) - for i in range(0, num_pts): - poly_line.GetPointIds().SetId(i, i) - - # Create a cell array to store the lines in and add the lines to it. - cells = vtkCellArray() - cells.InsertNextCell(poly_line) - - # Add the lines to the dataset - poly_data.SetLines(cells) - - poly_data.Modified() - - transform = vtkTransform() - if utm: - # Scale the elevation. - transform.Scale(1, 1, 1) - if ecef: - # Rotate the ECEF coordinates - # into VTK coordinates so that on the screen: - # Y points North, X points East and Z points up. - transform.RotateX(-(90 - lat_mid_pt)) - transform.RotateY(0) - transform.RotateZ(90 - lat_mid_pt) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputData(table_pd.GetOutput()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - if vtp: - writer = vtkXMLPolyDataWriter() - writer.SetFileName(vtp_fn) - writer.SetInputConnection(transform_filter.GetOutputPort()) - writer.SetDataModeToBinary() - writer.Write() - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - lut = get_diverging_lut('cool_warm') - # lut = get_diverging_lut1('DarkRed', 'Gainsboro', 'Green') - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(transform_filter.GetOutputPort()) - mapper.SetScalarRange(elev_range) - mapper.SetLookupTable(lut) - mapper.ScalarVisibilityOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 1024 - window_height = 1024 - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle('Elevation') - scalar_bar.UnconstrainedFontSizeOff() - scalar_bar.SetNumberOfLabels(6) - scalar_bar.SetVerticalTitleSeparation(50) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 2) - scalar_bar.SetBarRatio(scalar_bar.GetBarRatio() * 0.6) - scalar_bar.SetPosition(0.87, 0.1) - - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(window_width, window_height) - if ecef: - ren_win.SetWindowName('ECEF') - elif utm: - ren_win.SetWindowName('UTM') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer.AddActor(actor) - renderer.AddActor(scalar_bar) - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - cam_orient_manipulator.On() - - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') - axes.SetYAxisLabelText('North') - # Zenith - axes.SetZAxisLabelText('Zenith') - - widget = vtkOrientationMarkerWidget() - rgba = [0] * 4 - colors.GetColor('Carrot', rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(iren) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.SetEnabled(1) - widget.InteractiveOn() - - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(0) - - iren.Initialize() - - ren_win.Render() - iren.Start() - - -def get_diverging_lut(color_map: str, table_size: int = 256): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start-point mid-point end-point\n - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150\n - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046\n - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631\n - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093\n - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233\n - - :param color_map: The color map to use e.g. cool_warm. - :param table_size: The table size. - :return: - """ - color_maps = dict() - color_maps['cool_warm'] = {'start': (0.230, 0.299, 0.754), 'mid': (0.865, 0.865, 0.865), - 'end': (0.706, 0.016, 0.150)} - color_maps['purple_orange'] = {'start': (0.436, 0.308, 0.631), 'mid': (0.865, 0.865, 0.865), - 'end': (0.759, 0.334, 0.046)} - color_maps['green_purple'] = {'start': (0.085, 0.532, 0.201), 'mid': (0.865, 0.865, 0.865), - 'end': (0.436, 0.308, 0.631)} - color_maps['blue_brown'] = {'start': (0.217, 0.525, 0.910), 'mid': (0.865, 0.865, 0.865), - 'end': (0.677, 0.492, 0.093)} - color_maps['green_red'] = {'start': (0.085, 0.532, 0.201), 'mid': (0.865, 0.865, 0.865), - 'end': (0.758, 0.214, 0.233)} - - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - cm = color_maps[color_map] - - ctf.AddRGBPoint(0.0, *cm['start']) - ctf.AddRGBPoint(0.5, *cm['mid']) - ctf.AddRGBPoint(1.0, *cm['end']) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def get_diverging_lut1(start: str, mid: str, end: str, table_size: int = 256): - """ - Create a diverging lookup table from three named colors. - - :param start: The start-point point color. - :param mid: The mid-point color. - :param end: The end-point color. - :param table_size: The table size. - :return: - """ - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) - p3 = [1.0] + list(colors.GetColor3d(end)) - ctf.AddRGBPoint(*p1) - ctf.AddRGBPoint(*p2) - ctf.AddRGBPoint(*p3) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/HDRReader.md b/data/examples/IO/HDRReader.md deleted file mode 100644 index a3bdcdd..0000000 --- a/data/examples/IO/HDRReader.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -Demonstrates how to read high-dynamic-range imaging files. - -A callback is used to print out the color window (move the mouse horizontally over the image) and color level (move the mouse vertically over the image). - -This is based on IO/Image/Testing/Cxx/TestHDRReader.cxx in the VTK source files. diff --git a/data/examples/IO/HDRReader.py b/data/examples/IO/HDRReader.py deleted file mode 100755 index bc4ec97..0000000 --- a/data/examples/IO/HDRReader.py +++ /dev/null @@ -1,75 +0,0 @@ -##!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkIOImage import vtkHDRReader -from vtkmodules.vtkInteractionImage import vtkImageViewer -from vtkmodules.vtkRenderingCore import vtkRenderWindowInteractor - - -def get_program_parameters(): - import argparse - description = 'Demonstrate the use of HDRReader' - epilogue = ''' -This example shows how to read in an HDR file. -A callback is used to print out the color window (move the mouse horizontally over the image) - and color level (move the mouse vertically over the image). - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='Path to the hdr file e.g. Skyboxes/spiaggia_di_mondello_1k.hdr.') - args = parser.parse_args() - return args.file_name - - -def main(): - file_name = get_program_parameters() - - reader = vtkHDRReader() - - # Check the image can be read - if not reader.CanReadFile(file_name): - print('CanReadFile failed for ', file_name) - return - - reader.SetFileName(file_name) - reader.UpdateInformation() - - # Whole extent - we = reader.GetDataExtent() - extents = [we[0], we[1], we[2], we[3], 0, 0] - reader.UpdateExtent(extents) - # Visualize - image_viewer = vtkImageViewer() - image_viewer.SetInputData(reader.GetOutput()) - - image_viewer.SetColorWindow(1) - image_viewer.SetColorLevel(1) - image_viewer.SetPosition(0, 100) - - iren = vtkRenderWindowInteractor() - image_viewer.SetupInteractor(iren) - image_viewer.GetRenderWindow().SetWindowName('HDRReader') - image_viewer.Render() - - iren.AddObserver('EndInteractionEvent', ColorCallback(image_viewer)) - - iren.Start() - - -class ColorCallback(object): - def __init__(self, image_viewer): - self.image_viewer = image_viewer - - def __call__(self, caller, ev): - # Just do this to demonstrate who called callback and the event that triggered it. - # print(caller.GetClassName(), 'Event Id:', ev) - - res = 'Color window: {} level: {}'.format(self.image_viewer.GetColorWindow(), - self.image_viewer.GetColorLevel()) - print(res) - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ImageWriter.md b/data/examples/IO/ImageWriter.md deleted file mode 100644 index added44..0000000 --- a/data/examples/IO/ImageWriter.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -A generic function `WriteImage()` is provided that selects what image writer to use based on the file extension and then writes the render window to the file. The following formats are supported: **BMP, JPEG, PNM, PNG, PostScript, TIFF**. - -If no file extension is specified, **PNG** is assumed. - -The function `WriteImage()` is also available in the Snippets. diff --git a/data/examples/IO/ImageWriter.py b/data/examples/IO/ImageWriter.py deleted file mode 100755 index 6f6b42c..0000000 --- a/data/examples/IO/ImageWriter.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkBMPWriter, - vtkJPEGWriter, - vtkPNGWriter, - vtkPNMWriter, - vtkPostScriptWriter, - vtkTIFFWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkWindowToImageFilter -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create source - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(5.0) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # actor - actor = vtkActor() - actor.SetMapper(mapper) - - # color the actor - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('BkgColor')) - - renWin.SetWindowName('ImageWriter') - renWin.Render() - - ext = ['', '.png', '.jpg', '.ps', '.tiff', '.bmp', '.pnm'] - filenames = list(map(lambda x: 'ImageWriter' + x, ext)) - filenames[0] = filenames[0] + '1' - for f in filenames: - WriteImage(f, renWin, rgba=False) - - iren.Initialize() - iren.Start() - - -def WriteImage(fileName, renWin, rgba=True): - ''' - Write the render window view to an image file. - - Image types supported are: - BMP, JPEG, PNM, PNG, PostScript, TIFF. - The default parameters are used for all writers, change as needed. - - :param fileName: The file name, if no extension then PNG is assumed. - :param renWin: The render window. - :param rgba: Used to set the buffer type. - :return: - ''' - - import os - - if fileName: - # Select the writer to use. - path, ext = os.path.splitext(fileName) - ext = ext.lower() - if not ext: - ext = '.png' - fileName = fileName + ext - if ext == '.bmp': - writer = vtkBMPWriter() - elif ext == '.jpg': - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': - if rgba: - rgba = False - writer = vtkPostScriptWriter() - elif ext == '.tiff': - writer = vtkTIFFWriter() - else: - writer = vtkPNGWriter() - - windowto_image_filter = vtkWindowToImageFilter() - windowto_image_filter.SetInput(renWin) - windowto_image_filter.SetScale(1) # image quality - if rgba: - windowto_image_filter.SetInputBufferTypeToRGBA() - else: - windowto_image_filter.SetInputBufferTypeToRGB() - # Read from the front buffer. - windowto_image_filter.ReadFrontBufferOff() - windowto_image_filter.Update() - - writer.SetFileName(fileName) - writer.SetInputConnection(windowto_image_filter.GetOutputPort()) - writer.Write() - else: - raise RuntimeError('Need a filename.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/PolyDataToImageDataConverter.py b/data/examples/IO/PolyDataToImageDataConverter.py deleted file mode 100755 index 7df7cb5..0000000 --- a/data/examples/IO/PolyDataToImageDataConverter.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkIOGeometry import vtkSTLReader -from vtkmodules.vtkIOImage import vtkMetaImageWriter -from vtkmodules.vtkImagingStencil import ( - vtkImageStencil, - vtkPolyDataToImageStencil -) - - -def get_program_parameters(): - import argparse - parser = argparse.ArgumentParser(description='Converts the polydata to imagedata.') - parser.add_argument('filename', help='A filename e.g. headMesh.stl') - args = parser.parse_args() - return args.filename - - -def main(): - mesh_filename = get_program_parameters() - - reader = vtkSTLReader() - reader.SetFileName(mesh_filename) - reader.Update() - mesh = reader.GetOutput() - bounds = mesh.GetBounds() - - spacing1 = 0.1 - pixel_padding = 5 - origin_shift = pixel_padding * spacing1 - spacing = [spacing1, spacing1, spacing1] - origin = [bounds[0] - origin_shift, bounds[2] - origin_shift, bounds[4] - origin_shift] - extent = [0, int((bounds[1] - bounds[0]) / spacing1) + 2 * pixel_padding, 0, - int((bounds[3] - bounds[2]) / spacing1) + 2 * pixel_padding, 0, - int((bounds[5] - bounds[4]) / spacing1) + 2 * pixel_padding] - - blank_image = vtkImageData() - blank_image.SetExtent(extent) - blank_image.AllocateScalars(3, 1) # VTK_UNSIGNED_CHAR, 1 component - blank_image.GetPointData().GetScalars().Fill(0) - blank_image.SetSpacing(spacing) - blank_image.SetOrigin(origin) - - dataToStencil = vtkPolyDataToImageStencil() - dataToStencil.SetInputData(mesh) - dataToStencil.SetOutputSpacing(spacing) - dataToStencil.SetOutputOrigin(origin) - - stencil = vtkImageStencil() - stencil.SetInputData(blank_image) - stencil.SetStencilConnection(dataToStencil.GetOutputPort()) - stencil.ReverseStencilOn() - stencil.SetBackgroundValue(255) - stencil.Update() - mask = stencil.GetOutput() - - writer = vtkMetaImageWriter() - writer.SetFileName("output.mha") - writer.SetInputData(mask) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadDICOM.md b/data/examples/IO/ReadDICOM.md deleted file mode 100644 index 8ad1a2e..0000000 --- a/data/examples/IO/ReadDICOM.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example reads a DICOM file and displays it on the screen. DICOM_Prostate is an example data set. diff --git a/data/examples/IO/ReadDICOM.py b/data/examples/IO/ReadDICOM.py deleted file mode 100755 index 4b8b183..0000000 --- a/data/examples/IO/ReadDICOM.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkDICOMImageReader -from vtkmodules.vtkInteractionImage import vtkImageViewer2 -from vtkmodules.vtkRenderingCore import vtkRenderWindowInteractor - - -def get_program_parameters(): - import argparse - description = 'Read Dicom image data' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='prostate.img') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - input_filename = get_program_parameters() - - # Read the DICOM file - reader = vtkDICOMImageReader() - reader.SetFileName(input_filename) - reader.Update() - - # Visualize - image_viewer = vtkImageViewer2() - image_viewer.SetInputConnection(reader.GetOutputPort()) - render_window_interactor = vtkRenderWindowInteractor() - image_viewer.SetupInteractor(render_window_interactor) - image_viewer.Render() - image_viewer.GetRenderer().SetBackground(colors.GetColor3d("SlateGray")) - image_viewer.GetRenderWindow().SetWindowName("ReadDICOM") - image_viewer.GetRenderer().ResetCamera() - image_viewer.Render() - - render_window_interactor.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/IO/ReadDICOMSeries.md b/data/examples/IO/ReadDICOMSeries.md deleted file mode 100644 index 43e11e1..0000000 --- a/data/examples/IO/ReadDICOMSeries.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -This example demonstates how to read a series of DICOM images and how to scroll with the mousewheel or the up/down keys through all slices. -Sample data are available as a zipped file (977 kB, 40 slices): DicomTestImages - -!!! seealso - [ReadDICOM](../ReadDICOM). \ No newline at end of file diff --git a/data/examples/IO/ReadDICOMSeries.py b/data/examples/IO/ReadDICOMSeries.py deleted file mode 100755 index 662df4a..0000000 --- a/data/examples/IO/ReadDICOMSeries.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkDICOMImageReader -from vtkmodules.vtkInteractionImage import vtkImageViewer2 -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkActor2D, - vtkRenderWindowInteractor, - vtkTextMapper, - vtkTextProperty -) - - -# Helper class to format slice status message -class StatusMessage: - @staticmethod - def format(slice: int, max_slice: int): - return f'Slice Number {slice + 1}/{max_slice + 1}' - - -# Define own interaction style -class MyVtkInteractorStyleImage(vtkInteractorStyleImage): - def __init__(self, parent=None): - super().__init__() - self.AddObserver('KeyPressEvent', self.key_press_event) - self.AddObserver('MouseWheelForwardEvent', self.mouse_wheel_forward_event) - self.AddObserver('MouseWheelBackwardEvent', self.mouse_wheel_backward_event) - self.image_viewer = None - self.status_mapper = None - self.slice = 0 - self.min_slice = 0 - self.max_slice = 0 - - def set_image_viewer(self, image_viewer): - self.image_viewer = image_viewer - self.min_slice = image_viewer.GetSliceMin() - self.max_slice = image_viewer.GetSliceMax() - self.slice = self.min_slice - print(f'Slicer: Min = {self.min_slice}, Max= {self.max_slice}') - - def set_status_mapper(self, status_mapper): - self.status_mapper = status_mapper - - def move_slice_forward(self): - if self.slice < self.max_slice: - self.slice += 1 - print(f'MoveSliceForward::Slice = {self.slice}') - self.imageviewer.SetSlice(self.slice) - msg = StatusMessage.format(self.slice, self.max_slice) - self.status_mapper.SetInput(msg) - self.imageviewer.Render() - - def move_slice_backward(self): - if self.slice > self.min_slice: - self.slice -= 1 - print(f'MoveSliceBackward::Slice = {self.slice}') - self.imageviewer.SetSlice(self.slice) - msg = StatusMessage.format(self.slice, self.max_slice) - self.status_mapper.SetInput(msg) - self.imageviewer.Render() - - def key_press_event(self, obj, event): - key = self.GetInteractor().GetKeySym() - if key == 'Up': - self.move_slice_forward() - elif key == 'Down': - self.move_slice_backward() - - def mouse_wheel_forward_event(self, obj, event): - self.move_slice_forward() - - def mouse_wheel_backward_event(self, obj, event): - self.move_slice_backward() - - -# Read all the DICOM files in the specified directory. -def get_program_parameters(): - import argparse - description = 'Read DICOM series data' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('dirname', help='DicomTestImages.zip') - args = parser.parse_args() - return args.dirname - - -def main(): - colors = vtkNamedColors() - reader = vtkDICOMImageReader() - folder = get_program_parameters() - # Read DICOM files in the specified directory - reader.SetDirectoryName(folder) - reader.Update() - - # Visualilze - image_viewer = vtkImageViewer2() - image_viewer.SetInputConnection(reader.GetOutputPort()) - # Slice status message - slice_text_prop = vtkTextProperty() - slice_text_prop.SetFontFamilyToCourier() - slice_text_prop.SetFontSize(20) - slice_text_prop.SetVerticalJustificationToBottom() - slice_text_prop.SetJustificationToLeft() - # Slice status message - slice_text_mapper = vtkTextMapper() - msg = StatusMessage.format(image_viewer.GetSliceMin(), image_viewer.GetSliceMax()) - slice_text_mapper.SetInput(msg) - slice_text_mapper.SetTextProperty(slice_text_prop) - - slice_text_actor = vtkActor2D() - slice_text_actor.SetMapper(slice_text_mapper) - slice_text_actor.SetPosition(15, 10) - - # Usage hint message - usage_text_prop = vtkTextProperty() - usage_text_prop.SetFontFamilyToCourier() - usage_text_prop.SetFontSize(14) - usage_text_prop.SetVerticalJustificationToTop() - usage_text_prop.SetJustificationToLeft() - usage_text_mapper = vtkTextMapper() - usage_text_mapper.SetInput( - 'Slice with mouse wheel\n or Up/Down-Key\n- Zoom with pressed right\n ' - ' mouse button while dragging' - ) - usage_text_mapper.SetTextProperty(usage_text_prop) - - usage_text_actor = vtkActor2D() - usage_text_actor.SetMapper(usage_text_mapper) - usage_text_actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - usage_text_actor.GetPositionCoordinate().SetValue(0.05, 0.95) - - # Create an interactor with our own style (inherit from - # vtkInteractorStyleImage in order to catch mousewheel and key events. - render_window_interactor = vtkRenderWindowInteractor() - my_interactor_style = MyVtkInteractorStyleImage() - - # Make imageviewer2 and sliceTextMapper visible to our interactorstyle - # to enable slice status message updates when scrolling through the slices. - my_interactor_style.set_image_viewer(image_viewer) - my_interactor_style.set_status_mapper(slice_text_mapper) - - # Make the interactor use our own interactor style - # because SetupInteractor() is defining it's own default interator style - # this must be called after SetupInteractor(). - # renderWindowInteractor.SetInteractorStyle(myInteractorStyle); - image_viewer.SetupInteractor(render_window_interactor) - render_window_interactor.SetInteractorStyle(my_interactor_style) - render_window_interactor.Render() - - # Add slice status message and usage hint message to the renderer. - image_viewer.GetRenderer().AddActor2D(slice_text_actor) - image_viewer.GetRenderer().AddActor2D(usage_text_actor) - - # Initialize rendering and interaction. - image_viewer.Render() - image_viewer.GetRenderer().ResetCamera() - image_viewer.GetRenderer().SetBackground(colors.GetColor3d('SlateGray')) - image_viewer.GetRenderWindow().SetSize(800, 800) - image_viewer.GetRenderWindow().SetWindowName('ReadDICOMSeries') - image_viewer.Render() - render_window_interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadExodusData.md b/data/examples/IO/ReadExodusData.md deleted file mode 100644 index 6eec4e6..0000000 --- a/data/examples/IO/ReadExodusData.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -The example uses vtkExodusIIReader to read an ExodusII file. The nodal variable to read is the second argument. The nodal variable is displayed with a color map. diff --git a/data/examples/IO/ReadExodusData.py b/data/examples/IO/ReadExodusData.py deleted file mode 100755 index 853e9a2..0000000 --- a/data/examples/IO/ReadExodusData.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeometry import vtkCompositeDataGeometryFilter -from vtkmodules.vtkIOExodus import vtkExodusIIReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read and display ExodusII data.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required filename e.g mug.e.') - parser.add_argument('nodal_var', help='The nodal variable e,g, convected.') - args = parser.parse_args() - return args.filename, args.nodal_var - - -def main(): - colors = vtkNamedColors() - - # Input file and variable - filename, nodal_var = get_program_parameters() - - # Read Exodus Data - reader = vtkExodusIIReader() - reader.SetFileName(filename) - reader.UpdateInformation() - reader.SetTimeStep(10) - reader.SetAllArrayStatus(vtkExodusIIReader.NODAL, 1) # enables all NODAL variables - reader.Update() - # print(reader) # uncomment this to show the file information - - # Create Geometry - geometry = vtkCompositeDataGeometryFilter() - geometry.SetInputConnection(0, reader.GetOutputPort(0)) - geometry.Update() - - # Mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(geometry.GetOutputPort()) - mapper.SelectColorArray(nodal_var) - mapper.SetScalarModeToUsePointFieldData() - mapper.InterpolateScalarsBeforeMappingOn() - - # Actor - actor = vtkActor() - actor.SetMapper(mapper) - - # Renderer - renderer = vtkRenderer() - renderer.AddViewProp(actor) - renderer.SetBackground(colors.GetColor3d('DimGray')) - - renderer.GetActiveCamera().SetPosition(9.0, 9.0, 7.0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0.2, -0.7, 0.7) - renderer.GetActiveCamera().SetDistance(14.5) - - # Window and Interactor - window = vtkRenderWindow() - window.AddRenderer(renderer) - window.SetSize(600, 600) - window.SetWindowName('ReadExodusData') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(window) - interactor.Initialize() - - # Show the result - window.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadImageData.md b/data/examples/IO/ReadImageData.md deleted file mode 100644 index 7a5803a..0000000 --- a/data/examples/IO/ReadImageData.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example reads an image data (.vti) file. diff --git a/data/examples/IO/ReadImageData.py b/data/examples/IO/ReadImageData.py deleted file mode 100755 index 7d3d6b5..0000000 --- a/data/examples/IO/ReadImageData.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOXML import vtkXMLImageDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read a VTK image data file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='vase.vti') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - file_name = get_program_parameters() - - # Read the source file. - reader = vtkXMLImageDataReader() - reader.SetFileName(file_name) - - # Create the mapper that creates graphics elements - mapper = vtkDataSetMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - # Create the Actor - actor = vtkActor() - actor.SetMapper(mapper) - # show the edges of the image grid - actor.GetProperty().SetRepresentationToWireframe() - - # Create the Renderer - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.ResetCamera() - renderer.SetBackground(colors.GetColor3d('Silver')) - - # Create the RendererWindow - renderer_window = vtkRenderWindow() - renderer_window.AddRenderer(renderer) - renderer_window.SetWindowName('ReadImageData') - - # Create the RendererWindowInteractor and display the vti file - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderer_window) - interactor.Initialize() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadLegacyUnstructuredGrid.md b/data/examples/IO/ReadLegacyUnstructuredGrid.md deleted file mode 100644 index 7645738..0000000 --- a/data/examples/IO/ReadLegacyUnstructuredGrid.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -This example displays a vtkUnstructuredGrid that contains eleven linear cells. We use a number of techniques to visualize the cells. - -1. vtkUnstructuredGridReader reads in the file `src/Testing/Data/VTKCellTypes.vtk`. -2. vtkExtractEdges extracts the edges of the 2 and 3 dimensional cells. vtkTubeFilter wraps each edge with tubes. -3. vtkGlyph3DMapper displays each point as a vtkSphere. -4. vtkShrinkFilter highlights the cell faces by pulling them in towards their centroid. -5. vtkLabeledDataMapper shows the point ids. -6. vtkProperty::EdgeVisibilityOn() shows the edges of the cells after shrinking. -7. vtkCellData colors each cell with a different color. - -The example also shows how to add a vtkCategoryLegend to a visualization. The vtkCategoryLegend has a vtkLookupTable that **must** be Indexed for categorical data. Since the vtkDataSetMapper for the geometry uses the lookup table to color each cell, we use vtkLookupTable::DeepCopy to copy the input vtkLookupTable and apply vtkLookupTable::IndexedLookupOn(). - -The sample file is taken from the [VTKFileFormats](../../../VTKFileFormats#legacy-file-examples) document. diff --git a/data/examples/IO/ReadLegacyUnstructuredGrid.py b/data/examples/IO/ReadLegacyUnstructuredGrid.py deleted file mode 100755 index 81116db..0000000 --- a/data/examples/IO/ReadLegacyUnstructuredGrid.py +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkChartsCore import vtkCategoryLegend -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkVariantArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellTypes, - vtkGenericCell -) -from vtkmodules.vtkFiltersCore import vtkTubeFilter - -# vtkExtractEdges moved from vtkFiltersExtraction to vtkFiltersCore in -# VTK commit d9981b9aeb93b42d1371c6e295d76bfdc18430bd -try: - from vtkmodules.vtkFiltersCore import vtkExtractEdges -except ImportError: - from vtkmodules.vtkFiltersExtraction import vtkExtractEdges -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader -from vtkmodules.vtkRenderingContext2D import vtkContextTransform -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkCamera, - vtkDataSetMapper, - vtkGlyph3DMapper, - vtkPolyDataMapper, - vtkRenderWindowInteractor -) -from vtkmodules.vtkRenderingLabel import vtkLabeledDataMapper -from vtkmodules.vtkViewsContext2D import vtkContextView - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - # Create the reader for the data. - print('Loading ', filename) - reader = vtkUnstructuredGridReader() - reader.SetFileName(filename) - reader.Update() - - extractEdges = vtkExtractEdges() - extractEdges.SetInputConnection(reader.GetOutputPort()) - - legendValues = vtkVariantArray() - it = reader.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - cell = vtkGenericCell() - it.GetCell(cell) - cellName = vtkCellTypes.GetClassNameFromTypeId(cell.GetCellType()) - print(cellName, 'NumberOfPoints:', cell.GetNumberOfPoints(), 'CellDimension:', cell.GetCellDimension()) - legendValues.InsertNextValue(cellName) - it.GoToNextCell() - - # Tube the edges - tubes = vtkTubeFilter() - tubes.SetInputConnection(extractEdges.GetOutputPort()) - tubes.SetRadius(.05) - tubes.SetNumberOfSides(21) - - edgeMapper = vtkPolyDataMapper() - edgeMapper.SetInputConnection(tubes.GetOutputPort()) - edgeMapper.SetScalarRange(0, 26) - - edgeActor = vtkActor() - edgeActor.SetMapper(edgeMapper) - edgeActor.GetProperty().SetSpecular(0.6) - edgeActor.GetProperty().SetSpecularPower(30) - - # Glyph the points - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) - sphere.SetRadius(0.08) - - pointMapper = vtkGlyph3DMapper() - pointMapper.SetInputConnection(reader.GetOutputPort()) - pointMapper.SetSourceConnection(sphere.GetOutputPort()) - pointMapper.ScalingOff() - pointMapper.ScalarVisibilityOff() - - pointActor = vtkActor() - pointActor.SetMapper(pointMapper) - pointActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - pointActor.GetProperty().SetSpecular(0.6) - pointActor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) - pointActor.GetProperty().SetSpecularPower(100) - - # Label the points - labelMapper = vtkLabeledDataMapper() - labelMapper.SetInputConnection(reader.GetOutputPort()) - labelActor = vtkActor2D() - labelActor.SetMapper(labelMapper) - - # The geometry - geometryShrink = vtkShrinkFilter() - geometryShrink.SetInputConnection(reader.GetOutputPort()) - geometryShrink.SetShrinkFactor(0.8) - - # NOTE: We must copy the originalLut because the CategoricalLegend - # needs an indexed lookup table, but the geometryMapper uses a - # non-index lookup table - categoricalLut = vtkLookupTable() - originalLut = reader.GetOutput().GetCellData().GetScalars().GetLookupTable() - - categoricalLut.DeepCopy(originalLut) - categoricalLut.IndexedLookupOn() - - geometryMapper = vtkDataSetMapper() - geometryMapper.SetInputConnection(geometryShrink.GetOutputPort()) - geometryMapper.SetScalarModeToUseCellData() - geometryMapper.SetScalarRange(0, 11) - - geometryActor = vtkActor() - geometryActor.SetMapper(geometryMapper) - geometryActor.GetProperty().SetLineWidth(3) - geometryActor.GetProperty().EdgeVisibilityOn() - geometryActor.GetProperty().SetEdgeColor(0, 0, 0) - - # Legend - for v in range(0, legendValues.GetNumberOfTuples()): - categoricalLut.SetAnnotation(legendValues.GetValue(v), legendValues.GetValue(v).ToString()) - legend = vtkCategoryLegend() - legend.SetScalarsToColors(categoricalLut) - legend.SetValues(legendValues) - legend.SetTitle('Cell Type') - legend.GetBrush().SetColor(colors.GetColor4ub('Silver')) - - placeLegend = vtkContextTransform() - placeLegend.AddItem(legend) - placeLegend.Translate(640 - 20, 480 - 12 * 16) - - contextView = vtkContextView() - contextView.GetScene().AddItem(placeLegend) - - renderer = contextView.GetRenderer() - - renderWindow = contextView.GetRenderWindow() - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(geometryActor) - renderer.AddActor(labelActor) - renderer.AddActor(edgeActor) - renderer.AddActor(pointActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - aCamera = vtkCamera() - aCamera.Azimuth(-40.0) - aCamera.Elevation(50.0) - - renderer.SetActiveCamera(aCamera) - renderer.ResetCamera() - - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('ReadLegacyUnstructuredGrid') - renderWindow.Render() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Display a vtkUnstructuredGrid that contains eleven linear cells.' - epilogue = ''' - This example also shows how to add a vtkCategoryLegend to a visualization. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='VTKCellTypes.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadPLOT3D.py b/data/examples/IO/ReadPLOT3D.py deleted file mode 100755 index cc7c249..0000000 --- a/data/examples/IO/ReadPLOT3D.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFile, qFile = get_program_parameters() - - colors = vtkNamedColors() - - reader = vtkMultiBlockPLOT3DReader() - reader.SetXYZFileName(xyzFile) - reader.SetQFileName(qFile) - reader.SetScalarFunctionNumber(100) - reader.SetVectorFunctionNumber(202) - reader.Update() - - geometry = vtkStructuredGridGeometryFilter() - geometry.SetInputData(reader.GetOutput().GetBlock(0)) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(geometry.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - render = vtkRenderer() - render.AddActor(actor) - render.SetBackground(colors.GetColor3d('DarkSlateGray')) - - render_win = vtkRenderWindow() - render_win.AddRenderer(render) - render_win.SetSize(640, 480) - render_win.SetWindowName('ReadPLOT3D') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(render_win) - - camera = render.GetActiveCamera() - camera.SetPosition(5.02611, -23.535, 50.3979) - camera.SetFocalPoint(9.33614, 0.0414149, 30.112) - camera.SetViewUp(-0.0676794, 0.657814, 0.750134) - camera.SetDistance(31.3997) - camera.SetClippingRange(12.1468, 55.8147) - - render_win.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Read PLOT3D data files' - epilogue = ''' - vtkMultiBlockPLOT3DReader is a reader object that reads PLOT3D formatted files - and generates structured grid(s) on output. - PLOT3D is a computer graphics program designed to visualize the grids - and solutions of computational fluid dynamics. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadPolyData.md b/data/examples/IO/ReadPolyData.md deleted file mode 100644 index 58513d5..0000000 --- a/data/examples/IO/ReadPolyData.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example reads a polygonal data (.vtp) file, for example `src/Testing/Data/Torso.vtp`. diff --git a/data/examples/IO/ReadPolyData.py b/data/examples/IO/ReadPolyData.py deleted file mode 100755 index deb0b9f..0000000 --- a/data/examples/IO/ReadPolyData.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read a polydata file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Torso.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - # Read all the data from the file - reader = vtkXMLPolyDataReader() - reader.SetFileName(filename) - reader.Update() - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('NavajoWhite')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkOliveGreen')) - renderer.GetActiveCamera().Pitch(90) - renderer.GetActiveCamera().SetViewUp(0, 0, 1) - renderer.ResetCamera() - - renderWindow.SetSize(600, 600) - renderWindow.Render() - renderWindow.SetWindowName('ReadPolyData') - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadSLC.md b/data/examples/IO/ReadSLC.md deleted file mode 100644 index c13b129..0000000 --- a/data/examples/IO/ReadSLC.md +++ /dev/null @@ -1,13 +0,0 @@ -### Description - -In this example you will familiarize yourself with the stages required to read a .slc file and create a visualization pipeline in VTK. -Following is the three-step procedure: - -1. Read the data from .slc file using vtkSLCReader - -2. Implement Marching cubes Algorithm using vtkContourFilter - -3. Create Visualization pipeline to visualize data using an actor, mapper and rendering window - -!!! cite - This example was provided by Bharatesh Chakravarthi from Virtual Environment Lab, Chung-Ang University, Seoul, South Korea diff --git a/data/examples/IO/ReadSLC.py b/data/examples/IO/ReadSLC.py deleted file mode 100755 index 5254f34..0000000 --- a/data/examples/IO/ReadSLC.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkSLCReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - InputFilename, iso_value = get_program_parameters() - - colors = vtkNamedColors() - - # vtkSLCReader to read. - reader = vtkSLCReader() - reader.SetFileName(InputFilename) - reader.Update() - - # Create a mapper. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - # Implementing Marching Cubes Algorithm to create the surface using vtkContourFilter object. - contourFilter = vtkContourFilter() - contourFilter.SetInputConnection(reader.GetOutputPort()) - # Change the range(2nd and 3rd Parameter) based on your - # requirement. recommended value for 1st parameter is above 1 - # contourFilter.GenerateValues(5, 80.0, 100.0) - contourFilter.SetValue(0, iso_value) - - outliner = vtkOutlineFilter() - outliner.SetInputConnection(reader.GetOutputPort()) - outliner.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(contourFilter.GetOutputPort()) - mapper.SetScalarVisibility(0) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuse(0.8) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - actor.GetProperty().SetSpecular(0.8) - actor.GetProperty().SetSpecularPower(120.0) - - # Create a rendering window and renderer. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(500, 500) - - # Create a renderwindowinteractor. - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Assign actor to the renderer. - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - # Pick a good view - cam1 = renderer.GetActiveCamera() - cam1.SetFocalPoint(0.0, 0.0, 0.0) - cam1.SetPosition(0.0, -1.0, 0.0) - cam1.SetViewUp(0.0, 0.0, -1.0) - cam1.Azimuth(-90.0) - renderer.ResetCamera() - renderer.ResetCameraClippingRange() - - renderWindow.SetWindowName('ReadSLC') - renderWindow.SetSize(640, 512) - renderWindow.Render() - - # Enable user interface interactor. - renderWindowInteractor.Initialize() - renderWindow.Render() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Read a .slc file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='vw_knee.slc.') - parser.add_argument('iso_value', nargs='?', type=float, default=72.0, help='Defaullt 72.') - args = parser.parse_args() - return args.filename, args.iso_value - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadSTL.md b/data/examples/IO/ReadSTL.md deleted file mode 100644 index 2dd87a2..0000000 --- a/data/examples/IO/ReadSTL.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Read an STL file and create a PolyData output diff --git a/data/examples/IO/ReadSTL.py b/data/examples/IO/ReadSTL.py deleted file mode 100755 index bcfd637..0000000 --- a/data/examples/IO/ReadSTL.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOGeometry import vtkSTLReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read a .stl file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='42400-IDGH.stl') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - reader = vtkSTLReader() - reader.SetFileName(filename) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuse(0.8) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - actor.GetProperty().SetSpecular(0.3) - actor.GetProperty().SetSpecularPower(60.0) - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('ReadSTL') - - # Create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('DarkOliveGreen')) - - # Enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadUnstructuredGrid.md b/data/examples/IO/ReadUnstructuredGrid.md deleted file mode 100644 index e79c021..0000000 --- a/data/examples/IO/ReadUnstructuredGrid.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example demonstrates how to read an unstructured grid (VTU) file. The front facing faces are colored Misty Rose, while the back facing faces are colored Tomato. - -An example file to use is `src/Testing/Data/tetra.vtu`. diff --git a/data/examples/IO/ReadUnstructuredGrid.py b/data/examples/IO/ReadUnstructuredGrid.py deleted file mode 100755 index 387a2af..0000000 --- a/data/examples/IO/ReadUnstructuredGrid.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import vtkmodules.all as vtk - - -def get_program_parameters(): - import argparse - description = 'Read an unstructured grid file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='tetra.vtu.') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtk.vtkNamedColors() - - file_name = get_program_parameters() - - # Read the source file. - reader = vtk.vtkXMLUnstructuredGridReader() - reader.SetFileName(file_name) - reader.Update() # Needed because of GetScalarRange - output = reader.GetOutput() - # scalar_range = output.GetScalarRange() - - # Create the mapper that corresponds the objects of the vtk.vtk file - # into graphics elements - mapper = vtk.vtkDataSetMapper() - mapper.SetInputData(output) - # mapper.SetScalarRange(scalar_range) - mapper.ScalarVisibilityOff() - - # Create the Actor - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetLineWidth(2.0) - actor.GetProperty().SetColor(colors.GetColor3d("MistyRose")) - - backface = vtk.vtkProperty() - backface.SetColor(colors.GetColor3d('Tomato')) - actor.SetBackfaceProperty(backface) - - # Create the Renderer - renderer = vtk.vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Wheat')) - - # Create the RendererWindow - renderer_window = vtk.vtkRenderWindow() - renderer_window.SetSize(640, 480) - renderer_window.AddRenderer(renderer) - renderer_window.SetWindowName('ReadUnstructuredGrid') - - # Create the RendererWindowInteractor and display the vtk_file - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderer_window) - interactor.Initialize() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/ReadVTP.py b/data/examples/IO/ReadVTP.py deleted file mode 100755 index 8326a8c..0000000 --- a/data/examples/IO/ReadVTP.py +++ /dev/null @@ -1,68 +0,0 @@ -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read a VTK XML PolyData file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='horse.vtp.') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - reader = vtkXMLPolyDataReader() - reader.SetFileName(filename) - reader.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tan')) - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('ReadVTP') - - # Create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Assign actor to the renderer - ren.AddActor(actor) - - # Enable user interface interactor - iren.Initialize() - renWin.Render() - - ren.SetBackground(colors.GetColor3d('AliceBlue')) - ren.GetActiveCamera().SetPosition(-0.5, 0.1, 0.0) - ren.GetActiveCamera().SetViewUp(0.1, 0.0, 1.0) - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/TransientHDFReader.md b/data/examples/IO/TransientHDFReader.md deleted file mode 100644 index e2eb930..0000000 --- a/data/examples/IO/TransientHDFReader.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -That example uses a feature of vtk_hdf5 that is only available in [vtk/master](https://gitlab.kitware.com/vtk/vtk) and will be released with VTK 9.3. See [this blog post](https://www.kitware.com/how-to-write-time-dependent-data-in-vtkhdf-files/) for more information. diff --git a/data/examples/IO/TransientHDFReader.py b/data/examples/IO/TransientHDFReader.py deleted file mode 100755 index 63ab0e0..0000000 --- a/data/examples/IO/TransientHDFReader.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOHDF import vtkHDFReader -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDiscretizableColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read transient data writen inside a vtkhdf file.' - epilogue = '''''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='warping_spheres.vtkhdf') - args = parser.parse_args() - return args.file_name - - -def main(): - fn = get_program_parameters() - - colors = vtkNamedColors() - - # Read the dataset. - reader = vtkHDFReader() - reader.SetFileName(fn) - reader.Update() - print('Number of steps: ', reader.GetNumberOfSteps()) - polydata = reader.GetOutput() - - # Render the dataset. - mapper = vtkPolyDataMapper() - mapper.SetInputData(polydata) - mapper.SetLookupTable(get_ctf()) - mapper.SetScalarModeToUsePointFieldData() - mapper.SelectColorArray('SpatioTemporalHarmonics') - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - renderer.AddActor(actor) - - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetWindowName('TransientHDFReader') - ren_win.SetSize(1024, 512) - ren_win.Render() - - # Add the interactor. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Add the animation callback. - observer = AnimationObserver(iren, reader) - - # You must initialize the vtkRenderWindowInteractor - # before adding the observer and setting the repeating timer. - iren.Initialize() - iren.AddObserver('TimerEvent', observer) - iren.CreateRepeatingTimer(50) - - i_style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(i_style) - - iren.Start() - - -def get_ctf(): - ctf = vtkDiscretizableColorTransferFunction() - ctf.SetColorSpaceToLab() - ctf.SetScaleToLinear() - - ctf.AddRGBPoint(-30.3399130649763, 0.0862745098039216, 0.00392156862745098, 0.298039215686275) - ctf.AddRGBPoint(-29.3502559661865, 0.113725, 0.0235294, 0.45098) - ctf.AddRGBPoint(-28.5283393859863, 0.105882, 0.0509804, 0.509804) - ctf.AddRGBPoint(-27.958028793335, 0.0392157, 0.0392157, 0.560784) - ctf.AddRGBPoint(-27.4044914245605, 0.0313725, 0.0980392, 0.6) - ctf.AddRGBPoint(-26.8677291870117, 0.0431373, 0.164706, 0.639216) - ctf.AddRGBPoint(-26.096134185791, 0.054902, 0.243137, 0.678431) - ctf.AddRGBPoint(-25.0729293823242, 0.054902, 0.317647, 0.709804) - ctf.AddRGBPoint(-23.8148933330084, 0.0509804, 0.396078, 0.741176) - ctf.AddRGBPoint(-22.9992658665124, 0.0392157, 0.466667, 0.768627) - ctf.AddRGBPoint(-22.1836384000164, 0.0313725, 0.537255, 0.788235) - ctf.AddRGBPoint(-21.3323650360107, 0.0313725, 0.615686, 0.811765) - ctf.AddRGBPoint(-20.4601268768311, 0.0235294, 0.709804, 0.831373) - ctf.AddRGBPoint(-19.5878868103027, 0.0509804, 0.8, 0.85098) - ctf.AddRGBPoint(-18.8666133880615, 0.0705882, 0.854902, 0.870588) - ctf.AddRGBPoint(-18.1956596374512, 0.262745, 0.901961, 0.862745) - ctf.AddRGBPoint(-17.6085758209229, 0.423529, 0.941176, 0.87451) - ctf.AddRGBPoint(-16.7027893066406, 0.572549, 0.964706, 0.835294) - ctf.AddRGBPoint(-16.0989303588867, 0.658824, 0.980392, 0.843137) - ctf.AddRGBPoint(-15.6628112792969, 0.764706, 0.980392, 0.866667) - ctf.AddRGBPoint(-15.1931447982788, 0.827451, 0.980392, 0.886275) - ctf.AddRGBPoint(-14.2705841064453, 0.913725, 0.988235, 0.937255) - ctf.AddRGBPoint(-13.9854288101196, 1, 1, 0.972549019607843) - ctf.AddRGBPoint(-13.7002735137939, 0.988235, 0.980392, 0.870588) - ctf.AddRGBPoint(-13.2809276580811, 0.992156862745098, 0.972549019607843, 0.803921568627451) - ctf.AddRGBPoint(-12.9622249603271, 0.992157, 0.964706, 0.713725) - ctf.AddRGBPoint(-12.4254627227783, 0.988235, 0.956863, 0.643137) - ctf.AddRGBPoint(-11.5699977874756, 0.980392, 0.917647, 0.509804) - ctf.AddRGBPoint(-10.8487224578857, 0.968627, 0.87451, 0.407843) - ctf.AddRGBPoint(-10.1106739044189, 0.94902, 0.823529, 0.321569) - ctf.AddRGBPoint(-9.57391166687012, 0.929412, 0.776471, 0.278431) - ctf.AddRGBPoint(-8.78554153442383, 0.909804, 0.717647, 0.235294) - ctf.AddRGBPoint(-8.08104133605957, 0.890196, 0.658824, 0.196078) - ctf.AddRGBPoint(-7.50234400308847, 0.878431, 0.619608, 0.168627) - ctf.AddRGBPoint(-6.68671653659248, 0.870588, 0.54902, 0.156863) - ctf.AddRGBPoint(-5.87108907009648, 0.85098, 0.47451, 0.145098) - ctf.AddRGBPoint(-5.05546160360049, 0.831373, 0.411765, 0.133333) - ctf.AddRGBPoint(-4.23983413710449, 0.811765, 0.345098, 0.113725) - ctf.AddRGBPoint(-3.4242066706085, 0.788235, 0.266667, 0.0941176) - ctf.AddRGBPoint(-2.6085792041125, 0.741176, 0.184314, 0.0745098) - ctf.AddRGBPoint(-1.79295173761651, 0.690196, 0.12549, 0.0627451) - ctf.AddRGBPoint(-0.977324271120517, 0.619608, 0.0627451, 0.0431373) - ctf.AddRGBPoint(-0.214114964008331, 0.54902, 0.027451, 0.0705882) - ctf.AddRGBPoint(0.456838220357895, 0.470588, 0.0156863, 0.0901961) - ctf.AddRGBPoint(1.21166050434113, 0.4, 0.00392157, 0.101961) - ctf.AddRGBPoint(2.28518559486346, 0.188235294117647, 0, 0.0705882352941176) - - ctf.SetNumberOfValues(46) - ctf.DiscretizeOff() - - return ctf - - -class AnimationObserver(object): - def __init__(self, interactor, reader): - self.interactor = interactor - self.reader = reader - - def __call__(self, caller, ev): - step = 0 if (self.reader.GetStep() == self.reader.GetNumberOfSteps() - 1) else self.reader.GetStep() + 1 - self.reader.SetStep(step) - print('Current step: ', self.reader.GetStep()) - self.reader.Update() - self.interactor.Render() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/WriteLegacyLinearCells.md b/data/examples/IO/WriteLegacyLinearCells.md deleted file mode 100644 index abb8122..0000000 --- a/data/examples/IO/WriteLegacyLinearCells.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -This example uses vtkUnstructuredGridWriter to write each linear cell into a *.vtk* file. The files are written into the current directory. - -!!! seealso - [WriteXMLLinearCells](../WriteXMLLinearCells) writes the same files using the VTK XML format. - -!!! cite - The [VTK File Formats](VTKFileFormats#simple-legacy-formats) document discusses the XML file format. diff --git a/data/examples/IO/WriteLegacyLinearCells.py b/data/examples/IO/WriteLegacyLinearCells.py deleted file mode 100755 index 0656856..0000000 --- a/data/examples/IO/WriteLegacyLinearCells.py +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkHexagonalPrism, - vtkHexahedron, - vtkLine, - vtkPentagonalPrism, - vtkPixel, - vtkPolyLine, - vtkPolyVertex, - vtkPolygon, - vtkPyramid, - vtkQuad, - vtkTetra, - vtkTriangle, - vtkTriangleStrip, - vtkUnstructuredGrid, - vtkVertex, - vtkVoxel, - vtkWedge -) -from vtkmodules.vtkIOLegacy import vtkUnstructuredGridWriter - - -def main(): - filenames = list() - uGrids = list() - - uGrids.append(MakeUnstructuredGrid(vtkVertex())) - filenames.append('Vertex.vtk') - - uGrids.append(MakePolyVertex()) - filenames.append('PolyVertex.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkLine())) - filenames.append('Line.vtk') - - uGrids.append(MakePolyLine()) - filenames.append('PolyLine.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkTriangle())) - filenames.append('Triangle.vtk') - - uGrids.append(MakeTriangleStrip()) - filenames.append('TriangleStrip.vtk') - - uGrids.append(MakePolygon()) - filenames.append('Polygon.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkPixel())) - filenames.append('Pixel.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkQuad())) - filenames.append('Quad.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkTetra())) - filenames.append('Tetra.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkVoxel())) - filenames.append('Voxel.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkHexahedron())) - filenames.append('Hexahedron.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkWedge())) - filenames.append('Wedge.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkPyramid())) - filenames.append('Pyramid.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkPentagonalPrism())) - filenames.append('PentagonalPrism.vtk') - - uGrids.append(MakeUnstructuredGrid(vtkHexagonalPrism())) - filenames.append('HexagonalPrism.vtk') - - # Write each grid into a file - for i in range(0, len(uGrids)): - print('Writing: ', filenames[i]) - writer = vtkUnstructuredGridWriter() - writer.SetFileName(filenames[i]) - writer.SetInputData(uGrids[i]) - writer.Write() - - -def MakeUnstructuredGrid(aCell): - pcoords = aCell.GetParametricCoords() - for i in range(0, aCell.GetNumberOfPoints()): - aCell.GetPointIds().SetId(i, i) - aCell.GetPoints().SetPoint(i, (pcoords[3 * i]), (pcoords[3 * i + 1]), (pcoords[3 * i + 2])) - - ug = vtkUnstructuredGrid() - ug.SetPoints(aCell.GetPoints()) - ug.InsertNextCell(aCell.GetCellType(), aCell.GetPointIds()) - return ug - - -def MakePolyVertex(): - # A polyvertex is a cell represents a set of 0D vertices - numberOfVertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, .4) - points.InsertNextPoint(0, 1, .6) - - polyVertex = vtkPolyVertex() - polyVertex.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyVertex.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyVertex.GetCellType(), polyVertex.GetPointIds()) - - return ug - - -def MakePolyLine(): - # A polyline is a cell that represents a set of 1D lines - numberOfVertices = 5 - - points = vtkPoints() - points.InsertNextPoint(0, .5, 0) - points.InsertNextPoint(.5, 0, 0) - points.InsertNextPoint(1, .3, 0) - points.InsertNextPoint(1.5, .4, 0) - points.InsertNextPoint(2.0, .4, 0) - - polyline = vtkPolyLine() - polyline.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyline.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyline.GetCellType(), polyline.GetPointIds()) - - return ug - - -def MakeTriangleStrip(): - # A triangle is a cell that represents a triangle strip - numberOfVertices = 10 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(.5, 1, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(1.5, .8, 0) - points.InsertNextPoint(2.0, -.1, 0) - points.InsertNextPoint(2.5, .9, 0) - points.InsertNextPoint(3.0, 0, 0) - points.InsertNextPoint(3.5, .8, 0) - points.InsertNextPoint(4.0, -.2, 0) - points.InsertNextPoint(4.5, 1.1, 0) - - trianglestrip = vtkTriangleStrip() - trianglestrip.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - trianglestrip.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(trianglestrip.GetCellType(), trianglestrip.GetPointIds()) - - return ug - - -def MakePolygon(): - # A polygon is a cell that represents a polygon - numberOfVertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(.8, .5, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(.6, 1.2, 0) - points.InsertNextPoint(0, .8, 0) - - polygon = vtkPolygon() - polygon.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - polygon.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polygon.GetCellType(), polygon.GetPointIds()) - - return ug - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/WritePLY.md b/data/examples/IO/WritePLY.md deleted file mode 100644 index 700f3c0..0000000 --- a/data/examples/IO/WritePLY.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -!!! note - Unlike vtkPolyDataXMLWriter and most other VTK writers, to write colors to the .ply file you must specify to the vtkPLYWriter: - - plyWriter->SetArrayName("Colors"); - - where your color array was created/named like this: - - vtkNew colors; - colors->SetNumberOfComponents(3); - colors->SetName("Colors"); - -(This was found in response to a user question on StackOverflow: http://stackoverflow.com/questions/17783612/save-mesh-with-rgb-in-vtk/19525938) diff --git a/data/examples/IO/WritePLY.py b/data/examples/IO/WritePLY.py deleted file mode 100755 index ff36a97..0000000 --- a/data/examples/IO/WritePLY.py +++ /dev/null @@ -1,74 +0,0 @@ -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOPLY import ( - vtkPLYReader, - vtkPLYWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Generate image data, then write a .ply file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required ply filename.', nargs='?', - const='TestWritePLY.ply', - type=str, default='TestWritePLY.ply') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - sphereSource = vtkSphereSource() - sphereSource.Update() - - plyWriter = vtkPLYWriter() - plyWriter.SetFileName(filename) - plyWriter.SetInputConnection(sphereSource.GetOutputPort()) - plyWriter.Write() - - # Read and display for verification - reader = vtkPLYReader() - reader.SetFileName(filename) - reader.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('WritePLY') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('cobalt_green')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/WriteSTL.md b/data/examples/IO/WriteSTL.md deleted file mode 100644 index bd058a1..0000000 --- a/data/examples/IO/WriteSTL.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -An [STL file](https://en.wikipedia.org/wiki/STL_(file_format)) describes a triangulated three-dimensional surface by the unit normal and vertices (ordered by the right-hand rule) of the triangles. This example saves 3D geometric data stored in a vtkPolyData object to an STL file using vtkSTLWriter. diff --git a/data/examples/IO/WriteSTL.py b/data/examples/IO/WriteSTL.py deleted file mode 100755 index 88dd0c5..0000000 --- a/data/examples/IO/WriteSTL.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOGeometry import ( - vtkSTLReader, - vtkSTLWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Generate image data, then write a .stl file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required stl filename.', nargs='?', - const='TestWriteSTL.ply', - type=str, default='TestWriteSTL.ply') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - sphereSource = vtkSphereSource() - sphereSource.Update() - - # Write the stl file to disk - stlWriter = vtkSTLWriter() - stlWriter.SetFileName(filename) - stlWriter.SetInputConnection(sphereSource.GetOutputPort()) - stlWriter.Write() - - # Read and display for verification - reader = vtkSTLReader() - reader.SetFileName(filename) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('WriteSTL') - - # Create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('cobalt_green')) - - # Enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/WriteTriangleToFile.py b/data/examples/IO/WriteTriangleToFile.py deleted file mode 100755 index 151aa38..0000000 --- a/data/examples/IO/WriteTriangleToFile.py +++ /dev/null @@ -1,55 +0,0 @@ -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangle -) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate image data, then write a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestWriteTriangleToFile.vtp', - type=str, default='TestWriteTriangleToFile.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - filename = get_program_parameters() - - Points = vtkPoints() - Triangles = vtkCellArray() - Triangle = vtkTriangle() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - - Triangle.GetPointIds().SetId(0, 0) - Triangle.GetPointIds().SetId(1, 1) - Triangle.GetPointIds().SetId(2, 2) - Triangles.InsertNextCell(Triangle) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.SetPolys(Triangles) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/IO/WriteXMLLinearCells.md b/data/examples/IO/WriteXMLLinearCells.md deleted file mode 100644 index ab7d6f4..0000000 --- a/data/examples/IO/WriteXMLLinearCells.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -This example uses vtkXMLDataSetWriter to write each linear cell into a *.vtu* file. The files are written into the current directory. - -!!! seealso - [WriteLegacyLinearCells](../WriteLegacyLinearCells) writes the same files using the VTK legacy format. - -!!! cite - The [VTK File Formats](../../../VTKFileFormats#xml-file-formats) document discusses the XML file format. diff --git a/data/examples/IO/WriteXMLLinearCells.py b/data/examples/IO/WriteXMLLinearCells.py deleted file mode 100755 index 93ed34a..0000000 --- a/data/examples/IO/WriteXMLLinearCells.py +++ /dev/null @@ -1,206 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkHexagonalPrism, - vtkHexahedron, - vtkLine, - vtkPentagonalPrism, - vtkPixel, - vtkPolyLine, - vtkPolyVertex, - vtkPolygon, - vtkPyramid, - vtkQuad, - vtkTetra, - vtkTriangle, - vtkTriangleStrip, - vtkUnstructuredGrid, - vtkVertex, - vtkVoxel, - vtkWedge -) -from vtkmodules.vtkIOXML import vtkXMLDataSetWriter - - -def main(): - filenames = list() - uGrids = list() - - uGrids.append(MakeUnstructuredGrid(vtkVertex())) - filenames.append('Vertex.vtu') - - uGrids.append(MakePolyVertex()) - filenames.append('PolyVertex.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkLine())) - filenames.append('Line.vtu') - - uGrids.append(MakePolyLine()) - filenames.append('PolyLine.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkTriangle())) - filenames.append('Triangle.vtu') - - uGrids.append(MakeTriangleStrip()) - filenames.append('TriangleStrip.vtu') - - uGrids.append(MakePolygon()) - filenames.append('Polygon.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkPixel())) - filenames.append('Pixel.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkQuad())) - filenames.append('Quad.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkTetra())) - filenames.append('Tetra.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkVoxel())) - filenames.append('Voxel.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkHexahedron())) - filenames.append('Hexahedron.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkWedge())) - filenames.append('Wedge.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkPyramid())) - filenames.append('Pyramid.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkPentagonalPrism())) - filenames.append('PentagonalPrism.vtu') - - uGrids.append(MakeUnstructuredGrid(vtkHexagonalPrism())) - filenames.append('HexagonalPrism.vtu') - - # Write each grid into a file - for i in range(0, len(uGrids)): - print('Writing: ', filenames[i]) - writer = vtkXMLDataSetWriter() - writer.SetFileName(filenames[i]) - writer.SetInputData(uGrids[i]) - writer.Write() - - -def MakeUnstructuredGrid(aCell): - pcoords = aCell.GetParametricCoords() - for i in range(0, aCell.GetNumberOfPoints()): - aCell.GetPointIds().SetId(i, i) - aCell.GetPoints().SetPoint(i, (pcoords[3 * i]), (pcoords[3 * i + 1]), (pcoords[3 * i + 2])) - - ug = vtkUnstructuredGrid() - ug.SetPoints(aCell.GetPoints()) - ug.InsertNextCell(aCell.GetCellType(), aCell.GetPointIds()) - return ug - - -def MakePolyVertex(): - # A polyvertex is a cell represents a set of 0D vertices - numberOfVertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, .4) - points.InsertNextPoint(0, 1, .6) - - polyVertex = vtkPolyVertex() - polyVertex.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyVertex.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyVertex.GetCellType(), polyVertex.GetPointIds()) - - return ug - - -def MakePolyLine(): - # A polyline is a cell that represents a set of 1D lines - numberOfVertices = 5 - - points = vtkPoints() - points.InsertNextPoint(0, .5, 0) - points.InsertNextPoint(.5, 0, 0) - points.InsertNextPoint(1, .3, 0) - points.InsertNextPoint(1.5, .4, 0) - points.InsertNextPoint(2.0, .4, 0) - - polyline = vtkPolyLine() - polyline.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyline.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyline.GetCellType(), polyline.GetPointIds()) - - return ug - - -def MakeTriangleStrip(): - # A triangle is a cell that represents a triangle strip - numberOfVertices = 10 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(.5, 1, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(1.5, .8, 0) - points.InsertNextPoint(2.0, -.1, 0) - points.InsertNextPoint(2.5, .9, 0) - points.InsertNextPoint(3.0, 0, 0) - points.InsertNextPoint(3.5, .8, 0) - points.InsertNextPoint(4.0, -.2, 0) - points.InsertNextPoint(4.5, 1.1, 0) - - trianglestrip = vtkTriangleStrip() - trianglestrip.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - trianglestrip.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(trianglestrip.GetCellType(), trianglestrip.GetPointIds()) - - return ug - - -def MakePolygon(): - # A polygon is a cell that represents a polygon - numberOfVertices = 6 - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(.8, .5, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(.6, 1.2, 0) - points.InsertNextPoint(0, .8, 0) - - polygon = vtkPolygon() - polygon.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - polygon.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polygon.GetCellType(), polygon.GetPointIds()) - - return ug - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageData/ImageDataGeometryFilter.md b/data/examples/ImageData/ImageDataGeometryFilter.md deleted file mode 100644 index 26f6914..0000000 --- a/data/examples/ImageData/ImageDataGeometryFilter.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Convert a vtkImageData to a vtkPolyData. diff --git a/data/examples/ImageData/ImageDataGeometryFilter.py b/data/examples/ImageData/ImageDataGeometryFilter.py deleted file mode 100755 index 9256a11..0000000 --- a/data/examples/ImageData/ImageDataGeometryFilter.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkImagingSources import vtkImageCanvasSource2D -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create an image - source1 = vtkImageCanvasSource2D() - source1.SetScalarTypeToUnsignedChar() - source1.SetNumberOfScalarComponents(3) - source1.SetExtent(0, 100, 0, 100, 0, 0) - source1.SetDrawColor(colors.GetColor4ub('SteelBlue')) - source1.FillBox(0, 100, 0, 100) - source1.SetDrawColor(colors.GetColor4ub('PaleGoldenrod')) - source1.FillBox(10, 20, 10, 20) - source1.FillBox(40, 50, 20, 30) - source1.Update() - - # Convert the image to a polydata - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(source1.GetOutputPort()) - imageDataGeometryFilter.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualization - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('RosyBrown')) - renderWindow.SetWindowName('ImageDataGeometryFilter') - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageData/ImageNormalize.py b/data/examples/ImageData/ImageNormalize.py deleted file mode 100755 index 4fe64aa..0000000 --- a/data/examples/ImageData/ImageNormalize.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkImagingCore import vtkImageCast -from vtkmodules.vtkImagingGeneral import vtkImageNormalize -from vtkmodules.vtkImagingSources import vtkImageSinusoidSource -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create an image - source = vtkImageSinusoidSource() - source.Update() - - normalizeFilter = vtkImageNormalize() - - normalizeFilter.SetInputConnection(source.GetOutputPort()) - normalizeFilter.Update() - - inputCastFilter = vtkImageCast() - inputCastFilter.SetInputConnection(source.GetOutputPort()) - inputCastFilter.SetOutputScalarTypeToUnsignedChar() - inputCastFilter.Update() - - normalizeCastFilter = vtkImageCast() - normalizeCastFilter.SetInputConnection(normalizeFilter.GetOutputPort()) - normalizeCastFilter.SetOutputScalarTypeToUnsignedChar() - normalizeCastFilter.Update() - - # Create actors - inputActor = vtkImageActor() - inputActor.GetMapper().SetInputConnection(inputCastFilter.GetOutputPort()) - - normalizedActor = vtkImageActor() - normalizedActor.GetMapper().SetInputConnection(normalizeCastFilter.GetOutputPort()) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - - # And one interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - leftViewport = [0.0, 0.0, 0.5, 1.0] - rightViewport = [0.5, 0.0, 1.0, 1.0] - - # Setup both renderers - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) - leftRenderer.SetBackground(colors.GetColor3d('Sienna')) - - rightRenderer = vtkRenderer() - renderWindow.AddRenderer(rightRenderer) - rightRenderer.SetViewport(rightViewport) - rightRenderer.SetBackground(colors.GetColor3d('SteelBlue')) - - leftRenderer.AddActor(inputActor) - rightRenderer.AddActor(normalizedActor) - - leftRenderer.ResetCamera() - - rightRenderer.ResetCamera() - - renderWindow.SetWindowName('ImageNormalize') - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageData/ImageWeightedSum.md b/data/examples/ImageData/ImageWeightedSum.md deleted file mode 100644 index cc2daea..0000000 --- a/data/examples/ImageData/ImageWeightedSum.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Sum multiple images. Images must be of the same size and type. diff --git a/data/examples/ImageData/ImageWeightedSum.py b/data/examples/ImageData/ImageWeightedSum.py deleted file mode 100755 index 6e01eae..0000000 --- a/data/examples/ImageData/ImageWeightedSum.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkImagingCore import vtkImageCast -from vtkmodules.vtkImagingMath import vtkImageWeightedSum -from vtkmodules.vtkImagingSources import ( - vtkImageMandelbrotSource, - vtkImageSinusoidSource -) -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create image 1 - source1 = vtkImageMandelbrotSource() - source1.SetWholeExtent(0, 255, 0, 255, 0, 0) - source1.Update() - - source1Double = vtkImageCast() - source1Double.SetInputConnection(0, source1.GetOutputPort()) - source1Double.SetOutputScalarTypeToDouble() - - # Create image 2 - source2 = vtkImageSinusoidSource() - source2.SetWholeExtent(0, 255, 0, 255, 0, 0) - source2.Update() - - # Do the sum - sumFilter = vtkImageWeightedSum() - sumFilter.SetWeight(0, 0.8) - sumFilter.SetWeight(1, 0.2) - sumFilter.AddInputConnection(source1Double.GetOutputPort()) - sumFilter.AddInputConnection(source2.GetOutputPort()) - sumFilter.Update() - - # Display the images - source1CastFilter = vtkImageCast() - source1CastFilter.SetInputConnection(source1.GetOutputPort()) - source1CastFilter.SetOutputScalarTypeToUnsignedChar() - source1CastFilter.Update() - - source2CastFilter = vtkImageCast() - source2CastFilter.SetInputConnection(source2.GetOutputPort()) - source2CastFilter.SetOutputScalarTypeToUnsignedChar() - source2CastFilter.Update() - - summedCastFilter = vtkImageCast() - summedCastFilter.SetInputConnection(sumFilter.GetOutputPort()) - summedCastFilter.SetOutputScalarTypeToUnsignedChar() - summedCastFilter.Update() - - # Create actors - source1Actor = vtkImageActor() - source1Actor.GetMapper().SetInputConnection(source1CastFilter.GetOutputPort()) - - source2Actor = vtkImageActor() - source2Actor.GetMapper().SetInputConnection(source2CastFilter.GetOutputPort()) - - summedActor = vtkImageActor() - summedActor.GetMapper().SetInputConnection(summedCastFilter.GetOutputPort()) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - - # And one interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - leftViewport = [0.0, 0.0, 0.33, 1.0] - centerViewport = [0.33, 0.0, .66, 1.0] - rightViewport = [0.66, 0.0, 1.0, 1.0] - - # Setup renderers - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) - leftRenderer.SetBackground(colors.GetColor3d('Peru')) - - centerRenderer = vtkRenderer() - renderWindow.AddRenderer(centerRenderer) - centerRenderer.SetViewport(centerViewport) - centerRenderer.SetBackground(colors.GetColor3d('DarkTurquoise')) - - rightRenderer = vtkRenderer() - renderWindow.AddRenderer(rightRenderer) - rightRenderer.SetViewport(rightViewport) - rightRenderer.SetBackground(colors.GetColor3d('SteelBlue')) - - leftRenderer.AddActor(source1Actor) - centerRenderer.AddActor(source2Actor) - rightRenderer.AddActor(summedActor) - - leftRenderer.ResetCamera() - centerRenderer.ResetCamera() - rightRenderer.ResetCamera() - - renderWindow.SetWindowName('ImageWeightedSum') - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageData/SumVTKImages.py b/data/examples/ImageData/SumVTKImages.py deleted file mode 100755 index 00c2997..0000000 --- a/data/examples/ImageData/SumVTKImages.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkImagingMath import vtkImageWeightedSum - - -# ImageSets = List of Image sets -# Weights = List of weights e.g [1, 1, 1] - -def SumVTKImages(ImageSets, Weights): - NumOfImages = len(ImageSets) - SumFilter = vtkImageWeightedSum() - for x in range(0, NumOfImages, 1): - SumFilter.AddInputConnection(ImageSets[x]) - SumFilter.SetWeight(x, Weights[x]) - SumFilter.Update() - - # Return summed Image as vtkImageData - return SumFilter.GetOutput() diff --git a/data/examples/ImageData/WriteReadVtkImageData.py b/data/examples/ImageData/WriteReadVtkImageData.py deleted file mode 100755 index c331910..0000000 --- a/data/examples/ImageData/WriteReadVtkImageData.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import VTK_DOUBLE -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkIOXML import ( - vtkXMLImageDataReader, - vtkXMLImageDataWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Generate image data, edit data points, store and reload it.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtk filename, e.g. writeImageData.vti.', nargs='?', - const='writeImageData.vti', - type=str, default='writeImageData.vti') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - imageData = vtkImageData() - imageData.SetDimensions(3, 4, 5) - imageData.AllocateScalars(VTK_DOUBLE, 1) - - dims = imageData.GetDimensions() - - # Fill every entry of the image data with '2.0' - for z in range(dims[2]): - for y in range(dims[1]): - for x in range(dims[0]): - imageData.SetScalarComponentFromDouble(x, y, z, 0, 2.0) - - writer = vtkXMLImageDataWriter() - writer.SetFileName(filename) - writer.SetInputData(imageData) - writer.Write() - - # Read the file (to test that it was written correctly) - reader = vtkXMLImageDataReader() - reader.SetFileName(filename) - reader.Update() - - # Convert the image to a polydata - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort()) - imageDataGeometryFilter.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(3) - - # Setup rendering - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('White')) - renderer.ResetCamera() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/Attenuation.md b/data/examples/ImageProcessing/Attenuation.md deleted file mode 100644 index 6ef5500..0000000 --- a/data/examples/ImageProcessing/Attenuation.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This MRI image illustrates attenuation that can occur due to sensor position. The artifact is removed by dividing by the attenuation profile determined manually. This histograms shows how the artifact hides information in the form of scalar value clusters. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-6) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/Attenuation.py b/data/examples/ImageProcessing/Attenuation.py deleted file mode 100755 index 671b64a..0000000 --- a/data/examples/ImageProcessing/Attenuation.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkSphere -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import ( - vtkImageCast, - vtkImageShiftScale -) -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - - # Get rid of the discrete scalars. - smooth = vtkImageGaussianSmooth() - smooth.SetInputConnection(cast.GetOutputPort()) - smooth.SetStandardDeviations(0.8, 0.8, 0) - - m1 = vtkSphere() - m1.SetCenter(310, 130, 0) - m1.SetRadius(0) - - m2 = vtkSampleFunction() - m2.SetImplicitFunction(m1) - m2.SetModelBounds(0, 264, 0, 264, 0, 1) - m2.SetSampleDimensions(264, 264, 1) - - m3 = vtkImageShiftScale() - m3.SetInputConnection(m2.GetOutputPort()) - m3.SetScale(0.000095) - - div = vtkImageMathematics() - div.SetInputConnection(0, smooth.GetOutputPort()) - div.SetInputConnection(1, m3.GetOutputPort()) - div.SetOperationToMultiply() - - # Create the actors. - colorWindow = 256.0 - colorLevel = 127.5 - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(cast.GetOutputPort()) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - - filteredActor = vtkImageActor() - filteredActor.GetMapper().SetInputConnection(div.GetOutputPort()) - - # Define the viewport ranges. - # (xmin, ymin, xmax, ymax) - originalViewport = [0.0, 0.0, 0.5, 1.0] - filteredViewport = [0.5, 0.0, 1.0, 1.0] - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.SetViewport(originalViewport) - originalRenderer.AddActor(originalActor) - originalRenderer.ResetCamera() - originalRenderer.SetBackground(colors.GetColor3d("SlateGray")) - - filteredRenderer = vtkRenderer() - filteredRenderer.SetViewport(filteredViewport) - filteredRenderer.AddActor(filteredActor) - filteredRenderer.ResetCamera() - filteredRenderer.SetBackground(colors.GetColor3d("LightSlateGray")) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.AddRenderer(originalRenderer) - renderWindow.AddRenderer(filteredRenderer) - renderWindow.SetWindowName('Attenuation') - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'This MRI image illustrates attenuation that can occur due to sensor position.' - epilogue = ''' - The artifact is removed by dividing by the attenuation profile determined manually. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='AttenuationArtifact.pgm.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/EnhanceEdges.md b/data/examples/ImageProcessing/EnhanceEdges.md deleted file mode 100644 index df5007b..0000000 --- a/data/examples/ImageProcessing/EnhanceEdges.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -High-pass filters can also be used to compress the range of an image. Since low frequencies account for much of the dynamic range of an image but carry little information, a high-pass filter can significantly decrease an image’s scalar range and emphasize hidden details. The Laplacian filter, which is a second derivative operation, is one implementation of a high-pass filter. It eliminates constant and low frequencies leaving only high-frequency edges. The output of the Laplacian can be subtracted from the original image to produce edge enhancement or sharpening of an image. - -This example subtracts the Laplacian (middle) from the original image (left) resulting in edge enhancement or a sharpening operation (right). - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-9) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/EnhanceEdges.py b/data/examples/ImageProcessing/EnhanceEdges.py deleted file mode 100755 index 459980d..0000000 --- a/data/examples/ImageProcessing/EnhanceEdges.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingColor import vtkImageMapToWindowLevelColors -from vtkmodules.vtkImagingCore import vtkImageCast -from vtkmodules.vtkImagingGeneral import vtkImageLaplacian -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 - scalarRange[0] = reader.GetOutput().GetPointData().GetScalars().GetRange()[0] - scalarRange[1] = reader.GetOutput().GetPointData().GetScalars().GetRange()[1] - print("Range:", scalarRange) - middleSlice = 22 - - # Work with triple images. - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - laplacian = vtkImageLaplacian() - laplacian.SetInputConnection(cast.GetOutputPort()) - laplacian.SetDimensionality(3) - - enhance = vtkImageMathematics() - enhance.SetInputConnection(0, cast.GetOutputPort()) - enhance.SetInputConnection(1, laplacian.GetOutputPort()) - enhance.SetOperationToSubtract() - - colorWindow = (scalarRange[1] - scalarRange[0]) - colorLevel = colorWindow / 2 - - # Map the image through the lookup table. - originalColor = vtkImageMapToWindowLevelColors() - originalColor.SetWindow(colorWindow) - originalColor.SetLevel(colorLevel) - originalColor.SetInputConnection(reader.GetOutputPort()) - - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(originalColor.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetDisplayExtent( - reader.GetDataExtent()[0], reader.GetDataExtent()[1], - reader.GetDataExtent()[2], reader.GetDataExtent()[3], - middleSlice, middleSlice) - - laplacianColor = vtkImageMapToWindowLevelColors() - laplacianColor.SetWindow(1000) - laplacianColor.SetLevel(0) - laplacianColor.SetInputConnection(laplacian.GetOutputPort()) - - laplacianActor = vtkImageActor() - laplacianActor.GetMapper().SetInputConnection(laplacianColor.GetOutputPort()) - laplacianActor.GetProperty().SetInterpolationTypeToNearest() - laplacianActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - enhancedColor = vtkImageMapToWindowLevelColors() - enhancedColor.SetWindow(colorWindow) - enhancedColor.SetLevel(colorLevel) - enhancedColor.SetInputConnection(enhance.GetOutputPort()) - - enhancedActor = vtkImageActor() - enhancedActor.GetMapper().SetInputConnection(enhancedColor.GetOutputPort()) - enhancedActor.GetProperty().SetInterpolationTypeToNearest() - enhancedActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.AddActor(originalActor) - laplacianRenderer = vtkRenderer() - laplacianRenderer.AddActor(laplacianActor) - enhancedRenderer = vtkRenderer() - enhancedRenderer.AddActor(enhancedActor) - - renderers = list() - renderers.append(originalRenderer) - renderers.append(laplacianRenderer) - renderers.append(enhancedRenderer) - - # Setup viewports for the renderers. - rendererSize = 400 - xGridDimensions = 3 - yGridDimensions = 1 - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(xGridDimensions): - index = row * xGridDimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, float(yGridDimensions - row) / yGridDimensions] - renderers[index].SetViewport(viewport) - renderWindow.AddRenderer(renderers[index]) - renderWindow.SetWindowName('EnhanceEdges') - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Renderers share one camera. - renderWindow.Render() - renderers[0].GetActiveCamera().Dolly(1.5) - renderers[0].ResetCameraClippingRange() - - for r in range(1, len(renderers)): - renderers[r].SetActiveCamera(renderers[0].GetActiveCamera()) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'High-pass filters can extract and enhance edges in an image.' - epilogue = ''' - Subtraction of the Laplacian (middle) from the original image (left) results - in edge enhancement or a sharpening operation (right). - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/GaussianSmooth.md b/data/examples/ImageProcessing/GaussianSmooth.md deleted file mode 100644 index 1116012..0000000 --- a/data/examples/ImageProcessing/GaussianSmooth.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Low-pass filters can be implemented as convolution with a Gaussian kernel. The Gaussian kernel displayed on top has been magnified for this figure. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-2) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/GaussianSmooth.py b/data/examples/ImageProcessing/GaussianSmooth.py deleted file mode 100755 index 25e8415..0000000 --- a/data/examples/ImageProcessing/GaussianSmooth.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import vtkImageCast -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Process the image. - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToFloat() - - smoothing_filter = vtkImageGaussianSmooth() - smoothing_filter.SetDimensionality(2) - smoothing_filter.SetInputConnection(cast.GetOutputPort()) - smoothing_filter.SetStandardDeviations(4.0, 4.0) - smoothing_filter.SetRadiusFactors(2.0, 2.0) - - # Create the actors. - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection( - reader.GetOutputPort()) - - filteredActor = vtkImageActor() - filteredActor.GetMapper().SetInputConnection( - smoothing_filter.GetOutputPort()) - - # Define the viewport ranges. - # (xmin, ymin, xmax, ymax) - originalViewport = [0.0, 0.0, 0.5, 1.0] - filteredViewport = [0.5, 0.0, 1.0, 1.0] - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.SetViewport(originalViewport) - originalRenderer.AddActor(originalActor) - originalRenderer.ResetCamera() - originalRenderer.SetBackground(colors.GetColor3d("SlateGray")) - - filteredRenderer = vtkRenderer() - filteredRenderer.SetViewport(filteredViewport) - filteredRenderer.AddActor(filteredActor) - filteredRenderer.ResetCamera() - filteredRenderer.SetBackground(colors.GetColor3d("LightSlateGray")) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('GaussianSmooth') - renderWindow.AddRenderer(originalRenderer) - renderWindow.AddRenderer(filteredRenderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Low-pass filters can be implemented as convolution with a Gaussian kernel.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Gourds.png.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/HybridMedianComparison.md b/data/examples/ImageProcessing/HybridMedianComparison.md deleted file mode 100644 index 90b2ba3..0000000 --- a/data/examples/ImageProcessing/HybridMedianComparison.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Comparison of median and hybrid-median filters. The hybrid filter preserves corners and thin lines, better than the median filter. The lower patterns represent the three neighborhoods used to compute the hybrid median. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-4) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/HybridMedianComparison.py b/data/examples/ImageProcessing/HybridMedianComparison.py deleted file mode 100755 index fc6b9b2..0000000 --- a/data/examples/ImageProcessing/HybridMedianComparison.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import ( - vtkImageCast, - vtkImageThreshold -) -from vtkmodules.vtkImagingGeneral import ( - vtkImageHybridMedian2D, - vtkImageMedian3D -) -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkImagingSources import vtkImageNoiseSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 - scalarRange[0] = reader.GetOutput().GetPointData().GetScalars().GetRange()[0] - scalarRange[1] = reader.GetOutput().GetPointData().GetScalars().GetRange()[1] - print("Range:", scalarRange) - middleSlice = (reader.GetOutput().GetExtent()[5] - reader.GetOutput().GetExtent()[4]) // 2 - - # Work with double images. - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - originalData = vtkImageData() - originalData.DeepCopy(cast.GetOutput()) - - noisyData = vtkImageData() - - AddShotNoise(originalData, noisyData, 2000.0, 0.1, reader.GetOutput().GetExtent()) - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) - - hybridMedian1 = vtkImageHybridMedian2D() - hybridMedian1.SetInputData(noisyData) - hybridMedian = vtkImageHybridMedian2D() - hybridMedian.SetInputConnection(hybridMedian1.GetOutputPort()) - - colorWindow = (scalarRange[1] - scalarRange[0]) * 0.8 - colorLevel = colorWindow / 2 - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputData(originalData) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetDisplayExtent(reader.GetDataExtent()[0], reader.GetDataExtent()[1], reader.GetDataExtent()[2], - reader.GetDataExtent()[3], middleSlice, middleSlice) - - noisyActor = vtkImageActor() - noisyActor.GetMapper().SetInputData(noisyData) - noisyActor.GetProperty().SetColorWindow(colorWindow) - noisyActor.GetProperty().SetColorLevel(colorLevel) - noisyActor.GetProperty().SetInterpolationTypeToNearest() - noisyActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - hybridMedianActor = vtkImageActor() - hybridMedianActor.GetMapper().SetInputConnection(hybridMedian.GetOutputPort()) - hybridMedianActor.GetProperty().SetColorWindow(colorWindow) - hybridMedianActor.GetProperty().SetColorLevel(colorLevel) - hybridMedianActor.GetProperty().SetInterpolationTypeToNearest() - hybridMedianActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - medianActor = vtkImageActor() - medianActor.GetMapper().SetInputConnection(median.GetOutputPort()) - medianActor.GetProperty().SetColorWindow(colorWindow) - medianActor.GetProperty().SetColorLevel(colorLevel) - medianActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.AddActor(originalActor) - noisyRenderer = vtkRenderer() - noisyRenderer.AddActor(noisyActor) - hybridRenderer = vtkRenderer() - hybridRenderer.AddActor(hybridMedianActor) - medianRenderer = vtkRenderer() - medianRenderer.AddActor(medianActor) - - renderers = list() - renderers.append(originalRenderer) - renderers.append(noisyRenderer) - renderers.append(hybridRenderer) - renderers.append(medianRenderer) - - # Setup viewports for the renderers. - rendererSize = 400 - xGridDimensions = 2 - yGridDimensions = 2 - - renderWindow = vtkRenderWindow() - renderWindow.SetSize( - rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(xGridDimensions): - index = row * xGridDimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, float(yGridDimensions - row) / yGridDimensions] - renderers[index].SetViewport(viewport) - renderWindow.AddRenderer(renderers[index]) - renderWindow.SetWindowName('HybridMedianComparison') - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. - renderWindow.Render() - renderers[0].GetActiveCamera().Dolly(1.5) - renderers[0].ResetCameraClippingRange() - for r in range(1, len(renderers)): - renderers[r].SetActiveCamera(renderers[0].GetActiveCamera()) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Comparison of median and hybrid-median filters.' - epilogue = ''' - The hybrid filter preserves corners and thin lines, better than the median filter. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='TestPattern.png.') - args = parser.parse_args() - return args.filename - - -def AddShotNoise(inputImage, outputImage, noiseAmplitude, noiseFraction, extent): - shotNoiseSource = vtkImageNoiseSource() - shotNoiseSource.SetWholeExtent(extent) - shotNoiseSource.SetMinimum(0.0) - shotNoiseSource.SetMaximum(1.0) - - shotNoiseThresh1 = vtkImageThreshold() - shotNoiseThresh1.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh1.ThresholdByLower(1.0 - noiseFraction) - shotNoiseThresh1.SetInValue(0) - shotNoiseThresh1.SetOutValue(noiseAmplitude) - shotNoiseThresh2 = vtkImageThreshold() - shotNoiseThresh2.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh2.ThresholdByLower(noiseFraction) - shotNoiseThresh2.SetInValue(1.0 - noiseAmplitude) - shotNoiseThresh2.SetOutValue(0.0) - - shotNoise = vtkImageMathematics() - shotNoise.SetInputConnection(0, shotNoiseThresh1.GetOutputPort()) - shotNoise.SetInputConnection(1, shotNoiseThresh2.GetOutputPort()) - shotNoise.SetOperationToAdd() - - add = vtkImageMathematics() - add.SetInputData(0, inputImage) - add.SetInputConnection(1, shotNoise.GetOutputPort()) - add.SetOperationToAdd() - add.Update() - outputImage.DeepCopy(add.GetOutput()) - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/IdealHighPass.md b/data/examples/ImageProcessing/IdealHighPass.md deleted file mode 100644 index 04a4d01..0000000 --- a/data/examples/ImageProcessing/IdealHighPass.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Low-pass and high-pass filtering become trivial in the frequency domain. A portion of the pixels are simply masked or attenuated. This example shows a high pass Butterworth filter that attenuates the frequency domain image with the function `out(i, j) = 1 / (1 + pow(CutOff/Freq(i,j), 2*Order))`. - -The gradual attenuation of the filter is important. The ideal high-pass filter, shown in the same exaample, simply masks a set of pixels in the frequency domain. The abrupt transition causes a ringing effect in the spatial domain. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-11) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/IdealHighPass.py b/data/examples/ImageProcessing/IdealHighPass.py deleted file mode 100755 index 1bc1d91..0000000 --- a/data/examples/ImageProcessing/IdealHighPass.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingColor import vtkImageMapToWindowLevelColors -from vtkmodules.vtkImagingCore import vtkImageExtractComponents -from vtkmodules.vtkImagingFourier import ( - vtkImageButterworthHighPass, - vtkImageFFT, - vtkImageIdealHighPass, - vtkImageRFFT -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - fft = vtkImageFFT() - fft.SetInputConnection(reader.GetOutputPort()) - - idealHighPass = vtkImageIdealHighPass() - idealHighPass.SetInputConnection(fft.GetOutputPort()) - idealHighPass.SetXCutOff(0.1) - idealHighPass.SetYCutOff(0.1) - - idealRfft = vtkImageRFFT() - idealRfft.SetInputConnection(idealHighPass.GetOutputPort()) - - idealReal = vtkImageExtractComponents() - idealReal.SetInputConnection(idealRfft.GetOutputPort()) - idealReal.SetComponents(0) - - butterworthHighPass = vtkImageButterworthHighPass() - butterworthHighPass.SetInputConnection(fft.GetOutputPort()) - butterworthHighPass.SetXCutOff(0.1) - butterworthHighPass.SetYCutOff(0.1) - - butterworthRfft = vtkImageRFFT() - butterworthRfft.SetInputConnection(butterworthHighPass.GetOutputPort()) - - butterworthReal = vtkImageExtractComponents() - butterworthReal.SetInputConnection(butterworthRfft.GetOutputPort()) - butterworthReal.SetComponents(0) - - # Create the actors. - idealColor = vtkImageMapToWindowLevelColors() - idealColor.SetWindow(500) - idealColor.SetLevel(0) - idealColor.SetInputConnection(idealReal.GetOutputPort()) - - idealActor = vtkImageActor() - idealActor.GetMapper().SetInputConnection(idealColor.GetOutputPort()) - idealActor.GetProperty().SetInterpolationTypeToNearest() - - butterworthColor = vtkImageMapToWindowLevelColors() - butterworthColor.SetWindow(500) - butterworthColor.SetLevel(0) - butterworthColor.SetInputConnection(butterworthReal.GetOutputPort()) - - butterworthActor = vtkImageActor() - butterworthActor.GetMapper().SetInputConnection(butterworthColor.GetOutputPort()) - butterworthActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup the renderers. - idealRenderer = vtkRenderer() - idealRenderer.SetViewport(0.0, 0.0, 0.5, 1.0) - idealRenderer.AddActor(idealActor) - idealRenderer.ResetCamera() - idealRenderer.SetBackground(colors.GetColor3d("SlateGray")) - - butterworthRenderer = vtkRenderer() - butterworthRenderer.SetViewport(0.5, 0.0, 1.0, 1.0) - butterworthRenderer.AddActor(butterworthActor) - butterworthRenderer.SetActiveCamera(idealRenderer.GetActiveCamera()) - butterworthRenderer.SetBackground(colors.GetColor3d("LightSlateGray")) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('IdealHighPass') - renderWindow.AddRenderer(idealRenderer) - renderWindow.AddRenderer(butterworthRenderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - idealRenderer.GetActiveCamera().Dolly(1.4) - idealRenderer.ResetCameraClippingRange() - renderWindowInteractor.Initialize() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'This figure shows two high-pass filters in the frequency domain.' - epilogue = ''' - The Butterworth high-pass filter has a gradual attenuation that avoids ringing - produced by the ideal high-pass filter with an abrupt transition. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='fullhead15.png.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/IsoSubsample.md b/data/examples/ImageProcessing/IsoSubsample.md deleted file mode 100644 index c2e8998..0000000 --- a/data/examples/ImageProcessing/IsoSubsample.md +++ /dev/null @@ -1,13 +0,0 @@ -### Description - -An artifact called aliasing occurs when sub-sampling and is often associated with stair-stepping edges. Sampling theory proves that discrete sampled signals with spacing S, completely describe continuous functions composed of frequencies less than S/2. When a signal is sub-sampled, its capacity to hold high frequency information is reduced. However, the high frequency energy does not disappear. It wraps around the frequency spectrum appearing as a low frequency alias artifact. The solution, which eliminates this artifact, is to low-pass filter before sub-sampling. - -Low-pass smoothing reduces the high frequency range of an image that would cause aliasing. The same aliasing phenomena occurs when acquiring data. If a signal from an analog source contains high frequencies, saving the analog data in a discrete form requires sub-sampling that will introduce alias artifacts. For this reason, it is common practice to acquire data at high resolutions,then smooth and subsample to reduce the image to a manageable size. - -This example demonstrates aliasing that occurs when a high-frequency signal is sub-sampled. High frequencies appear as low frequency artifacts. The left image is an isosurface of a skull after sub-sampling. The right image used a low-pass filter before sub-sampling to reduce aliasing. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-5) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/ImageProcessing/IsoSubsample.py b/data/examples/ImageProcessing/IsoSubsample.py deleted file mode 100755 index a1d8a63..0000000 --- a/data/examples/ImageProcessing/IsoSubsample.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkImageMarchingCubes -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import vtkImageShrink3D -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - file_name = get_program_parameters() - - # Read the image. - reader_factory = vtkImageReader2Factory() - reader = reader_factory.CreateImageReader2(file_name) - reader.SetFileName(file_name) - reader.Update() - - # Smoothed pipeline. - smooth = vtkImageGaussianSmooth() - smooth.SetDimensionality(3) - smooth.SetInputConnection(reader.GetOutputPort()) - smooth.SetStandardDeviations(1.75, 1.75, 0.0) - smooth.SetRadiusFactor(2) - - subsample_smoothed = vtkImageShrink3D() - subsample_smoothed.SetInputConnection(smooth.GetOutputPort()) - subsample_smoothed.SetShrinkFactors(4, 4, 1) - - iso_smoothed = vtkImageMarchingCubes() - iso_smoothed.SetInputConnection(smooth.GetOutputPort()) - iso_smoothed.SetValue(0, 1150) - - iso_smoothed_mapper = vtkPolyDataMapper() - iso_smoothed_mapper.SetInputConnection(iso_smoothed.GetOutputPort()) - iso_smoothed_mapper.ScalarVisibilityOff() - - iso_smoothed_actor = vtkActor() - iso_smoothed_actor.SetMapper(iso_smoothed_mapper) - iso_smoothed_actor.GetProperty().SetColor(colors.GetColor3d("Ivory")) - - # Unsmoothed pipeline. - # Sub sample the data. - subsample = vtkImageShrink3D() - subsample.SetInputConnection(reader.GetOutputPort()) - subsample.SetShrinkFactors(4, 4, 1) - - iso = vtkImageMarchingCubes() - iso.SetInputConnection(subsample.GetOutputPort()) - iso.SetValue(0, 1150) - - iso_mapper = vtkPolyDataMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) - iso_mapper.ScalarVisibilityOff() - - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor(colors.GetColor3d("Ivory")) - - # The rendering Pipeline. - - # Setup the render window, renderer, and interactor. - left_viewport = [0.0, 0.0, 0.5, 1.0] - right_viewport = [0.5, 0.0, 1.0, 1.0] - - renderer_left = vtkRenderer() - renderer_left.SetViewport(left_viewport) - - renderer_right = vtkRenderer() - renderer_right.SetViewport(right_viewport) - - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer_left) - render_window.AddRenderer(renderer_right) - - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - renderer_left.AddActor(iso_actor) - renderer_right.AddActor(iso_smoothed_actor) - - renderer_left.GetActiveCamera().SetFocalPoint(0.0, 0.0, 0.0) - renderer_left.GetActiveCamera().SetPosition(0.0, -1.0, 0.0) - renderer_left.GetActiveCamera().SetViewUp(0.0, 0.0, -1.0) - renderer_left.ResetCamera() - renderer_left.GetActiveCamera().Azimuth(-20.0) - renderer_left.GetActiveCamera().Elevation(20.0) - renderer_left.ResetCameraClippingRange() - - renderer_left.SetBackground(colors.GetColor3d("SlateGray")) - renderer_right.SetBackground(colors.GetColor3d("LightSlateGray")) - renderer_right.SetActiveCamera(renderer_left.GetActiveCamera()) - - render_window.SetSize(640, 480) - render_window.SetWindowName('IsoSubsample') - render_window.Render() - - render_window_interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'This figure demonstrates aliasing that occurs when a high-frequency signal is subsampled.' - epilogue = ''' - High frequencies appear as low frequency artifacts. - The left image is an isosurface of a skull after subsampling. - The right image used a low-pass filter before subsampling to reduce aliasing. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/MedianComparison.md b/data/examples/ImageProcessing/MedianComparison.md deleted file mode 100644 index 1dc2a74..0000000 --- a/data/examples/ImageProcessing/MedianComparison.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Comparison of Gaussian and Median smoothing for reducing low-probability high-amplitude noise. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-3) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/MedianComparison.py b/data/examples/ImageProcessing/MedianComparison.py deleted file mode 100755 index 0e5b137..0000000 --- a/data/examples/ImageProcessing/MedianComparison.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import ( - vtkImageCast, - vtkImageThreshold -) -from vtkmodules.vtkImagingGeneral import ( - vtkImageGaussianSmooth, - vtkImageMedian3D -) -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkImagingSources import vtkImageNoiseSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 - scalarRange[0] = reader.GetOutput().GetPointData().GetScalars().GetRange()[0] - scalarRange[1] = reader.GetOutput().GetPointData().GetScalars().GetRange()[1] - print("Range:", scalarRange) - middleSlice = (reader.GetOutput().GetExtent()[5] - reader.GetOutput().GetExtent()[4]) // 2 - - # Work with double images - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - originalData = vtkImageData() - originalData.DeepCopy(cast.GetOutput()) - - noisyData = vtkImageData() - - AddShotNoise(originalData, noisyData, 2000.0, 0.1, reader.GetOutput().GetExtent()) - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) - - gaussian = vtkImageGaussianSmooth() - gaussian.SetDimensionality(2) - gaussian.SetInputData(noisyData) - gaussian.SetStandardDeviations(2.0, 2.0) - gaussian.SetRadiusFactors(2.0, 2.0) - - colorWindow = (scalarRange[1] - scalarRange[0]) * 0.8 - colorLevel = colorWindow / 2 - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputData(originalData) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetZSlice(middleSlice) - - noisyActor = vtkImageActor() - noisyActor.GetMapper().SetInputData(noisyData) - noisyActor.GetProperty().SetColorWindow(colorWindow) - noisyActor.GetProperty().SetColorLevel(colorLevel) - noisyActor.GetProperty().SetInterpolationTypeToNearest() - noisyActor.SetZSlice(middleSlice) - - gaussianActor = vtkImageActor() - gaussianActor.GetMapper().SetInputConnection(gaussian.GetOutputPort()) - gaussianActor.GetProperty().SetColorWindow(colorWindow) - gaussianActor.GetProperty().SetColorLevel(colorLevel) - gaussianActor.GetProperty().SetInterpolationTypeToNearest() - gaussianActor.SetZSlice(middleSlice) - - medianActor = vtkImageActor() - medianActor.GetMapper().SetInputConnection(median.GetOutputPort()) - medianActor.GetProperty().SetColorWindow(colorWindow) - medianActor.GetProperty().SetColorLevel(colorLevel) - medianActor.GetProperty().SetInterpolationTypeToNearest() - medianActor.SetZSlice(middleSlice) - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.AddActor(originalActor) - noisyRenderer = vtkRenderer() - noisyRenderer.AddActor(noisyActor) - gaussRenderer = vtkRenderer() - gaussRenderer.AddActor(gaussianActor) - medianRenderer = vtkRenderer() - medianRenderer.AddActor(medianActor) - - renderers = list() - renderers.append(originalRenderer) - renderers.append(noisyRenderer) - renderers.append(gaussRenderer) - renderers.append(medianRenderer) - - # Setup viewports for the renderers. - rendererSize = 400 - xGridDimensions = 2 - yGridDimensions = 2 - - renderWindow = vtkRenderWindow() - renderWindow.SetSize( - rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(xGridDimensions): - index = row * xGridDimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, float(yGridDimensions - row) / yGridDimensions] - renderers[index].SetViewport(viewport) - renderWindow.AddRenderer(renderers[index]) - renderWindow.SetWindowName('MedianComparison') - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. - renderWindow.Render() - renderers[0].GetActiveCamera().Dolly(1.5) - renderers[0].ResetCameraClippingRange() - for r in range(1, len(renderers)): - renderers[r].SetActiveCamera(renderers[0].GetActiveCamera()) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Comparison of Gaussian and Median smoothing for reducing low-probability high-amplitude noise.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def AddShotNoise(inputImage, outputImage, noiseAmplitude, noiseFraction, extent): - shotNoiseSource = vtkImageNoiseSource() - shotNoiseSource.SetWholeExtent(extent) - shotNoiseSource.SetMinimum(0.0) - shotNoiseSource.SetMaximum(1.0) - - shotNoiseThresh1 = vtkImageThreshold() - shotNoiseThresh1.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh1.ThresholdByLower(1.0 - noiseFraction) - shotNoiseThresh1.SetInValue(0) - shotNoiseThresh1.SetOutValue(noiseAmplitude) - shotNoiseThresh2 = vtkImageThreshold() - shotNoiseThresh2.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh2.ThresholdByLower(noiseFraction) - shotNoiseThresh2.SetInValue(1.0 - noiseAmplitude) - shotNoiseThresh2.SetOutValue(0.0) - - shotNoise = vtkImageMathematics() - shotNoise.SetInputConnection(0, shotNoiseThresh1.GetOutputPort()) - shotNoise.SetInputConnection(1, shotNoiseThresh2.GetOutputPort()) - shotNoise.SetOperationToAdd() - - add = vtkImageMathematics() - add.SetInputData(0, inputImage) - add.SetInputConnection(1, shotNoise.GetOutputPort()) - add.SetOperationToAdd() - add.Update() - outputImage.DeepCopy(add.GetOutput()) - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/MorphologyComparison.md b/data/examples/ImageProcessing/MorphologyComparison.md deleted file mode 100644 index 1820337..0000000 --- a/data/examples/ImageProcessing/MorphologyComparison.md +++ /dev/null @@ -1,19 +0,0 @@ -### Description - -Although preprocessing can do a lot to improve segmentation results, postprocessing can also be useful. Morphological filters, which operate on binary or discrete images, can be useful for manipulating the shape of the segmented regions. In this brief discussion we will only consider operations that use circular footprints, even though these morphological filters can be defined much more generally. - -Erosion is implemented by removing pixels within a specified distance of a border. For each pixel not in the segmented region, all the neighbors in a circular region around the pixels are turned off. This erosion filter shrinks the segmented region and small isolated regions disappear. - -The opposite of erosion is dilation. This filter grows the area of segmented regions. Small holes in the segmented region are completely closed. Any pixel not in the segmented region but near the region is turned on. - -Dilation and erosion are dual filters with nearly identical implementations. Dilating the “on” pixels is equivalent to eroding “off” pixels in a binary image. Holes in the map disappear. However, dilation alone also grows the boundaries of the segmented regions. When dilation is followed by erosion in a closing operation, small holes are removed; however, the boundary of the segmented regions remain in the same general location. - -Opening is the dual of closing. Opening removes small islands of pixels. It is implemented with an initial erosion, followed by a dilation. - -Connectivity filters can also remove small regions without affecting the remaining boundaries of segmented regions. This set of filters separate the segmented pixels into equivalence classes based on a neighbor relation. Two pixels belong to the same class if they are touching. There are two common neighbor relations in two-dimensional images: four connectivity considers pixels neighbors if they are edge neighbors, and eight connectivity considers pixels neighbors if pixels share any vertex. - -This example demonstrates various binary filters that can alter the shape of -segmented regions. From left to right, top to bottom: original image, connectivity, erosion, dilation, opening, closing. - -!!! info - See [this figure](../../../VTKBook/10Chapter10/#Figure%2010-14) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/MorphologyComparison.py b/data/examples/ImageProcessing/MorphologyComparison.py deleted file mode 100755 index 79336c6..0000000 --- a/data/examples/ImageProcessing/MorphologyComparison.py +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingMorphological import ( - vtkImageDilateErode3D, - vtkImageSeedConnectivity -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Dilate - dilate = vtkImageDilateErode3D() - dilate.SetInputConnection(reader.GetOutputPort()) - dilate.SetDilateValue(0) - dilate.SetErodeValue(255) - dilate.SetKernelSize(31, 31, 1) - - # Erode - erode = vtkImageDilateErode3D() - erode.SetInputConnection(reader.GetOutputPort()) - erode.SetDilateValue(255) - erode.SetErodeValue(0) - erode.SetKernelSize(31, 31, 1) - - # Opening - dilate then erode. - dilate1 = vtkImageDilateErode3D() - dilate1.SetInputConnection(reader.GetOutputPort()) - dilate1.SetDilateValue(0) - dilate1.SetErodeValue(255) - dilate1.SetKernelSize(31, 31, 1) - - erode1 = vtkImageDilateErode3D() - erode1.SetInputConnection(dilate1.GetOutputPort()) - erode1.SetDilateValue(255) - erode1.SetErodeValue(0) - erode1.SetKernelSize(31, 31, 1) - - # Closing - erode then dilate. - erode2 = vtkImageDilateErode3D() - erode2.SetInputConnection(reader.GetOutputPort()) - erode2.SetDilateValue(255) - erode2.SetErodeValue(0) - erode2.SetKernelSize(31, 31, 1) - - dilate2 = vtkImageDilateErode3D() - dilate2.SetInputConnection(erode2.GetOutputPort()) - dilate2.SetDilateValue(0) - dilate2.SetErodeValue(255) - dilate2.SetKernelSize(31, 31, 1) - - # Connectivity - con = vtkImageSeedConnectivity() - con.SetInputConnection(reader.GetOutputPort()) - con.AddSeed(300, 200) - con.SetInputConnectValue(0) - con.SetOutputConnectedValue(0) - con.SetOutputUnconnectedValue(255) - - # Actors - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(reader.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - - connectedActor = vtkImageActor() - connectedActor.GetMapper().SetInputConnection(con.GetOutputPort()) - connectedActor.GetProperty().SetInterpolationTypeToNearest() - - erodeActor = vtkImageActor() - erodeActor.GetMapper().SetInputConnection(erode.GetOutputPort()) - erodeActor.GetProperty().SetInterpolationTypeToNearest() - - dilateActor = vtkImageActor() - dilateActor.GetMapper().SetInputConnection(dilate.GetOutputPort()) - dilateActor.GetProperty().SetInterpolationTypeToNearest() - - openingActor = vtkImageActor() - openingActor.GetMapper().SetInputConnection(dilate2.GetOutputPort()) - openingActor.GetProperty().SetInterpolationTypeToNearest() - - closingActor = vtkImageActor() - closingActor.GetMapper().SetInputConnection(erode1.GetOutputPort()) - closingActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup renderers - originalRenderer = vtkRenderer() - originalRenderer.AddActor(originalActor) - connectedRenderer = vtkRenderer() - connectedRenderer.AddActor(connectedActor) - dilateRenderer = vtkRenderer() - dilateRenderer.AddActor(dilateActor) - erodeRenderer = vtkRenderer() - erodeRenderer.AddActor(erodeActor) - closingRenderer = vtkRenderer() - closingRenderer.AddActor(closingActor) - openingRenderer = vtkRenderer() - openingRenderer.AddActor(openingActor) - - renderers = list() - renderers.append(originalRenderer) - renderers.append(connectedRenderer) - renderers.append(erodeRenderer) - renderers.append(dilateRenderer) - renderers.append(openingRenderer) - renderers.append(closingRenderer) - - # Setup viewports for the renderers - rendererSize = 300 - xGridDimensions = 2 - yGridDimensions = 3 - - renderWindow = vtkRenderWindow() - renderWindow.SetSize( - rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(xGridDimensions): - index = row * xGridDimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, float(yGridDimensions - row) / yGridDimensions] - renderers[index].SetViewport(viewport) - renderWindow.AddRenderer(renderers[index]) - renderWindow.SetWindowName('MorphologyComparison') - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. - renderWindow.Render() - renderers[0].GetActiveCamera().Dolly(1.5) - renderers[0].ResetCameraClippingRange() - - for r in range(1, len(renderers)): - renderers[r].SetActiveCamera(renderers[0].GetActiveCamera()) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Demonstrate various binary filters that can alter the shape of segmented regions.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='binary.pgm.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/Pad.md b/data/examples/ImageProcessing/Pad.md deleted file mode 100644 index 699ce7f..0000000 --- a/data/examples/ImageProcessing/Pad.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -An important point about the discrete Fourier transform is that it treats the image as a periodic function. This means the pixels on the right border are adjacent to pixels on the left border. Since there is usually no physical relationship between these pixels, the artificial horizontal and vertical edges can distort the frequency spectrum and subsequent processing. To reduce these artifacts, the original image can be multiplied by a window function that becomes zero at the borders. - -Another approach removes these artificial edges by smoothing only along the borders. - -In both of these approaches, a portion of the original image is lost, so only the central portion of an image can be processed. If this is unacceptable, another solution is to double the dimensions of the original image with a mirror-padding filter. The intermediate image is periodic and continuous. - -The left image has been padded with a constant (800). On the right, mirror padding has been used to remove artificial edges introduced by borders. - -!!! info - See [Figure 10-12](../../../VTKBook/10Chapter10/#Figure%2010-12) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/Pad.py b/data/examples/ImageProcessing/Pad.py deleted file mode 100755 index 4cdcb63..0000000 --- a/data/examples/ImageProcessing/Pad.py +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingColor import vtkImageMapToWindowLevelColors -from vtkmodules.vtkImagingCore import ( - vtkImageConstantPad, - vtkImageMirrorPad -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Pipelines - constantPad = vtkImageConstantPad() - constantPad.SetInputConnection(reader.GetOutputPort()) - constantPad.SetConstant(800) - constantPad.SetOutputWholeExtent(-127, 383, -127, 383, 22, 22) - - mirrorPad = vtkImageMirrorPad() - mirrorPad.SetInputConnection(reader.GetOutputPort()) - mirrorPad.SetOutputWholeExtent(constantPad.GetOutputWholeExtent()) - - # Create actors - constantPadColor = vtkImageMapToWindowLevelColors() - constantPadColor.SetWindow(2000) - constantPadColor.SetLevel(1000) - constantPadColor.SetInputConnection(constantPad.GetOutputPort()) - - constantPadActor = vtkImageActor() - constantPadActor.GetMapper().SetInputConnection( - constantPadColor.GetOutputPort()) - constantPadActor.GetProperty().SetInterpolationTypeToNearest() - - mirrorPadColor = vtkImageMapToWindowLevelColors() - mirrorPadColor.SetWindow(2000) - mirrorPadColor.SetLevel(1000) - mirrorPadColor.SetInputConnection(mirrorPad.GetOutputPort()) - - mirrorPadActor = vtkImageActor() - mirrorPadActor.GetMapper().SetInputConnection( - mirrorPadColor.GetOutputPort()) - mirrorPadActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup the renderers. - constantPadRenderer = vtkRenderer() - constantPadRenderer.SetViewport(0.0, 0.0, 0.5, 1.0) - constantPadRenderer.AddActor(constantPadActor) - constantPadRenderer.ResetCamera() - constantPadRenderer.SetBackground(colors.GetColor3d("SlateGray")) - - mirrorPadRenderer = vtkRenderer() - mirrorPadRenderer.SetViewport(0.5, 0.0, 1.0, 1.0) - mirrorPadRenderer.AddActor(mirrorPadActor) - mirrorPadRenderer.SetActiveCamera(constantPadRenderer.GetActiveCamera()) - mirrorPadRenderer.SetBackground(colors.GetColor3d("LightSlateGray")) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('Pad') - renderWindow.AddRenderer(constantPadRenderer) - renderWindow.AddRenderer(mirrorPadRenderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - constantPadRenderer.GetActiveCamera().Dolly(1.2) - constantPadRenderer.ResetCameraClippingRange() - renderWindowInteractor.Initialize() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Convolution in frequency space treats the image as a periodic function.' - epilogue = ''' - A large kernel can pick up features from both sides of the image. - The lower-left image has been padded with zeros to eliminate wraparound during convolution. - On the right, mirror padding has been used to remove artificial edges introduced by borders. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImageProcessing/VTKSpectrum.md b/data/examples/ImageProcessing/VTKSpectrum.md deleted file mode 100644 index db25417..0000000 --- a/data/examples/ImageProcessing/VTKSpectrum.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -The discrete Fourier transform changes an image from the spatial domain into the frequency domain, where each pixel represents a sinusoidal function. This example shows an image and its power spectrum displayed using a logarithmic transfer function. - -!!! info - See [Figure 10-10](../../../VTKBook/10Chapter10/#Figure%2010-10) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImageProcessing/VTKSpectrum.py b/data/examples/ImageProcessing/VTKSpectrum.py deleted file mode 100755 index eb61869..0000000 --- a/data/examples/ImageProcessing/VTKSpectrum.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkImagingCore import vtkImageMapToColors -from vtkmodules.vtkImagingFourier import ( - vtkImageFFT, - vtkImageFourierCenter -) -from vtkmodules.vtkImagingMath import ( - vtkImageLogarithmicScale, - vtkImageMagnitude -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkWindowLevelLookupTable -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - fft = vtkImageFFT() - fft.SetInputConnection(reader.GetOutputPort()) - - mag = vtkImageMagnitude() - mag.SetInputConnection(fft.GetOutputPort()) - - center = vtkImageFourierCenter() - center.SetInputConnection(mag.GetOutputPort()) - - compress = vtkImageLogarithmicScale() - compress.SetInputConnection(center.GetOutputPort()) - compress.SetConstant(15) - compress.Update() - - # Create the actors. - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(reader.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - - compressedActor = vtkImageActor() - compressedActor.GetMapper().SetInputConnection(compress.GetOutputPort()) - compressedActor.GetProperty().SetInterpolationTypeToNearest() - CreateImageActor(compressedActor, 160, 120) - - # Define the viewport ranges. - # (xmin, ymin, xmax, ymax) - originalViewport = [0.0, 0.0, 0.5, 1.0] - compressedViewport = [0.5, 0.0, 1.0, 1.0] - - # Setup the renderers. - originalRenderer = vtkRenderer() - originalRenderer.SetViewport(originalViewport) - originalRenderer.AddActor(originalActor) - originalRenderer.ResetCamera() - originalRenderer.SetBackground(colors.GetColor3d("SlateGray")) - - compressedRenderer = vtkRenderer() - compressedRenderer.SetViewport(compressedViewport) - compressedRenderer.AddActor(compressedActor) - compressedRenderer.ResetCamera() - compressedRenderer.SetBackground(colors.GetColor3d("LightSlateGray")) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('VTKSpectrum') - renderWindow.AddRenderer(originalRenderer) - renderWindow.AddRenderer(compressedRenderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'The discrete Fourier transform.' - epilogue = ''' - This changes an image from the spatial domain into the frequency domain, - where each pixel represents a sinusoidal function. - This figure shows an image and its power spectrum displayed using a logarithmic transfer function. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='vtks.pgm.') - args = parser.parse_args() - return args.filename - - -def CreateImageActor(actor, colorWindow, colorLevel): - wlut = vtkWindowLevelLookupTable() - wlut.SetWindow(colorWindow) - wlut.SetLevel(colorLevel) - wlut.Build() - - # Map the image through the lookup table. - color = vtkImageMapToColors() - color.SetLookupTable(wlut) - color.SetInputData(actor.GetMapper().GetInput()) - - actor.GetMapper().SetInputConnection(color.GetOutputPort()) - return - - -if __name__ == '__main__': - main() diff --git a/data/examples/Images/Actor2D.py b/data/examples/Images/Actor2D.py deleted file mode 100755 index 4052c62..0000000 --- a/data/examples/Images/Actor2D.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersGeneral import vtkVertexGlyphFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor2D, - vtkPolyDataMapper2D, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - points = vtkPoints() - points.InsertNextPoint(10, 10, 0) - points.InsertNextPoint(100, 100, 0) - points.InsertNextPoint(200, 200, 0) - - polydata = vtkPolyData() - polydata.SetPoints(points) - - glyphFilter = vtkVertexGlyphFilter() - glyphFilter.SetInputData(polydata) - glyphFilter.Update() - - mapper = vtkPolyDataMapper2D() - mapper.SetInputConnection(glyphFilter.GetOutputPort()) - mapper.Update() - - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - actor.GetProperty().SetPointSize(8) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderWindow.SetSize(300, 300) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - renderWindow.SetWindowName('Actor2D') - - # Render and interact - renderWindow.Render() - # w2if = vtkWindowToImageFilter() - # w2if.SetInput(renderWindow) - # w2if.Update() - # - # writer = vtkPNGWriter() - # writer.SetFileName('TestActor2D.png') - # writer.SetInputConnection(w2if.GetOutputPort()) - # writer.Write() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Images/BackgroundImage.md b/data/examples/Images/BackgroundImage.md deleted file mode 100644 index e939d00..0000000 --- a/data/examples/Images/BackgroundImage.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example displays an image as the "background" of a scene, and renders a superquadric in front of it. - -The example accepts a jpeg file on the command line to use as a background image. If there is no file, it generates a simple background. diff --git a/data/examples/Images/BackgroundImage.py b/data/examples/Images/BackgroundImage.py deleted file mode 100755 index 7ec7ce1..0000000 --- a/data/examples/Images/BackgroundImage.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSuperquadricSource -from vtkmodules.vtkIOImage import vtkJPEGReader -from vtkmodules.vtkImagingSources import vtkImageCanvasSource2D -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkImageActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Add a background image at a render window.' - epilogue = ''' - Add a background image to a render window. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', default=None, type=str, nargs='?', help='A required filename.') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - # Verify input arguments - fn = get_program_parameters() - if fn: - # Read the image - jpeg_reader = vtkJPEGReader() - if not jpeg_reader.CanReadFile(fn): - print('Error reading file:', fn) - return - - jpeg_reader.SetFileName(fn) - jpeg_reader.Update() - image_data = jpeg_reader.GetOutput() - else: - canvas_source = vtkImageCanvasSource2D() - canvas_source.SetExtent(0, 100, 0, 100, 0, 0) - canvas_source.SetScalarTypeToUnsignedChar() - canvas_source.SetNumberOfScalarComponents(3) - canvas_source.SetDrawColor(colors.GetColor4ub('warm_grey')) - canvas_source.FillBox(0, 100, 0, 100) - canvas_source.SetDrawColor(colors.GetColor4ub('DarkCyan')) - canvas_source.FillTriangle(10, 10, 25, 10, 25, 25) - canvas_source.SetDrawColor(colors.GetColor4ub('LightCoral')) - canvas_source.FillTube(75, 75, 0, 75, 5.0) - canvas_source.Update() - image_data = canvas_source.GetOutput() - - # Create an image actor to display the image - image_actor = vtkImageActor() - image_actor.SetInputData(image_data) - - # Create a renderer to display the image in the background - background_renderer = vtkRenderer() - - # Create a superquadric - superquadric_source = vtkSuperquadricSource() - superquadric_source.SetPhiRoundness(1.1) - superquadric_source.SetThetaRoundness(.2) - - # Create a mapper and actor - superquadric_mapper = vtkPolyDataMapper() - superquadric_mapper.SetInputConnection(superquadric_source.GetOutputPort()) - - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - superquadric_actor.GetProperty().SetColor(colors.GetColor3d('NavajoWhite')) - - scene_renderer = vtkRenderer() - render_window = vtkRenderWindow() - - # Set up the render window and renderers such that there is - # a background layer and a foreground layer - background_renderer.SetLayer(0) - background_renderer.InteractiveOff() - scene_renderer.SetLayer(1) - render_window.SetNumberOfLayers(2) - render_window.AddRenderer(background_renderer) - render_window.AddRenderer(scene_renderer) - render_window.SetWindowName('BackgroundImage') - - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - # Add actors to the renderers - scene_renderer.AddActor(superquadric_actor) - background_renderer.AddActor(image_actor) - - # Render once to figure out where the background camera will be - render_window.Render() - - # Set up the background camera to fill the renderer with the image - origin = image_data.GetOrigin() - spacing = image_data.GetSpacing() - extent = image_data.GetExtent() - - camera = background_renderer.GetActiveCamera() - camera.ParallelProjectionOn() - - xc = origin[0] + 0.5 * (extent[0] + extent[1]) * spacing[0] - yc = origin[1] + 0.5 * (extent[2] + extent[3]) * spacing[1] - # xd = (extent[1] - extent[0] + 1) * spacing[0] - yd = (extent[3] - extent[2] + 1) * spacing[1] - d = camera.GetDistance() - camera.SetParallelScale(0.5 * yd) - camera.SetFocalPoint(xc, yc, 0.0) - camera.SetPosition(xc, yc, d) - - # Render again to set the correct view - render_window.Render() - - # Interact with the window - render_window_interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Images/Cast.md b/data/examples/Images/Cast.md deleted file mode 100644 index 4aa164e..0000000 --- a/data/examples/Images/Cast.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Cast an image to a different type. diff --git a/data/examples/Images/Cast.py b/data/examples/Images/Cast.py deleted file mode 100755 index 84dfdf3..0000000 --- a/data/examples/Images/Cast.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkImagingCore import vtkImageCast -from vtkmodules.vtkImagingSources import vtkImageMandelbrotSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleImage -from vtkmodules.vtkRenderingCore import ( - vtkImageActor, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a float image - source = vtkImageMandelbrotSource() - source.Update() - - print(source.GetOutput().GetScalarTypeAsString()) - - castFilter = vtkImageCast() - castFilter.SetInputConnection(source.GetOutputPort()) - castFilter.SetOutputScalarTypeToUnsignedChar() - castFilter.Update() - - # Create an actor - actor = vtkImageActor() - actor.GetMapper().SetInputConnection(castFilter.GetOutputPort()) - - # Setup renderer - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - renderer.ResetCamera() - - # Setup render window - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('Cast') - - # Setup render window interactor - renderWindowInteractor = vtkRenderWindowInteractor() - style = vtkInteractorStyleImage() - renderWindowInteractor.SetInteractorStyle(style) - - # Render and start interaction - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindow.Render() - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Images/ImageWarp.py b/data/examples/Images/ImageWarp.py deleted file mode 100755 index 7c306e0..0000000 --- a/data/examples/Images/ImageWarp.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkMergeFilter -from vtkmodules.vtkFiltersGeneral import vtkWarpScalar -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkIOImage import vtkBMPReader -from vtkmodules.vtkImagingColor import vtkImageLuminance -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [60, 93, 144, 255]) - - # Read in an image and compute a luminance value. The image is extracted - # as a set of polygons (vtkImageDataGeometryFilter). We then will - # warp the plane using the scalar (luminance) values. - # - reader = vtkBMPReader() - reader.SetFileName(fileName) - # Convert the image to a grey scale. - luminance = vtkImageLuminance() - luminance.SetInputConnection(reader.GetOutputPort()) - # Pass the data to the pipeline as polygons. - geometry = vtkImageDataGeometryFilter() - geometry.SetInputConnection(luminance.GetOutputPort()) - # Warp the data in a direction perpendicular to the image plane. - warp = vtkWarpScalar() - warp.SetInputConnection(geometry.GetOutputPort()) - warp.SetScaleFactor(-0.1) - - # Use vtkMergeFilter to combine the original image with the warped geometry. - merge = vtkMergeFilter() - merge.SetGeometryConnection(warp.GetOutputPort()) - merge.SetScalarsConnection(reader.GetOutputPort()) - mapper = vtkDataSetMapper() - mapper.SetInputConnection(merge.GetOutputPort()) - mapper.SetScalarRange(0, 255) - actor = vtkActor() - actor.SetMapper(mapper) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(actor) - ren.ResetCamera() - ren.SetBackground(colors.GetColor3d('BkgColor')) - # ren.GetActiveCamera().Azimuth(20) - # ren.GetActiveCamera().Elevation(30) - # ren.ResetCameraClippingRange() - # ren.GetActiveCamera().Zoom(1.3) - ren.GetActiveCamera().SetPosition(-100, -130, 325) - ren.GetActiveCamera().SetFocalPoint(105, 114, -29) - ren.GetActiveCamera().SetViewUp(0.51, 0.54, 0.67) - ren.ResetCameraClippingRange() - - renWin.SetSize(512, 512) - renWin.SetWindowName('ImageWarp') - - # Render the image. - iren.Initialize() - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'ImageWarp.' - epilogue = ''' -This example shows how to combine data from both the imaging - and graphics pipelines. The vtkMergeData filter is used to - merge the data from each together. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filePrefix', help='Path to the masonry.bmp file.') - args = parser.parse_args() - return args.filePrefix - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.md b/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.md deleted file mode 100644 index d4d7bfb..0000000 --- a/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Demonstration on how to perform boolean operations with implicit functions. diff --git a/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.py b/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.py deleted file mode 100755 index d9c7a78..0000000 --- a/data/examples/ImplicitFunctions/BooleanOperationImplicitFunctions.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkBox, - vtkImplicitBoolean, - vtkSphere -) -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a sphere - sphere = vtkSphere() - sphere.SetRadius(1) - sphere.SetCenter(1, 0, 0) - - # create a box - box = vtkBox() - box.SetBounds(-1, 1, -1, 1, -1, 1) - - # combine the two implicit functions - boolean = vtkImplicitBoolean() - boolean.SetOperationTypeToDifference() - # boolean.SetOperationTypeToUnion() - # boolean.SetOperationTypeToIntersection() - boolean.AddFunction(box) - boolean.AddFunction(sphere) - - # The sample function generates a distance function from the implicit - # function. This is then contoured to get a polygonal surface. - sample = vtkSampleFunction() - sample.SetImplicitFunction(boolean) - sample.SetModelBounds(-1, 2, -1, 1, -1, 1) - sample.SetSampleDimensions(40, 40, 40) - sample.ComputeNormalsOff() - - # contour - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.ScalarVisibilityOff() - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) - - # add the actor - renderer.AddActor(actor) - - # render window - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('BooleanOperationImplicitFunctions') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # Start - interactor.Initialize() - renwin.Render() - # renderer.GetActiveCamera().AddObserver('ModifiedEvent', CameraModifiedCallback) - renderer.GetActiveCamera().SetPosition(5.0, -4.0, 1.6) - renderer.GetActiveCamera().SetViewUp(0.1, 0.5, 0.9) - renderer.GetActiveCamera().SetDistance(6.7) - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImplicitFunctions/ImplicitQuadric.md b/data/examples/ImplicitFunctions/ImplicitQuadric.md deleted file mode 100644 index 5d5af13..0000000 --- a/data/examples/ImplicitFunctions/ImplicitQuadric.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Create an ellipsoid by using the implicit quadric. diff --git a/data/examples/ImplicitFunctions/ImplicitQuadric.py b/data/examples/ImplicitFunctions/ImplicitQuadric.py deleted file mode 100755 index 6f512e5..0000000 --- a/data/examples/ImplicitFunctions/ImplicitQuadric.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create an ellipsoid using a implicit quadric - quadric = vtkQuadric() - quadric.SetCoefficients(0.5, 1, 0.2, 0, 0.1, 0, 0, 0.2, 0, 0) - - # The sample function generates a distance function from the implicit - # function. This is then contoured to get a polygonal surface. - sample = vtkSampleFunction() - sample.SetImplicitFunction(quadric) - sample.SetModelBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5) - sample.SetSampleDimensions(40, 40, 40) - sample.ComputeNormalsOff() - - # contour - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.ScalarVisibilityOff() - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) - - # add the actor - renderer.AddActor(actor) - - # render window - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('ImplicitQuadric') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # Start - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImplicitFunctions/ImplicitSphere.md b/data/examples/ImplicitFunctions/ImplicitSphere.md deleted file mode 100644 index b9aef5d..0000000 --- a/data/examples/ImplicitFunctions/ImplicitSphere.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example creates an isosurface of sampled sphere. - -!!! info - See [Figure 6-23b](../../../VTKBook/06Chapter6/#Figure%206-23b) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/ImplicitFunctions/ImplicitSphere.py b/data/examples/ImplicitFunctions/ImplicitSphere.py deleted file mode 100755 index c339aff..0000000 --- a/data/examples/ImplicitFunctions/ImplicitSphere.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkSphere -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - sphere = vtkSphere() - - # Sample the function - sample = vtkSampleFunction() - sample.SetSampleDimensions(50, 50, 50) - sample.SetImplicitFunction(sphere) - value = 2.0 - xmin = -value - xmax = value - ymin = -value - ymax = value - zmin = -value - zmax = value - sample.SetModelBounds(xmin, xmax, ymin, ymax, zmin, zmax) - - # Create the 0 isosurface - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, 1, 1) - - # Map the contours to graphical primitives - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contours.GetOutputPort()) - contourMapper.ScalarVisibilityOff() - - # Create an actor for the contours - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('ImplicitSphere') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(contourActor) - renderer.SetBackground(colors.GetColor3d("BkgColor")) - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImplicitFunctions/ImplicitSphere1.md b/data/examples/ImplicitFunctions/ImplicitSphere1.md deleted file mode 100644 index 2e23b61..0000000 --- a/data/examples/ImplicitFunctions/ImplicitSphere1.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Shows how to create a surface representing a sphere by creating an implicit sphere, sampling the implicit function, and finally contouring the sampled data to produce the surface. diff --git a/data/examples/ImplicitFunctions/ImplicitSphere1.py b/data/examples/ImplicitFunctions/ImplicitSphere1.py deleted file mode 100755 index 56b293d..0000000 --- a/data/examples/ImplicitFunctions/ImplicitSphere1.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkSphere -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphere = vtkSphere() - sphere.SetCenter(0, 0, 0) - sphere.SetRadius(0.5) - - # The sample function generates a distance function from the implicit - # function. This is then contoured to get a polygonal surface. - sample = vtkSampleFunction() - sample.SetImplicitFunction(sphere) - sample.SetModelBounds(-.5, .5, -.5, .5, -.5, .5) - sample.SetSampleDimensions(20, 20, 20) - sample.ComputeNormalsOff() - - # contour - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.ScalarVisibilityOff() - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) - - # add the actor - renderer.AddActor(actor) - - # render window - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('ImplicitSphere1') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # Start - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/ImplicitFunctions/SampleFunction.py b/data/examples/ImplicitFunctions/SampleFunction.py deleted file mode 100755 index dff7a11..0000000 --- a/data/examples/ImplicitFunctions/SampleFunction.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkSuperquadric -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - value = 2.0 - colors = vtkNamedColors() - - implicitFunction = vtkSuperquadric() - implicitFunction.SetPhiRoundness(2.5) - implicitFunction.SetThetaRoundness(.5) - - # Sample the function. - sample = vtkSampleFunction() - sample.SetSampleDimensions(50, 50, 50) - sample.SetImplicitFunction(implicitFunction) - - xmin, xmax, ymin, ymax, zmin, zmax = -value, value, -value, value, -value, value - sample.SetModelBounds(xmin, xmax, ymin, ymax, zmin, zmax) - - # Create the 0 isosurface. - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, 2.0, 2.0) - - # Map the contours to graphical primitives. - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contours.GetOutputPort()) - contourMapper.SetScalarRange(0.0, 1.2) - - # Create an actor for the contours. - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Create a box around the function to indicate the sampling volume. - - # Create outline. - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) - - # Map it to graphics primitives. - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - # Create an actor. - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Visualize. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('ImplicitSphere1') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(contourActor) - renderer.AddActor(outlineActor) - renderer.SetBackground(colors.GetColor3d("Tan")) - - # Enable user interface interactor - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/InfoVis/ParallelCoordinatesExtraction.md b/data/examples/InfoVis/ParallelCoordinatesExtraction.md deleted file mode 100644 index e1133d2..0000000 --- a/data/examples/InfoVis/ParallelCoordinatesExtraction.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Using Parallel Coordinates View to plot and compare data set attributes, and then using selections in the parallel coordinates view to extract and view data points associated with those selections. diff --git a/data/examples/InfoVis/ParallelCoordinatesExtraction.py b/data/examples/InfoVis/ParallelCoordinatesExtraction.py deleted file mode 100755 index 3998048..0000000 --- a/data/examples/InfoVis/ParallelCoordinatesExtraction.py +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env python - -# Example of how to use Parallel Coordinates View to plot and compare -# data set attributes, and then to use selections in the parallel coordinates -# view to extract and view data points associated with those selections -# Use the 'u' character to toggle between 'inspect modes' on the parallel -# coordinates view (i.e. between selecting data and manipulating axes) -# Note that no points will show up inside of the 3d box outline until you -# select some lines/curves in the parallel coordinates view - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersExtraction import vtkExtractSelection -from vtkmodules.vtkFiltersGeneral import ( - vtkAnnotationLink, - vtkBrownianPoints -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingCore import vtkRTAnalyticSource -from vtkmodules.vtkImagingGeneral import vtkImageGradient -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkViewsInfovis import ( - vtkParallelCoordinatesRepresentation, - vtkParallelCoordinatesView -) - - -def main(): - colors = vtkNamedColors() - - # Generate an image data set with multiple attribute arrays to probe and view - rt = vtkRTAnalyticSource() - rt.SetWholeExtent(-3, 3, -3, 3, -3, 3) - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) - brown.SetInputConnection(grad.GetOutputPort()) - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) - elev.SetHighPoint(3, 3, 3) - elev.SetInputConnection(brown.GetOutputPort()) - - # Updating here because I will need to probe scalar ranges before - # the render window updates the pipeline - elev.Update() - - # Set up parallel coordinates representation to be used in View - rep = vtkParallelCoordinatesRepresentation() - rep.SetInputConnection(elev.GetOutputPort()) - rep.SetInputArrayToProcess(0, 0, 0, 0, 'RTDataGradient') - rep.SetInputArrayToProcess(1, 0, 0, 0, 'RTData') - rep.SetInputArrayToProcess(2, 0, 0, 0, 'Elevation') - rep.SetInputArrayToProcess(3, 0, 0, 0, 'BrownianVectors') - rep.SetUseCurves(0) # set to 1 to use smooth curves - rep.SetLineOpacity(0.5) - rep.SetAxisColor(colors.GetColor3d('Gold')) - rep.SetLineColor(colors.GetColor3d('MistyRose')) - - # Set up the Parallel Coordinates View and hook in representation - view = vtkParallelCoordinatesView() - view.SetRepresentation(rep) - view.SetInspectMode(view.VTK_INSPECT_SELECT_DATA) - view.SetBrushOperatorToReplace() - view.SetBrushModeToLasso() - - # Create a annotation link to access selection in parallel coordinates view - annotationLink = vtkAnnotationLink() - # If you don't set the FieldType explicitly it ends up as UNKNOWN - # (as of 21 Feb 2010) - # See vtkSelectionNode doc for field and content type enum values - annotationLink.GetCurrentSelection().GetNode(0).SetFieldType(1) # Point - annotationLink.GetCurrentSelection().GetNode(0).SetContentType(4) # Indices - # Update before passing annotationLink to vtkExtractSelection - annotationLink.Update() - # Connect the annotation link to the parallel coordinates representation - rep.SetAnnotationLink(annotationLink) - - # Extract portion of data corresponding to parallel coordinates selection - extract = vtkExtractSelection() - extract.SetInputConnection(0, elev.GetOutputPort()) - extract.SetInputConnection(1, annotationLink.GetOutputPort(2)) - - def update_render_windows(obj, event): - ''' - Handle updating of RenderWindow since it's not a 'View' - and so not covered by vtkViewUpdater - - :param obj: - :param event: - :return: - ''' - # ren.ResetCamera() - renWin.Render() - - # Set up callback to update 3d render window when selections are changed in - # parallel coordinates view - annotationLink.AddObserver('AnnotationChangedEvent', update_render_windows) - - def toggle_inspectors(obj, event): - - if view.GetInspectMode() == 0: - view.SetInspectMode(1) - else: - view.SetInspectMode(0) - - # Set up callback to toggle between inspect modes (manip axes & select data) - view.GetInteractor().AddObserver('UserEvent', toggle_inspectors) - - # 3D outline of image data bounds - outline = vtkOutlineFilter() - outline.SetInputConnection(elev.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Build the lookup table for the 3d data scalar colors (brown to white) - lut = vtkLookupTable() - lut.SetTableRange(0, 256) - lut.SetHueRange(0.1, 0.1) - lut.SetSaturationRange(1.0, 0.1) - lut.SetValueRange(0.4, 1.0) - lut.Build() - - # Set up the 3d rendering parameters - # of the image data which is selected in parallel coordinates - coloring_by = 'Elevation' - dataMapper = vtkDataSetMapper() - dataMapper.SetInputConnection(extract.GetOutputPort()) - dataMapper.SetScalarModeToUsePointFieldData() - dataMapper.SetColorModeToMapScalars() - data = elev.GetOutputDataObject(0).GetPointData() - dataMapper.ScalarVisibilityOn() - dataMapper.SetScalarRange(data.GetArray(coloring_by).GetRange()) - dataMapper.SetLookupTable(lut) - dataMapper.SelectColorArray(coloring_by) - dataActor = vtkActor() - dataActor.SetMapper(dataMapper) - dataActor.GetProperty().SetRepresentationToPoints() - dataActor.GetProperty().SetPointSize(10) - - # Set up the 3d render window and add both actors - ren = vtkRenderer() - ren.AddActor(outlineActor) - ren.AddActor(dataActor) - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('ParallelCoordinatesExtraction') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - ren.ResetCamera() - renWin.Render() - - # Finalize parallel coordinates view and start interaction event loop - view.GetRenderWindow().SetSize(600, 300) - view.GetRenderWindow().SetWindowName('ParallelCoordinatesExtraction') - view.GetRenderer().GradientBackgroundOn() - view.GetRenderer().SetBackground2(colors.GetColor3d('DarkBlue')) - view.GetRenderer().SetBackground(colors.GetColor3d('MidnightBlue')) - - view.ResetCamera() - view.Render() - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/InfoVis/ParallelCoordinatesView.md b/data/examples/InfoVis/ParallelCoordinatesView.md deleted file mode 100644 index 0bc6289..0000000 --- a/data/examples/InfoVis/ParallelCoordinatesView.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Using Parallel Coordinates View to plot and compare data set attributes. diff --git a/data/examples/InfoVis/ParallelCoordinatesView.py b/data/examples/InfoVis/ParallelCoordinatesView.py deleted file mode 100755 index 20fd82b..0000000 --- a/data/examples/InfoVis/ParallelCoordinatesView.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python - -# Example of how to use Parallel Coordinates View to plot and compare -# data set attributes. -# Use the 'u' character to toggle between 'inspect modes' on the parallel -# coordinates view (i.e. between selecting data and manipulating axes). -# Lines which are commented out show alternative options. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersGeneral import vtkBrownianPoints -from vtkmodules.vtkImagingCore import vtkRTAnalyticSource -from vtkmodules.vtkImagingGeneral import vtkImageGradient -from vtkmodules.vtkViewsInfovis import ( - vtkParallelCoordinatesRepresentation, - vtkParallelCoordinatesView -) - - -def main(): - colors = vtkNamedColors() - - # Generate an example image data set with multiple attribute arrays to probe - # and view. - # This is where you would put your reader instead of this rt->elev pipeline... - rt = vtkRTAnalyticSource() - rt.SetWholeExtent(-3, 3, -3, 3, -3, 3) - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) - brown.SetInputConnection(grad.GetOutputPort()) - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) - elev.SetHighPoint(3, 3, 3) - elev.SetInputConnection(brown.GetOutputPort()) - - # Set up the parallel coordinates Representation to be used in the View - rep = vtkParallelCoordinatesRepresentation() - - # Plug your reader in here for your own data - rep.SetInputConnection(elev.GetOutputPort()) - - # List all of the attribute arrays you want plotted in parallel coordinates - rep.SetInputArrayToProcess(0, 0, 0, 0, 'RTDataGradient') - rep.SetInputArrayToProcess(1, 0, 0, 0, 'RTData') - rep.SetInputArrayToProcess(2, 0, 0, 0, 'Elevation') - rep.SetInputArrayToProcess(3, 0, 0, 0, 'BrownianVectors') - - rep.SetUseCurves(0) # set to 1 to use smooth curves - rep.SetLineOpacity(0.5) - rep.SetAxisColor(colors.GetColor3d('Gold')) - rep.SetLineColor(colors.GetColor3d('MistyRose')) - - # Set up the Parallel Coordinates View and hook in the Representation - view = vtkParallelCoordinatesView() - view.SetRepresentation(rep) - - # Inspect Mode determines whether your interactions manipulate the axes or - # select data - # view.SetInspectMode(view.VTK_INSPECT_MANIPULATE_AXES) # VTK_INSPECT_MANIPULATE_AXES = 0, - view.SetInspectMode(view.VTK_INSPECT_SELECT_DATA) # VTK_INSPECT_SELECT_DATA = 1 - - # Brush Mode determines the type of interaction you perform to select data - view.SetBrushModeToLasso() - # view.SetBrushModeToAngle() - # view.SetBrushModeToFunction() - # view.SetBrushModeToAxisThreshold() # not implemented yet (as of 21 Feb 2010) - - # Brush Operator determines how each new selection interaction changes - # selected lines - # view.SetBrushOperatorToAdd() - # view.SetBrushOperatorToSubtract() - # view.SetBrushOperatorToIntersect() - view.SetBrushOperatorToReplace() - - def ToggleInspectors(obj, event): - # Define the callback routine which toggles between 'Inspect Modes' - if view.GetInspectMode() == 0: - view.SetInspectMode(1) - else: - view.SetInspectMode(0) - - # Hook up the callback to toggle between inspect modes - # (manip axes & select data) - view.GetInteractor().AddObserver('UserEvent', ToggleInspectors) - - # Set up render window - view.GetRenderWindow().SetSize(600, 300) - view.GetRenderWindow().SetWindowName('ParallelCoordinatesView') - view.GetRenderer().GradientBackgroundOn() - view.GetRenderer().SetBackground2(colors.GetColor3d('DarkBlue')) - view.GetRenderer().SetBackground(colors.GetColor3d('MidnightBlue')) - view.ResetCamera() - view.Render() - - # Start interaction event loop - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/InfoVis/SelectedGraphIDs.py b/data/examples/InfoVis/SelectedGraphIDs.py deleted file mode 100755 index 5c4c631..0000000 --- a/data/examples/InfoVis/SelectedGraphIDs.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python - -# This is a variation on VTK/Examples/Infovis/Python/selection.py -# which shows how to use a vtkAnnotationLink to view the contents -# of a selection from a vtkGraphLayoutView - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkAnnotationLink -from vtkmodules.vtkInfovisCore import vtkRandomGraphSource -from vtkmodules.vtkInfovisLayout import vtkSimple2DLayoutStrategy -from vtkmodules.vtkViewsCore import vtkViewTheme -from vtkmodules.vtkViewsInfovis import vtkGraphLayoutView - - -def main(): - colors = vtkNamedColors() - - source = vtkRandomGraphSource() - source.DirectedOff() - source.SetNumberOfVertices(100) - source.SetEdgeProbability(0) # Basically generates a tree - source.SetUseEdgeProbability(True) - source.SetStartWithTree(True) - source.IncludeEdgeWeightsOn() - - # Create force directed layout - strategy = vtkSimple2DLayoutStrategy() - strategy.SetInitialTemperature(5) - - # Create a graph layout view - view = vtkGraphLayoutView() - view.AddRepresentationFromInputConnection(source.GetOutputPort()) - view.SetVertexLabelArrayName('vertex id') - view.SetVertexLabelVisibility(True) - view.SetVertexColorArrayName('vertex id') - view.SetColorVertices(True) - view.SetEdgeColorArrayName('edge weight') - view.SetColorEdges(True) - view.SetLayoutStrategy(strategy) - - # Make sure the views are using a pedigree id selection - view.GetRepresentation(0).SetSelectionType(2) - - # Create a selection link and set both view to use it - annotationLink = vtkAnnotationLink() - view.GetRepresentation(0).SetAnnotationLink(annotationLink) - - def select_callback(caller, event): - ''' - In this particular data representation the current selection in the - annotation link should always contain two nodes: one for the edges and - one for the vertices. Which is which is not consistent, so you need to - check the FieldType of each SelectionNode - - :param caller: - :param event: - :return: - ''' - - sel = caller.GetCurrentSelection() - - for nn in range(sel.GetNumberOfNodes()): - sel_ids = sel.GetNode(nn).GetSelectionList() - field_type = sel.GetNode(nn).GetFieldType() - if field_type == 3: - print('Vertex selection Pedigree IDs') - if field_type == 4: - print('Edge selection Pedigree IDs') - if sel_ids.GetNumberOfTuples() > 0: - for ii in range(sel_ids.GetNumberOfTuples()): - print(int(sel_ids.GetTuple1(ii))) - else: - print('-- empty') - - print('') - - # AnnotationChangedEvent will fire when the selection is changed - annotationLink.AddObserver('AnnotationChangedEvent', select_callback) - - # Set the theme on the view - theme = vtkViewTheme.CreateMellowTheme() - theme.SetLineWidth(5) - theme.SetPointSize(10) - theme.SetCellOpacity(0.99) - theme.SetOutlineColor(colors.GetColor3d('Gray')) - # Vertices - theme.SetSelectedPointColor(colors.GetColor3d('DodgerBlue')) - theme.SetPointHueRange(1.0, 1.0) - theme.SetPointSaturationRange(1.0, 1.0) - theme.SetPointValueRange(0.0, 1.0) - # theme.SetPointAlphaRange(0.2, 0.8) - # Edges - theme.SetSelectedCellColor(colors.GetColor3d('LavenderBlush')) - theme.SetCellHueRange(0.1, 0.1) - theme.SetCellSaturationRange(0.2, 1.0) - theme.SetCellValueRange(0.5, 1.0) - # theme.SetPointAlphaRange(0.2, 0.8) - view.ApplyViewTheme(theme) - theme.FastDelete() - - view.GetRenderWindow().SetSize(600, 600) - view.GetRenderWindow().SetWindowName('SelectedGraphIDs') - view.ResetCamera() - view.Render() - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Interaction/CallBack.md b/data/examples/Interaction/CallBack.md deleted file mode 100644 index 321a0af..0000000 --- a/data/examples/Interaction/CallBack.md +++ /dev/null @@ -1,32 +0,0 @@ -### Description - -#### Demonstrate how to set up a callback with client data - -Getting the camera orientation after interacting with the image is used as an example. - -We define a callback passing the active camera as client data and linking the callback to the **EndInteractionEvent** of the vtkRenderWindowInteractor class. -This allows us to get the camera orientation after we manipulate the image. We can then copy/paste this data as needed into our camera to set up a nice initial orientation as shown in the example. - -To help orient the cone, we use a vtkOrientationMarkerWidget and a vtkOutlineFilter. - -##### C++ - -There are two methodologies in C++. - -1. Create a class that inherits from vtkCallbackCommand reimplementing `Execute(` vtkObject `*caller, unsigned long evId, void*)` and setting pointers to a client and/or call data as needed. When the class is implemented, it becomes the callback function. -2. Create a function with this signature: `void f(` vtkObject `* caller, long unsigned int evId, void* clientData, void* callData)` - and, where needed, create a vtkCallbackCommand setting its callback to the function we have created. - -The example demonstrates both approaches. - -In the function **PrintCameraOrientation** note how we convert an array to a vector and get a comma-separated list. - -##### Python - -In Python the approach is even simpler. We simply define a function to use as the callback with this signature: `def MyCallback(obj, ev):`. -Then, to pass client data to it, we simply do: `MyCallback.myClientData = myClientData`. -This relies on the fact that Python functions are in fact objects and we are simply adding new attributes such as `myClientData` in this case. - -An alternative method is to define a class passsing the needed variables in the `__init__` function and then implement a `_call__` function that does the work. - -Both approaches are demonstrated in the example. diff --git a/data/examples/Interaction/CallBack.py b/data/examples/Interaction/CallBack.py deleted file mode 100755 index 49983bf..0000000 --- a/data/examples/Interaction/CallBack.py +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env python - -''' -Demonstrate the use of a callback. - -We also add call data. -''' - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Decide what approach to use. - use_function_callback = True - - colors = vtkNamedColors() - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Use a cone as a source. - source = vtkConeSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - # Use the golden ratio for the height. Because we can! - source.SetHeight(1.6180339887498948482) - source.SetResolution(128) - source.Update() - - # Pipeline - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('peacock')) - # Lighting - actor.GetProperty().SetAmbient(0.3) - actor.GetProperty().SetDiffuse(0.0) - actor.GetProperty().SetSpecular(1.0) - actor.GetProperty().SetSpecularPower(20.0) - - # Get an outline of the data set for context. - outline = vtkOutlineFilter() - outline.SetInputData(source.GetOutput()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(actor) - ren.AddActor(outlineActor) - ren.SetBackground(colors.GetColor3d('AliceBlue')) - renWin.SetSize(512, 512) - - # Set up a nice camera position. - camera = vtkCamera() - camera.SetPosition(4.6, -2.0, 3.8) - camera.SetFocalPoint(0.0, 0.0, 0.0) - camera.SetClippingRange(3.2, 10.2) - camera.SetViewUp(0.3, 1.0, 0.13) - ren.SetActiveCamera(camera) - - renWin.Render() - renWin.SetWindowName('CallBack') - - axes1 = MakeAxesActor() - om1 = vtkOrientationMarkerWidget() - om1.SetOrientationMarker(axes1) - # Position lower left in the viewport. - om1.SetViewport(0, 0, 0.2, 0.2) - om1.SetInteractor(iren) - om1.EnabledOn() - om1.InteractiveOn() - - # Set up the callback. - if use_function_callback: - # We are going to output the camera position when the event is triggered - # so we add the active camera as an attribute. - GetOrientation.cam = ren.GetActiveCamera() - # Register the callback with the object that is observing. - iren.AddObserver('EndInteractionEvent', GetOrientation) - else: - iren.AddObserver('EndInteractionEvent', OrientationObserver(ren.GetActiveCamera())) - # Or: - # observer = OrientationObserver(ren.GetActiveCamera()) - # iren.AddObserver('EndInteractionEvent', observer) - - iren.Initialize() - iren.Start() - - -def GetOrientation(caller, ev): - ''' - Print out the orientation. - - We must do this before we register the callback in the calling function. - GetOrientation.cam = ren.GetActiveCamera() - - :param caller: - :param ev: The event. - :return: - ''' - # Just do this to demonstrate who called callback and the event that triggered it. - print(caller.GetClassName(), 'Event Id:', ev) - # Now print the camera orientation. - CameraOrientation(GetOrientation.cam) - - -class OrientationObserver(object): - def __init__(self, cam): - self.cam = cam - - def __call__(self, caller, ev): - # Just do this to demonstrate who called callback and the event that triggered it. - print(caller.GetClassName(), 'Event Id:', ev) - # Now print the camera orientation. - CameraOrientation(self.cam) - - -def CameraOrientation(cam): - fmt1 = '{:>15s}' - fmt2 = '{:9.6g}' - print(fmt1.format('Position:'), ', '.join(map(fmt2.format, cam.GetPosition()))) - print(fmt1.format('Focal point:'), ', '.join(map(fmt2.format, cam.GetFocalPoint()))) - print(fmt1.format('Clipping range:'), ', '.join(map(fmt2.format, cam.GetClippingRange()))) - print(fmt1.format('View up:'), ', '.join(map(fmt2.format, cam.GetViewUp()))) - print(fmt1.format('Distance:'), fmt2.format(cam.GetDistance())) - - -def MakeAxesActor(): - axes = vtkAxesActor() - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText('X') - axes.SetYAxisLabelText('Y') - axes.SetZAxisLabelText('Z') - axes.SetTotalLength(1.0, 1.0, 1.0) - axes.SetCylinderRadius(0.5 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.025 * axes.GetConeRadius()) - axes.SetSphereRadius(1.5 * axes.GetSphereRadius()) - return axes - - -if __name__ == '__main__': - main() diff --git a/data/examples/Interaction/InteractorStyleTrackballActor.md b/data/examples/Interaction/InteractorStyleTrackballActor.md deleted file mode 100644 index 789037d..0000000 --- a/data/examples/Interaction/InteractorStyleTrackballActor.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Move, rotate, and scale an object in 3D. diff --git a/data/examples/Interaction/InteractorStyleTrackballActor.py b/data/examples/Interaction/InteractorStyleTrackballActor.py deleted file mode 100755 index 7231a81..0000000 --- a/data/examples/Interaction/InteractorStyleTrackballActor.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('InteractorStyleTrackballActor') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - style = vtkInteractorStyleTrackballActor() - iren.SetInteractorStyle(style) - - # create source - sphereSource = vtkSphereSource() - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphereSource.GetOutputPort()) - - # actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Chartreuse')) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('PaleGoldenrod')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Interaction/InteractorStyleTrackballCamera.py b/data/examples/Interaction/InteractorStyleTrackballCamera.py deleted file mode 100755 index 6a2084e..0000000 --- a/data/examples/Interaction/InteractorStyleTrackballCamera.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersSources import ( - vtkPointSource, - vtkSphereSource -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkGlyph3DMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('InteractorStyleTrackballCamera') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # create source - src = vtkPointSource() - src.SetCenter(0, 0, 0) - src.SetNumberOfPoints(50) - src.SetRadius(5) - src.Update() - - actor = point_to_glyph(src.GetOutput().GetPoints(), 0.05) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('RoyalBLue')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -def point_to_glyph(points, scale): - """ - Convert points to glyphs. - :param points: The points to glyph. - :param scale: The scale, used to determine the size of the - glyph representing the point, expressed as a - fraction of the largest side of the bounding - box surrounding the points. e.g. 0.05 - :return: The actor. - """ - - bounds = points.GetBounds() - max_len = 0.0 - for i in range(0, 3): - max_len = max(bounds[i + 1] - bounds[i], max_len) - - sphere_source = vtkSphereSource() - sphere_source.SetRadius(scale * max_len) - - pd = vtkPolyData() - pd.SetPoints(points) - - mapper = vtkGlyph3DMapper() - mapper.SetInputData(pd) - mapper.SetSourceConnection(sphere_source.GetOutputPort()) - mapper.ScalarVisibilityOff() - mapper.ScalingOff() - - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - -if __name__ == '__main__': - main() diff --git a/data/examples/Interaction/MouseEvents.md b/data/examples/Interaction/MouseEvents.md deleted file mode 100644 index 440bcbb..0000000 --- a/data/examples/Interaction/MouseEvents.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a new vtkInteractorStyle which can be used to implement custom reactions on user events. If you just want to disable single events you can also have a look at [MouseEventsObserver](../MouseEventsObserver). This specific example just prints a simple message and then calls the original eventhandler of the vtkInteractorStyleTrackballCamera. diff --git a/data/examples/Interaction/MouseEvents.py b/data/examples/Interaction/MouseEvents.py deleted file mode 100755 index ff0d0e6..0000000 --- a/data/examples/Interaction/MouseEvents.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -class MyInteractorStyle(vtkInteractorStyleTrackballCamera): - - def __init__(self, parent=None): - self.AddObserver('MiddleButtonPressEvent', self.middle_button_press_event) - self.AddObserver('MiddleButtonReleaseEvent', self.middle_button_release_event) - - def middle_button_press_event(self, obj, event): - print('Middle Button pressed') - self.OnMiddleButtonDown() - return - - def middle_button_release_event(self, obj, event): - print('Middle Button released') - self.OnMiddleButtonUp() - return - - -def main(): - colors = vtkNamedColors() - - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - source.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.AddActor(actor) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('MouseEvents') - - interactor = vtkRenderWindowInteractor() - interactor.SetInteractorStyle(MyInteractorStyle()) - interactor.SetRenderWindow(renwin) - - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Interaction/MouseEventsObserver.md b/data/examples/Interaction/MouseEventsObserver.md deleted file mode 100644 index 58d6f93..0000000 --- a/data/examples/Interaction/MouseEventsObserver.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example directly changes the observers of the vtkInteractor, which is an easy way to disable events or to add some simple callback functions. For a more general framework using vtkInteractorStyle see [MouseEvents](../MouseEvents). This specific example just disables the left mouse button of the vtkInteractorStyleTrackballCamera and prints a simple message instead. diff --git a/data/examples/Interaction/MouseEventsObserver.py b/data/examples/Interaction/MouseEventsObserver.py deleted file mode 100755 index 9438f31..0000000 --- a/data/examples/Interaction/MouseEventsObserver.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - source.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.AddActor(actor) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('MouseEventsObserver') - - interactor = vtkRenderWindowInteractor() - interactor.SetInteractorStyle(vtkInteractorStyleTrackballCamera()) - interactor.SetRenderWindow(renwin) - - def DummyFunc1(obj, ev): - print('Before Event') - - def DummyFunc2(obj, ev): - print('After Event') - - # Print interator gives you a list of registered observers of the current - # interactor style - # print(interactor) - - # adding priorities allow to control the order of observer execution - # (highest value first! if equal the first added observer is called first) - interactor.RemoveObservers('LeftButtonPressEvent') - interactor.AddObserver('LeftButtonPressEvent', DummyFunc1, 1.0) - interactor.AddObserver('LeftButtonPressEvent', DummyFunc2, -1.0) - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/GenerateCubesFromLabels.md b/data/examples/Medical/GenerateCubesFromLabels.md deleted file mode 100644 index d768cc7..0000000 --- a/data/examples/Medical/GenerateCubesFromLabels.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -Sometimes it is helpful to view the results of a segmentation without any post processing. This example converts the point data from a labeled volume into cell data. The surfaces are displayed as vtkPolydata. If you want to created smoothed polydata models from your segmented volumes, see the example [GenerateModelsFromLabels](../GenerateModelsFromLabels). The input volume must be in [MetaIO format](http://www.vtk.org/Wiki/MetaIO/Documentation). - -``` text - Usage: GenerateCubesFromLabels InputVolume.mhd StartLabel EndLabel - where - InputVolume is a meta file containing a 3 volume of discrete labels. - StartLabel is the first label to be processed - EndLabel is the last label to be processed - NOTE: There can be gaps in the labeling. If a label does not exist in the volume, it will be skipped. -``` - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/GenerateCubesFromLabels.cxx). diff --git a/data/examples/Medical/GenerateCubesFromLabels.py b/data/examples/Medical/GenerateCubesFromLabels.py deleted file mode 100755 index 5b805b7..0000000 --- a/data/examples/Medical/GenerateCubesFromLabels.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkDataObject, - vtkDataSetAttributes -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkThreshold -from vtkmodules.vtkFiltersGeneral import vtkTransformFilter -from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkImageWrapPad -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - file_name, start_label, end_label = get_program_parameters() - if start_label > end_label: - end_label, start_label = start_label, end_label - - # Generate cubes from labels - # 1) Read the meta file - # 2) Convert point data to cell data - # 3) Convert to geometry and display - - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # Pad the volume so that we can change the point data into cell - # data. - extent = reader.GetOutput().GetExtent() - pad = vtkImageWrapPad() - pad.SetInputConnection(reader.GetOutputPort()) - pad.SetOutputWholeExtent(extent[0], extent[1] + 1, extent[2], extent[3] + 1, extent[4], extent[5] + 1) - pad.Update() - - # Copy the scalar point data of the volume into the scalar cell data - pad.GetOutput().GetCellData().SetScalars(reader.GetOutput().GetPointData().GetScalars()) - - selector = vtkThreshold() - selector.SetInputArrayToProcess(0, 0, 0, vtkDataObject().FIELD_ASSOCIATION_CELLS, - vtkDataSetAttributes().SCALARS) - selector.SetInputConnection(pad.GetOutputPort()) - selector.SetLowerThreshold(start_label) - selector.SetUpperThreshold(end_label) - selector.Update() - - # Shift the geometry by 1/2 - transform = vtkTransform() - transform.Translate(-0.5, -0.5, -0.5) - - transform_model = vtkTransformFilter() - transform_model.SetTransform(transform) - transform_model.SetInputConnection(selector.GetOutputPort()) - - geometry = vtkGeometryFilter() - geometry.SetInputConnection(transform_model.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(geometry.GetOutputPort()) - mapper.SetScalarRange(start_label, end_label) - mapper.SetScalarModeToUseCellData() - mapper.SetColorModeToMapScalars() - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetSize(640, 480) - render_window.SetWindowName('GenerateCubesFromLabels') - - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkSlateBlue')) - render_window.Render() - - camera = renderer.GetActiveCamera() - camera.SetPosition(42.301174, 939.893457, -124.005030) - camera.SetFocalPoint(224.697134, 221.301653, 146.823706) - camera.SetViewUp(0.262286, -0.281321, -0.923073) - camera.SetDistance(789.297581) - camera.SetClippingRange(168.744328, 1509.660206) - - render_window_interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Convert the point data from a labeled volume into cell data.' - epilogue = ''' - The surfaces are displayed as vtkPolydata. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Input volume e.g. Frog/frogtissue.mhd.') - parser.add_argument('startlabel', type=int, help='The starting label in the input volume, e,g, 1.') - parser.add_argument('endlabel', type=int, help='The ending label in the input volume e.g. 29') - args = parser.parse_args() - return args.filename, args.startlabel, args.endlabel - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/GenerateModelsFromLabels.md b/data/examples/Medical/GenerateModelsFromLabels.md deleted file mode 100644 index 1521829..0000000 --- a/data/examples/Medical/GenerateModelsFromLabels.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -This example uses vtkDiscreteFlyingEdges3D or vtkDiscreteMarchingCubes to create vtkPolyData models from a 3D volume that contains discrete labels. These volumes are normally the output of a segmentation algorithm. The polydata for each label will be output into a separate file. - -You can load these files into ParaView, where they will appear as a series of time steps. You can then single step through displaying the polydate from each file making up the series. - -If you want to see the segmentation results as cube models, see the example [GenerateCubesFromLabels](../GenerateCubesFromLabels) - -The input volume must be in [MetaIO format](http://www.vtk.org/Wiki/MetaIO/Documentation). - -Once you generate the models, you can view them with [Paraview](http://paraview.org) - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/GenerateModelsFromLabels.cxx). diff --git a/data/examples/Medical/GenerateModelsFromLabels.py b/data/examples/Medical/GenerateModelsFromLabels.py deleted file mode 100755 index 59dbc6f..0000000 --- a/data/examples/Medical/GenerateModelsFromLabels.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env python - -import os -import sys - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - vtkDataObject, - vtkDataSetAttributes -) -from vtkmodules.vtkFiltersCore import ( - vtkMaskFields, - vtkThreshold, - vtkWindowedSincPolyDataFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkDiscreteFlyingEdges3D, - vtkDiscreteMarchingCubes -) -from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter -from vtkmodules.vtkImagingStatistics import vtkImageAccumulate - - -def main(): - # vtkDiscreteFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - file_name, start_label, end_label = get_program_parameters() - if start_label > end_label: - end_label, start_label = start_label, end_label - - # Create all of the classes we will need - reader = vtkMetaImageReader() - histogram = vtkImageAccumulate() - if use_flying_edges: - try: - using_marching_cubes = False - discrete_cubes = vtkDiscreteFlyingEdges3D() - except AttributeError: - using_marching_cubes = True - discrete_cubes = vtkDiscreteMarchingCubes() - else: - using_marching_cubes = True - discrete_cubes = vtkDiscreteMarchingCubes() - smoother = vtkWindowedSincPolyDataFilter() - selector = vtkThreshold() - scalars_off = vtkMaskFields() - geometry = vtkGeometryFilter() - writer = vtkXMLPolyDataWriter() - - # Define all of the variables - file_prefix = 'Label' - smoothing_iterations = 15 - pass_band = 0.001 - feature_angle = 120.0 - - # Generate models from labels - # 1) Read the meta file - # 2) Generate a histogram of the labels - # 3) Generate models from the labeled volume - # 4) Smooth the models - # 5) Output each model into a separate file - - reader.SetFileName(file_name) - - histogram.SetInputConnection(reader.GetOutputPort()) - histogram.SetComponentExtent(0, end_label, 0, 0, 0, 0) - histogram.SetComponentOrigin(0, 0, 0) - histogram.SetComponentSpacing(1, 1, 1) - histogram.Update() - - discrete_cubes.SetInputConnection(reader.GetOutputPort()) - discrete_cubes.GenerateValues(end_label - start_label + 1, start_label, end_label) - - smoother.SetInputConnection(discrete_cubes.GetOutputPort()) - smoother.SetNumberOfIterations(smoothing_iterations) - smoother.BoundarySmoothingOff() - smoother.FeatureEdgeSmoothingOff() - smoother.SetFeatureAngle(feature_angle) - smoother.SetPassBand(pass_band) - smoother.NonManifoldSmoothingOn() - smoother.NormalizeCoordinatesOn() - smoother.Update() - - selector.SetInputConnection(smoother.GetOutputPort()) - if use_flying_edges: - if using_marching_cubes: - selector.SetInputArrayToProcess(0, 0, 0, vtkDataObject().FIELD_ASSOCIATION_CELLS, - vtkDataSetAttributes().SCALARS) - else: - selector.SetInputArrayToProcess(0, 0, 0, vtkDataObject().FIELD_ASSOCIATION_POINTS, - vtkDataSetAttributes().SCALARS) - else: - selector.SetInputArrayToProcess(0, 0, 0, vtkDataObject().FIELD_ASSOCIATION_CELLS, - vtkDataSetAttributes().SCALARS) - - # Strip the scalars from the output - scalars_off.SetInputConnection(selector.GetOutputPort()) - scalars_off.CopyAttributeOff(vtkMaskFields().POINT_DATA, - vtkDataSetAttributes().SCALARS) - scalars_off.CopyAttributeOff(vtkMaskFields().CELL_DATA, - vtkDataSetAttributes().SCALARS) - - geometry.SetInputConnection(scalars_off.GetOutputPort()) - - writer.SetInputConnection(geometry.GetOutputPort()) - - for i in range(start_label, end_label + 1): - # see if the label exists, if not skip it - frequency = histogram.GetOutput().GetPointData().GetScalars().GetTuple1(i) - if frequency == 0.0: - continue - - # select the cells for a given label - selector.SetLowerThreshold(i) - selector.SetUpperThreshold(i) - - # output the polydata - output_fn = '{:s}{:d}.vtp'.format(file_prefix, i) - print('{:s} writing {:s}'.format(os.path.basename(sys.argv[0]), output_fn)) - - writer.SetFileName(output_fn) - writer.Write() - - -def get_program_parameters(): - import argparse - description = 'Creates vtkPolyData models from a 3D volume that contains discrete labels.' - epilogue = ''' -These volumes are normally the output of a segmentation algorithm. -The polydata for each label will be output into a separate file. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Input volume e.g. Frog/frogtissue.mhd.') - parser.add_argument('startlabel', type=int, help='The starting label in the input volume, e,g, 1.') - parser.add_argument('endlabel', type=int, help='The ending label in the input volume e.g. 29') - args = parser.parse_args() - return args.filename, args.startlabel, args.endlabel - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/MedicalDemo1.md b/data/examples/Medical/MedicalDemo1.md deleted file mode 100644 index 33dfc37..0000000 --- a/data/examples/Medical/MedicalDemo1.md +++ /dev/null @@ -1,18 +0,0 @@ -### Description - -The skin extracted from a CT dataset of the head. - -!!! example "usage" - MedicalDemo1 FullHead.mhd - -!!! note - The skin color was selected from Table 7 in [Improvement of Haar Feature Based Face Detection in OpenCV Incorporating Human Skin Color Characteristic](https://www.researchgate.net/publication/310443424_Improvement_of_Haar_Feature_Based_Face_Detection_in_OpenCV_Incorporating_Human_Skin_Color_Characteristic) - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/Medical1.cxx). - -!!! info - See [Figure 12-2](../../../VTKBook/12Chapter12/#Figure%2012-2) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/Medical/MedicalDemo1.py b/data/examples/Medical/MedicalDemo1.py deleted file mode 100755 index 7f0f595..0000000 --- a/data/examples/Medical/MedicalDemo1.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - # Create the renderer, the render window, and the interactor. The renderer - # draws into the render window, the interactor enables mouse- and - # keyboard-based interaction with the data within the render window. - # - a_renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(a_renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. - if use_flying_edges: - try: - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - skin_mapper = vtkPolyDataMapper() - skin_mapper.SetInputConnection(skin_extractor.GetOutputPort()) - skin_mapper.ScalarVisibilityOff() - - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - skin.SetBackfaceProperty(back_prop) - - # An outline provides context around the data. - # - outline_data = vtkOutlineFilter() - outline_data.SetInputConnection(reader.GetOutputPort()) - - map_outline = vtkPolyDataMapper() - map_outline.SetInputConnection(outline_data.GetOutputPort()) - - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) - # this vector is used to position the camera to look at the data in - # this direction. - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) - a_camera.Elevation(30.0) - - # Actors are added to the renderer. An initial camera view is created. - # The Dolly() method moves the camera towards the FocalPoint, - # thereby enlarging the image. - a_renderer.AddActor(outline) - a_renderer.AddActor(skin) - a_renderer.SetActiveCamera(a_camera) - a_renderer.ResetCamera() - a_camera.Dolly(1.5) - - # Set a background color for the renderer and set the size of the - # render window (expressed in pixels). - a_renderer.SetBackground(colors.GetColor3d('BkgColor')) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('MedicalDemo1') - - # Note that when camera movement occurs (as it does in the Dolly() - # method), the clipping planes often need adjusting. Clipping planes - # consist of two planes: near and far along the view direction. The - # near plane clips out objects in front of the plane the far plane - # clips out objects behind the plane. This way only what is drawn - # between the planes is actually rendered. - a_renderer.ResetCameraClippingRange() - - # Initialize the event loop and then start it. - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'The skin extracted from a CT dataset of the head.' - epilogue = ''' - Derived from VTK/Examples/Cxx/Medical1.cxx - This example reads a volume dataset, extracts an isosurface that - represents the skin and displays it. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/MedicalDemo2.md b/data/examples/Medical/MedicalDemo2.md deleted file mode 100644 index 30d9754..0000000 --- a/data/examples/Medical/MedicalDemo2.md +++ /dev/null @@ -1,18 +0,0 @@ -### Description - -Skin and bone isosurfaces. - -!!! example "Usage" - MedicalDemo2 FullHead.mhd - -!!! note - The skin color was selected from Table 7 in [Improvement of Haar Feature Based Face Detection in OpenCV Incorporating Human Skin Color Characteristic](https://www.researchgate.net/publication/310443424_Improvement_of_Haar_Feature_Based_Face_Detection_in_OpenCV_Incorporating_Human_Skin_Color_Characteristic) - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/Medical2.cxx). - -!!! info - See [Figure 12-3](../../../VTKBook/12Chapter12/#Figure%2012-3) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/Medical/MedicalDemo2.py b/data/examples/Medical/MedicalDemo2.py deleted file mode 100755 index 2f81103..0000000 --- a/data/examples/Medical/MedicalDemo2.py +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkStripper -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - # Create the renderer, the render window, and the interactor. The renderer - # draws into the render window, the interactor enables mouse- and - # keyboard-based interaction with the data within the render window. - # - a_renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(a_renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # The following reader is used to read a series of 2D slices (images) - # that compose the volume. The slice dimensions are set, and the - # pixel spacing. The data Endianness must also be specified. The reader - # uses the FilePrefix in combination with the slice number to construct - # filenames using the format FilePrefix.%d. (In this case the FilePrefix - # is the root name of the file: quarter.) - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. - # The triangle stripper is used to create triangle strips from the - # isosurface these render much faster on many systems. - if use_flying_edges: - try: - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - skin_stripper = vtkStripper() - skin_stripper.SetInputConnection(skin_extractor.GetOutputPort()) - - skin_mapper = vtkPolyDataMapper() - skin_mapper.SetInputConnection(skin_stripper.GetOutputPort()) - skin_mapper.ScalarVisibilityOff() - - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - skin.GetProperty().SetSpecular(0.3) - skin.GetProperty().SetSpecularPower(20) - skin.GetProperty().SetOpacity(0.5) - - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - skin.SetBackfaceProperty(back_prop) - - # An isosurface, or contour value of 1150 is known to correspond to the - # bone of the patient. - # The triangle stripper is used to create triangle strips from the - # isosurface these render much faster on may systems. - if use_flying_edges: - try: - bone_extractor = vtkFlyingEdges3D() - except AttributeError: - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) - bone_extractor.SetValue(0, 1150) - - bone_stripper = vtkStripper() - bone_stripper.SetInputConnection(bone_extractor.GetOutputPort()) - - bone_mapper = vtkPolyDataMapper() - bone_mapper.SetInputConnection(bone_stripper.GetOutputPort()) - bone_mapper.ScalarVisibilityOff() - - bone = vtkActor() - bone.SetMapper(bone_mapper) - bone.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - - # An outline provides context around the data. - # - outline_data = vtkOutlineFilter() - outline_data.SetInputConnection(reader.GetOutputPort()) - - map_outline = vtkPolyDataMapper() - map_outline.SetInputConnection(outline_data.GetOutputPort()) - - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) - # this vector is used to position the camera to look at the data in - # this direction. - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) - a_camera.Elevation(30.0) - - # Actors are added to the renderer. An initial camera view is created. - # The Dolly() method moves the camera towards the FocalPoint, - # thereby enlarging the image. - a_renderer.AddActor(outline) - a_renderer.AddActor(skin) - a_renderer.AddActor(bone) - a_renderer.SetActiveCamera(a_camera) - a_renderer.ResetCamera() - a_camera.Dolly(1.5) - - # Set a background color for the renderer and set the size of the - # render window (expressed in pixels). - a_renderer.SetBackground(colors.GetColor3d('BkgColor')) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('MedicalDemo2') - - # Note that when camera movement occurs (as it does in the Dolly() - # method), the clipping planes often need adjusting. Clipping planes - # consist of two planes: near and far along the view direction. The - # near plane clips out objects in front of the plane the far plane - # clips out objects behind the plane. This way only what is drawn - # between the planes is actually rendered. - a_renderer.ResetCameraClippingRange() - - # Initialize the event loop and then start it. - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'The skin and bone is extracted from a CT dataset of the head.' - epilogue = ''' - Derived from VTK/Examples/Cxx/Medical2.cxx - This example reads a volume dataset, extracts two isosurfaces that - represent the skin and bone, and then displays it. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/MedicalDemo3.md b/data/examples/Medical/MedicalDemo3.md deleted file mode 100644 index 3aca3ac..0000000 --- a/data/examples/Medical/MedicalDemo3.md +++ /dev/null @@ -1,18 +0,0 @@ -### Description - -Composite image of three planes and translucent skin - -!!! example "Usage" - MedicalDemo3 FullHead.mhd - -!!! note - The skin color was selected from Table 7 in [Improvement of Haar Feature Based Face Detection in OpenCV Incorporating Human Skin Color Characteristic](https://www.researchgate.net/publication/310443424_Improvement_of_Haar_Feature_Based_Face_Detection_in_OpenCV_Incorporating_Human_Skin_Color_Characteristic) - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/Medical3.cxx). - -!!! info - See [Figure 12-4](../../../VTKBook/12Chapter12/#Figure%2012-4) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/Medical/MedicalDemo3.py b/data/examples/Medical/MedicalDemo3.py deleted file mode 100755 index e8af684..0000000 --- a/data/examples/Medical/MedicalDemo3.py +++ /dev/null @@ -1,301 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkLookupTable, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkStripper -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkImageMapToColors -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkImageActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - # Create the renderer, the render window, and the interactor. The - # renderer draws into the render window, the interactor enables - # mouse- and keyboard-based interaction with the data within the - # render window. - # - a_renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(a_renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Set a background color for the renderer and set the size of the - # render window (expressed in pixels). - a_renderer.SetBackground(colors.GetColor3d('BkgColor')) - ren_win.SetSize(640, 480) - - # The following reader is used to read a series of 2D slices (images) - # that compose the volume. The slice dimensions are set, and the - # pixel spacing. The data Endianness must also be specified. The - # reader uses the FilePrefix in combination with the slice number to - # construct filenames using the format FilePrefix.%d. (In this case - # the FilePrefix is the root name of the file: quarter.) - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # An isosurface, or contour value of 500 is known to correspond to - # the skin of the patient. - # The triangle stripper is used to create triangle - # strips from the isosurface these render much faster on may - # systems. - if use_flying_edges: - try: - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - skin_extractor.Update() - - skin_stripper = vtkStripper() - skin_stripper.SetInputConnection(skin_extractor.GetOutputPort()) - skin_stripper.Update() - - skin_mapper = vtkPolyDataMapper() - skin_mapper.SetInputConnection(skin_stripper.GetOutputPort()) - skin_mapper.ScalarVisibilityOff() - - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - skin.GetProperty().SetSpecular(0.3) - skin.GetProperty().SetSpecularPower(20) - - # An isosurface, or contour value of 1150 is known to correspond to - # the bone of the patient. - # The triangle stripper is used to create triangle - # strips from the isosurface these render much faster on may - # systems. - if use_flying_edges: - try: - bone_extractor = vtkFlyingEdges3D() - except AttributeError: - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) - bone_extractor.SetValue(0, 1150) - - bone_stripper = vtkStripper() - bone_stripper.SetInputConnection(bone_extractor.GetOutputPort()) - - bone_mapper = vtkPolyDataMapper() - bone_mapper.SetInputConnection(bone_stripper.GetOutputPort()) - bone_mapper.ScalarVisibilityOff() - - bone = vtkActor() - bone.SetMapper(bone_mapper) - bone.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - - # An outline provides context around the data. - # - outline_data = vtkOutlineFilter() - outline_data.SetInputConnection(reader.GetOutputPort()) - outline_data.Update() - - map_outline = vtkPolyDataMapper() - map_outline.SetInputConnection(outline_data.GetOutputPort()) - - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Now we are creating three orthogonal planes passing through the - # volume. Each plane uses a different texture map and therefore has - # different coloration. - - # Start by creating a black/white lookup table. - bw_lut = vtkLookupTable() - bw_lut.SetTableRange(0, 2000) - bw_lut.SetSaturationRange(0, 0) - bw_lut.SetHueRange(0, 0) - bw_lut.SetValueRange(0, 1) - bw_lut.Build() # effective built - - # Now create a lookup table that consists of the full hue circle - # (from HSV). - hue_lut = vtkLookupTable() - hue_lut.SetTableRange(0, 2000) - hue_lut.SetHueRange(0, 1) - hue_lut.SetSaturationRange(1, 1) - hue_lut.SetValueRange(1, 1) - hue_lut.Build() # effective built - - # Finally, create a lookup table with a single hue but having a range - # in the saturation of the hue. - sat_lut = vtkLookupTable() - sat_lut.SetTableRange(0, 2000) - sat_lut.SetHueRange(0.6, 0.6) - sat_lut.SetSaturationRange(0, 1) - sat_lut.SetValueRange(1, 1) - sat_lut.Build() # effective built - - # Create the first of the three planes. The filter vtkImageMapToColors - # maps the data through the corresponding lookup table created above. The - # vtkImageActor is a type of vtkProp and conveniently displays an image on - # a single quadrilateral plane. It does this using texture mapping and as - # a result is quite fast. (Note: the input image has to be unsigned char - # values, which the vtkImageMapToColors produces.) Note also that by - # specifying the DisplayExtent, the pipeline requests data of this extent - # and the vtkImageMapToColors only processes a slice of data. - sagittal_colors = vtkImageMapToColors() - sagittal_colors.SetInputConnection(reader.GetOutputPort()) - sagittal_colors.SetLookupTable(bw_lut) - sagittal_colors.Update() - - sagittal = vtkImageActor() - sagittal.GetMapper().SetInputConnection(sagittal_colors.GetOutputPort()) - sagittal.SetDisplayExtent(128, 128, 0, 255, 0, 92) - sagittal.ForceOpaqueOn() - - # Create the second (axial) plane of the three planes. We use the - # same approach as before except that the extent differs. - axial_colors = vtkImageMapToColors() - axial_colors.SetInputConnection(reader.GetOutputPort()) - axial_colors.SetLookupTable(hue_lut) - axial_colors.Update() - - axial = vtkImageActor() - axial.GetMapper().SetInputConnection(axial_colors.GetOutputPort()) - axial.SetDisplayExtent(0, 255, 0, 255, 46, 46) - axial.ForceOpaqueOn() - - # Create the third (coronal) plane of the three planes. We use - # the same approach as before except that the extent differs. - coronal_colors = vtkImageMapToColors() - coronal_colors.SetInputConnection(reader.GetOutputPort()) - coronal_colors.SetLookupTable(sat_lut) - coronal_colors.Update() - - coronal = vtkImageActor() - coronal.GetMapper().SetInputConnection(coronal_colors.GetOutputPort()) - coronal.SetDisplayExtent(0, 255, 128, 128, 0, 92) - coronal.ForceOpaqueOn() - - # It is convenient to create an initial view of the data. The - # FocalPoint and Position form a vector direction. Later on - # (ResetCamera() method) this vector is used to position the camera - # to look at the data in this direction. - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) - a_camera.Elevation(30.0) - - # Actors are added to the renderer. - a_renderer.AddActor(outline) - a_renderer.AddActor(sagittal) - a_renderer.AddActor(axial) - a_renderer.AddActor(coronal) - a_renderer.AddActor(skin) - a_renderer.AddActor(bone) - - # Turn off bone for this example. - bone.VisibilityOff() - - # Set skin to semi-transparent. - skin.GetProperty().SetOpacity(0.5) - - # An initial camera view is created. The Dolly() method moves - # the camera towards the FocalPoint, thereby enlarging the image. - a_renderer.SetActiveCamera(a_camera) - - # Calling Render() directly on a vtkRenderer is strictly forbidden. - # Only calling Render() on the vtkRenderWindow is a valid call. - ren_win.SetWindowName('MedicalDemo3') - ren_win.Render() - - a_renderer.ResetCamera() - a_camera.Dolly(1.5) - - # Note that when camera movement occurs (as it does in the Dolly() - # method), the clipping planes often need adjusting. Clipping planes - # consist of two planes: near and far along the view direction. The - # near plane clips out objects in front of the plane; the far plane - # clips out objects behind the plane. This way only what is drawn - # between the planes is actually rendered. - a_renderer.ResetCameraClippingRange() - - # Interact with the data. - ren_win.Render() - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'The skin and bone is extracted from a CT dataset of the head.' - epilogue = ''' - Derived from VTK/Examples/Cxx/Medical3.cxx - This example reads a volume dataset, extracts two isosurfaces that - represent the skin and bone, creates three orthogonal planes - (sagittal, axial, coronal), and displays them. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/MedicalDemo4.md b/data/examples/Medical/MedicalDemo4.md deleted file mode 100644 index ff2a85f..0000000 --- a/data/examples/Medical/MedicalDemo4.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -Volume rendering of the dataset. - -!!! example "Usage" - MedicalDemo4 FullHead.mhd - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Medical/Cxx/Medical4.cxx). - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/Medical/MedicalDemo4.py b/data/examples/Medical/MedicalDemo4.py deleted file mode 100755 index d94fcab..0000000 --- a/data/examples/Medical/MedicalDemo4.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingVolumeOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPiecewiseFunction -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkRenderingCore import ( - vtkColorTransferFunction, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkVolume, - vtkVolumeProperty -) -from vtkmodules.vtkRenderingVolume import vtkFixedPointVolumeRayCastMapper - - -def main(): - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - # Create the renderer, the render window, and the interactor. The renderer - # draws into the render window, the interactor enables mouse- and - # keyboard-based interaction with the scene. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # The following reader is used to read a series of 2D slices (images) - # that compose the volume. The slice dimensions are set, and the - # pixel spacing. The data Endianness must also be specified. The reader - # uses the FilePrefix in combination with the slice number to construct - # filenames using the format FilePrefix.%d. (In this case the FilePrefix - # is the root name of the file: quarter.) - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # The volume will be displayed by ray-cast alpha compositing. - # A ray-cast mapper is needed to do the ray-casting. - volume_mapper = vtkFixedPointVolumeRayCastMapper() - volume_mapper.SetInputConnection(reader.GetOutputPort()) - - # The color transfer function maps voxel intensities to colors. - # It is modality-specific, and often anatomy-specific as well. - # The goal is to one color for flesh (between 500 and 1000) - # and another color for bone (1150 and over). - volume_color = vtkColorTransferFunction() - volume_color.AddRGBPoint(0, 0.0, 0.0, 0.0) - volume_color.AddRGBPoint(500, 240.0 / 255.0, 184.0 / 255.0, 160.0 / 255.0) - volume_color.AddRGBPoint(1000, 240.0 / 255.0, 184.0 / 255.0, 160.0 / 255.0) - volume_color.AddRGBPoint(1150, 1.0, 1.0, 240.0 / 255.0) # Ivory - - # The opacity transfer function is used to control the opacity - # of different tissue types. - volume_scalar_opacity = vtkPiecewiseFunction() - volume_scalar_opacity.AddPoint(0, 0.00) - volume_scalar_opacity.AddPoint(500, 0.15) - volume_scalar_opacity.AddPoint(1000, 0.15) - volume_scalar_opacity.AddPoint(1150, 0.85) - - # The gradient opacity function is used to decrease the opacity - # in the 'flat' regions of the volume while maintaining the opacity - # at the boundaries between tissue types. The gradient is measured - # as the amount by which the intensity changes over unit distance. - # For most medical data, the unit distance is 1mm. - volume_gradient_opacity = vtkPiecewiseFunction() - volume_gradient_opacity.AddPoint(0, 0.0) - volume_gradient_opacity.AddPoint(90, 0.5) - volume_gradient_opacity.AddPoint(100, 1.0) - - # The VolumeProperty attaches the color and opacity functions to the - # volume, and sets other volume properties. The interpolation should - # be set to linear to do a high-quality rendering. The ShadeOn option - # turns on directional lighting, which will usually enhance the - # appearance of the volume and make it look more '3D'. However, - # the quality of the shading depends on how accurately the gradient - # of the volume can be calculated, and for noisy data the gradient - # estimation will be very poor. The impact of the shading can be - # decreased by increasing the Ambient coefficient while decreasing - # the Diffuse and Specular coefficient. To increase the impact - # of shading, decrease the Ambient and increase the Diffuse and Specular. - volume_property = vtkVolumeProperty() - volume_property.SetColor(volume_color) - volume_property.SetScalarOpacity(volume_scalar_opacity) - volume_property.SetGradientOpacity(volume_gradient_opacity) - volume_property.SetInterpolationTypeToLinear() - volume_property.ShadeOn() - volume_property.SetAmbient(0.4) - volume_property.SetDiffuse(0.6) - volume_property.SetSpecular(0.2) - - # The vtkVolume is a vtkProp3D (like a vtkActor) and controls the position - # and orientation of the volume in world coordinates. - volume = vtkVolume() - volume.SetMapper(volume_mapper) - volume.SetProperty(volume_property) - - # Finally, add the volume to the renderer - ren.AddViewProp(volume) - - # Set up an initial view of the volume. The focal point will be the - # center of the volume, and the camera position will be 400mm to the - # patient's left (which is our right). - camera = ren.GetActiveCamera() - c = volume.GetCenter() - camera.SetViewUp(0, 0, -1) - camera.SetPosition(c[0], c[1] - 400, c[2]) - camera.SetFocalPoint(c[0], c[1], c[2]) - camera.Azimuth(30.0) - camera.Elevation(30.0) - - # Set a background color for the renderer - ren.SetBackground(colors.GetColor3d('BkgColor')) - - # Increase the size of the render window - ren_win.SetSize(640, 480) - ren_win.SetWindowName('MedicalDemo4') - - # Interact with the data. - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Read a volume dataset and displays it via volume rendering.' - epilogue = ''' - Derived from VTK/Examples/Cxx/Medical4.cxx - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Medical/TissueLens.md b/data/examples/Medical/TissueLens.md deleted file mode 100644 index b8c4a51..0000000 --- a/data/examples/Medical/TissueLens.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example uses two vtkClipDataSet filters to achieve a "tissue lens" effect. First, a vtkSphere implicit function is used to clip a spherical hole in the isosurface extracted with vtkFlyingEdges3D or vtkMarchingCubes. Then a geometric vtkSphereSource samples the original volume data using a vtkProbeFilter. vtkClipDataSet uses the resulting scalar point data to clip the sphere surface with the isosurface value. - -!!! example "Usage" - TissueLens FullHead.mhd - -!!! note - The skin color was selected from Table 7 in [Improvement of Haar Feature Based Face Detection in OpenCV Incorporating Human Skin Color Characteristic](https://www.researchgate.net/publication/310443424_Improvement_of_Haar_Feature_Based_Face_Detection_in_OpenCV_Incorporating_Human_Skin_Color_Characteristic) - -!!! info - The example uses `src/Testing/Data/FullHead.mhd` which references `src/Testing/Data/FullHead.raw.gz`. diff --git a/data/examples/Medical/TissueLens.py b/data/examples/Medical/TissueLens.py deleted file mode 100755 index 8f96ae5..0000000 --- a/data/examples/Medical/TissueLens.py +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkLookupTable, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkSphere -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkProbeFilter -) -from vtkmodules.vtkFiltersGeneral import vtkClipDataSet -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkDataSetMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - # Read the volume data - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. - if use_flying_edges: - try: - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - # Define a spherical clip function to clip the isosurface - clip_function = vtkSphere() - clip_function.SetRadius(50) - clip_function.SetCenter(73, 52, 15) - - # Clip the isosurface with a sphere - skin_clip = vtkClipDataSet() - skin_clip.SetInputConnection(skin_extractor.GetOutputPort()) - skin_clip.SetClipFunction(clip_function) - skin_clip.SetValue(0) - skin_clip.GenerateClipScalarsOn() - skin_clip.Update() - - skin_mapper = vtkDataSetMapper() - skin_mapper.SetInputConnection(skin_clip.GetOutputPort()) - skin_mapper.ScalarVisibilityOff() - - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - skin.SetBackfaceProperty(back_prop) - - # Define a model for the "lens". Its geometry matches the implicit - # sphere used to clip the isosurface - lens_model = vtkSphereSource() - lens_model.SetRadius(50) - lens_model.SetCenter(73, 52, 15) - lens_model.SetPhiResolution(201) - lens_model.SetThetaResolution(101) - - # Sample the input volume with the lens model geometry - lens_probe = vtkProbeFilter() - lens_probe.SetInputConnection(lens_model.GetOutputPort()) - lens_probe.SetSourceConnection(reader.GetOutputPort()) - - # Clip the lens data with the isosurface value - lens_clip = vtkClipDataSet() - lens_clip.SetInputConnection(lens_probe.GetOutputPort()) - lens_clip.SetValue(500) - lens_clip.GenerateClipScalarsOff() - lens_clip.Update() - - # Define a suitable grayscale lut - bw_lut = vtkLookupTable() - bw_lut.SetTableRange(0, 2048) - bw_lut.SetSaturationRange(0, 0) - bw_lut.SetHueRange(0, 0) - bw_lut.SetValueRange(0.2, 1) - bw_lut.Build() - - lens_mapper = vtkDataSetMapper() - lens_mapper.SetInputConnection(lens_clip.GetOutputPort()) - lens_mapper.SetScalarRange(lens_clip.GetOutput().GetScalarRange()) - lens_mapper.SetLookupTable(bw_lut) - - lens = vtkActor() - lens.SetMapper(lens_mapper) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) - # this vector is used to position the camera to look at the data in - # this direction. - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) - a_camera.Elevation(30.0) - - # Create the renderer, the render window, and the interactor. The renderer - # draws into the render window, the interactor enables mouse- and - # keyboard-based interaction with the data within the render window. - # - a_renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(a_renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Actors are added to the renderer. An initial camera view is created. - # The Dolly() method moves the camera towards the FocalPoint, - # thereby enlarging the image. - a_renderer.AddActor(lens) - a_renderer.AddActor(skin) - a_renderer.SetActiveCamera(a_camera) - a_renderer.ResetCamera() - a_camera.Dolly(1.5) - - # Set a background color for the renderer and set the size of the - # render window (expressed in pixels). - a_renderer.SetBackground(colors.GetColor3d('BkgColor')) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('TissueLens') - - # Note that when camera movement occurs (as it does in the Dolly() - # method), the clipping planes often need adjusting. Clipping planes - # consist of two planes: near and far along the view direction. The - # near plane clips out objects in front of the plane the far plane - # clips out objects behind the plane. This way only what is drawn - # between the planes is actually rendered. - a_renderer.ResetCameraClippingRange() - - # Initialize the event loop and then start it. - ren_win.Render() - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'The skin and bone is extracted from a CT dataset of the head and a "tissue lens" effect is applied.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/BoundaryEdges.md b/data/examples/Meshes/BoundaryEdges.md deleted file mode 100644 index d4b6f6f..0000000 --- a/data/examples/Meshes/BoundaryEdges.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This filter will extract the boundary edges of a mesh. The original mesh is shown with the feature edges shown in red. diff --git a/data/examples/Meshes/BoundaryEdges.py b/data/examples/Meshes/BoundaryEdges.py deleted file mode 100755 index c0f38a6..0000000 --- a/data/examples/Meshes/BoundaryEdges.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkFeatureEdges -from vtkmodules.vtkFiltersSources import vtkDiskSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - diskSource = vtkDiskSource() - diskSource.Update() - - featureEdges = vtkFeatureEdges() - featureEdges.SetInputConnection(diskSource.GetOutputPort()) - featureEdges.BoundaryEdgesOn() - featureEdges.FeatureEdgesOff() - featureEdges.ManifoldEdgesOff() - featureEdges.NonManifoldEdgesOff() - featureEdges.ColoringOn() - featureEdges.Update() - - # Visualize - edgeMapper = vtkPolyDataMapper() - edgeMapper.SetInputConnection(featureEdges.GetOutputPort()) - edgeActor = vtkActor() - edgeActor.SetMapper(edgeMapper) - - diskMapper = vtkPolyDataMapper() - diskMapper.SetInputConnection(diskSource.GetOutputPort()) - diskActor = vtkActor() - diskActor.SetMapper(diskMapper) - diskActor.GetProperty().SetColor(colors.GetColor3d('Gray')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('BoundaryEdges') - - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(edgeActor) - renderer.AddActor(diskActor) - renderer.SetBackground(colors.GetColor3d('DimGray')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/CapClip.md b/data/examples/Meshes/CapClip.md deleted file mode 100644 index 8695043..0000000 --- a/data/examples/Meshes/CapClip.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description -This example shows how to generate a "cap" on a clipped vtkPolyData. After clipping with vtkClipPolyData, it uses a clever ''trick'' to convert polylines into polygons. If a polydata file is provided, it will cap it. Otherwise it caps a clipped sphere. - -!!! warning - The clipping is done with a scalar field provided by vtkPlane and results may depend on the resolution of the input vtkPolyData. - -!!! tip "Style" - This example collects all of the color definition in the beginning of the example. This makes it easier to make changes to the colors without having to search the code. diff --git a/data/examples/Meshes/CapClip.py b/data/examples/Meshes/CapClip.py deleted file mode 100755 index c8f5a40..0000000 --- a/data/examples/Meshes/CapClip.py +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env python - -import os.path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkPlane, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import ( - vtkClipPolyData, - vtkFeatureEdges, - vtkStripper -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Clip polydata using a plane.' - epilogue = ''' - This is an example using vtkClipPolyData to clip input polydata, if provided, or a sphere otherwise. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', nargs='?', default=None, help='Optional input filename e.g cow.g.') - args = parser.parse_args() - return args.filename - - -def main(): - filePath = get_program_parameters() - - # Define colors - colors = vtkNamedColors() - backgroundColor = colors.GetColor3d('steel_blue') - boundaryColor = colors.GetColor3d('Banana') - clipColor = colors.GetColor3d('Tomato') - - if filePath and os.path.isfile(filePath): - polyData = ReadPolyData(filePath) - if not polyData: - polyData = GetSpherePD() - else: - polyData = GetSpherePD() - - plane = vtkPlane() - plane.SetOrigin(polyData.GetCenter()) - plane.SetNormal(1.0, -1.0, -1.0) - - clipper = vtkClipPolyData() - clipper.SetInputData(polyData) - clipper.SetClipFunction(plane) - clipper.SetValue(0) - clipper.Update() - - polyData = clipper.GetOutput() - - clipMapper = vtkDataSetMapper() - clipMapper.SetInputData(polyData) - - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(clipColor) - clipActor.GetProperty().SetInterpolationToFlat() - clipActor.GetProperty().EdgeVisibilityOn() - - # Now extract feature edges - boundaryEdges = vtkFeatureEdges() - boundaryEdges.SetInputData(polyData) - boundaryEdges.BoundaryEdgesOn() - boundaryEdges.FeatureEdgesOff() - boundaryEdges.NonManifoldEdgesOff() - boundaryEdges.ManifoldEdgesOff() - - boundaryStrips = vtkStripper() - boundaryStrips.SetInputConnection(boundaryEdges.GetOutputPort()) - boundaryStrips.Update() - - # Change the polylines into polygons - boundaryPoly = vtkPolyData() - boundaryPoly.SetPoints(boundaryStrips.GetOutput().GetPoints()) - boundaryPoly.SetPolys(boundaryStrips.GetOutput().GetLines()) - - boundaryMapper = vtkPolyDataMapper() - boundaryMapper.SetInputData(boundaryPoly) - - boundaryActor = vtkActor() - boundaryActor.SetMapper(boundaryMapper) - boundaryActor.GetProperty().SetDiffuseColor(boundaryColor) - - # create renderer render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # set background color and size - renderer.SetBackground(backgroundColor) - renderWindow.SetSize(640, 480) - - # add our actor to the renderer - renderer.AddActor(clipActor) - renderer.AddActor(boundaryActor) - - # Generate an interesting view - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.GetActiveCamera().Dolly(1.2) - renderer.ResetCameraClippingRange() - - renderWindow.Render() - renderWindow.SetWindowName('CapClip') - renderWindow.Render() - - interactor.Start() - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def GetSpherePD(): - ''' - :return: The PolyData representation of a sphere. - ''' - source = vtkSphereSource() - source.SetThetaResolution(20) - source.SetPhiResolution(11) - source.Update() - return source.GetOutput() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/ClipDataSetWithPolyData.md b/data/examples/Meshes/ClipDataSetWithPolyData.md deleted file mode 100644 index a4ab47a..0000000 --- a/data/examples/Meshes/ClipDataSetWithPolyData.md +++ /dev/null @@ -1,31 +0,0 @@ -### Description - -The example that shows how to use the vtkClipDataSet to clip a -vtkRectilinearGrid with an arbitrary -polydata. vtkImplicitPolyDataDistance is used to turn the polydata -into an implicit function. Every point of the grid is evaluated before -sending to vtkClipDataSet. This example uses a vtkConeSource to -generate polydata to use, however any polydata could be used, -including stl files. - -The left part of the image shows the inside clip and the distance -field on a center slice. The right side shows the outside clip. When -the program exits using the "e: key, the example will report the cell -type for both the inside and outside clips. - -!!! note - vtkClipDataSet tetrahedralizes the volume before clipping. Contrast this with the vtkTableBasedClipDataSet example: [TableBasedClipDataSetWithPolyData](../../../Cxx/Meshes/TableBasedClipDataSetWithPolyData). - -Here is the summary reported when the example exits: - ------------------------- -The clipped dataset(inside) contains a -vtkUnstructuredGrid that has 49514 cells - Cell type vtkTetra occurs 41034 times. - Cell type vtkWedge occurs 8480 times. ------------------------- -The clipped dataset(outside) contains a -vtkUnstructuredGrid that has 714434 cells - Cell type vtkTetra occurs 705090 times. - Cell type vtkWedge occurs 9344 times. - diff --git a/data/examples/Meshes/ClipDataSetWithPolyData.py b/data/examples/Meshes/ClipDataSetWithPolyData.py deleted file mode 100755 index 749cba8..0000000 --- a/data/examples/Meshes/ClipDataSetWithPolyData.py +++ /dev/null @@ -1,214 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import ( - vtkCellTypes, - vtkRectilinearGrid -) -from vtkmodules.vtkFiltersCore import vtkImplicitPolyDataDistance -from vtkmodules.vtkFiltersGeneral import vtkClipDataSet -from vtkmodules.vtkFiltersGeometry import vtkRectilinearGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create polydata to slice the grid with. In this case, use a cone. This - # could - # be any polydata including a stl file. - cone = vtkConeSource() - cone.SetResolution(50) - cone.SetDirection(0, 0, -1) - cone.SetHeight(3.0) - cone.CappingOn() - cone.Update() - - # Implicit function that will be used to slice the mesh - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(cone.GetOutput()) - - # create a grid - dimension = 51 - xCoords = vtkFloatArray() - for x, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - xCoords.InsertNextValue(i) - - yCoords = vtkFloatArray() - for y, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - yCoords.InsertNextValue(i) - - zCoords = vtkFloatArray() - for z, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - zCoords.InsertNextValue(i) - - # # create a grid - if not using numpy - # dimension = 51 - # xCoords = vtkFloatArray() - # for i in range(0, dimension): - # xCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - # - # yCoords = vtkFloatArray() - # for i in range(0, dimension): - # yCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - # - # zCoords = vtkFloatArray() - # for i in range(0, dimension): - # zCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, - # and ZCoordinates is equal to what is defined in SetDimensions(). - rgrid = vtkRectilinearGrid() - rgrid.SetDimensions(xCoords.GetNumberOfTuples(), - yCoords.GetNumberOfTuples(), - zCoords.GetNumberOfTuples()) - rgrid.SetXCoordinates(xCoords) - rgrid.SetYCoordinates(yCoords) - rgrid.SetZCoordinates(zCoords) - - # Create an array to hold distance information - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(0, rgrid.GetNumberOfPoints()): - p = rgrid.GetPoint(pointId) - signedDistance = implicitPolyDataDistance.EvaluateFunction(p) - signedDistances.InsertNextValue(signedDistance) - - # Add the SignedDistances to the grid - rgrid.GetPointData().SetScalars(signedDistances) - - # Use vtkClipDataSet to slice the grid with the polydata - clipper = vtkClipDataSet() - clipper.SetInputData(rgrid) - clipper.InsideOutOn() - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() - - # --- mappers, actors, render, etc. --- - # mapper and actor to view the cone - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # geometry filter to view the background grid - geometryFilter = vtkRectilinearGridGeometryFilter() - geometryFilter.SetInputData(rgrid) - geometryFilter.SetExtent(0, dimension, 0, dimension, int(dimension / 2), int(dimension / 2)) - geometryFilter.Update() - - rgridMapper = vtkPolyDataMapper() - rgridMapper.SetInputConnection(geometryFilter.GetOutputPort()) - rgridMapper.SetScalarRange( - rgrid.GetPointData().GetArray('SignedDistances').GetRange()) - - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetRepresentationToWireframe() - - # mapper and actor to view the clipped mesh - clipperMapper = vtkDataSetMapper() - clipperMapper.SetInputConnection(clipper.GetOutputPort()) - clipperMapper.ScalarVisibilityOff() - - clipperOutsideMapper = vtkDataSetMapper() - clipperOutsideMapper.SetInputConnection(clipper.GetOutputPort(1)) - clipperOutsideMapper.ScalarVisibilityOff() - - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) - clipperActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - clipperOutsideActor = vtkActor() - clipperOutsideActor.SetMapper(clipperOutsideMapper) - clipperOutsideActor.GetProperty().SetColor( - colors.GetColor3d('Banana')) - - # A renderer and render window - # Create a renderer, render window, and interactor - leftViewport = [0.0, 0.0, 0.5, 1.0] - leftRenderer = vtkRenderer() - leftRenderer.SetViewport(leftViewport) - leftRenderer.SetBackground(colors.GetColor3d('SteelBlue')) - - rightViewport = [0.5, 0.0, 1.0, 1.0] - rightRenderer = vtkRenderer() - rightRenderer.SetViewport(rightViewport) - rightRenderer.SetBackground(colors.GetColor3d('CadetBlue')) - - # add the actors - leftRenderer.AddActor(wireActor) - leftRenderer.AddActor(clipperActor) - rightRenderer.AddActor(clipperOutsideActor) - - renwin = vtkRenderWindow() - renwin.SetSize(640, 480) - renwin.AddRenderer(leftRenderer) - renwin.AddRenderer(rightRenderer) - renwin.SetWindowName('ClipDataSetWithPolyData') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # Share the camera - - leftRenderer.GetActiveCamera().SetPosition(0, -1, 0) - leftRenderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - leftRenderer.GetActiveCamera().SetViewUp(0, 0, 1) - leftRenderer.GetActiveCamera().Azimuth(30) - leftRenderer.GetActiveCamera().Elevation(30) - leftRenderer.ResetCamera() - rightRenderer.SetActiveCamera(leftRenderer.GetActiveCamera()) - - renwin.Render() - interactor.Start() - - # Generate a report - ct = vtkCellTypes() - - numberOfCells = clipper.GetOutput().GetNumberOfCells() - print('------------------------') - print('The clipped dataset(inside) contains a\n', clipper.GetOutput().GetClassName(), 'that has', numberOfCells, - 'cells') - cellMap = dict() - for i in range(0, numberOfCells): - cellMap[clipper.GetOutput().GetCellType(i)] = cellMap.get(clipper.GetOutput().GetCellType(i), 0) + 1 - - for k, v in cellMap.items(): - print('\tCell type ', ct.GetClassNameFromTypeId(k), 'occurs', v, 'times.') - - numberOfCells = clipper.GetClippedOutput().GetNumberOfCells() - print('------------------------') - print('The clipped dataset(outside) contains a\n', clipper.GetClippedOutput().GetClassName(), 'that has', - numberOfCells, 'cells') - outsideCellMap = dict() - for i in range(0, numberOfCells): - outsideCellMap[clipper.GetClippedOutput().GetCellType(i)] = outsideCellMap.get( - clipper.GetClippedOutput().GetCellType(i), 0) + 1 - - for k, v in outsideCellMap.items(): - print('\tCell type ', ct.GetClassNameFromTypeId(k), 'occurs', v, 'times.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/ClipDataSetWithPolyData1.md b/data/examples/Meshes/ClipDataSetWithPolyData1.md deleted file mode 100644 index 1d20fe1..0000000 --- a/data/examples/Meshes/ClipDataSetWithPolyData1.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -An example that shows how to use the vtkClipDataSet to clip a vtkRectilinearGrid with an arbitrary polydata. vtkImplicitPolyDataDistance is used to turn the polydata into an implicit function. Every point of the grid is evaluated before sending to vtkClipDataSet. This example uses a vtkConeSource to generate polydata to use, however any polydata could be used, including stl files. - -!!! note - This was the original code used to make the C++ example [ClipDataSetWithPolyData](../../../Cxx/Meshes/ClipDataSetWithPolyData) diff --git a/data/examples/Meshes/ClipDataSetWithPolyData1.py b/data/examples/Meshes/ClipDataSetWithPolyData1.py deleted file mode 100755 index dcb8fbd..0000000 --- a/data/examples/Meshes/ClipDataSetWithPolyData1.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import vtkRectilinearGrid -from vtkmodules.vtkFiltersCore import vtkImplicitPolyDataDistance -from vtkmodules.vtkFiltersGeneral import vtkClipDataSet -from vtkmodules.vtkFiltersGeometry import vtkRectilinearGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create polydata to slice the grid with. In this case, use a cone. This could - # be any polydata including a stl file. - cone = vtkConeSource() - cone.SetResolution(20) - cone.Update() - - # implicit function that will be used to slice the mesh - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(cone.GetOutput()) - - # create a grid - xCoords = vtkFloatArray() - for x, i in enumerate(np.linspace(-1.0, 1.0, 15)): - xCoords.InsertNextValue(i) - - yCoords = vtkFloatArray() - for y, i in enumerate(np.linspace(-1.0, 1.0, 15)): - yCoords.InsertNextValue(i) - - zCoords = vtkFloatArray() - for z, i in enumerate(np.linspace(-1.0, 1.0, 15)): - zCoords.InsertNextValue(i) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, - # and ZCoordinates is equal to what is defined in SetDimensions(). - rgrid = vtkRectilinearGrid() - rgrid.SetDimensions(x + 1, y + 1, z + 1) - rgrid.SetXCoordinates(xCoords) - rgrid.SetYCoordinates(yCoords) - rgrid.SetZCoordinates(zCoords) - - # Create an array to hold distance information - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(rgrid.GetNumberOfPoints()): - p = rgrid.GetPoint(pointId) - signedDistance = implicitPolyDataDistance.EvaluateFunction(p) - signedDistances.InsertNextValue(signedDistance) - - # add the SignedDistances to the grid - rgrid.GetPointData().SetScalars(signedDistances) - - # use vtkClipDataSet to slice the grid with the polydata - clipper = vtkClipDataSet() - clipper.SetInputData(rgrid) - clipper.InsideOutOn() - clipper.SetValue(0.0) - clipper.Update() - - # --- mappers, actors, render, etc. --- - # mapper and actor to view the cone - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # geometry filter to view the background grid - geometryFilter = vtkRectilinearGridGeometryFilter() - geometryFilter.SetInputData(rgrid) - geometryFilter.SetExtent(0, x + 1, 0, y + 1, (z + 1) // 2, (z + 1) // 2) - geometryFilter.Update() - - rgridMapper = vtkPolyDataMapper() - rgridMapper.SetInputConnection(geometryFilter.GetOutputPort()) - - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetRepresentationToWireframe() - wireActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # mapper and actor to view the clipped mesh - clipperMapper = vtkDataSetMapper() - clipperMapper.SetInputConnection(clipper.GetOutputPort()) - - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) - clipperActor.GetProperty().SetRepresentationToWireframe() - clipperActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Snow')) - - # add the actors - # renderer.AddActor(coneActor) - renderer.AddActor(wireActor) - renderer.AddActor(clipperActor) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('ClipDataSetWithPolyData') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # Start - interactor.Initialize() - renwin.Render() - renderer.GetActiveCamera().SetPosition(0, -1, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 0, 1) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCamera() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/ColoredElevationMap.md b/data/examples/Meshes/ColoredElevationMap.md deleted file mode 100644 index 0d033c7..0000000 --- a/data/examples/Meshes/ColoredElevationMap.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a elevation map with different color based on height. diff --git a/data/examples/Meshes/ColoredElevationMap.py b/data/examples/Meshes/ColoredElevationMap.py deleted file mode 100755 index ebdb83c..0000000 --- a/data/examples/Meshes/ColoredElevationMap.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkMinimalStandardRandomSequence, - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkDelaunay2D -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - named_colors = vtkNamedColors() - - # Create a grid points - points = vtkPoints() - GridSize = 20; - xx = 0.0 - yy = 0.0 - zz = 0.0 - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775586) # For testing. - for x in range(0, GridSize): - for y in range(0, GridSize): - rng.Next() - xx = x + rng.GetRangeValue(-0.2, 0.2) - rng.Next() - yy = y + rng.GetRangeValue(-0.2, 0.2) - rng.Next() - zz = rng.GetRangeValue(-0.5, 0.5) - points.InsertNextPoint(xx, yy, zz) - - # Add the grid points to a polydata object - inputPolyData = vtkPolyData() - inputPolyData.SetPoints(points) - - # Triangulate the grid points - delaunay = vtkDelaunay2D() - delaunay.SetInputData(inputPolyData) - delaunay.Update() - outputPolyData = delaunay.GetOutput() - - bounds = 6 * [0.0] - outputPolyData.GetBounds(bounds) - - # Find min and max z - minz = bounds[4] - maxz = bounds[5] - - print('minz: {:< 6.3}'.format(minz)) - print('maxz: {:< 6.3}'.format(maxz)) - - # Create the color map - colorLookupTable = vtkLookupTable() - colorLookupTable.SetTableRange(minz, maxz) - colorLookupTable.Build() - - # Generate the colors for each point based on the color map - colors = vtkUnsignedCharArray() - colors.SetNumberOfComponents(3) - colors.SetName('Colors') - - print('There are ' + str(outputPolyData.GetNumberOfPoints()) + ' points.') - - for i in range(0, outputPolyData.GetNumberOfPoints()): - p = 3 * [0.0] - outputPolyData.GetPoint(i, p) - - dcolor = 3 * [0.0] - colorLookupTable.GetColor(p[2], dcolor); - # print( 'dcolor: {:<8.6} {:<8.6} {:<8.6}'.format(*dcolor)) - color = 3 * [0.0] - for j in range(0, 3): - color[j] = int(255.0 * dcolor[j]) - # print('color: {:<8} {:<8} {:<8}'.format(*color)) - - try: - colors.InsertNextTupleValue(color) - except AttributeError: - # For compatibility with new VTK generic data arrays. - colors.InsertNextTypedTuple(color) - - outputPolyData.GetPointData().SetScalars(colors) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputData(outputPolyData) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('ColoredElevationMap') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(named_colors.GetColor3d('DarkSlateGray')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/Decimation.md b/data/examples/Meshes/Decimation.md deleted file mode 100644 index e1075dd..0000000 --- a/data/examples/Meshes/Decimation.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example decimates a mesh using progressive decimation. The SetTargetReduction function specifies how many triangles should reduced by specifying the percentage (0,1) of triangles to be removed. For example, if the mesh contains 100 triangles and SetTargetReduction(.90) is called, after the decimation there will be approximately 10 triangles - a 90% reduction. - -The implementation of vtkDecimatePro is similar to the algorithm originally described in ["Decimation of Triangle Meshes"](https://www.researchgate.net/publication/225075888_Decimation_of_triangle_meshes), Proc Siggraph \`92, with three major differences. First, this algorithm does not necessarily preserve the topology of the mesh. Second, it is guaranteed to give the a mesh reduction factor specified by the user (as long as certain constraints are not set - see Caveats). Third, it is set up generate progressive meshes, that is a stream of operations that can be easily transmitted and incrementally updated (see Hugues Hoppe's Siggraph '96 paper on [progressive meshes](http://hhoppe.com/pm.pdf)). diff --git a/data/examples/Meshes/Decimation.py b/data/examples/Meshes/Decimation.py deleted file mode 100755 index 3d2e2ff..0000000 --- a/data/examples/Meshes/Decimation.py +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env python - -import os.path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import ( - vtkDecimatePro, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Decimate polydata.' - epilogue = ''' - This is an example using vtkDecimatePro to decimate input polydata, if provided, or a sphere otherwise. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', nargs='?', default=None, help='Optional input filename e.g Torso.vtp.') - parser.add_argument('reduction', nargs='?', type=float, default=.9, - help='Sets the decimation target reduction, (default is 0.9).') - args = parser.parse_args() - return args.filename, args.reduction - - -def main(): - filePath, reduction = get_program_parameters() - - # Define colors - colors = vtkNamedColors() - backFaceColor = colors.GetColor3d('Gold') - inputActorColor = colors.GetColor3d('NavajoWhite') - decimatedActorColor = colors.GetColor3d('NavajoWhite') - # colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) - # colors.SetColor('rightBkg', [0.4, 0.5, 0.6, 1.0]) - - if filePath and os.path.isfile(filePath): - readerPD = ReadPolyData(filePath) - if not readerPD: - inputPolyData = GetSpherePD() - else: - triangles = vtkTriangleFilter() - triangles.SetInputData(readerPD) - triangles.Update() - inputPolyData = triangles.GetOutput() - else: - inputPolyData = GetSpherePD() - - print('Before decimation') - print(f'There are {inputPolyData.GetNumberOfPoints()} points.') - print(f'There are {inputPolyData.GetNumberOfPolys()} polygons.') - - decimate = vtkDecimatePro() - decimate.SetInputData(inputPolyData) - decimate.SetTargetReduction(reduction) - decimate.PreserveTopologyOn() - decimate.Update() - - decimated = vtkPolyData() - decimated.ShallowCopy(decimate.GetOutput()) - - print('After decimation') - print(f'There are {decimated.GetNumberOfPoints()} points.') - print(f'There are {decimated.GetNumberOfPolys()} polygons.') - print( - f'Reduction: {(inputPolyData.GetNumberOfPolys() - decimated.GetNumberOfPolys()) / inputPolyData.GetNumberOfPolys()}') - - inputMapper = vtkPolyDataMapper() - inputMapper.SetInputData(inputPolyData) - - backFace = vtkProperty() - backFace.SetColor(backFaceColor) - - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.GetProperty().SetInterpolationToFlat() - inputActor.GetProperty().SetColor(inputActorColor) - inputActor.SetBackfaceProperty(backFace) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputData(decimated) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(decimatedActorColor) - decimatedActor.GetProperty().SetInterpolationToFlat() - decimatedActor.SetBackfaceProperty(backFace) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('Decimation'); - - # And one interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - leftViewport = [0.0, 0.0, 0.5, 1.0] - rightViewport = [0.5, 0.0, 1.0, 1.0] - - # Setup both renderers - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) - # leftRenderer.SetBackground((colors.GetColor3d('leftBkg'))) - leftRenderer.SetBackground((colors.GetColor3d('Peru'))) - - rightRenderer = vtkRenderer() - renderWindow.AddRenderer(rightRenderer) - rightRenderer.SetViewport(rightViewport) - # rightRenderer.SetBackground((colors.GetColor3d('rightBkg'))) - rightRenderer.SetBackground((colors.GetColor3d('CornflowerBlue'))) - - # Add the sphere to the left and the cube to the right - leftRenderer.AddActor(inputActor) - rightRenderer.AddActor(decimatedActor) - - # Shared camera - # Shared camera looking down the -y axis - camera = vtkCamera() - camera.SetPosition(0, -1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Elevation(30) - camera.Azimuth(30) - - leftRenderer.SetActiveCamera(camera) - rightRenderer.SetActiveCamera(camera) - - leftRenderer.ResetCamera() - leftRenderer.ResetCameraClippingRange() - - renderWindow.Render() - renderWindow.SetWindowName('Decimation') - - interactor.Start() - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def GetSpherePD(): - ''' - :return: The PolyData representation of a sphere. - ''' - source = vtkSphereSource() - source.SetThetaResolution(30) - source.SetPhiResolution(15) - source.Update() - return source.GetOutput() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/DeformPointSet.md b/data/examples/Meshes/DeformPointSet.md deleted file mode 100644 index 45da9d7..0000000 --- a/data/examples/Meshes/DeformPointSet.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -An example that shows how to use the vtkDeformPointSet filter to deform a sphere with arbitrary polydata. This example uses a vtkSphereSource to generate polydata to use, however any polydata could be used, including stl files. diff --git a/data/examples/Meshes/DeformPointSet.py b/data/examples/Meshes/DeformPointSet.py deleted file mode 100755 index a41b5b2..0000000 --- a/data/examples/Meshes/DeformPointSet.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersGeneral import vtkDeformPointSet -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - # colors.SetColor('bkg', [0.2, 0.3, 0.4, 1.0]) - - # Create a sphere to deform - sphere = vtkSphereSource() - sphere.SetThetaResolution(51) - sphere.SetPhiResolution(17) - sphere.Update() - bounds = sphere.GetOutput().GetBounds() - - # Create a filter to color the sphere - ele = vtkElevationFilter() - ele.SetInputConnection(sphere.GetOutputPort()) - ele.SetLowPoint(0, 0, -0.5); - ele.SetHighPoint(0, 0, 0.5); - ele.SetLowPoint((bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, - -bounds[5]); - ele.SetHighPoint((bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, - bounds[5]); - ele.Update() - - # Create a mesh to deform the sphere - pts = vtkPoints() - pts.SetNumberOfPoints(6) - pts.SetPoint(0, - bounds[0] - 0.1 * (bounds[1] - bounds[0]), - (bounds[3] + bounds[2]) / 2.0, - (bounds[5] + bounds[4]) / 2.0) - pts.SetPoint(1, - bounds[1] + 0.1 * (bounds[1] - bounds[0]), - (bounds[3] + bounds[2]) / 2.0, - (bounds[5] + bounds[4]) / 2.0) - pts.SetPoint(2, - (bounds[1] + bounds[0]) / 2.0, - bounds[2] - 0.1 * (bounds[3] - bounds[2]), - (bounds[5] + bounds[4]) / 2.0) - pts.SetPoint(3, - (bounds[1] + bounds[0]) / 2.0, - bounds[3] + 0.1 * (bounds[3] - bounds[2]), - (bounds[5] + bounds[4]) / 2.0) - pts.SetPoint(4, - (bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, - bounds[4] - 0.1 * (bounds[5] - bounds[4])) - pts.SetPoint(5, - (bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, - bounds[5] + 0.1 * (bounds[5] - bounds[4])) - tris = vtkCellArray() - - cells = [[2, 0, 4], [1, 2, 4], [3, 1, 4], [0, 3, 4], [0, 2, 5], [2, 1, 5], [1, 3, 5], [3, 0, 5]] - - for cell in cells: - tris.InsertNextCell(3) - for c in cell: - tris.InsertCellPoint(c) - - pd = vtkPolyData() - pd.SetPoints(pts) - pd.SetPolys(tris) - - meshMapper = vtkPolyDataMapper() - meshMapper.SetInputData(pd) - meshActor = vtkActor() - meshActor.SetMapper(meshMapper) - meshActor.GetProperty().SetRepresentationToWireframe() - meshActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - deform = vtkDeformPointSet() - deform.SetInputData(ele.GetOutput()) - deform.SetControlMeshData(pd) - deform.Update() - - controlPoint = pts.GetPoint(5) - pts.SetPoint(5, controlPoint[0], - controlPoint[1], - bounds[5] + .8 * (bounds[5] - bounds[4])) - pts.Modified() - - polyMapper = vtkPolyDataMapper() - polyMapper.SetInputConnection(deform.GetOutputPort()) - polyActor = vtkActor() - polyActor.SetMapper(polyMapper) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - renderer.AddActor(polyActor) - renderer.AddActor(meshActor) - - renderer.GetActiveCamera().SetPosition(1, 1, 1) - renderer.ResetCamera() - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - renWin.SetSize(300, 300) - renWin.SetWindowName('DeformPointSet') - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/PointInterpolator.md b/data/examples/Meshes/PointInterpolator.md deleted file mode 100644 index d81e0bc..0000000 --- a/data/examples/Meshes/PointInterpolator.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example uses vtkPointInterpolator with a Gaussian Kernel (or other kernel) to interpolate and extrapolate more smoothly the fields inside and outside the probed area. - -!!! info - This C++ code is translated from the python code that Kenichiro Yoshimi wrote to respond to Hosam. See the [discourse discussion](https://discourse.vtk.org/t/interpolate-on-stl-plotting-scalar-field-on-50-points-on-an-70000-points-stl-surface/450). diff --git a/data/examples/Meshes/PointInterpolator.py b/data/examples/Meshes/PointInterpolator.py deleted file mode 100755 index 9ea0d2a..0000000 --- a/data/examples/Meshes/PointInterpolator.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkFiltersCore import vtkResampleWithDataSet -from vtkmodules.vtkFiltersGeneral import vtkTableToPolyData -from vtkmodules.vtkFiltersPoints import ( - vtkGaussianKernel, - vtkPointInterpolator -) -from vtkmodules.vtkIOGeometry import vtkSTLReader -from vtkmodules.vtkIOInfovis import vtkDelimitedTextReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPointGaussianMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Plot the scalar field of points onto a PolyData surface.' - epilogue = ''' -This example uses vtkPointInterpolator with a Gaussian Kernel (or other kernel) - to interpolate and extrapolate more smoothly the fields inside and outside the probed area. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('points_fn', help='sparsePoints.txt.') - parser.add_argument('probe_fn', help='InterpolatingOnSTL_final.stl.') - - args = parser.parse_args() - return args.points_fn, args.probe_fn - - -def main(): - points_fn, probe_fn = get_program_parameters() - - colors = vtkNamedColors() - - points_reader = vtkDelimitedTextReader() - points_reader.SetFileName(points_fn) - points_reader.DetectNumericColumnsOn() - points_reader.SetFieldDelimiterCharacters('\t') - points_reader.SetHaveHeaders(True) - - table_points = vtkTableToPolyData() - table_points.SetInputConnection(points_reader.GetOutputPort()) - table_points.SetXColumn('x') - table_points.SetYColumn('y') - table_points.SetZColumn('z') - table_points.Update() - - points = table_points.GetOutput() - points.GetPointData().SetActiveScalars('val') - range = points.GetPointData().GetScalars().GetRange() - - # Read a probe surface - stl_reader = vtkSTLReader() - stl_reader.SetFileName(probe_fn) - stl_reader.Update() - - surface = stl_reader.GetOutput() - bounds = np.array(surface.GetBounds()) - - dims = np.array([101, 101, 101]) - box = vtkImageData() - box.SetDimensions(dims) - box.SetSpacing((bounds[1::2] - bounds[:-1:2]) / (dims - 1)) - box.SetOrigin(bounds[::2]) - - # Gaussian kernel - gaussian_kernel = vtkGaussianKernel() - gaussian_kernel.SetSharpness(2) - gaussian_kernel.SetRadius(12) - - interpolator = vtkPointInterpolator() - interpolator.SetInputData(box) - interpolator.SetSourceData(points) - interpolator.SetKernel(gaussian_kernel) - - resample = vtkResampleWithDataSet() - resample.SetInputData(surface) - resample.SetSourceConnection(interpolator.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(resample.GetOutputPort()) - mapper.SetScalarRange(range) - - actor = vtkActor() - actor.SetMapper(mapper) - - point_mapper = vtkPointGaussianMapper() - point_mapper.SetInputData(points) - point_mapper.SetScalarRange(range) - point_mapper.SetScaleFactor(0.6) - point_mapper.EmissiveOff(); - point_mapper.SetSplatShaderCode( - "//VTK::Color::Impl\n" - "float dist = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n" - "if (dist > 1.0) {\n" - " discard;\n" - "} else {\n" - " float scale = (1.0 - dist);\n" - " ambientColor *= scale;\n" - " diffuseColor *= scale;\n" - "}\n" - ) - - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - renderer.AddActor(actor) - renderer.AddActor(point_actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - renWin.SetSize(640, 480) - renWin.SetWindowName('PointInterpolator') - - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(-45) - - iren.Initialize() - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Meshes/SolidClip.md b/data/examples/Meshes/SolidClip.md deleted file mode 100644 index d9003d4..0000000 --- a/data/examples/Meshes/SolidClip.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example clips a mesh and applies a backface property to that mesh so that it appears to have a solid interior. - -The "ghost" of the part clipped away is also shown. diff --git a/data/examples/Meshes/SolidClip.py b/data/examples/Meshes/SolidClip.py deleted file mode 100755 index 2d1dd70..0000000 --- a/data/examples/Meshes/SolidClip.py +++ /dev/null @@ -1,97 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import vtkClipPolyData -from vtkmodules.vtkFiltersSources import vtkSuperquadricSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Create a superquadric - superquadric_source = vtkSuperquadricSource() - superquadric_source.SetPhiRoundness(3.1) - superquadric_source.SetThetaRoundness(2.2) - - # Define a clipping plane - clip_plane = vtkPlane() - clip_plane.SetNormal(1.0, -1.0, -1.0) - clip_plane.SetOrigin(0.0, 0.0, 0.0) - - # Clip the source with the plane - clipper = vtkClipPolyData() - clipper.SetInputConnection(superquadric_source.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - # This will give us the polygonal data that is clipped away - clipper.GenerateClippedOutputOn() - - # Create a mapper and actor - superquadric_mapper = vtkPolyDataMapper() - superquadric_mapper.SetInputConnection(clipper.GetOutputPort()) - - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - - colors = vtkNamedColors() - - # Create a property to be used for the back faces. Turn off all - # shading by specifying 0 weights for specular and diffuse. Max the - # ambient. - back_faces = vtkProperty() - back_faces.SetSpecular(0.0) - back_faces.SetDiffuse(0.0) - back_faces.SetAmbient(1.0) - back_faces.SetAmbientColor(colors.GetColor3d('Tomato')) - - superquadric_actor.SetBackfaceProperty(back_faces) - - # Here we get the the polygonal data that is clipped away - clipped_away_mapper = vtkPolyDataMapper() - clipped_away_mapper.SetInputData(clipper.GetClippedOutput()) - clipped_away_mapper.ScalarVisibilityOff() - - # Let us display it as a faint object - clipped_away_actor = vtkActor() - clipped_away_actor.SetMapper(clipped_away_mapper) - clipped_away_actor.GetProperty().SetDiffuseColor(colors.GetColor3d("Silver")) - clipped_away_actor.GetProperty().SetOpacity(0.1) - - # Create a renderer - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - render_window = vtkRenderWindow() - - render_window.AddRenderer(renderer) - - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - # Add the actor to the renderer - renderer.AddActor(superquadric_actor) - renderer.AddActor(clipped_away_actor) - render_window.SetSize(600, 600) - renderer.ResetCamera() - renderer.GetActiveCamera().Dolly(1.5) - renderer.ResetCameraClippingRange() - render_window.Render() - render_window.SetWindowName('SolidClip') - - # Interact with the window - render_window_interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/Bottle.py b/data/examples/Modelling/Bottle.py deleted file mode 100755 index 5dc4412..0000000 --- a/data/examples/Modelling/Bottle.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import ( - vtkStripper, - vtkTubeFilter -) -from vtkmodules.vtkFiltersModeling import vtkRotationalExtrusionFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the bottle profile. - # - points = vtkPoints() - points.InsertPoint(0, 0.01, 0.0, 0.0) - points.InsertPoint(1, 1.5, 0.0, 0.0) - points.InsertPoint(2, 1.5, 0.0, 3.5) - points.InsertPoint(3, 1.25, 0.0, 3.75) - points.InsertPoint(4, 0.75, 0.0, 4.00) - points.InsertPoint(5, 0.6, 0.0, 4.35) - points.InsertPoint(6, 0.7, 0.0, 4.65) - points.InsertPoint(7, 1.0, 0.0, 4.75) - points.InsertPoint(8, 1.0, 0.0, 5.0) - points.InsertPoint(9, 0.2, 0.0, 5.0) - - lines = vtkCellArray() - lines.InsertNextCell(10) # The number of points. - lines.InsertCellPoint(0) - lines.InsertCellPoint(1) - lines.InsertCellPoint(2) - lines.InsertCellPoint(3) - lines.InsertCellPoint(4) - lines.InsertCellPoint(5) - lines.InsertCellPoint(6) - lines.InsertCellPoint(7) - lines.InsertCellPoint(8) - lines.InsertCellPoint(9) - - profile = vtkPolyData() - profile.SetPoints(points) - profile.SetLines(lines) - - # Extrude the profile to make the bottle. - # - extrude = vtkRotationalExtrusionFilter() - extrude.SetInputData(profile) - extrude.SetResolution(60) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(extrude.GetOutputPort()) - - bottle = vtkActor() - bottle.SetMapper(mapper) - bottle.GetProperty().SetColor(colors.GetColor3d('Mint')) - - # Sisplay the profile. - stripper = vtkStripper() - stripper.SetInputData(profile) - - tubes = vtkTubeFilter() - tubes.SetInputConnection(stripper.GetOutputPort()) - tubes.SetNumberOfSides(11) - tubes.SetRadius(0.05) - - profileMapper = vtkPolyDataMapper() - profileMapper.SetInputConnection(tubes.GetOutputPort()) - - profileActor = vtkActor() - profileActor.SetMapper(profileMapper) - profileActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Add the actors to the renderer, set the background and size. - # - renderer.AddActor(bottle) - renderer.AddActor(profileActor) - renderer.SetBackground(colors.GetColor3d('Burlywood')) - - renWin.SetSize(640, 480) - renWin.SetWindowName('Bottle'); - renWin.Render() - - renderer.GetActiveCamera().SetPosition(1, 0, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 0, 1) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - # Render the image. - # - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/CappedSphere.md b/data/examples/Modelling/CappedSphere.md deleted file mode 100644 index f3beea2..0000000 --- a/data/examples/Modelling/CappedSphere.md +++ /dev/null @@ -1,26 +0,0 @@ -### Description - -Demonstrates how to create a capped sphere. - -Firstly a line is created in the x-z plane corresponding to an arc from +z to -z in the +x direction in the x-z plane, the length of the arc is specified in degrees. - -Then the line is extended by dropping a perpendicular to the x-axis. - -The points generated are then converted to a line and passed through to the vtkRotationalExtrusionFilter to generate the resultant 3D surface. - -The parameters are: - -- angle - the arc length in degrees default 90° (a hemisphere) -- step -the step size of the arc in degrees, default 1° -- radius - the radius of the arc default 1 - -Options are provided to: - -- Uncap the sphere (**-u, --uncapped**) -- Display the line that was rotationally extruded (**-s, --show_line**) - -!!! Note - The coordinate system for specifying the arc is left-handed with 0° aligned with the positive z-axis, 90° aligned with the positive x-axis. - -!!! Note - You can substitute different parametric equations for x and z in the line generating function to get other shapes. diff --git a/data/examples/Modelling/CappedSphere.py b/data/examples/Modelling/CappedSphere.py deleted file mode 100755 index 1ff4545..0000000 --- a/data/examples/Modelling/CappedSphere.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/env python - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) -from vtkmodules.vtkFiltersModeling import vtkRotationalExtrusionFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Display a capped sphere.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('angle', default=90, type=float, nargs='?', - help='The length of the arc in degrees from +z to -z in the +x direction in the x-z plane.') - parser.add_argument('step', default=1, type=float, nargs='?', help='Step size in degrees.') - parser.add_argument('radius', default=1, type=float, nargs='?', help='Radius of the arc.') - parser.add_argument('-u', '--uncapped', action='store_true', help='Uncap the sphere.') - parser.add_argument('-s', '--show_line', action='store_true', - help='Show the line that is rotationally extruded to make the surface.') - args = parser.parse_args() - return args.angle, args.step, args.radius, args.uncapped, args.show_line - - -def main(): - angle, step, radius, uncapped, show_line = get_program_parameters() - angle = math.radians(abs(angle)) - step = math.radians(abs(step)) - radius = abs(radius) - # With default settings set this to 45 and you get a bowl with a flat bottom. - start = math.radians(90) - - pts = get_line(angle, step, radius, uncapped, start) - - # Setup points and lines - points = vtkPoints() - lines = vtkCellArray() - for pt in pts: - pt_id = points.InsertNextPoint(pt) - if pt_id < len(pts) - 1: - line = vtkLine() - line.GetPointIds().SetId(0, pt_id) - line.GetPointIds().SetId(1, pt_id + 1) - lines.InsertNextCell(line) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetLines(lines) - - # Extrude the profile to make the capped sphere - extrude = vtkRotationalExtrusionFilter() - extrude.SetInputData(polydata) - extrude.SetResolution(60) - - # Visualize - colors = vtkNamedColors() - - # To see the line - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputData(polydata) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetLineWidth(4) - lineActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # To see the surface - surfaceMapper = vtkPolyDataMapper() - surfaceMapper.SetInputConnection(extrude.GetOutputPort()) - - surfaceActor = vtkActor() - surfaceActor.SetMapper(surfaceMapper) - surfaceActor.GetProperty().SetColor(colors.GetColor3d('Khaki')) - - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - ren.AddActor(surfaceActor) - if show_line: - ren.AddActor(lineActor) - ren.SetBackground(colors.GetColor3d('LightSlateGray')) - - ren.ResetCamera() - ren.GetActiveCamera().Azimuth(0) - ren.GetActiveCamera().Elevation(60) - ren.ResetCameraClippingRange() - - renWin.SetSize(600, 600) - renWin.Render() - renWin.SetWindowName('CappedSphere') - iren.Start() - - -def get_line(angle, step, radius, uncapped, start): - ''' - Get the points for a line. - - :param angle: Length of the arc in degrees. - :param step: Step size in degrees. - :param radius: Radius of the arc. - :param uncapped: True if uncapped. - :param start: Starting angle. - :return: A vector of points. - ''' - precision = 1.0e-6 - pts = list() - # Do the curved line - theta = 0.0 - while theta <= angle: - x = radius * math.cos(start - theta) - z = radius * math.sin(theta - start) - if x < 0: - x = 0 - pts.append((x, 0, z)) - break - if abs(x) < precision: - x = 0 - if abs(z) < precision: - z = 0 - pts.append((x, 0, z)) - theta += step - - if not uncapped: - # Drop a perpendicular from the last point to the x-axis - if len(pts) > 1: - if pts[-1][0] > 0: - last_point = pts[-1] - num_pts = 10 - interval = float(num_pts) / radius - for i in range(1, num_pts): - x = last_point[0] - i / interval - z = last_point[2] - if x < 0: - x = 0 - pts.append((x, 0, z)) - break - if abs(x) < precision: - x = 0 - if abs(z) < precision: - z = 0 - pts.append((x, 0, z)) - if pts[-1][0] > precision: - pts.append((0, 0, pts[-1][2])) - return pts - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/ContourTriangulator.py b/data/examples/Modelling/ContourTriangulator.py deleted file mode 100755 index 23c90f7..0000000 --- a/data/examples/Modelling/ContourTriangulator.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkMarchingSquares -from vtkmodules.vtkFiltersGeneral import vtkContourTriangulator -from vtkmodules.vtkIOImage import vtkPNGReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Create a contour from a structured point set (image) and triangulate it.' - epilogue = ''' - Try with different iso values e.g. -i1000. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('file_name', help='The path to the image file to use e.g fullhead15.png.') - parser.add_argument('-i', '--iso_value', help='The contour value for generating the isoline.', default=500, - type=int) - args = parser.parse_args() - return args.file_name, args.iso_value - - -def main(): - file_name, iso_value = get_program_parameters() - - colors = vtkNamedColors() - - reader = vtkPNGReader() - if not reader.CanReadFile(file_name): - print('Error: Could not read', file_name) - return - reader.SetFileName(file_name) - reader.Update() - - iso = vtkMarchingSquares() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, iso_value) - - iso_mapper = vtkDataSetMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) - iso_mapper.ScalarVisibilityOff() - - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor( - colors.GetColor3d('MediumOrchid')) - - poly = vtkContourTriangulator() - poly.SetInputConnection(iso.GetOutputPort()) - - poly_mapper = vtkDataSetMapper() - poly_mapper.SetInputConnection(poly.GetOutputPort()) - poly_mapper.ScalarVisibilityOff() - - poly_actor = vtkActor() - poly_actor.SetMapper(poly_mapper) - poly_actor.GetProperty().SetColor(colors.GetColor3d('Gray')) - - # Standard rendering classes. - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.SetMultiSamples(0) - ren_win.AddRenderer(renderer) - ren_win.SetWindowName('ContourTriangulator') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - renderer.AddActor(poly_actor) - renderer.AddActor(iso_actor) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - ren_win.SetSize(300, 300) - - camera = renderer.GetActiveCamera() - renderer.ResetCamera() - camera.Azimuth(180) - - ren_win.Render() - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/DelaunayMesh.md b/data/examples/Modelling/DelaunayMesh.md deleted file mode 100644 index a333c07..0000000 --- a/data/examples/Modelling/DelaunayMesh.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This is two dimensional Delaunay triangulation of a random set of points. Points and edges are shown highlighted with spheres and tubes. - -!!! info - See [Figure 9-54](../../../VTKBook/09Chapter9/#Figure%209-54) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Modelling/DelaunayMesh.py b/data/examples/Modelling/DelaunayMesh.py deleted file mode 100755 index bb3baef..0000000 --- a/data/examples/Modelling/DelaunayMesh.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python - -""" -This code is based on the VTK file: Examples/Modelling/Tcl/DelMesh.py. - -This example demonstrates how to use 2D Delaunay triangulation. -We create a fancy image of a 2D Delaunay triangulation. Points are - randomly generated. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import ( - vtkDelaunay2D, - vtkGlyph3D, - vtkTubeFilter -) - -# vtkExtractEdges moved from vtkFiltersExtraction to vtkFiltersCore in -# VTK commit d9981b9aeb93b42d1371c6e295d76bfdc18430bd -try: - from vtkmodules.vtkFiltersCore import vtkExtractEdges -except ImportError: - from vtkmodules.vtkFiltersExtraction import vtkExtractEdges -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Generate some "random" points. - points = vtkPoints() - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(1) - for i in range(0, 50): - p1 = randomSequence.GetValue() - randomSequence.Next() - p2 = randomSequence.GetValue() - randomSequence.Next() - points.InsertPoint(i, p1, p2, 0.0) - - # Create a polydata with the points we just created. - profile = vtkPolyData() - profile.SetPoints(points) - - # Perform a 2D Delaunay triangulation on them. - delny = vtkDelaunay2D() - delny.SetInputData(profile) - delny.SetTolerance(0.001) - mapMesh = vtkPolyDataMapper() - mapMesh.SetInputConnection(delny.GetOutputPort()) - meshActor = vtkActor() - meshActor.SetMapper(mapMesh) - meshActor.GetProperty().SetColor(colors.GetColor3d('MidnightBlue')) - - # We will now create a nice looking mesh by wrapping the edges in tubes, - # and putting fat spheres at the points. - extract = vtkExtractEdges() - extract.SetInputConnection(delny.GetOutputPort()) - tubes = vtkTubeFilter() - tubes.SetInputConnection(extract.GetOutputPort()) - tubes.SetRadius(0.01) - tubes.SetNumberOfSides(6) - mapEdges = vtkPolyDataMapper() - mapEdges.SetInputConnection(tubes.GetOutputPort()) - edgeActor = vtkActor() - edgeActor.SetMapper(mapEdges) - edgeActor.GetProperty().SetColor(colors.GetColor3d('peacock')) - edgeActor.GetProperty().SetSpecularColor(1, 1, 1) - edgeActor.GetProperty().SetSpecular(0.3) - edgeActor.GetProperty().SetSpecularPower(20) - edgeActor.GetProperty().SetAmbient(0.2) - edgeActor.GetProperty().SetDiffuse(0.8) - - ball = vtkSphereSource() - ball.SetRadius(0.025) - ball.SetThetaResolution(12) - ball.SetPhiResolution(12) - balls = vtkGlyph3D() - balls.SetInputConnection(delny.GetOutputPort()) - balls.SetSourceConnection(ball.GetOutputPort()) - mapBalls = vtkPolyDataMapper() - mapBalls.SetInputConnection(balls.GetOutputPort()) - ballActor = vtkActor() - ballActor.SetMapper(mapBalls) - ballActor.GetProperty().SetColor(colors.GetColor3d('hot_pink')) - ballActor.GetProperty().SetSpecularColor(1, 1, 1) - ballActor.GetProperty().SetSpecular(0.3) - ballActor.GetProperty().SetSpecularPower(20) - ballActor.GetProperty().SetAmbient(0.2) - ballActor.GetProperty().SetDiffuse(0.8) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(ballActor) - ren.AddActor(edgeActor) - ren.SetBackground(colors.GetColor3d('AliceBlue')) - renWin.SetSize(512, 512) - renWin.SetWindowName('DelaunayMesh') - - ren.ResetCamera() - ren.GetActiveCamera().Zoom(1.3) - - # Interact with the data. - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/DiscreteMarchingCubes.md b/data/examples/Modelling/DiscreteMarchingCubes.md deleted file mode 100644 index 25536cd..0000000 --- a/data/examples/Modelling/DiscreteMarchingCubes.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Creates surfaces from labeled data. Volume data does not always contain samples of continuous data. A volume may contain discrete integer values, often the result of segmentation. -vtkDiscreteFlyingEdges3D or vtkDiscreteMarchingCubes create surfaces from these segmented volumes using a modified flying edges or marching cubes algorithm. -The algorithm generates one or more models representing the boundaries between the specified label and the adjacent structures. One or more label values must be specified to generate the models. The boundary positions are always defined to be half-way between adjacent voxels. - -!!! seealso - [SmoothDiscreteMarchingCubes](../SmoothDiscreteMarchingCubes) produces smooth models. diff --git a/data/examples/Modelling/DiscreteMarchingCubes.py b/data/examples/Modelling/DiscreteMarchingCubes.py deleted file mode 100755 index 1f7c84d..0000000 --- a/data/examples/Modelling/DiscreteMarchingCubes.py +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkLookupTable, - vtkMinimalStandardRandomSequence, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - vtkImageData, - vtkSphere -) -from vtkmodules.vtkFiltersGeneral import ( - vtkDiscreteFlyingEdges3D, - vtkDiscreteMarchingCubes -) -from vtkmodules.vtkImagingCore import vtkImageThreshold -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkDiscreteFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - n = 20 - radius = 8 - blob = make_blob(n, radius) - - if use_flying_edges: - try: - discrete = vtkDiscreteFlyingEdges3D() - except AttributeError: - discrete = vtkDiscreteMarchingCubes() - else: - discrete = vtkDiscreteMarchingCubes() - discrete.SetInputData(blob) - discrete.GenerateValues(n, 1, n) - - lut = make_colors(n) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(discrete.GetOutputPort()) - mapper.SetLookupTable(lut) - mapper.SetScalarRange(0, lut.GetNumberOfColors()) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetWindowName('DiscreteMarchingCubes') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - colors = vtkNamedColors() - ren.SetBackground(colors.GetColor3d('Burlywood')) - - ren_win.Render() - - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def make_blob(n, radius): - blob_image = vtkImageData() - - max_r = 50 - 2.0 * radius - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): - - sphere = vtkSphere() - sphere.SetRadius(radius) - - x = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - y = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - z = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - - sphere.SetCenter(int(x), int(y), int(z)) - - sampler = vtkSampleFunction() - sampler.SetImplicitFunction(sphere) - sampler.SetOutputScalarTypeToFloat() - sampler.SetSampleDimensions(100, 100, 100) - sampler.SetModelBounds(-50, 50, -50, 50, -50, 50) - - thres = vtkImageThreshold() - thres.SetInputConnection(sampler.GetOutputPort()) - thres.ThresholdByLower(radius * radius) - thres.ReplaceInOn() - thres.ReplaceOutOn() - thres.SetInValue(i + 1) - thres.SetOutValue(0) - thres.Update() - if i == 0: - blob_image.DeepCopy(thres.GetOutput()) - - max_value = vtkImageMathematics() - max_value.SetInputData(0, blob_image) - max_value.SetInputData(1, thres.GetOutput()) - max_value.SetOperationToMax() - max_value.Modified() - max_value.Update() - - blob_image.DeepCopy(max_value.GetOutput()) - - return blob_image - - -def make_colors(n): - """ - Generate some random colors - :param n: The number of colors. - :return: The lookup table. - """ - - lut = vtkLookupTable() - lut.SetNumberOfColors(n) - lut.SetTableRange(0, n - 1) - lut.SetScaleToLinear() - lut.Build() - lut.SetTableValue(0, 0, 0, 0, 1) - - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(1, n): - r = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - g = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - b = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - lut.SetTableValue(i, r, g, b, 1.0) - - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/ExtractLargestIsosurface.md b/data/examples/Modelling/ExtractLargestIsosurface.md deleted file mode 100644 index cfb55b9..0000000 --- a/data/examples/Modelling/ExtractLargestIsosurface.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -* Contributed by: Jinyoung Hwang - -This example reads a structured points dataset stored in a .vtk file and constructs a 3D model using vtkFlyingEdges3D or vtkMarchingCubes, vtkPolyDataConnectivityFilter is used to extract the largest isosurface. - -Data is available at: - -1. test.vtk: http://web.kaist.ac.kr/~hjy/test.vtk - -2. brainweb.img: http://web.kaist.ac.kr/~hjy/brainweb.img - -3. brainweb.hdr: http://web.kaist.ac.kr/~hjy/brainweb.hdr - -Second and third datasets can be downloaded from [BrainWeb](http://www.bic.mni.mcgill.ca/brainweb/), which is free of charge in use for a research. -"test.vtk" was converted from "brainweb.img" using a program by Erik Vidholm (http://www.cb.uu.se/~erik/vtk/rawToVTK.cpp). - -The examples expects 2 or 3 argments: - -``` bash - ExtractLargestIsosurface InputFilename Threshold (ExtractLargest) -``` - - if ExtractLargest is omitted or 1, the largest isosurface is extracted - - if ExtractLargest is 0 (or -a in Python), all of the isosurfaces are extracted - -Try - - ExtractLargestIsosurface test.vtk 50 - -and compare the results to - - ExtractLargestIsosurface test.vtk 50 0 diff --git a/data/examples/Modelling/ExtractLargestIsosurface.py b/data/examples/Modelling/ExtractLargestIsosurface.py deleted file mode 100755 index 008a676..0000000 --- a/data/examples/Modelling/ExtractLargestIsosurface.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkPolyDataConnectivityFilter -) -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - file_name, threshold, largest_surface = get_program_parameters() - - # Load data - reader = vtkStructuredPointsReader() - reader.SetFileName(file_name) - - # Create a 3D model using flying edges or marching cubes - if use_flying_edges: - try: - mc = vtkFlyingEdges3D() - except AttributeError: - mc = vtkMarchingCubes() - else: - mc = vtkMarchingCubes() - - mc.SetInputConnection(reader.GetOutputPort()) - mc.ComputeNormalsOn() - mc.ComputeGradientsOn() - mc.SetValue(0, threshold) # second value acts as threshold - - # To remain largest region - confilter = vtkPolyDataConnectivityFilter() - confilter.SetInputConnection(mc.GetOutputPort()) - confilter.SetExtractionModeToLargestRegion() - - # Create a mapper - mapper = vtkPolyDataMapper() - if largest_surface: - mapper.SetInputConnection(confilter.GetOutputPort()) - else: - mapper.SetInputConnection(mc.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Visualize - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('SkinColor')) - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - actor.SetBackfaceProperty(back_prop) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.GetActiveCamera().SetViewUp(0.0, 0.0, 1.0) - renderer.GetActiveCamera().SetPosition(0.0, 1.0, 0.0) - renderer.GetActiveCamera().SetFocalPoint(0.0, 0.0, 0.0) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(30.0) - renderer.GetActiveCamera().Elevation(30.0) - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('ExtractLargestIsosurface') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - ren_win.Render() - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Reads a structured points dataset stored in a .vtk file and constructs a 3D model.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='E.g. brain.vtk.') - parser.add_argument('threshold', type=int, help='The threshold, e.g. 50.') - parser.add_argument('-a', action='store_false', default=True, help='Extract all surfaces.') - args = parser.parse_args() - return args.filename, args.threshold, args.a - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/Finance.md b/data/examples/Modelling/Finance.md deleted file mode 100644 index 4f0f58a..0000000 --- a/data/examples/Modelling/Finance.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -The first step is to choose dependent and independent variables. This choice is essentially a mapping from multidimensional data into an unstructured point dataset. This example chooses MONTHLY_PAYMENT, INTEREST_RATE, and LOAN_AMOUNT as (x, y, z) point coordinates, and TIME_LATE as a scalar value. This maps four of six variables. For now we will ignore the other two variables. - -The example uses vtkGaussianSplatter to perform the splatting operation (i.e., conversion from unstructured points to volume dataset). This is followed by an isosurface extraction. We splat the data two times. The first time we splat the entire population. This is to show context and appears as gray/ wireframe in the figure. The second time we splat the data and scale it by the value of TIME_LATE . As a result, only payments that are late contribute to the second isosurface. The results of this visualization are interesting. First, we see that there is a strong correlation between the two independent variables MONTHLY_PAYMENT and LOAN_AMOUNT . (This is more evident when viewing the data interactively.) We see that the data falls roughly on a plane at a 45 degree angle between these two axes. With a little reflection this is evident: the monthly payment is strongly a function of loan amount (as well as interest rate and payment period). Second, we see that there is a clustering of delinquent accounts within the total population. The cluster tends to grow with larger interest rates and shrink with smaller monthly payments and loan amounts. Although the relationship with interest rate is expected, the clustering towards smaller monthly payments is not. Thus our visualization has provided a clue into the data. Further exploration may reveal the reason(s), or we may perform additional data analysis and acquisition to understand the phenomena. - -One important note about multidimensional visualization. Because we tend to combine variables in odd ways (e.g., the use of MONTHLY_PAYMENT , INTEREST_RATE , and LOAN_AMOUNT as (x, y, z) coordinates), normalization of the data is usually required. To normalize data we simply adjust data values to lie between (0,1). Otherwise our data can be badly skewed and result in poor visualizations. - -!!! info - See [Figure 9-50](../../../VTKBook/09Chapter9/#Figure%209-50) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Modelling/Finance.py b/data/examples/Modelling/Finance.py deleted file mode 100755 index 1fe4959..0000000 --- a/data/examples/Modelling/Finance.py +++ /dev/null @@ -1,202 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersGeneral import vtkAxes -from vtkmodules.vtkImagingHybrid import vtkGaussianSplatter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - colors.SetColor('PopColor', [230, 230, 230, 255]) - - fileName = get_program_parameters() - - keys = ['NUMBER_POINTS', 'MONTHLY_PAYMENT', 'INTEREST_RATE', 'LOAN_AMOUNT', 'TIME_LATE'] - - # Read in the data and make an unstructured data set. - dataSet = make_dataset(fileName, keys) - - # Construct the pipeline for the original population. - popSplatter = vtkGaussianSplatter() - popSplatter.SetInputData(dataSet) - popSplatter.SetSampleDimensions(100, 100, 100) - popSplatter.SetRadius(0.05) - popSplatter.ScalarWarpingOff() - - popSurface = vtkContourFilter() - popSurface.SetInputConnection(popSplatter.GetOutputPort()) - popSurface.SetValue(0, 0.01) - - popMapper = vtkPolyDataMapper() - popMapper.SetInputConnection(popSurface.GetOutputPort()) - popMapper.ScalarVisibilityOff() - - popActor = vtkActor() - popActor.SetMapper(popMapper) - popActor.GetProperty().SetOpacity(0.3) - popActor.GetProperty().SetColor(colors.GetColor3d('PopColor')) - - # Construct the pipeline for the delinquent population. - lateSplatter = vtkGaussianSplatter() - lateSplatter.SetInputData(dataSet) - lateSplatter.SetSampleDimensions(50, 50, 50) - lateSplatter.SetRadius(0.05) - lateSplatter.SetScaleFactor(0.005) - - lateSurface = vtkContourFilter() - lateSurface.SetInputConnection(lateSplatter.GetOutputPort()) - lateSurface.SetValue(0, 0.01) - - lateMapper = vtkPolyDataMapper() - lateMapper.SetInputConnection(lateSurface.GetOutputPort()) - lateMapper.ScalarVisibilityOff() - - lateActor = vtkActor() - lateActor.SetMapper(lateMapper) - lateActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Create axes. - popSplatter.Update() - bounds = popSplatter.GetOutput().GetBounds() - - axes = vtkAxes() - axes.SetOrigin(bounds[0], bounds[2], bounds[4]) - axes.SetScaleFactor(popSplatter.GetOutput().GetLength() / 5) - - axesTubes = vtkTubeFilter() - axesTubes.SetInputConnection(axes.GetOutputPort()) - axesTubes.SetRadius(axes.GetScaleFactor() / 25.0) - axesTubes.SetNumberOfSides(6) - - axesMapper = vtkPolyDataMapper() - axesMapper.SetInputConnection(axesTubes.GetOutputPort()) - - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Graphics stuff. - renderer = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renWin) - - # Set up the renderer. - renderer.AddActor(lateActor) - renderer.AddActor(axesActor) - renderer.AddActor(popActor) - renderer.SetBackground(colors.GetColor3d('Wheat')) - renWin.SetSize(640, 480) - renWin.SetWindowName('Finance') - - renderer.ResetCamera() - renderer.GetActiveCamera().Dolly(1.3) - renderer.ResetCameraClippingRange() - - # Interact with the data. - renWin.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Visualization of multidimensional financial data.' - epilogue = ''' - The gray/wireframe surface represents the total data population. - The red surface represents data points delinquent on loan payment. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='financial.txt.') - args = parser.parse_args() - return args.filename - - -def normalise(maximum, minimum, x): - return minimum + x / (maximum - minimum) - - -def read_file(filename): - ''' - Read in the data set. - :param filename: - :return: - ''' - res = dict() - - with open(filename) as ifn: - k = '' - v = list() - for line in ifn: - cl = ' '.join(line.split()).split() # Clean the line. - if cl: - if len(cl) == 2 and cl[0] == 'NUMBER_POINTS': - k = cl[0] - v = [int(cl[1])] - has_key = True - continue - if len(cl) == 1 and not has_key: - has_key = True - k = cl[0] - v = list() - else: - v += map(float, cl) - else: - if has_key: - # Normalise the data. - minimum = min(v) - maximum = max(v) - # Emulate the bug in the C++ code. - for i in v: - if i > minimum: - maximum = i - if maximum != minimum: - res[k] = list(map(lambda x: minimum + x / (maximum - minimum), v)) - else: - res[k] = v - has_key = False - return res - - -def make_dataset(filename, keys): - res = read_file(filename) - if res: - newPts = vtkPoints() - newScalars = vtkFloatArray() - xyz = list(zip(res[keys[1]], res[keys[2]], res[keys[3]])) - for i in range(0, res[keys[0]][0]): - # print(xyz[i]) - newPts.InsertPoint(i, xyz[i]) - newScalars.InsertValue(i, res[keys[4]][i]) - - dataset = vtkUnstructuredGrid() - dataset.SetPoints(newPts) - dataset.GetPointData().SetScalars(newScalars) - return dataset - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/FinanceFieldData.md b/data/examples/Modelling/FinanceFieldData.md deleted file mode 100644 index f7bd48c..0000000 --- a/data/examples/Modelling/FinanceFieldData.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description -This example is similar to [Finance](../Finance), but here we read a .vtk file with vtkDataObjectReader. The file is: `src/Testing/Data/financial.vtk`. - -The generated image is Figure 5 in [VTKFileFormats](../../../VTKFileFormats#legacy-file-examples). diff --git a/data/examples/Modelling/FinanceFieldData.py b/data/examples/Modelling/FinanceFieldData.py deleted file mode 100755 index 9181883..0000000 --- a/data/examples/Modelling/FinanceFieldData.py +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkDataObjectToDataSetFilter, - vtkFieldDataToAttributeDataFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkAxes, - vtkMarchingContourFilter -) -from vtkmodules.vtkIOLegacy import vtkDataObjectReader -from vtkmodules.vtkImagingHybrid import vtkGaussianSplatter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkFollower, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - ifn = get_program_parameters() - - colors = vtkNamedColors() - - reader = vtkDataObjectReader() - reader.SetFileName(ifn) - - size = 3187 # maximum number possible - - xAxis = 'INTEREST_RATE' - yAxis = 'MONTHLY_PAYMENT' - zAxis = 'MONTHLY_INCOME' - scalar = 'TIME_LATE' - - # Extract data from field as a polydata (just points), then extract scalars. - do2ds = vtkDataObjectToDataSetFilter() - do2ds.SetInputConnection(reader.GetOutputPort()) - do2ds.SetDataSetTypeToPolyData() - # format: component#, arrayname, arraycomp, minArrayId, maxArrayId, normalize - do2ds.DefaultNormalizeOn() - do2ds.SetPointComponent(0, xAxis, 0) - do2ds.SetPointComponent(1, yAxis, 0, 0, size, 1) - do2ds.SetPointComponent(2, zAxis, 0) - do2ds.Update() - fd2ad = vtkFieldDataToAttributeDataFilter() - fd2ad.SetInputConnection(do2ds.GetOutputPort()) - fd2ad.SetInputFieldToDataObjectField() - fd2ad.SetOutputAttributeDataToPointData() - fd2ad.DefaultNormalizeOn() - fd2ad.SetScalarComponent(0, scalar, 0) - - # Construct the pipeline for the original population. - popSplatter = vtkGaussianSplatter() - popSplatter.SetInputConnection(fd2ad.GetOutputPort()) - popSplatter.SetSampleDimensions(150, 150, 150) - popSplatter.SetRadius(0.05) - popSplatter.ScalarWarpingOff() - - popSurface = vtkMarchingContourFilter() - popSurface.SetInputConnection(popSplatter.GetOutputPort()) - popSurface.SetValue(0, 0.01) - popMapper = vtkPolyDataMapper() - popMapper.SetInputConnection(popSurface.GetOutputPort()) - popMapper.ScalarVisibilityOff() - popActor = vtkActor() - popActor.SetMapper(popMapper) - popActor.GetProperty().SetOpacity(0.3) - popActor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Construct the pipeline for the delinquent population. - lateSplatter = vtkGaussianSplatter() - lateSplatter.SetInputConnection(fd2ad.GetOutputPort()) - lateSplatter.SetSampleDimensions(150, 150, 150) - lateSplatter.SetRadius(0.05) - lateSplatter.SetScaleFactor(0.05) - - lateSurface = vtkMarchingContourFilter() - lateSurface.SetInputConnection(lateSplatter.GetOutputPort()) - lateSurface.SetValue(0, 0.01) - lateMapper = vtkPolyDataMapper() - lateMapper.SetInputConnection(lateSurface.GetOutputPort()) - lateMapper.ScalarVisibilityOff() - lateActor = vtkActor() - lateActor.SetMapper(lateMapper) - lateActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Create the axes. - popSplatter.Update() - bounds = popSplatter.GetOutput().GetBounds() - axes = vtkAxes() - axes.SetOrigin(bounds[0], bounds[2], bounds[4]) - axes.SetScaleFactor(popSplatter.GetOutput().GetLength() / 5.0) - axesTubes = vtkTubeFilter() - axesTubes.SetInputConnection(axes.GetOutputPort()) - axesTubes.SetRadius(axes.GetScaleFactor() / 25.0) - axesTubes.SetNumberOfSides(6) - axesMapper = vtkPolyDataMapper() - axesMapper.SetInputConnection(axesTubes.GetOutputPort()) - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Label the axes. - XText = vtkVectorText() - XText.SetText(xAxis) - XTextMapper = vtkPolyDataMapper() - XTextMapper.SetInputConnection(XText.GetOutputPort()) - - XActor = vtkFollower() - XActor.SetMapper(XTextMapper) - XActor.SetScale(0.02, .02, .02) - XActor.SetPosition(0.35, -0.05, -0.05) - XActor.GetProperty().SetColor(0, 0, 0) - - YText = vtkVectorText() - YText.SetText(yAxis) - - YTextMapper = vtkPolyDataMapper() - YTextMapper.SetInputConnection(YText.GetOutputPort()) - YActor = vtkFollower() - YActor.SetMapper(YTextMapper) - YActor.SetScale(0.02, .02, .02) - YActor.SetPosition(-0.05, 0.35, -0.05) - YActor.GetProperty().SetColor(0, 0, 0) - - ZText = vtkVectorText() - ZText.SetText(zAxis) - ZTextMapper = vtkPolyDataMapper() - ZTextMapper.SetInputConnection(ZText.GetOutputPort()) - ZActor = vtkFollower() - ZActor.SetMapper(ZTextMapper) - ZActor.SetScale(0.02, .02, .02) - ZActor.SetPosition(-0.05, -0.05, 0.35) - ZActor.GetProperty().SetColor(0, 0, 0) - - # Graphics stuff. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('FinanceFieldData') - - # Add the actors to the renderer, set the background and size. - renderer.AddActor(axesActor) - renderer.AddActor(lateActor) - renderer.AddActor(XActor) - renderer.AddActor(YActor) - renderer.AddActor(ZActor) - renderer.AddActor(popActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderWindow.SetSize(650, 480) - - camera = vtkCamera() - camera.SetClippingRange(.274, 13.72) - camera.SetFocalPoint(0.433816, 0.333131, 0.449) - camera.SetPosition(-1.96987, 1.15145, 1.49053) - camera.SetViewUp(0.378927, 0.911821, 0.158107) - renderer.SetActiveCamera(camera) - XActor.SetCamera(camera) - YActor.SetCamera(camera) - ZActor.SetCamera(camera) - - # Render and interact with the data. - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Visualization of multidimensional financial data.' - epilogue = ''' - This example is similar to /Python/Modelling/Finance.py, but here we read a .vtk file with vtkDataObjectReader. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('filename', help='financial.') - - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/MarchingCubes.md b/data/examples/Modelling/MarchingCubes.md deleted file mode 100644 index ab613da..0000000 --- a/data/examples/Modelling/MarchingCubes.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -Creates a surface from a volume using Flying Edges or Marching Cubes. - -Without arguments, the examples generates a voxelized sphere with vtkVoxelModeller. - -!!! note - vtkVoxelModeller by default produces a VTK_BIT scalar image. Marching Cubes does not support this type. The scalar output is set to float for this example. - -To generate a surface from a DICOM series, provide a folder containing the series and specify an isovalue for the surface. - -This [Midas Repository](http://placid.nlm.nih.gov/community/21) contains a number of DICOM datasets. diff --git a/data/examples/Modelling/MarchingCubes.py b/data/examples/Modelling/MarchingCubes.py deleted file mode 100755 index 5af8fa3..0000000 --- a/data/examples/Modelling/MarchingCubes.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import vtkDICOMImageReader -from vtkmodules.vtkImagingHybrid import vtkVoxelModeller -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - dicom_dir, iso_value = get_program_parameters() - if iso_value is None and dicom_dir is not None: - print('An ISO value is needed.') - return () - - volume = vtkImageData() - if dicom_dir is None: - sphere_source = vtkSphereSource() - sphere_source.SetPhiResolution(20) - sphere_source.SetThetaResolution(20) - sphere_source.Update() - - bounds = list(sphere_source.GetOutput().GetBounds()) - for i in range(0, 6, 2): - dist = bounds[i + 1] - bounds[i] - bounds[i] = bounds[i] - 0.1 * dist - bounds[i + 1] = bounds[i + 1] + 0.1 * dist - voxel_modeller = vtkVoxelModeller() - voxel_modeller.SetSampleDimensions(50, 50, 50) - voxel_modeller.SetModelBounds(bounds) - voxel_modeller.SetScalarTypeToFloat() - voxel_modeller.SetMaximumDistance(0.1) - - voxel_modeller.SetInputConnection(sphere_source.GetOutputPort()) - voxel_modeller.Update() - iso_value = 0.5 - volume.DeepCopy(voxel_modeller.GetOutput()) - else: - reader = vtkDICOMImageReader() - reader.SetDirectoryName(dicom_dir) - reader.Update() - volume.DeepCopy(reader.GetOutput()) - - if use_flying_edges: - try: - surface = vtkFlyingEdges3D() - except AttributeError: - surface = vtkMarchingCubes() - else: - surface = vtkMarchingCubes() - surface.SetInputData(volume) - surface.ComputeNormalsOn() - surface.SetValue(0, iso_value) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetWindowName('MarchingCubes') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer.AddActor(actor) - - render_window.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'The skin extracted from a CT dataset of the head.' - epilogue = ''' - Derived from VTK/Examples/Cxx/Medical1.cxx - This example reads a volume dataset, extracts an isosurface that - represents the skin and displays it. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-d', default=None, help='A DICOM Image directory.') - parser.add_argument('-i', type=float, default=None, help='The iso value to use.') - args = parser.parse_args() - return args.d, args.i - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/SmoothDiscreteMarchingCubes.md b/data/examples/Modelling/SmoothDiscreteMarchingCubes.md deleted file mode 100644 index 1bae42f..0000000 --- a/data/examples/Modelling/SmoothDiscreteMarchingCubes.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Creates surfaces from labeled data. Volume data does not always contain samples of continuous data. A volume may contain discrete integer values, often the result of segmentation. This example smooths the discrete models generated by vtkDiscreteMarchingCubes with vtkWindowedSincPolyDataFilter. - -!!! seealso - [DiscreteMarchingCubes](../DiscreteMarchingCubes) produces rough models. diff --git a/data/examples/Modelling/SmoothDiscreteMarchingCubes.py b/data/examples/Modelling/SmoothDiscreteMarchingCubes.py deleted file mode 100755 index 74021b9..0000000 --- a/data/examples/Modelling/SmoothDiscreteMarchingCubes.py +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkMinimalStandardRandomSequence -) -from vtkmodules.vtkCommonDataModel import ( - vtkImageData, - vtkSphere -) -from vtkmodules.vtkFiltersCore import vtkWindowedSincPolyDataFilter -from vtkmodules.vtkFiltersGeneral import vtkDiscreteMarchingCubes -from vtkmodules.vtkImagingCore import vtkImageThreshold -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkImagingMath import vtkImageMathematics -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - n = 20 - radius = 8 - blob = make_blob(n, radius) - - discrete = vtkDiscreteMarchingCubes() - discrete.SetInputData(blob) - discrete.GenerateValues(n, 1, n) - - smoothing_iterations = 15 - pass_band = 0.001 - feature_angle = 120.0 - - smoother = vtkWindowedSincPolyDataFilter() - smoother.SetInputConnection(discrete.GetOutputPort()) - smoother.SetNumberOfIterations(smoothing_iterations) - smoother.BoundarySmoothingOff() - smoother.FeatureEdgeSmoothingOff() - smoother.SetFeatureAngle(feature_angle) - smoother.SetPassBand(pass_band) - smoother.NonManifoldSmoothingOn() - smoother.NormalizeCoordinatesOn() - smoother.Update() - - lut = make_colors(n) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(smoother.GetOutputPort()) - mapper.SetLookupTable(lut) - mapper.SetScalarRange(0, lut.GetNumberOfColors()) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetWindowName('SmoothDiscreteMarchingCubes') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - colors = vtkNamedColors() - ren.SetBackground(colors.GetColor3d('Burlywood')) - - ren_win.Render() - - iren.Start() - - -def make_blob(n, radius): - blob_image = vtkImageData() - - max_r = 50 - 2.0 * radius - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): - - sphere = vtkSphere() - sphere.SetRadius(radius) - - x = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - y = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - z = random_sequence.GetRangeValue(-max_r, max_r) - random_sequence.Next() - - sphere.SetCenter(int(x), int(y), int(z)) - - sampler = vtkSampleFunction() - sampler.SetImplicitFunction(sphere) - sampler.SetOutputScalarTypeToFloat() - sampler.SetSampleDimensions(100, 100, 100) - sampler.SetModelBounds(-50, 50, -50, 50, -50, 50) - - thres = vtkImageThreshold() - thres.SetInputConnection(sampler.GetOutputPort()) - thres.ThresholdByLower(radius * radius) - thres.ReplaceInOn() - thres.ReplaceOutOn() - thres.SetInValue(i + 1) - thres.SetOutValue(0) - thres.Update() - if i == 0: - blob_image.DeepCopy(thres.GetOutput()) - - max_value = vtkImageMathematics() - max_value.SetInputData(0, blob_image) - max_value.SetInputData(1, thres.GetOutput()) - max_value.SetOperationToMax() - max_value.Modified() - max_value.Update() - - blob_image.DeepCopy(max_value.GetOutput()) - - return blob_image - - -def make_colors(n): - """ - Generate some random colors - :param n: The number of colors. - :return: The lookup table. - """ - - lut = vtkLookupTable() - lut.SetNumberOfColors(n) - lut.SetTableRange(0, n - 1) - lut.SetScaleToLinear() - lut.Build() - lut.SetTableValue(0, 0, 0, 0, 1) - - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(1, n): - r = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - g = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - b = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - lut.SetTableValue(i, r, g, b, 1.0) - - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/Modelling/Spring.py b/data/examples/Modelling/Spring.py deleted file mode 100755 index 44bde94..0000000 --- a/data/examples/Modelling/Spring.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkFiltersModeling import vtkRotationalExtrusionFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the spring profile (a circle). - # - points = vtkPoints() - points.InsertPoint(0, 1.0, 0.0, 0.0) - points.InsertPoint(1, 1.0732, 0.0, -0.1768) - points.InsertPoint(2, 1.25, 0.0, -0.25) - points.InsertPoint(3, 1.4268, 0.0, -0.1768) - points.InsertPoint(4, 1.5, 0.0, 0.00) - points.InsertPoint(5, 1.4268, 0.0, 0.1768) - points.InsertPoint(6, 1.25, 0.0, 0.25) - points.InsertPoint(7, 1.0732, 0.0, 0.1768) - - poly = vtkCellArray() - poly.InsertNextCell(8) # The number of points. - poly.InsertCellPoint(0) - poly.InsertCellPoint(1) - poly.InsertCellPoint(2) - poly.InsertCellPoint(3) - poly.InsertCellPoint(4) - poly.InsertCellPoint(5) - poly.InsertCellPoint(6) - poly.InsertCellPoint(7) - - profile = vtkPolyData() - profile.SetPoints(points) - profile.SetPolys(poly) - - # Extrude the profile to make a spring. - # - extrude = vtkRotationalExtrusionFilter() - extrude.SetInputData(profile) - extrude.SetResolution(360) - extrude.SetTranslation(6) - extrude.SetDeltaRadius(1.0) - extrude.SetAngle(2160.0) # six revolutions - - normals = vtkPolyDataNormals() - normals.SetInputConnection(extrude.GetOutputPort()) - normals.SetFeatureAngle(60) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(normals.GetOutputPort()) - - spring = vtkActor() - spring.SetMapper(mapper) - spring.GetProperty().SetColor(colors.GetColor3d("PowderBlue")) - spring.GetProperty().SetDiffuse(0.7) - spring.GetProperty().SetSpecular(0.4) - spring.GetProperty().SetSpecularPower(20) - spring.GetProperty().BackfaceCullingOn() - - # Add the actors to the renderer, set the background and size. - # - renderer.AddActor(spring) - renderer.SetBackground(colors.GetColor3d("Burlywood")) - renWin.SetSize(640, 512) - renWin.SetWindowName('Spring') - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(90) - - # Render the image. - # - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Picking/CellPicking.md b/data/examples/Picking/CellPicking.md deleted file mode 100644 index 2667372..0000000 --- a/data/examples/Picking/CellPicking.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example demonstrates how to get the coordinates of the point on an actor that is clicked with the left mouse button. It also indicates which cell the selected point belongs to by highlighting the edges of that cell. diff --git a/data/examples/Picking/CellPicking.py b/data/examples/Picking/CellPicking.py deleted file mode 100755 index d291ba0..0000000 --- a/data/examples/Picking/CellPicking.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdTypeArray -from vtkmodules.vtkCommonDataModel import ( - vtkSelection, - vtkSelectionNode, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkTriangleFilter -from vtkmodules.vtkFiltersExtraction import vtkExtractSelection -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCellPicker, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -# Catch mouse events -class MouseInteractorStyle(vtkInteractorStyleTrackballCamera): - def __init__(self, data): - self.AddObserver('LeftButtonPressEvent', self.left_button_press_event) - self.data = data - self.selected_mapper = vtkDataSetMapper() - self.selected_actor = vtkActor() - - def left_button_press_event(self, obj, event): - colors = vtkNamedColors() - - # Get the location of the click (in window coordinates) - pos = self.GetInteractor().GetEventPosition() - - picker = vtkCellPicker() - picker.SetTolerance(0.0005) - - # Pick from this location. - picker.Pick(pos[0], pos[1], 0, self.GetDefaultRenderer()) - - world_position = picker.GetPickPosition() - print(f'Cell id is: {picker.GetCellId()}') - - if picker.GetCellId() != -1: - print(f'Pick position is: ({world_position[0]:.6g}, {world_position[1]:.6g}, {world_position[2]:.6g})') - - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - ids.InsertNextValue(picker.GetCellId()) - - selection_node = vtkSelectionNode() - selection_node.SetFieldType(vtkSelectionNode.CELL) - selection_node.SetContentType(vtkSelectionNode.INDICES) - selection_node.SetSelectionList(ids) - - selection = vtkSelection() - selection.AddNode(selection_node) - - extract_selection = vtkExtractSelection() - extract_selection.SetInputData(0, self.data) - extract_selection.SetInputData(1, selection) - extract_selection.Update() - - # In selection - selected = vtkUnstructuredGrid() - selected.ShallowCopy(extract_selection.GetOutput()) - - print(f'Number of points in the selection: {selected.GetNumberOfPoints()}') - print(f'Number of cells in the selection : {selected.GetNumberOfCells()}') - - self.selected_mapper.SetInputData(selected) - self.selected_actor.SetMapper(self.selected_mapper) - self.selected_actor.GetProperty().EdgeVisibilityOn() - self.selected_actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - self.selected_actor.GetProperty().SetLineWidth(3) - - self.GetInteractor().GetRenderWindow().GetRenderers().GetFirstRenderer().AddActor(self.selected_actor) - - # Forward events - self.OnLeftButtonDown() - - -def main(argv): - colors = vtkNamedColors() - - plane_source = vtkPlaneSource() - plane_source.Update() - - triangle_filter = vtkTriangleFilter() - triangle_filter.SetInputConnection(plane_source.GetOutputPort()) - triangle_filter.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(triangle_filter.GetOutputPort()) - - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('SeaGreen')) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetWindowName('CellPicking') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - renderer.AddActor(actor) - # renderer.ResetCamera() - renderer.SetBackground(colors.GetColor3d('PaleTurquoise')) - - # Add the custom style. - style = MouseInteractorStyle(triangle_filter.GetOutput()) - style.SetDefaultRenderer(renderer) - iren.SetInteractorStyle(style) - - ren_win.Render() - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Picking/HighlightPickedActor.md b/data/examples/Picking/HighlightPickedActor.md deleted file mode 100644 index 12d5556..0000000 --- a/data/examples/Picking/HighlightPickedActor.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Click on a sphere to highlight it. The picked sphere color changes to red, and its EdgeVisibity is On. The example subclasses vtkInteractorStyleTrackballCamera with a local class called **MouseInteractorHighLightActor**. The new interactor overrides the *OnLeftButtonDown* of vtkInteractorStyleTrackballCamera. - -!!! seealso - [HighlightWithSilhouette](../HighlightWithSilhouette) generates a silhouette of the picked actor. diff --git a/data/examples/Picking/HighlightPickedActor.py b/data/examples/Picking/HighlightPickedActor.py deleted file mode 100755 index 4a18a8d..0000000 --- a/data/examples/Picking/HighlightPickedActor.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkMinimalStandardRandomSequence -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropPicker, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -colors = vtkNamedColors() -NUMBER_OF_SPHERES = 10 - - -class MouseInteractorHighLightActor(vtkInteractorStyleTrackballCamera): - - def __init__(self, parent=None): - self.AddObserver("LeftButtonPressEvent", self.leftButtonPressEvent) - - self.LastPickedActor = None - self.LastPickedProperty = vtkProperty() - - def leftButtonPressEvent(self, obj, event): - clickPos = self.GetInteractor().GetEventPosition() - - picker = vtkPropPicker() - picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) - - # get the new - self.NewPickedActor = picker.GetActor() - - # If something was selected - if self.NewPickedActor: - # If we picked something before, reset its property - if self.LastPickedActor: - self.LastPickedActor.GetProperty().DeepCopy(self.LastPickedProperty) - - # Save the property of the picked actor so that we can - # restore it next time - self.LastPickedProperty.DeepCopy(self.NewPickedActor.GetProperty()) - # Highlight the picked actor by changing its properties - self.NewPickedActor.GetProperty().SetColor(colors.GetColor3d('Red')) - self.NewPickedActor.GetProperty().SetDiffuse(1.0) - self.NewPickedActor.GetProperty().SetSpecular(0.0) - self.NewPickedActor.GetProperty().EdgeVisibilityOn() - - # save the last picked actor - self.LastPickedActor = self.NewPickedActor - - self.OnLeftButtonDown() - return - - -def main(): - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SteelBlue')) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetSize(640, 480) - renwin.SetWindowName('HighlightPickedActor') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # add the custom style - style = MouseInteractorHighLightActor() - style.SetDefaultRenderer(renderer) - interactor.SetInteractorStyle(style) - - randomSequence = vtkMinimalStandardRandomSequence() - # randomSequence.SetSeed(1043618065) - # randomSequence.SetSeed(5170) - randomSequence.SetSeed(8775070) - # Add spheres to play with - for i in range(NUMBER_OF_SPHERES): - source = vtkSphereSource() - - # random position and radius - x = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - y = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - z = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - radius = randomSequence.GetRangeValue(0.5, 1.0) - randomSequence.Next() - - source.SetRadius(radius) - source.SetCenter(x, y, z) - source.SetPhiResolution(11) - source.SetThetaResolution(21) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - - r = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - g = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - b = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - - actor.GetProperty().SetDiffuseColor(r, g, b) - actor.GetProperty().SetDiffuse(.8) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecularPower(30.0) - - renderer.AddActor(actor) - - # Start - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Picking/HighlightWithSilhouette.md b/data/examples/Picking/HighlightWithSilhouette.md deleted file mode 100644 index e3dfaae..0000000 --- a/data/examples/Picking/HighlightWithSilhouette.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Click on a sphere to highlight it. vtkPolyDataSilhoutte creates a silhouette of the picked vtkActor. The example subclasses vtkInteractorStyleTrackballCamera with a local class called **MouseInteractorHighLightActor**. The new interactor overrides the *OnLeftButtonDown* of vtkInteractorStyleTrackballCamera. - -[Watch this video](https://www.youtube.com/watch?v=ATjYDzk9llk) showing the picking of several spheres. - -!!! seealso - **HighlightPickedActor** [C++](../../../Cxx/Picking/HighlightPickedActor) or [Python](../HighlightPickedActor) where the color and edge visibility of the picked actor is changed. diff --git a/data/examples/Picking/HighlightWithSilhouette.py b/data/examples/Picking/HighlightWithSilhouette.py deleted file mode 100755 index 337a145..0000000 --- a/data/examples/Picking/HighlightWithSilhouette.py +++ /dev/null @@ -1,161 +0,0 @@ -# !/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkMinimalStandardRandomSequence -from vtkmodules.vtkFiltersHybrid import vtkPolyDataSilhouette -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropPicker, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Highlighting a selected object with a silhouette.' - epilogue = ''' -Click on the object to highlight it. -The selected object is highlighted with a silhouette. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('numberOfSpheres', nargs='?', type=int, default=10, - help='The number of spheres, default is 10.') - args = parser.parse_args() - return args.numberOfSpheres - - -class MouseInteractorHighLightActor(vtkInteractorStyleTrackballCamera): - - def __init__(self, silhouette=None, silhouetteActor=None): - self.AddObserver("LeftButtonPressEvent", self.onLeftButtonDown) - self.LastPickedActor = None - self.Silhouette = silhouette - self.SilhouetteActor = silhouetteActor - - def onLeftButtonDown(self, obj, event): - clickPos = self.GetInteractor().GetEventPosition() - - # Pick from this location. - picker = vtkPropPicker() - picker.Pick(clickPos[0], clickPos[1], 0, self.GetDefaultRenderer()) - self.LastPickedActor = picker.GetActor() - - # If we picked something before, remove the silhouette actor and - # generate a new one. - if self.LastPickedActor: - self.GetDefaultRenderer().RemoveActor(self.SilhouetteActor) - - # Highlight the picked actor by generating a silhouette - self.Silhouette.SetInputData(self.LastPickedActor.GetMapper().GetInput()) - self.GetDefaultRenderer().AddActor(self.SilhouetteActor) - - # Forward events - self.OnLeftButtonDown() - return - - def SetSilhouette(self, silhouette): - self.Silhouette = silhouette - - def SetSilhouetteActor(self, silhouetteActor): - self.SilhouetteActor = silhouetteActor - - -def main(): - numberOfSpheres = get_program_parameters() - colors = vtkNamedColors() - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SteelBlue')) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(640, 480) - renderWindow.AddRenderer(renderer) - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - randomSequence = vtkMinimalStandardRandomSequence() - # randomSequence.SetSeed(1043618065) - # randomSequence.SetSeed(5170) - randomSequence.SetSeed(8775070) - # Add spheres to play with - for i in range(numberOfSpheres): - source = vtkSphereSource() - - # random position and radius - x = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - y = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - z = randomSequence.GetRangeValue(-5.0, 5.0) - randomSequence.Next() - radius = randomSequence.GetRangeValue(0.5, 1.0) - randomSequence.Next() - - source.SetRadius(radius) - source.SetCenter(x, y, z) - source.SetPhiResolution(11) - source.SetThetaResolution(21) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - - r = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - g = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - b = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - - actor.GetProperty().SetDiffuseColor(r, g, b) - actor.GetProperty().SetDiffuse(0.8) - actor.GetProperty().SetSpecular(0.5) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecularPower(30.0) - - renderer.AddActor(actor) - - # Render and interact - renderWindow.Render() - - # Create the silhouette pipeline, the input data will be set in the - # interactor - silhouette = vtkPolyDataSilhouette() - silhouette.SetCamera(renderer.GetActiveCamera()) - - # Create mapper and actor for silhouette - silhouetteMapper = vtkPolyDataMapper() - silhouetteMapper.SetInputConnection(silhouette.GetOutputPort()) - - silhouetteActor = vtkActor() - silhouetteActor.SetMapper(silhouetteMapper) - silhouetteActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - silhouetteActor.GetProperty().SetLineWidth(5) - - # Set the custom type to use for interaction. - style = MouseInteractorHighLightActor(silhouette, silhouetteActor) - style.SetDefaultRenderer(renderer) - - # Start - interactor.Initialize() - interactor.SetInteractorStyle(style) - renderWindow.SetWindowName('HighlightWithSilhouette') - renderWindow.Render() - - interactor.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/Plotting/MultiplePlots.md b/data/examples/Plotting/MultiplePlots.md deleted file mode 100644 index 55ab1d6..0000000 --- a/data/examples/Plotting/MultiplePlots.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -Display multiple plots by using viewports in a single render window. - -In this case, we display two graphs side-by-side. - -The difference between setting a background in the renderer and setting the chart background is shown. - -!!! Note - This example was prompted by this discussion [vtk chart background shifted towards origin](https://discourse.vtk.org/t/vtk-chart-background-shifted-towards-origin/5890). diff --git a/data/examples/Plotting/MultiplePlots.py b/data/examples/Plotting/MultiplePlots.py deleted file mode 100755 index b3664d8..0000000 --- a/data/examples/Plotting/MultiplePlots.py +++ /dev/null @@ -1,148 +0,0 @@ -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkChartsCore import ( - vtkAxis, - vtkChart, - vtkChartXY, - vtkPlotPoints -) -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import vtkTable -from vtkmodules.vtkRenderingContext2D import ( - vtkContextActor, - vtkContextScene -) -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - renwin = vtkRenderWindow() - renwin.SetWindowName('MultiplePlots') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renwin) - - # Setup the viewports - grid_dimensions_x = 2 - grid_dimensions_y = 1 - renderer_sz_x = 320 - renderer_sz_y = 240 - renwin.SetSize(renderer_sz_x * grid_dimensions_x, renderer_sz_y * grid_dimensions_y) - - viewports = list() - for row in range(0, grid_dimensions_y): - for col in range(0, grid_dimensions_x): - # index = row * grid_dimensions_x + col - - # (xmin, ymin, xmax, ymax) - viewports.append([float(col) / grid_dimensions_x, - float(grid_dimensions_y - (row + 1)) / grid_dimensions_y, - float(col + 1) / grid_dimensions_x, - float(grid_dimensions_y - row) / grid_dimensions_y]) - - # Link the renderers to the viewports. - left_renderer = vtkRenderer() - left_renderer.SetBackground(colors.GetColor3d('AliceBlue')) - left_renderer.SetViewport(viewports[0]) - renwin.AddRenderer(left_renderer) - - right_renderer = vtkRenderer() - right_renderer.SetBackground(colors.GetColor3d('Lavender')) - right_renderer.SetViewport(viewports[1]) - renwin.AddRenderer(right_renderer) - - # Create the charts. - left_chart = vtkChartXY() - left_chart_scene = vtkContextScene() - left_chart_actor = vtkContextActor() - - left_chart_scene.AddItem(left_chart) - left_chart_actor.SetScene(left_chart_scene) - - left_renderer.AddActor(left_chart_actor) - left_chart_scene.SetRenderer(left_renderer) - - x_axis = left_chart.GetAxis(vtkAxis.BOTTOM) - x_axis.GetGridPen().SetColor(colors.GetColor4ub("LightGrey")) - x_axis.SetTitle('x') - y_axis = left_chart.GetAxis(vtkAxis.LEFT) - y_axis.GetGridPen().SetColor(colors.GetColor4ub("LightGrey")) - y_axis.SetTitle('cos(x)') - left_chart.GetBackgroundBrush().SetColorF(*colors.GetColor4d('MistyRose')) - left_chart.GetBackgroundBrush().SetOpacityF(0.4) - left_chart.SetTitle('Cosine') - - right_chart = vtkChartXY() - right_chart_scene = vtkContextScene() - right_chart_actor = vtkContextActor() - - right_chart_scene.AddItem(right_chart) - right_chart_actor.SetScene(right_chart_scene) - - right_renderer.AddActor(right_chart_actor) - right_chart_scene.SetRenderer(right_renderer) - - x_axis = right_chart.GetAxis(vtkAxis.BOTTOM) - x_axis.GetGridPen().SetColor(colors.GetColor4ub("LightCyan")) - x_axis.SetTitle('x') - y_axis = right_chart.GetAxis(vtkAxis.LEFT) - y_axis.GetGridPen().SetColor(colors.GetColor4ub("LightCyan")) - y_axis.SetTitle('sin(x)') - right_chart.GetBackgroundBrush().SetColorF(*colors.GetColor4d('Thistle')) - right_chart.GetBackgroundBrush().SetOpacityF(0.4) - right_chart.SetTitle('Sine') - - # Create the data. - table = vtkTable() - array_x = vtkFloatArray() - array_x.SetName('X Axis') - table.AddColumn(array_x) - - array_cos = vtkFloatArray() - array_cos.SetName('Cosine') - table.AddColumn(array_cos) - - array_sin = vtkFloatArray() - array_sin.SetName('Sine') - table.AddColumn(array_sin) - - # Fill in the table with some example values. - num_points = 40 - inc = 7.5 / (num_points - 1.0) - table.SetNumberOfRows(num_points) - for i in range(num_points): - table.SetValue(i, 0, i * inc) - table.SetValue(i, 1, math.cos(i * inc)) - table.SetValue(i, 2, math.sin(i * inc)) - - points = left_chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 1) - points.SetColor(*colors.GetColor4ub('Black')) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CROSS) - - points = right_chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 2) - points.SetColor(*colors.GetColor4ub('Black')) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.PLUS) - - renwin.Render() - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Plotting/ScatterPlot.py b/data/examples/Plotting/ScatterPlot.py deleted file mode 100755 index 008cf64..0000000 --- a/data/examples/Plotting/ScatterPlot.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkChartsCore import ( - vtkChart, - vtkChartXY, - vtkPlotPoints -) -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import vtkTable -from vtkmodules.vtkViewsContext2D import vtkContextView - - -def main(): - colors = vtkNamedColors() - - view = vtkContextView() - view.GetRenderer().SetBackground(colors.GetColor3d('SlateGray')) - view.GetRenderWindow().SetSize(400, 300) - - chart = vtkChartXY() - view.GetScene().AddItem(chart) - chart.SetShowLegend(True) - - table = vtkTable() - - arrX = vtkFloatArray() - arrX.SetName('X Axis') - - arrC = vtkFloatArray() - arrC.SetName('Cosine') - - arrS = vtkFloatArray() - arrS.SetName('Sine') - - arrT = vtkFloatArray() - arrT.SetName('Sine-Cosine') - - table.AddColumn(arrC) - table.AddColumn(arrS) - table.AddColumn(arrX) - table.AddColumn(arrT) - - numPoints = 40 - - inc = 7.5 / (numPoints - 1) - table.SetNumberOfRows(numPoints) - for i in range(numPoints): - table.SetValue(i, 0, i * inc) - table.SetValue(i, 1, math.cos(i * inc)) - table.SetValue(i, 2, math.sin(i * inc)) - table.SetValue(i, 3, math.sin(i * inc) - math.cos(i * inc)) - - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 1) - points.SetColor(0, 0, 0, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CROSS) - - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 2) - points.SetColor(0, 0, 0, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.PLUS) - - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 3) - points.SetColor(0, 0, 255, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CIRCLE) - - view.GetRenderWindow().SetMultiSamples(0) - view.GetRenderWindow().SetWindowName('ScatterPlot') - view.GetInteractor().Initialize() - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Plotting/SpiderPlot.md b/data/examples/Plotting/SpiderPlot.md deleted file mode 100644 index 428cc0e..0000000 --- a/data/examples/Plotting/SpiderPlot.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -A spider plot is used to display multivariate data. See [this wikipedia article](https://en.wikipedia.org/wiki/Radar_chart) for more information. diff --git a/data/examples/Plotting/SpiderPlot.py b/data/examples/Plotting/SpiderPlot.py deleted file mode 100755 index cc2e644..0000000 --- a/data/examples/Plotting/SpiderPlot.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkMinimalStandardRandomSequence -) -from vtkmodules.vtkCommonDataModel import vtkDataObject -from vtkmodules.vtkRenderingAnnotation import vtkSpiderPlotActor -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - numTuples = 12 - - bitter = vtkFloatArray() - bitter.SetNumberOfTuples(numTuples) - - crispy = vtkFloatArray() - crispy.SetNumberOfTuples(numTuples) - - crunchy = vtkFloatArray() - crunchy.SetNumberOfTuples(numTuples) - - salty = vtkFloatArray() - salty.SetNumberOfTuples(numTuples) - - oily = vtkFloatArray() - oily.SetNumberOfTuples(numTuples) - - rand_seq = vtkMinimalStandardRandomSequence() - rand_seq.SetSeed(8775070) - - for i in range(numTuples): - bitter.SetTuple1(i, rand_seq.GetRangeValue(1, 10)) - rand_seq.Next() - crispy.SetTuple1(i, rand_seq.GetRangeValue(-1, 1)) - rand_seq.Next() - crunchy.SetTuple1(i, rand_seq.GetRangeValue(1, 100)) - rand_seq.Next() - salty.SetTuple1(i, rand_seq.GetRangeValue(0, 10)) - rand_seq.Next() - oily.SetTuple1(i, rand_seq.GetRangeValue(5, 25)) - rand_seq.Next() - - dobj = vtkDataObject() - dobj.GetFieldData().AddArray(bitter) - dobj.GetFieldData().AddArray(crispy) - dobj.GetFieldData().AddArray(crunchy) - dobj.GetFieldData().AddArray(salty) - dobj.GetFieldData().AddArray(oily) - - actor = vtkSpiderPlotActor() - actor.SetInputData(dobj) - actor.SetTitle("Spider Plot") - actor.SetIndependentVariablesToColumns() - actor.GetPositionCoordinate().SetValue(0.05, 0.1, 0.0) - actor.GetPosition2Coordinate().SetValue(0.95, 0.85, 0.0) - actor.GetProperty().SetColor(colors.GetColor3d('Red')) - - actor.SetAxisLabel(0, "Bitter") - actor.SetAxisRange(0, 1, 10) - - actor.SetAxisLabel(1, "Crispy") - actor.SetAxisRange(1, -1, 1) - - actor.SetAxisLabel(2, "Crunchy") - actor.SetAxisRange(2, 1, 100) - - actor.SetAxisLabel(3, "Salty") - actor.SetAxisRange(3, 0, 10) - - actor.SetAxisLabel(4, "Oily") - actor.SetAxisRange(4, 5, 25) - actor.GetLegendActor().SetNumberOfEntries(numTuples) - - for i in range(numTuples): - r = rand_seq.GetRangeValue(0.4, 1.0) - rand_seq.Next() - g = rand_seq.GetRangeValue(0.4, 1.0) - rand_seq.Next() - b = rand_seq.GetRangeValue(0.4, 1.0) - rand_seq.Next() - actor.SetPlotColor(i, r, g, b) - - actor.LegendVisibilityOn() - - actor.GetTitleTextProperty().SetColor(colors.GetColor3d('MistyRose')) - actor.GetLabelTextProperty().SetColor(colors.GetColor3d('MistyRose')) - - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - ren1.AddActor(actor) - ren1.SetBackground(colors.GetColor3d('DarkSlateGray')) - renWin.SetSize(600, 500) - renWin.SetWindowName('SpiderPlot') - - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Plotting/SurfacePlot.py b/data/examples/Plotting/SurfacePlot.py deleted file mode 100755 index 8b5282f..0000000 --- a/data/examples/Plotting/SurfacePlot.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -from math import sin, sqrt - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingContextOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkChartsCore import ( - vtkChartXYZ, - vtkPlotSurface -) -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkFloatArray -from vtkmodules.vtkCommonDataModel import ( - vtkRectf, - vtkTable, - vtkVector2i -) -from vtkmodules.vtkRenderingContext2D import vtkContextMouseEvent -from vtkmodules.vtkViewsContext2D import vtkContextView - - -def main(): - colors = vtkNamedColors() - - chart = vtkChartXYZ() - chart.SetGeometry(vtkRectf(10.0, 10.0, 630, 470)) - - plot = vtkPlotSurface() - - view = vtkContextView() - view.GetRenderer().SetBackground(colors.GetColor3d("Silver")) - view.GetRenderWindow().SetSize(640, 480) - view.GetScene().AddItem(chart) - - # Create a surface - table = vtkTable() - numPoints = 70 - inc = 9.424778 / (numPoints - 1) - for i in range(numPoints): - arr = vtkFloatArray() - table.AddColumn(arr) - - table.SetNumberOfRows(numPoints) - for i in range(numPoints): - x = i * inc - for j in range(numPoints): - y = j * inc - table.SetValue(i, j, sin(sqrt(x * x + y * y))) - - # Set up the surface plot we wish to visualize and add it to the chart - plot.SetXRange(0, 10.0) - plot.SetYRange(0, 10.0) - plot.SetInputData(table) - plot.GetPen().SetColorF(colors.GetColor3d("Tomato")) - chart.AddPlot(plot) - - view.GetRenderWindow().SetMultiSamples(0) - view.GetInteractor().Initialize() - view.GetRenderWindow().SetWindowName("SurfacePlot") - view.GetRenderWindow().Render() - - # Rotate - mouseEvent = vtkContextMouseEvent() - mouseEvent.SetInteractor(view.GetInteractor()) - - pos = vtkVector2i() - - lastPos = vtkVector2i() - mouseEvent.SetButton(vtkContextMouseEvent.LEFT_BUTTON) - lastPos.Set(100, 50) - mouseEvent.SetLastScreenPos(lastPos) - pos.Set(150, 100) - mouseEvent.SetScreenPos(pos) - - sP = [float(x) for x in pos] - lSP = [float(x) for x in lastPos] - screenPos = [float(x) for x in mouseEvent.GetScreenPos()] - lastScreenPos = [float(x) for x in mouseEvent.GetLastScreenPos()] - - chart.MouseMoveEvent(mouseEvent) - - view.GetInteractor().Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/AlignTwoPolyDatas.md b/data/examples/PolyData/AlignTwoPolyDatas.md deleted file mode 100644 index dac7a11..0000000 --- a/data/examples/PolyData/AlignTwoPolyDatas.md +++ /dev/null @@ -1,23 +0,0 @@ -### Description - -This example shows how to align two vtkPolyData's. Typically, the two datasets are related. For example, aligning a CT head isosurface with an MRI head isosurface of the same patient. Or two steps in a time series of an evolving surface. These cases usually reside in the same coordinate system, and the initial alignment is "close" to the desired results. - -Another case is when the two datasets are from the "same" family of objects - for example, running the example with two types of sharks that exist in different coordinate systems. - -The algorithm proceeds as follows: - -1. Read the two vtkPolyData's that exist in the example's command line. The first file contains the source vtkPolyData to be aligned with the second file's vtkPolyData called the target. Another naming convention is moving and fixed. - -2. Compute a measure of fit of the two original files. We use the recently added vtkHausdorffDistancePointSetFilter to compute the measure. See [Hausdorff Distance](https://en.wikipedia.org/wiki/Hausdorff_distance). - -3. Align the bounding boxes of the two datasets. Here we use a vtkOBBTree locator to create oriented bounding boxes. See [Oriented Bounding Boxes](https://en.wikipedia.org/wiki/Minimum_bounding_box). Use the bounding box corner coordinates to create source and target vtkLandmarkTransform's. vtkTransformPolyData uses this transform to create a new source vtkPolyData. Since the orientations of the bounding boxes may differ, the AlignBoundingBoxes function tries ten different rotations. For each rotation, it computes the Hausdorff distance between the target's OBB corners and the transformed source's OBB corners. Finally, transform the original source using the smallest distance. - -4. Improve the alignment with vtkIterativeClosestPointTransform with a RigidBody transform. Compute the distance metric again. - -5. Display the source and target vtkPolyData's with the transform that has the best distance metric. - -!!! info - The example is run with `src/Testing/Data/thingiverse/Grey_Nurse_Shark.stl` and `src/Testing/Data/greatWhite.stl`, in this case, we reorient the target using a rotation. vtkTransformPolyDataFilter is used to get a better fit in this case. - -!!! info - If example is run with `src/Testing/Data/thingiverse/Grey_Nurse_Shark.stl` and `src/Testing/Data/shark.ply` the fit is really poor and the Iterative Closest Point algotithm fails. So we fallback and use oriented bounding boxes. diff --git a/data/examples/PolyData/AlignTwoPolyDatas.py b/data/examples/PolyData/AlignTwoPolyDatas.py deleted file mode 100755 index 660b854..0000000 --- a/data/examples/PolyData/AlignTwoPolyDatas.py +++ /dev/null @@ -1,416 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import math -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_DOUBLE_MAX, - vtkPoints -) -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - vtkIterativeClosestPointTransform, - vtkPolyData -) -from vtkmodules.vtkCommonTransforms import ( - vtkLandmarkTransform, - vtkTransform -) -from vtkmodules.vtkFiltersGeneral import ( - vtkOBBTree, - vtkTransformPolyDataFilter -) -from vtkmodules.vtkFiltersModeling import vtkHausdorffDistancePointSetFilter -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import ( - vtkPolyDataReader, - vtkPolyDataWriter - ) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'How to align two vtkPolyData\'s.' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('src_fn', help='The polydata source file name,e.g. thingiverse/Grey_Nurse_Shark.stl.') - parser.add_argument('tgt_fn', help='The polydata target file name, e.g. greatWhite.stl.') - - args = parser.parse_args() - - return args.src_fn, args.tgt_fn - - -def main(): - colors = vtkNamedColors() - - src_fn, tgt_fn = get_program_parameters() - print('Loading source:', src_fn) - source_polydata = read_poly_data(src_fn) - # Save the source polydata in case the alignment process does not improve - # segmentation. - original_source_polydata = vtkPolyData() - original_source_polydata.DeepCopy(source_polydata) - - print('Loading target:', tgt_fn) - target_polydata = read_poly_data(tgt_fn) - - # If the target orientation is markedly different, you may need to apply a - # transform to orient the target with the source. - # For example, when using Grey_Nurse_Shark.stl as the source and - # greatWhite.stl as the target, you need to transform the target. - trnf = vtkTransform() - if Path(src_fn).name == 'Grey_Nurse_Shark.stl' and Path(tgt_fn).name == 'greatWhite.stl': - trnf.RotateY(90) - - tpd = vtkTransformPolyDataFilter() - tpd.SetTransform(trnf) - tpd.SetInputData(target_polydata) - tpd.Update() - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - distance = vtkHausdorffDistancePointSetFilter() - distance.SetInputData(0, tpd.GetOutput()) - distance.SetInputData(1, source_polydata) - distance.Update() - - distance_before_align = distance.GetOutput(0).GetFieldData().GetArray('HausdorffDistance').GetComponent(0, 0) - - # Get initial alignment using oriented bounding boxes. - align_bounding_boxes(source_polydata, tpd.GetOutput()) - - distance.SetInputData(0, tpd.GetOutput()) - distance.SetInputData(1, source_polydata) - distance.Modified() - distance.Update() - distance_after_align = distance.GetOutput(0).GetFieldData().GetArray('HausdorffDistance').GetComponent(0, 0) - - best_distance = min(distance_before_align, distance_after_align) - - if distance_after_align > distance_before_align: - source_polydata.DeepCopy(original_source_polydata) - - # Refine the alignment using IterativeClosestPoint. - icp = vtkIterativeClosestPointTransform() - icp.SetSource(source_polydata) - icp.SetTarget(tpd.GetOutput()) - icp.GetLandmarkTransform().SetModeToRigidBody() - icp.SetMaximumNumberOfLandmarks(100) - icp.SetMaximumMeanDistance(.00001) - icp.SetMaximumNumberOfIterations(500) - icp.CheckMeanDistanceOn() - icp.StartByMatchingCentroidsOn() - icp.Update() - icp_mean_distance = icp.GetMeanDistance() - - # print(icp) - - lm_transform = icp.GetLandmarkTransform() - transform = vtkTransformPolyDataFilter() - transform.SetInputData(source_polydata) - transform.SetTransform(lm_transform) - transform.SetTransform(icp) - transform.Update() - - distance.SetInputData(0, tpd.GetOutput()) - distance.SetInputData(1, transform.GetOutput()) - distance.Update() - - # Note: If there is an error extracting eigenfunctions, then this will be zero. - distance_after_icp = distance.GetOutput(0).GetFieldData().GetArray('HausdorffDistance').GetComponent(0, 0) - - # Check if ICP worked. - if not (math.isnan(icp_mean_distance) or math.isinf(icp_mean_distance)): - if distance_after_icp < best_distance: - best_distance = distance_after_icp - - print('Distances:') - print(' Before aligning: {:0.5f}'.format(distance_before_align)) - print(' Aligning using oriented bounding boxes: {:0.5f}'.format(distance_before_align)) - print(' Aligning using IterativeClosestPoint: {:0.5f}'.format(distance_after_icp)) - print(' Best distance: {:0.5f}'.format(best_distance)) - - # Select the source to use. - source_mapper = vtkDataSetMapper() - if best_distance == distance_before_align: - source_mapper.SetInputData(original_source_polydata) - print('Using original alignment') - elif best_distance == distance_after_align: - source_mapper.SetInputData(source_polydata) - print('Using alignment by OBB') - else: - source_mapper.SetInputConnection(transform.GetOutputPort()) - print('Using alignment by ICP') - source_mapper.ScalarVisibilityOff() - - - writer = vtkPolyDataWriter() - if best_distance == distance_before_align: - writer.SetInputData(original_source_polydata) - elif best_distance == distance_after_align: - writer.SetInputData(source_polydata) - else: - writer.SetInputData(transform.GetOutput()) - writer.SetFileName('AlignedSource.vtk') - writer.Write() - writer.SetInputData(tpd.GetOutput()) - writer.SetFileName('Target.vtk') - writer.Write() - - source_actor = vtkActor() - source_actor.SetMapper(source_mapper) - source_actor.GetProperty().SetOpacity(0.6) - source_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('White')) - renderer.AddActor(source_actor) - - target_mapper = vtkDataSetMapper() - target_mapper.SetInputData(tpd.GetOutput()) - target_mapper.ScalarVisibilityOff() - - target_actor = vtkActor() - target_actor.SetMapper(target_mapper) - target_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('Tomato')) - renderer.AddActor(target_actor) - - render_window.AddRenderer(renderer) - renderer.SetBackground(colors.GetColor3d("sea_green_light")) - renderer.UseHiddenLineRemovalOn() - - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - render_window.SetSize(640, 480) - render_window.Render() - render_window.SetWindowName('AlignTwoPolyDatas') - - interactor.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def read_poly_data(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == ".ply": - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtp": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".obj": - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".stl": - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtk": - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".g": - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def align_bounding_boxes(source, target): - # Use OBBTree to create an oriented bounding box for target and source - source_obb_tree = vtkOBBTree() - source_obb_tree.SetDataSet(source) - source_obb_tree.SetMaxLevel(1) - source_obb_tree.BuildLocator() - - target_obb_tree = vtkOBBTree() - target_obb_tree.SetDataSet(target) - target_obb_tree.SetMaxLevel(1) - target_obb_tree.BuildLocator() - - source_landmarks = vtkPolyData() - source_obb_tree.GenerateRepresentation(0, source_landmarks) - - target_landmarks = vtkPolyData() - target_obb_tree.GenerateRepresentation(0, target_landmarks) - - lm_transform = vtkLandmarkTransform() - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - best_distance = VTK_DOUBLE_MAX - best_points = vtkPoints() - best_distance = best_bounding_box( - "X", - target, - source, - target_landmarks, - source_landmarks, - best_distance, - best_points) - best_distance = best_bounding_box( - "Y", - target, - source, - target_landmarks, - source_landmarks, - best_distance, - best_points) - best_distance = best_bounding_box( - "Z", - target, - source, - target_landmarks, - source_landmarks, - best_distance, - best_points) - - lm_transform.SetSourceLandmarks(best_points) - lm_transform.Modified() - - lm_transform_pd = vtkTransformPolyDataFilter() - lm_transform_pd.SetInputData(source) - lm_transform_pd.SetTransform(lm_transform) - lm_transform_pd.Update() - - source.DeepCopy(lm_transform_pd.GetOutput()) - - return - - -def best_bounding_box(axis, target, source, target_landmarks, source_landmarks, best_distance, best_points): - distance = vtkHausdorffDistancePointSetFilter() - test_transform = vtkTransform() - test_transform_pd = vtkTransformPolyDataFilter() - lm_transform = vtkLandmarkTransform() - lm_transform_pd = vtkTransformPolyDataFilter() - - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - - source_center = source_landmarks.GetCenter() - - delta = 90.0 - for i in range(0, 4): - angle = delta * i - # Rotate about center - test_transform.Identity() - test_transform.Translate(source_center[0], source_center[1], source_center[2]) - if axis == "X": - test_transform.RotateX(angle) - elif axis == "Y": - test_transform.RotateY(angle) - else: - test_transform.RotateZ(angle) - test_transform.Translate(-source_center[0], -source_center[1], -source_center[2]) - - test_transform_pd.SetTransform(test_transform) - test_transform_pd.SetInputData(source_landmarks) - test_transform_pd.Update() - - lm_transform.SetSourceLandmarks(test_transform_pd.GetOutput().GetPoints()) - lm_transform.Modified() - - lm_transform_pd.SetInputData(source) - lm_transform_pd.SetTransform(lm_transform) - lm_transform_pd.Update() - - distance.SetInputData(0, target) - distance.SetInputData(1, lm_transform_pd.GetOutput()) - distance.Update() - - test_distance = distance.GetOutput(0).GetFieldData().GetArray("HausdorffDistance").GetComponent(0, 0) - if test_distance < best_distance: - best_distance = test_distance - best_points.DeepCopy(test_transform_pd.GetOutput().GetPoints()) - - return best_distance - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/BooleanOperationPolyDataFilter.md b/data/examples/PolyData/BooleanOperationPolyDataFilter.md deleted file mode 100644 index 48edd46..0000000 --- a/data/examples/PolyData/BooleanOperationPolyDataFilter.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -The vtkBooleanOperationPolyDataFilter works best with "clean" data, so this examples first runs vtkTriangleFilter and then vtkCleanPolyData. - -This example can be run in three ways: - -1. *BooleanOperationPolyDataFilter* - Computes the intersection of two spheres -2. *BooleanOperationPolyDataFilter* **-o intersection|difference|union** - Computes the intersection(difference or union) of two spheres -3. *BooleanOperationPolyDataFilter* **-o intersection|difference|union input1.vtk input2.vtk** - Computes the intersection(difference or union) of two vtkPolyData's - -!!! cite - See [Boolean Operations on Surfaces in VTK Without External Libraries](http://www.vtkjournal.org/browse/publication/797) for details on the algorithm. - -!!! seealso - [LoopBooleanPolyDataFilter](../LoopBooleanPolyDataFilter), it uses an alternative algorithm to do the boolean operations. diff --git a/data/examples/PolyData/BooleanOperationPolyDataFilter.py b/data/examples/PolyData/BooleanOperationPolyDataFilter.py deleted file mode 100755 index 10a0fb6..0000000 --- a/data/examples/PolyData/BooleanOperationPolyDataFilter.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import vtkBooleanOperationPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'How to align two vtkPolyData\'s.' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('-o', '--operation', nargs='?', default='intersection', help='The type of ') - parser.add_argument('fn1', nargs='?', default=None, help='The polydata source file name,e.g. Grey_Nurse_Shark.stl.') - parser.add_argument('fn2', nargs='?', default=None, help='The polydata target file name, e.g. shark.ply.') - - args = parser.parse_args() - - return args.operation, args.fn1, args.fn2 - - -def main(): - colors = vtkNamedColors() - - operation, fn1, fn2 = get_program_parameters() - if fn1 and fn2: - poly1 = ReadPolyData(fn1) - tri1 = vtkTriangleFilter() - tri1.SetInputData(poly1) - clean1 = vtkCleanPolyData() - clean1.SetInputConnection(tri1.GetOutputPort()) - clean1.Update() - input1 = clean1.GetOutput() - - poly2 = ReadPolyData(fn2) - tri2 = vtkTriangleFilter() - tri2.SetInputData(poly2) - tri2.Update() - clean2 = vtkCleanPolyData() - clean2.SetInputConnection(tri2.GetOutputPort()) - clean2.Update() - input2 = clean2.GetOutput() - else: - sphereSource1 = vtkSphereSource() - sphereSource1.SetCenter(0.25, 0, 0) - sphereSource1.SetPhiResolution(21) - sphereSource1.SetThetaResolution(21) - sphereSource1.Update() - input1 = sphereSource1.GetOutput() - - sphereSource2 = vtkSphereSource() - sphereSource2.Update() - input2 = sphereSource2.GetOutput() - - input1Mapper = vtkPolyDataMapper() - input1Mapper.SetInputData(input1) - input1Mapper.ScalarVisibilityOff() - input1Actor = vtkActor() - input1Actor.SetMapper(input1Mapper) - input1Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - input1Actor.GetProperty().SetSpecular(0.6) - input1Actor.GetProperty().SetSpecularPower(20) - input1Actor.SetPosition(input1.GetBounds()[1] - input1.GetBounds()[0], 0, 0) - - input2Mapper = vtkPolyDataMapper() - input2Mapper.SetInputData(input2) - input2Mapper.ScalarVisibilityOff() - input2Actor = vtkActor() - input2Actor.SetMapper(input2Mapper) - input2Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Mint')) - input2Actor.GetProperty().SetSpecular(0.6) - input2Actor.GetProperty().SetSpecularPower(20) - input2Actor.SetPosition(-(input1.GetBounds()[1] - input1.GetBounds()[0]), 0, 0) - - booleanOperation = vtkBooleanOperationPolyDataFilter() - if operation.lower() == 'union': - booleanOperation.SetOperationToUnion() - elif operation.lower() == 'intersection': - booleanOperation.SetOperationToIntersection() - elif operation.lower() == 'difference': - booleanOperation.SetOperationToDifference() - else: - print('Unknown operation:', operation) - return - - booleanOperation.SetInputData(0, input1) - booleanOperation.SetInputData(1, input2) - - booleanOperationMapper = vtkPolyDataMapper() - booleanOperationMapper.SetInputConnection(booleanOperation.GetOutputPort()) - booleanOperationMapper.ScalarVisibilityOff() - - booleanOperationActor = vtkActor() - booleanOperationActor.SetMapper(booleanOperationMapper) - booleanOperationActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - booleanOperationActor.GetProperty().SetSpecular(0.6) - booleanOperationActor.GetProperty().SetSpecularPower(20) - - renderer = vtkRenderer() - renderer.AddViewProp(input1Actor) - renderer.AddViewProp(input2Actor) - renderer.AddViewProp(booleanOperationActor) - renderer.SetBackground(colors.GetColor3d('Silver')) - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('BooleanOperationPolyDataFilter') - - viewUp = [0.0, 0.0, 1.0] - position = [0.0, -1.0, 0.0] - PositionCamera(renderer, viewUp, position) - renderer.GetActiveCamera().Dolly(1.4) - renderer.ResetCameraClippingRange() - - renWinInteractor = vtkRenderWindowInteractor() - renWinInteractor.SetRenderWindow(renderWindow) - - renderWindow.Render() - renWinInteractor.Start() - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def PositionCamera(renderer, viewUp, position): - renderer.GetActiveCamera().SetViewUp(viewUp) - renderer.GetActiveCamera().SetPosition(position) - renderer.ResetCamera() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/CellsInsideObject.md b/data/examples/PolyData/CellsInsideObject.md deleted file mode 100644 index 013edf4..0000000 --- a/data/examples/PolyData/CellsInsideObject.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example illustrates how to extract the cells that exist inside a closed surface. -It uses vtkSelectEnclosedPoints to mark points that are inside and outside the surface. vtkMultiThreshold is used to extract the three meshes into three vtkMultiBlockDataSet's. The cells completely outside are shown in crimson, completely inside are yellow and border cells are green. A translucent copy of the closed surface helps illustrate the selection process. - -If two polydata datasets are provided, the example uses the second as the closed surface. If only one dataset is provided, the closed surface is generated by rotating the first dataset by 90 degrees around its Y axis. - -!!! info - The example is run with `src/Testing/Data/cow.g`. - -!!! warning - The surface that contains cells must be closed and manifold. The example does not check for this. Run [ClosedSurface](../ClosedSurface) to check your surface. diff --git a/data/examples/PolyData/CellsInsideObject.py b/data/examples/PolyData/CellsInsideObject.py deleted file mode 100755 index 694e390..0000000 --- a/data/examples/PolyData/CellsInsideObject.py +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkDataObject -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import ( - vtkMultiThreshold, - vtkTransformPolyDataFilter -) -from vtkmodules.vtkFiltersModeling import vtkSelectEnclosedPoints -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Read a polydata file of a surface and determine if it is a closed surface.' - epilogue = ''' -This example illustrates how to extract the cells that exist inside a closed surface. -It uses vtkSelectEnclosedPoints to mark points that are inside and outside the surface. -vtkMultiThreshold is used to extract the three meshes into three vtkMultiBlockDataSet's. -The cells completely outside are shown in crimson, completely inside are yellow and - border cells are green. -A translucent copy of the closed surface helps illustrate the selection process. - -If two polydata datasets are provided, the example uses the second as the closed surface. -If only one dataset is provided, the closed surface is generated by rotating the - first dataset by 90 degrees around its Y axis. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='Enter a polydata file e.g cow.g.') - parser.add_argument('filename2', default=None, nargs='?', help='Enter another polydata file e.g cow.g.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -def main(): - fn1, fn2 = get_program_parameters() - polyData1 = ReadPolyData(fn1) - if fn2: - polyData2 = ReadPolyData(fn2) - else: - # If only one polydata is present, generate a second polydata by - # rotating the original about its center. - print('Generating modified polyData1') - center = polyData1.GetCenter() - transform = vtkTransform() - transform.Translate(center[0], center[1], center[2]) - transform.RotateY(90.0) - transform.Translate(-center[0], -center[1], -center[2]) - transformPD = vtkTransformPolyDataFilter() - transformPD.SetTransform(transform) - transformPD.SetInputData(polyData1) - transformPD.Update() - polyData2 = transformPD.GetOutput() - - # Mark points inside with 1 and outside with a 0 - select = vtkSelectEnclosedPoints() - select.SetInputData(polyData1) - select.SetSurfaceData(polyData2) - - # Extract three meshes, one completely inside, one completely - # outside and on the border between the inside and outside. - - threshold = vtkMultiThreshold() - # Outside points have a 0 value in ALL points of a cell - outsideId = threshold.AddBandpassIntervalSet( - 0, 0, - vtkDataObject.FIELD_ASSOCIATION_POINTS, 'SelectedPoints', - 0, 1) - # Inside points have a 1 value in ALL points of a cell - insideId = threshold.AddBandpassIntervalSet( - 1, 1, - vtkDataObject.FIELD_ASSOCIATION_POINTS, 'SelectedPoints', - 0, 1) - # Border points have a 0 or a 1 in at least one point of a cell - borderId = threshold.AddIntervalSet( - 0, 1, - vtkMultiThreshold.OPEN, vtkMultiThreshold.OPEN, - vtkDataObject.FIELD_ASSOCIATION_POINTS, 'SelectedPoints', - 0, 0) - - threshold.SetInputConnection(select.GetOutputPort()) - - # Select the intervals to be output - threshold.OutputSet(outsideId) - threshold.OutputSet(insideId) - threshold.OutputSet(borderId) - threshold.Update() - - # Visualize - colors = vtkNamedColors() - outsideColor = colors.GetColor3d('Crimson') - insideColor = colors.GetColor3d('Banana') - borderColor = colors.GetColor3d('Mint') - surfaceColor = colors.GetColor3d('Peacock') - backgroundColor = colors.GetColor3d('Silver') - - # Outside - outsideMapper = vtkDataSetMapper() - outsideMapper.SetInputData(threshold.GetOutput().GetBlock(outsideId).GetBlock(0)) - outsideMapper.ScalarVisibilityOff() - - outsideActor = vtkActor() - outsideActor.SetMapper(outsideMapper) - outsideActor.GetProperty().SetDiffuseColor(outsideColor) - outsideActor.GetProperty().SetSpecular(.6) - outsideActor.GetProperty().SetSpecularPower(30) - - # Inside - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(threshold.GetOutput().GetBlock(insideId).GetBlock(0)) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(insideColor) - insideActor.GetProperty().SetSpecular(.6) - insideActor.GetProperty().SetSpecularPower(30) - insideActor.GetProperty().EdgeVisibilityOn() - - # Border - borderMapper = vtkDataSetMapper() - borderMapper.SetInputData(threshold.GetOutput().GetBlock(borderId).GetBlock(0)) - borderMapper.ScalarVisibilityOff() - - borderActor = vtkActor() - borderActor.SetMapper(borderMapper) - borderActor.GetProperty().SetDiffuseColor(borderColor) - borderActor.GetProperty().SetSpecular(.6) - borderActor.GetProperty().SetSpecularPower(30) - borderActor.GetProperty().EdgeVisibilityOn() - - surfaceMapper = vtkDataSetMapper() - surfaceMapper.SetInputData(polyData2) - surfaceMapper.ScalarVisibilityOff() - - # Surface of object containing cell - surfaceActor = vtkActor() - surfaceActor.SetMapper(surfaceMapper) - surfaceActor.GetProperty().SetDiffuseColor(surfaceColor) - surfaceActor.GetProperty().SetOpacity(.1) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.SetBackground(backgroundColor) - renderer.UseHiddenLineRemovalOn() - - renderer.AddActor(surfaceActor) - renderer.AddActor(outsideActor) - renderer.AddActor(insideActor) - renderer.AddActor(borderActor) - - renderWindow.SetWindowName('CellsInsideObject') - renderWindow.Render() - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - renderer.GetActiveCamera().Dolly(1.25) - renderWindow.Render() - - renderWindowInteractor.Start() - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/ClosedSurface.py b/data/examples/PolyData/ClosedSurface.py deleted file mode 100755 index e1183b7..0000000 --- a/data/examples/PolyData/ClosedSurface.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkFiltersCore import vtkFeatureEdges -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader - - -def get_program_parameters(): - import argparse - description = 'Read a polydata file of a surface and determine if it is a closed surface.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Enter a polydata file e.g cow.g.') - args = parser.parse_args() - return args.filename - - -def main(): - fn = get_program_parameters() - polyData = ReadPolyData(fn) - featureEdges = vtkFeatureEdges() - featureEdges.FeatureEdgesOff() - featureEdges.BoundaryEdgesOn() - featureEdges.NonManifoldEdgesOn() - featureEdges.SetInputData(polyData) - featureEdges.Update() - - numberOfOpenEdges = featureEdges.GetOutput().GetNumberOfCells() - - if numberOfOpenEdges > 0: - print(fn, ': Surface is not closed') - else: - print(fn, ': Surface is closed') - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/ColoredTriangle.md b/data/examples/PolyData/ColoredTriangle.md deleted file mode 100644 index 3549564..0000000 --- a/data/examples/PolyData/ColoredTriangle.md +++ /dev/null @@ -1,3 +0,0 @@ -### Decription - -Creates a file called TestTriangleColored.vtp. diff --git a/data/examples/PolyData/ColoredTriangle.py b/data/examples/PolyData/ColoredTriangle.py deleted file mode 100755 index 18086b0..0000000 --- a/data/examples/PolyData/ColoredTriangle.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints, - vtkUnsignedCharArray - ) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangle - ) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate a colored triangle, then write a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestColoredTriangle.vtp', - type=str, default='TestColoredTriangle.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() - Triangles = vtkCellArray() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - - Triangle = vtkTriangle() - Triangle.GetPointIds().SetId(0, 0) - Triangle.GetPointIds().SetId(1, 1) - Triangle.GetPointIds().SetId(2, 2) - Triangles.InsertNextCell(Triangle) - - # setup colors - Colors = vtkUnsignedCharArray() - Colors.SetNumberOfComponents(3) - Colors.SetName('Colors') - Colors.InsertNextTuple3(*colors.GetColor3ub('Red')) - Colors.InsertNextTuple3(*colors.GetColor3ub('Lime')) - Colors.InsertNextTuple3(*colors.GetColor3ub('Blue')) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.SetPolys(Triangles) - - polydata.GetPointData().SetScalars(Colors) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/Curvatures.py b/data/examples/PolyData/Curvatures.py deleted file mode 100755 index 3499ffd..0000000 --- a/data/examples/PolyData/Curvatures.py +++ /dev/null @@ -1,299 +0,0 @@ -#!/usr/bin/env python - -from pathlib import Path - -import numpy as np -from vtkmodules.numpy_interface import dataset_adapter as dsa -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import ( - VTK_DOUBLE, - vtkIdList, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFeatureEdges, - vtkIdFilter -) -from vtkmodules.vtkFiltersGeneral import vtkCurvatures -# noinspection PyUnresolvedReferences -from vtkmodules.vtkIOXML import ( - vtkXMLPolyDataReader, - vtkXMLPolyDataWriter -) -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtk.util import numpy_support - - -def get_program_parameters(argv): - import argparse - import textwrap - - description = 'Calculate Gauss or Mean Curvature.' - epilogue = textwrap.dedent(''' - ''') - parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description=description, - epilog=epilogue) - parser.add_argument('file_name', help=' e.g. cowHead.vtp.') - parser.add_argument('-i', default=16, type=int, help='The color map index e.g. 16.') - parser.add_argument('-g', help='Use Gaussian Curvature.', action='store_true') - - args = parser.parse_args() - return args.file_name, args.i, args.g - - -def main(argv): - file_name, color_map_idx, gaussian_curvature = get_program_parameters(argv) - - if not Path(file_name).is_file(): - print(f'The path: {file_name} does not exist.') - return - if gaussian_curvature: - curvature = 'Gauss_Curvature' - else: - curvature = 'Mean_Curvature' - - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - - source = reader.GetOutput() - - cc = vtkCurvatures() - cc.SetInputData(source) - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() - else: - cc.SetCurvatureTypeToMean() - cc.Update() - adjust_edge_curvatures(cc.GetOutput(), curvature) - source.GetPointData().AddArray(cc.GetOutput().GetPointData().GetAbstractArray(curvature)) - scalar_range = source.GetPointData().GetScalars(curvature).GetRange() - - # Uncomment the following lines if you want to write out the polydata. - # writer = vtkXMLPolyDataWriter() - # writer.SetFileName('Source.vtp') - # writer.SetInputData(source) - # writer.SetDataModeToAscii() - # writer.Write() - - # Build a lookup table - color_series = vtkColorSeries() - color_series.SetColorScheme(color_map_idx) - print(f'Using color scheme #: {color_series.GetColorScheme()}, {color_series.GetColorSchemeName()}') - - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() - - # Use a color series to create a transfer function - for i in range(0, color_series.GetNumberOfColors()): - color = color_series.GetColor(i) - double_color = list(map(lambda x: x / 255.0, color)) - t = scalar_range[0] + (scalar_range[1] - scalar_range[0]) / (color_series.GetNumberOfColors() - 1) * i - lut.AddRGBPoint(t, double_color[0], double_color[1], double_color[2]) - - colors = vtkNamedColors() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - mapper.SetScalarModeToUsePointFieldData() - mapper.SelectColorArray(curvature) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) - - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 800 - window_height = 800 - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle(curvature.replace('_', '\n')) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetNumberOfLabels(5) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 3) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(window_width, window_height) - ren_win.SetWindowName('Curvatures') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) - - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.AddActor2D(scalar_bar) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - # Render and interact - ren_win.Render() - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -def adjust_edge_curvatures(source, curvature_name, epsilon=1.0e-08): - """ - This function adjusts curvatures along the edges of the surface by replacing - the value with the average value of the curvatures of points in the neighborhood. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param epsilon: Absolute curvature values less than this will be set to zero. - :return: - """ - - def point_neighbourhood(pt_id): - """ - Find the ids of the neighbours of pt_id. - - :param pt_id: The point id. - :return: The neighbour ids. - """ - """ - Extract the topological neighbors for point pId. In two steps: - 1) source.GetPointCells(pt_id, cell_ids) - 2) source.GetCellPoints(cell_id, cell_point_ids) for all cell_id in cell_ids - """ - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - - def compute_distance(pt_id_a, pt_id_b): - """ - Compute the distance between two points given their ids. - - :param pt_id_a: - :param pt_id_b: - :return: - """ - pt_a = np.array(source.GetPoint(pt_id_a)) - pt_b = np.array(source.GetPoint(pt_id_b)) - return np.linalg.norm(pt_a - pt_b) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Get the boundary point IDs. - array_name = 'ids' - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) - id_filter.Update() - - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() - edges.Update() - - edge_array = edges.GetOutput().GetPointData().GetArray(array_name) - boundary_ids = [] - for i in range(edges.GetOutput().GetNumberOfPoints()): - boundary_ids.append(edge_array.GetValue(i)) - # Remove duplicate Ids. - p_ids_set = set(boundary_ids) - - # Iterate over the edge points and compute the curvature as the weighted - # average of the neighbours. - count_invalid = 0 - for p_id in boundary_ids: - p_ids_neighbors = point_neighbourhood(p_id) - # Keep only interior points. - p_ids_neighbors -= p_ids_set - # Compute distances and extract curvature values. - curvs = [curvatures[p_id_n] for p_id_n in p_ids_neighbors] - dists = [compute_distance(p_id_n, p_id) for p_id_n in p_ids_neighbors] - curvs = np.array(curvs) - dists = np.array(dists) - curvs = curvs[dists > 0] - dists = dists[dists > 0] - if len(curvs) > 0: - weights = 1 / np.array(dists) - weights /= weights.sum() - new_curv = np.dot(curvs, weights) - else: - # Corner case. - count_invalid += 1 - # Assuming the curvature of the point is planar. - new_curv = 0.0 - # Set the new curvature value. - curvatures[p_id] = new_curv - - # Set small values to zero. - if epsilon != 0.0: - curvatures = np.where(abs(curvatures) < epsilon, 0, curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/PolyData/CurvaturesAdjustEdges.md b/data/examples/PolyData/CurvaturesAdjustEdges.md deleted file mode 100644 index 2f47824..0000000 --- a/data/examples/PolyData/CurvaturesAdjustEdges.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -This example demonstrates how to calculate Gaussian and Mean curvatures for a vtkPolyData source. Since edges can produce large discrepancies to curvatures, edge adjustment can be applied. If we know the geometry of the surface we can also modify the curvatures. - -Functions are provided to achieve these aims. - -A histogram of the frequencies is also output to the console. This is useful if you want to get an idea of the distribution of the scalars in each band. - -This example was inspired by these discussions: - -- [?vtkCurvatures? yields unreasonably large values along borders](https://discourse.vtk.org/t/?vtkcurvatures?-yields-unreasonably-large-values-along-borders/2527) -- [How to extract the ids of the boundary points of a surface?](https://discourse.vtk.org/t/2530/3) - -Thanks to everyone involved in these discussions. diff --git a/data/examples/PolyData/CurvaturesAdjustEdges.py b/data/examples/PolyData/CurvaturesAdjustEdges.py deleted file mode 100755 index 10dbac1..0000000 --- a/data/examples/PolyData/CurvaturesAdjustEdges.py +++ /dev/null @@ -1,866 +0,0 @@ -#!/usr/bin/env python - -import math - -import numpy as np -from vtkmodules.numpy_interface import dataset_adapter as dsa -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBour, - vtkParametricEnneper, - vtkParametricMobius, - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - VTK_DOUBLE, - vtkDoubleArray, - vtkFloatArray, - vtkIdList, - vtkLookupTable, - vtkPoints, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkDelaunay2D, - vtkFeatureEdges, - vtkIdFilter, - vtkPolyDataNormals, - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkCurvatures, - vtkTransformPolyDataFilter -) -from vtkmodules.vtkFiltersModeling import vtkLinearSubdivisionFilter -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkParametricFunctionSource, - vtkTexturedSphereSource -) -# noinspection PyUnresolvedReferences -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) -from vtk.util import numpy_support - - -def main(argv): - # desired_surface = 'Bour' - # desired_surface = 'Cube' - # desired_surface = 'Hills' - # desired_surface = 'Enneper' - # desired_surface = 'Mobius' - desired_surface = 'RandomHills' - # desired_surface = 'Sphere' - # desired_surface = 'Torus' - source = get_source(desired_surface) - if not source: - print('The surface is not available.') - return - - gc = vtkCurvatures() - gc.SetInputData(source) - gc.SetCurvatureTypeToGaussian() - gc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(gc.GetOutput(), 'Gauss_Curvature') - if desired_surface == 'Bour': - # Gaussian curvature is -1/(r(r+1)^4)) - constrain_curvatures(gc.GetOutput(), 'Gauss_Curvature', -0.0625, -0.0625) - if desired_surface == 'Enneper': - # Gaussian curvature is -4/(1 + r^2)^4 - constrain_curvatures(gc.GetOutput(), 'Gauss_Curvature', -0.25, -0.25) - if desired_surface == 'Cube': - constrain_curvatures(gc.GetOutput(), 'Gauss_Curvature', 0.0, 0.0) - if desired_surface == 'Mobius': - constrain_curvatures(gc.GetOutput(), 'Gauss_Curvature', 0.0, 0.0) - if desired_surface == 'Sphere': - # Gaussian curvature is 1/r^2 - constrain_curvatures(gc.GetOutput(), 'Gauss_Curvature', 4.0, 4.0) - source.GetPointData().AddArray( - gc.GetOutput().GetPointData().GetAbstractArray('Gauss_Curvature')) - - mc = vtkCurvatures() - mc.SetInputData(source) - mc.SetCurvatureTypeToMean() - mc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(mc.GetOutput(), 'Mean_Curvature') - if desired_surface == 'Bour': - # Mean curvature is 0 - constrain_curvatures(mc.GetOutput(), 'Mean_Curvature', 0.0, 0.0) - if desired_surface == 'Enneper': - # Mean curvature is 0 - constrain_curvatures(mc.GetOutput(), 'Mean_Curvature', 0.0, 0.0) - if desired_surface == 'Sphere': - # Mean curvature is 1/r - constrain_curvatures(mc.GetOutput(), 'Mean_Curvature', 2.0, 2.0) - source.GetPointData().AddArray( - mc.GetOutput().GetPointData().GetAbstractArray('Mean_Curvature')) - - # Uncomment the following lines if you want to write out the polydata. - # writer = vtkXMLPolyDataWriter() - # writer.SetFileName('Source.vtp') - # writer.SetInputData(source) - # writer.SetDataModeToBinary() - # writer.Write() - - # Let's visualise what we have done. - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - window_width = 1024 - window_height = 512 - - ren_win = vtkRenderWindow() - ren_win.SetSize(window_width, window_height) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(24) - text_property.SetJustificationToCentered() - - lut = get_diverging_lut() - # lut = get_diverging_lut1() - - # Define viewport ranges - xmins = [0, 0.5] - xmaxs = [0.5, 1] - ymins = [0, 0] - ymaxs = [1.0, 1.0] - - camera = None - - has_cow = False - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - has_cow = True - - curvature_types = ['Gauss_Curvature', 'Mean_Curvature'] - for idx, curvature_name in enumerate(curvature_types): - - curvature_title = curvature_name.replace('_', '\n') - - source.GetPointData().SetActiveScalars(curvature_name) - scalar_range = source.GetPointData().GetScalars(curvature_name).GetRange() - - bands = get_bands(scalar_range, 10) - freq = get_frequencies(bands, source) - bands, freq = adjust_ranges(bands, freq) - print(curvature_name) - print_bands_frequencies(bands, freq) - - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - mapper.SetScalarModeToUsePointFieldData() - mapper.SelectColorArray(curvature_name) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle(curvature_title) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetNumberOfLabels(min(5, len(freq))) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 3) - scalar_bar.SetBarRatio(scalar_bar.GetBarRatio() * 0.5) - scalar_bar.SetPosition(0.85, 0.1) - - text_mapper = vtkTextMapper() - text_mapper.SetInput(curvature_title) - text_mapper.SetTextProperty(text_property) - - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(250, 16) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - - renderer.AddActor(actor) - renderer.AddActor(text_actor) - renderer.AddActor(scalar_bar) - - ren_win.AddRenderer(renderer) - - if idx == 0: - if has_cow: - cam_orient_manipulator.SetParentRenderer(renderer) - camera = renderer.GetActiveCamera() - camera.Elevation(60) - else: - renderer.SetActiveCamera(camera) - renderer.SetViewport(xmins[idx], ymins[idx], xmaxs[idx], ymaxs[idx]) - renderer.ResetCamera() - - if has_cow: - # Enable the widget. - cam_orient_manipulator.On() - - ren_win.Render() - ren_win.SetWindowName('CurvaturesAdjustEdges') - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -def adjust_edge_curvatures(source, curvature_name, epsilon=1.0e-08): - """ - This function adjusts curvatures along the edges of the surface by replacing - the value with the average value of the curvatures of points in the neighborhood. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param epsilon: Absolute curvature values less than this will be set to zero. - :return: - """ - - def point_neighbourhood(pt_id): - """ - Find the ids of the neighbours of pt_id. - - :param pt_id: The point id. - :return: The neighbour ids. - """ - """ - Extract the topological neighbors for point pId. In two steps: - 1) source.GetPointCells(pt_id, cell_ids) - 2) source.GetCellPoints(cell_id, cell_point_ids) for all cell_id in cell_ids - """ - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - - def compute_distance(pt_id_a, pt_id_b): - """ - Compute the distance between two points given their ids. - - :param pt_id_a: - :param pt_id_b: - :return: - """ - pt_a = np.array(source.GetPoint(pt_id_a)) - pt_b = np.array(source.GetPoint(pt_id_b)) - return np.linalg.norm(pt_a - pt_b) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Get the boundary point IDs. - array_name = 'ids' - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) - id_filter.Update() - - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() - edges.Update() - - edge_array = edges.GetOutput().GetPointData().GetArray(array_name) - boundary_ids = [] - for i in range(edges.GetOutput().GetNumberOfPoints()): - boundary_ids.append(edge_array.GetValue(i)) - # Remove duplicate Ids. - p_ids_set = set(boundary_ids) - - # Iterate over the edge points and compute the curvature as the weighted - # average of the neighbours. - count_invalid = 0 - for p_id in boundary_ids: - p_ids_neighbors = point_neighbourhood(p_id) - # Keep only interior points. - p_ids_neighbors -= p_ids_set - # Compute distances and extract curvature values. - curvs = [curvatures[p_id_n] for p_id_n in p_ids_neighbors] - dists = [compute_distance(p_id_n, p_id) for p_id_n in p_ids_neighbors] - curvs = np.array(curvs) - dists = np.array(dists) - curvs = curvs[dists > 0] - dists = dists[dists > 0] - if len(curvs) > 0: - weights = 1 / np.array(dists) - weights /= weights.sum() - new_curv = np.dot(curvs, weights) - else: - # Corner case. - count_invalid += 1 - # Assuming the curvature of the point is planar. - new_curv = 0.0 - # Set the new curvature value. - curvatures[p_id] = new_curv - - # Set small values to zero. - if epsilon != 0.0: - curvatures = np.where(abs(curvatures) < epsilon, 0, curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -def constrain_curvatures(source, curvature_name, lower_bound=0.0, upper_bound=0.0): - """ - This function constrains curvatures to the range [lower_bound ... upper_bound]. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param lower_bound: The lower bound. - :param upper_bound: The upper bound. - :return: - """ - - bounds = list() - if lower_bound < upper_bound: - bounds.append(lower_bound) - bounds.append(upper_bound) - else: - bounds.append(upper_bound) - bounds.append(lower_bound) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Set upper and lower bounds. - curvatures = np.where(curvatures < bounds[0], bounds[0], curvatures) - curvatures = np.where(curvatures > bounds[1], bounds[1], curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -def get_diverging_lut(): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start point midPoint end point - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150 - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046 - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631 - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093 - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233 - - :return: - """ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def get_diverging_lut1(): - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) - ctf.AddRGBPoint(*p2) - ctf.AddRGBPoint(*p3) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def get_bour(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricBour() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(0.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_hills(): - # Create four hills on a plane. - # This will have regions of negative, zero and positive Gsaussian curvatures. - - x_res = 50 - y_res = 50 - x_min = -5.0 - x_max = 5.0 - dx = (x_max - x_min) / (x_res - 1) - y_min = -5.0 - y_max = 5.0 - dy = (y_max - y_min) / (x_res - 1) - - # Make a grid. - points = vtkPoints() - for i in range(0, x_res): - x = x_min + i * dx - for j in range(0, y_res): - y = y_min + j * dy - points.InsertNextPoint(x, y, 0) - - # Add the grid points to a polydata object. - plane = vtkPolyData() - plane.SetPoints(points) - - # Triangulate the grid. - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], - [5.0, -2.5, 1.5, 1.5, 2.5], [-5.0, 5, 2.5, 3.0, 3]] - xx = [0.0] * 2 - for i in range(0, points.GetNumberOfPoints()): - x = list(polydata.GetPoint(i)) - for j in range(0, len(hd)): - xx[0] = (x[0] - hd[j][0] / hd[j][2]) ** 2.0 - xx[1] = (x[1] - hd[j][1] / hd[j][3]) ** 2.0 - x[2] += hd[j][4] * math.exp(-(xx[0] + xx[1]) / 2.0) - polydata.GetPoints().SetPoint(i, x) - elevation.SetValue(i, x[2]) - - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): - tc = [i / (x_res - 1.0), 0.0] - for j in range(0, y_res): - # tc[1] = 1.0 - j / (y_res - 1.0) - tc[1] = j / (y_res - 1.0) - textures.SetTuple(i * y_res + j, tc) - - polydata.GetPointData().SetScalars(elevation) - polydata.GetPointData().GetScalars().SetName("Elevation") - polydata.GetPointData().SetTCoords(textures) - - normals = vtkPolyDataNormals() - normals.SetInputData(polydata) - normals.SetInputData(polydata) - normals.SetFeatureAngle(30) - normals.SplittingOff() - - tr1 = vtkTransform() - tr1.RotateX(-90) - - tf1 = vtkTransformPolyDataFilter() - tf1.SetInputConnection(normals.GetOutputPort()) - tf1.SetTransform(tr1) - tf1.Update() - - return tf1.GetOutput() - - -def get_enneper(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricEnneper() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(0.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_mobius(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_random_hills(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - - return tangents.GetOutput() - - -def get_torus(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_source(source): - surface = source.lower() - available_surfaces = ['bour', 'cube', 'enneper', 'hills', 'mobius', 'randomhills', 'sphere', 'torus'] - if surface not in available_surfaces: - return None - elif surface == 'bour': - return get_bour() - elif surface == 'cube': - return get_cube() - elif surface == 'enneper': - return get_enneper() - elif surface == 'hills': - return get_hills() - elif surface == 'mobius': - return get_mobius() - elif surface == 'randomhills': - return get_random_hills() - elif surface == 'sphere': - return get_sphere() - elif surface == 'torus': - return get_torus() - return None - - -def get_frequencies(bands, src): - """ - Count the number of scalars in each band. - The scalars used are the active scalars in the polydata. - - :param: bands - The bands. - :param: src - The vtkPolyData source. - :return: The frequencies of the scalars in each band. - """ - freq = dict() - for i in range(len(bands)): - freq[i] = 0 - tuples = src.GetPointData().GetScalars().GetNumberOfTuples() - for i in range(tuples): - x = src.GetPointData().GetScalars().GetTuple1(i) - for j in range(len(bands)): - if x <= bands[j][2]: - freq[j] += 1 - break - return freq - - -def adjust_ranges(bands, freq): - """ - The bands and frequencies are adjusted so that the first and last - frequencies in the range are non-zero. - :param bands: The bands dictionary. - :param freq: The frequency dictionary. - :return: Adjusted bands and frequencies. - """ - # Get the indices of the first and last non-zero elements. - first = 0 - for k, v in freq.items(): - if v != 0: - first = k - break - rev_keys = list(freq.keys())[::-1] - last = rev_keys[0] - for idx in list(freq.keys())[::-1]: - if freq[idx] != 0: - last = idx - break - # Now adjust the ranges. - min_key = min(freq.keys()) - max_key = max(freq.keys()) - for idx in range(min_key, first): - freq.pop(idx) - bands.pop(idx) - for idx in range(last + 1, max_key + 1): - freq.popitem() - bands.popitem() - old_keys = freq.keys() - adj_freq = dict() - adj_bands = dict() - - for idx, k in enumerate(old_keys): - adj_freq[idx] = freq[k] - adj_bands[idx] = bands[k] - - return adj_bands, adj_freq - - -def get_bands(d_r, number_of_bands, precision=2, nearest_integer=False): - """ - Divide a range into bands - :param: d_r - [min, max] the range that is to be covered by the bands. - :param: number_of_bands - The number of bands, a positive integer. - :param: precision - The decimal precision of the bounds. - :param: nearest_integer - If True then [floor(min), ceil(max)] is used. - :return: A dictionary consisting of the band number and [min, midpoint, max] for each band. - """ - prec = abs(precision) - if prec > 14: - prec = 14 - - bands = dict() - if (d_r[1] < d_r[0]) or (number_of_bands <= 0): - return bands - x = list(d_r) - if nearest_integer: - x[0] = math.floor(x[0]) - x[1] = math.ceil(x[1]) - dx = (x[1] - x[0]) / float(number_of_bands) - b = [x[0], x[0] + dx / 2.0, x[0] + dx] - i = 0 - while i < number_of_bands: - b = list(map(lambda ele_b: round(ele_b, prec), b)) - if i == 0: - b[0] = x[0] - bands[i] = b - b = [b[0] + dx, b[1] + dx, b[2] + dx] - i += 1 - return bands - - -def print_bands_frequencies(bands, freq, precision=2): - prec = abs(precision) - if prec > 14: - prec = 14 - - if len(bands) != len(freq): - print('Bands and Frequencies must be the same size.') - return - s = f'Bands & Frequencies:\n' - total = 0 - width = prec + 6 - for k, v in bands.items(): - total += freq[k] - for j, q in enumerate(v): - if j == 0: - s += f'{k:4d} [' - if j == len(v) - 1: - s += f'{q:{width}.{prec}f}]: {freq[k]:8d}\n' - else: - s += f'{q:{width}.{prec}f}, ' - width = 3 * width + 13 - s += f'{"Total":{width}s}{total:8d}\n' - print(s) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/PolyData/CurvaturesDemo.md b/data/examples/PolyData/CurvaturesDemo.md deleted file mode 100644 index d2c2485..0000000 --- a/data/examples/PolyData/CurvaturesDemo.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description - -**How to get the Gaussian and Mean curvatures of a surface.** - -Two different surfaces are used in this demonstration with each surface coloured according to its Gaussian and Mean curvatures. - -- The first surface is a superquadric surface, this demonstrates the use of extra filters that are needed to get a nice smooth surface. - -- The second surface is a parametric surface, in this case the surface has already been triangulated so no extra processing is necessary. - -In order to get a nice coloured image, a vtkColorTransferFunction has been used to generate a set of colours for the vtkLookupTable tables. We have used a diverging colour space. -Because of the symmetry of the ranges selected for the lookup tables, the white colouration represents a midpoint value whilst the blue represents values less than the midpoint value and orange represents colours greater than the midpoint value. - -In the case of the Random Hills Gaussian curvature surface, this colouration shows the nature of the surface quite nicely. The blue areas are saddle points (negative Gaussian curvature) and the orange areas have a positive Gaussian curvature. - -In the case of the mean curvature the blue colouration represents negative curvature perpendicular to one of the principal axes. diff --git a/data/examples/PolyData/CurvaturesDemo.py b/data/examples/PolyData/CurvaturesDemo.py deleted file mode 100755 index 5cfde53..0000000 --- a/data/examples/PolyData/CurvaturesDemo.py +++ /dev/null @@ -1,439 +0,0 @@ -#!/usr/bin/env python - -""" -The purpose of this is to demonstrate how to get the Gaussian and Mean curvatures of a surface. - -Two different surfaces are used in this demonstration with each surface coloured according - to its Gaussian and Mean curvatures. - -The first surface is a superquadric surface, this demonstrates the use of extra filters - that are needed to get a nice smooth surface. - -The second surface is a parametric surface, in this case the surface has already been triangulated -so no extra processing is necessary. - -In order to get a nice coloured image, a vtkColorTransferFunction has been used to generate - a set of colours for the vtkLookUp tables. We have used a diverging colour space. -Because of the symmetry of the ranges selected for the lookup tables, the white colouration - represents a midpoint value whilst the blue represents values less than the midopoint value - and orange represents colours greater than the midpoint value. - -In the case of the Random Hills Gaussian Curvature surface, this colouration shows the nature - of the surface quite nicely. The blue areas are saddle points (negative Gaussian curvature) - and the orange areas have a positive Gaussian curvature. -In the case of the mean curvature the blue colouration is representing negative curvature - perpendicular to one of the principal axes. - -This example also demonstrates the use of lists and the linking of the elements of the - lists together to form a pipeline. - -""" - -import numpy as np -from vtkmodules.numpy_interface import dataset_adapter as dsa -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import vtkParametricRandomHills -from vtkmodules.vtkCommonCore import ( - VTK_DOUBLE, - vtkIdList, - vtkLookupTable, - vtkVersion -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkFeatureEdges, - vtkIdFilter, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkCurvatures, - vtkTransformFilter -) -from vtkmodules.vtkFiltersSources import ( - vtkParametricFunctionSource, - vtkSuperquadricSource -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) -from vtk.util import numpy_support - - -def main(argv): - colors = vtkNamedColors() - - # We are going to handle two different sources. - # The first source is a superquadric source. - torus = vtkSuperquadricSource() - torus.SetCenter(0.0, 0.0, 0.0) - torus.SetScale(1.0, 1.0, 1.0) - torus.SetPhiResolution(64) - torus.SetThetaResolution(64) - torus.SetThetaRoundness(1) - torus.SetThickness(0.5) - torus.SetSize(0.5) - torus.SetToroidal(1) - - # Rotate the torus towards the observer (around the x-axis) - toroid_transform = vtkTransform() - toroid_transform.RotateX(55) - - toroid_transform_filter = vtkTransformFilter() - toroid_transform_filter.SetInputConnection(torus.GetOutputPort()) - toroid_transform_filter.SetTransform(toroid_transform) - - # The quadric is made of strips, so pass it through a triangle filter as - # the curvature filter only operates on polys - tri = vtkTriangleFilter() - tri.SetInputConnection(toroid_transform_filter.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - # The next source will be a parametric function - rh = vtkParametricRandomHills() - rh_fn_src = vtkParametricFunctionSource() - rh_fn_src.SetParametricFunction(rh) - rh_fn_src.Update() - - sources = list() - for i in range(0, 4): - cc = vtkCurvatures() - if i < 2: - cc.SetInputConnection(cleaner.GetOutputPort()) - else: - cc.SetInputConnection(rh_fn_src.GetOutputPort()) - if i % 2 == 0: - cc.SetCurvatureTypeToGaussian() - curvature_name = 'Gauss_Curvature' - else: - cc.SetCurvatureTypeToMean() - curvature_name = 'Mean_Curvature' - cc.Update() - adjust_edge_curvatures(cc.GetOutput(), curvature_name) - sources.append(cc.GetOutput()) - - curvatures = { - 0: 'Gauss_Curvature', - 1: 'Mean_Curvature', - 2: 'Gauss_Curvature', - 3: 'Mean_Curvature', - } - - # lut = get_diverging_lut() - lut = get_diverging_lut1() - - renderers = list() - mappers = list() - actors = list() - text_mappers = list() - text_actors = list() - scalar_bars = list() - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(24) - text_property.SetJustificationToCentered() - - # RenderWindow Dimensions - # - renderer_size = 512 - grid_dimensions = 2 - window_width = renderer_size * grid_dimensions - window_height = renderer_size * grid_dimensions - - # Link the pipeline together. - for idx, source in enumerate(sources): - curvature_name = curvatures[idx].replace('_', '\n') - - source.GetPointData().SetActiveScalars(curvatures[idx]) - scalar_range = source.GetPointData().GetScalars(curvatures[idx]).GetRange() - - mappers.append(vtkPolyDataMapper()) - mappers[idx].SetInputData(source) - mappers[idx].SetScalarModeToUsePointFieldData() - mappers[idx].SelectColorArray(curvatures[idx]) - mappers[idx].SetScalarRange(scalar_range) - mappers[idx].SetLookupTable(lut) - - actors.append(vtkActor()) - actors[idx].SetMapper(mappers[idx]) - - text_mappers.append(vtkTextMapper()) - text_mappers[idx].SetInput(curvature_name) - text_mappers[idx].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[idx].SetMapper(text_mappers[idx]) - text_actors[idx].SetPosition(250, 16) - - # Create a scalar bar - scalar_bars.append(vtkScalarBarActor()) - scalar_bars[idx].SetLookupTable(mappers[idx].GetLookupTable()) - scalar_bars[idx].SetTitle(curvature_name) - scalar_bars[idx].UnconstrainedFontSizeOn() - scalar_bars[idx].SetNumberOfLabels(5) - scalar_bars[idx].SetMaximumWidthInPixels(window_width // 8) - scalar_bars[idx].SetMaximumHeightInPixels(window_height // 3) - scalar_bars[idx].SetBarRatio(scalar_bars[idx].GetBarRatio() * 0.5) - scalar_bars[idx].SetPosition(0.85, 0.1) - - renderers.append(vtkRenderer()) - - for idx in range(len(sources)): - if idx < grid_dimensions * grid_dimensions: - renderers.append(vtkRenderer) - - # Create the RenderWindow - # - render_window = vtkRenderWindow() - render_window.SetSize(renderer_size * grid_dimensions, renderer_size * grid_dimensions) - render_window.SetWindowName('CurvaturesDemo') - - # Add and position the renders to the render window. - viewport = list() - for row in range(grid_dimensions): - for col in range(grid_dimensions): - idx = row * grid_dimensions + col - - viewport[:] = [] - viewport.append(float(col) / grid_dimensions) - viewport.append(float(grid_dimensions - (row + 1)) / grid_dimensions) - viewport.append(float(col + 1) / grid_dimensions) - viewport.append(float(grid_dimensions - row) / grid_dimensions) - - if idx > (len(sources) - 1): - continue - - renderers[idx].SetViewport(viewport) - render_window.AddRenderer(renderers[idx]) - - renderers[idx].AddActor(actors[idx]) - renderers[idx].AddActor(text_actors[idx]) - renderers[idx].AddActor(scalar_bars[idx]) - renderers[idx].SetBackground(colors.GetColor3d('SlateGray')) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - render_window.Render() - - interactor.Start() - - -def get_diverging_lut(): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start point midPoint end point - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150 - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046 - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631 - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093 - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233 - - :return: - """ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def get_diverging_lut1(): - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) - ctf.AddRGBPoint(*p2) - ctf.AddRGBPoint(*p3) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -def adjust_edge_curvatures(source, curvature_name, epsilon=1.0e-08): - """ - This function adjusts curvatures along the edges of the surface by replacing - the value with the average value of the curvatures of points in the neighborhood. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param epsilon: Absolute curvature values less than this will be set to zero. - :return: - """ - - def point_neighbourhood(pt_id): - """ - Find the ids of the neighbours of pt_id. - - :param pt_id: The point id. - :return: The neighbour ids. - """ - """ - Extract the topological neighbors for point pId. In two steps: - 1) source.GetPointCells(pt_id, cell_ids) - 2) source.GetCellPoints(cell_id, cell_point_ids) for all cell_id in cell_ids - """ - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - - def compute_distance(pt_id_a, pt_id_b): - """ - Compute the distance between two points given their ids. - - :param pt_id_a: - :param pt_id_b: - :return: - """ - pt_a = np.array(source.GetPoint(pt_id_a)) - pt_b = np.array(source.GetPoint(pt_id_b)) - return np.linalg.norm(pt_a - pt_b) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Get the boundary point IDs. - array_name = 'ids' - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) - id_filter.Update() - - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() - edges.Update() - - edge_array = edges.GetOutput().GetPointData().GetArray(array_name) - boundary_ids = [] - for i in range(edges.GetOutput().GetNumberOfPoints()): - boundary_ids.append(edge_array.GetValue(i)) - # Remove duplicate Ids. - p_ids_set = set(boundary_ids) - - # Iterate over the edge points and compute the curvature as the weighted - # average of the neighbours. - count_invalid = 0 - for p_id in boundary_ids: - p_ids_neighbors = point_neighbourhood(p_id) - # Keep only interior points. - p_ids_neighbors -= p_ids_set - # Compute distances and extract curvature values. - curvs = [curvatures[p_id_n] for p_id_n in p_ids_neighbors] - dists = [compute_distance(p_id_n, p_id) for p_id_n in p_ids_neighbors] - curvs = np.array(curvs) - dists = np.array(dists) - curvs = curvs[dists > 0] - dists = dists[dists > 0] - if len(curvs) > 0: - weights = 1 / np.array(dists) - weights /= weights.sum() - new_curv = np.dot(curvs, weights) - else: - # Corner case. - count_invalid += 1 - # Assuming the curvature of the point is planar. - new_curv = 0.0 - # Set the new curvature value. - curvatures[p_id] = new_curv - - # Set small values to zero. - if epsilon != 0.0: - curvatures = np.where(abs(curvatures) < epsilon, 0, curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/PolyData/ExtractPolyLinesFromPolyData.md b/data/examples/PolyData/ExtractPolyLinesFromPolyData.md deleted file mode 100644 index a1af3c9..0000000 --- a/data/examples/PolyData/ExtractPolyLinesFromPolyData.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example uses vtkCutter to create contour lines. It processes these lines with vtkStripper to create continuous poly lines. After exiting the example with the "e" key, the lines are printed. diff --git a/data/examples/PolyData/ExtractPolyLinesFromPolyData.py b/data/examples/PolyData/ExtractPolyLinesFromPolyData.py deleted file mode 100755 index 1e07da6..0000000 --- a/data/examples/PolyData/ExtractPolyLinesFromPolyData.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdList -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import ( - vtkCutter, - vtkStripper -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - lineColor = colors.GetColor3d('peacock') - modelColor = colors.GetColor3d('silver') - backgroundColor = colors.GetColor3d('wheat') - - modelSource = vtkSphereSource() - - plane = vtkPlane() - - cutter = vtkCutter() - cutter.SetInputConnection(modelSource.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateValues(10, -0.5, 0.5) - - modelMapper = vtkPolyDataMapper() - modelMapper.SetInputConnection(modelSource.GetOutputPort()) - - model = vtkActor() - model.SetMapper(modelMapper) - model.GetProperty().SetDiffuseColor(modelColor) - model.GetProperty().SetInterpolationToFlat() - - stripper = vtkStripper() - stripper.SetInputConnection(cutter.GetOutputPort()) - stripper.JoinContiguousSegmentsOn() - - linesMapper = vtkPolyDataMapper() - linesMapper.SetInputConnection(stripper.GetOutputPort()) - - lines = vtkActor() - lines.SetMapper(linesMapper) - lines.GetProperty().SetDiffuseColor(lineColor) - lines.GetProperty().SetLineWidth(3.) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('ExtractPolyLinesFromPolyData') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer. - renderer.AddActor(model) - renderer.AddActor(lines) - renderer.SetBackground(backgroundColor) - renderer.GetActiveCamera().Azimuth(-45) - renderer.GetActiveCamera().Elevation(-22.5) - renderer.ResetCamera() - - # This starts the event loop and as a side effect causes an - # initial render. - renderWindow.Render() - interactor.Start() - - # Extract the lines from the polydata. - numberOfLines = cutter.GetOutput().GetNumberOfLines() - - print('-----------Lines without using vtkStripper') - print('There are {0} lines in the polydata'.format(numberOfLines)) - - numberOfLines = stripper.GetOutput().GetNumberOfLines() - points = stripper.GetOutput().GetPoints() - cells = stripper.GetOutput().GetLines() - cells.InitTraversal() - - print('-----------Lines using vtkStripper') - print('There are {0} lines in the polydata'.format(numberOfLines)) - - indices = vtkIdList() - lineCount = 0 - - while cells.GetNextCell(indices): - print('Line {0}:'.format(lineCount)) - for i in range(indices.GetNumberOfIds()): - point = points.GetPoint(indices.GetId(i)) - print('\t({0:0.6f} ,{1:0.6f}, {2:0.6f})'.format(point[0], point[1], point[2])) - lineCount += 1 - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/ExtractSelection.md b/data/examples/PolyData/ExtractSelection.md deleted file mode 100644 index 5fac0c1..0000000 --- a/data/examples/PolyData/ExtractSelection.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -This example creates 50 random points and extracts 10 of them (the points with ids 10-19). - -Also demonstrated is how to invert the selection. - -The three actors in the render window display from left to right: - -- all the points -- the selected points -- the points not selected. diff --git a/data/examples/PolyData/ExtractSelection.py b/data/examples/PolyData/ExtractSelection.py deleted file mode 100755 index 6860077..0000000 --- a/data/examples/PolyData/ExtractSelection.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdTypeArray -from vtkmodules.vtkCommonDataModel import ( - vtkSelection, - vtkSelectionNode, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersExtraction import vtkExtractSelection -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - point_source = vtkPointSource() - - point_source.SetNumberOfPoints(50) - point_source.Update() - - print('There are', point_source.GetOutput().GetNumberOfPoints(), 'input points.') - - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - - # Set values. - for i in range(10, 20): - ids.InsertNextValue(i) - - selection_node = vtkSelectionNode() - selection_node.SetFieldType(vtkSelectionNode.POINT) - selection_node.SetContentType(vtkSelectionNode.INDICES) - selection_node.SetSelectionList(ids) - - selection = vtkSelection() - selection.AddNode(selection_node) - - extract_selection = vtkExtractSelection() - extract_selection.SetInputConnection(0, point_source.GetOutputPort()) - extract_selection.SetInputData(1, selection) - extract_selection.Update() - - # In selection. - selected = vtkUnstructuredGrid() - selected.ShallowCopy(extract_selection.GetOutput()) - - print('There are', selected.GetNumberOfPoints(), 'points and', selected.GetNumberOfCells(), - 'cells in the selection.') - - # Get points that are NOT in the selection. - selection_node.GetProperties().Set(vtkSelectionNode().INVERSE(), 1) # invert the selection. - extract_selection.Update() - - not_selected = vtkUnstructuredGrid() - not_selected.ShallowCopy(extract_selection.GetOutput()) - - print('There are', not_selected.GetNumberOfPoints(), 'points and', not_selected.GetNumberOfCells(), - 'cells NOT in the selection.') - - input_mapper = vtkDataSetMapper() - input_mapper.SetInputConnection(point_source.GetOutputPort()) - input_actor = vtkActor() - input_actor.SetMapper(input_mapper) - input_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - input_actor.GetProperty().SetPointSize(5) - - selected_mapper = vtkDataSetMapper() - selected_mapper.SetInputData(selected) - - selected_actor = vtkActor() - selected_actor.SetMapper(selected_mapper) - selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - selected_actor.GetProperty().SetPointSize(5) - - not_selected_mapper = vtkDataSetMapper() - not_selected_mapper.SetInputData(not_selected) - - not_selected_actor = vtkActor() - not_selected_actor.SetMapper(not_selected_mapper) - not_selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - not_selected_actor.GetProperty().SetPointSize(5) - - # There will be one render window. - render_window = vtkRenderWindow() - render_window.SetSize(900, 300) - render_window.SetWindowName("ExtractSelectedIds") - - # And one interactor. - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - # Define viewport ranges. - # (xmin, ymin, xmax, ymax) - left_viewport = [0.0, 0.0, 0.33, 1.0] - center_viewport = [0.33, 0.0, 0.66, 1.0] - right_viewport = [0.66, 0.0, 1.0, 1.0] - - # Create a camera for all renderers. - camera = vtkCamera() - - # Setup the renderers - left_renderer = vtkRenderer() - render_window.AddRenderer(left_renderer) - left_renderer.SetViewport(left_viewport) - left_renderer.SetBackground(colors.GetColor3d("BurlyWood")) - left_renderer.SetActiveCamera(camera) - - center_renderer = vtkRenderer() - render_window.AddRenderer(center_renderer) - center_renderer.SetViewport(center_viewport) - center_renderer.SetBackground(colors.GetColor3d("orchid_dark")) - center_renderer.SetActiveCamera(camera) - - right_renderer = vtkRenderer() - render_window.AddRenderer(right_renderer) - right_renderer.SetViewport(right_viewport) - right_renderer.SetBackground(colors.GetColor3d("CornflowerBlue")) - right_renderer.SetActiveCamera(camera) - - left_renderer.AddActor(input_actor) - center_renderer.AddActor(selected_actor) - right_renderer.AddActor(not_selected_actor) - - left_renderer.ResetCamera() - - render_window.Render() - interactor.Start() - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/PolyData/ExtractSelectionUsingCells.py b/data/examples/PolyData/ExtractSelectionUsingCells.py deleted file mode 100755 index 968bb31..0000000 --- a/data/examples/PolyData/ExtractSelectionUsingCells.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdTypeArray -from vtkmodules.vtkCommonDataModel import ( - vtkSelection, - vtkSelectionNode, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersExtraction import vtkExtractSelection -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkDataSetMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) - # colors.SetColor('centreBkg', [0.3, 0.1, 0.4, 1.0]) - # colors.SetColor('rightBkg', [0.4, 0.5, 0.6, 1.0]) - - sphereSource = vtkSphereSource() - sphereSource.Update() - - print('There are %s input points' % sphereSource.GetOutput().GetNumberOfPoints()) - print('There are %s input cells' % sphereSource.GetOutput().GetNumberOfCells()) - - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - - # Specify that we want to extract cells 10 through 19 - i = 10 - while i < 20: - ids.InsertNextValue(i) - i += 1 - - selectionNode = vtkSelectionNode() - selectionNode.SetFieldType(vtkSelectionNode.CELL) - selectionNode.SetContentType(vtkSelectionNode.INDICES) - selectionNode.SetSelectionList(ids) - - selection = vtkSelection() - selection.AddNode(selectionNode) - - extractSelection = vtkExtractSelection() - extractSelection.SetInputConnection(0, sphereSource.GetOutputPort()) - extractSelection.SetInputData(1, selection) - extractSelection.Update() - - # In selection - selected = vtkUnstructuredGrid() - selected.ShallowCopy(extractSelection.GetOutput()) - - print('There are %s points in the selection' % selected.GetNumberOfPoints()) - print('There are %s cells in the selection' % selected.GetNumberOfCells()) - - # Get points that are NOT in the selection - selectionNode.GetProperties().Set(vtkSelectionNode.INVERSE(), 1) # invert the selection - extractSelection.Update() - - notSelected = vtkUnstructuredGrid() - notSelected.ShallowCopy(extractSelection.GetOutput()) - - print('There are %s points NOT in the selection' % notSelected.GetNumberOfPoints()) - print('There are %s cells NOT in the selection' % notSelected.GetNumberOfCells()) - - backfaces = vtkProperty() - backfaces.SetColor(colors.GetColor3d('Gold')) - - inputMapper = vtkDataSetMapper() - inputMapper.SetInputConnection(sphereSource.GetOutputPort()) - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.SetBackfaceProperty(backfaces) - inputActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - selectedMapper = vtkDataSetMapper() - selectedMapper.SetInputData(selected) - - selectedActor = vtkActor() - selectedActor.SetMapper(selectedMapper) - selectedActor.SetBackfaceProperty(backfaces) - selectedActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - notSelectedMapper = vtkDataSetMapper() - notSelectedMapper.SetInputData(notSelected) - - notSelectedActor = vtkActor() - notSelectedActor.SetMapper(notSelectedMapper) - notSelectedActor.SetBackfaceProperty(backfaces) - notSelectedActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(900, 300) - renderWindow.SetWindowName('ExtractSelectionCells') - - # And one interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - leftViewport = [0.0, 0.0, 0.33, 1.0] - centerViewport = [0.33, 0.0, 0.66, 1.0] - rightViewport = [0.66, 0.0, 1.0, 1.0] - - # Create a camera for all renderers - camera = vtkCamera() - - # Setup the renderers - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) - leftRenderer.SetBackground(colors.GetColor3d('BurlyWood')) - leftRenderer.SetActiveCamera(camera) - - centerRenderer = vtkRenderer() - renderWindow.AddRenderer(centerRenderer) - centerRenderer.SetViewport(centerViewport) - centerRenderer.SetBackground(colors.GetColor3d('orchid_dark')) - centerRenderer.SetActiveCamera(camera) - - rightRenderer = vtkRenderer() - renderWindow.AddRenderer(rightRenderer) - rightRenderer.SetViewport(rightViewport) - rightRenderer.SetBackground(colors.GetColor3d('CornflowerBlue')) - rightRenderer.SetActiveCamera(camera) - - leftRenderer.AddActor(inputActor) - centerRenderer.AddActor(selectedActor) - rightRenderer.AddActor(notSelectedActor) - - leftRenderer.ResetCamera() - - renderWindow.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/FilledPolygon.py b/data/examples/PolyData/FilledPolygon.py deleted file mode 100755 index 67a4b2f..0000000 --- a/data/examples/PolyData/FilledPolygon.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkPlane, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import ( - vtkCutter, - vtkFeatureEdges, - vtkStripper -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a cube - cube = vtkSphereSource() - cube.SetRadius(50) - cube.SetThetaResolution(100) - cube.SetPhiResolution(100) - - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cube.GetOutputPort()) - - # create a plane to cut,here it cuts in the XZ direction (xz normal=(1,0,0);XY =(0,0,1),YZ =(0,1,0) - plane = vtkPlane() - plane.SetOrigin(20, 0, 0) - plane.SetNormal(1, 0, 0) - - # create cutter - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputConnection(cube.GetOutputPort()) - cutter.Update() - - FeatureEdges = vtkFeatureEdges() - FeatureEdges.SetInputConnection(cutter.GetOutputPort()) - FeatureEdges.BoundaryEdgesOn() - FeatureEdges.FeatureEdgesOff() - FeatureEdges.NonManifoldEdgesOff() - FeatureEdges.ManifoldEdgesOff() - FeatureEdges.Update() - - cutStrips = vtkStripper() # Forms loops (closed polylines) from cutter - cutStrips.SetInputConnection(cutter.GetOutputPort()) - cutStrips.Update() - cutPoly = vtkPolyData() # This trick defines polygons as polyline loop - cutPoly.SetPoints((cutStrips.GetOutput()).GetPoints()) - cutPoly.SetPolys((cutStrips.GetOutput()).GetLines()) - - cutMapper = vtkPolyDataMapper() - # cutMapper.SetInput(FeatureEdges.GetOutput()) - cutMapper.SetInputData(cutPoly) - - backface = vtkProperty() - backface.SetColor(colors.GetColor3d('Gold')) - - cutActor = vtkActor() - cutActor.SetMapper(cutMapper) - cutActor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - cutActor.GetProperty().SetEdgeColor(colors.GetColor3d('Red')) - cutActor.GetProperty().SetLineWidth(2) - cutActor.GetProperty().EdgeVisibilityOn() - # cutActor.GetProperty().SetOpacity(0.7) - cutActor.SetBackfaceProperty(backface) - - # create renderers and add actors of plane and cube - ren = vtkRenderer() - ren.AddActor(cutActor) - - # Add renderer to renderwindow and render - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(600, 400) - renWin.SetWindowName('FilledPolygon') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - ren.SetBackground(colors.GetColor3d('DarkSlateGray')) - ren.GetActiveCamera().SetPosition(223, -122, -91) - renWin.Render() - - camera = ren.GetActiveCamera() - camera.SetPosition(151.519511, 12.795117, -223.586044) - camera.SetFocalPoint(12.518283, 1.963242, 7.618042) - camera.SetViewUp(0.740690, -0.523767, 0.420769) - camera.SetDistance(269.988889) - camera.SetClippingRange(175.347580, 366.490816) - camera.Zoom(1.5) - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/ImplicitPolyDataDistance.py b/data/examples/PolyData/ImplicitPolyDataDistance.py deleted file mode 100755 index 4294bd4..0000000 --- a/data/examples/PolyData/ImplicitPolyDataDistance.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkImplicitPolyDataDistance -from vtkmodules.vtkFiltersGeneral import vtkVertexGlyphFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(1.0) - sphereSource.Update() - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphereSource.GetOutputPort()) - sphereMapper.ScalarVisibilityOff() - - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetOpacity(0.3) - sphereActor.GetProperty().SetColor(1, 0, 0) - - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(sphereSource.GetOutput()) - - # Setup a grid - points = vtkPoints() - step = 0.1 - for x in np.arange(-2, 2, step): - for y in np.arange(-2, 2, step): - for z in np.arange(-2, 2, step): - points.InsertNextPoint(x, y, z) - - # Add distances to each point - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(points.GetNumberOfPoints()): - p = points.GetPoint(pointId) - signedDistance = implicitPolyDataDistance.EvaluateFunction(p) - signedDistances.InsertNextValue(signedDistance) - - polyData = vtkPolyData() - polyData.SetPoints(points) - polyData.GetPointData().SetScalars(signedDistances) - - vertexGlyphFilter = vtkVertexGlyphFilter() - vertexGlyphFilter.SetInputData(polyData) - vertexGlyphFilter.Update() - - signedDistanceMapper = vtkPolyDataMapper() - signedDistanceMapper.SetInputConnection(vertexGlyphFilter.GetOutputPort()) - signedDistanceMapper.ScalarVisibilityOn() - - signedDistanceActor = vtkActor() - signedDistanceActor.SetMapper(signedDistanceMapper) - - renderer = vtkRenderer() - renderer.AddViewProp(sphereActor) - renderer.AddViewProp(signedDistanceActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('ImplicitPolyDataDistance') - - renWinInteractor = vtkRenderWindowInteractor() - renWinInteractor.SetRenderWindow(renderWindow) - - renderWindow.Render() - renWinInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/IterateOverLines.py b/data/examples/PolyData/IterateOverLines.py deleted file mode 100755 index b4b2524..0000000 --- a/data/examples/PolyData/IterateOverLines.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import ( - vtkIdList, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) - - -def main(): - origin = [0.0, 0.0, 0.0] - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] - p2 = [0.0, 1.0, 2.0] - p3 = [1.0, 2.0, 3.0] - - # Create a vtkPoints object and store the points in it. - points = vtkPoints() - points.InsertNextPoint(origin) - points.InsertNextPoint(p0) - points.InsertNextPoint(p1) - points.InsertNextPoint(p2) - points.InsertNextPoint(p3) - - # Create a cell array to store the lines in and add the lines to it. - lines = vtkCellArray() - - # Create four lines. - for i in range(4): - line = vtkLine() - line.GetPointIds().SetId(0, i) - line.GetPointIds().SetId(1, i + 1) - lines.InsertNextCell(line) - - # Create a polydata to store everything in. - linesPolyData = vtkPolyData() - - # Add the points to the dataset. - linesPolyData.SetPoints(points) - - # Add the lines to the dataset. - linesPolyData.SetLines(lines) - - print('There are {0} lines.'.format(linesPolyData.GetNumberOfLines())) - - linesPolyData.GetLines().InitTraversal() - idList = vtkIdList() - while (linesPolyData.GetLines().GetNextCell(idList)): - print('Line has {0} points'.format(idList.GetNumberOfIds())) - for pointId in range(idList.GetNumberOfIds() - 1): - print('{0} {1}'.format(idList.GetId(pointId), idList.GetId(pointId + 1))) - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/Outline.py b/data/examples/PolyData/Outline.py deleted file mode 100755 index 5701479..0000000 --- a/data/examples/PolyData/Outline.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('Outline') - - renWin.AddRenderer(ren) - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create source - source = vtkConeSource() - source.SetCenter(0, 0, 0) - source.SetResolution(100) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # actor - actor1 = vtkActor() - actor1.SetMapper(mapper) - actor1.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # outline - outline = vtkOutlineFilter() - outline.SetInputConnection(source.GetOutputPort()) - mapper2 = vtkPolyDataMapper() - mapper2.SetInputConnection(outline.GetOutputPort()) - - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # assign actor to the renderer - ren.AddActor(actor1) - ren.AddActor(actor2) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/PointSource.py b/data/examples/PolyData/PointSource.py deleted file mode 100755 index 71b4a4f..0000000 --- a/data/examples/PolyData/PointSource.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('PointSource') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create a point cloud - src = vtkPointSource() - src.SetCenter(0, 0, 0) - src.SetNumberOfPoints(50) - src.SetRadius(5) - src.Update() - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(src.GetOutputPort()) - - # actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - actor.GetProperty().SetPointSize(4) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('DarkGreen')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/PolyDataContourToImageData.md b/data/examples/PolyData/PolyDataContourToImageData.md deleted file mode 100644 index a429d25..0000000 --- a/data/examples/PolyData/PolyDataContourToImageData.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description -* Contributed by: Lars Friedrich, Peter Gruber - -This example generates a sphere, cuts it with a plane and, therefore, generates a circlular contour (vtkPolyData). Subsequently a binary image representation (vtkImageData) is extracted from it. Internally vtkPolyDataToImageStencil and vtkLinearExtrusionFilter are utilized. -Both the circular poly data (circle.vtp) and the resultant image (labelImage.mhd) are saved to disk. - -!!! note - Similarily to example [PolyDataToImageStencil](../PolyDataToImageDataStencil), I am not really sure whether or not the image origin needs to be adjusted as the sphere-image-overlay shows some offset in paraview visualization (at least I think ...). Maybe someone could verify that. Thanks! diff --git a/data/examples/PolyData/PolyDataContourToImageData.py b/data/examples/PolyData/PolyDataContourToImageData.py deleted file mode 100755 index fb125ff..0000000 --- a/data/examples/PolyData/PolyDataContourToImageData.py +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env python - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import VTK_UNSIGNED_CHAR -from vtkmodules.vtkCommonDataModel import ( - vtkImageData, - vtkPlane -) -from vtkmodules.vtkFiltersCore import ( - vtkCutter, - vtkStripper -) -from vtkmodules.vtkFiltersModeling import vtkLinearExtrusionFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkMetaImageWriter, - vtkPNGWriter -) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter -from vtkmodules.vtkImagingStencil import ( - vtkImageStencil, - vtkPolyDataToImageStencil -) - - -def main(): - # 3D source sphere - sphereSource = vtkSphereSource() - sphereSource.SetPhiResolution(30) - sphereSource.SetThetaResolution(30) - sphereSource.SetCenter(40, 40, 0) - sphereSource.SetRadius(20) - - # generate circle by cutting the sphere with an implicit plane - # (through its center, axis-aligned) - circleCutter = vtkCutter() - circleCutter.SetInputConnection(sphereSource.GetOutputPort()) - cutPlane = vtkPlane() - cutPlane.SetOrigin(sphereSource.GetCenter()) - cutPlane.SetNormal(0, 0, 1) - circleCutter.SetCutFunction(cutPlane) - - stripper = vtkStripper() - stripper.SetInputConnection(circleCutter.GetOutputPort()) # valid circle - stripper.Update() - - # that's our circle - circle = stripper.GetOutput() - - # write circle out - polyDataWriter = vtkXMLPolyDataWriter() - polyDataWriter.SetInputData(circle) - - polyDataWriter.SetFileName('circle.vtp') - polyDataWriter.SetCompressorTypeToNone() - polyDataWriter.SetDataModeToAscii() - polyDataWriter.Write() - - # prepare the binary image's voxel grid - whiteImage = vtkImageData() - bounds = [0] * 6 - circle.GetBounds(bounds) - spacing = [0] * 3 # desired volume spacing - spacing[0] = 0.5 - spacing[1] = 0.5 - spacing[2] = 0.5 - whiteImage.SetSpacing(spacing) - - # compute dimensions - dim = [0] * 3 - for i in range(3): - dim[i] = int(math.ceil((bounds[i * 2 + 1] - bounds[i * 2]) / spacing[i])) + 1 - if dim[i] < 1: - dim[i] = 1 - whiteImage.SetDimensions(dim) - whiteImage.SetExtent(0, dim[0] - 1, 0, dim[1] - 1, 0, dim[2] - 1) - origin = [0] * 3 - # NOTE: I am not sure whether or not we had to add some offset! - origin[0] = bounds[0] # + spacing[0] / 2 - origin[1] = bounds[2] # + spacing[1] / 2 - origin[2] = bounds[4] # + spacing[2] / 2 - whiteImage.SetOrigin(origin) - whiteImage.AllocateScalars(VTK_UNSIGNED_CHAR, 1) - - # fill the image with foreground voxels: - inval = 255 - outval = 0 - count = whiteImage.GetNumberOfPoints() - # for (vtkIdType i = 0 i < count ++i) - for i in range(count): - whiteImage.GetPointData().GetScalars().SetTuple1(i, inval) - - # sweep polygonal data (this is the important thing with contours!) - extruder = vtkLinearExtrusionFilter() - extruder.SetInputData(circle) - extruder.SetScaleFactor(1.0) - # extruder.SetExtrusionTypeToNormalExtrusion() - extruder.SetExtrusionTypeToVectorExtrusion() - extruder.SetVector(0, 0, 1) - extruder.Update() - - # polygonal data -. image stencil: - pol2stenc = vtkPolyDataToImageStencil() - pol2stenc.SetTolerance(0) # important if extruder.SetVector(0, 0, 1) !!! - pol2stenc.SetInputConnection(extruder.GetOutputPort()) - pol2stenc.SetOutputOrigin(origin) - pol2stenc.SetOutputSpacing(spacing) - pol2stenc.SetOutputWholeExtent(whiteImage.GetExtent()) - pol2stenc.Update() - - # cut the corresponding white image and set the background: - imgstenc = vtkImageStencil() - imgstenc.SetInputData(whiteImage) - imgstenc.SetStencilConnection(pol2stenc.GetOutputPort()) - imgstenc.ReverseStencilOff() - imgstenc.SetBackgroundValue(outval) - imgstenc.Update() - - imageWriter = vtkMetaImageWriter() - imageWriter.SetFileName('labelImage.mhd') - imageWriter.SetInputConnection(imgstenc.GetOutputPort()) - imageWriter.Write() - - imageWriter = vtkPNGWriter() - imageWriter.SetFileName('labelImage.png') - imageWriter.SetInputConnection(imgstenc.GetOutputPort()) - imageWriter.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/PolyDataToImageDataStencil.md b/data/examples/PolyData/PolyDataToImageDataStencil.md deleted file mode 100644 index 7fb09e1..0000000 --- a/data/examples/PolyData/PolyDataToImageDataStencil.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This is an example from the vtkPolyDataToImageStencil tests. It converts polydata to imagedata and masks the given imagedata. diff --git a/data/examples/PolyData/PolyDataToImageDataStencil.py b/data/examples/PolyData/PolyDataToImageDataStencil.py deleted file mode 100755 index 7b91e76..0000000 --- a/data/examples/PolyData/PolyDataToImageDataStencil.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import ( - vtkCutter, - vtkImageAppend, - vtkStripper, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import vtkPNGReader -from vtkmodules.vtkImagingStencil import ( - vtkImageStencil, - vtkPolyDataToImageStencil -) -from vtkmodules.vtkInteractionImage import vtkImageViewer -from vtkmodules.vtkRenderingCore import vtkRenderWindowInteractor - - -def get_program_parameters(): - import argparse - description = 'Converts the polydata to imagedata and masks the given imagedata.' - epilogue = ''' - Contributed by: Peter Gruber - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A filename e.g. fullhead15.png.') - args = parser.parse_args() - return args.filename - - -def main(): - fn = get_program_parameters() - # A script to test the stencil filter with a polydata stencil. - # Image pipeline - reader = vtkPNGReader() - reader.SetDataSpacing(0.8, 0.8, 1.5) - reader.SetDataOrigin(0.0, 0.0, 0.0) - reader.SetFileName(fn) - sphere = vtkSphereSource() - sphere.SetPhiResolution(12) - sphere.SetThetaResolution(12) - sphere.SetCenter(102, 102, 0) - sphere.SetRadius(60) - triangle = vtkTriangleFilter() - triangle.SetInputConnection(sphere.GetOutputPort()) - - stripper = vtkStripper() - stripper.SetInputConnection(triangle.GetOutputPort()) - dataToStencil = vtkPolyDataToImageStencil() - dataToStencil.SetInputConnection(stripper.GetOutputPort()) - dataToStencil.SetOutputSpacing(0.8, 0.8, 1.5) - dataToStencil.SetOutputOrigin(0.0, 0.0, 0.0) - - stencil = vtkImageStencil() - stencil.SetInputConnection(reader.GetOutputPort()) - stencil.SetStencilConnection(dataToStencil.GetOutputPort()) - stencil.ReverseStencilOn() - stencil.SetBackgroundValue(500) - - # test again with a contour - reader2 = vtkPNGReader() - reader2.SetDataSpacing(0.8, 0.8, 1.5) - reader2.SetDataOrigin(0.0, 0.0, 0.0) - reader2.SetFileName(fn) - plane = vtkPlane() - plane.SetOrigin(0, 0, 0) - plane.SetNormal(0, 0, 1) - cutter = vtkCutter() - cutter.SetInputConnection(sphere.GetOutputPort()) - cutter.SetCutFunction(plane) - stripper2 = vtkStripper() - stripper2.SetInputConnection(cutter.GetOutputPort()) - dataToStencil2 = vtkPolyDataToImageStencil() - dataToStencil2.SetInputConnection(stripper2.GetOutputPort()) - dataToStencil2.SetOutputSpacing(0.8, 0.8, 1.5) - dataToStencil2.SetOutputOrigin(0.0, 0.0, 0.0) - stencil2 = vtkImageStencil() - stencil2.SetInputConnection(reader2.GetOutputPort()) - stencil2.SetStencilConnection(dataToStencil2.GetOutputPort()) - stencil2.SetBackgroundValue(500) - - imageAppend = vtkImageAppend() - imageAppend.SetInputConnection(stencil.GetOutputPort()) - imageAppend.AddInputConnection(stencil2.GetOutputPort()) - - viewer = vtkImageViewer() - interator = vtkRenderWindowInteractor() - viewer.SetInputConnection(imageAppend.GetOutputPort()) - viewer.SetupInteractor(interator) - viewer.SetZSlice(0) - viewer.SetColorWindow(2000) - viewer.SetColorLevel(1000) - viewer.GetRenderWindow().SetWindowName('PolyDataToImageDataStencil') - viewer.Render() - - interator.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/RotationAroundLine.md b/data/examples/PolyData/RotationAroundLine.md deleted file mode 100644 index a169b75..0000000 --- a/data/examples/PolyData/RotationAroundLine.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -NOTE: this example shows both the original and the rotated object using different colors. Not exactly equivalent to the C++ example with the same name. diff --git a/data/examples/PolyData/RotationAroundLine.py b/data/examples/PolyData/RotationAroundLine.py deleted file mode 100755 index dffada8..0000000 --- a/data/examples/PolyData/RotationAroundLine.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkArrowSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(640, 480) - renWin.SetWindowName('RotationAroundLine') - - # Create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create arrow - source = vtkArrowSource() - - # Create a transform that rotates the arrow 45° around the z-axis - transform = vtkTransform() - transform.RotateWXYZ(45, 0, 0, 1) - transformFilter = vtkTransformPolyDataFilter() - transformFilter.SetTransform(transform) - transformFilter.SetInputConnection(source.GetOutputPort()) - transformFilter.Update() - - # Mapper for the original arrow - coneMapper1 = vtkPolyDataMapper() - coneMapper1.SetInputConnection(source.GetOutputPort()) - - # Another mapper for the rotated arrow - coneMapper2 = vtkPolyDataMapper() - coneMapper2.SetInputConnection(transformFilter.GetOutputPort()) - - # Actor for original arrow - actor1 = vtkActor() - actor1.SetMapper(coneMapper1) - - # Actor for rotated arrow - actor2 = vtkActor() - actor2.SetMapper(coneMapper2) - - # Color the original arrow - actor1.GetProperty().SetColor(colors.GetColor3d('LightCoral')) - # Color rotated arrow - actor2.GetProperty().SetColor(colors.GetColor3d('PaleTurquoise')) - - # Assign actor to the renderer - ren.AddActor(actor1) - ren.AddActor(actor2) - ren.SetBackground(colors.GetColor3d('SlateGray')); - - # Enable the user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/RuledSurfaceFilter.py b/data/examples/PolyData/RuledSurfaceFilter.py deleted file mode 100755 index 57c1bcd..0000000 --- a/data/examples/PolyData/RuledSurfaceFilter.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) -from vtkmodules.vtkFiltersModeling import vtkRuledSurfaceFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - # Create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the points for the lines. - points = vtkPoints() - points.InsertPoint(0, 0, 0, 1) - points.InsertPoint(1, 1, 0, 0) - points.InsertPoint(2, 0, 1, 0) - points.InsertPoint(3, 1, 1, 1) - - # Create line1 - line1 = vtkLine() - line1.GetPointIds().SetId(0, 0) - line1.GetPointIds().SetId(1, 1) - - # Create line2 - line2 = vtkLine() - line2.GetPointIds().SetId(0, 2) - line2.GetPointIds().SetId(1, 3) - - # Create a cellArray containing the lines - lines = vtkCellArray() - lines.InsertNextCell(line1) - lines.InsertNextCell(line2) - - # Create the vtkPolyData to contain the points and cellArray with the lines - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetLines(lines) - - # Create the ruledSurfaceFilter from the polydata containing the lines - ruledSurfaceFilter = vtkRuledSurfaceFilter() - ruledSurfaceFilter.SetInputData(polydata) - ruledSurfaceFilter.SetResolution(21, 21) - ruledSurfaceFilter.SetRuledModeToResample() - - # Create the mapper with the ruledSurfaceFilter as input - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(ruledSurfaceFilter.GetOutputPort()) - - # Create the actor with the mapper - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - - # Add the actor to the display - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d("SteelBlue")) - renWin.SetWindowName('RuledSurfaceFilter') - - # Enable user interface interactor - iren.Initialize() - renWin.Render() - # ren.GetActiveCamera().SetPosition(3.7, -0.5, -0.5) - # ren.GetActiveCamera().SetFocalPoint(0.5, 0.5, 0.5) - # ren.GetActiveCamera().SetViewUp(-0.3, 0.1, -1.0) - ren.GetActiveCamera().Azimuth(60) - ren.GetActiveCamera().Elevation(60) - ren.ResetCamera() - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/SmoothMeshGrid.md b/data/examples/PolyData/SmoothMeshGrid.md deleted file mode 100644 index e25771c..0000000 --- a/data/examples/PolyData/SmoothMeshGrid.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -Create a terrain with regularly spaced points. The triangles are created manually. Then different types of smoothing filters are used to smooth the terrain. - -Left : initial terrain, middle : vtkLoopSubdivisionFilter, right : vtkButterflySubdivisionFilter - -* Contributed by Michka Popoff, with the help of Bill Lorensen and madz (madaramh). diff --git a/data/examples/PolyData/SmoothMeshGrid.py b/data/examples/PolyData/SmoothMeshGrid.py deleted file mode 100755 index bcfc4f6..0000000 --- a/data/examples/PolyData/SmoothMeshGrid.py +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env python - -import numpy -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangle -) -from vtkmodules.vtkFiltersCore import vtkCleanPolyData -from vtkmodules.vtkFiltersModeling import ( - vtkButterflySubdivisionFilter, - vtkLoopSubdivisionFilter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - nc = vtkNamedColors() - - # Make a 32 x 32 grid - size = 32 - - rn = vtkMinimalStandardRandomSequence() - rn.SetSeed(1) - - # Define z values for the topography (random height) - topography = numpy.zeros([size, size]) - for i in range(size): - for j in range(size): - topography[i][j] = rn.GetRangeValue(0, 5) - rn.Next() - - # Define points, triangles and colors - colors = vtkUnsignedCharArray() - colors.SetNumberOfComponents(3) - points = vtkPoints() - triangles = vtkCellArray() - - # Build the meshgrid manually - count = 0 - for i in range(size - 1): - for j in range(size - 1): - z1 = topography[i][j] - z2 = topography[i][j + 1] - z3 = topography[i + 1][j] - - # Triangle 1 - points.InsertNextPoint(i, j, z1) - points.InsertNextPoint(i, (j + 1), z2) - points.InsertNextPoint((i + 1), j, z3) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, count) - triangle.GetPointIds().SetId(1, count + 1) - triangle.GetPointIds().SetId(2, count + 2) - - triangles.InsertNextCell(triangle) - - z1 = topography[i][j + 1] - z2 = topography[i + 1][j + 1] - z3 = topography[i + 1][j] - - # Triangle 2 - points.InsertNextPoint(i, (j + 1), z1) - points.InsertNextPoint((i + 1), (j + 1), z2) - points.InsertNextPoint((i + 1), j, z3) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, count + 3) - triangle.GetPointIds().SetId(1, count + 4) - triangle.GetPointIds().SetId(2, count + 5) - - count += 6 - - triangles.InsertNextCell(triangle) - - # Add some color - r = [int(i / float(size) * 255), int(j / float(size) * 255), 0] - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - colors.InsertNextTypedTuple(r) - - # Create a polydata object - trianglePolyData = vtkPolyData() - - # Add the geometry and topology to the polydata - trianglePolyData.SetPoints(points) - trianglePolyData.GetPointData().SetScalars(colors) - trianglePolyData.SetPolys(triangles) - - # Clean the polydata so that the edges are shared ! - cleanPolyData = vtkCleanPolyData() - cleanPolyData.SetInputData(trianglePolyData) - - # Use a filter to smooth the data (will add triangles and smooth) - # Use two different filters to show the difference - smooth_loop = vtkLoopSubdivisionFilter() - smooth_loop.SetNumberOfSubdivisions(3) - smooth_loop.SetInputConnection(cleanPolyData.GetOutputPort()) - smooth_butterfly = vtkButterflySubdivisionFilter() - smooth_butterfly.SetNumberOfSubdivisions(3) - smooth_butterfly.SetInputConnection(cleanPolyData.GetOutputPort()) - - # Create a mapper and actor for initial dataset - mapper = vtkPolyDataMapper() - mapper.SetInputData(trianglePolyData) - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a mapper and actor for smoothed dataset (vtkLoopSubdivisionFilter) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(smooth_loop.GetOutputPort()) - actor_loop = vtkActor() - actor_loop.SetMapper(mapper) - actor_loop.SetPosition(32, 0, 0) - - # Create a mapper and actor for smoothed dataset (vtkButterflySubdivisionFilter) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(smooth_butterfly.GetOutputPort()) - actor_butterfly = vtkActor() - actor_butterfly.SetMapper(mapper) - actor_butterfly.SetPosition(64, 0, 0) - - # Visualise - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add actors and render - renderer.AddActor(actor) - renderer.AddActor(actor_loop) - renderer.AddActor(actor_butterfly) - renderer.SetBackground(nc.GetColor3d('AliceBlue')) - - renderWindow.SetSize(900, 300) - renderWindow.Render() - renderer.GetActiveCamera().Elevation(-45) - renderer.GetActiveCamera().Zoom(3) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/SolidColoredTriangle.py b/data/examples/PolyData/SolidColoredTriangle.py deleted file mode 100755 index a1d15d7..0000000 --- a/data/examples/PolyData/SolidColoredTriangle.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkTriangle -) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate a solid colored triangle and write it to a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestSolidColorTriangle.vtp', - type=str, default='TestSolidColorTriangle.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() - Triangles = vtkCellArray() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - - Triangle = vtkTriangle() - Triangle.GetPointIds().SetId(0, 0) - Triangle.GetPointIds().SetId(1, 1) - Triangle.GetPointIds().SetId(2, 2) - Triangles.InsertNextCell(Triangle) - - # Setup colors (setting the name to "Colors" is nice but not necessary) - Colors = vtkUnsignedCharArray() - Colors.SetNumberOfComponents(3) - Colors.SetName("Colors") - Colors.InsertNextTuple3(*colors.GetColor3ub('Red')) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.SetPolys(Triangles) - - polydata.GetCellData().SetScalars(Colors) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/TriangleColoredPoints.py b/data/examples/PolyData/TriangleColoredPoints.py deleted file mode 100755 index e01bd7d..0000000 --- a/data/examples/PolyData/TriangleColoredPoints.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkPoints, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate a triangle with colored points and write it to a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestTriangleColoredPoints.vtp', - type=str, default='TestTriangleColoredPoints.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() - Vertices = vtkCellArray() - - id = Points.InsertNextPoint(1.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 1.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - - # setup colors - Colors = vtkUnsignedCharArray() - Colors.SetNumberOfComponents(3) - Colors.SetName("Colors") - Colors.InsertNextTuple3(*colors.GetColor3ub('Red')) - Colors.InsertNextTuple3(*colors.GetColor3ub('LimeGreen')) - Colors.InsertNextTuple3(*colors.GetColor3ub('Blue')) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.SetVerts(Vertices) - polydata.GetPointData().SetScalars(Colors) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/TriangleCornerVertices.py b/data/examples/PolyData/TriangleCornerVertices.py deleted file mode 100755 index 67d4db1..0000000 --- a/data/examples/PolyData/TriangleCornerVertices.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate triangle polydata, then write a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestTriangleCornerVertices.vtp', - type=str, default='TestTriangleCornerVertices.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - filename = get_program_parameters() - - Points = vtkPoints() - Vertices = vtkCellArray() - - id = Points.InsertNextPoint(1.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 1.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.SetVerts(Vertices) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/TriangleCorners.py b/data/examples/PolyData/TriangleCorners.py deleted file mode 100755 index 9b7389c..0000000 --- a/data/examples/PolyData/TriangleCorners.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkIOXML import vtkXMLPolyDataWriter - - -def get_program_parameters(): - import argparse - description = 'Generate triangle points, then write a .vtp file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required vtp filename.', nargs='?', - const='TestTriangleCorners.vtp', - type=str, default='TestTriangleCorners.vtp') - args = parser.parse_args() - return args.filename - - -def main(): - filename = get_program_parameters() - - Points = vtkPoints() - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - - polydata = vtkPolyData() - polydata.SetPoints(Points) - polydata.Modified() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName(filename) - writer.SetInputData(polydata) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/TubeFilter.md b/data/examples/PolyData/TubeFilter.md deleted file mode 100644 index cd88363..0000000 --- a/data/examples/PolyData/TubeFilter.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example creates a tube around a line. This is helpful because when you zoom the camera, the thickness of a line remains constant, while the thickness of a tube varies. diff --git a/data/examples/PolyData/TubeFilter.py b/data/examples/PolyData/TubeFilter.py deleted file mode 100755 index b6ea291..0000000 --- a/data/examples/PolyData/TubeFilter.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python - -# This example creates a tube around a line. -# This is helpful because when you zoom the camera, -# the thickness of a line remains constant, -# while the thickness of a tube varies. - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkTubeFilter -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a line - lineSource = vtkLineSource() - lineSource.SetPoint1(1.0, 0.0, 0.0) - lineSource.SetPoint2(.0, 1.0, 0.0) - - # Setup actor and mapper - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputConnection(lineSource.GetOutputPort()) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Create tube filter - tubeFilter = vtkTubeFilter() - tubeFilter.SetInputConnection(lineSource.GetOutputPort()) - tubeFilter.SetRadius(0.025) - tubeFilter.SetNumberOfSides(50) - tubeFilter.Update() - - # Setup actor and mapper - tubeMapper = vtkPolyDataMapper() - tubeMapper.SetInputConnection(tubeFilter.GetOutputPort()) - - tubeActor = vtkActor() - tubeActor.SetMapper(tubeMapper) - # Make the tube have some transparency. - tubeActor.GetProperty().SetOpacity(0.5) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('TubeFilter') - renderWindow.AddRenderer(renderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - # Visualise the arrow - renderer.AddActor(lineActor) - renderer.AddActor(tubeActor) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - renderer.ResetCamera() - - renderWindow.SetSize(300, 300) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/PolyData/WarpVector.md b/data/examples/PolyData/WarpVector.md deleted file mode 100644 index 4b3dd64..0000000 --- a/data/examples/PolyData/WarpVector.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This script creates a vtkLine and deflects it using a vtkWarpVector. diff --git a/data/examples/PolyData/WarpVector.py b/data/examples/PolyData/WarpVector.py deleted file mode 100755 index 46a1b6d..0000000 --- a/data/examples/PolyData/WarpVector.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkLine, - vtkPolyData -) -from vtkmodules.vtkFiltersGeneral import vtkWarpVector -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(2.0, 0.0, 0.0) - points.InsertNextPoint(3.0, 0.0, 0.0) - points.InsertNextPoint(4.0, 0.0, 0.0) - - lines = vtkCellArray() - line = vtkLine() - line.GetPointIds().SetId(0, 0) - line.GetPointIds().SetId(1, 1) - lines.InsertNextCell(line) - line.GetPointIds().SetId(0, 1) - line.GetPointIds().SetId(1, 2) - lines.InsertNextCell(line) - line.GetPointIds().SetId(0, 2) - line.GetPointIds().SetId(1, 3) - lines.InsertNextCell(line) - line.GetPointIds().SetId(0, 3) - line.GetPointIds().SetId(1, 4) - lines.InsertNextCell(line) - - warpData = vtkDoubleArray() - warpData.SetNumberOfComponents(3) - warpData.SetName("warpData") - warp = [0.0, 0.0, 0.0] - warp[1] = 0.0 - warpData.InsertNextTuple(warp) - warp[1] = 0.1 - warpData.InsertNextTuple(warp) - warp[1] = 0.3 - warpData.InsertNextTuple(warp) - warp[1] = 0.0 - warpData.InsertNextTuple(warp) - warp[1] = 0.1 - warpData.InsertNextTuple(warp) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetLines(lines) - polydata.GetPointData().AddArray(warpData) - polydata.GetPointData().SetActiveVectors(warpData.GetName()) - - # WarpVector will use the array marked as active vector in polydata - # it has to be a 3 component array - # with the same number of tuples as points in polydata - warpVector = vtkWarpVector() - warpVector.SetInputData(polydata) - warpVector.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(warpVector.GetPolyDataOutput()) - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('cobalt_green')) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('WarpVector') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Problems/ImplicitFunctions/ImplicitDataSet.py b/data/examples/Problems/ImplicitFunctions/ImplicitDataSet.py deleted file mode 100755 index ccbe3e2..0000000 --- a/data/examples/Problems/ImplicitFunctions/ImplicitDataSet.py +++ /dev/null @@ -1,58 +0,0 @@ -# Example in which a cube is used to define an implicit function (through vtkImplicitDataSet) -# which is then used to clip a sphere - -import vtkmodules.all as vtk - -sphere = vtk.vtkSphereSource() -sphere.SetCenter(1, 1, 1) -sphere.SetRadius(1) -sphere.Update() - -cube = vtk.vtkCubeSource() -cube.SetBounds(-1, 1, -1, 1, -1, 1) -cube.Update() - -# Create 3D cells so vtkImplicitDataSet evaluates inside vs outside correctly -tri = vtk.vtkDelaunay3D() -tri.SetInputConnection(cube.GetOutputPort()) -tri.BoundingTriangulationOff() - -# vtkImplicitDataSet needs some scalars to interpolate to find inside/outside -elev = vtk.vtkElevationFilter() -elev.SetInputConnection(tri.GetOutputPort()) - -implicit = vtk.vtkImplicitDataSet() -implicit.SetDataSet(elev.GetOutput()) - -clipper = vtk.vtkClipPolyData() -clipper.SetClipFunction(implicit) -clipper.SetInputConnection(sphere.GetOutputPort()) -clipper.InsideOutOn() -clipper.Update() - -# Vis for clipped sphere -mapper = vtk.vtkPolyDataMapper() -mapper.SetInputConnection(clipper.GetOutputPort()) -actor = vtk.vtkActor() -actor.SetMapper(mapper) - -# Vis for cube so can see it in relation to clipped sphere -mapper2 = vtk.vtkDataSetMapper() -mapper2.SetInputConnection(elev.GetOutputPort()) -actor2 = vtk.vtkActor() -actor2.SetMapper(mapper2) -actor2.GetProperty().SetRepresentationToWireframe() - -ren1 = vtk.vtkRenderer() -ren1.AddActor(actor) -ren1.AddActor(actor2) -ren1.SetBackground(0.1, 0.2, 0.4) - -renWin = vtk.vtkRenderWindow() -renWin.AddRenderer(ren1) - -iren = vtk.vtkRenderWindowInteractor() -iren.SetRenderWindow(renWin) - -renWin.Render() -iren.Start() diff --git a/data/examples/Problems/ReadMe.md b/data/examples/Problems/ReadMe.md deleted file mode 100644 index 07a0a76..0000000 --- a/data/examples/Problems/ReadMe.md +++ /dev/null @@ -1,3 +0,0 @@ -# Problem examples - -In this folder you will find that have problems. Usually bugs that need fixing. diff --git a/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.md b/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.md deleted file mode 100644 index ec350f4..0000000 --- a/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Volume render unstructured transient data. diff --git a/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.py b/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.py deleted file mode 100755 index 34fafa8..0000000 --- a/data/examples/Problems/Visualization/UnstructuredTransientVolumeRendering.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function -import vtkmodules.all as vtk - -tse = vtk.vtkTimeSourceExample() -ex = tse.GetExecutive() -tse.UpdateInformation() - -# inspect available time range and time steps -print(ex.GetOutputInformation()) - -# make it grow because bounds are easy to inspect -# tse.SetGrowing(1) - -ex.SetUpdateTimeStep(0, 0.0) -tse.Update() -print(tse.GetOutput().GetBounds()) - -# pick some other time inside the time range -ex.SetUpdateTimeStep(0, 0.5) -tse.Update() -print(tse.GetOutput().GetBounds()) - -grid = tse.GetOutput() -print(grid) - -tri = vtk.vtkDataSetTriangleFilter() -tri.SetInputData(grid) -tri.SetTetrahedraOnly(1) -tri.Update() -output = tri.GetOutput() - -iss = output.GetPointData().SetActiveScalars("Point Label") -# iss = gridMapper.GetInput().GetCellData().SetActiveScalars(options.scalarName) -assert(iss > -1) - -drange = [0, 1] - -# Create transfer mapping scalar value to opacity. -opacityFunction = vtk.vtkPiecewiseFunction() -opacityFunction.AddPoint(drange[0], 0.0) -opacityFunction.AddPoint(drange[1], 1.0) - -# Create transfer mapping scalar value to color. -colorFunction = vtk.vtkColorTransferFunction() -colorFunction.SetColorSpaceToHSV() -colorFunction.HSVWrapOff() -colorFunction.AddRGBPoint(drange[0], 0.0, 0.0, 1.0) -colorFunction.AddRGBPoint(drange[1], 1.0, 0.0, 0.0) - -volumeProperty = vtk.vtkVolumeProperty() -volumeProperty.SetScalarOpacity(opacityFunction) -volumeProperty.SetColor(colorFunction) -volumeProperty.ShadeOff() -volumeProperty.SetInterpolationTypeToLinear() -# volumeProperty.SetScalarOpacityUnitDistance(options.unit) - -volumeMapper = vtk.vtkUnstructuredGridVolumeRayCastMapper() -# volumeMapper = vtk.vtkUnstructuredGridVolumeZSweepMapper() -# volumeMapper = vtk.vtkProjectedTetrahedraMapper() -# volumeMapper.SetBlendModeToMaximumIntensity() -volumeMapper.SetInputData(output) - -volume = vtk.vtkVolume() -volume.SetMapper(volumeMapper) -volume.SetProperty(volumeProperty) - -# create a rendering window and renderer -renderer = vtk.vtkRenderer() -renderer.SetBackground(0, 0, 0) - -window = vtk.vtkRenderWindow() -window.SetSize(512, 512) -window.AddRenderer(renderer) - -interactor = vtk.vtkRenderWindowInteractor() -interactor.SetRenderWindow(window) - -style = vtk.vtkInteractorStyleTrackballCamera() -interactor.SetInteractorStyle(style) - -renderer.AddVolume(volume) - -scalarBar = vtk.vtkScalarBarActor() -scalarBar.SetLookupTable(colorFunction) -scalarBar.SetOrientationToVertical() -scalarBar.SetPosition(0.85, 0.7) -scalarBar.SetPosition2(0.1, 0.3) -propT = vtk.vtkTextProperty() -propL = vtk.vtkTextProperty() -propT.SetFontFamilyToArial() -propT.ItalicOff() -propT.BoldOn() -propL.BoldOff() -scalarBar.SetTitleTextProperty(propT) -scalarBar.SetLabelTextProperty(propL) -scalarBar.SetLabelFormat("%5.2f") -renderer.AddActor(scalarBar) - -# setup the text and add it to the window -textActor = vtk.vtkTextActor() -textActor.GetTextProperty().SetFontSize(12) -textActor.SetPosition2(10, 40) -renderer.AddActor2D(textActor) -textActor.SetInput("time = ") -textActor.GetTextProperty().SetColor(1.0, 1.0, 1.0) - -renderer.ResetCameraClippingRange() -renderer.ResetCamera() - -counter = 1 -time = 0 -while time <= 1: - print("time = ", time) - textActor.SetInput("time = %g" % time) - - window.Render() - - # TODO FIXME if this block is not here than the volume renders wrongly - # renderer.RemoveVolume(volume) - # del volume - volume = vtk.vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - renderer.AddVolume(volume) - - counter = counter + 1 - time = time + 1. / 10 - ex.SetUpdateTimeStep(0, time) - tse.Modified() - if output.GetPointData().GetScalars(): - print(output.GetPointData().GetScalars().GetRange()) - # if grid.GetPointData().GetScalars(): - # print(grid.GetPointData().GetScalars().GetRange()) - # print(grid.GetPointData().GetScalars()) - -# while True: - # window.Render() diff --git a/data/examples/RectilinearGrid/RGrid.md b/data/examples/RectilinearGrid/RGrid.md deleted file mode 100644 index 2b3f20e..0000000 --- a/data/examples/RectilinearGrid/RGrid.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Creating a rectilinear grid dataset. The coordinates along each axis are defined using an instance of vtkDataArray. - -!!! info - See [Figure 5-20](../../../VTKBook/05Chapter5/#Figure%205-20) in [Chapter 5](../../../VTKBook/05Chapter5) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/RectilinearGrid/RGrid.py b/data/examples/RectilinearGrid/RGrid.py deleted file mode 100755 index c7f0a1b..0000000 --- a/data/examples/RectilinearGrid/RGrid.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python - -""" -This example shows how to create a rectilinear grid. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkRectilinearGrid -from vtkmodules.vtkFiltersGeometry import vtkRectilinearGridGeometryFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - x = [-1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542, -0.911458, -0.859375, -0.807292, -0.755208, - -0.703125, -0.651042, -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542, -0.286458, -0.234375, - -0.182292, -0.130209, -0.078125, -0.026042, 0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458, - 0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958, 0.651042, 0.703125, 0.755208, 0.807292, 0.859375, - 0.911458, 0.963542, 1.01562, 1.06771, 1.11979, 1.17188] - y = [-1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375, -0.78125, -0.703125, -0.625, -0.546875, -0.46875, - -0.390625, -0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125, 0.15625, 0.234375, 0.3125, 0.390625, 0.46875, - 0.546875, 0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562, 1.09375, 1.17188, 1.25] - z = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.75, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, 1.9, 2, - 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.75, 2.8, 2.9, 3, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.75, 3.8, 3.9] - print(len(x), len(y), len(z)) - - # Create a rectilinear grid by defining three arrays specifying the - # coordinates in the x-y-z directions. - xCoords = vtkDoubleArray() - for i in range(0, len(x)): - xCoords.InsertNextValue(x[i]) - yCoords = vtkDoubleArray() - for i in range(0, len(y)): - yCoords.InsertNextValue(y[i]) - zCoords = vtkDoubleArray() - for i in range(0, len(z)): - zCoords.InsertNextValue(z[i]) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, - # and ZCoordinates is equal to what is defined in SetDimensions(). - # - rgrid = vtkRectilinearGrid() - rgrid.SetDimensions(len(x), len(y), len(z)) - rgrid.SetXCoordinates(xCoords) - rgrid.SetYCoordinates(yCoords) - rgrid.SetZCoordinates(zCoords) - - # Extract a plane from the grid to see what we've got. - plane = vtkRectilinearGridGeometryFilter() - plane.SetInputData(rgrid) - plane.SetExtent(0, len(x) - 1, 16, 16, 0, len(z) - 1) - - rgridMapper = vtkPolyDataMapper() - rgridMapper.SetInputConnection(plane.GetOutputPort()) - - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetColor(colors.GetColor3d("Banana")) - wireActor.GetProperty().EdgeVisibilityOn() - - # Create the usual rendering stuff. - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - renderer.AddActor(wireActor) - renderer.SetBackground(colors.GetColor3d("Beige")) - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(60.0) - renderer.GetActiveCamera().Azimuth(30.0) - renderer.GetActiveCamera().Zoom(1.0) - - renWin.SetSize(640, 480) - renWin.SetWindowName('RGrid') - - # Interact with the data. - renWin.Render() - iren.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/RectilinearGrid/RectilinearGrid.md b/data/examples/RectilinearGrid/RectilinearGrid.md deleted file mode 100644 index ce8b4d7..0000000 --- a/data/examples/RectilinearGrid/RectilinearGrid.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Shows how to create a vtkRectilinearGrid. diff --git a/data/examples/RectilinearGrid/RectilinearGrid.py b/data/examples/RectilinearGrid/RectilinearGrid.py deleted file mode 100755 index 14f3d18..0000000 --- a/data/examples/RectilinearGrid/RectilinearGrid.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkRectilinearGrid -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a grid - grid = vtkRectilinearGrid() - grid.SetDimensions(2, 3, 1) - - xArray = vtkDoubleArray() - xArray.InsertNextValue(0.0) - xArray.InsertNextValue(2.0) - - yArray = vtkDoubleArray() - yArray.InsertNextValue(0.0) - yArray.InsertNextValue(1.0) - yArray.InsertNextValue(2.0) - - zArray = vtkDoubleArray() - zArray.InsertNextValue(0.0) - - grid.SetXCoordinates(xArray) - grid.SetYCoordinates(yArray) - grid.SetZCoordinates(zArray) - - print('There are', grid.GetNumberOfPoints(), 'points.') - print('There are', grid.GetNumberOfCells(), 'cells.') - - for id in range(0, grid.GetNumberOfPoints()): - p = [0] * 3 - p = grid.GetPoint(id) - print('Point', id, ':(', p[0], ',', p[1], ',', p[2], ')') - - # Create a mapper and actor - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('RectilinearGrid') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/RectilinearGrid/VisualizeRectilinearGrid.py b/data/examples/RectilinearGrid/VisualizeRectilinearGrid.py deleted file mode 100755 index bdadf2d..0000000 --- a/data/examples/RectilinearGrid/VisualizeRectilinearGrid.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkRectilinearGrid -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a grid - grid = vtkRectilinearGrid() - - grid.SetDimensions(2, 3, 2) - - xArray = vtkDoubleArray() - xArray.InsertNextValue(0.0) - xArray.InsertNextValue(2.0) - - yArray = vtkDoubleArray() - yArray.InsertNextValue(0.0) - yArray.InsertNextValue(1.0) - yArray.InsertNextValue(2.0) - - zArray = vtkDoubleArray() - zArray.InsertNextValue(0.0) - zArray.InsertNextValue(5.0) - - grid.SetXCoordinates(xArray) - grid.SetYCoordinates(yArray) - grid.SetZCoordinates(zArray) - - shrinkFilter = vtkShrinkFilter() - shrinkFilter.SetInputData(grid) - shrinkFilter.SetShrinkFactor(.8) - - # Create a mapper and actor - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrinkFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('VisualizeRectilinearGrid') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.GetActiveCamera().Roll(10.0) - renderer.GetActiveCamera().Elevation(60.0) - renderer.GetActiveCamera().Azimuth(30.0) - renderer.ResetCamera() - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/AmbientSpheres.md b/data/examples/Rendering/AmbientSpheres.md deleted file mode 100644 index 61c2c45..0000000 --- a/data/examples/Rendering/AmbientSpheres.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/73465690278158b9e89661cd6aed26bead781378/Examples/Rendering/Cxx/AmbientSpheres.cxx). - -!!! info - Similar examples setting the diffuse and specular properties are: - See [DiffuseSpheres.cxx](../../../Cxx/RenderingDiffuseSpheres), [DiffuseSpheres.py](../DiffuseSpheres) and [SpecularSpheres.cxx](../../../Cxx/Rendering/SpecularSpheres), [SpecularSpheres.py](../SpecularSpheres). diff --git a/data/examples/Rendering/AmbientSpheres.py b/data/examples/Rendering/AmbientSpheres.py deleted file mode 100755 index 3059e56..0000000 --- a/data/examples/Rendering/AmbientSpheres.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. - # - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(50) - - # The mapper is responsible for pushing the geometry into the graphics - # library. It may also do color mapping, if scalars or other attributes - # are defined. - # - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - # The actor is a grouping mechanism: besides the geometry (mapper), it - # also has a property, transformation matrix, and/or texture map. - # In this example we create eight different spheres (two rows of four - # spheres) and set the ambient lighting coefficients. A little ambient - # is turned on so the sphere is not completely black on the back side. - # - numberOfSpheres = 8 - spheres = list() - ambient = 0.125 - diffuse = 0.0 - specular = 0.0 - position = [0, 0, 0] - for i in range(0, numberOfSpheres): - spheres.append(vtkActor()) - spheres[i].SetMapper(sphereMapper) - spheres[i].GetProperty().SetColor(colors.GetColor3d('Red')) - spheres[i].GetProperty().SetAmbient(ambient) - spheres[i].GetProperty().SetDiffuse(diffuse) - spheres[i].GetProperty().SetSpecular(specular) - spheres[i].AddPosition(position) - ambient += 0.125 - position[0] += 1.25 - if i == 3: - position[0] = 0 - position[1] = 1.25 - - # Create the graphics structure. The renderer renders into the - # render window. The render window interactor captures mouse events - # and will perform appropriate camera or actor manipulation - # depending on the nature of the events. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - for i in range(0, numberOfSpheres): - ren.AddActor(spheres[i]) - - ren.SetBackground(colors.GetColor3d('bkg')) - renWin.SetSize(640, 480) - renWin.SetWindowName('AmbientSpheres') - - # Set up the lighting. - # - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. - # Parallel camera projection will be used. To zoom in parallel projection - # mode, the ParallelScale is set. - # - ren.GetActiveCamera().SetFocalPoint(0, 0, 0) - ren.GetActiveCamera().SetPosition(0, 0, 1) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.GetActiveCamera().ParallelProjectionOn() - ren.ResetCamera() - ren.GetActiveCamera().SetParallelScale(2.0) - # This starts the event loop and invokes an initial render. - # - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/CameraBlur.py b/data/examples/Rendering/CameraBlur.py deleted file mode 100755 index 2460594..0000000 --- a/data/examples/Rendering/CameraBlur.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('Bkg', [26, 51, 102, 255]) - - # Create the rendering objects. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline, ball and spikes. - sphere = vtkSphereSource() - sphere.SetPhiResolution(7) - sphere.SetThetaResolution(7) - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor2 = vtkActor() - sphereActor2.SetMapper(sphereMapper) - - cone = vtkConeSource() - cone.SetResolution(5) - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.25) - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(glyph.GetOutputPort()) - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor2 = vtkActor() - spikeActor2.SetMapper(spikeMapper) - - spikeActor.SetPosition(0, 0.7, 0) - sphereActor.SetPosition(0, 0.7, 0) - spikeActor2.SetPosition(0, -1.0, -10) - sphereActor2.SetPosition(0, -1.0, -10) - spikeActor2.SetScale(1.5, 1.5, 1.5) - sphereActor2.SetScale(1.5, 1.5, 1.5) - - ren1.AddActor(sphereActor) - ren1.AddActor(spikeActor) - ren1.AddActor(sphereActor2) - ren1.AddActor(spikeActor2) - ren1.SetBackground(colors.GetColor3d('Bkg')) - renWin.SetSize(300, 300) - renWin.SetWindowName('CameraBlur') - - # Do the first render and then zoom in a little. - renWin.Render() - ren1.GetActiveCamera().SetFocalPoint(0, 0, 0.0) - ren1.GetActiveCamera().Zoom(1.8) - ren1.GetActiveCamera().SetFocalDisk(0.05) - - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/ColoredSphere.md b/data/examples/Rendering/ColoredSphere.md deleted file mode 100644 index e6d9960..0000000 --- a/data/examples/Rendering/ColoredSphere.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This demonstrates a simple visualization pipeline. A polygonal representation of a sphere is created with the source object (vtkSphereSource). The sphere is passed through a filter (vtkElevationFilter) that computes the height of each point of the sphere above a plane. The plane is perpendicular to the z-axis, and passes through the point (0,0,-1). The data is finally mapped (vtkDataSetMapper) through a lookup table. The mapping process converts height value into colors, and interfaces the sphere geometry to the rendering library. The mapper is assigned to an actor, and then the actor is displayed. - -The execution of the pipeline occurs implicitly when we render the actor. Each actor asks its mapper to update itself. The mapper in turn asks its input to update itself. This process continues until a source object is encountered. Then the source will execute if modified since the last render. - -!!! info - See [Figure 4-19](../../../VTKBook/04Chapter4/#Figure%204-19) in [Chapter 4](../../../VTKBook/04Chapter4) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/ColoredSphere.py b/data/examples/Rendering/ColoredSphere.py deleted file mode 100755 index b041d4b..0000000 --- a/data/examples/Rendering/ColoredSphere.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - sphere = vtkSphereSource() - sphere.SetPhiResolution(12) - sphere.SetThetaResolution(12) - - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(sphere.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -1) - colorIt.SetHighPoint(0, 0, 1) - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('ColoredSphere') - - renWin.Render() - - # Interact with the data. - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Cone3.md b/data/examples/Rendering/Cone3.md deleted file mode 100644 index f6aecf6..0000000 --- a/data/examples/Rendering/Cone3.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -!!! info - See [Figure 3-27](../../../VTKBook/03Chapter3/#Figure%203-27) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/Cone3.py b/data/examples/Rendering/Cone3.py deleted file mode 100755 index 24defb5..0000000 --- a/data/examples/Rendering/Cone3.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# -# This example demonstrates how to use multiple renderers within a -# render window. It is a variation of the Cone1.py example. Please -# refer to that example for additional documentation. -# - -import time - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a visualization - # pipeline (it is a source process object); it produces data (output type is - # vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the cone. The actor orchestrates rendering of - # the mapper's graphics primitives. An actor also refers to properties via a - # vtkProperty instance, and includes an internal transformation matrix. We - # set this actor's mapper to be coneMapper which we created above. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # - # Create two renderers and assign actors to them. A renderer renders into a - # viewport within the vtkRenderWindow. It is part or all of a window on the - # screen and it is responsible for drawing the actors it has. We also set - # the background color here. In this example we are adding the same actor - # to two different renderers; it is okay to add different actors to - # different renderers as well. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.SetViewport(0.0, 0.0, 0.5, 1.0) - - ren2 = vtkRenderer() - ren2.AddActor(coneActor) - ren2.SetBackground(colors.GetColor3d('LightSlateGray')) - ren2.SetViewport(0.5, 0.0, 1.0, 1.0) - - # - # Finally we create the render window which will show up on the screen. - # We add our two renderers into the render window using AddRenderer. We also - # set the size to be 600 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.AddRenderer(ren2) - renWin.SetSize(600, 300) - renWin.SetWindowName('Cone3') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # Make one camera view 90 degrees from the other. - # - ren1.ResetCamera() - ren1.GetActiveCamera().Azimuth(90) - - # - # Now we loop over 60 degrees and render the cone each time. - # - for i in range(0, 60): - time.sleep(0.03) - - renWin.Render() - ren1.GetActiveCamera().Azimuth(1) - ren2.GetActiveCamera().Azimuth(1) - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Cone4.md b/data/examples/Rendering/Cone4.md deleted file mode 100644 index 0aeacd6..0000000 --- a/data/examples/Rendering/Cone4.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example modifies vtkActor's properties and transformation matrix. - -!!! info - See [Figure 3-28](../../../VTKBook/03Chapter3/#Figure%203-28) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/Cone4.py b/data/examples/Rendering/Cone4.py deleted file mode 100755 index 6f94f3c..0000000 --- a/data/examples/Rendering/Cone4.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - - -import time - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a visualization - # pipeline (it is a source process object); it produces data (output type is - # vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the first cone. The actor's properties are - # modified to give it different surface properties. By default, an actor - # is create with a property so the GetProperty() method can be used. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - coneActor.GetProperty().SetDiffuse(0.7) - coneActor.GetProperty().SetSpecular(0.4) - coneActor.GetProperty().SetSpecularPower(20) - - # - # Create a property and directly manipulate it. Assign it to the - # second actor. - # - property = vtkProperty() - property.SetColor(colors.GetColor3d('Tomato')) - property.SetDiffuse(0.7) - property.SetSpecular(0.4) - property.SetSpecularPower(20) - - # - # Create a second actor and a property. The property is directly - # manipulated and then assigned to the actor. In this way, a single - # property can be shared among many actors. Note also that we use the - # same mapper as the first actor did. This way we avoid duplicating - # geometry, which may save lots of memory if the geometry is large. - coneActor2 = vtkActor() - coneActor2.SetMapper(coneMapper) - # coneActor2.GetProperty().SetColor(colors.GetColor3d('Peacock')) - coneActor2.SetProperty(property) - coneActor2.SetPosition(0, 2, 0) - - # - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is responsible - # for drawing the actors it has. We also set the background color here. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.AddActor(coneActor2) - ren1.SetBackground(colors.GetColor3d('LightSlateGray')) - - # - # Finally we create the render window which will show up on the screen - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(640, 480) - renWin.SetWindowName('Cone4') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # Now we loop over 60 degrees and render the cone each time. - # - ren1.GetActiveCamera().Elevation(30) - ren1.ResetCamera() - for i in range(0, 60): - time.sleep(0.03) - - renWin.Render() - ren1.GetActiveCamera().Azimuth(1) - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/DiffuseSpheres.md b/data/examples/Rendering/DiffuseSpheres.md deleted file mode 100644 index cf4a115..0000000 --- a/data/examples/Rendering/DiffuseSpheres.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -!!! note - This original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/73465690278158b9e89661cd6aed26bead781378/Examples/Rendering/Cxx/DiffuseSpheres.cxx). - -!!! info - Similar examples setting the ambient and specular properties are: - See [AmbientSpheres.cxx](../../../Cxx/Rendering/AmbientSpheres), [AmbientSpheres.py](../AmbientSpheres), [AmbientSpheres.java](../../../Java/Rendering/AmbientSpheres) and [SpecularSpheres.cxx](../../../Cxx/Rendering/SpecularSpheres), [SpecularSpheres.py](../SpecularSpheres). diff --git a/data/examples/Rendering/DiffuseSpheres.py b/data/examples/Rendering/DiffuseSpheres.py deleted file mode 100755 index a2eb811..0000000 --- a/data/examples/Rendering/DiffuseSpheres.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. - # - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(50) - - # The mapper is responsible for pushing the geometry into the graphics - # library. It may also do color mapping, if scalars or other attributes - # are defined. - # - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - # The actor is a grouping mechanism: besides the geometry (mapper), it - # also has a property, transformation matrix, and/or texture map. - # In this example we create eight different spheres (two rows of four - # spheres) and set the diffuse lighting coefficients. A little ambient - # is turned on so the sphere is not completely black on the back side. - # - numberOfSpheres = 8 - spheres = list() - ambient = 0.3 - diffuse = 0.0 - specular = 0.0 - position = [0, 0, 0] - for i in range(0, numberOfSpheres): - spheres.append(vtkActor()) - spheres[i].SetMapper(sphereMapper) - spheres[i].GetProperty().SetColor(colors.GetColor3d('Red')) - spheres[i].GetProperty().SetAmbient(ambient) - spheres[i].GetProperty().SetDiffuse(diffuse) - spheres[i].GetProperty().SetSpecular(specular) - spheres[i].AddPosition(position) - diffuse += 0.125 - position[0] += 1.25 - if i == 3: - position[0] = 0 - position[1] = 1.25 - - # Create the graphics structure. The renderer renders into the - # render window. The render window interactor captures mouse events - # and will perform appropriate camera or actor manipulation - # depending on the nature of the events. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - for i in range(0, numberOfSpheres): - ren.AddActor(spheres[i]) - - ren.SetBackground(colors.GetColor3d('bkg')) - renWin.SetSize(640, 480) - renWin.SetWindowName('DiffuseSpheres') - - # Set up the lighting. - # - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. - # Parallel camera projection will be used. To zoom in parallel projection - # mode, the ParallelScale is set. - # - ren.GetActiveCamera().SetFocalPoint(0, 0, 0) - ren.GetActiveCamera().SetPosition(0, 0, 1) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.GetActiveCamera().ParallelProjectionOn() - ren.ResetCamera() - ren.GetActiveCamera().SetParallelScale(2.0) - # This starts the event loop and invokes an initial render. - # - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/FlatVersusGouraud.md b/data/examples/Rendering/FlatVersusGouraud.md deleted file mode 100644 index 10e7d3b..0000000 --- a/data/examples/Rendering/FlatVersusGouraud.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Flat and Gouraud shading. Different shading methods can dramatically improve the look of an object represented with polygons. On the top, flat shading uses a constant surface normal across each polygon. On the bottom, Gouraud shading interpolates normals from polygon vertices to give a smoother look. - -In this example, the flat and gouraud images for each pair have linked cameras. Rotate and zoom a pair to get a better look at the differences. - -!!! info - See [Figure 3-7](../../../VTKBook/03Chapter3/#Figure%203-7) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/FlatVersusGouraud.py b/data/examples/Rendering/FlatVersusGouraud.py deleted file mode 100755 index 30d7fcf..0000000 --- a/data/examples/Rendering/FlatVersusGouraud.py +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from collections import OrderedDict - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersSources import ( - vtkCylinderSource, - vtkSphereSource -) -from vtkmodules.vtkIOGeometry import vtkOBJReader -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the renderers. - renderers = OrderedDict() - renderers['flatSphereRenderer'] = CreateSphere(True) - renderers['flatCylinderRenderer'] = CreateCylinder(True) - renderers['flatIsoSurfaceRenderer'] = CreateIsoSurface(True) - renderers['flatModelRenderer'] = CreateModel(True, fileName) - - renderers['smoothSphereRenderer'] = CreateSphere(False) - renderers['smoothCylinderRenderer'] = CreateCylinder(False) - renderers['smoothIsoSurfaceRenderer'] = CreateIsoSurface(False) - renderers['smoothModelRenderer'] = CreateModel(False, fileName) - - # Get the keys - keys = list(renderers.keys()) - - renderWindow = vtkRenderWindow() - - # Setup the viewports for the renderers. - rendererSize = 256 - xGridDimensions = 4 - yGridDimensions = 2 - - renderWindow.SetSize(rendererSize * xGridDimensions, rendererSize * yGridDimensions) - renderWindow.SetWindowName('FlatVersusGouraud') - - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): - # (xmin, ymin, xmax, ymax) - viewport = [0] * 4 - viewport[0] = col / xGridDimensions - viewport[1] = (yGridDimensions - (row + 1)) / yGridDimensions - viewport[2] = (col + 1) / xGridDimensions - viewport[3] = (yGridDimensions - row) / yGridDimensions - index = row * xGridDimensions + col - renderers[keys[index]].SetViewport(viewport) - - for r in range(0, len(renderers)): - renderers[keys[r]].SetBackground(colors.GetColor3d('SlateGray')) - renderers[keys[r]].GetActiveCamera().Azimuth(20) - renderers[keys[r]].GetActiveCamera().Elevation(30) - renderers[keys[r]].ResetCamera() - if r > 3: - renderers[keys[r]].SetActiveCamera(renderers[keys[r - 4]].GetActiveCamera()) - - renderWindow.AddRenderer(renderers[keys[r]]) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Flat and Gouraud shading.' - epilogue = ''' - Flat and Gouraud shading. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='cow.obj.') - args = parser.parse_args() - return args.filename - - -def CreateSphere(flat): - ''' - - :param flat: The interpolation to use (flat or Gouraud). - :return: the renderer - ''' - colors = vtkNamedColors() - sphere = vtkSphereSource() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphere.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: - actor.GetProperty().SetInterpolationToGouraud() - renderer = vtkRenderer() - renderer.AddActor(actor) - return renderer - - -def CreateCylinder(flat): - ''' - - :param flat: The interpolation to use (flat or Gouraud). - :return: the renderer - ''' - colors = vtkNamedColors() - cylinder = vtkCylinderSource() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cylinder.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: - actor.GetProperty().SetInterpolationToGouraud() - renderer = vtkRenderer() - renderer.AddActor(actor) - return renderer - - -def CreateIsoSurface(flat): - ''' - - :param flat: The interpolation to use (flat or Gouraud). - :return: the renderer - ''' - quadric = vtkQuadric() - quadric.SetCoefficients(1, 2, 3, 0, 1, 0, 0, 0, 0, 0) - sample = vtkSampleFunction() - sample.SetSampleDimensions(25, 25, 25) - sample.SetImplicitFunction(quadric) - # Generate the implicit surface. - contour = vtkContourFilter() - contour.SetInputConnection(sample.GetOutputPort()) - range = [1.0, 6.0] - contour.GenerateValues(5, range) - # Map the contour. - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) - contourMapper.SetScalarRange(0, 7) - actor = vtkActor() - actor.SetMapper(contourMapper) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: - actor.GetProperty().SetInterpolationToGouraud() - renderer = vtkRenderer() - renderer.AddActor(actor) - return renderer - - -def CreateModel(flat, fileName): - ''' - - :param flat: The interpolation to use (flat or Gouraud). - :param fileName: The file name. - :return: the renderer - ''' - colors = vtkNamedColors() - reader = vtkOBJReader() - reader.SetFileName(fileName) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tan')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: - actor.GetProperty().SetInterpolationToGouraud() - renderer = vtkRenderer() - renderer.AddActor(actor) - return renderer - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/GradientBackground.md b/data/examples/Rendering/GradientBackground.md deleted file mode 100644 index d148d22..0000000 --- a/data/examples/Rendering/GradientBackground.md +++ /dev/null @@ -1,22 +0,0 @@ -### Description - -Demonstrates the gradient backgrounds available in VTK. - -The gradient background modes are: - -- Vertical -- Horizontal -- Radial Farthest Side -- Radial Farthest Corner - -The user can also edit the code to change the stop colors marking the beginning and end points in a gradient. - -An option is provided for the user to read in a data file so that more interesting objects can be viewed. - -The viewport border can also be set and colored. - -For more information, see [New in VTK 9.3: Radial Gradient Background](https://www.kitware.com/new-in-vtk-9-3-radial-gradient-background/) - -!!! note VTK 9.3 or later is required. - -!!! note The C++ version requires C++ 17 or later as std::filesystem is used. diff --git a/data/examples/Rendering/GradientBackground.py b/data/examples/Rendering/GradientBackground.py deleted file mode 100755 index 3764c94..0000000 --- a/data/examples/Rendering/GradientBackground.py +++ /dev/null @@ -1,342 +0,0 @@ -#!/usr/bin/env python - -# Based on: -# https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/Core/Testing/Cxx/TestGradientBackground.cxx?ref_type=heads -# See: -# [New in VTK 9.3: Radial Gradient Background](https://www.kitware.com/new-in-vtk-9-3-radial-gradient-background/) - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine -) -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkSphereSource -) -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkCoordinate, - vtkPolyDataMapper, - vtkPolyDataMapper2D, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty, - vtkViewport -) - - -def get_program_parameters(argv): - import argparse - description = 'Demonstrates the background shading options.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-f', '--file_name', default=None, - help='An optional file name, e.g. star-wars-vader-tie-fighter.obj.') - args = parser.parse_args() - return args.file_name - - -def main(fn): - if fn: - fp = Path(fn) - if not fp.is_file(): - print(f'The path: {fp} does not exist.') - return - else: - fp = None - - pd = read_polydata_(fp) - - ren_win = vtkRenderWindow() - ren_win.SetWindowName('GradientBackground') - - iren = vtkRenderWindowInteractor() - renderers = [] - - # For each gradient specify the mode. - modes = [ - vtkViewport.GradientModes.VTK_GRADIENT_VERTICAL, - vtkViewport.GradientModes.VTK_GRADIENT_HORIZONTAL, - vtkViewport.GradientModes.VTK_GRADIENT_RADIAL_VIEWPORT_FARTHEST_SIDE, - vtkViewport.GradientModes.VTK_GRADIENT_RADIAL_VIEWPORT_FARTHEST_CORNER, - ] - - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(pd) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Honeydew')) - actor.GetProperty().SetSpecular(0.3) - actor.GetProperty().SetSpecularPower(60.0) - - ren_width = 640 - ren_height = 480 - - # The bounds for each view port. - xmins = [0.0, 0.5, 0.0, 0.5] - ymins = [0.0, 0.0, 0.5, 0.5] - xmaxs = [0.5, 1.0, 0.5, 1.0] - ymaxs = [0.5, 0.5, 1.0, 1.0] - - # Here we select and name the colors. - # Feel free to change colors. - bottom_color = colors.GetColor3d('Gold') - top_color = colors.GetColor3d('OrangeRed') - left_color = colors.GetColor3d('Gold') - right_color = colors.GetColor3d('OrangeRed') - center_color = colors.GetColor3d('Gold') - side_color = colors.GetColor3d('OrangeRed') - corner_color = colors.GetColor3d('OrangeRed') - - viewport_title = ["Vertical", - "Horizontal", - "Radial Farthest Side", - "Radial Farthest Corner", - ] - - # Create one text property for all. - text_property = vtkTextProperty() - text_property.SetJustificationToCentered() - text_property.SetFontSize(ren_height // 12) - text_property.SetColor(colors.GetColor3d('MidnightBlue')) - - text_mappers = [] - text_actors = [] - - # Define borders for the viewports = [top, left, bottom, right]. - lb = [False, True, True, False] - lbr = [False, True, True, True] - tlb = [True, True, True, False] - tlbr = [True, True, True, True] - border_color = 'DarkGreen' - border_width = 4.0 - - for i in range(0, 4): - text_mappers.append(vtkTextMapper()) - text_mappers[i].SetInput(viewport_title[i]) - text_mappers[i].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[i].SetMapper(text_mappers[i]) - text_actors[i].SetPosition(ren_width / 2, 8) - - renderers.append(vtkRenderer()) - renderers[i].AddActor(text_actors[i]) - renderers[i].AddActor(actor) - renderers[i].GradientBackgroundOn() - renderers[i].SetGradientMode(modes[i]) - - renderers[i].SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) - - if i == 1: - # Horizontal - renderers[i].SetBackground(left_color) - renderers[i].SetBackground2(right_color) - viewport_border(renderers[i], lbr, border_color, border_width) - elif i == 2: - # Radial Farthest Side - renderers[i].SetBackground(center_color) - renderers[i].SetBackground2(side_color) - viewport_border(renderers[i], tlb, border_color, border_width) - elif i == 3: - # Radial Farthest Corner - renderers[i].SetBackground(center_color) - renderers[i].SetBackground2(corner_color) - viewport_border(renderers[i], tlbr, border_color, border_width) - else: - # Vertical - renderers[i].SetBackground(bottom_color) - renderers[i].SetBackground2(top_color) - viewport_border(renderers[i], lb, border_color, border_width) - - ren_win.AddRenderer(renderers[i]) - - ren_win.SetInteractor(iren) - ren_win.Render() - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - iren.Initialize() - iren.UpdateSize(ren_width * 2, ren_height * 2) - - iren.Start() - - -def read_polydata_(path): - """ - Read from a file containing vtkPolyData. - - If the path is empty a cone is returned. - If the extension is unknown a sphere is returned. - - :param path: The path to the file. - :return: The vtkPolyData. - """ - - poly_data = vtkPolyData() - - if path is None: - # Default to a cone if the path is empty. - source = vtkConeSource() - source.SetResolution(25) - source.SetDirection(0, 1, 0) - source.SetHeight(1) - source.Update() - poly_data.DeepCopy(source.GetOutput()) - return poly_data - - valid_suffixes = ['.g', '.obj', '.stl', '.ply', '.vtk', '.vtp'] - ext = path.suffix.lower() - if path.suffix not in valid_suffixes: - print('Warning:', path, 'unknown extension, using a sphere instead.') - source = vtkSphereSource() - source.SetPhiResolution(50) - source.SetThetaResolution(50) - source.Update() - poly_data.DeepCopy(source.GetOutput()) - else: - if ext == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - - return poly_data - - -def viewport_border(renderer, sides, border_color, border_width): - """ - Set a border around a viewport. - - :param renderer: The renderer corresponding to the viewport. - :param sides: An array of boolean corresponding to [top, left, bottom, right] - :param border_color: The color of the border. - :param border_width: The width of the border. - :return: - """ - colors = vtkNamedColors() - - # Points start at upper right and proceed anti-clockwise. - points = vtkPoints() - points.SetNumberOfPoints(4) - points.InsertPoint(0, 1, 1, 0) - points.InsertPoint(1, 0, 1, 0) - points.InsertPoint(2, 0, 0, 0) - points.InsertPoint(3, 1, 0, 0) - - cells = vtkCellArray() - cells.Initialize() - - if sides[0]: - # Top - top = vtkPolyLine() - top.GetPointIds().SetNumberOfIds(2) - top.GetPointIds().SetId(0, 0) - top.GetPointIds().SetId(1, 1) - cells.InsertNextCell(top) - if sides[1]: - # Left - left = vtkPolyLine() - left.GetPointIds().SetNumberOfIds(2) - left.GetPointIds().SetId(0, 1) - left.GetPointIds().SetId(1, 2) - cells.InsertNextCell(left) - if sides[2]: - # Bottom - bottom = vtkPolyLine() - bottom.GetPointIds().SetNumberOfIds(2) - bottom.GetPointIds().SetId(0, 2) - bottom.GetPointIds().SetId(1, 3) - cells.InsertNextCell(bottom) - if sides[3]: - # Right - right = vtkPolyLine() - right.GetPointIds().SetNumberOfIds(2) - right.GetPointIds().SetId(0, 3) - right.GetPointIds().SetId(1, 0) - cells.InsertNextCell(right) - - # Now make the polydata and display it. - poly = vtkPolyData() - poly.Initialize() - poly.SetPoints(points) - poly.SetLines(cells) - - # Use normalized viewport coordinates since - # they are independent of window size. - coordinate = vtkCoordinate() - coordinate.SetCoordinateSystemToNormalizedViewport() - - mapper = vtkPolyDataMapper2D() - mapper.SetInputData(poly) - mapper.SetTransformCoordinate(coordinate) - - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(border_color)) - - # Line width should be at least 2 to be visible at extremes. - actor.GetProperty().SetLineWidth(border_width) - - renderer.AddViewProp(actor) - - -if __name__ == '__main__': - import sys - - file_name = get_program_parameters(sys.argv) - main(file_name) diff --git a/data/examples/Rendering/LayeredActors.md b/data/examples/Rendering/LayeredActors.md deleted file mode 100644 index c39963d..0000000 --- a/data/examples/Rendering/LayeredActors.md +++ /dev/null @@ -1,18 +0,0 @@ -### Description - -Demonstrates the use of two renderers in a render window. Notice that the second (and subsequent) renderers will have a transparent background. - -The first layer (layer 0) contains the base object, a slab in this case. The second layer (layer 1) contains an object (axes in this case). This axes object will always be in front of the base layer object. When the program runs, the top-most layer will be the active layer, layer 1 in this case. - -Two callbacks are provided, the first callback selects which layer is active: - -- Pressing **0** on the keyboard will let you manipulate the objects in layer 0. -- Pressing **1** on the keyboard will let you manipulate the objects in layer 1. - -The second callback allows you to orient objects in all layers using the object in the active layer. - -!!! note - Objects in the top-most layer will always be in front of any objects in other layers. - -!!! info - This is an extension of the [TransparentBackground.py](../TransparentBackground) example, extended by adding an extra callback so that the non-active layer objects move in conjunction with the active layer objects. diff --git a/data/examples/Rendering/LayeredActors.py b/data/examples/Rendering/LayeredActors.py deleted file mode 100755 index de92d44..0000000 --- a/data/examples/Rendering/LayeredActors.py +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def generate_and_display_cube_and_axes(): - colors = vtkNamedColors() - - # Make the slab and axes actors. - cube_source = vtkCubeSource() - cube_source.SetXLength(4.0) - cube_source.SetYLength(9.0) - cube_source.SetZLength(1.0) - cube_source.SetCenter(0.0, 0.0, 0.0) - - cube_mapper = vtkPolyDataMapper() - cube_mapper.SetInputConnection(cube_source.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Sienna')) - - cube_actor = vtkActor() - cube_actor.GetProperty().SetDiffuseColor(colors.GetColor3d('BurlyWood')) - cube_actor.SetMapper(cube_mapper) - cube_actor.GetProperty().EdgeVisibilityOn() - cube_actor.GetProperty().SetLineWidth(2.0) - cube_actor.GetProperty().SetEdgeColor(colors.GetColor3d('PapayaWhip')) - cube_actor.SetBackfaceProperty(back) - - transform = vtkTransform() - transform.Translate(0.0, 0.0, 0.0) - - axes = vtkAxesActor() - # The axes can be positioned with a user transform. - axes.SetUserTransform(transform) - - # The renderers, render window and interactor. - renderers = list() - ren_win = vtkRenderWindow() - ren_win.SetSize(800, 800) - ren_win.SetWindowName('LayeredActors') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # Define the renderers and allocate them to layers. - for i in range(0, 2): - renderers.append(vtkRenderer()) - ren_win.AddRenderer(renderers[i]) - renderers[i].SetLayer(i) - - # Layer 0 - background not transparent. - renderers[0].SetBackground(colors.GetColor3d('DarkSlateGray')) - renderers[0].AddActor(cube_actor) - renderers[0].SetLayer(0) - # Layer 1 - the background is transparent, - # so we only see the layer 0 background color - renderers[1].AddActor(axes) - renderers[1].SetBackground(colors.GetColor3d('MidnightBlue')) - renderers[1].SetLayer(1) - - # Set a common camera view for each layer. - for renderer in renderers: - camera = renderer.GetActiveCamera() - camera.Elevation(-30) - camera.Azimuth(-30) - renderer.ResetCamera() - - # We have two layers. - ren_win.SetNumberOfLayers(len(renderers)) - - ren_win.Render() - - iren.AddObserver('KeyPressEvent', select_layer) - iren.AddObserver('EndInteractionEvent', orient_layer) - - iren.Start() - - -def select_layer(caller, ev): - """ - Select the layer to manipulate. - :param caller: - :param ev: - :return: - """ - iren = caller - renderers = iren.GetRenderWindow().GetRenderers() - if renderers.GetNumberOfItems() < 2: - print('We need at least two renderers, we have only', renderers.GetNumberOfItems()) - return - renderers.InitTraversal() - # Top item. - ren0 = renderers.GetNextItem() - # Bottom item. - ren1 = renderers.GetNextItem() - - key = iren.GetKeySym() - - if key in ['0', 'KP_0']: - print('Selected layer:', key) - iren.GetRenderWindow().GetInteractor().GetInteractorStyle().SetDefaultRenderer(ren0) - ren0.InteractiveOn() - ren1.InteractiveOff() - if key in ['1', 'KP_1']: - print('Selected layer:', key) - iren.GetRenderWindow().GetInteractor().GetInteractorStyle().SetDefaultRenderer(ren1) - ren0.InteractiveOff() - ren1.InteractiveOn() - - -def orient_layer(caller, ev): - """ - Orient layer 0 based on the camera orientation in layer 1 or vice versa. - - :param caller: - :param ev: - :return: - """ - - iren = caller - renderers = iren.GetRenderWindow().GetRenderers() - if renderers.GetNumberOfItems() < 2: - print('We need at least two renderers, we have only', renderers.GetNumberOfItems()) - return - renderers.InitTraversal() - # Top item. - ren0 = renderers.GetNextItem() - # Bottom item. - ren1 = renderers.GetNextItem() - - if ren1.GetInteractive(): - orient1 = get_orientation(ren1) - set_orientation(ren0, orient1) - ren0.ResetCamera() - else: - orient0 = get_orientation(ren0) - set_orientation(ren1, orient0) - ren1.ResetCamera() - - -def get_orientation(ren): - """ - Get the camera orientation. - :param ren: The renderer. - :return: The orientation parameters. - """ - p = dict() - camera = ren.GetActiveCamera() - p['position'] = camera.GetPosition() - p['focal point'] = camera.GetFocalPoint() - p['view up'] = camera.GetViewUp() - p['distance'] = camera.GetDistance() - p['clipping range'] = camera.GetClippingRange() - p['orientation'] = camera.GetOrientation() - return p - - -def set_orientation(ren, p): - """ - Set the orientation of the camera. - :param ren: The renderer. - :param p: The orientation parameters. - :return: - """ - camera = ren.GetActiveCamera() - camera.SetPosition(p['position']) - camera.SetFocalPoint(p['focal point']) - camera.SetViewUp(p['view up']) - camera.SetDistance(p['distance']) - camera.SetClippingRange(p['clipping range']) - - -def main(): - generate_and_display_cube_and_axes() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Mace.md b/data/examples/Rendering/Mace.md deleted file mode 100644 index 67d1478..0000000 --- a/data/examples/Rendering/Mace.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -An example of multiple inputs and outputs. - -!!! info - See [Figure 4-21](../../../VTKBook/04Chapter4/#Figure%204-21) in [Chapter 4](../../../VTKBook/04Chapter4) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/Mace.py b/data/examples/Rendering/Mace.py deleted file mode 100755 index 2a25ea8..0000000 --- a/data/examples/Rendering/Mace.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - renderer = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(8) - sphere.SetPhiResolution(8) - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - cone = vtkConeSource() - cone.SetResolution(6) - - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.25) - - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(glyph.GetOutputPort()) - - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - renderer.AddActor(sphereActor) - renderer.AddActor(spikeActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('Mace') - - # Interact with the data. - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Model.py b/data/examples/Rendering/Model.py deleted file mode 100755 index 6ea04ba..0000000 --- a/data/examples/Rendering/Model.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('CubeColor', [250, 128, 114, 255]) - colors.SetColor('BkgColor', [230, 230, 230, 255]) - - # Create the rendering windows and three renderers. - - ren1 = vtkRenderer() - ren2 = vtkRenderer() - renWindow1 = vtkRenderWindow() - renWindow1.AddRenderer(ren1) - renWindow1.AddRenderer(ren2) - renWindow1.SetWindowName('Model') - - iren1 = vtkRenderWindowInteractor() - iren1.SetRenderWindow(renWindow1) - ren3 = vtkRenderer() - renWindow2 = vtkRenderWindow() - renWindow2.SetWindowName('Model') - - renWindow2.AddRenderer(ren3) - iren2 = vtkRenderWindowInteractor() - iren2.SetRenderWindow(renWindow2) - - # Create an actor and give it cone geometry. - cone = vtkConeSource() - cone.SetResolution(8) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - # Create an actor and give it cube geometry. - cube = vtkCubeSource() - - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cube.GetOutputPort()) - - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - cubeActor.GetProperty().SetColor(colors.GetColor3d('CubeColor')) - - # Create an actor and give it sphere geometry. - sphere = vtkSphereSource() - sphere.SetThetaResolution(16) - sphere.SetPhiResolution(16) - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Melon')) - - # Assign our actors to both renderers. - ren1.AddActor(coneActor) - ren2.AddActor(sphereActor) - ren3.AddActor(cubeActor) - - # set the size of our window - renWindow1.SetSize(300, 150) - renWindow1.SetPosition(0, 50) - renWindow2.SetSize(300, 300) - renWindow2.SetPosition(0, 300) - - # Set the viewports and backgrounds of the renderers. - ren1.SetViewport(0, 0, 0.5, 1) - ren1.SetBackground(colors.GetColor3d('BkgColor')) - ren2.SetViewport(0.5, 0, 1, 1) - ren2.SetBackground(colors.GetColor3d('Linen')) - ren3.SetBackground(colors.GetColor3d('Honeydew')) - - # Draw the resulting scene. - renWindow1.Render() - renWindow2.Render() - - iren1.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/MotionBlur.md b/data/examples/Rendering/MotionBlur.md deleted file mode 100644 index 5c24611..0000000 --- a/data/examples/Rendering/MotionBlur.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Example of motion blur. - -!!! info - See [Figure 7-36](../../../VTKBook/07Chapter7/#Figure%207-36) in [Chapter 7](../../../VTKBook/07Chapter7) in the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/Rendering/MotionBlur.py b/data/examples/Rendering/MotionBlur.py deleted file mode 100755 index 0e6b4cd..0000000 --- a/data/examples/Rendering/MotionBlur.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkRenderStepsPass, - vtkSimpleMotionBlurPass -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - colors.SetColor('A1Diff', [255, 204, 77, 255]) - colors.SetColor('A2Amb', [51, 51, 255, 255]) - colors.SetColor('A2Diff', [51, 255, 204, 255]) - colors.SetColor('A3Amb', [128, 166, 255, 255]) - colors.SetColor('Bkg', [77, 102, 153, 255]) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Bkg')) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(500, 500) - renderWindow.SetWindowName('MotionBlur') - - renderWindow.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renderWindow) - - reader = vtkPLYReader() - reader.SetFileName(fileName) - reader.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - # create three models - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('Red')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A1Diff')) - actor.GetProperty().SetSpecular(0.0) - actor.GetProperty().SetDiffuse(0.5) - actor.GetProperty().SetAmbient(0.3) - actor.SetPosition(-0.1, 0.0, -0.1) - renderer.AddActor(actor) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('A2Amb')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A2Diff')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('Black')) - actor.GetProperty().SetSpecular(0.2) - actor.GetProperty().SetDiffuse(0.9) - actor.GetProperty().SetAmbient(0.1) - actor.GetProperty().SetSpecularPower(10.0) - renderer.AddActor(actor) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A3Amb')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecular(0.7) - actor.GetProperty().SetDiffuse(0.4) - actor.GetProperty().SetSpecularPower(60.0) - actor.SetPosition(0.1, 0.0, 0.1) - renderer.AddActor(actor) - - renderWindow.SetMultiSamples(0) - - # create the basic VTK render steps - basicPasses = vtkRenderStepsPass() - - motion = vtkSimpleMotionBlurPass() - motion.SetDelegatePass(basicPasses) - - # Tell the renderer to use our render pass pipeline. - renderer.SetPass(motion) - - numRenders = 30 - - renderer.GetActiveCamera().SetPosition(0, 0, -1) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 1, 0) - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(15.0) - renderer.GetActiveCamera().Zoom(1.2) - - renderWindow.Render() - - for i in range(0, numRenders): - renderer.GetActiveCamera().Azimuth(10.0 / numRenders) - renderer.GetActiveCamera().Elevation(10.0 / numRenders) - renderWindow.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Example of motion blur.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Armadillo.ply.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/OutlineGlowPass.md b/data/examples/Rendering/OutlineGlowPass.md deleted file mode 100644 index 81f43b2..0000000 --- a/data/examples/Rendering/OutlineGlowPass.md +++ /dev/null @@ -1,7 +0,0 @@ -## Description - -Demonstrates how to render an object in a scene with a glowing outline. - -The class vtkOutlineGlowPass is designed to highlight parts of a scene by applying the render pass to a layered renderer on top of the main scene. For optimal results, actors that form the outline should be brightly colored with lighting disabled. The outline will have the color of the actors. There is only one outline around all objects rendered by the delegate. - -When combined with layered renderers, this creates a very visible highlight without altering the highlighted object. diff --git a/data/examples/Rendering/OutlineGlowPass.py b/data/examples/Rendering/OutlineGlowPass.py deleted file mode 100755 index 2de88a6..0000000 --- a/data/examples/Rendering/OutlineGlowPass.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkFiltersSources import vtkArrowSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkOutlineGlowPass, - vtkRenderStepsPass -) - - -def get_program_parameters(): - import argparse - description = 'How to render an object in a scene with a glowing outline.' - epilogue = ''' -Parts of a scene are highlighted by applying the render pass to a layered renderer - on top of the main scene. For optimal results, actors that form the outline - should be brightly colored with lighting disabled. The outline will have the - color of the actors. There is only one outline around all objects rendered by the delegate. - -When combined with layered renderers, this creates a very visible highlight without - altering the highlighted object. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.parse_args() - return - - -def main(): - if not vtk_version_ok(9, 0, 20200909): - print('You need VTK version 9.0.20200909 or greater to run this program.') - return - get_program_parameters() - - colors = vtkNamedColors() - - iren = vtkRenderWindowInteractor() - renWin = vtkRenderWindow() - renWin.SetMultiSamples(0) - - iren.SetRenderWindow(renWin) - - # Set up the renderers - # One for the object and the other for the outline - renderer = vtkRenderer() - rendererOutline = vtkRenderer() - rendererOutline.SetLayer(1) - renWin.SetNumberOfLayers(2) - renWin.AddRenderer(rendererOutline) - renWin.AddRenderer(renderer) - - # Create an arrow. - arrowSource = vtkArrowSource() - # arrowSource.SetShaftRadius(1.0) - # arrowSource.SetTipLength(1.0) - arrowSource.Update() - - # Create mapper and actor for the main renderer - coneMapperMain = vtkPolyDataMapper() - coneMapperMain.SetInputConnection(arrowSource.GetOutputPort()) - - coneActorMain = vtkActor() - coneActorMain.SetMapper(coneMapperMain) - coneActorMain.GetProperty().SetDiffuseColor(colors.GetColor3d("LimeGreen")) - - renderer.AddActor(coneActorMain) - - # Lets make the outline glow! - # Create the render pass - basicPasses = vtkRenderStepsPass() - glowPass = vtkOutlineGlowPass() - glowPass.SetDelegatePass(basicPasses) - - # Apply the render pass to the highlight renderer - rendererOutline.SetPass(glowPass) - - # Create mapper and actor for the outline - coneMapperOutline = vtkPolyDataMapper() - coneMapperOutline.SetInputConnection(arrowSource.GetOutputPort()) - - coneActorOutline = vtkActor() - coneActorOutline.SetMapper(coneMapperOutline) - coneActorOutline.GetProperty().SetColor(colors.GetColor3d("Magenta")) - coneActorOutline.GetProperty().LightingOff() - - rendererOutline.AddActor(coneActorOutline) - - renWin.SetSize(600, 600) - - renderer.GradientBackgroundOn() - renderer.SetBackground(colors.GetColor3d("DarkSlateGray")) - renderer.SetBackground2(colors.GetColor3d("DarkSlateBlue")) - - renderer.ResetCamera() - camera = renderer.GetActiveCamera() - camera.Roll(45.0) - camera.Azimuth(-30.0) - camera.Elevation(-15.0) - renderer.ResetCamera() - # Now set the active camera for the outline - rendererOutline.SetActiveCamera(camera) - - renWin.SetWindowName('OutlineGlowPass') - - renWin.Render() - - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Anisotropy.md b/data/examples/Rendering/PBR_Anisotropy.md deleted file mode 100644 index 0952ab4..0000000 --- a/data/examples/Rendering/PBR_Anisotropy.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBRAnisotropy.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRAnisotropy.cxx) and renders spheres with different anisotropy values. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Anisotropy.py b/data/examples/Rendering/PBR_Anisotropy.py deleted file mode 100755 index dce7cdc..0000000 --- a/data/examples/Rendering/PBR_Anisotropy.py +++ /dev/null @@ -1,330 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkPolyDataTangents -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkFiltersTexture import vtkTextureMapToSphere -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkOpenGLRenderer, - vtkOpenGLSkybox -) - - -def get_program_parameters(): - import argparse - description = 'Render spheres with different anisotropy values.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-e', '--use_equirectangular', action='store_true', - help='Use the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_equirectangular - - -def main(): - fn, use_cubemap = get_program_parameters() - use_cubemap = not use_cubemap - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - texture_map = vtkTextureMapToSphere() - texture_map.SetInputConnection(sphere.GetOutputPort()) - texture_map.PreventSeamOff() - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(texture_map.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetAnisotropy(1.0) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(0.1) - actor_sphere.GetProperty().SetAnisotropy(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(0.1) - actor_sphere.GetProperty().SetAnisotropy(1.0) - actor_sphere.GetProperty().SetAnisotropyRotation(i / 5.0) - ren.AddActor(actor_sphere) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Anisotropy') - - ren_win.Render() - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Clear_Coat.md b/data/examples/Rendering/PBR_Clear_Coat.md deleted file mode 100644 index 7560aa5..0000000 --- a/data/examples/Rendering/PBR_Clear_Coat.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBRClearCoat.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRClearCoat.cxx) and renders a cube with custom texture mapping and a coat normal texture. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Clear_Coat.py b/data/examples/Rendering/PBR_Clear_Coat.py deleted file mode 100755 index 852817e..0000000 --- a/data/examples/Rendering/PBR_Clear_Coat.py +++ /dev/null @@ -1,345 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory, - vtkPNGReader -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import vtkOpenGLRenderer - - -def get_program_parameters(): - import argparse - description = 'Render a cube with custom texture mapping and a coat normal texture.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-e', '--use_equirectangular', action='store_true', - help='Use the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_equirectangular - - -def main(): - fn, use_cubemap = get_program_parameters() - use_cubemap = not use_cubemap - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(triangulation.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - material_reader = vtkPNGReader() - material_reader.SetFileName(parameters['material']) - - material = vtkTexture() - material.InterpolateOn() - material.SetInputConnection(material_reader.GetOutputPort()) - - albedo_reader = vtkPNGReader() - albedo_reader.SetFileName(parameters['albedo']) - - albedo = vtkTexture() - albedo.UseSRGBColorSpaceOn() - albedo.InterpolateOn() - albedo.SetInputConnection(albedo_reader.GetOutputPort()) - - normal_reader = vtkPNGReader() - normal_reader.SetFileName(parameters['normal']) - - # Uncomment this if you want a similar image to the VTK test image. - # flip = vtkImageFlip() - # flip.SetInputConnection(normal_reader.GetOutputPort()) - # flip.SetFilteredAxes(0) - - normal = vtkTexture() - normal.InterpolateOn() - normal.SetInputConnection(normal_reader.GetOutputPort()) - - coat_normal = vtkTexture() - coat_normal.InterpolateOn() - coat_normal.SetInputConnection(normal_reader.GetOutputPort()) - # Uncomment this if you want a similar image to the VTK test image. - # coat_normal.SetInputConnection(flip.GetOutputPort()) - - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness and coat strength to 1.0 as they act as multipliers - # with texture value. - actor.GetProperty().SetMetallic(1.0) - actor.GetProperty().SetRoughness(1.0) - actor.GetProperty().SetCoatStrength(1.0) - actor.GetProperty().SetCoatColor(colors.GetColor3d('Red')) - - actor.GetProperty().SetBaseColorTexture(albedo) - actor.GetProperty().SetORMTexture(material) - actor.GetProperty().SetNormalTexture(normal) - actor.GetProperty().SetCoatNormalTexture(coat_normal) - - ren.AddActor(actor) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Clear_Coat') - - ren_win.Render() - ren.GetActiveCamera().Zoom(1.5) - - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Edge_Tint.md b/data/examples/Rendering/PBR_Edge_Tint.md deleted file mode 100644 index 41e1e8a..0000000 --- a/data/examples/Rendering/PBR_Edge_Tint.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBREdgeTint.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBREdgeTint.cxx) and renders spheres with different edge colors using a skybox as image based lighting. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Edge_Tint.py b/data/examples/Rendering/PBR_Edge_Tint.py deleted file mode 100755 index f61a33b..0000000 --- a/data/examples/Rendering/PBR_Edge_Tint.py +++ /dev/null @@ -1,329 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import vtkOpenGLRenderer - - -def get_program_parameters(): - import argparse - description = 'Render spheres with different edge colors using a skybox as image based lighting.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-c', '--use_cubemap', action='store_true', - help='Build the cubemap from the six cubemap files.' - ' Overrides the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_cubemap - - -def main(): - fn, use_cubemap = get_program_parameters() - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetEdgeTint(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetEdgeTint(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Blue')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetEdgeTint(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetEdgeTint(colors.GetColor3d('Blue')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetEdgeTint(colors.GetColor3d('Yellow')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Edge_Tint') - - ren_win.Render() - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_HDR_Environment.md b/data/examples/Rendering/PBR_HDR_Environment.md deleted file mode 100644 index f193478..0000000 --- a/data/examples/Rendering/PBR_HDR_Environment.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBRHdrEnvironment.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRHdrEnvironment.cxx) and renders spheres with different materials using a skybox as image based lighting. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_HDR_Environment.py b/data/examples/Rendering/PBR_HDR_Environment.py deleted file mode 100755 index 99a061f..0000000 --- a/data/examples/Rendering/PBR_HDR_Environment.py +++ /dev/null @@ -1,284 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import vtkOpenGLRenderer - - -def get_program_parameters(): - import argparse - description = 'Renders spheres with different materials using a skybox as image based lighting.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-c', '--use_cubemap', action='store_true', - help='Build the cubemap from the six cubemap files.' - ' Overrides the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_cubemap - - -def main(): - fn, use_cubemap = get_program_parameters() - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_HDR_Environment') - - ren_win.Render() - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Mapping.md b/data/examples/Rendering/PBR_Mapping.md deleted file mode 100644 index fcd30c7..0000000 --- a/data/examples/Rendering/PBR_Mapping.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBRMapping.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRMapping.cxx) and renders spheres with different edge colors using a skybox as image based lighting. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Mapping.py b/data/examples/Rendering/PBR_Mapping.py deleted file mode 100755 index 92bd315..0000000 --- a/data/examples/Rendering/PBR_Mapping.py +++ /dev/null @@ -1,342 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory, - vtkPNGReader -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import vtkOpenGLRenderer - - -def get_program_parameters(): - import argparse - description = 'Render a cube with custom texture mapping.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-e', '--use_equirectangular', action='store_true', - help='Use the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_equirectangular - - -def main(): - fn, use_cubemap = get_program_parameters() - use_cubemap = not use_cubemap - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(triangulation.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - material_reader = vtkPNGReader() - material_reader.SetFileName(parameters['material']) - - material = vtkTexture() - material.InterpolateOn() - material.SetInputConnection(material_reader.GetOutputPort()) - - albedo_reader = vtkPNGReader() - albedo_reader.SetFileName(parameters['albedo']) - - albedo = vtkTexture() - albedo.UseSRGBColorSpaceOn() - albedo.InterpolateOn() - albedo.SetInputConnection(albedo_reader.GetOutputPort()) - - normal_reader = vtkPNGReader() - normal_reader.SetFileName(parameters['normal']) - - normal = vtkTexture() - normal.InterpolateOn() - normal.SetInputConnection(normal_reader.GetOutputPort()) - - anisotropy_reader = vtkPNGReader() - anisotropy_reader.SetFileName(parameters['anisotropy']) - - anisotropy = vtkTexture() - anisotropy.InterpolateOn() - anisotropy.SetInputConnection(anisotropy_reader.GetOutputPort()) - - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness, anisotropy and anisotropyRotation - # to 1.0 as they act as multipliers with texture value. - actor.GetProperty().SetMetallic(1.0) - actor.GetProperty().SetRoughness(1.0) - actor.GetProperty().SetAnisotropy(1.0) - actor.GetProperty().SetAnisotropyRotation(1.0) - actor.GetProperty().SetColor(colors.GetColor3d('White')) - - actor.GetProperty().SetBaseColorTexture(albedo) - actor.GetProperty().SetORMTexture(material) - actor.GetProperty().SetNormalTexture(normal) - actor.GetProperty().SetAnisotropyTexture(anisotropy) - - ren.AddActor(actor) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Mapping') - - ren_win.Render() - ren.GetActiveCamera().Zoom(1.5) - - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Materials.md b/data/examples/Rendering/PBR_Materials.md deleted file mode 100644 index 66827e8..0000000 --- a/data/examples/Rendering/PBR_Materials.md +++ /dev/null @@ -1,35 +0,0 @@ -### Description - -This example is based on [TestPBRMaterials.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRMaterials.cxx) and renders spheres with different materials using a skybox as image based lighting. Red, cyan and black spheres are dielectric, brass and white spheres are metallic. -Roughness ranges from 0 to 1 in steps of 0.2. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Materials.py b/data/examples/Rendering/PBR_Materials.py deleted file mode 100755 index 4383461..0000000 --- a/data/examples/Rendering/PBR_Materials.py +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkOpenGLRenderer, - vtkOpenGLSkybox -) - - -def get_program_parameters(): - import argparse - description = 'Renders spheres with different materials using a skybox as image based lighting.' - epilogue = ''' -Red, cyan and black spheres are dielectric, brass and white spheres are metallic. -Roughness ranges from 0 to 1 in steps of 0.2. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-e', '--use_equirectangular', action='store_true', - help='Use the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_equirectangular - - -def main(): - fn, use_cubemap = get_program_parameters() - use_cubemap = not use_cubemap - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(100) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Cyan')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Materials') - - ren_win.Render() - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Materials_Coat.md b/data/examples/Rendering/PBR_Materials_Coat.md deleted file mode 100644 index 0568dde..0000000 --- a/data/examples/Rendering/PBR_Materials_Coat.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -This example is based on [TestPBRMaterialsCoat.cxx](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/Testing/Cxx/TestPBRMaterialsCoat.cxx) and renders spheres with different coat materials using a skybox as image based lighting. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from a HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a generic JSON file, not all the parameters are used: - -``` text -/PBR_Parameters.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Parameters.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Materials_Coat.py b/data/examples/Rendering/PBR_Materials_Coat.py deleted file mode 100755 index be317fe..0000000 --- a/data/examples/Rendering/PBR_Materials_Coat.py +++ /dev/null @@ -1,337 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkImageReader2Factory -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkOpenGLRenderer, - vtkOpenGLSkybox -) - - -def get_program_parameters(): - import argparse - description = 'Render spheres with different coat materials using a skybox as image based lighting.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-e', '--use_equirectangular', action='store_true', - help='Use the equirectangular entry in the json file.') - args = parser.parse_args() - return args.file_name, args.use_equirectangular - - -def main(): - fn, use_cubemap = get_program_parameters() - use_cubemap = not use_cubemap - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - colors.SetColor('DarkTeal', [0, 128, 77, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - ren.UseImageBasedLightingOn() - if is_hdr: - ren.UseSphericalHarmonicsOn() - ren.SetEnvironmentTexture(env_texture, False) - else: - ren.UseSphericalHarmonicsOff() - ren.SetEnvironmentTexture(env_texture, True) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(0.1) - actor_sphere.GetProperty().SetCoatStrength(1.0) - actor_sphere.GetProperty().SetCoatRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(1.0) - actor_sphere.GetProperty().SetCoatStrength(1.0) - actor_sphere.GetProperty().SetCoatRoughness(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) - actor_sphere.GetProperty().SetRoughness(0.1) - actor_sphere.GetProperty().SetCoatColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetCoatRoughness(0.1) - actor_sphere.GetProperty().SetCoatStrength(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetRoughness(0.1) - actor_sphere.GetProperty().SetCoatColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetCoatRoughness(1.0) - actor_sphere.GetProperty().SetCoatStrength(i / 5.0) - ren.AddActor(actor_sphere) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('DarkTeal')) - actor_sphere.GetProperty().SetBaseIOR(1.0 + i / 3.0) - ren.AddActor(actor_sphere) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren.AddActor(skybox) - - ren_win.SetWindowName('PBR_Materials_Coat') - - ren_win.Render() - iren.Start() - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Skybox.md b/data/examples/Rendering/PBR_Skybox.md deleted file mode 100644 index 204ef64..0000000 --- a/data/examples/Rendering/PBR_Skybox.md +++ /dev/null @@ -1,51 +0,0 @@ -### Description - -Demonstrates physically based rendering using image based lighting and a skybox. - -Physically based rendering sets color, metallicity and roughness of the object, sliders are provided so that you can experiment with the various parameters. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from an HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a JSON file with the same name as the example. In this case: - -``` text -/PBR_Skybox.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -By default we use the equirectangular file to generate the texture for the lighting and skybox. We have optionally provided six individual cubemap files to generate lighting and a skybox. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -### Options - -``` text -Positionals: - fileName The path to the JSON file containing the parameters. - -Options: - -h,--help Print this help message and exit - -s,--surface The name of the surface. Overrides the surface entry in the json file. - -c,--use_cubemap Build the cubemap from the six cubemap files. Overrides the equirectangular entry in the json file. - -t, --use_tonemapping Use tone mapping. -``` - -Additionally, you can save a screenshot by pressing "k". - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Skybox.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file. This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Skybox.py b/data/examples/Rendering/PBR_Skybox.py deleted file mode 100755 index 831a091..0000000 --- a/data/examples/Rendering/PBR_Skybox.py +++ /dev/null @@ -1,913 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBoy, - vtkParametricMobius, - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkCommand, - vtkFloatArray, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkClipPolyData, - vtkPolyDataNormals, - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkLinearSubdivisionFilter -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkParametricFunctionSource, - vtkTexturedSphereSource -) -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkJPEGWriter, - vtkImageReader2Factory, - vtkPNGWriter -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget, - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture, - vtkRenderer, - vtkWindowToImageFilter -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkCameraPass, - vtkLightsPass, - vtkOpaquePass, - vtkOverlayPass, - vtkRenderPassCollection, - vtkSequencePass, - vtkToneMappingPass -) - - -def get_program_parameters(): - import argparse - description = 'Demonstrates physically based rendering, image based lighting and a skybox.' - epilogue = ''' -Physically based rendering sets color, metallicity and roughness of the object. -Image based lighting uses a cubemap texture to specify the environment. -A Skybox is used to create the illusion of distant three-dimensional surroundings. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-s', '--surface', default='', - help='The name of the surface. Overrides the surface entry in the json file.') - parser.add_argument('-c', '--use_cubemap', action='store_true', - help='Build the cubemap from the six cubemap files.' - ' Overrides the equirectangular entry in the json file.') - parser.add_argument('-t', '--use_tonemapping', action='store_true', - help='Use tone mapping.') - args = parser.parse_args() - return args.file_name, args.surface, args.use_cubemap, args.use_tonemapping - - -def main(): - if not vtk_version_ok(9, 0, 0): - print('You need VTK version 9.0 or greater to run this program.') - return - - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - fn, surface_name, use_cubemap, use_tonemapping = get_program_parameters() - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - - # Check for missing parameters. - if 'bkgcolor' not in parameters.keys(): - parameters['bkgcolor'] = 'BkgColor' - if 'objcolor' not in parameters.keys(): - parameters['objcolor'] = 'White' - if 'skybox' not in parameters.keys(): - parameters['skybox'] = False - if surface_name: - parameters['object'] = surface_name - - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - # Build the pipeline. - # ren1 is for the slider rendering, - # ren2 is for the object rendering. - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) - ren2.SetViewport(0.2, 0.0, 1, 1) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) - - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - # Turn off the default lighting and use image based lighting. - ren2.AutomaticLightCreationOff() - ren2.UseImageBasedLightingOn() - if is_hdr: - ren2.UseSphericalHarmonicsOn() - ren2.SetEnvironmentTexture(env_texture, False) - else: - ren2.UseSphericalHarmonicsOff() - ren2.SetEnvironmentTexture(env_texture, True) - - # Get the surface. - surface = parameters['object'].lower() - available_surfaces = {'boy', 'mobius', 'randomhills', 'torus', 'sphere', 'clippedsphere', 'cube', 'clippedcube'} - if surface not in available_surfaces: - print(f'The requested surface: {parameters["object"]} not found, reverting to Boys Surface.') - surface = 'boy' - if surface == 'mobius': - source = get_mobius() - elif surface == 'randomhills': - source = get_random_hills() - elif surface == 'torus': - source = get_torus() - elif surface == 'sphere': - source = get_sphere() - elif surface == 'clippedsphere': - source = get_clipped_sphere() - elif surface == 'cube': - source = get_cube() - elif surface == 'clippedcube': - source = get_clipped_cube() - else: - source = get_boy() - - # Let's use a metallic surface - diffuse_coefficient = 1.0 - roughness_coefficient = 0.0 - metallic_coefficient = 1.0 - - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) - actor.GetProperty().SetDiffuse(diffuse_coefficient) - actor.GetProperty().SetRoughness(roughness_coefficient) - actor.GetProperty().SetMetallic(metallic_coefficient) - ren2.AddActor(actor) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren2.AddActor(skybox) - - # Create the slider callbacks to manipulate various parameters. - step_size = 1.0 / 3 - pos_y = 0.1 - pos_x0 = 0.02 - pos_x1 = 0.18 - - sw_p = SliderProperties() - - sw_p.initial_value = 1.0 - sw_p.maximum_value = 5.0 - sw_p.title = 'Exposure' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_exposure = make_slider_widget(sw_p) - sw_exposure.SetInteractor(interactor) - sw_exposure.SetAnimationModeToAnimate() - if use_tonemapping: - sw_exposure.EnabledOn() - else: - sw_exposure.EnabledOff() - sw_exposure.SetCurrentRenderer(ren1) - sw_exposure_cb = SliderCallbackExposure(tone_mapping_p) - sw_exposure.AddObserver(vtkCommand.InteractionEvent, sw_exposure_cb) - - pos_y += step_size - - sw_p.initial_value = metallic_coefficient - sw_p.maximum_value = 1.0 - sw_p.title = 'Metallicity' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_metallic = make_slider_widget(sw_p) - sw_metallic.SetInteractor(interactor) - sw_metallic.SetAnimationModeToAnimate() - sw_metallic.EnabledOn() - sw_metallic.SetCurrentRenderer(ren1) - sw_metallic_cb = SliderCallbackMetallic(actor.GetProperty()) - sw_metallic.AddObserver(vtkCommand.InteractionEvent, sw_metallic_cb) - - pos_y += step_size - - sw_p.initial_value = roughness_coefficient - sw_p.title = 'Roughness' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_roughnesss = make_slider_widget(sw_p) - sw_roughnesss.SetInteractor(interactor) - sw_roughnesss.SetAnimationModeToAnimate() - sw_roughnesss.EnabledOn() - sw_roughnesss.SetCurrentRenderer(ren1) - sw_roughnesss_cb = SliderCallbackRoughness(actor.GetProperty()) - sw_roughnesss.AddObserver(vtkCommand.InteractionEvent, sw_roughnesss_cb) - - name = Path(sys.argv[0]).stem - render_window.SetSize(1000, 625) - render_window.Render() - render_window.SetWindowName(name) - - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - print_callback = PrintCallback(interactor, name, 1, False) - # print_callback = PrintCallback(interactor, name + '.jpg', 1, False) - interactor.AddObserver('KeyPressEvent', print_callback) - - interactor.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -def get_boy(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_mobius(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_random_hills(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_torus(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOn() - tangents.Update() - return tangents.GetOutput() - - -def uv_tcoords(u_resolution, v_resolution, pd): - """ - Generate u, v texture coordinates on a parametric surface. - :param u_resolution: u resolution - :param v_resolution: v resolution - :param pd: The polydata representing the surface. - :return: The polydata with the texture coordinates added. - """ - u0 = 1.0 - v0 = 0.0 - du = 1.0 / (u_resolution - 1) - dv = 1.0 / (v_resolution - 1) - num_pts = pd.GetNumberOfPoints() - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 - for i in range(0, u_resolution): - v = v0 - for j in range(0, v_resolution): - tc = [u, v] - t_coords.SetTuple(pt_id, tc) - v += dv - pt_id += 1 - u -= du - pd.GetPointData().SetTCoords(t_coords) - return pd - - -class SliderProperties: - tube_width = 0.008 - slider_length = 0.075 - slider_width = 0.025 - end_cap_length = 0.025 - end_cap_width = 0.025 - title_height = 0.025 - label_height = 0.020 - - minimum_value = 0.0 - maximum_value = 1.0 - initial_value = 0.0 - - p1 = [0.02, 0.1] - p2 = [0.18, 0.1] - - title = None - - title_color = 'Black' - label_color = 'Black' - value_color = 'DarkSlateGray' - slider_color = 'BurlyWood' - selected_color = 'Lime' - bar_color = 'Black' - bar_ends_color = 'Indigo' - - -def make_slider_widget(properties): - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) - - slider.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint1Coordinate().SetValue(properties.p1[0], properties.p1[1]) - slider.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint2Coordinate().SetValue(properties.p2[0], properties.p2[1]) - - slider.SetTubeWidth(properties.tube_width) - slider.SetSliderLength(properties.slider_length) - slider.SetSliderWidth(properties.slider_width) - slider.SetEndCapLength(properties.end_cap_length) - slider.SetEndCapWidth(properties.end_cap_width) - slider.SetTitleHeight(properties.title_height) - slider.SetLabelHeight(properties.label_height) - - # Set the color properties - # Change the color of the title. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.title_color)) - # Change the color of the label. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.label_color)) - # Change the color of the bar. - slider.GetTubeProperty().SetColor(colors.GetColor3d(properties.bar_color)) - # Change the color of the ends of the bar. - slider.GetCapProperty().SetColor(colors.GetColor3d(properties.bar_ends_color)) - # Change the color of the knob that slides. - slider.GetSliderProperty().SetColor(colors.GetColor3d(properties.slider_color)) - # Change the color of the knob when the mouse is held on it. - slider.GetSelectedProperty().SetColor(colors.GetColor3d(properties.selected_color)) - # Change the color of the text displaying the value. - slider.GetLabelProperty().SetColor(colors.GetColor3d(properties.value_color)) - - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - -class SliderCallbackExposure: - def __init__(self, tone_mapping_property): - self.tone_mapping_property = tone_mapping_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.tone_mapping_property.SetExposure(value) - - -class SliderCallbackMetallic: - def __init__(self, actor_property): - self.actor_property = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actor_property.SetMetallic(value) - - -class SliderCallbackRoughness: - def __init__(self, actor_property): - self.actor_property = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actor_property.SetRoughness(value) - - -class PrintCallback: - def __init__(self, caller, file_name, image_quality=1, rgba=True): - """ - Set the parameters for writing the - render window view to an image file. - - :param caller: The caller for the callback. - :param file_name: The image file name. - :param image_quality: The image quality. - :param rgba: The buffer type, (if true, there is no background in the screenshot). - """ - self.caller = caller - self.image_quality = image_quality - self.rgba = rgba - if not file_name: - self.path = None - print("A file name is required.") - return - pth = Path(file_name).absolute() - valid_suffixes = ['.jpeg', '.jpg', '.png'] - if pth.suffix: - ext = pth.suffix.lower() - else: - ext = '.png' - if ext not in valid_suffixes: - ext = '.png' - self.suffix = ext - self.path = Path(str(pth)).with_suffix(ext) - - def __call__(self, caller, ev): - if not self.path: - print("A file name is required.") - return - # Save the screenshot. - if caller.GetKeyCode() == "k": - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: - w2if.SetInputBufferTypeToRGB() - # Read from the front buffer. - w2if.ReadFrontBufferOn() - w2if.Update() - if self.suffix in ['.jpeg', '.jpg']: - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Skybox_Anisotropy.md b/data/examples/Rendering/PBR_Skybox_Anisotropy.md deleted file mode 100644 index 70805da..0000000 --- a/data/examples/Rendering/PBR_Skybox_Anisotropy.md +++ /dev/null @@ -1,51 +0,0 @@ -### Description - -Demonstrates physically based rendering (PBR) using image based lighting, anisotropic texturing and a skybox. - -Physically based rendering sets metallicity, roughness, occlusion strength and normal scaling of the object. Textures are used to set base color, ORM, anisotropy and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from an HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a JSON file with the same name as the example. In this case: - -``` text -/PBR_Skybox_Anisotropy.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -By default we use the equirectangular file to generate the texture for the lighting and skybox. We have optionally provided six individual cubemap files to generate lighting and a skybox. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -### Options - -``` text -Positionals: - fileName The path to the JSON file containing the parameters. - -Options: - -h,--help Print this help message and exit - -s,--surface The name of the surface. Overrides the surface entry in the json file. - -c,--use_cubemap Build the cubemap from the six cubemap files. Overrides the equirectangular entry in the json file. - -t, --use_tonemapping Use tone mapping. -``` - -Additionally, you can save a screenshot by pressing "k". - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Skybox_Anisotropy.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file. This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Skybox_Anisotropy.py b/data/examples/Rendering/PBR_Skybox_Anisotropy.py deleted file mode 100755 index 8bbc380..0000000 --- a/data/examples/Rendering/PBR_Skybox_Anisotropy.py +++ /dev/null @@ -1,1102 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBoy, - vtkParametricMobius, - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkCommand, - vtkFloatArray, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkClipPolyData, - vtkPolyDataNormals, - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkLinearSubdivisionFilter -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkParametricFunctionSource, - vtkTexturedSphereSource -) -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkJPEGWriter, - vtkImageReader2Factory, - vtkPNGWriter -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget, - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture, - vtkRenderer, - vtkWindowToImageFilter -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkCameraPass, - vtkLightsPass, - vtkOpaquePass, - vtkOverlayPass, - vtkRenderPassCollection, - vtkSequencePass, - vtkToneMappingPass -) - - -def get_program_parameters(): - import argparse - description = 'Demonstrates physically based rendering, image based lighting, anisotropic texturing and a skybox.' - epilogue = ''' -Physically based rendering sets color, metallicity and roughness of the object. -Image based lighting uses a cubemap texture to specify the environment. -Texturing is used to generate lighting effects. -A Skybox is used to create the illusion of distant three-dimensional surroundings. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-s', '--surface', default='', - help='The name of the surface. Overrides the surface entry in the json file.') - parser.add_argument('-c', '--use_cubemap', action='store_true', - help='Build the cubemap from the six cubemap files.' - ' Overrides the equirectangular entry in the json file.') - parser.add_argument('-t', '--use_tonemapping', action='store_true', - help='Use tone mapping.') - args = parser.parse_args() - return args.file_name, args.surface, args.use_cubemap, args.use_tonemapping - - -def main(): - if not vtk_version_ok(9, 0, 0): - print('You need VTK version 9.0 or greater to run this program.') - return - - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - fn, surface_name, use_cubemap, use_tonemapping = get_program_parameters() - - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - - # Check for missing parameters. - if 'bkgcolor' not in parameters.keys(): - parameters['bkgcolor'] = 'BkgColor' - if 'objcolor' not in parameters.keys(): - parameters['objcolor'] = 'White' - if 'skybox' not in parameters.keys(): - parameters['skybox'] = False - if surface_name: - parameters['object'] = surface_name - - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - if not check_for_missing_textures(parameters, ['albedo', 'normal', 'material', 'anisotropy']): - return - - # Build the pipeline. - # ren1 is for the slider rendering, - # ren2 is for the object rendering. - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) - ren2.SetViewport(0.2, 0.0, 1, 1) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) - - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - # Turn off the default lighting and use image based lighting. - ren2.AutomaticLightCreationOff() - ren2.UseImageBasedLightingOn() - if is_hdr: - ren2.UseSphericalHarmonicsOn() - ren2.SetEnvironmentTexture(env_texture, False) - else: - ren2.UseSphericalHarmonicsOff() - ren2.SetEnvironmentTexture(env_texture, True) - - # Get the textures - base_color = read_texture(parameters['albedo']) - base_color.SetColorModeToDirectScalars() - base_color.UseSRGBColorSpaceOn() - normal = read_texture(parameters['normal']) - normal.SetColorModeToDirectScalars() - material = read_texture(parameters['material']) - material.SetColorModeToDirectScalars() - anisotropy = read_texture(parameters['anisotropy']) - anisotropy.SetColorModeToDirectScalars() - - # Get the surface. - surface = parameters['object'].lower() - available_surfaces = {'boy', 'mobius', 'randomhills', 'torus', 'sphere', 'clippedsphere', 'cube', 'clippedcube'} - if surface not in available_surfaces: - print(f'The requested surface: {parameters["object"]} not found, reverting to Boys Surface.') - surface = 'boy' - if surface == 'mobius': - source = get_mobius() - elif surface == 'randomhills': - source = get_random_hills() - elif surface == 'torus': - source = get_torus() - elif surface == 'sphere': - source = get_sphere() - elif surface == 'clippedsphere': - source = get_clipped_sphere() - elif surface == 'cube': - source = get_cube() - elif surface == 'clippedcube': - source = get_clipped_cube() - else: - source = get_boy() - - # Let's use a nonmetallic surface - diffuse_coefficient = 1.0 - roughness_coefficient = 0.3 - metallic_coefficient = 0.0 - # Other parameters. - occlusion_strength = 1.0 - normal_scale = 1.0 - anisotropy_coefficient = 1.0 - anisotropy_rotation = 0.0 - - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - # Set the model colour. - actor.GetProperty().SetColor(colors.GetColor3d('White')) - actor.GetProperty().SetDiffuse(diffuse_coefficient) - actor.GetProperty().SetRoughness(roughness_coefficient) - actor.GetProperty().SetMetallic(metallic_coefficient) - # Configure textures (needs tcoords on the mesh). - actor.GetProperty().SetBaseColorTexture(base_color) - actor.GetProperty().SetORMTexture(material) - actor.GetProperty().SetOcclusionStrength(occlusion_strength) - # Needs tcoords, normals and tangents on the mesh. - actor.GetProperty().SetNormalTexture(normal) - actor.GetProperty().SetNormalScale(normal_scale) - actor.GetProperty().SetAnisotropyTexture(anisotropy) - actor.GetProperty().SetAnisotropy(anisotropy_coefficient) - actor.GetProperty().SetAnisotropyRotation(anisotropy_rotation) - ren2.AddActor(actor) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren2.AddActor(skybox) - - # Create the slider callbacks to manipulate various parameters. - step_size = 1.0 / 7 - pos_y = 0.1 - pos_x0 = 0.02 - pos_x1 = 0.18 - - sw_p = SliderProperties() - - sw_p.initial_value = 1.0 - sw_p.maximum_value = 5.0 - sw_p.title = 'Exposure' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_exposure = make_slider_widget(sw_p) - sw_exposure.SetInteractor(interactor) - sw_exposure.SetAnimationModeToAnimate() - if use_tonemapping: - sw_exposure.EnabledOn() - else: - sw_exposure.EnabledOff() - sw_exposure.SetCurrentRenderer(ren1) - sw_exposure_cb = SliderCallbackExposure(tone_mapping_p) - sw_exposure.AddObserver(vtkCommand.InteractionEvent, sw_exposure_cb) - - pos_y += step_size - - sw_p.initial_value = metallic_coefficient - sw_p.maximum_value = 1.0 - sw_p.title = 'Metallicity' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_metallic = make_slider_widget(sw_p) - sw_metallic.SetInteractor(interactor) - sw_metallic.SetAnimationModeToAnimate() - sw_metallic.EnabledOn() - sw_metallic.SetCurrentRenderer(ren1) - sw_metallic_cb = SliderCallbackMetallic(actor.GetProperty()) - sw_metallic.AddObserver(vtkCommand.InteractionEvent, sw_metallic_cb) - - pos_y += step_size - - sw_p.initial_value = roughness_coefficient - sw_p.title = 'Roughness' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_roughnesss = make_slider_widget(sw_p) - sw_roughnesss.SetInteractor(interactor) - sw_roughnesss.SetAnimationModeToAnimate() - sw_roughnesss.EnabledOn() - sw_roughnesss.SetCurrentRenderer(ren1) - sw_roughnesss_cb = SliderCallbackRoughness(actor.GetProperty()) - sw_roughnesss.AddObserver(vtkCommand.InteractionEvent, sw_roughnesss_cb) - - pos_y += step_size - - sw_p.initial_value = occlusion_strength - sw_p.maximum_value = 5 - sw_p.title = 'Occlusion' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_occlusion_strength = make_slider_widget(sw_p) - sw_occlusion_strength.SetInteractor(interactor) - sw_occlusion_strength.SetAnimationModeToAnimate() - sw_occlusion_strength.EnabledOn() - sw_occlusion_strength.SetCurrentRenderer(ren1) - sw_occlusion_strength_cb = SliderCallbackOcclusionStrength(actor.GetProperty()) - sw_occlusion_strength.AddObserver(vtkCommand.InteractionEvent, sw_occlusion_strength_cb) - - pos_y += step_size - - sw_p.initial_value = normal_scale - sw_p.maximum_value = 5 - sw_p.title = 'Normal' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_normal = make_slider_widget(sw_p) - sw_normal.SetInteractor(interactor) - sw_normal.SetAnimationModeToAnimate() - sw_normal.EnabledOn() - sw_normal.SetCurrentRenderer(ren1) - sw_normal_cb = SliderCallbackNormalScale(actor.GetProperty()) - sw_normal.AddObserver(vtkCommand.InteractionEvent, sw_normal_cb) - - pos_y += step_size - - sw_p.initial_value = anisotropy_coefficient - sw_p.maximum_value = 1 - sw_p.title = 'Anisotropy' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_anisotropy = make_slider_widget(sw_p) - sw_anisotropy.SetInteractor(interactor) - sw_anisotropy.SetAnimationModeToAnimate() - sw_anisotropy.EnabledOn() - sw_anisotropy.SetCurrentRenderer(ren1) - sw_anisotropy_cb = SliderCallbackAnisotropy(actor.GetProperty()) - sw_anisotropy.AddObserver(vtkCommand.InteractionEvent, sw_anisotropy_cb) - - pos_y += step_size - - sw_p.initial_value = anisotropy_rotation - sw_p.maximum_value = 1 - sw_p.title = 'Anisotropy Rotation' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_anisotropy_rotation = make_slider_widget(sw_p) - sw_anisotropy_rotation.SetInteractor(interactor) - sw_anisotropy_rotation.SetAnimationModeToAnimate() - sw_anisotropy_rotation.EnabledOn() - sw_anisotropy_rotation.SetCurrentRenderer(ren1) - sw_anisotropy_rotation_cb = SliderCallbackAnisotropyRotation(actor.GetProperty()) - sw_anisotropy_rotation.AddObserver(vtkCommand.InteractionEvent, sw_anisotropy_rotation_cb) - - name = Path(sys.argv[0]).stem - render_window.SetSize(1000, 625) - render_window.Render() - render_window.SetWindowName(name) - - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - print_callback = PrintCallback(interactor, name, 1, False) - # print_callback = PrintCallback(interactor, name + '.jpg', 1, False) - interactor.AddObserver('KeyPressEvent', print_callback) - - interactor.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -def read_texture(image_path): - """ - Read an image and convert it to a texture - :param image_path: The image path. - :return: The texture. - """ - - suffix = image_path.suffix.lower() - valid_extensions = ['.jpg', '.png', '.bmp', '.tiff', '.pnm', '.pgm', '.ppm'] - if suffix not in valid_extensions: - print('Unable to read the texture file (wrong extension):', image_path) - return None - - # Read the images - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(img_reader.GetOutputPort()) - texture.Update() - - return texture - - -def check_for_missing_textures(parameters, wanted_textures): - """ - Check that the needed textures exist. - - :param parameters: The parameters. - :param wanted_textures: The wanted textures. - :return: True if all the wanted textures are present. - """ - have_textures = True - for texture_name in wanted_textures: - if texture_name not in parameters: - print('Missing texture:', texture_name) - have_textures = False - elif not parameters[texture_name]: - print('No texture path for:', texture_name) - have_textures = False - - return have_textures - - -def get_boy(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_mobius(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_random_hills(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_torus(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOn() - tangents.Update() - return tangents.GetOutput() - - -def uv_tcoords(u_resolution, v_resolution, pd): - """ - Generate u, v texture coordinates on a parametric surface. - :param u_resolution: u resolution - :param v_resolution: v resolution - :param pd: The polydata representing the surface. - :return: The polydata with the texture coordinates added. - """ - u0 = 1.0 - v0 = 0.0 - du = 1.0 / (u_resolution - 1) - dv = 1.0 / (v_resolution - 1) - num_pts = pd.GetNumberOfPoints() - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 - for i in range(0, u_resolution): - v = v0 - for j in range(0, v_resolution): - tc = [u, v] - t_coords.SetTuple(pt_id, tc) - v += dv - pt_id += 1 - u -= du - pd.GetPointData().SetTCoords(t_coords) - return pd - - -class SliderProperties: - tube_width = 0.008 - slider_length = 0.075 - slider_width = 0.025 - end_cap_length = 0.025 - end_cap_width = 0.025 - title_height = 0.025 - label_height = 0.020 - - minimum_value = 0.0 - maximum_value = 1.0 - initial_value = 0.0 - - p1 = [0.02, 0.1] - p2 = [0.18, 0.1] - - title = None - - title_color = 'Black' - label_color = 'Black' - value_color = 'DarkSlateGray' - slider_color = 'BurlyWood' - selected_color = 'Lime' - bar_color = 'Black' - bar_ends_color = 'Indigo' - - -def make_slider_widget(properties): - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) - - slider.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint1Coordinate().SetValue(properties.p1[0], properties.p1[1]) - slider.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint2Coordinate().SetValue(properties.p2[0], properties.p2[1]) - - slider.SetTubeWidth(properties.tube_width) - slider.SetSliderLength(properties.slider_length) - slider.SetSliderWidth(properties.slider_width) - slider.SetEndCapLength(properties.end_cap_length) - slider.SetEndCapWidth(properties.end_cap_width) - slider.SetTitleHeight(properties.title_height) - slider.SetLabelHeight(properties.label_height) - - # Set the color properties - # Change the color of the title. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.title_color)) - # Change the color of the label. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.label_color)) - # Change the color of the bar. - slider.GetTubeProperty().SetColor(colors.GetColor3d(properties.bar_color)) - # Change the color of the ends of the bar. - slider.GetCapProperty().SetColor(colors.GetColor3d(properties.bar_ends_color)) - # Change the color of the knob that slides. - slider.GetSliderProperty().SetColor(colors.GetColor3d(properties.slider_color)) - # Change the color of the knob when the mouse is held on it. - slider.GetSelectedProperty().SetColor(colors.GetColor3d(properties.selected_color)) - # Change the color of the text displaying the value. - slider.GetLabelProperty().SetColor(colors.GetColor3d(properties.value_color)) - - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - -class SliderCallbackExposure: - def __init__(self, tone_mapping_property): - self.tone_mapping_property = tone_mapping_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.tone_mapping_property.SetExposure(value) - - -class SliderCallbackMetallic: - def __init__(self, actor_property): - self.actor_property = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actor_property.SetMetallic(value) - - -class SliderCallbackRoughness: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetRoughness(value) - - -class SliderCallbackOcclusionStrength: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetOcclusionStrength(value) - - -class SliderCallbackNormalScale: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetNormalScale(value) - - -class SliderCallbackAnisotropy: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetAnisotropy(value) - - -class SliderCallbackAnisotropyRotation: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetAnisotropyRotation(value) - - -class PrintCallback: - def __init__(self, caller, file_name, image_quality=1, rgba=True): - """ - Set the parameters for writing the - render window view to an image file. - - :param caller: The caller for the callback. - :param file_name: The image file name. - :param image_quality: The image quality. - :param rgba: The buffer type, (if true, there is no background in the screenshot). - """ - self.caller = caller - self.image_quality = image_quality - self.rgba = rgba - if not file_name: - self.path = None - print("A file name is required.") - return - pth = Path(file_name).absolute() - valid_suffixes = ['.jpeg', '.jpg', '.png'] - if pth.suffix: - ext = pth.suffix.lower() - else: - ext = '.png' - if ext not in valid_suffixes: - ext = '.png' - self.suffix = ext - self.path = Path(str(pth)).with_suffix(ext) - - def __call__(self, caller, ev): - if not self.path: - print("A file name is required.") - return - # Save the screenshot. - if caller.GetKeyCode() == "k": - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: - w2if.SetInputBufferTypeToRGB() - # Read from the front buffer. - w2if.ReadFrontBufferOn() - w2if.Update() - if self.suffix in ['.jpeg', '.jpg']: - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/PBR_Skybox_Texturing.md b/data/examples/Rendering/PBR_Skybox_Texturing.md deleted file mode 100644 index 24a1bc7..0000000 --- a/data/examples/Rendering/PBR_Skybox_Texturing.md +++ /dev/null @@ -1,51 +0,0 @@ -### Description - -Demonstrates physically based rendering (PBR) using image based lighting, texturing and a skybox. - -Physically based rendering sets metallicity, roughness, occlusion strength, the emissive factor and normal scaling of the object. Textures are used to set base color, ORM, emissivity and normals. Textures for the image based lighting and the skymap are supplied from a cubemap. - -Image based lighting uses a cubemap texture to specify the environment. A Skybox is used to create the illusion of distant three-dimensional surroundings. Textures for the image based lighting and the skybox are supplied from an HDR or JPEG equirectangular Environment map or cubemap consisting of six image files. - -A good source for Skybox HDRs and Textures is [Poly Haven](https://polyhaven.com/all). Start with the 4K HDR versions of Skyboxes. - -The parameters used to generate the example image are loaded from a JSON file with the same name as the example. In this case: - -``` text -/PBR_Skybox_Texturing.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -By default we use the equirectangular file to generate the texture for the lighting and skybox. We have optionally provided six individual cubemap files to generate lighting and a skybox. - -For information about the parameters in the JSON file, please see [PBR_JSON_format](../../Documentation/PBR_JSON_format.md). - -### Options - -``` text -Positionals: - fileName The path to the JSON file containing the parameters. - -Options: - -h,--help Print this help message and exit - -s,--surface The name of the surface. Overrides the surface entry in the json file. - -c,--use_cubemap Build the cubemap from the six cubemap files. Overrides the equirectangular entry in the json file. - -t, --use_tonemapping Use tone mapping. -``` - -Additionally, you can save a screenshot by pressing "k". - -#### Further Reading - -- [Introducing Physically Based Rendering with VTK](https://blog.kitware.com/vtk-pbr/) -- [PBR Journey Part 1: High Dynamic Range Image Based Lighting with VTK](https://blog.kitware.com/pbrj1/) -- [PBR Journey Part 2 : Anisotropy model with VTK](https://blog.kitware.com/pbr-journey-part-2-anisotropy-model-with-vtk/) -- [PBR Journey Part 3 : Clear Coat Model with VTK](https://blog.kitware.com/pbr-journey-part-3-clear-coat-model-with-vtk/) -- [Object Shading Properties](https://gitlab.kitware.com/paraview/paraview-docs/-/blob/master/doc/source/ReferenceManual/objectShadingProperties.rst) - -!!! note - - `/PBR_Skybox_Texturing.json` assumes that the skyboxes and textures are in the subfolders `Skyboxes` and `Textures` relative to this file. This allows you to copy this JSON file and the associated subfolders to any other location on your computer. - - You can turn off the skybox in the JSON file by setting `"skybox":false`. Image based lighting will still be active. - -!!! note - - The C++ example requires C++17 as `std::filesystem` is used. If your compiler does not support C++17 comment out the filesystem stuff. diff --git a/data/examples/Rendering/PBR_Skybox_Texturing.py b/data/examples/Rendering/PBR_Skybox_Texturing.py deleted file mode 100755 index 419e9d5..0000000 --- a/data/examples/Rendering/PBR_Skybox_Texturing.py +++ /dev/null @@ -1,1045 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBoy, - vtkParametricMobius, - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkCommand, - vtkFloatArray, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkClipPolyData, - vtkPolyDataNormals, - vtkPolyDataTangents, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkLinearSubdivisionFilter -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkParametricFunctionSource, - vtkTexturedSphereSource -) -from vtkmodules.vtkIOImage import ( - vtkHDRReader, - vtkJPEGWriter, - vtkImageReader2Factory, - vtkPNGWriter -) -from vtkmodules.vtkImagingCore import vtkImageFlip -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget, - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkSkybox, - vtkTexture, - vtkRenderer, - vtkWindowToImageFilter -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkCameraPass, - vtkLightsPass, - vtkOpaquePass, - vtkOverlayPass, - vtkRenderPassCollection, - vtkSequencePass, - vtkToneMappingPass -) - - -def get_program_parameters(): - import argparse - description = 'Demonstrates physically based rendering, image based lighting, texturing and a skybox.' - epilogue = ''' -Physically based rendering sets color, metallicity and roughness of the object. -Image based lighting uses a cubemap texture to specify the environment. -Texturing is used to generate lighting effects. -A Skybox is used to create the illusion of distant three-dimensional surroundings. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='The path to the JSON file.') - parser.add_argument('-s', '--surface', default='', - help='The name of the surface. Overrides the surface entry in the json file.') - parser.add_argument('-c', '--use_cubemap', action='store_true', - help='Build the cubemap from the six cubemap files.' - ' Overrides the equirectangular entry in the json file.') - parser.add_argument('-t', '--use_tonemapping', action='store_true', - help='Use tone mapping.') - args = parser.parse_args() - return args.file_name, args.surface, args.use_cubemap, args.use_tonemapping - - -def main(): - if not vtk_version_ok(9, 0, 0): - print('You need VTK version 9.0 or greater to run this program.') - return - - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - colors.SetColor('VTKBlue', [6, 79, 141, 255]) - # Let's make a complementary colour to VTKBlue. - colors.SetColor('VTKBlueComp', [249, 176, 114, 255]) - - fn, surface_name, use_cubemap, use_tonemapping = get_program_parameters() - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - paths_ok, parameters = get_parameters(fn_path) - if not paths_ok: - return - - # Check for missing parameters. - if 'bkgcolor' not in parameters.keys(): - parameters['bkgcolor'] = 'BkgColor' - if 'objcolor' not in parameters.keys(): - parameters['objcolor'] = 'White' - if 'skybox' not in parameters.keys(): - parameters['skybox'] = False - if surface_name: - parameters['object'] = surface_name - - res = display_parameters(parameters) - print('\n'.join(res)) - print() - - if not check_for_missing_textures(parameters, ['albedo', 'normal', 'material', 'emissive']): - return - - # Build the pipeline. - # ren1 is for the slider rendering, - # ren2 is for the object rendering. - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) - ren2.SetViewport(0.2, 0.0, 1, 1) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) - - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. - is_hdr = False - has_skybox = False - gamma_correct = False - - if use_cubemap and 'cubemap' in parameters.keys(): - print('Using the cubemap files to generate the environment texture.') - env_texture = read_cubemap(parameters['cubemap']) - if parameters['skybox']: - skybox.SetTexture(env_texture) - has_skybox = True - elif 'equirectangular' in parameters.keys(): - print('Using the equirectangular file to generate the environment texture.') - env_texture = read_equirectangular_file(parameters['equirectangular']) - if parameters['equirectangular'].suffix.lower() in '.hdr .pic': - gamma_correct = True - is_hdr = True - if parameters['skybox']: - # Generate a skybox. - skybox.SetFloorRight(0, 0, 1) - skybox.SetProjection(vtkSkybox.Sphere) - skybox.SetTexture(env_texture) - has_skybox = True - else: - print('An environment texture is required,\n' - 'please add the necessary equirectangular' - ' or cubemap file paths to the json file.') - return - - # Turn off the default lighting and use image based lighting. - ren2.AutomaticLightCreationOff() - ren2.UseImageBasedLightingOn() - if is_hdr: - ren2.UseSphericalHarmonicsOn() - ren2.SetEnvironmentTexture(env_texture, False) - else: - ren2.UseSphericalHarmonicsOff() - ren2.SetEnvironmentTexture(env_texture, True) - - # Get the textures - base_color = read_texture(parameters['albedo']) - base_color.UseSRGBColorSpaceOn() - normal = read_texture(parameters['normal']) - material = read_texture(parameters['material']) - emissive = read_texture(parameters['emissive']) - emissive.UseSRGBColorSpaceOn() - - # Get the surface - surface = parameters['object'].lower() - available_surfaces = {'boy', 'mobius', 'randomhills', 'torus', 'sphere', 'clippedsphere', 'cube', 'clippedcube'} - if surface not in available_surfaces: - print(f'The requested surface: {parameters["object"]} not found, reverting to Boys Surface.') - surface = 'boy' - if surface == 'mobius': - source = get_mobius() - elif surface == 'randomhills': - source = get_random_hills() - elif surface == 'torus': - source = get_torus() - elif surface == 'sphere': - source = get_sphere() - elif surface == 'clippedsphere': - source = get_clipped_sphere() - elif surface == 'cube': - source = get_cube() - elif surface == 'clippedcube': - source = get_clipped_cube() - else: - source = get_boy() - - # Let's use a nonmetallic surface. - diffuse_coefficient = 1.0 - roughness_coefficient = 0.3 - metallic_coefficient = 0.0 - # Other parameters. - occlusion_strength = 1.0 - normal_scale = 1.0 - # emissive_col = colors.GetColor3d('VTKBlueComp') - # emissive_factor = emissive_col - # Make VTK silvery in appearance. - emissive_factor = [1.0, 1.0, 1.0] - - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) - actor.GetProperty().SetDiffuse(diffuse_coefficient) - actor.GetProperty().SetRoughness(roughness_coefficient) - actor.GetProperty().SetMetallic(metallic_coefficient) - # Configure textures (needs tcoords on the mesh). - actor.GetProperty().SetBaseColorTexture(base_color) - actor.GetProperty().SetORMTexture(material) - actor.GetProperty().SetOcclusionStrength(occlusion_strength) - actor.GetProperty().SetEmissiveTexture(emissive) - actor.GetProperty().SetEmissiveFactor(emissive_factor) - # Needs tcoords, normals and tangents on the mesh. - actor.GetProperty().SetNormalTexture(normal) - actor.GetProperty().SetNormalScale(normal_scale) - ren2.AddActor(actor) - - if has_skybox: - if gamma_correct: - skybox.GammaCorrectOn() - else: - skybox.GammaCorrectOff() - ren2.AddActor(skybox) - - # Create the slider callbacks to manipulate various parameters. - step_size = 1.0 / 5 - pos_y = 0.1 - pos_x0 = 0.02 - pos_x1 = 0.18 - - sw_p = SliderProperties() - - sw_p.initial_value = 1.0 - sw_p.maximum_value = 5.0 - sw_p.title = 'Exposure' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_exposure = make_slider_widget(sw_p) - sw_exposure.SetInteractor(interactor) - sw_exposure.SetAnimationModeToAnimate() - if use_tonemapping: - sw_exposure.EnabledOn() - else: - sw_exposure.EnabledOff() - sw_exposure.SetCurrentRenderer(ren1) - sw_exposure_cb = SliderCallbackExposure(tone_mapping_p) - sw_exposure.AddObserver(vtkCommand.InteractionEvent, sw_exposure_cb) - - pos_y += step_size - - sw_p.initial_value = metallic_coefficient - sw_p.maximum_value = 1.0 - sw_p.title = 'Metallicity' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_metallic = make_slider_widget(sw_p) - sw_metallic.SetInteractor(interactor) - sw_metallic.SetAnimationModeToAnimate() - sw_metallic.EnabledOn() - sw_metallic.SetCurrentRenderer(ren1) - sw_metallic_cb = SliderCallbackMetallic(actor.GetProperty()) - sw_metallic.AddObserver(vtkCommand.InteractionEvent, sw_metallic_cb) - - pos_y += step_size - - sw_p.initial_value = roughness_coefficient - sw_p.title = 'Roughness' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_roughnesss = make_slider_widget(sw_p) - sw_roughnesss.SetInteractor(interactor) - sw_roughnesss.SetAnimationModeToAnimate() - sw_roughnesss.EnabledOn() - sw_roughnesss.SetCurrentRenderer(ren1) - sw_roughnesss_cb = SliderCallbackRoughness(actor.GetProperty()) - sw_roughnesss.AddObserver(vtkCommand.InteractionEvent, sw_roughnesss_cb) - - pos_y += step_size - - sw_p.initial_value = occlusion_strength - sw_p.maximum_value = 1 - sw_p.title = 'Occlusion' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_occlusion_strength = make_slider_widget(sw_p) - sw_occlusion_strength.SetInteractor(interactor) - sw_occlusion_strength.SetAnimationModeToAnimate() - sw_occlusion_strength.EnabledOn() - sw_occlusion_strength.SetCurrentRenderer(ren1) - sw_occlusion_strength_cb = SliderCallbackOcclusionStrength(actor.GetProperty()) - sw_occlusion_strength.AddObserver(vtkCommand.InteractionEvent, sw_occlusion_strength_cb) - - pos_y += step_size - - sw_p.initial_value = normal_scale - sw_p.maximum_value = 5 - sw_p.title = 'Normal' - # Screen coordinates. - sw_p.p1 = [pos_x0, pos_y] - sw_p.p2 = [pos_x1, pos_y] - - sw_normal = make_slider_widget(sw_p) - sw_normal.SetInteractor(interactor) - sw_normal.SetAnimationModeToAnimate() - sw_normal.EnabledOn() - sw_normal.SetCurrentRenderer(ren1) - sw_normal_cb = SliderCallbackNormalScale(actor.GetProperty()) - sw_normal.AddObserver(vtkCommand.InteractionEvent, sw_normal_cb) - - name = Path(sys.argv[0]).stem - render_window.SetSize(1000, 625) - render_window.Render() - render_window.SetWindowName(name) - - if vtk_version_ok(9, 0, 20210718): - try: - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass - else: - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.EnabledOn() - widget.InteractiveOn() - - print_callback = PrintCallback(interactor, name, 1, False) - # print_callback = PrintCallback(interactor, name + '.jpg', 1, False) - interactor.AddObserver('KeyPressEvent', print_callback) - - interactor.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def get_parameters(fn_path): - """ - Read the parameters from a JSON file and check that the file paths exist. - - :param fn_path: The path to the JSON file. - :return: True if the paths correspond to files and the parameters. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - parameters = dict() - - # Extract the values. - keys_no_paths = {'title', 'object', 'objcolor', 'bkgcolor', 'skybox'} - keys_with_paths = {'cubemap', 'equirectangular', 'albedo', 'normal', 'material', 'coat', 'anisotropy', 'emissive'} - paths_ok = True - for k, v in json_data.items(): - if k in keys_no_paths: - parameters[k] = v - continue - if k in keys_with_paths: - if k == 'cubemap': - if ('root' in v) and ('files' in v): - root = Path(v['root']) - if not root.exists(): - print(f'Bad cubemap path: {root}') - paths_ok = False - elif len(v['files']) != 6: - print(f'Expect six cubemap file names.') - paths_ok = False - else: - cm = list(map(lambda p: root / p, v['files'])) - for fn in cm: - if not fn.is_file(): - paths_ok = False - print(f'Not a file {fn}') - if paths_ok: - parameters['cubemap'] = cm - else: - paths_ok = False - print('Missing the key "root" and/or the key "fíles" for the cubemap.') - else: - fn = Path(v) - if not fn.exists(): - print(f'Bad {k} path: {fn}') - paths_ok = False - else: - parameters[k] = fn - - # Set Boy as the default surface. - if ('object' in parameters.keys() and not parameters['object']) or 'object' not in parameters.keys(): - parameters['object'] = 'Boy' - - return paths_ok, parameters - - -def display_parameters(parameters): - res = list() - parameter_keys = ['title', 'object', 'objcolor', 'bkgcolor', 'skybox', 'cubemap', 'equirectangular', 'albedo', - 'normal', 'material', 'coat', 'anisotropy', 'emissive'] - for k in parameter_keys: - if k != 'cubemap': - if k in parameters: - res.append(f'{k:15}: {parameters[k]}') - else: - if k in parameters: - for idx in range(len(parameters[k])): - if idx == 0: - res.append(f'{k:15}: {parameters[k][idx]}') - else: - res.append(f'{" " * 17}{parameters[k][idx]}') - return res - - - -def read_cubemap(cubemap): - """ - Read six images forming a cubemap. - - :param cubemap: The paths to the six cubemap files. - :return: The cubemap texture. - """ - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - - cube_map.MipmapOn() - cube_map.InterpolateOn() - - return cube_map - - -def read_equirectangular_file(fn_path): - """ - Read an equirectangular environment file and convert to a texture. - - :param fn_path: The equirectangular file path. - :return: The texture. - """ - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - - else: - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None - if suffix not in extensions: - print('Unable to read this file extension: ', suffix) - return None - reader.SetFileName(str(fn_path)) - - texture.SetColorModeToDirectScalars() - texture.SetInputConnection(reader.GetOutputPort()) - - texture.MipmapOn() - texture.InterpolateOn() - - return texture - - -def read_texture(image_path): - """ - Read an image and convert it to a texture - :param image_path: The image path. - :return: The texture. - """ - - suffix = image_path.suffix.lower() - valid_extensions = ['.jpg', '.png', '.bmp', '.tiff', '.pnm', '.pgm', '.ppm'] - if suffix not in valid_extensions: - print('Unable to read the texture file (wrong extension):', image_path) - return None - - # Read the images - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(img_reader.GetOutputPort(0)) - texture.Update() - - return texture - - -def check_for_missing_textures(parameters, wanted_textures): - """ - Check that the needed textures exist. - - :param parameters: The parameters. - :param wanted_textures: The wanted textures. - :return: True if all the wanted textures are present. - """ - have_textures = True - for texture_name in wanted_textures: - if texture_name not in parameters: - print('Missing texture:', texture_name) - have_textures = False - elif not parameters[texture_name]: - print('No texture path for:', texture_name) - have_textures = False - - return have_textures - - -def get_boy(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_mobius(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_random_hills(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_torus(): - u_resolution = 51 - v_resolution = 51 - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() - - # Build the tangents - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_sphere(): - theta_resolution = 32 - phi_resolution = 32 - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - -def get_clipped_cube(): - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOff() - tangents.Update() - return tangents.GetOutput() - - -def uv_tcoords(u_resolution, v_resolution, pd): - """ - Generate u, v texture coordinates on a parametric surface. - :param u_resolution: u resolution - :param v_resolution: v resolution - :param pd: The polydata representing the surface. - :return: The polydata with the texture coordinates added. - """ - u0 = 1.0 - v0 = 0.0 - du = 1.0 / (u_resolution - 1) - dv = 1.0 / (v_resolution - 1) - num_pts = pd.GetNumberOfPoints() - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 - for i in range(0, u_resolution): - v = v0 - for j in range(0, v_resolution): - tc = [u, v] - t_coords.SetTuple(pt_id, tc) - v += dv - pt_id += 1 - u -= du - pd.GetPointData().SetTCoords(t_coords) - return pd - - -class SliderProperties: - tube_width = 0.008 - slider_length = 0.075 - slider_width = 0.025 - end_cap_length = 0.025 - end_cap_width = 0.025 - title_height = 0.025 - label_height = 0.020 - - minimum_value = 0.0 - maximum_value = 1.0 - initial_value = 0.0 - - p1 = [0.02, 0.1] - p2 = [0.18, 0.1] - - title = None - - title_color = 'Black' - label_color = 'Black' - value_color = 'DarkSlateGray' - slider_color = 'BurlyWood' - selected_color = 'Lime' - bar_color = 'Black' - bar_ends_color = 'Indigo' - - -def make_slider_widget(properties): - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) - - slider.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint1Coordinate().SetValue(properties.p1[0], properties.p1[1]) - slider.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint2Coordinate().SetValue(properties.p2[0], properties.p2[1]) - - slider.SetTubeWidth(properties.tube_width) - slider.SetSliderLength(properties.slider_length) - slider.SetSliderWidth(properties.slider_width) - slider.SetEndCapLength(properties.end_cap_length) - slider.SetEndCapWidth(properties.end_cap_width) - slider.SetTitleHeight(properties.title_height) - slider.SetLabelHeight(properties.label_height) - - # Set the color properties - # Change the color of the title. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.title_color)) - # Change the color of the label. - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.label_color)) - # Change the color of the bar. - slider.GetTubeProperty().SetColor(colors.GetColor3d(properties.bar_color)) - # Change the color of the ends of the bar. - slider.GetCapProperty().SetColor(colors.GetColor3d(properties.bar_ends_color)) - # Change the color of the knob that slides. - slider.GetSliderProperty().SetColor(colors.GetColor3d(properties.slider_color)) - # Change the color of the knob when the mouse is held on it. - slider.GetSelectedProperty().SetColor(colors.GetColor3d(properties.selected_color)) - # Change the color of the text displaying the value. - slider.GetLabelProperty().SetColor(colors.GetColor3d(properties.value_color)) - - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - -class SliderCallbackExposure: - def __init__(self, tone_mapping_property): - self.tone_mapping_property = tone_mapping_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.tone_mapping_property.SetExposure(value) - - -class SliderCallbackMetallic: - def __init__(self, actor_property): - self.actor_property = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actor_property.SetMetallic(value) - - -class SliderCallbackRoughness: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetRoughness(value) - - -class SliderCallbackOcclusionStrength: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetOcclusionStrength(value) - - -class SliderCallbackNormalScale: - def __init__(self, actor_property): - self.actorProperty = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actorProperty.SetNormalScale(value) - - -class PrintCallback: - def __init__(self, caller, file_name, image_quality=1, rgba=True): - """ - Set the parameters for writing the - render window view to an image file. - - :param caller: The caller for the callback. - :param file_name: The image file name. - :param image_quality: The image quality. - :param rgba: The buffer type, (if true, there is no background in the screenshot). - """ - self.caller = caller - self.image_quality = image_quality - self.rgba = rgba - if not file_name: - self.path = None - print("A file name is required.") - return - pth = Path(file_name).absolute() - valid_suffixes = ['.jpeg', '.jpg', '.png'] - if pth.suffix: - ext = pth.suffix.lower() - else: - ext = '.png' - if ext not in valid_suffixes: - ext = '.png' - self.suffix = ext - self.path = Path(str(pth)).with_suffix(ext) - - def __call__(self, caller, ev): - if not self.path: - print("A file name is required.") - return - # Save the screenshot. - if caller.GetKeyCode() == "k": - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: - w2if.SetInputBufferTypeToRGB() - # Read from the front buffer. - w2if.ReadFrontBufferOn() - w2if.Update() - if self.suffix in ['.jpeg', '.jpg']: - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Rainbow.md b/data/examples/Rendering/Rainbow.md deleted file mode 100644 index 2d816fd..0000000 --- a/data/examples/Rendering/Rainbow.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -This example demonstrates the use and manipulation of vtkLookupTable's. - -First a simple pipeline that reads a vtkStructuredGrid and then extracts a plane using vtkStructuredGeometryFilter from the grid. The plane will be colored differently by using different vtkLookupTable's. - -!!! note - The Update method is manually invoked because it causes the reader to read; later on we use the output of the reader to set a range for the scalar values. - -!!! note - This original tcl source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/395857190c8453508d283958383bc38c9c2999bf/Examples/Rendering/Tcl/rainbow.tcl). - -!!! info - See [Figure 6-3](../../../VTKBook/06Chapter6/#Figure%206-3) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/Rainbow.py b/data/examples/Rendering/Rainbow.py deleted file mode 100755 index 87c652b..0000000 --- a/data/examples/Rendering/Rainbow.py +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFn, qFn = get_program_parameters() - colors = vtkNamedColors() - - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFn) - pl3d.SetQFileName(qFn) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - pl3dOutput = pl3d.GetOutput().GetBlock(0) - - plane = vtkStructuredGridGeometryFilter() - plane.SetInputData(pl3dOutput) - plane.SetExtent(1, 100, 1, 100, 7, 7) - - lut = vtkLookupTable() - - planeMapper = vtkPolyDataMapper() - planeMapper.SetLookupTable(lut) - planeMapper.SetInputConnection(plane.GetOutputPort()) - planeMapper.SetScalarRange(pl3dOutput.GetScalarRange()) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # This creates an outline around the data. - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Much of the following is commented out. To try different lookup tables, - # uncomment the appropriate portions. - # - - # This creates a black to white lut. - # lut.SetHueRange(0, 0) - # lut.SetSaturationRange(0, 0) - # lut.SetValueRange(0.2, 1.0) - - # This creates a red to blue lut. - # lut.SetHueRange(0.0, 0.667) - - # This creates a blue to red lut. - # lut.SetHueRange(0.667, 0.0) - - # This creates a weird effect. The Build() method causes the lookup table - # to allocate memory and create a table based on the correct hue, saturation, - # value, and alpha (transparency) range. Here we then manually overwrite the - # values generated by the Build() method. - lut.SetNumberOfColors(256) - lut.SetHueRange(0.0, 0.667) - lut.Build() - - # Create the RenderWindow, Renderer and both Actors. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(planeActor) - - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.TwoSidedLightingOff() - - renWin.SetSize(512, 512) - renWin.SetWindowName('Rainbow') - - iren.Initialize() - - cam1 = ren1.GetActiveCamera() - cam1.SetClippingRange(3.95297, 50) - cam1.SetFocalPoint(8.88908, 0.595038, 29.3342) - cam1.SetPosition(-12.3332, 31.7479, 41.2387) - cam1.SetViewUp(0.060772, -0.319905, 0.945498) - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Demonstrates the use and manipulation of lookup tables.' - epilogue = ''' - First create a simple pipeline that reads a structured grid - and then extracts a plane from the grid. The plane will be colored - differently by using different lookup tables. - - Note: The Update method is manually invoked because it causes the - reader to read; later on we use the output of the reader to set - a range for the scalar values. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('xyzFilename', help='combxyz.bin.') - parser.add_argument('qFilename', help='combq.bin.') - args = parser.parse_args() - return args.xyzFilename, args.qFilename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Rotations.md b/data/examples/Rendering/Rotations.md deleted file mode 100644 index 447b01d..0000000 --- a/data/examples/Rendering/Rotations.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Rotations of a cow about her axes. In this model, the *x* axis is from the left to right; the *y* axis is from bottom to top; and the *z* axis emerges from the image. The camera location is the same in all four images. - -!!! info - See [Figure 3-31](../../../VTKBook/03Chapter3/#Figure%203-31) in [Chapter 3](../../..//VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/Rotations.py b/data/examples/Rendering/Rotations.py deleted file mode 100755 index bed3b50..0000000 --- a/data/examples/Rendering/Rotations.py +++ /dev/null @@ -1,228 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkAxes -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - """ - To match the illustrations in VTKTextbook.pdf, use BkgColor as the background and - Wheat as the cow colour. - Also comment out the lines: - modelActor->GetProperty()->SetSpecular(.6); - modelActor->GetProperty()->SetSpecularPower(30); - and use cow.g as the input data. - - """ - file_name, figure, actor_color = get_program_parameters() - rotate(file_name, figure, actor_color) - - -def rotate(file_name, figure, actor_color): - """ - This is where we do the rotations. - - """ - # Create renderer stuff - # - colors = vtkNamedColors() - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - # colors.SetColor('BkgColor', [60, 93, 144, 255]) - - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - polyData = ReadPolyData(file_name) - - modelMapper = vtkPolyDataMapper() - modelMapper.SetInputData(polyData) - - modelActor = vtkActor() - modelActor.SetMapper(modelMapper) - modelActor.GetProperty().SetDiffuseColor(colors.GetColor3d(actor_color)) - if actor_color != 'Wheat': - modelActor.GetProperty().SetSpecular(0.6) - modelActor.GetProperty().SetSpecularPower(30) - - modelAxesSource = vtkAxes() - modelAxesSource.SetScaleFactor(10) - modelAxesSource.SetOrigin(0, 0, 0) - - modelAxesMapper = vtkPolyDataMapper() - modelAxesMapper.SetInputConnection(modelAxesSource.GetOutputPort()) - - modelAxes = vtkActor() - modelAxes.SetMapper(modelAxesMapper) - - ren1.AddActor(modelAxes) - modelAxes.VisibilityOff() - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(modelActor) - if actor_color == 'Wheat': - ren1.SetBackground(colors.GetColor3d('BkgColor')) - else: - ren1.SetBackground(colors.GetColor3d('Silver')) - renWin.SetSize(640, 480) - renWin.SetWindowName('Rotations') - - ren1.ResetCamera() - ren1.GetActiveCamera().Azimuth(0) - ren1.GetActiveCamera().SetClippingRange(0.1, 1000.0) - - modelAxes.VisibilityOn() - - renWin.Render() - renWin.Render() - - if figure == 1: - RotateX(renWin, modelActor) - elif figure == 2: - RotateY(renWin, modelActor) - elif figure == 3: - RotateZ(renWin, modelActor) - else: - RotateXY(renWin, modelActor) - - renWin.EraseOff() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Perform rotations about the X, Y, Z and X then Y axes.' - epilogue = ''' - Perform rotations about the X, Y, Z and X then Y axes. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='The file cow.obj.') - parser.add_argument('figure', default=0, type=int, nargs='?', - help='The particular rotation that you want to view.') - parser.add_argument('actor_color', default='Wheat', type=str, nargs='?', - help='If the color is Wheat then the vtk textbook colors are used.') - args = parser.parse_args() - return args.filename, args.figure, args.actor_color - - -def RotateX(renWin, actor): - actor.SetOrientation(0, 0, 0) - renWin.Render() - renWin.Render() - renWin.EraseOff() - - for i in range(0, 6): - actor.RotateX(60) - renWin.Render() - renWin.Render() - renWin.EraseOn() - - -def RotateY(renWin, actor): - actor.SetOrientation(0, 0, 0) - renWin.Render() - renWin.EraseOff() - - for i in range(0, 6): - actor.RotateY(60) - renWin.Render() - renWin.Render() - renWin.EraseOn() - - -def RotateZ(renWin, actor): - actor.SetOrientation(0, 0, 0) - renWin.Render() - renWin.EraseOff() - - for i in range(0, 6): - actor.RotateZ(60) - renWin.Render() - renWin.Render() - renWin.EraseOn() - - -def RotateXY(renWin, actor): - actor.SetOrientation(0, 0, 0) - actor.RotateX(60) - renWin.Render() - renWin.Render() - renWin.EraseOff() - - for i in range(0, 6): - actor.RotateY(60) - renWin.Render() - renWin.Render() - renWin.EraseOn() - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a sphere if the extension is unknown. - source = vtkSphereSource() - source.Update() - poly_data = source.GetOutput() - return poly_data - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/RotationsA.py b/data/examples/Rendering/RotationsA.py deleted file mode 100755 index db2e232..0000000 --- a/data/examples/Rendering/RotationsA.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -""" -Rotations, VTK Textbook figure 3-31a. - -Note: Make sure Rotations.py is in the same directory as this program. -""" - -import Rotations - - -def main(): - file_name, figure, book_color = Rotations.get_program_parameters() - # Set up for six rotations about the x-axis. - figure = 1 - book_color = True - Rotations.rotate(file_name, figure, book_color) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/RotationsB.py b/data/examples/Rendering/RotationsB.py deleted file mode 100755 index a0d2a27..0000000 --- a/data/examples/Rendering/RotationsB.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -""" -Rotations, VTK Textbook figure 3-31b. - -Note: Make sure Rotations.py is in the same directory as this program. -""" - -import Rotations - - -def main(): - file_name, figure, book_color = Rotations.get_program_parameters() - # Set up for six rotations about the y-axis. - figure = 2 - book_color = True - Rotations.rotate(file_name, figure, book_color) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/RotationsC.py b/data/examples/Rendering/RotationsC.py deleted file mode 100755 index a6cf582..0000000 --- a/data/examples/Rendering/RotationsC.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -""" -Rotations, VTK Textbook figure 3-31c. - -Note: Make sure Rotations.py is in the same directory as this program. -""" - -import Rotations - - -def main(): - file_name, figure, book_color = Rotations.get_program_parameters() - # Set up for six rotations about the z-axis. - figure = 3 - book_color = True - Rotations.rotate(file_name, figure, book_color) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/RotationsD.py b/data/examples/Rendering/RotationsD.py deleted file mode 100755 index 8aa6458..0000000 --- a/data/examples/Rendering/RotationsD.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -""" -Rotations, VTK Textbook figure 3-31d. - -Note: Make sure Rotations.py is in the same directory as this program. -""" - -import Rotations - - -def main(): - file_name, figure, book_color = Rotations.get_program_parameters() - # First a rotation about the x-axis, then six rotations about the y-axis. - figure = 4 - book_color = True - Rotations.rotate(file_name, figure, book_color) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/Shadows.py b/data/examples/Rendering/Shadows.py deleted file mode 100755 index 26e87e0..0000000 --- a/data/examples/Rendering/Shadows.py +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkCameraPass, - vtkRenderPassCollection, - vtkSequencePass, - vtkShadowMapPass -) - - -def get_program_parameters(): - import argparse - description = 'Read a polydata file of a surface and display it with shadows.' - epilogue = ''' -If no file is entered a sphere is used. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', default=None, nargs='?', help='Enter a polydata file e.g cow.g.') - args = parser.parse_args() - return args.filename - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def main(): - fn = get_program_parameters() - if fn: - polyData = ReadPolyData(fn) - else: - # Use a sphere - source = vtkSphereSource() - source.SetThetaResolution(100) - source.SetPhiResolution(100) - source.Update() - polyData = source.GetOutput() - - colors = vtkNamedColors() - colors.SetColor('HighNoonSun', [255, 255, 251, 255]) # Color temp. 5400°K - colors.SetColor('100W Tungsten', [255, 214, 170, 255]) # Color temp. 2850°K - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(640, 480) - renderWindow.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - light1 = vtkLight() - light1.SetFocalPoint(0, 0, 0) - light1.SetPosition(0, 1, 0.2) - light1.SetColor(colors.GetColor3d('HighNoonSun')) - light1.SetIntensity(0.3) - renderer.AddLight(light1) - - light2 = vtkLight() - light2.SetFocalPoint(0, 0, 0) - light2.SetPosition(1.0, 1.0, 1.0) - light2.SetColor(colors.GetColor3d('100W Tungsten')) - light2.SetIntensity(0.8) - renderer.AddLight(light2) - - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('SaddleBrown')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Sienna')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecular(0.51) - actor.GetProperty().SetDiffuse(0.7) - actor.GetProperty().SetAmbient(0.7) - actor.GetProperty().SetSpecularPower(30.0) - actor.GetProperty().SetOpacity(1.0) - renderer.AddActor(actor) - - # Add a plane - bounds = polyData.GetBounds() - - rnge = [0] * 3 - rnge[0] = bounds[1] - bounds[0] - rnge[1] = bounds[3] - bounds[2] - rnge[2] = bounds[5] - bounds[4] - print('range: ', ', '.join(['{0:0.6f}'.format(i) for i in rnge])) - expand = 1.0 - thickness = rnge[2] * 0.1 - plane = vtkCubeSource() - plane.SetCenter((bounds[1] + bounds[0]) / 2.0, - bounds[2] - thickness / 2.0, - (bounds[5] + bounds[4]) / 2.0) - plane.SetXLength(bounds[1] - bounds[0] + (rnge[0] * expand)) - plane.SetYLength(thickness) - plane.SetZLength(bounds[5] - bounds[4] + (rnge[2] * expand)) - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(plane.GetOutputPort()) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - renderer.AddActor(planeActor) - - renderWindow.SetMultiSamples(0) - - shadows = vtkShadowMapPass() - - seq = vtkSequencePass() - - passes = vtkRenderPassCollection() - passes.AddItem(shadows.GetShadowMapBakerPass()) - passes.AddItem(shadows) - seq.SetPasses(passes) - - cameraP = vtkCameraPass() - cameraP.SetDelegatePass(seq) - - # Tell the renderer to use our render pass pipeline - glrenderer = renderer - glrenderer.SetPass(cameraP) - - renderer.GetActiveCamera().SetPosition(-0.2, 0.2, 1) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 1, 0) - renderer.ResetCamera() - renderer.GetActiveCamera().Dolly(2.25) - renderer.ResetCameraClippingRange() - renderWindow.SetWindowName('Shadows') - renderWindow.Render() - renderWindow.SetWindowName('Shadows') - - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/SpecularSpheres.md b/data/examples/Rendering/SpecularSpheres.md deleted file mode 100644 index 57b85ee..0000000 --- a/data/examples/Rendering/SpecularSpheres.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -!!! note - The original source code for this example is [here](https://gitlab.kitware.com/vtk/vtk/blob/73465690278158b9e89661cd6aed26bead781378/Examples/Rendering/Cxx/SpecularSpheres.cxx). - -!!! info - See [Figure 3-10](../../../VTKBook/03Chapter3/#Figure%203-10) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). - -!!! info - Similar examples setting the ambient and diffuse properties are: - See [AmbientSpheres.cxx](../../../Cxx/Rendering/AmbientSpheres), [AmbientSpheres.py](../AmbientSpheres), [AmbientSpheres.java](../../../Java/Rendering/AmbientSpheres) and [DiffuseSpheres.cxx](../../../Cxx/Rendering/DiffuseSpheres), [DiffuseSpheres.py](../DiffuseSpheres). diff --git a/data/examples/Rendering/SpecularSpheres.py b/data/examples/Rendering/SpecularSpheres.py deleted file mode 100755 index 37eeba5..0000000 --- a/data/examples/Rendering/SpecularSpheres.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. - # - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(50) - - # The mapper is responsible for pushing the geometry into the graphics - # library. It may also do color mapping, if scalars or other attributes - # are defined. - # - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - # The actor is a grouping mechanism: besides the geometry (mapper), it - # also has a property, transformation matrix, and/or texture map. - # In this example we create eight different spheres (two rows of four - # spheres) and set the specular lighting coefficients. A little ambient - # is turned on so the sphere is not completely black on the back side. - # - numberOfSpheres = 8 - spheres = list() - ambient = 0.3 - diffuse = 0.5 - specular = 1.0 - spBase = 5.0 - spScale = 1.0 - position = [0, 0, 0] - for i in range(0, numberOfSpheres): - specularPower = spBase * spScale - spheres.append(vtkActor()) - spheres[i].SetMapper(sphereMapper) - spheres[i].GetProperty().SetColor(colors.GetColor3d('Red')) - spheres[i].GetProperty().SetAmbient(ambient) - spheres[i].GetProperty().SetDiffuse(diffuse) - spheres[i].GetProperty().SetSpecular(specular) - spheres[i].GetProperty().SetSpecularPower(specularPower) - spheres[i].GetProperty().SetSpecularColor(colors.GetColor3d('White')) - spheres[i].AddPosition(position) - spScale = spScale * 2.0 - position[0] += 1.25 - if i == 3: - specular = 0.5 - spScale = 1.0 - position[0] = 0 - position[1] = 1.25 - - # Create the graphics structure. The renderer renders into the - # render window. The render window interactor captures mouse events - # and will perform appropriate camera or actor manipulation - # depending on the nature of the events. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - for i in range(0, numberOfSpheres): - ren.AddActor(spheres[i]) - - ren.SetBackground(colors.GetColor3d('bkg')) - renWin.SetSize(640, 480) - renWin.SetWindowName('SpecularSpheres') - - # Set up the lighting. - # - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. - # Parallel camera projection will be used. To zoom in parallel projection - # mode, the ParallelScale is set. - # - ren.GetActiveCamera().SetFocalPoint(0, 0, 0) - ren.GetActiveCamera().SetPosition(0, 0, 1) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.GetActiveCamera().ParallelProjectionOn() - ren.ResetCamera() - ren.GetActiveCamera().SetParallelScale(2.0) - # This starts the event loop and invokes an initial render. - # - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/StippledLine.md b/data/examples/Rendering/StippledLine.md deleted file mode 100644 index 96a84c1..0000000 --- a/data/examples/Rendering/StippledLine.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -VTK OpenGL2 no longer supports Stippled Lines. This example uses texture mapping to created stippled lines. Two parameters, StipplePattern and StippleRepeat, control the pattern of the stippled lines. - -StipplePattern is a 16-bit binary pattern, 1 = pixel on, 0 = pixel off. - -StippleRepeat is the stippling repeat factor of a Line, which specifies how many times each bit in the pattern is to be repeated. - -It can be tricky to set the proper pattern and repeat, so experiment. diff --git a/data/examples/Rendering/StippledLine.py b/data/examples/Rendering/StippledLine.py deleted file mode 100755 index 48b4e6d..0000000 --- a/data/examples/Rendering/StippledLine.py +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_UNSIGNED_CHAR, - vtkDoubleArray -) -from vtkmodules.vtkCommonDataModel import vtkImageData -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - colors = vtkNamedColors() - - lines = vtkLineSource() - # Create two points, P0 and P1 - p0 = [1.0, 0.0, 0.0] - p1 = [5.0, 0.0, 0.0] - - lines.SetResolution(11) - lines.SetPoint1(p0) - lines.SetPoint2(p1) - lines.Update() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(lines.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(5) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - - StippledLine(actor, 0xA1A1, 2) - - ren1 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d("SlateGray")) - renWin = vtkRenderWindow() - renWin.SetSize(640, 480) - renWin.SetWindowName('StippledLine') - - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - ren1.AddActor(actor) - renWin.Render() - iren.Start() - - -def StippledLine(actor, lineStipplePattern, lineStippleRepeat): - tcoords = vtkDoubleArray() - image = vtkImageData() - texture = vtkTexture() - - # Create texture - dimension = 16 * lineStippleRepeat - - image.SetDimensions(dimension, 1, 1) - image.AllocateScalars(VTK_UNSIGNED_CHAR, 4) - image.SetExtent(0, dimension - 1, 0, 0, 0, 0) - on = 255 - off = 0 - i_dim = 0 - while i_dim < dimension: - for i in range(0, 16): - mask = (1 << i) - bit = (lineStipplePattern & mask) >> i - value = bit - if value == 0: - for j in range(0, lineStippleRepeat): - image.SetScalarComponentFromFloat(i_dim, 0, 0, 0, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 1, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 2, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 3, off) - i_dim += 1 - else: - for j in range(0, lineStippleRepeat): - image.SetScalarComponentFromFloat(i_dim, 0, 0, 0, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 1, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 2, on) - image.SetScalarComponentFromFloat(i_dim, 0, 0, 3, on) - i_dim += 1 - polyData = actor.GetMapper().GetInput() - # Create texture coordinates - tcoords.SetNumberOfComponents(1) - tcoords.SetNumberOfTuples(polyData.GetNumberOfPoints()) - for i in range(0, polyData.GetNumberOfPoints()): - value = i * 0.5 - tcoords.SetTypedTuple(i, [value]) - polyData.GetPointData().SetTCoords(tcoords) - texture.SetInputData(image) - texture.InterpolateOff() - texture.RepeatOn() - - actor.SetTexture(texture) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/StripFran.py b/data/examples/Rendering/StripFran.py deleted file mode 100755 index 417f1ed..0000000 --- a/data/examples/Rendering/StripFran.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkDecimatePro, - vtkMaskPolyData, - vtkPolyDataNormals, - vtkStripper -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - renderWindow.SetWindowName('StripFran') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Create a cyberware source. - # - cyber = vtkPolyDataReader() - cyber.SetFileName(fileName) - - deci = vtkDecimatePro() - deci.SetInputConnection(cyber.GetOutputPort()) - deci.SetTargetReduction(0.7) - deci.PreserveTopologyOn() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(deci.GetOutputPort()) - - mask = vtkMaskPolyData() - mask.SetInputConnection(deci.GetOutputPort()) - mask.SetOnRatio(2) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(mask.GetOutputPort()) - - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - stripper = vtkStripper() - stripper.SetInputConnection(cyber.GetOutputPort()) - - stripperMask = vtkMaskPolyData() - stripperMask.SetInputConnection(stripper.GetOutputPort()) - stripperMask.SetOnRatio(2) - - stripperMapper = vtkPolyDataMapper() - stripperMapper.SetInputConnection(stripperMask.GetOutputPort()) - - stripperActor = vtkActor() - stripperActor.SetMapper(stripperMapper) - stripperActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # Add the actors to the renderer, set the background and size. - # - renderer1.AddActor(stripperActor) - renderer2.AddActor(cyberActor) - renderer1.SetBackground(colors.GetColor3d('Wheat')) - renderer2.SetBackground(colors.GetColor3d('Papaya_Whip')) - renderWindow.SetSize(1024, 640) - - # Render the image. - # - cam1 = vtkCamera() - cam1.SetFocalPoint(0, 0, 0) - cam1.SetPosition(1, 0, 0) - cam1.SetViewUp(0, 1, 0) - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) - renderer1.ResetCamera() - cam1.Azimuth(30) - cam1.Elevation(30) - cam1.Dolly(1.4) - renderer1.ResetCameraClippingRange() - - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Triangle strip examples.' - epilogue = ''' - a) Structured triangle mesh consisting of 134 strips each of 390 triangles (stripF.tcl). - - b) Unstructured triangle mesh consisting of 2227 strips of average length 3.94, - longest strip 101 triangles. - Images are generated by displaying every other triangle strip (uStripeF.tcl). - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/TransformSphere.md b/data/examples/Rendering/TransformSphere.md deleted file mode 100644 index b51306a..0000000 --- a/data/examples/Rendering/TransformSphere.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example extends the pipeline of the [ColoredSphere.py](../ColoredSphere) example and shows the effects of type checking on the connectivity of process objects. We add a transform filter (vtkTransformFilter) to nonuniformly scale the sphere in the x-y-z directions. The transform filter only operates on objects with explicit point coordinate representation (i.e., a subclass of vtkPointSet ). However, the elevation filter generates the more general form vtkDataSet as output. Hence we cannot connect the transform filter to the elevation filter. But we can connect the transform filter to the sphere source, and then the elevation filter to the transform filter. (Note: an alternative method is to use vtkCastToConcrete to perform run-time casting.) - -!!! info - See [Figure 4-20](../../../VTKBook/04Chapter4/#Figure%204-20) in [Chapter 4](../../../VTKBook/04Chapter4) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/TransformSphere.py b/data/examples/Rendering/TransformSphere.py deleted file mode 100755 index 9737847..0000000 --- a/data/examples/Rendering/TransformSphere.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersGeneral import vtkTransformFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(12) - sphere.SetPhiResolution(12) - - aTransform = vtkTransform() - aTransform.Scale(1, 1.5, 2) - - transFilter = vtkTransformFilter() - transFilter.SetInputConnection(sphere.GetOutputPort()) - transFilter.SetTransform(aTransform) - - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(transFilter.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -1) - colorIt.SetHighPoint(0, 0, 1) - - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0) - lut.SetSaturationRange(1, 1) - lut.SetValueRange(1, 1) - - mapper = vtkDataSetMapper() - mapper.SetLookupTable(lut) - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("SlateGray")) - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(60.0) - renderer.GetActiveCamera().Azimuth(30.0) - renderer.ResetCameraClippingRange() - - renWin.SetSize(640, 480) - renWin.SetWindowName('TransformSphere') - - renWin.Render() - - # Interact with the data. - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/TransparentBackground.md b/data/examples/Rendering/TransparentBackground.md deleted file mode 100644 index b64b644..0000000 --- a/data/examples/Rendering/TransparentBackground.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -Demonstrates the use of two renderers. Notice that the second (and subsequent) renderers will have a transparent background. - -You can manipulate the object in the second layer/renderer whilst the objects in the first layer/renderer form the background. - -- Pressing **0** on the keyboard will let you manipulate the objects in - layer 0. -- Pressing **1** on the keyboard will let you manipulate the objects in layer 1. - -!!! info - Also see the [LayeredActors.py](../LayeredActors) example, where we have added an extra callback so that the non-active layer objects move in conjunction with the active layer objects. diff --git a/data/examples/Rendering/TransparentBackground.py b/data/examples/Rendering/TransparentBackground.py deleted file mode 100755 index 45b80ad..0000000 --- a/data/examples/Rendering/TransparentBackground.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python - -""" - 1. Create a cube and cone source. - 2. Render it with the cube in layer 0 and the cone in layer 1 of the render window. - 3. Interact with it. - 4. Notice that the cube and the cone are both visible and the layer 1 background is transparent. - 5. Pressing '0' on the keyboard will let you manipulate the objects in layer 0. - 6. Pressing '1' on the keyboard will let you manipulate the objects in layer 1. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def GenerateAndDisplayCubeAndSphere(): - colors = vtkNamedColors() - - cubeSource = vtkCubeSource() - cubeSource.SetXLength(4.0) - cubeSource.SetYLength(9.0) - cubeSource.SetZLength(1.0) - cubeSource.SetCenter(0.0, 0.0, 0.0) - - # Render the cube - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cubeSource.GetOutputPort()) - - cubeActor = vtkActor() - cubeActor.GetProperty().SetDiffuseColor(colors.GetColor3d("DarkGreen")) - cubeActor.SetMapper(cubeMapper) - - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetHeight(1.0) - coneSource.SetRadius(0.25) - coneSource.SetDirection(0.0, 1.0, 0.0) - coneSource.SetResolution(60) - coneSource.CappingOn() - - # Render the cone - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(coneSource.GetOutputPort()) - - coneActor = vtkActor() - coneActor.GetProperty().SetDiffuseColor(colors.GetColor3d("DarkTurquoise")) - # Make the cone slightly transparent for fun - coneActor.GetProperty().SetOpacity(0.75) - coneActor.SetMapper(coneMapper) - - # The renderers, render window and interactor - renderers = list() - renWin = vtkRenderWindow() - for i in range(0, 2): - renderers.append(vtkRenderer()) - renWin.AddRenderer(renderers[i]) - renWin.SetSize(800, 800) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Layer 0 - background not transparent - renderers[0].SetBackground(colors.GetColor3d("Silver")) - renderers[0].AddActor(cubeActor) - renderers[0].SetLayer(0) - # Layer 1 - the background is transparent - # so we only see the layer 0 background color - renderers[1].AddActor(coneActor) - renderers[1].SetLayer(1) - renderers[1].SetBackground(colors.GetColor3d("MidnightBlue")) - - # We have two layers - renWin.SetNumberOfLayers(2) - renWin.Render() - renWin.SetWindowName('TransparentBackground') - - iren.AddObserver('KeyPressEvent', KeypressCallbackFunction) - - iren.Start() - - -def KeypressCallbackFunction(caller, ev): - iren = caller - renderers = iren.GetRenderWindow().GetRenderers() - if renderers.GetNumberOfItems() < 2: - print('We need at least two renderers, we have only', renderers.GetNumberOfItems()) - return - renderers.InitTraversal() - # Top item - ren0 = renderers.GetNextItem() - # Bottom item - ren1 = renderers.GetNextItem() - - key = iren.GetKeySym() - - if key in ['0', 'KP_0']: - print('Pressed:', key) - iren.GetRenderWindow().GetInteractor().GetInteractorStyle().SetDefaultRenderer(ren0) - ren0.InteractiveOn() - ren1.InteractiveOff() - if key in ['1', 'KP_1']: - print('Pressed:', key) - iren.GetRenderWindow().GetInteractor().GetInteractorStyle().SetDefaultRenderer(ren1) - ren0.InteractiveOff() - ren1.InteractiveOn() - - -def main(): - GenerateAndDisplayCubeAndSphere() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/WalkCow.md b/data/examples/Rendering/WalkCow.md deleted file mode 100644 index e50ce45..0000000 --- a/data/examples/Rendering/WalkCow.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This generates Fig. 3-32: The cow "walking" around the global origin; Fig. 3-33: The cow rotating about a vector passing through her nose. (a) With origin (0,0,0). (b) With origin at (6.1,1.3,.02). found in [VTKTextbook](https://www.kitware.com/products/books/VTKTextbook.pdf). - -The example allows an optional second argument that selects the figure to be generated. A *0* generates Fig 3-32, *1* generates Fig 3-33a and *2* generates Fig 3-33b. - -!!! info - See [Figure 3-32](../../../VTKBook/03Chapter3/#Figure%203-32) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Rendering/WalkCow.py b/data/examples/Rendering/WalkCow.py deleted file mode 100755 index 834c458..0000000 --- a/data/examples/Rendering/WalkCow.py +++ /dev/null @@ -1,421 +0,0 @@ -#!/usr/local/bin/python - -# Translated from walkCow.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkAxes -from vtkmodules.vtkIOGeometry import vtkBYUReader -from vtkmodules.vtkIOImage import vtkPNGWriter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkWindowToImageFilter -) - - -def walk_cow(file_name, figure): - figure = abs(figure) - if figure > 2: - figure = 0 - - colors = vtkNamedColors() - # Set the background color. - colors.SetColor('BkgColor1', [60, 93, 144, 255]) - colors.SetColor('BkgColor2', [26, 51, 102, 255]) - - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('WalkCow'); - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # The cow pipeline. - cow = vtkBYUReader() - cow.SetGeometryFileName(file_name) - cow.Update() - - cowMapper = vtkPolyDataMapper() - cowMapper.SetInputConnection(cow.GetOutputPort()) - cowMapper.ScalarVisibilityOff() - - cowActor = vtkActor() - cowActor.SetMapper(cowMapper) - cowActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - ren.AddActor(cowActor) - - # Axes pipeline. - cowAxesSource = vtkAxes() - cowAxesSource.SetScaleFactor(10.0) - cowAxesSource.SetOrigin(0, 0, 0) - - cowAxesMapper = vtkPolyDataMapper() - cowAxesMapper.SetInputConnection(cowAxesSource.GetOutputPort()) - - cowAxes = vtkActor() - cowAxes.SetMapper(cowAxesMapper) - cowAxes.VisibilityOff() - - ren.AddActor(cowAxes) - - ren.SetBackground(colors.GetColor3d('BkgColor1')) - renWin.SetSize(600, 480) - - iren.Initialize() - cowAxes.VisibilityOn() - renWin.Render() - - # Activate this if you want to see the Position and Focal point. - # ren.GetActiveCamera().AddObserver('ModifiedEvent', CameraModifiedCallback) - - # These four walks use the same camera position. - Rotate_X(cowActor, ren, renWin) - Rotate_Y(cowActor, ren, renWin) - Rotate_Z(cowActor, ren, renWin) - Rotate_XY(cowActor, ren, renWin) - - ren.SetBackground(colors.GetColor3d('BkgColor2')) - if figure == 1: - Rotate_V_0(cowActor, ren, renWin) - elif figure == 2: - Rotate_V_V(cowActor, ren, renWin) - else: - Rotate_V_0(cowActor, ren, renWin) - Rotate_V_V(cowActor, ren, renWin) - # Walk() needs to go after Rotate_V_0() or Rotate_V_V(). - Walk(cowActor, ren, renWin) - - # Interact with data. - renWin.EraseOff() - iren.Start() - - -def main(): - file_name, figure = get_program_parameters() - walk_cow(file_name, figure) - - -def get_program_parameters(): - import argparse - description = 'Produce figures: 3-32, 3-33a, 3-33b from the VTK Textbook.' - epilogue = ''' - It is a translation of the original WalkCow.tcl with a few additional enhancements. - - If the parameter figure is 0, 1 or 2 then these correspond to - the VTK Textbook figures 3-32, 3-33a, 3-33b in that order. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='The file cow.g.') - parser.add_argument('figure', default=0, type=int, nargs='?', help='The particular rotation that you want to view.') - args = parser.parse_args() - return args.filename, args.figure - - -''' - These Rotate* and Walk functions create a scene where multiple - views of the object exist. - - They all operate in a similar manner, namely: - 1) Accept vtkActor, vtkRenderer, vtkRenderWindow as parameters. - 2) Position the object. - 3) Position the observer with the focal point sent to the centre - of the object. - 4) Render and set EraseOff() in the render window. - Note that: - EraseOff() has to be called after a Render() call - to work in the desired way. - 5) Then rotate or Walk the object around the scene. - 6) Optionally write out the scene using Screenshot(). - 6) Set EraseOff() in the render window. - 7) Reset the object position. - -''' - - -def Rotate_X(cowActor, ren, renWin): - # Six rotations about the x axis. - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(2, 25, 0) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.GetActiveCamera().SetViewUp(0, 0, -1) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(0, 6): - cowActor.RotateX(60) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-31a.png', renWin) - renWin.EraseOn() - - -def Rotate_Y(cowActor, ren, renWin): - # Six rotations about the y axis. - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(2, 0, 25) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(0, 6): - cowActor.RotateY(60) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-31b.png', renWin) - renWin.EraseOn() - - -def Rotate_Z(cowActor, ren, renWin): - # Six rotations about the z axis. - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - # This closely matches the original illustration. - # ren.GetActiveCamera().SetPosition(2, 0, 25) - ren.GetActiveCamera().SetPosition(2, 0, 25) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(0, 6): - cowActor.RotateZ(60) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-31c.png', renWin) - renWin.EraseOn() - - -def Rotate_XY(cowActor, ren, renWin): - # First a rotation about the x axis, then six rotations about the y axis. - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - # This closely matches the original illustration. - # ren.GetActiveCamera().SetPosition(2, 0, 24) - ren.GetActiveCamera().SetPosition(2, 0, 25) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.GetActiveCamera().SetViewUp(0, 1, 0) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - cowActor.RotateX(60) - for idx in range(0, 6): - cowActor.RotateY(60) - renWin.Render() - renWin.Render() - cowActor.RotateX(-60) - # Screenshot('Fig3-31d.png', renWin) - renWin.EraseOn() - - -def Rotate_V_0(cowActor, ren, renWin): - # The cow rotating about a vector passing through her nose. - # With the origin at (0, 0, 0). - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - cowPos = vtkTransform() - cowPos.Identity() - cowPos.SetMatrix(cowActor.GetMatrix()) - cowTransform = vtkTransform() - cowTransform.Identity() - cowActor.SetUserMatrix(cowTransform.GetMatrix()) - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(16, 9, -12) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(0, 6): - cowActor.RotateWXYZ(60, 2.19574, -1.42455, -0.0331036) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-33a.png', renWin) - renWin.EraseOn() - # Put the cow back on the origin. - # for idx in range(0, 6): - # cowActor.RotateWXYZ(-60, 2.19574, -1.42455, -0.0331036) - # cowActor.SetUserMatrix(cowPos.GetMatrix()) - # ren.GetActiveCamera().SetPosition(0, 0, 1) - # ren.GetActiveCamera().SetViewUp(0, 1, 0) - # ren.ResetCamera() - - -def Rotate_V_V(cowActor, ren, renWin): - # The cow rotating about a vector passing through her nose. - # With the origin at (6.11414, 1.27386, 0.015175). - ren.ResetCamera() - ren.ResetCameraClippingRange() - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0) - cowActor.SetPosition(0, 0, 0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - cowPos = vtkTransform() - cowPos.Identity() - cowPos.SetMatrix(cowActor.GetMatrix()) - cowActor.SetOrigin(6.11414, 1.27386, 0.015175) # The cow's nose - cowTransform = vtkTransform() - cowTransform.Identity() - cowActor.SetUserMatrix(cowTransform.GetMatrix()) - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(31, 23, -21) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(0, 6): - cowActor.RotateWXYZ(60, 2.19574, -1.42455, -0.0331036) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-33b.png', renWin) - renWin.EraseOn() - # Put the cow back on the origin. - # for idx in range(0, 6): - # cowActor.RotateWXYZ(-60, 2.19574, -1.42455, -0.0331036) - # cowActor.SetUserMatrix(cowPos.GetMatrix()) - - -def Walk(cowActor, ren, renWin): - # The cow 'walking' around the global origin - cowPos = vtkTransform() - cowPos.Identity() - cowPos.SetMatrix(cowActor.GetMatrix()) - cowActor.SetOrientation(0.0, 0.0, 0.0) - cowActor.SetOrigin(0.0, 0.0, 0.0) - # Get the focal point. - bounds = cowActor.GetBounds() - fp = [0.0] * 3 - for i in range(0, 3): - fp[i] = (bounds[i * 2 + 1] + bounds[i * 2]) / 2.0 - cowTransform = vtkTransform() - cowTransform.Identity() - cowTransform.Translate(0, 0, 5) - cowActor.SetUserMatrix(cowTransform.GetMatrix()) - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(1, 24, 16) - ren.GetActiveCamera().SetFocalPoint(fp) - ren.GetActiveCamera().SetViewUp(0, 0, -1) - ren.ResetCameraClippingRange() - renWin.Render() - renWin.Render() - renWin.EraseOff() - for idx in range(1, 7): - cowTransform.Identity() - cowTransform.RotateY(idx * 60) - cowTransform.Translate(0, 0, 5) - cowActor.SetUserMatrix(cowTransform.GetMatrix()) - renWin.Render() - renWin.Render() - # Screenshot('Fig3-32.png', renWin) - renWin.EraseOn() - # Walkies are over, put the cow back on the origin. - # cowActor.SetUserMatrix(cowPos.GetMatrix()) - - -def CameraModifiedCallback(caller, ev): - ''' - Used to estimate positions similar to the book illustrations. - :param caller: - :return: - ''' - print(caller.GetClassName(), 'modified') - # Print the interesting stuff. - print('\tPosition: ', - caller.GetPosition()[0], ', ', - caller.GetPosition()[1], ', ', - caller.GetPosition()[2]) - print('\tFocal point: ', - caller.GetFocalPoint()[0], ', ', - caller.GetFocalPoint()[1], ', ', - caller.GetFocalPoint()[2]) - - -def Screenshot(fileName, renWin): - ''' - Save a screenshot. - :param fileName: - :param renWin: - :return: - ''' - windowToImageFilter = vtkWindowToImageFilter() - windowToImageFilter.SetInput(renWin) - windowToImageFilter.SetScale(1) # image quality - # We are not recording the alpha (transparency) channel. - # windowToImageFilter.SetInputBufferTypeToRGBA() - windowToImageFilter.SetInputBufferTypeToRGB() - # Read from the front buffer. - windowToImageFilter.ReadFrontBufferOff() - windowToImageFilter.Update() - - writer = vtkPNGWriter() - writer.SetFileName(fileName) - writer.SetInputConnection(windowToImageFilter.GetOutputPort()) - writer.Write() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/WalkCowA.py b/data/examples/Rendering/WalkCowA.py deleted file mode 100755 index eb4215d..0000000 --- a/data/examples/Rendering/WalkCowA.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -""" -WalkCow, VTK Textbook figure 3-33a. - -Note: Make sure WalkCow.py is in the same directory as this program. -""" - -import WalkCow - - -def main(): - file_name, figure = WalkCow.get_program_parameters() - figure = 1 - WalkCow.walk_cow(file_name, figure) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Rendering/WalkCowB.py b/data/examples/Rendering/WalkCowB.py deleted file mode 100755 index 4b270b1..0000000 --- a/data/examples/Rendering/WalkCowB.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -""" -WalkCow, VTK Textbook figure 3-33b. - -Note: Make sure WalkCow.py is in the same directory as this program. -""" - -import WalkCow - - -def main(): - file_name, figure = WalkCow.get_program_parameters() - figure = 2 - WalkCow.walk_cow(file_name, figure) - - -if __name__ == '__main__': - main() diff --git a/data/examples/SimpleOperations/DistanceBetweenPoints.md b/data/examples/SimpleOperations/DistanceBetweenPoints.md deleted file mode 100644 index 9796f9d..0000000 --- a/data/examples/SimpleOperations/DistanceBetweenPoints.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example finds the squared distance and the Euclidean distance between two 3D points. diff --git a/data/examples/SimpleOperations/DistanceBetweenPoints.py b/data/examples/SimpleOperations/DistanceBetweenPoints.py deleted file mode 100755 index e0eca27..0000000 --- a/data/examples/SimpleOperations/DistanceBetweenPoints.py +++ /dev/null @@ -1,23 +0,0 @@ -# !/usr/bin/env python - -import math - -from vtkmodules.vtkCommonCore import vtkMath - - -def main(): - p0 = (0, 0, 0) - p1 = (1, 1, 1) - - distSquared = vtkMath.Distance2BetweenPoints(p0, p1) - - dist = math.sqrt(distSquared) - - print('p0 = ', p0) - print('p1 = ', p1) - print('distance squared = ', distSquared) - print('distance = ', dist) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Snippets.md b/data/examples/Snippets.md deleted file mode 100644 index a657ede..0000000 --- a/data/examples/Snippets.md +++ /dev/null @@ -1,29 +0,0 @@ -### Description - -Snippets are chunks of code that can be cut (*snipped*) and pasted into examples. We want each example to be stand-alone, so we do not keep the snippet code in a library. - -### Available snippets - -#### [CameraPosition](/Python/Snippets/CameraPosition.md) - -Output the camera position while moving the image. - -#### [CheckVTKVersion](/Python/Snippets/CheckVTKVersion.md) - -Check the VTK version returning `True` if the requested VTK version is >= the current version. - -#### [PointToGlyph](/Python/Snippets/PointToGlyph.md) - -Represent points as glyphs. - -#### [GetProgramParameters](/Python/Snippets/GetProgramParameters.md) - -Get the program parameters. - -#### [ReadPolyData](/Python/Snippets/ReadPolyData.md) - -Uses the appropriate vtkPolyData reader to read any vtkPolyData file. - -#### [WriteImage](/Python/Snippets/WriteImage.md) - -Take a screen shot from the render window and write it to a file. The file extension selects the writer to use. diff --git a/data/examples/Snippets/CameraPosition.md b/data/examples/Snippets/CameraPosition.md deleted file mode 100644 index bdf5c36..0000000 --- a/data/examples/Snippets/CameraPosition.md +++ /dev/null @@ -1,37 +0,0 @@ -### Description - -A callback that gives you the camera position and focal point. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -``` Python - -def camera_modified_callback(caller, event): - """ - Used to estimate positions similar to the book illustrations. - :param caller: - :param event: - :return: - """ - print(caller.GetClassName(), "modified") - # Print the interesting stuff. - res = f'\tcamera = renderer.GetActiveCamera()\n' - res += f'\tcamera.SetPosition({", ".join(map("{0:0.6f}".format, caller.GetPosition()))})\n' - res += f'\tcamera.SetFocalPoint({", ".join(map("{0:0.6f}".format, caller.GetFocalPoint()))})\n' - res += f'\tcamera.SetViewUp({", ".join(map("{0:0.6f}".format, caller.GetViewUp()))})\n' - res += f'\tcamera.SetDistance({"{0:0.6f}".format(caller.GetDistance())})\n' - res += f'\tcamera.SetClippingRange({", ".join(map("{0:0.6f}".format, caller.GetClippingRange()))})\n' - print(res) - -``` - -### Usage - -```python - renWin.Render() - ren.GetActiveCamera().AddObserver('ModifiedEvent', camera_modified_callback) -``` - -Once you have the output, replace the `ren.GetActiveCamera().AddObserver...` line with the output data. diff --git a/data/examples/Snippets/CheckVTKVersion.md b/data/examples/Snippets/CheckVTKVersion.md deleted file mode 100644 index 2ffe9a0..0000000 --- a/data/examples/Snippets/CheckVTKVersion.md +++ /dev/null @@ -1,63 +0,0 @@ -### Description - -This enables us to check the VTK version and provide alternatives for different VTK versions. - -`True` is returned if the requested VTK version is >= the current version. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -``` python - -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major)\ - + 100000000 * int(minor)\ - + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: - # Expand component-wise comparisons for VTK versions < 8.90. - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion()\ - + 100000000 * ver.GetVTKMinorVersion()\ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - -``` - -### Typical usage - -``` python - - if vtk_version_ok(*ver): - try: - print('Our newest version of the code.') - except AttributeError: - pass - else: - print('This is code for older versions of VTK.') - print('Rest of the code.') - -``` - -See: - -- [PBR_Skybox](../../Rendering/PBR_Skybox) for a typical usage example. Here we are deciding to use `vtkCameraOrientationWidget` instead of `vtkOrientationMarkerWidget` if the VTK version is >= 9.0.20210718. -- [CheckVTKVersion](../../Utilities/CheckVTKVersion) for a test/example. diff --git a/data/examples/Snippets/GetProgramParameters.md b/data/examples/Snippets/GetProgramParameters.md deleted file mode 100644 index c0f31dd..0000000 --- a/data/examples/Snippets/GetProgramParameters.md +++ /dev/null @@ -1,34 +0,0 @@ -### Description - -Get the program parameters. - -This particular snippet requires a file name and an optional figure number. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -``` python - -def get_program_parameters(): - import argparse - description = 'What the program does.' - epilogue = ''' - An expanded description of what the program does. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='A required filename.') - parser.add_argument('figure', default=0, type=int, nargs='?', help='An optional figure number.') - args = parser.parse_args() - return args.filename, args.figure - - -``` - -### Typical usage - -``` python - -file_name, figure = get_program_parameters() - -``` diff --git a/data/examples/Snippets/PointToGlyph.md b/data/examples/Snippets/PointToGlyph.md deleted file mode 100644 index 75857f5..0000000 --- a/data/examples/Snippets/PointToGlyph.md +++ /dev/null @@ -1,62 +0,0 @@ -### Description - -Represent points as glyphs. The point is represented as a sphere. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -``` Python - -# from vtkmodules.vtkCommonDataModel import vtkPolyData -# from vtkmodules.vtkFiltersSources import vtkSphereSource -# from vtkmodules.vtkRenderingCore import ( -# vtkActor, -# vtkGlyph3DMapper -# ) - - -def point_to_glyph(points, scale): - """ - Convert points to glyphs. - :param points: The points to glyph. - :param scale: The scale, used to determine the size of the - glyph representing the point, expressed as a - fraction of the largest side of the bounding - box surrounding the points. e.g. 0.05 - :return: The actor. - """ - - bounds = points.GetBounds() - max_len = 0.0 - for i in range(0, 3): - max_len = max(bounds[i + 1] - bounds[i], max_len) - - sphere_source = vtkSphereSource() - sphere_source.SetRadius(scale * max_len) - - pd = vtkPolyData() - pd.SetPoints(points) - - mapper = vtkGlyph3DMapper() - mapper.SetInputData(pd) - mapper.SetSourceConnection(sphere_source.GetOutputPort()) - mapper.ScalarVisibilityOff() - mapper.ScalingOff() - - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - -``` - -### Usage - -``` Python - - # Map the points to spheres - sphereActor = point_to_glyph(someFilter.GetOutput().GetPoints(), 0.05) - # Set the actor color here - -``` diff --git a/data/examples/Snippets/ReadPolyData.md b/data/examples/Snippets/ReadPolyData.md deleted file mode 100644 index 3df267b..0000000 --- a/data/examples/Snippets/ReadPolyData.md +++ /dev/null @@ -1,65 +0,0 @@ -### Description - -Given a filename, uses the appropriate vtkPolyData reader to read any vtkPolyData file. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -``` python -# from pathlib import Path - -# from vtkmodules.vtkIOGeometry import ( -# vtkBYUReader, -# vtkOBJReader, -# vtkSTLReader -# ) -# from vtkmodules.vtkIOLegacy import vtkPolyDataReader -# from vtkmodules.vtkIOPLY import vtkPLYReader -# from vtkmodules.vtkIOXML import vtkXMLPolyDataReader - - -def ReadPolyData(file_name): - valid_suffixes = ['.g', '.obj', '.stl', '.ply', '.vtk', '.vtp'] - path = Path(file_name) - if path.suffix: - ext = path.suffix.lower() - if path.suffix not in valid_suffixes: - print(f'No reader for this file suffix: {ext}') - return None - else: - if ext == ".ply": - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif ext == ".vtp": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif ext == ".obj": - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif ext == ".stl": - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif ext == ".vtk": - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif ext == ".g": - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - - return poly_data - - -``` diff --git a/data/examples/Snippets/WriteImage.md b/data/examples/Snippets/WriteImage.md deleted file mode 100644 index b4d679c..0000000 --- a/data/examples/Snippets/WriteImage.md +++ /dev/null @@ -1,92 +0,0 @@ -### Description - -Given a filename, render window and optionally a rgba value, take a screenshot of the render window and write it to a file. The extension of the filename determines what writer to use. - -To use the snippet, click the *Copy to clipboard* at the upper right of the code blocks. - -### Implementation - -```python - - -# from pathlib import Path -# -# from vtkmodules.vtkIOImage import ( -# vtkBMPWriter, -# vtkJPEGWriter, -# vtkPNGWriter, -# vtkPNMWriter, -# vtkPostScriptWriter, -# vtkTIFFWriter -# ) -# from vtkmodules.vtkRenderingCore import vtkWindowToImageFilter - - -def write_image(file_name, ren_win, rgba=True): - """ - Write the render window view to an image file. - - Image types supported are: - BMP, JPEG, PNM, PNG, PostScript, TIFF. - The default parameters are used for all writers, change as needed. - - :param file_name: The file name, if no extension then PNG is assumed. - :param ren_win: The render window. - :param rgba: Used to set the buffer type. - :return: - """ - - if file_name: - valid_suffixes = ['.bmp', '.jpg', '.png', '.pnm', '.ps', '.tiff'] - # Select the writer to use. - parent = Path(file_name).resolve().parent - path = Path(parent) / file_name - if path.suffix: - ext = path.suffix.lower() - else: - ext = '.png' - path = Path(str(path)).with_suffix(ext) - if path.suffix not in valid_suffixes: - print(f'No writer for this file suffix: {ext}') - return - if ext == '.bmp': - writer = vtkBMPWriter() - elif ext == '.jpg': - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': - if rgba: - rgba = False - writer = vtkPostScriptWriter() - elif ext == '.tiff': - writer = vtkTIFFWriter() - else: - writer = vtkPNGWriter() - - windowto_image_filter = vtkWindowToImageFilter() - windowto_image_filter.SetInput(ren_win) - windowto_image_filter.SetScale(1) # image quality - if rgba: - windowto_image_filter.SetInputBufferTypeToRGBA() - else: - windowto_image_filter.SetInputBufferTypeToRGB() - # Read from the front buffer. - windowto_image_filter.ReadFrontBufferOff() - windowto_image_filter.Update() - - writer.SetFileName(path) - writer.SetInputConnection(windowto_image_filter.GetOutputPort()) - writer.Write() - else: - raise RuntimeError('Need a filename.') - -``` - -### Usage - -```python - - write_image(file_name, ren_win, rgba=False) - -``` diff --git a/data/examples/StructuredGrid/BlankPoint.py b/data/examples/StructuredGrid/BlankPoint.py deleted file mode 100755 index 404309d..0000000 --- a/data/examples/StructuredGrid/BlankPoint.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkStructuredGrid -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - points = vtkPoints() - - grid_size = 8 - counter = 0 - pt_idx = 0 - # Create a 5x5 grid of points - for j in range(0, grid_size): - for i in range(0, grid_size): - if i == 3 and j == 3: # Make one point higher than the rest. - points.InsertNextPoint(i, j, 2) - print(f'The different point is number {counter}.') - pt_idx = counter - else: - # Make most of the points the same height. - points.InsertNextPoint(i, j, 0) - counter += 1 - - structured_grid = vtkStructuredGrid() - # Specify the dimensions of the grid, set the points and blank one point. - structured_grid.SetDimensions(grid_size, grid_size, 1) - structured_grid.SetPoints(points) - structured_grid.BlankPoint(pt_idx) - - # Check. - def is_visible(pt_num): - if structured_grid.IsPointVisible(pt_num): - return f'Point {pt_num:2d} is visible.' - else: - return f'Point {pt_num:2d} is not visible.' - - # Should not be visible. - print(is_visible(pt_idx)) - # Should be visible. - print(is_visible(7)) - - # We need the geometry filter to ensure that the - # blanked point and surrounding faces is missing. - geometry_filter = vtkStructuredGridGeometryFilter() - geometry_filter.SetInputData(structured_grid) - - # Create a mapper and actor. - grid_mapper = vtkDataSetMapper() - grid_mapper.SetInputConnection(geometry_filter.GetOutputPort()) - - grid_actor = vtkActor() - grid_actor.SetMapper(grid_mapper) - grid_actor.GetProperty().EdgeVisibilityOn() - grid_actor.GetProperty().SetEdgeColor(colors.GetColor3d('Blue')) - - # Visualize - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - renderer.AddActor(grid_actor) - renderer.SetBackground(colors.GetColor3d('ForestGreen')) - - # ren_win.SetSize(640, 480) - ren_win.SetWindowName('BlankPoint') - ren_win.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/StructuredGrid/SGrid.md b/data/examples/StructuredGrid/SGrid.md deleted file mode 100644 index 14360d0..0000000 --- a/data/examples/StructuredGrid/SGrid.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Creating a structured grid dataset of a semicylinder. Vectors are created whose magnitude is proportional to radius and oriented in tangential direction. - -!!! info - See [Figure 5-19](../../../VTKBook/05Chapter5/#Figure%205-19) in [Chapter 5](../../../VTKBook/05Chapter5) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/StructuredGrid/SGrid.py b/data/examples/StructuredGrid/SGrid.py deleted file mode 100755 index e325c51..0000000 --- a/data/examples/StructuredGrid/SGrid.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python - -''' -This example shows how to manually create a structured grid. -The basic idea is to instantiate vtkStructuredGrid, set its dimensions, - and then assign points defining the grid coordinate. The number of - points must equal the number of points implicit in the dimensions - (i.e., dimX*dimY*dimZ). Also, data attributes (either point or cell) - can be added to the dataset. -''' - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkMath, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkStructuredGrid -from vtkmodules.vtkFiltersCore import vtkHedgeHog -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - rMin = 0.5 - rMax = 1.0 - dims = [13, 11, 11] - - # Create the structured grid. - sgrid = vtkStructuredGrid() - sgrid.SetDimensions(dims) - - # We also create the points and vectors. The points - # form a hemi-cylinder of data. - vectors = vtkDoubleArray() - vectors.SetNumberOfComponents(3) - vectors.SetNumberOfTuples(dims[0] * dims[1] * dims[2]) - points = vtkPoints() - points.Allocate(dims[0] * dims[1] * dims[2]) - - deltaZ = 2.0 / (dims[2] - 1) - deltaRad = (rMax - rMin) / (dims[1] - 1) - x = [0.0] * 3 - v = [0.0] * 3 - for k in range(0, dims[2]): - x[2] = -1.0 + k * deltaZ - kOffset = k * dims[0] * dims[1] - for j in range(0, dims[1]): - radius = rMin + j * deltaRad - jOffset = j * dims[0] - for i in range(0, dims[0]): - theta = i * vtkMath.RadiansFromDegrees(15.0) - x[0] = radius * math.cos(theta) - x[1] = radius * math.sin(theta) - v[0] = -x[1] - v[1] = x[0] - offset = i + jOffset + kOffset - points.InsertPoint(offset, x) - vectors.InsertTuple(offset, v) - sgrid.SetPoints(points) - sgrid.GetPointData().SetVectors(vectors) - - # We create a simple pipeline to display the data. - hedgehog = vtkHedgeHog() - hedgehog.SetInputData(sgrid) - hedgehog.SetScaleFactor(0.1) - - sgridMapper = vtkPolyDataMapper() - sgridMapper.SetInputConnection(hedgehog.GetOutputPort()) - sgridActor = vtkActor() - sgridActor.SetMapper(sgridMapper) - sgridActor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Create the usual rendering stuff - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - renWin.SetWindowName('SGrid') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - renderer.AddActor(sgridActor) - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(60.0) - renderer.GetActiveCamera().Azimuth(30.0) - renderer.GetActiveCamera().Dolly(1.0) - renWin.SetSize(640, 480) - - # Interact with the data. - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/StructuredPoints/Vol.md b/data/examples/StructuredPoints/Vol.md deleted file mode 100644 index 70353a5..0000000 --- a/data/examples/StructuredPoints/Vol.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - - Creating a image data dataset. Scalar data is generated from the equation for a sphere. Volume dimensions are 26^3. - -!!! info - See [Figure 5-18](../../../VTKBook/05Chapter5/#Figure%205-18) in [Chapter 5](../../../VTKBook/05Chapter5) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/StructuredPoints/Vol.py b/data/examples/StructuredPoints/Vol.py deleted file mode 100755 index 7881766..0000000 --- a/data/examples/StructuredPoints/Vol.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkStructuredPoints -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - vol = vtkStructuredPoints() - vol.SetDimensions(26, 26, 26) - vol.SetOrigin(-0.5, -0.5, -0.5) - sp = 1.0 / 25.0 - vol.SetSpacing(sp, sp, sp) - - scalars = vtkDoubleArray() - scalars.SetNumberOfComponents(1) - scalars.SetNumberOfTuples(26 * 26 * 26) - for k in range(0, 26): - z = -0.5 + k * sp - kOffset = k * 26 * 26 - for j in range(0, 26): - y = -0.5 + j * sp - jOffset = j * 26 - for i in range(0, 26): - x = -0.5 + i * sp - s = x * x + y * y + z * z - (0.4 * 0.4) - offset = i + jOffset + kOffset - scalars.InsertTuple1(offset, s) - vol.GetPointData().SetScalars(scalars) - - contour = vtkContourFilter() - contour.SetInputData(vol) - contour.SetValue(0, 0.0) - - volMapper = vtkPolyDataMapper() - volMapper.SetInputConnection(contour.GetOutputPort()) - volMapper.ScalarVisibilityOff() - volActor = vtkActor() - volActor.SetMapper(volMapper) - volActor.GetProperty().EdgeVisibilityOn() - volActor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - renderer.AddActor(volActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(512, 512) - renWin.SetWindowName('Vol') - - # Interact with the data. - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Texture/AnimateVectors.md b/data/examples/Texture/AnimateVectors.md deleted file mode 100644 index be0c7a4..0000000 --- a/data/examples/Texture/AnimateVectors.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -Texture maps can be animated as a function of time. By choosing a texture map whose intensity varies monotonically from dark to light, and then “moving” the texture along an object,the object appears to crawl in the direction of the texture map motion. We can use this technique to add apparent motion to things like hedgehogs to show vector magnitude. This example uses texture map animation to simulate vector field motion. - -!!! cite - See [B. Yamrom and K. M. Martin. *Vector Field Animation with Texture Maps.*](http://ieeexplore.ieee.org/abstract/document/365001/) IEEE Computer Graphics and Applications. 15(2):22–24, 1995 for background. - -!!! info - See [Figure 7-3](../../../VTKBook/07Chapter7/#Figure%207-3) in [Chapter 7](../../../VTKBook/07Chapter7) the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/Texture/AnimateVectors.py b/data/examples/Texture/AnimateVectors.py deleted file mode 100755 index 765a5f2..0000000 --- a/data/examples/Texture/AnimateVectors.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env python - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkGlyph3D, - vtkThresholdPoints -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - vec_anim_paths = [''] * 2 - fn1, fn2 = get_program_parameters() - vec_anim_paths[0] = Path(fn1) - vec_anim_paths[1] = Path(fn2) - - # Generate the other vecAnim file names. There are 8 of them. - tmp = str(vec_anim_paths[1]) - old_stem = vec_anim_paths[1].stem - for i in range(2, 9): - new_stem = old_stem[:-1] + str(i) - vec_anim_paths.append(Path(tmp.replace(old_stem, new_stem))) - - colors = vtkNamedColors() - - # Setup the render window, renderer, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Read the data. - - # Create the pipeline. - - reader = vtkStructuredPointsReader() - reader.SetFileName(vec_anim_paths[0]) - - threshold = vtkThresholdPoints() - threshold.SetInputConnection(reader.GetOutputPort()) - threshold.ThresholdByUpper(200) - - line = vtkLineSource() - line.SetResolution(1) - - lines = vtkGlyph3D() - lines.SetInputConnection(threshold.GetOutputPort()) - lines.SetSourceConnection(line.GetOutputPort()) - lines.SetScaleFactor(0.005) - lines.SetScaleModeToScaleByScalar() - lines.Update() - - vectorMapper = vtkPolyDataMapper() - vectorMapper.SetInputConnection(lines.GetOutputPort()) - vectorMapper.SetScalarRange(lines.GetOutput().GetScalarRange()) - - vectorActor = vtkActor() - vectorActor.SetMapper(vectorMapper) - vectorActor.GetProperty().SetOpacity(0.99) - vectorActor.GetProperty().SetLineWidth(1.5) - - # Outline - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Texture maps. - textureMaps = list() - for i in range(2, len(vec_anim_paths)): - tmap = vtkStructuredPointsReader() - tmap.SetFileName(vec_anim_paths[i]) - - texture = vtkTexture() - texture.SetInputConnection(tmap.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - textureMaps.append(texture) - - vectorActor.SetTexture(textureMaps[0]) - - # Add the actors to the renderer, set the background and size. - - renderer.AddActor(vectorActor) - renderer.AddActor(outlineActor) - - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) - renderer.SetActiveCamera(cam1) - - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('AnimateVectors') - - # Go into a loop. - for j in range(0, 100): - for i in range(0, len(textureMaps)): - vectorActor.SetTexture(textureMaps[i]) - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Texture maps can be animated as a function of time.' - epilogue = ''' - This example uses texture map animation to simulate vector field motion. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='carotid.') - parser.add_argument('filename2', help='VectorAnimation/vecAnim1.vtk.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/Texture/TextureCutQuadric.md b/data/examples/Texture/TextureCutQuadric.md deleted file mode 100644 index 342f973..0000000 --- a/data/examples/Texture/TextureCutQuadric.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Clip geometry using a 2D texture map and two implicit functions. The -technique is described in : [Geometric Clipping Using Boolean -Textures](http://marchingcubes.org/images/c/c0/GeometricClippingUsingBooleanTextures.pdf). - -!!! info - See [Figure 9-45b](../../../VTKBook/09Chapter9/#Figure%209-45b) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Texture/TextureCutQuadric.py b/data/examples/Texture/TextureCutQuadric.py deleted file mode 100755 index 1e833ad..0000000 --- a/data/examples/Texture/TextureCutQuadric.py +++ /dev/null @@ -1,265 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkFiltersTexture import vtkImplicitTextureCoords -from vtkmodules.vtkImagingHybrid import vtkBooleanTexture -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - -positions = [ - [-4, 4, 0], [-2, 4, 0], [0, 4, 0], [2, 4, 0], - [-4, 2, 0], [-2, 2, 0], [0, 2, 0], [2, 2, 0], - [-4, 0, 0], [-2, 0, 0], [0, 0, 0], [2, 0, 0], - [-4, -2, 0], [-2, -2, 0], [0, -2, 0], [2, -2, 0] -] - -solid = [255, 255] -clear = [255, 0] -edge = [0, 255] - - -def main(): - colors = vtkNamedColors() - - renWin = vtkRenderWindow() - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - aren = vtkRenderer() - - # define two elliptical cylinders - quadric1 = vtkQuadric() - quadric1.SetCoefficients(1, 2, 0, 0, 0, 0, 0, 0, 0, -.07) - - quadric2 = vtkQuadric() - quadric2.SetCoefficients(2, 1, 0, 0, 0, 0, 0, 0, 0, -.07) - - # Create a sphere for all to use. - aSphere = vtkSphereSource() - aSphere.SetPhiResolution(21) - aSphere.SetThetaResolution(21) - - # Create texture coordinates for all. - tcoords = vtkImplicitTextureCoords() - tcoords.SetInputConnection(aSphere.GetOutputPort()) - tcoords.SetRFunction(quadric1) - tcoords.SetSFunction(quadric2) - - aMapper = vtkDataSetMapper() - aMapper.SetInputConnection(tcoords.GetOutputPort()) - - # Create a mapper, sphere and texture map for each case. - for i in range(0, 16): - aBoolean = MakeBooleanTexture(i, 64, 0) - - aTexture2 = vtkTexture() - aTexture2.SetInputConnection(aBoolean.GetOutputPort()) - aTexture2.InterpolateOff() - aTexture2.RepeatOff() - - anActor2 = vtkActor() - - anActor2.SetMapper(aMapper) - anActor2.SetTexture(aTexture2) - anActor2.SetPosition(positions[i]) - anActor2.SetScale(2.0, 2.0, 2.0) - anActor2.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - aren.AddActor(anActor2) - - aren.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(500, 500) - renWin.AddRenderer(aren) - renWin.SetWindowName('TextureCutQuadric') - - # Interact with the data. - renWin.Render() - - iren.Start() - - -def MakeBooleanTexture(caseNumber, resolution, thickness): - booleanTexture = vtkBooleanTexture() - - booleanTexture.SetXSize(resolution) - booleanTexture.SetYSize(resolution) - booleanTexture.SetThickness(thickness) - - if caseNumber == 0: - booleanTexture.SetInIn(solid) - booleanTexture.SetOutIn(solid) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(solid) - booleanTexture.SetOnIn(solid) - booleanTexture.SetOnOut(solid) - booleanTexture.SetInOn(solid) - booleanTexture.SetOutOn(solid) - elif caseNumber == 1: # cut inside 1 - booleanTexture.SetInIn(clear) - booleanTexture.SetOutIn(solid) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(solid) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(solid) - elif caseNumber == 2: # cut outside 1 - booleanTexture.SetInIn(solid) - booleanTexture.SetOutIn(clear) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(solid) - booleanTexture.SetInOn(solid) - booleanTexture.SetOutOn(edge) - elif caseNumber == 3: # cut all 1 - booleanTexture.SetInIn(clear) - booleanTexture.SetOutIn(clear) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(clear) - booleanTexture.SetOnOut(solid) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(edge) - elif caseNumber == 4: - booleanTexture.SetInIn(solid) - booleanTexture.SetOutIn(solid) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(solid) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(solid) - elif caseNumber == 5: - booleanTexture.SetInIn(clear) - booleanTexture.SetOutIn(solid) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(clear) - booleanTexture.SetOutOn(solid) - elif caseNumber == 6: - booleanTexture.SetInIn(solid) - booleanTexture.SetOutIn(clear) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(edge) - elif caseNumber == 7: - booleanTexture.SetInIn(clear) - booleanTexture.SetOutIn(clear) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutOut(solid) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(clear) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(clear) - booleanTexture.SetOutOn(edge) - elif caseNumber == 8: - booleanTexture.SetInIn(solid) - booleanTexture.SetOutIn(solid) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(solid) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(solid) - booleanTexture.SetOutOn(edge) - elif caseNumber == 9: - booleanTexture.SetInIn(clear) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutIn(solid) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(edge) - elif caseNumber == 10: - booleanTexture.SetInIn(solid) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutIn(clear) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(solid) - booleanTexture.SetOutOn(clear) - elif caseNumber == 11: - booleanTexture.SetInIn(clear) - booleanTexture.SetInOut(solid) - booleanTexture.SetOutIn(clear) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(clear) - booleanTexture.SetOnOut(edge) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(clear) - elif caseNumber == 12: - booleanTexture.SetInIn(solid) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutIn(solid) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(solid) - booleanTexture.SetOnOut(clear) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(edge) - elif caseNumber == 13: - booleanTexture.SetInIn(clear) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutIn(solid) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(clear) - booleanTexture.SetInOn(clear) - booleanTexture.SetOutOn(edge) - elif caseNumber == 14: - booleanTexture.SetInIn(solid) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutIn(clear) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(edge) - booleanTexture.SetOnIn(edge) - booleanTexture.SetOnOut(clear) - booleanTexture.SetInOn(edge) - booleanTexture.SetOutOn(clear) - else: # caseNumber == 15: - booleanTexture.SetInIn(clear) - booleanTexture.SetInOut(clear) - booleanTexture.SetOutIn(clear) - booleanTexture.SetOutOut(clear) - booleanTexture.SetOnOn(clear) - booleanTexture.SetOnIn(clear) - booleanTexture.SetOnOut(clear) - booleanTexture.SetInOn(clear) - booleanTexture.SetOutOn(clear) - - return booleanTexture - - -if __name__ == '__main__': - main() diff --git a/data/examples/Texture/TextureCutSphere.py b/data/examples/Texture/TextureCutSphere.py deleted file mode 100755 index fb83e93..0000000 --- a/data/examples/Texture/TextureCutSphere.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPlanes -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkFiltersTexture import vtkImplicitTextureCoords -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # hidden sphere - sphere1 = vtkSphereSource() - sphere1.SetRadius(0.5) - - innerMapper = vtkPolyDataMapper() - innerMapper.SetInputConnection(sphere1.GetOutputPort()) - - innerSphere = vtkActor() - innerSphere.SetMapper(innerMapper) - innerSphere.GetProperty().SetColor(colors.GetColor3d('BlanchedAlmond')) - - # sphere to texture - sphere2 = vtkSphereSource() - sphere2.SetRadius(1.0) - sphere2.SetPhiResolution(21) - sphere2.SetThetaResolution(21) - - pts = [0.0] * 6 - points = vtkPoints() - points.SetNumberOfPoints(2) - points.SetPoint(0, pts[:3]) - points.SetPoint(1, pts[3:]) - - nrms = [0.0] * 6 - nrms[0] = 1.0 - nrms[4] = 1.0 - normals = vtkDoubleArray() - normals.SetNumberOfComponents(3) - normals.SetNumberOfTuples(2) - normals.SetTuple(0, nrms[:3]) - normals.SetTuple(1, nrms[3:]) - - planes = vtkPlanes() - planes.SetPoints(points) - planes.SetNormals(normals) - - tcoords = vtkImplicitTextureCoords() - tcoords.SetInputConnection(sphere2.GetOutputPort()) - tcoords.SetRFunction(planes) - - outerMapper = vtkDataSetMapper() - outerMapper.SetInputConnection(tcoords.GetOutputPort()) - - tmap = vtkStructuredPointsReader() - tmap.SetFileName(fileName) - - texture = vtkTexture() - texture.SetInputConnection(tmap.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - - outerSphere = vtkActor() - outerSphere.SetMapper(outerMapper) - outerSphere.SetTexture(texture) - outerSphere.GetProperty().SetColor(colors.GetColor3d('LightSalmon')) - - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - aren = vtkRenderer() - iren.SetRenderWindow(renWin) - renWin.AddRenderer(aren) - - aren.AddActor(innerSphere) - aren.AddActor(outerSphere) - aren.SetBackground(colors.GetColor3d('SlateGray')) - aren.GetActiveCamera().Azimuth(-30) - aren.GetActiveCamera().Elevation(-30) - aren.ResetCamera() - - renWin.SetSize(500, 500) - renWin.SetWindowName('TextureCutSphere') - - # interact with data - renWin.Render() - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Cut an outer sphere to reveal an inner sphere.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='texThres.vtk.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Texture/TexturePlane.py b/data/examples/Texture/TexturePlane.py deleted file mode 100755 index 86d1711..0000000 --- a/data/examples/Texture/TexturePlane.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOImage import vtkImageReader2Factory -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Load in the texture map. A texture is any unsigned char image. If it - # is not of this type, you will have to map it through a lookup table - # or by using vtkImageShiftScale. - # - readerFactory = vtkImageReader2Factory() - textureFile = readerFactory.CreateImageReader2(fileName) - textureFile.SetFileName(fileName) - textureFile.Update() - - atext = vtkTexture() - atext.SetInputConnection(textureFile.GetOutputPort()) - atext.InterpolateOn() - - # Create a plane source and actor. The vtkPlanesSource generates - # texture coordinates. - # - plane = vtkPlaneSource() - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(plane.GetOutputPort()) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.SetTexture(atext) - - # Create the RenderWindow, Renderer and Interactor. - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - renderer.AddActor(planeActor) - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('TexturePlane') - - # render the image - renWin.Render() - - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(-30) - renderer.GetActiveCamera().Roll(-20) - renderer.ResetCameraClippingRange() - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'How to do basic texture mapping.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='masonry.bmp.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Texture/TextureThreshold.md b/data/examples/Texture/TextureThreshold.md deleted file mode 100644 index e14f115..0000000 --- a/data/examples/Texture/TextureThreshold.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -Demonstrating texture thresholding applied to scalar data from a simulation of fluid flow. - -There are three planes cutting the blunt fin with different thresholds set. From the left, the scalar threshold is set so that: - -1. Only data with a scalar value greater than or equal to 1.5 is shown. -2. Only data with a scalar value less than or equal to 1.5 is shown. -3. Only data with a scalar value between 1.5 and 1.8 inclusive is shown. - -!!! info - See [Figure 9-43a](../../../VTKBook/09Chapter9/#Figure%209-43a) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Texture/TextureThreshold.py b/data/examples/Texture/TextureThreshold.py deleted file mode 100755 index b3a0a54..0000000 --- a/data/examples/Texture/TextureThreshold.py +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/env python - -# Modified from VTK/Filters/Texture/Testing/Python/textureThreshold.py. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersTexture import vtkThresholdTextureCoords -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - dataFn1, dataFn2, textureFn = get_program_parameters() - colors = vtkNamedColors() - - # Read the data. - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(dataFn1) - pl3d.SetQFileName(dataFn2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - output = pl3d.GetOutput().GetBlock(0) - - # Make the wall (floor). - wall = vtkStructuredGridGeometryFilter() - wall.SetInputData(output) - wall.SetExtent(0, 100, 0, 0, 0, 100) - wallMap = vtkPolyDataMapper() - wallMap.SetInputConnection(wall.GetOutputPort()) - wallMap.ScalarVisibilityOff() - wallActor = vtkActor() - wallActor.SetMapper(wallMap) - wallActor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Make the fin (rear wall) - fin = vtkStructuredGridGeometryFilter() - fin.SetInputData(output) - fin.SetExtent(0, 100, 0, 100, 0, 0) - finMap = vtkPolyDataMapper() - finMap.SetInputConnection(fin.GetOutputPort()) - finMap.ScalarVisibilityOff() - finActor = vtkActor() - finActor.SetMapper(finMap) - finActor.GetProperty().SetColor(colors.GetColor3d('DarkSlateGray')) - - # Get the texture. - tmap = vtkStructuredPointsReader() - tmap.SetFileName(textureFn) - texture = vtkTexture() - texture.SetInputConnection(tmap.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Make the planes to threshold and texture. - plane = list() - thresh = list() - planeMap = list() - planeActor = list() - # Define the extents of planes that we will use. - planeExtents = [[10, 10, 0, 100, 0, 100], - [30, 30, 0, 100, 0, 100], - [35, 35, 0, 100, 0, 100]] - # Now set up the pipeline. - for i in range(0, len(planeExtents)): - plane.append(vtkStructuredGridGeometryFilter()) - plane[i].SetInputData(output) - plane[i].SetExtent(*planeExtents[i]) - thresh.append(vtkThresholdTextureCoords()) - thresh[i].SetInputConnection(plane[i].GetOutputPort()) - thresh[i].SetInputConnection(plane[i].GetOutputPort()) - # If you want an image similar to Fig 9-43(a) in the VTK textbook, - # set thresh[i].ThresholdByUpper(1.5) for all planes. - if i == 1: - thresh[i].ThresholdByLower(1.5) - elif i == 2: - thresh[i].ThresholdBetween(1.5, 1.8) - else: - thresh[i].ThresholdByUpper(1.5) - planeMap.append(vtkDataSetMapper()) - planeMap[i].SetInputConnection(thresh[i].GetOutputPort()) - planeMap[i].SetScalarRange(output.GetScalarRange()) - planeActor.append(vtkActor()) - planeActor[i].SetMapper(planeMap[i]) - planeActor[i].SetTexture(texture) - # The slight transparency gives a nice effect. - planeActor[i].GetProperty().SetOpacity(0.999) - ren.AddActor(planeActor[i]) - - # Get an outline of the data set for context. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(output) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineProp = outlineActor.GetProperty() - outlineProp.SetColor(colors.GetColor3d('Black')) - - # Add the remaining actors to the renderer, set the background and size. - ren.AddActor(outlineActor) - ren.AddActor(wallActor) - ren.AddActor(finActor) - ren.SetBackground(colors.GetColor3d('MistyRose')) - renWin.SetSize(512, 512) - renWin.SetWindowName('TextureThreshold') - - cam = vtkCamera() - cam.SetClippingRange(1.51176, 75.5879) - cam.SetFocalPoint(2.33749, 2.96739, 3.61023) - cam.SetPosition(10.8787, 5.27346, 15.8687) - cam.SetViewAngle(30) - cam.SetViewUp(-0.0610856, 0.987798, -0.143262) - ren.SetActiveCamera(cam) - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Demonstrating texture thresholding applied to scalar data from a simulation of fluid flow.' - epilogue = ''' - There are three planes cutting the blunt fin with different thresholds set. - From the left, the scalar threshold is set so that: - 1) Only data with a scalar value greater than or equal to 1.5 is shown. - 2) Only data with a scalar value less than or equal to 1.5 is shown. - 3) Only data with a scalar value between 1.5 and 1.8 inclusive is shown. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('dataFn1', help='bluntfinxyz.bin.') - parser.add_argument('dataFn2', help='bluntfinq.bin.') - parser.add_argument('textureFn', help='texThres2.bmp') - args = parser.parse_args() - return args.dataFn1, args.dataFn2, args.textureFn - - -if __name__ == '__main__': - main() diff --git a/data/examples/Tutorial/Tutorial_Step1.md b/data/examples/Tutorial/Tutorial_Step1.md deleted file mode 100644 index 5adfd6a..0000000 --- a/data/examples/Tutorial/Tutorial_Step1.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example creates a polygonal model of a cone, and then renders it to -the screen. It will rotate the cone 360 degrees and then exit. The basic -setup of `source -> mapper -> actor -> renderer -> renderwindow` is typical of most VTK programs. diff --git a/data/examples/Tutorial/Tutorial_Step1.py b/data/examples/Tutorial/Tutorial_Step1.py deleted file mode 100755 index 909e8a4..0000000 --- a/data/examples/Tutorial/Tutorial_Step1.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderer -) - - -def main(argv): - # - # Next we create an instance of vtkNamedColors and we will use - # this to select colors for the object and background. - # - colors = vtkNamedColors() - - # - # Now we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource "cone" is part of a - # visualization pipeline (it is a source process object) it produces data - # (output type is vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the cone. The actor orchestrates rendering - # of the mapper's graphics primitives. An actor also refers to properties - # via a vtkProperty instance, and includes an internal transformation - # matrix. We set this actor's mapper to be coneMapper which we created - # above. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is - # responsible for drawing the actors it has. We also set the background - # color here. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('MidnightBlue')) - - # Finally we create the render window which will show up on the screen. - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName('Tutorial_Step1') - - # - # Now we loop over 360 degrees and render the cone each time. - # - for i in range(0, 360): - # Render the image - renWin.Render() - # Rotate the active camera by one degree. - ren1.GetActiveCamera().Azimuth(1) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Tutorial/Tutorial_Step2.md b/data/examples/Tutorial/Tutorial_Step2.md deleted file mode 100644 index 1532c76..0000000 --- a/data/examples/Tutorial/Tutorial_Step2.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -This example shows how to add an observer to a Python program. It extends -the [Tutorial_Step1](../Tutorial_Step1) example (see that example for information on -the basic setup). - -VTK uses a command/observer design pattern. That is, observers watch for -particular events that any vtkObject (or subclass) may invoke on -itself. For example, the vtkRenderer invokes a "StartEvent" as it begins -to render. Here we add an observer that invokes a command when this event -is observed. diff --git a/data/examples/Tutorial/Tutorial_Step2.py b/data/examples/Tutorial/Tutorial_Step2.py deleted file mode 100755 index 9bda0dc..0000000 --- a/data/examples/Tutorial/Tutorial_Step2.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # - # The pipeline creation is documented in Tutorial_Step1. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('MidnightBlue')) - ren1.ResetCamera() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName('Tutorial_Step2') - - # Here is where we setup the observer. - mo1 = vtkMyCallback(ren1) - ren1.AddObserver('StartEvent', mo1) - - # - # Now we loop over 360 degrees and render the cone each time. - # - for i in range(0, 360): - # Render the image. - renWin.Render() - # Rotate the active camera by one degree. - ren1.GetActiveCamera().Azimuth(1) - - -class vtkMyCallback(object): - """ - Callback for the interaction. - """ - - def __init__(self, renderer): - self.renderer = renderer - - def __call__(self, caller, ev): - position = self.renderer.GetActiveCamera().GetPosition() - print('({:5.2f}, {:5.2f}, {:5.2f})'.format(*position)) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Tutorial/Tutorial_Step3.md b/data/examples/Tutorial/Tutorial_Step3.md deleted file mode 100644 index 9fa5716..0000000 --- a/data/examples/Tutorial/Tutorial_Step3.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -This example demonstrates how to use multiple renderers within a -render window. diff --git a/data/examples/Tutorial/Tutorial_Step3.py b/data/examples/Tutorial/Tutorial_Step3.py deleted file mode 100755 index eec2fd6..0000000 --- a/data/examples/Tutorial/Tutorial_Step3.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data - # (output type is vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the cone. The actor orchestrates rendering - # of the mapper's graphics primitives. An actor also refers to properties - # via a vtkProperty instance, and includes an internal transformation - # matrix. We set this actor's mapper to be coneMapper which we created - # above. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # - # Create two renderers and assign actors to them. A renderer renders into - # a viewport within the vtkRenderWindow. It is part or all of a window on - # the screen and it is responsible for drawing the actors it has. We also - # set the background color here. In this example we are adding the same - # actor to two different renderers it is okay to add different actors to - # different renderers as well. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('RoyalBlue')) - - ren1.SetViewport(0.0, 0.0, 0.5, 1.0) - - ren2 = vtkRenderer() - ren2.AddActor(coneActor) - ren2.SetBackground(colors.GetColor3d('DodgerBlue')) - ren2.SetViewport(0.5, 0.0, 1.0, 1.0) - - # - # Finally we create the render window which will show up on the screen. - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.AddRenderer(ren2) - renWin.SetSize(600, 300) - renWin.SetWindowName('Tutorial_Step3') - - # - # Make one view 90 degrees from other. - # - ren1.ResetCamera() - ren1.GetActiveCamera().Azimuth(90) - - # - # Now we loop over 360 degrees and render the cones each time. - # - for i in range(0, 360): # render the image - renWin.Render() - # rotate the active camera by one degree - ren1.GetActiveCamera().Azimuth(1) - ren2.GetActiveCamera().Azimuth(1) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Tutorial/Tutorial_Step4.md b/data/examples/Tutorial/Tutorial_Step4.md deleted file mode 100644 index fd6442c..0000000 --- a/data/examples/Tutorial/Tutorial_Step4.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -This example demonstrates the creation of multiple actors and the -manipulation of their properties and transformations. diff --git a/data/examples/Tutorial/Tutorial_Step4.py b/data/examples/Tutorial/Tutorial_Step4.py deleted file mode 100755 index 072b284..0000000 --- a/data/examples/Tutorial/Tutorial_Step4.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource "cone" is part of a - # visualization pipeline (it is a source process object) it produces data - # (output type is vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the first cone. The actor's properties are - # modified to give it different surface properties. By default, an actor - # is create with a property so the GetProperty() method can be used. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(0.2, 0.63, 0.79) - coneActor.GetProperty().SetDiffuse(0.7) - coneActor.GetProperty().SetSpecular(0.4) - coneActor.GetProperty().SetSpecularPower(20) - - # - # Create a property and directly manipulate it. Assign it to the - # second actor. - # - property = vtkProperty() - property.SetColor(colors.GetColor3d("Tomato")) - property.SetDiffuse(0.7) - property.SetSpecular(0.4) - property.SetSpecularPower(20) - - # - # Create a second actor and a property. The property is directly - # manipulated and then assigned to the actor. In this way, a single - # property can be shared among many actors. Note also that we use the - # same mapper as the first actor did. This way we avoid duplicating - # geometry, which may save lots of memory if the geometry is large. - coneActor2 = vtkActor() - coneActor2.SetMapper(coneMapper) - coneActor2.GetProperty().SetColor(colors.GetColor3d("LightSeaGreen")) - coneActor2.SetProperty(property) - coneActor2.SetPosition(0, 2, 0) - - # - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is - # responsible for drawing the actors it has. We also set the background - # color here. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.AddActor(coneActor2) - ren1.SetBackground(colors.GetColor3d("CornflowerBlue")) - - # - # Finally we create the render window which will show up on the screen. - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName("Tutorial_Step4") - - # - # Now we loop over 360 degrees and render the cones each time. - # - for i in range(0, 360): # render the image - # render the image - renWin.Render() - # rotate the active camera by one degree - ren1.GetActiveCamera().Azimuth(1) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Tutorial/Tutorial_Step5.md b/data/examples/Tutorial/Tutorial_Step5.md deleted file mode 100644 index 739920a..0000000 --- a/data/examples/Tutorial/Tutorial_Step5.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example introduces the concepts of interaction into the -Python environment. A different interaction style (than -the default) is defined. diff --git a/data/examples/Tutorial/Tutorial_Step5.py b/data/examples/Tutorial/Tutorial_Step5.py deleted file mode 100755 index 614eec3..0000000 --- a/data/examples/Tutorial/Tutorial_Step5.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data - # (output type is vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the cone. The actor orchestrates rendering - # of the mapper's graphics primitives. An actor also refers to properties - # via a vtkProperty instance, and includes an internal transformation - # matrix. We set this actor's mapper to be coneMapper which we created - # above. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is - # responsible for drawing the actors it has. We also set the background - # color here. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('MidnightBlue')) - - # - # Finally we create the render window which will show up on the screen. - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName('Tutorial_Step5') - - # - # The vtkRenderWindowInteractor class watches for events (e.g., keypress, - # mouse) in the vtkRenderWindow. These events are translated into - # event invocations that VTK understands (see VTK/Common/vtkCommand.h - # for all events that VTK processes). Then observers of these VTK - # events can process them as appropriate. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # By default the vtkRenderWindowInteractor instantiates an instance - # of vtkInteractorStyle. vtkInteractorStyle translates a set of events - # it observes into operations on the camera, actors, and/or properties - # in the vtkRenderWindow associated with the vtkRenderWinodwInteractor. - # Here we specify a particular interactor style. - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Unlike the previous scripts where we performed some operations and then - # exited, here we leave an event loop running. The user can use the mouse - # and keyboard to perform the operations on the scene according to the - # current interaction style. When the user presses the 'e' key, by default - # an ExitEvent is invoked by the vtkRenderWindowInteractor which is caught - # and drops out of the event loop (triggered by the Start() method that - # follows. - # - iren.Initialize() - iren.Start() - - # - # Final note: recall that observers can watch for particular events and - # take appropriate action. Pressing 'u' in the render window causes the - # vtkRenderWindowInteractor to invoke a UserEvent. This can be caught to - # popup a GUI, etc. See the Tcl Cone5.tcl example for an idea of how this - # works. - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Tutorial/Tutorial_Step6.md b/data/examples/Tutorial/Tutorial_Step6.md deleted file mode 100644 index cc8aff4..0000000 --- a/data/examples/Tutorial/Tutorial_Step6.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -This example introduces 3D widgets. 3D widgets take advantage of the -event/observer design pattern introduced previously. They typically -have a particular representation in the scene which can be interactively -selected and manipulated using the mouse and keyboard. As the widgets -are manipulated, they in turn invoke events such as StartInteractionEvent, -InteractionEvent, and EndInteractionEvent which can be used to manipulate -the scene that the widget is embedded in. 3D widgets work in the context -of the event loop which was set up in the previous example. diff --git a/data/examples/Tutorial/Tutorial_Step6.py b/data/examples/Tutorial/Tutorial_Step6.py deleted file mode 100755 index 604932d..0000000 --- a/data/examples/Tutorial/Tutorial_Step6.py +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env python - -""" -========================================================================= - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ - -""" - -# First access the VTK module (and any other needed modules) by importing them. -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkBoxWidget -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data - # (output type is vtkPolyData) which other filters may process. - # - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # - # In this example we terminate the pipeline with a mapper process object. - # (Intermediate filters such as vtkShrinkPolyData could be inserted in - # between the source and the mapper.) We create an instance of - # vtkPolyDataMapper to map the polygonal data into graphics primitives. We - # connect the output of the cone source to the input of this mapper. - # - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - - # - # Create an actor to represent the cone. The actor orchestrates rendering - # of the mapper's graphics primitives. An actor also refers to properties - # via a vtkProperty instance, and includes an internal transformation - # matrix. We set this actor's mapper to be coneMapper which we created - # above. - # - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is - # responsible for drawing the actors it has. We also set the background - # color here. - # - ren1 = vtkRenderer() - ren1.AddActor(coneActor) - ren1.SetBackground(colors.GetColor3d('MidnightBlue')) - - # - # Finally we create the render window which will show up on the screen. - # We put our renderer into the render window using AddRenderer. We also - # set the size to be 300 pixels by 300. - # - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName('Tutorial_Step6') - - # - # The vtkRenderWindowInteractor class watches for events (e.g., keypress, - # mouse) in the vtkRenderWindow. These events are translated into - # event invocations that VTK understands (see VTK/Common/vtkCommand.h - # for all events that VTK processes). Then observers of these VTK - # events can process them as appropriate. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # By default the vtkRenderWindowInteractor instantiates an instance - # of vtkInteractorStyle. vtkInteractorStyle translates a set of events - # it observes into operations on the camera, actors, and/or properties - # in the vtkRenderWindow associated with the vtkRenderWinodwInteractor. - # Here we specify a particular interactor style. - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Here we use a vtkBoxWidget to transform the underlying coneActor (by - # manipulating its transformation matrix). Many other types of widgets - # are available for use, see the documentation for more details. - # - # The SetInteractor method is how 3D widgets are associated with the render - # window interactor. Internally, SetInteractor sets up a bunch of callbacks - # using the Command/Observer mechanism (AddObserver()). The place factor - # controls the initial size of the widget with respect to the bounding box - # of the input to the widget. - boxWidget = vtkBoxWidget() - boxWidget.SetInteractor(iren) - boxWidget.SetPlaceFactor(1.25) - boxWidget.GetOutlineProperty().SetColor(colors.GetColor3d('Gold')) - - # - # Place the interactor initially. The input to a 3D widget is used to - # initially position and scale the widget. The EndInteractionEvent is - # observed which invokes the SelectPolygons callback. - # - boxWidget.SetProp3D(coneActor) - boxWidget.PlaceWidget() - callback = vtkMyCallback() - boxWidget.AddObserver('InteractionEvent', callback) - - # - # Normally the user presses the 'i' key to bring a 3D widget to life. Here - # we will manually enable it so it appears with the cone. - # - boxWidget.On() - - # - # Start the event loop. - # - iren.Initialize() - iren.Start() - - -class vtkMyCallback(object): - """ - Callback for the interaction. - """ - - def __call__(self, caller, ev): - t = vtkTransform() - widget = caller - widget.GetTransform(t) - widget.GetProp3D().SetUserTransform(t) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.md b/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.md deleted file mode 100644 index d693ab1..0000000 --- a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.md +++ /dev/null @@ -1,32 +0,0 @@ -### Description - -The example uses vtkTableBasedClipDataSet to clip a vtkUnstructuredGrid. The resulting output and clipped output are presented in yellow and red respectively. To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each output about their centers. - -Note that unlike other clipping filters (except for vtkClipPolyData), vtkTableBasedClipDataSet retains the original cells if they are not clipped. - -After exiting, the example reports the number of each cell type for each output: - -``` text ------------------------- -The inside dataset contains a -?vtkUnstructuredGrid? that has 26116 cells - Cell type ?vtkTetra? occurs 3751 times. - Cell type ?vtkHexahedron? occurs 17361 times. - Cell type ?vtkWedge? occurs 628 times. - Cell type ?vtkPyramid? occurs 4376 times. ------------------------- -The clipped dataset contains a -?vtkUnstructuredGrid? that has 25655 cells - Cell type ?vtkTetra? occurs 3715 times. - Cell type ?vtkHexahedron? occurs 16984 times. - Cell type ?vtkWedge? occurs 616 times. - Cell type ?vtkPyramid? occurs 4340 times. -``` - -Compare these results with [ClipUnstructuredGridWithPlane2](../ClipUnstructuredGridWithPlane2). Also, the resulting ?vtkUnstructuredGrid?'s have a quarter of the number of cells. - -!!! example "usage" - ClipUnstructuredGridWithPlane treemesh.vtk - -!!! info "thanks" - Thanks to Bane Sullivan for sharing the treemesh.vtk unstructured grid dataset. diff --git a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.py b/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.py deleted file mode 100755 index 75eecf4..0000000 --- a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python - -import collections - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkCellTypes, - vtkPlane -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTableBasedClipDataSet -from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Use a vtkTableBasedClipDataSet to clip a vtkUnstructuredGrid.' - epilogue = ''' - Use a vtkTableBasedClipDataSet to clip a vtkUnstructuredGrid. - The resulting output and clipped output are presented in yellow and red respectively. - To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each - output about their centers. - Note: This clipping filter does retain the original cells if they are not clipped. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='treemesh.vtk') - args = parser.parse_args() - return args.filename - - -def main(): - filename = get_program_parameters() - - # Create the reader for the data. - reader = vtkUnstructuredGridReader() - reader.SetFileName(filename) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - center = reader.GetOutput().GetCenter() - - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - xnorm = [-1.0, -1.0, 1.0] - - clipPlane = vtkPlane() - clipPlane.SetOrigin(reader.GetOutput().GetCenter()) - clipPlane.SetNormal(xnorm) - - clipper = vtkTableBasedClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() - - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - - clippedMapper = vtkDataSetMapper() - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() - - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - - # Create transforms to make a better visualization - insideTransform = vtkTransform() - insideTransform.Translate(-(bounds[1] - bounds[0]) * 0.75, 0, 0) - insideTransform.Translate(center[0], center[1], center[2]) - insideTransform.RotateY(-120.0) - insideTransform.Translate(-center[0], -center[1], -center[2]) - insideActor.SetUserTransform(insideTransform) - - clippedTransform = vtkTransform() - clippedTransform.Translate((bounds[1] - bounds[0]) * 0.75, 0, 0) - clippedTransform.Translate(center[0], center[1], center[2]) - clippedTransform.RotateY(60.0) - clippedTransform.Translate(-center[0], -center[1], -center[2]) - clippedActor.SetUserTransform(clippedTransform) - - renderer.AddViewProp(clippedActor) - renderer.AddViewProp(insideActor) - - renderer.ResetCamera() - renderer.GetActiveCamera().Dolly(1.4) - renderer.ResetCameraClippingRange() - renderWindow.Render() - renderWindow.SetWindowName('ClipUnstructuredGridWithPlane') - renderWindow.Render() - - interactor.Start() - - # Generate a report - numberOfCells = clipper.GetOutput().GetNumberOfCells() - print('------------------------') - print('The inside dataset contains a \n', clipper.GetOutput().GetClassName(), ' that has ', numberOfCells, ' cells') - cellMap = dict() - for i in range(0, numberOfCells): - cellMap.setdefault(clipper.GetOutput().GetCellType(i), 0) - cellMap[clipper.GetOutput().GetCellType(i)] += 1 - # Sort by key and put into an OrderedDict. - # An OrderedDict remembers the order in which the keys have been inserted. - for k, v in collections.OrderedDict(sorted(cellMap.items())).items(): - print('\tCell type ', vtkCellTypes.GetClassNameFromTypeId(k), ' occurs ', v, ' times.') - - numberOfCells = clipper.GetClippedOutput().GetNumberOfCells() - print('------------------------') - print('The clipped dataset contains a \n', clipper.GetClippedOutput().GetClassName(), ' that has ', numberOfCells, - ' cells') - outsideCellMap = dict() - for i in range(0, numberOfCells): - outsideCellMap.setdefault(clipper.GetClippedOutput().GetCellType(i), 0) - outsideCellMap[clipper.GetClippedOutput().GetCellType(i)] += 1 - for k, v in collections.OrderedDict(sorted(outsideCellMap.items())).items(): - print('\tCell type ', vtkCellTypes.GetClassNameFromTypeId(k), ' occurs ', v, ' times.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.md b/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.md deleted file mode 100644 index 3fcfe03..0000000 --- a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.md +++ /dev/null @@ -1,28 +0,0 @@ -### Description - -The example uses vtkClipDataSet to clip a vtkUnstructuredGrid. The resulting output and clipped output are presented in yellow and red respectively. To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each output about their centers. - -Note that this clipping filter does not retain the original cells if they are not clipped. - -After exiting, the example reports the number of each cell type for each output: - -``` text ------------------------- -The inside dataset contains a -?vtkUnstructuredGrid? that has 110084 cells - Cell type ?vtkTetra? occurs 106934 times. - Cell type ?vtkWedge? occurs 3150 times. ------------------------- -The clipped dataset contains a -?vtkUnstructuredGrid? that has 110084 cells - Cell type ?vtkTetra? occurs 107401 times. - Cell type ?vtkWedge? occurs 4332 times. -``` - -Compare these results with [ClipUnstructuredGridWithPlane](../ClipUnstructuredGridWithPlane). Notice that in this example, the original ?vtkHexahedron? in the unclipped regions are converted to ?vtkTetra?. Also, the resulting ?vtkUnstructuredGrid?'s have more than 4 times the number of cells. - -!!! example "usage" - ClipUnstructuredGridWithPlane2 treemesh.vtk - -!!! info "thanks" - Thanks to Bane Sullivan for sharing the treemesh.vtk unstructured grid dataset. diff --git a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.py b/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.py deleted file mode 100755 index 45dac64..0000000 --- a/data/examples/UnstructuredGrid/ClipUnstructuredGridWithPlane2.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env python - -import collections - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkCellTypes, - vtkPlane -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkClipDataSet -from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Use a vtkClipDataSet to clip a vtkUnstructuredGrid..' - epilogue = ''' - Use a vtkClipDataSet to clip a vtkUnstructuredGrid.. - The resulting output and clipped output are presented in yellow and red respectively. - To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each - output about their centers. - Note: This clipping filter does not retain the original cells if they are not clipped. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='treemesh.vtk') - parser.add_argument('-o', action='store_false', - help='Output using the original code.') - args = parser.parse_args() - return args.filename, args.o - - -def main(): - filename, correct_output = get_program_parameters() - - # Create the reader for the data. - reader = vtkUnstructuredGridReader() - reader.SetFileName(filename) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - center = reader.GetOutput().GetCenter() - - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - xnorm = [-1.0, -1.0, 1.0] - - clipPlane = vtkPlane() - clipPlane.SetOrigin(reader.GetOutput().GetCenter()) - clipPlane.SetNormal(xnorm) - - if correct_output: - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOff() - clipper.Update() - - # Set inside out, generate the clipped output and - # use the clipped output for the clipped mapper. - # If this is done a similar image to - # ClipUnstructuredGridWithPlane is created. - clipper1 = vtkClipDataSet() - clipper1.SetClipFunction(clipPlane) - clipper1.SetInputData(reader.GetOutput()) - clipper1.SetValue(0.0) - clipper1.InsideOutOn() - clipper1.GenerateClippedOutputOn() - clipper1.Update() - - else: - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() - - clipper1 = None - - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - - clippedMapper = vtkDataSetMapper() - if correct_output: - clippedMapper.SetInputData(clipper1.GetClippedOutput()) - else: - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() - - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - - # Create transforms to make a better visualization - insideTransform = vtkTransform() - insideTransform.Translate(-(bounds[1] - bounds[0]) * 0.75, 0, 0) - insideTransform.Translate(center[0], center[1], center[2]) - insideTransform.RotateY(-120.0) - insideTransform.Translate(-center[0], -center[1], -center[2]) - insideActor.SetUserTransform(insideTransform) - - clippedTransform = vtkTransform() - clippedTransform.Translate((bounds[1] - bounds[0]) * 0.75, 0, 0) - clippedTransform.Translate(center[0], center[1], center[2]) - if correct_output: - clippedTransform.RotateY(60.0) - else: - clippedTransform.RotateY(-120.0) - clippedTransform.Translate(-center[0], -center[1], -center[2]) - clippedActor.SetUserTransform(clippedTransform) - - renderer.AddViewProp(clippedActor) - renderer.AddViewProp(insideActor) - - renderer.ResetCamera() - renderer.GetActiveCamera().Dolly(1.4) - renderer.ResetCameraClippingRange() - renderWindow.Render() - renderWindow.SetWindowName('ClipUnstructuredGridWithPlane2') - renderWindow.Render() - - interactor.Start() - - # Generate a report - numberOfCells = clipper.GetOutput().GetNumberOfCells() - print('------------------------') - print('The inside dataset contains a \n', clipper.GetOutput().GetClassName(), ' that has ', numberOfCells, ' cells') - cellMap = dict() - for i in range(0, numberOfCells): - cellMap.setdefault(clipper.GetOutput().GetCellType(i), 0) - cellMap[clipper.GetOutput().GetCellType(i)] += 1 - # Sort by key and put into an OrderedDict. - # An OrderedDict remembers the order in which the keys have been inserted. - for k, v in collections.OrderedDict(sorted(cellMap.items())).items(): - print('\tCell type ', vtkCellTypes.GetClassNameFromTypeId(k), ' occurs ', v, ' times.') - - print('------------------------') - outsideCellMap = dict() - if correct_output: - number_of_cells = clipper1.GetClippedOutput().GetNumberOfCells() - print('The clipped dataset contains a \n', clipper1.GetClippedOutput().GetClassName(), ' that has ', - numberOfCells, - ' cells') - for i in range(0, number_of_cells): - outsideCellMap.setdefault(clipper1.GetClippedOutput().GetCellType(i), 0) - outsideCellMap[clipper1.GetClippedOutput().GetCellType(i)] += 1 - else: - number_of_cells = clipper.GetClippedOutput().GetNumberOfCells() - print('The clipped dataset contains a \n', clipper.GetClippedOutput().GetClassName(), ' that has ', - numberOfCells, - ' cells') - for i in range(0, number_of_cells): - outsideCellMap.setdefault(clipper.GetClippedOutput().GetCellType(i), 0) - outsideCellMap[clipper.GetClippedOutput().GetCellType(i)] += 1 - for k, v in collections.OrderedDict(sorted(outsideCellMap.items())).items(): - print(f' Cell type {vtkCellTypes.GetClassNameFromTypeId(k)} occurs {v} times.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/UnstructuredGrid/UGrid.md b/data/examples/UnstructuredGrid/UGrid.md deleted file mode 100644 index 201ffc9..0000000 --- a/data/examples/UnstructuredGrid/UGrid.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Creation of an unstructured grid. - -!!! info - See [Figure 5-21](../../../VTKBook/05Chapter5/#Figure%205-21) in [Chapter 05](../../..//VTKBook/05Chapter5) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/UnstructuredGrid/UGrid.py b/data/examples/UnstructuredGrid/UGrid.py deleted file mode 100755 index 2abce10..0000000 --- a/data/examples/UnstructuredGrid/UGrid.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env python - -''' -This example shows how to create an unstructured grid. -''' - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - VTK_HEXAHEDRON, - VTK_LINE, - VTK_POLYGON, - VTK_QUAD, - VTK_TETRA, - VTK_TRIANGLE, - VTK_TRIANGLE_STRIP, - VTK_VERTEX, - vtkUnstructuredGrid -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - x = [[0, 0, 0], [1, 0, 0], [2, 0, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [0, 0, 1], [1, 0, 1], [2, 0, 1], [0, 1, 1], - [1, 1, 1], [2, 1, 1], [0, 1, 2], [1, 1, 2], [2, 1, 2], [0, 1, 3], [1, 1, 3], [2, 1, 3], [0, 1, 4], [1, 1, 4], - [2, 1, 4], [0, 1, 5], [1, 1, 5], [2, 1, 5], [0, 1, 6], [1, 1, 6], [2, 1, 6]] - # Here we have kept consistency with the Cxx example of the same name. - # This means we will use slicing in ugrid.InsertNextCell to ensure that the correct - # number of points are used. - pts = [[0, 1, 4, 3, 6, 7, 10, 9], [1, 2, 5, 4, 7, 8, 11, 10], [6, 10, 9, 12, 0, 0, 0, 0], - [8, 11, 10, 14, 0, 0, 0, 0], [16, 17, 14, 13, 12, 15, 0, 0], [18, 15, 19, 16, 20, 17, 0, 0], - [22, 23, 20, 19, 0, 0, 0, 0], [21, 22, 18, 0, 0, 0, 0, 0], [22, 19, 18, 0, 0, 0, 0, 0], - [23, 26, 0, 0, 0, 0, 0, 0], [21, 24, 0, 0, 0, 0, 0, 0], [25, 0, 0, 0, 0, 0, 0, 0]] - print(len(x), len(pts)) - - renderer = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - points = vtkPoints() - for i in range(0, len(x)): - points.InsertPoint(i, x[i]) - - ugrid = vtkUnstructuredGrid() - ugrid.Allocate(100) - ugrid.InsertNextCell(VTK_HEXAHEDRON, 8, pts[0]) - ugrid.InsertNextCell(VTK_HEXAHEDRON, 8, pts[1]) - ugrid.InsertNextCell(VTK_TETRA, 4, pts[2][:4]) - ugrid.InsertNextCell(VTK_TETRA, 4, pts[3][:4]) - ugrid.InsertNextCell(VTK_POLYGON, 6, pts[4][:6]) - ugrid.InsertNextCell(VTK_TRIANGLE_STRIP, 6, pts[5][:6]) - ugrid.InsertNextCell(VTK_QUAD, 4, pts[6][:4]) - ugrid.InsertNextCell(VTK_TRIANGLE, 3, pts[7][:3]) - ugrid.InsertNextCell(VTK_TRIANGLE, 3, pts[8][:3]) - ugrid.InsertNextCell(VTK_LINE, 2, pts[9][:2]) - ugrid.InsertNextCell(VTK_LINE, 2, pts[10][:2]) - ugrid.InsertNextCell(VTK_VERTEX, 1, pts[11][:1]) - - ugrid.SetPoints(points) - - ugridMapper = vtkDataSetMapper() - ugridMapper.SetInputData(ugrid) - - ugridActor = vtkActor() - ugridActor.SetMapper(ugridMapper) - ugridActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - ugridActor.GetProperty().EdgeVisibilityOn() - - renderer.AddActor(ugridActor) - renderer.SetBackground(colors.GetColor3d('Beige')) - - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(60.0) - renderer.GetActiveCamera().Azimuth(30.0) - renderer.GetActiveCamera().Dolly(1.0) - - renWin.SetSize(640, 480) - renWin.SetWindowName('UGrid') - - # Interact with the data. - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/Animation.md b/data/examples/Utilities/Animation.md deleted file mode 100644 index ffe1911..0000000 --- a/data/examples/Utilities/Animation.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example demonstrates how to create a simple animation. A timer is used to move a sphere across a scene. diff --git a/data/examples/Utilities/Animation.py b/data/examples/Utilities/Animation.py deleted file mode 100755 index 50e66d3..0000000 --- a/data/examples/Utilities/Animation.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -class vtkTimerCallback(): - def __init__(self, steps, actor, iren): - self.timer_count = 0 - self.steps = steps - self.actor = actor - self.iren = iren - self.timerId = None - - def execute(self, obj, event): - step = 0 - while step < self.steps: - print(self.timer_count) - self.actor.SetPosition(self.timer_count / 100.0, self.timer_count / 100.0, 0) - iren = obj - iren.GetRenderWindow().Render() - self.timer_count += 1 - step += 1 - if self.timerId: - iren.DestroyTimer(self.timerId) - - -def main(): - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(2) - sphereSource.SetPhiResolution(30) - sphereSource.SetThetaResolution(30) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphereSource.GetOutputPort()) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.SetMapper(mapper) - # actor.SetPosition(-5, -5, 0) - - # Setup a renderer, render window, and interactor - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d("MistyRose")) - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName("Animation") - renderWindow.AddRenderer(renderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - - # Render and interact - renderWindow.Render() - renderer.GetActiveCamera().Zoom(0.8) - renderWindow.Render() - - # Initialize must be called prior to creating timer events. - renderWindowInteractor.Initialize() - - # Sign up to receive TimerEvent - cb = vtkTimerCallback(200, actor, renderWindowInteractor) - renderWindowInteractor.AddObserver('TimerEvent', cb.execute) - cb.timerId = renderWindowInteractor.CreateRepeatingTimer(500) - - # start the interaction and timer - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/CheckVTKVersion.py b/data/examples/Utilities/CheckVTKVersion.py deleted file mode 100755 index c94c2e3..0000000 --- a/data/examples/Utilities/CheckVTKVersion.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python3 - -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) \ - + 100000000 * int(minor) \ - + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: - # Expand component-wise comparisons for VTK versions < 8.90. - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() \ - + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -def main(): - print('VTK Version:',vtkVersion.GetVTKVersion()) - if not vtk_version_ok(9, 0, 0): - print('You need VTK version 9.0.0 or greater to run this program.') - return - - test_versions = ((9, 2, 20220831), (9, 19, 0)) - for ver in test_versions: - if vtk_version_ok(*ver): - print('This code works for VTK Versions >=', '.'.join(map(str, ver))) - else: - print('You need VTK Version', '.'.join(map(str, ver)), 'or greater.') - print() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/ColorMapToLUT.md b/data/examples/Utilities/ColorMapToLUT.md deleted file mode 100644 index 9903a27..0000000 --- a/data/examples/Utilities/ColorMapToLUT.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -Demonstrate a cone using the vtkDiscretizableColorTransferFunction to generate the colormap. - -These two Python functions can be used to generate C++ and Python functions from a JSON or XML colormap. They can then be copied into ColorMapToLUT.cxx, ColorMapToLUT.py or into your own code. - -- [ColorMapToLUT_XML](../ColorMapToLUT_XML/) -- [ColorMapToLUT_JSON](../ColorMapToLUT_JSON/) - -Feel free to use either of these programs to generate different colormaps until you find one you like. - -A good initial source for color maps is: [SciVisColor](https://sciviscolor.org/) -- this will provide you with plenty of XML examples. - -[ColorMapToLUT_JSON](../../../Python/Utilities/ColorMapToLUT_JSON/) will allow you to select colormaps by name from [ParaView Default Colormaps](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Views/ColorMaps.json). diff --git a/data/examples/Utilities/ColorMapToLUT.py b/data/examples/Utilities/ColorMapToLUT.py deleted file mode 100755 index 12f905e..0000000 --- a/data/examples/Utilities/ColorMapToLUT.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersSources import vtkConeSource, vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDiscretizableColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - ren_win = vtkRenderWindow() - ren_win.SetSize(640, 480) - ren_win.SetWindowName('ColorMapToLUT') - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) - - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - bounds = cone.GetOutput().GetBounds() - - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - - ctf = get_ctf() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(elevation_filter.GetOutputPort()) - mapper.SetLookupTable(ctf) - mapper.SetColorModeToMapScalars() - mapper.InterpolateScalarsBeforeMappingOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - ren_win.Render() - iren.Start() - - -def get_ctf(): - # name: Fast, creator: Francesca Samsel and Alan W. Scott - # interpolationspace: RGB, space: rgb - # file name: Fast.json - - ctf = vtkDiscretizableColorTransferFunction() - - ctf.SetColorSpaceToRGB() - ctf.SetScaleToLinear() - - ctf.SetNanColor(0.0, 0.0, 0.0) - - ctf.AddRGBPoint(0, 0.05639999999999999, 0.05639999999999999, 0.47) - ctf.AddRGBPoint(0.17159223942480895, 0.24300000000000013, 0.4603500000000004, 0.81) - ctf.AddRGBPoint(0.2984914818394138, 0.3568143826543521, 0.7450246485363142, 0.954367702893722) - ctf.AddRGBPoint(0.4321287371255907, 0.6882, 0.93, 0.9179099999999999) - ctf.AddRGBPoint(0.5, 0.8994959551205902, 0.944646394975174, 0.7686567142818399) - ctf.AddRGBPoint(0.5882260353170073, 0.957107977357604, 0.8338185108985666, 0.5089156299842102) - ctf.AddRGBPoint(0.7061412605695164, 0.9275207599610714, 0.6214389091739178, 0.31535705838676426) - ctf.AddRGBPoint(0.8476395308725272, 0.8, 0.3520000000000001, 0.15999999999999998) - ctf.AddRGBPoint(1, 0.59, 0.07670000000000013, 0.11947499999999994) - - ctf.SetNumberOfValues(9) - ctf.DiscretizeOff() - - return ctf - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/JSONColorMapToLUT.md b/data/examples/Utilities/JSONColorMapToLUT.md deleted file mode 100644 index 9695842..0000000 --- a/data/examples/Utilities/JSONColorMapToLUT.md +++ /dev/null @@ -1,23 +0,0 @@ -### Description - -Generate a VTK colormap from a ParaView JSON description of a colormap. - -This script will let you choose a colormap by name from [ParaView Default Colormaps](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Views/ColorMaps.json). - -A cone is rendered to demonstrate the resultant colormap. - - C++ and Python functions can also be generated which implement the colormap. You can copy/paste these directly into your code. Or they can replace the existing function in: - - - [ColorMapToLUT.py](../ColorMapToLUT) - - [ColorMapToLUT.cxx](../../../Cxx/Utilities/ColorMapToLUT) - -This program was inspired by this discussion: [Replacement default color map and background palette](https://discourse.paraview.org/t/replacement-default-color-map-and-background-palette/12712), the **Fast** colormap from this discussion is used as test data here. - -A good initial source for color maps is: [SciVisColor](https://sciviscolor.org/) -- this will provide you with plenty of XML examples. - -Further information: - -- [VTK Examples - Some ColorMap to LookupTable tools]() -- [How to export ParaView colormap into a format that could be read by matplotlib](https://discourse.paraview.org/t/how-to-export-paraview-colormap-into-a-format-that-could-be-read-by-matplotlib/2436) -- [How to export ParaView colormap into a format that could be read by matplotlib?](https://discourse.paraview.org/t/how-to-export-paraview-colormap-into-a-format-that-could-be-read-by-matplotlib/2394) -- [Color map advice and resources](https://discourse.paraview.org/t/color-map-advice-and-resources/6452/4) diff --git a/data/examples/Utilities/JSONColorMapToLUT.py b/data/examples/Utilities/JSONColorMapToLUT.py deleted file mode 100755 index 4501505..0000000 --- a/data/examples/Utilities/JSONColorMapToLUT.py +++ /dev/null @@ -1,541 +0,0 @@ -#!/usr/bin/env python3 - -import json -import sys -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersSources import vtkConeSource, vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingCore import ( - vtkDiscretizableColorTransferFunction -) - - -def get_program_parameters(argv): - import argparse - description = 'Take a JSON description of a colormap and convert it to a VTK colormap.' - epilogue = ''' - A color transfer function in C++ or Python can be optionally generated. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - - parser.add_argument('file_name', help='The path to the JSONL file e.g Fast.xml.') - parser.add_argument('-d', action='store_true', dest='discretize', help='Discretize the colormap.') - parser.add_argument('-n', dest='name', default=None, type=str, - help='Specify the name of the colormap,' - ' needed if there is more than one colormap in the JSON file.') - parser.add_argument('-s', dest='size', default=None, type=int, - help='Specify the size of the colormap.') - parser.add_argument('-g', dest='generate_function', default=None, - help='Generate code for the color transfer function,' - ' specify the desired language one of: Cxx, Python.') - - args = parser.parse_args() - return args.file_name, args.discretize, args.name, args.size, args.generate_function - - -def main(file_name, discretize, colormap_name, table_size, generate_function): - if file_name: - fn_path = Path(file_name) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - return - else: - print('Please enter a path to the JSON file.') - return - parameters = parse_json(fn_path) - if len(parameters) == 0: - print('No named colormaps found.') - return - if len(parameters) == 1: - colormap_name = list(parameters.keys())[0] - else: - names = list(parameters.keys()) - if len(parameters) > 1 and colormap_name is None: - print(f'A colormap name is required, choose one of:\n{layout(sorted(names), order="row")}') - return - if colormap_name not in names: - print(f'Unknown colormap name {colormap_name}, choose one of:\n{layout(sorted(names), order="row")}') - return - - if generate_function is not None: - generate_function = generate_function.lower() - available_languages = {k.lower(): k for k in ['Cxx', 'Python']} - available_languages.update({'cpp': 'Cxx', 'c++': 'Cxx', 'py': 'Python'}) - if generate_function not in available_languages: - print(f'The language: {generate_function} is not available.') - tmp = ', '.join(sorted([lang for lang in set(available_languages.values())])) - print(f'Choose one of these: {tmp}.') - return - else: - language = available_languages[generate_function] - else: - language = None - - ctf = make_ctf(parameters[colormap_name], discretize, table_size) - - # Generate code for Python or C++ if needed. - if language is not None and language in ['Cxx', 'Python']: - if language == 'Python': - generate_ctf_python(parameters[colormap_name], discretize, table_size) - else: - generate_ctf_cpp(parameters[colormap_name], discretize, table_size) - - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) - sphere.SetRadius(0.5) - sphere.Update() - - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - - # bounds = sphere.GetOutput().GetBounds() - bounds = cone.GetOutput().GetBounds() - - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(elevation_filter.GetOutputPort()) - mapper.SetLookupTable(ctf) - mapper.SetColorModeToMapScalars() - mapper.InterpolateScalarsBeforeMappingOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - - ren_win.SetSize(640, 480) - ren_win.SetWindowName('ColorMapToLUT_JSON') - - ren_win.Render() - iren.Start() - - -def parse_json(fn_path): - """ - Parse the exported ParaView JSON file of a colormap. - :param fn_path: The path to the JSON file. - :return: A dict of colormaps indexed by name. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - - def extract(d): - """ - Pull out the data we need. - - :param d: The parsed JSON data. - :return: The extracted data. - """ - data_values = list() - color_values = list() - opacity_values = list() - color_map_details = dict() - nan = None - above = None - below = None - for k, v in d.items(): - if 'Points' in k: - n = 4 - data_color = [v[i * n:(i + 1) * n] for i in range((len(v) + n - 1) // n)] - for dc in data_color: - if len(dc) == 4: - data_values.append(dc[0]) - color_values.append(tuple(dc[1:])) - if 'hsv' in k.lower(): - color_map_details['space'] = 'hsv' - else: - color_map_details['space'] = 'rgb' - - if k == 'ColorSpace': - color_map_details['interpolationspace'] = v - if k == 'Creator': - color_map_details['creator'] = v - if k == 'Name': - color_map_details['name'] = v - if k == 'NanColor': - nan = tuple(v[0:3]) - return {'color_map_details': color_map_details, 'data_values': data_values, - 'color_values': color_values, 'opacity_values': opacity_values, 'NaN': nan, 'Above': above, - 'Below': below} - - res = dict() - for jd in json_data: - if 'ColorSpace' in jd: - parameters = extract(jd) - parameters['path'] = fn_path.name - cm_name = parameters['color_map_details']['name'] - # Do some checks. - if cm_name is not None: - if len(parameters['data_values']) != len(parameters['color_values']): - sys.exit(f'{parameters["path"]}: The data values length must be the same as colors.') - if len(parameters['opacity_values']) > 0: - if len(parameters['opacity_values']) != len(parameters['color_values']): - sys.exit(f'{parameters["path"]}: The opacity values length must be the same as colors.') - res[cm_name] = parameters - return res - - -def layout(targets, columns=None, width=120, order='column'): - """ - Layout a sorted list of targets into columns. - - :param targets: A list of targets. - :param columns: The number of columns, if None, then the width is used. - :param width: Width of the page, used if the number of columns is zero or None. - :param order: Ordering either by row or column (default). - :return A list of lists of available targets. - """ - - order = order.lower() - if order not in ['row', 'column']: - print('The order must be either row or column, row is the default.') - return - - def fmt_v(v): - return f'{v:<{max_len}s}' - - max_len = max(map(len, targets)) - # Split into rows. - if columns: - number_of_columns = columns - else: - number_of_columns = width // max_len - step_size = divmod(len(targets), number_of_columns) - step = step_size[0] - if step_size[1] != 0: - step += 1 - if order == 'row': - rows = [targets[i:i + number_of_columns] for i in range(0, len(targets), number_of_columns)] - else: - rows = list() - for i in range(step): - row = list() - for j in range(number_of_columns): - idx = j * step + i - if idx < len(targets): - row.append(targets[idx]) - rows.append(row) - res = list() - for row in rows: - res.append(' '.join(map(fmt_v, row))) - return '\n'.join(res) - - -def make_ctf(parameters, discretize, table_size=None): - """ - Generate the discretizable color transfer function - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - - ctf = vtkDiscretizableColorTransferFunction() - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - ctf.SetColorSpaceToHSV() - elif interp_space == 'lab': - ctf.SetColorSpaceToLab() - elif interp_space == 'cielab': - ctf.SetColorSpaceToLab() - elif interp_space == 'ciede2000': - ctf.SetColorSpaceToLabCIEDE2000() - elif interp_space == 'diverging': - ctf.SetColorSpaceToDiverging() - elif interp_space == 'step': - ctf.SetColorSpaceToStep() - else: - ctf.SetColorSpaceToRGB() - else: - ctf.SetColorSpaceToRGB() - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - ctf.SetScaleToLog10() - else: - ctf.SetScaleToLinear() - else: - ctf.SetScaleToLinear() - - if parameters['NaN'] is not None: - ctf.SetNanColor(*parameters['NaN']) - - if parameters['Above'] is not None: - ctf.SetAboveRangeColor(*parameters['Above']) - ctf.UseAboveRangeColorOn() - - if parameters['Below'] is not None: - ctf.SetBelowRangeColor(*parameters['Below']) - ctf.UseBelowRangeColorOn() - - space = parameters['color_map_details']['space'].lower() - ctf_sz = len(parameters["data_values"]) - for i in range(0, ctf_sz): - idx = parameters['data_values'][i] - rgb = parameters['color_values'][i] - if space == 'hsv': - ctf.AddHSVPoint(idx, *rgb) - else: - ctf.AddRGBPoint(idx, *rgb) - - if table_size is not None: - ctf.SetNumberOfValues(max(table_size, ctf_sz)) - else: - ctf.SetNumberOfValues(ctf_sz) - - if discretize: - ctf.DiscretizeOn() - else: - ctf.DiscretizeOff() - - return ctf - - -def generate_ctf_python(parameters, discretize, table_size=None): - """ - Generate a function for the ctf. - - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - indent = ' ' * 4 - - comment = f'{indent}#' - if 'name' in parameters['color_map_details']: - comment += f' name: {parameters["color_map_details"]["name"]},' - if 'creator' in parameters['color_map_details']: - comment += f' creator: {parameters["color_map_details"]["creator"]}' - if 'interpolationspace' in parameters['color_map_details']: - comment += f'\n{indent}# interpolationspace: {parameters["color_map_details"]["interpolationspace"]},' - if 'interpolationtype' in parameters['color_map_details']: - comment += f' interpolationtype: {parameters["color_map_details"]["interpolationtype"]},' - if 'space' in parameters['color_map_details']: - comment += f' space: {parameters["color_map_details"]["space"]}' - comment += f'\n{indent}# file name: {parameters["path"]}\n' - - s = ['', f'def get_ctf():', comment, f'{indent}ctf = vtkDiscretizableColorTransferFunction()', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - s.append(f'{indent}ctf.SetColorSpaceToHSV()') - elif interp_space == 'lab': - s.append(f'{indent}ctf.SetColorSpaceToLab()') - elif interp_space == 'cielab': - s.append(f'{indent}ctf.SetColorSpaceToLab()') - elif interp_space == 'ciede2000': - s.append(f'{indent}ctf.SetColorSpaceToLabCIEDE2000()') - elif interp_space == 'diverging': - s.append(f'{indent}ctf.SetColorSpaceToDiverging()') - elif interp_space == 'step': - s.append(f'{indent}ctf.SetColorSpaceToStep()') - else: - s.append(f'{indent}ctf.SetColorSpaceToRGB()') - else: - s.append(f'{indent}ctf.SetColorSpaceToRGB()') - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - s.append(f'{indent}ctf.SetScaleToLog10()') - else: - s.append(f'{indent}ctf.SetScaleToLinear()') - else: - s.append(f'{indent}ctf.SetScaleToLinear()') - s.append('') - - if parameters['NaN'] is not None: - color = ', '.join(list(map(str, parameters['NaN']))) - s.append(f'{indent}ctf.SetNanColor({color})') - - if parameters['Above'] is not None: - color = ', '.join(list(map(str, parameters['Above']))) - s.append(f'{indent}ctf.SetAboveRangeColor({color})') - s.append(f'{indent}ctf.UseAboveRangeColorOn()') - - if parameters['Below'] is not None: - color = ', '.join(list(map(str, parameters['Below']))) - s.append(f'{indent}ctf.SetBelowRangeColor({color})') - s.append(f'{indent}ctf.UseBelowRangeColorOn()') - s.append('') - - space = parameters['color_map_details']['space'].lower() - ctf_sz = len(parameters["data_values"]) - for i in range(0, ctf_sz): - rgb = ', '.join(list(map(str, parameters['color_values'][i]))) - idx = parameters['data_values'][i] - if space == 'hsv': - s.append(f'{indent}ctf.AddHSVPoint({idx}, {rgb})') - else: - s.append(f'{indent}ctf.AddRGBPoint({idx}, {rgb})') - s.append('') - - if table_size is not None: - s.append(f'{indent}ctf.SetNumberOfValues({max(table_size, ctf_sz)})') - else: - s.append(f'{indent}ctf.SetNumberOfValues({ctf_sz})') - - if discretize: - s.append(f'{indent}ctf.DiscretizeOn()') - else: - s.append(f'{indent}ctf.DiscretizeOff()') - s.append('') - - s.append(f'{indent}return ctf') - s.append('') - - print('\n'.join(s)) - - -def generate_ctf_cpp(parameters, discretize, table_size=None): - """ - Generate a function for the ctf. - - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - indent = ' ' * 2 - - comment = f'{indent}//' - if 'name' in parameters['color_map_details']: - comment += f' name: {parameters["color_map_details"]["name"]},' - if 'creator' in parameters['color_map_details']: - comment += f' creator: {parameters["color_map_details"]["creator"]}' - if 'interpolationspace' in parameters['color_map_details']: - comment += f'\n{indent}// interpolationspace: {parameters["color_map_details"]["interpolationspace"]},' - if 'interpolationtype' in parameters['color_map_details']: - comment += f' interpolationtype: {parameters["color_map_details"]["interpolationtype"]},' - if 'space' in parameters['color_map_details']: - comment += f' space: {parameters["color_map_details"]["space"]}' - comment += f'\n{indent}// file name: {parameters["path"]}\n' - - s = ['', f'vtkNew GetCTF()', '{', comment, - f'{indent}vtkNew ctf;', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - s.append(f'{indent}ctf->SetColorSpaceToHSV();') - elif interp_space == 'lab': - s.append(f'{indent}ctf->SetColorSpaceToLab();') - elif interp_space == 'cielab': - s.append(f'{indent}ctf->SetColorSpaceToLab();') - elif interp_space == 'ciede2000': - s.append(f'{indent}ctf->SetColorSpaceToLabCIEDE2000();') - elif interp_space == 'diverging': - s.append(f'{indent}ctf->SetColorSpaceToDiverging();') - elif interp_space == 'step': - s.append(f'{indent}ctf->SetColorSpaceToStep();') - else: - s.append(f'{indent}ctf->SetColorSpaceToRGB();') - else: - s.append(f'{indent}ctf->SetColorSpaceToRGB();') - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - s.append(f'{indent}ctf->SetScaleToLog10();') - else: - s.append(f'{indent}ctf->SetScaleToLinear();') - else: - s.append(f'{indent}ctf->SetScaleToLinear();') - s.append('') - - if parameters['NaN'] is not None: - color = ', '.join(list(map(str, parameters['NaN']))) - s.append(f'{indent}ctf->SetNanColor({color});') - - if parameters['Above'] is not None: - color = ', '.join(list(map(str, parameters['Above']))) - s.append(f'{indent}ctf->SetAboveRangeColor({color});') - s.append(f'{indent}ctf->UseAboveRangeColorOn();') - - if parameters['Below'] is not None: - color = ', '.join(list(map(str, parameters['Below']))) - s.append(f'{indent}ctf->SetBelowRangeColor({color});') - s.append(f'{indent}ctf->UseBelowRangeColorOn();') - s.append('') - - space = parameters['color_map_details']['space'].lower() - ctf_sz = len(parameters["data_values"]) - for i in range(0, ctf_sz): - rgb = ', '.join(list(map(str, parameters['color_values'][i]))) - idx = parameters['data_values'][i] - if space == 'hsv': - s.append(f'{indent}ctf->AddHSVPoint({idx}, {rgb});') - else: - s.append(f'{indent}ctf->AddRGBPoint({idx}, {rgb});') - s.append('') - - if table_size is not None: - s.append(f'{indent}ctf->SetNumberOfValues({max(table_size, ctf_sz)});') - else: - s.append(f'{indent}ctf->SetNumberOfValues({ctf_sz});') - - if discretize: - s.append(f'{indent}ctf->DiscretizeOn();') - else: - s.append(f'{indent}ctf->DiscretizeOff();') - s.append('') - - s.append(f'{indent}return ctf;') - s.append('}') - s.append('') - - print('\n'.join(s)) - - -if __name__ == '__main__': - file, discretise, name, size, generate = get_program_parameters(sys.argv) - main(file, discretise, name, size, generate) diff --git a/data/examples/Utilities/LUTUtilities.md b/data/examples/Utilities/LUTUtilities.md deleted file mode 100644 index a5c9984..0000000 --- a/data/examples/Utilities/LUTUtilities.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -A class called LUTUtilities is demonstrated along with a test harness that shows you how to use the class. - -This class allows you to: - -* Print the contents of the lookup table -* Compare two lookup tables to see if they are the same. - -The test harness is a function called: TestLookupTables that tests pairs of lookup tables against each other. - -The program will not display any output if all tests are successful. diff --git a/data/examples/Utilities/LUTUtilities.py b/data/examples/Utilities/LUTUtilities.py deleted file mode 100755 index bd4cff2..0000000 --- a/data/examples/Utilities/LUTUtilities.py +++ /dev/null @@ -1,354 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import sys - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkColorSeries -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkVariant, - vtkVariantArray -) - - -class LUTUtilities(object): - """ - Utilities for displaying and comparing lookup tables. - """ - - def __init__(self): - pass - - def DisplayLUTAsString(self, lut): - """ - Display the contents of the lookup table. - :param: lut - the lookup table. - :return: a string containing the table data. - """ - str = '' - tv = lut.GetNumberOfTableValues() - dR = lut.GetTableRange() - if lut.GetIndexedLookup(): - av = lut.GetNumberOfAnnotatedValues() - str = "Categorical Lookup Table\n" + \ - "Number of annotated values: {:d}".format(av) + \ - " Number of table values: {:d}".format(tv) + \ - "\nTable Range: {:8.6f} to {:8.6f}\n".format(dR[0], dR[1]) - if av > 0: - for i in range(av): - rgba = [0.0, 0.0, 0.0, 0.0] - lut.GetAnnotationColor(lut.GetAnnotatedValue(i), rgba) - str += "{:>5}: ".format(lut.GetAnnotation(i)) - str += self.AssembleRGBAString(rgba) - else: - for i in range(tv): - rgba = [0.0, 0.0, 0.0, 0.0] - rgba = lut.GetTableValue(i) - str += "{:5d}: ".format(i) - str += self.AssembleRGBAString(rgba) - else: - str = "Ordinal Lookup Table\n" + \ - " Number of table values: {:d}".format(tv) + \ - "\nTable Range: {:8.6f} to {:8.6f}\n".format(dR[0], dR[1]) - indices = [(dR[1] - dR[0]) * - float(x) / tv + dR[0] for x in range(0, tv)] - for i, v in enumerate(indices): - rgb = [0.0, 0.0, 0.0] - lut.GetColor(v, rgb) - rgba = rgb + [lut.GetOpacity(v)] - str += "{:5.2f}: ".format(v) - str += self.AssembleRGBAString(rgba) - return str - - def AssembleRGBAString(self, rgba): - """ - Display the contents of the rgba as a series of strings: - decimal [r g b a], integer [r g b a] where r,g ,b a are - in the range 0..255 and 0xrrggba . - :param: The rgba string. - :return: A string in the above format. - """ - s = '[' + ', '.join(['{:0.6f}'.format(x) for x in rgba]) + ']' - ucrgb = [int(x * 255) for x in rgba] - t = '[' + ', '.join(['{:3d}'.format(x) for x in ucrgb]) + ']' - # u = '0x'+''.join(map(lambda x: '{:02X}'.format(x),ucrgb[:3])) - u = '0x' + ''.join(['{:02x}'.format(x) for x in ucrgb]) - res = '{:s} {:s} {:s}\n'.format(s, t, u) - return res - - def CompareLUTs(self, lut1, lut2): - """ - Compare two lookup tables. - :param: lut1 - the lookup table. - :param: lut2 - the lookup table. - :return: True if the tables are the same. - """ - res = [True, ''] - if lut1.GetIndexedLookup() != lut2.GetIndexedLookup(): - res[0] = False - res[1] = "One table is ordinal and the other is categorical." - return res - if lut1.GetIndexedLookup() and \ - lut1.GetNumberOfAnnotatedValues() != \ - lut2.GetNumberOfAnnotatedValues(): - res[0] = False - res[1] = "The number of annotated values do not match." - return res - if lut1.GetNumberOfTableValues() != lut2.GetNumberOfTableValues(): - res[0] = False - res[1] = "Table values do not match." - return res - dR1 = lut1.GetTableRange() - dR2 = lut2.GetTableRange() - if dR1[0] != dR2[0] and dR1[1] != dR2[1]: - res[0] = False - res[1] = "Table ranges do not match." - return res - if lut1.GetIndexedLookup(): - av = lut1.GetNumberOfAnnotatedValues() - if av > 0: - for i in range(av): - if lut1.GetAnnotation(i) != lut1.GetAnnotation(i): - res[0] = False - res[1] = "Annotations do not match." - return res - for i in range(av): - rgba1 = [0.0, 0.0, 0.0, 0.0] - lut1.GetAnnotationColor(lut1.GetAnnotatedValue(i), rgba1) - rgba2 = [0.0, 0.0, 0.0, 0.0] - lut2.GetAnnotationColor(lut2.GetAnnotatedValue(i), rgba2) - if not self.CompareRGBA(rgba1, rgba2): - res[0] = False - res[1] = "Colors do not match." - return res - else: - tv = lut1.GetNumberOfTableValues() - for i in range(tv): - rgba1 = lut1.GetTableValue(i) - rgba2 = lut2.GetTableValue(i) - if not self.CompareRGBA(rgba1, rgba2): - res[0] = False - res[1] = "Colors do not match." - return res - else: - tv = lut1.GetNumberOfTableValues() - indices = [(dR1[1] - dR1[0]) * - float(x) / tv + dR1[0] for x in range(0, tv)] - for i, v in enumerate(indices): - rgb1 = [0.0, 0.0, 0.0] - lut1.GetColor(v, rgb1) - rgba1 = rgb1 + [lut1.GetOpacity(v)] - rgb2 = [0.0, 0.0, 0.0] - lut2.GetColor(v, rgb2) - rgba2 = rgb2 + [lut2.GetOpacity(v)] - if not self.CompareRGBA(rgba1, rgba2): - res[0] = False - res[1] = "Colors do not match." - return res - - return res - - def CompareRGBA(self, rgba1, rgba2): - """ - Compare two rgba lists. - rgba can be a hexadecimal string, or a - list of rgb or rgba colors. - :param: rgba1 - the color. - :param: rgba2 - the color. - :return: True if the colors are the same. - """ - if len(rgba1) != len(rgba2): - return False - if isinstance(rgba1, str): - return rgba1 == rgba2 - if len(rgba1) == 3 or len(rgba1) == 4: - for i in range(0, len(rgba1)): - if rgba1[i] != rgba2[i]: - return False - return True - return False - - -def GetAllColorSchemes(): - """ - Get all the color scheme names. - :return: a map of the names keyed on their index. - """ - colorSchemes = dict() - colorSeries = vtkColorSeries() - for i in range(colorSeries.GetNumberOfColorSchemes()): - colorSeries.SetColorScheme(i) - colorSchemes[i] = colorSeries.GetColorSchemeName() - return colorSchemes - - -def AvailableColorSchemes(colorSchemes): - """ - The available color scheme indexes and names. - :param: colorSchemes - a map of the names keyed on their index. - :return: a string if the indexes and names. - """ - str = '' - for k, v in colorSchemes.items(): - str += '{:3d}\t{:s}\n'.format(k, v) - return str - - -def DisplayAvailableColorSchemes(): - """ - Display the available color schemes. - """ - line = "-----------------------------------------------------------------------------\n" - colorSchemes = GetAllColorSchemes() - print(line + AvailableColorSchemes(colorSchemes) + line) - - -def DisplayResults(reason, lut1, lut2): - """ - Display the lookup tables and reason for failure. - :param: reason - the reason. - :param: lut1 - the first lookup table. - :param: lut2 - the second lookup table. - """ - lutUtilities = LUTUtilities() - line = "-----------------------------------------------------------------------------\n" - print(line + reason + "\n") - print(lutUtilities.DisplayLUTAsString(lut1)) - print(lutUtilities.DisplayLUTAsString(lut2)) - print(line) - - -def TestTables(lut1, lut2, expected=True): - """ - Test pairs of lookup tables. - :param: lut1 - the first lookup table. - :param: lut2 - the second lookup table. - :param: expected - if False a fail is expected. - :return: True/False. - """ - lutUtilities = LUTUtilities() - comparison = lutUtilities.CompareLUTs(lut1, lut2) - if comparison[0] != expected: - DisplayResults(comparison[1], lut1, lut2) - if expected: - return comparison[0] - return not comparison[0] - - -def TestLookupTables(lutMode): - """ - Test various combinations of lookup tables. - :param: lutMode - if True the tables are ordinal, categorical otherwise. - :return: True if all tests passed. - """ - lut1 = vtkLookupTable() - lut2 = vtkLookupTable() - colorSeries = vtkColorSeries() - colorSeriesEnum = colorSeries.SPECTRUM - colorSeries.SetColorScheme(colorSeriesEnum) - - colorSeries.BuildLookupTable(lut1) - colorSeries.BuildLookupTable(lut2) - if lutMode: - lut1.IndexedLookupOff() - lut2.IndexedLookupOff() - lut1.SetNanColor(1, 0, 0, 1) - lut2.SetNanColor(1, 0, 0, 1) - if not lutMode: - # For the annotation just use a letter of the alphabet. - values1 = vtkVariantArray() - values2 = vtkVariantArray() - str = "abcdefghijklmnopqrstuvwxyz" - for i in range(lut1.GetNumberOfTableValues()): - values1.InsertNextValue(vtkVariant(str[i])) - for i in range(lut2.GetNumberOfTableValues()): - values2.InsertNextValue(vtkVariant(str[i])) - for i in range(values1.GetNumberOfTuples()): - lut1.SetAnnotation(i, values1.GetValue(i).ToString()) - for i in range(values2.GetNumberOfTuples()): - lut2.SetAnnotation(i, values2.GetValue(i).ToString()) - # Are they the same? - res = True - res &= TestTables(lut1, lut2) - - # Different size - lut2.SetNumberOfTableValues(5) - res &= TestTables(lut1, lut2, False) - lut2.SetNumberOfTableValues(lut1.GetNumberOfTableValues()) - res &= TestTables(lut1, lut2) - - if lutMode: - # Different range - lut2.SetTableRange(1, 2) - res &= TestTables(lut1, lut2, False) - tr = lut1.GetTableRange() - lut2.SetTableRange(tr) - res &= TestTables(lut1, lut2) - - # Different color - colorSeriesEnum = colorSeries.COOL - colorSeries.SetColorScheme(colorSeriesEnum) - lut3 = vtkLookupTable() - colorSeries.BuildLookupTable(lut3) - lut3.IndexedLookupOff() - res &= TestTables(lut1, lut3, False) - - # One indexed, the other ordinal. - lut1.IndexedLookupOn() - res &= TestTables(lut1, lut2, False) - - else: - # Different color - colorSeriesEnum = colorSeries.COOL - colorSeries.SetColorScheme(colorSeriesEnum) - lut3 = vtkLookupTable() - colorSeries.BuildLookupTable(lut3) - values = vtkVariantArray() - str = "abcdefghijklmnopqrstuvwxyz" - for i in range(lut3.GetNumberOfTableValues()): - values.InsertNextValue(vtkVariant(str[i])) - for i in range(values.GetNumberOfTuples()): - lut3.SetAnnotation(i, values.GetValue(i).ToString()) - colorSeries.BuildLookupTable(lut3) - res &= TestTables(lut1, lut3, False) - - # Different annotations. - lut2.ResetAnnotations() - for i in range(values.GetNumberOfTuples()): - if i % 3 == 0: - continue - lut2.SetAnnotation(i, values.GetValue(i).ToString()) - res &= TestTables(lut1, lut2, False) - - # No annotations - lut1.ResetAnnotations() - lut2.ResetAnnotations() - res &= TestTables(lut1, lut2) - - # One indexed, the other ordinal. - lut1.IndexedLookupOff() - res &= TestTables(lut1, lut2, False) - - return res - - -def main(): - # DisplayAvailableColorSchemes() - # Test ordinal LUTS. - res = TestLookupTables(True) - # Test categorical LUTs. - res &= TestLookupTables(False) - return res - - -if __name__ == '__main__': - res = main() - if res: - sys.exit(0) - else: - print('Ordinal or Categorical LookupTable tests failed.') - sys.exit(1) diff --git a/data/examples/Utilities/RescaleReverseLUT.md b/data/examples/Utilities/RescaleReverseLUT.md deleted file mode 100644 index a32d819..0000000 --- a/data/examples/Utilities/RescaleReverseLUT.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description - -This example shows how to adjust a colormap so that the colormap scalar range matches the scalar range on the object. This is done by adjusting the colormap so that the colormap scalar range matches the scalar range of the object by rescaling the control points and, optionally, reversing the order of the colors. - -Of course, if you are generating the scalars, it may be easier to just change the scalar range of your filter. However, this may not be possible in some cases. - -Here, we generate the original Color Transfer Function (CTF) corresponding to the seven colors that Isaac Newton labeled when dividing the spectrum of visible light in 1672. There are seven colors and the scalar range is [-1, 1]. - -The cylinder has a vtkElevationFilter applied to it with a scalar range of [0, 1]. - -There are four images: - -- Original - The cylinder is colored by only the top four colors from the CTF. This is because the elevation scalar range on the cylinder is [0, 1] and the CTF scalar range is [-1, 1]. So the coloring is green->violet. -- Reversed - We have reversed the colors from the original CTF and the lower four colors in the original CTF are now the top four colors used to color the cylinder. The coloring is now green->red. -- Rescaled - The original CTF is rescaled to the range [0, 1] to match the scalar range of the elevation filter. The coloring is red->violet. -- Rescaled and Reversed - The original CTF is rescaled to the range [0, 1] and the colors reversed. The coloring is violet->red. diff --git a/data/examples/Utilities/RescaleReverseLUT.py b/data/examples/Utilities/RescaleReverseLUT.py deleted file mode 100755 index cddd160..0000000 --- a/data/examples/Utilities/RescaleReverseLUT.py +++ /dev/null @@ -1,267 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersSources import vtkCylinderSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkDiscretizableColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - - -def main(): - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - ren_win = vtkRenderWindow() - ren_win.SetSize(640 * 2, 480 * 2) - ren_win.SetWindowName('RescaleReverseLUT') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ctf = list() - ctf.append(get_ctf(False)) - ctf.append(rescale_ctf(ctf[0], 0, 1, False)) - ctf.append(rescale_ctf(ctf[0], *ctf[0].GetRange(), True)) - ctf.append(rescale_ctf(ctf[0], 0, 1, True)) - - # Define viewport ranges. - xmins = [0.0, 0.0, 0.5, 0.5] - xmaxs = [0.5, 0.5, 1.0, 1.0] - ymins = [0.5, 0.0, 0.5, 0.0] - ymaxs = [1.0, 0.5, 1.0, 0.5] - - # Define titles. - titles = ['Original', 'Rescaled', 'Reversed', 'Rescaled and Reversed'] - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(36) - text_property.SetJustificationToCentered() - text_property.SetColor(colors.GetColor3d('LightGoldenrodYellow')) - - sources = list() - elevation_filters = list() - mappers = list() - actors = list() - scalar_bars = list() - renderers = list() - text_mappers = list() - text_actors = list() - - for i in range(0, 4): - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.SetResolution(6) - cylinder.Update() - bounds = cylinder.GetOutput().GetBounds() - sources.append(cylinder) - - elevation_filter = vtkElevationFilter() - elevation_filter.SetScalarRange(0, 1) - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - elevation_filter.SetInputConnection(sources[i].GetOutputPort()) - elevation_filters.append(elevation_filter) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(elevation_filters[i].GetOutputPort()) - mapper.SetLookupTable(ctf[i]) - mapper.SetColorModeToMapScalars() - mapper.InterpolateScalarsBeforeMappingOn() - mappers.append(mapper) - - actor = vtkActor() - actor.SetMapper(mappers[i]) - actors.append(actor) - - # Add a scalar bar. - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(ctf[i]) - scalar_bars.append(scalar_bar) - - text_mappers.append(vtkTextMapper()) - text_mappers[i].SetInput(titles[i]) - text_mappers[i].SetTextProperty(text_property) - - text_actors.append(vtkActor2D()) - text_actors[i].SetMapper(text_mappers[i]) - # Note: The position of an Actor2D is specified in display coordinates. - text_actors[i].SetPosition(300, 16) - - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - ren.AddActor(actors[i]) - ren.AddActor(scalar_bars[i]) - ren.AddActor(text_actors[i]) - ren.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) - renderers.append(ren) - - ren_win.AddRenderer(renderers[i]) - - ren_win.Render() - iren.Start() - - -def get_ctf(modern=False): - """ - Generate the color transfer function. - - The seven colors corresponding to the colors that Isaac Newton labelled - when dividing the spectrum of visible light in 1672 are used. - - The modern variant of these colors can be selected and used instead. - - See: [Rainbow](https://en.wikipedia.org/wiki/Rainbow) - - :param modern: Selects either Newton's original seven colors or modern version. - :return: The color transfer function. - """ - - # name: Rainbow, creator: Andrew Maclean - # interpolationspace: RGB, space: rgb - # file name: - - ctf = vtkDiscretizableColorTransferFunction() - - ctf.SetColorSpaceToRGB() - ctf.SetScaleToLinear() - ctf.SetNanColor(0.5, 0.5, 0.5) - ctf.SetBelowRangeColor(0.0, 0.0, 0.0) - ctf.UseBelowRangeColorOn() - ctf.SetAboveRangeColor(1.0, 1.0, 1.0) - ctf.UseAboveRangeColorOn() - - if modern: - ctf.AddRGBPoint(-1.0, 1.0, 0.0, 0.0) # Red - ctf.AddRGBPoint(-2.0 / 3.0, 1.0, 128.0 / 255.0, 0.0) # Orange #ff8000 - ctf.AddRGBPoint(-1.0 / 3.0, 1.0, 1.0, 0.0) # Yellow - ctf.AddRGBPoint(0.0, 0.0, 1.0, 0.0) # Green #00ff00 - ctf.AddRGBPoint(1.0 / 3.0, 0.0, 1.0, 1.0) # Cyan - ctf.AddRGBPoint(2.0 / 3.0, 0.0, 0.0, 1.0) # Blue - ctf.AddRGBPoint(1.0, 128.0 / 255.0, 0.0, 1.0) # Violet #8000ff - else: - ctf.AddRGBPoint(-1.0, 1.0, 0.0, 0.0) # Red - ctf.AddRGBPoint(-2.0 / 3.0, 1.0, 165.0 / 255.0, 0.0) # Orange #00a500 - ctf.AddRGBPoint(-1.0 / 3.0, 1.0, 1.0, 0.0) # Yellow - ctf.AddRGBPoint(0.0, 0.0, 125.0 / 255.0, 0.0) # Green #008000 - ctf.AddRGBPoint(1.0 / 3.0, 0.0, 153.0 / 255.0, 1.0) # Blue #0099ff - ctf.AddRGBPoint(2.0 / 3.0, 68.0 / 255.0, 0, 153.0 / 255.0) # Indigo #4400ff - ctf.AddRGBPoint(1.0, 153.0 / 255.0, 0.0, 1.0) # Violet #9900ff - - ctf.SetNumberOfValues(7) - ctf.DiscretizeOn() - - return ctf - - -def generate_new_ctf(old_ctf, new_x, new_rgb, reverse=False): - """ - Generate a new color transfer function from the old one, - adding in the new x and rgb values. - - :param old_ctf: The old color transfer function. - :param new_x: The new color x-values. - :param new_rgb: The color RGB values. - :param reverse: If true, reverse the colors. - :return: The new color transfer function. - """ - new_ctf = vtkDiscretizableColorTransferFunction() - new_ctf.SetScale(old_ctf.GetScale()) - new_ctf.SetColorSpace(old_ctf.GetColorSpace()) - new_ctf.SetNanColor(old_ctf.GetNanColor()) - if not reverse: - new_ctf.SetBelowRangeColor(old_ctf.GetBelowRangeColor()) - new_ctf.SetUseBelowRangeColor(old_ctf.GetUseBelowRangeColor()) - new_ctf.SetAboveRangeColor(old_ctf.GetAboveRangeColor()) - new_ctf.SetUseAboveRangeColor(old_ctf.GetUseAboveRangeColor()) - else: - new_ctf.SetBelowRangeColor(old_ctf.GetAboveRangeColor()) - new_ctf.SetUseBelowRangeColor(old_ctf.GetUseAboveRangeColor()) - new_ctf.SetAboveRangeColor(old_ctf.GetBelowRangeColor()) - new_ctf.SetUseAboveRangeColor(old_ctf.GetUseBelowRangeColor()) - new_ctf.SetNumberOfValues(len(new_x)) - new_ctf.SetDiscretize(old_ctf.GetDiscretize()) - if not reverse: - for i in range(0, len(new_x)): - new_ctf.AddRGBPoint(new_x[i], *new_rgb[i]) - else: - sz = len(new_x) - for i in range(0, sz): - j = sz - (i + 1) - new_ctf.AddRGBPoint(new_x[i], *new_rgb[j]) - new_ctf.Build() - return new_ctf - - -def rescale(values, new_min=0, new_max=1): - """ - Rescale the values. - - See: https://stats.stackexchange.com/questions/25894/changing-the-scale-of-a-variable-to-0-100 - - :param values: The values to be rescaled. - :param new_min: The new minimum value. - :param new_max: The new maximum value. - :return: The rescaled values. - """ - res = list() - old_min, old_max = min(values), max(values) - for v in values: - new_v = (new_max - new_min) / (old_max - old_min) * (v - old_min) + new_min - # new_v1 = (new_max - new_min) / (old_max - old_min) * (v - old_max) + new_max - res.append(new_v) - return res - - -def rescale_ctf(ctf, new_min=0, new_max=1, reverse=False): - """ - Rescale and, optionally, reverse the colors in the color transfer function. - - :param ctf: The color transfer function to rescale. - :param new_min: The new minimum value. - :param new_max: The new maximum value. - :param reverse: If true, reverse the colors. - :return: The rescaled color transfer function. - """ - if new_min > new_max: - r0 = new_max - r1 = new_min - else: - r0 = new_min - r1 = new_max - - xv = list() - rgbv = list() - nv = [0] * 6 - for i in range(0, ctf.GetNumberOfValues()): - ctf.GetNodeValue(i, nv) - x = nv[0] - rgb = nv[1:4] - xv.append(x) - rgbv.append(rgb) - xvr = rescale(xv, r0, r1) - - return generate_new_ctf(ctf, xvr, rgbv, reverse=reverse) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/ResetCameraOrientation.md b/data/examples/Utilities/ResetCameraOrientation.md deleted file mode 100644 index 8efb712..0000000 --- a/data/examples/Utilities/ResetCameraOrientation.md +++ /dev/null @@ -1,13 +0,0 @@ -### Description - -This example demonstrates how to reset the camera orientation. - -In this case, the original orientation is stored, a new orientation calculated, and, finally the original orientation is restored. The original, new and restored orientations of the cone are displayed in one second intervals. After this you can interact with the scene. - -To set the camera position, you can use: - -- `SetPosition`, `SetFocalPoint`, `SetViewUp`, `SetDistance`, `SetClippingRange` -- `Roll`, `Elevation`, `Azimuth` -- `SetRoll`, `Pitch`, `Yaw` - -If you haven't used `SetDistance` or `SetClippingRange` remember to `ren->ResetCamera();` or `ren.ResetCamera()`. diff --git a/data/examples/Utilities/ResetCameraOrientation.py b/data/examples/Utilities/ResetCameraOrientation.py deleted file mode 100755 index b2ac267..0000000 --- a/data/examples/Utilities/ResetCameraOrientation.py +++ /dev/null @@ -1,137 +0,0 @@ -from time import sleep - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkConeSource -# noinspection PyUnresolvedReferences -from vtkmodules.vtkInteractionStyle import ( - vtkInteractorStyleTrackballCamera) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def comma_separated_list(v, precision=6, width=10): - """ - Produce a comma-separated string of numbers from a list. - :param v: The list of floats. - :param precision: Number of decimal places. - :param width: The width. - :return: A comma-separated string. - """ - res = list() - for p in v: - res.append(f'{p:{width}.{precision}f}') - return ','.join(res) - - -def get_orientation(ren): - """ - Get the camera orientation. - :param ren: The renderer. - :return: The orientation parameters. - """ - p = dict() - camera = ren.GetActiveCamera() - p['position'] = camera.GetPosition() - p['focal point'] = camera.GetFocalPoint() - p['view up'] = camera.GetViewUp() - p['distance'] = camera.GetDistance() - p['clipping range'] = camera.GetClippingRange() - p['orientation'] = camera.GetOrientation() - return p - - -def set_orientation(ren, p): - """ - Set the orientation of the camera. - :param ren: The renderer. - :param p: The orientation parameters. - :return: - """ - camera = ren.GetActiveCamera() - camera.SetPosition(p['position']) - camera.SetFocalPoint(p['focal point']) - camera.SetViewUp(p['view up']) - camera.SetDistance(p['distance']) - camera.SetClippingRange(p['clipping range']) - - -def main(argv): - colors = vtkNamedColors() - - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - cone_mapper = vtkPolyDataMapper() - cone_mapper.SetInputConnection(cone.GetOutputPort()) - - cone_actor = vtkActor() - cone_actor.SetMapper(cone_mapper) - cone_actor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - ren = vtkRenderer() - ren.AddActor(cone_actor) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) - - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetSize(600, 600) - ren_win.SetWindowName('ResetCameraOrientation') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = ren.GetActiveCamera() - camera.SetRoll(15) - camera.Elevation(-15) - camera.Azimuth(30) - ren.ResetCamera() - - ren_win.Render() - original_orient = get_orientation(ren) - s = f'{"Original orientation:":23s}' - s += comma_separated_list(original_orient["orientation"]) - print(s) - sleep(1) - - camera.SetPosition(-3.568189, 5.220048, 2.352639) - camera.SetFocalPoint(-0.399044, -0.282865, 0.131438) - camera.SetViewUp(0.623411, 0.573532, -0.531431) - camera.SetDistance(6.727500) - camera.SetClippingRange(3.001430, 11.434082) - # No need to use ren.ResetCamera() as we have all the parameters. - ren_win.Render() - new_orient = get_orientation(ren) - s = f'{"New orientation:":23s}' - s += comma_separated_list(new_orient["orientation"]) - print(s) - sleep(1) - - print('Reloading the original orientation.') - set_orientation(ren, original_orient) - ren_win.Render() - check = get_orientation(ren) - s = f'{"Final orientation:":23s}' - s += comma_separated_list(check["orientation"]) - print(s) - sleep(1) - - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Utilities/SaveSceneToFieldData.md b/data/examples/Utilities/SaveSceneToFieldData.md deleted file mode 100644 index 3efcfbb..0000000 --- a/data/examples/Utilities/SaveSceneToFieldData.md +++ /dev/null @@ -1,13 +0,0 @@ -### Description -This example saves a vtkCamera's parameters in the vtkFieldData of a vkDataSet. - -To see how the scene is saved and restored, - -1. Interact with the scene. Press the **e key** to exit the first iteractor. The current state of the scene's vtkCamera will be saved in the vtkDataSet's vtkFieldData. - -2. Interact with the scene again. Press the **e key** to exit the second interactor. The scene will be restored to the previous state. - -3. Press the **e key** to exit the example. - -!!! info - This example uses [snippets](../../Snippets). diff --git a/data/examples/Utilities/SaveSceneToFieldData.py b/data/examples/Utilities/SaveSceneToFieldData.py deleted file mode 100755 index 07df05d..0000000 --- a/data/examples/Utilities/SaveSceneToFieldData.py +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkStringArray -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - pd_fn = get_program_parameters() - - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('SaveSceneToFieldData') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - # Interact to change camera. - renderWindow.Render() - renderWindowInteractor.Start() - - # After the interaction is done, save the scene. - SaveSceneToFieldData(polyData, actor, renderer.GetActiveCamera()) - renderWindow.Render() - renderWindowInteractor.Start() - - # After interaction , restore the scene. - RestoreSceneFromFieldData(polyData, actor, renderer.GetActiveCamera()) - renderWindow.Render() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Saving a scene to field data.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('data_file', help='A polydata file e.g. Armadillo.ply.') - args = parser.parse_args() - return args.data_file - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def SaveSceneToFieldData(data, actor, camera): - # Actor - # Position, orientation, origin, scale, usrmatrix, usertransform - # Camera - # FocalPoint, Position, ViewUp, ViewAngle, ClippingRange - - fp_format = '{0:.6f}' - res = dict() - res['Camera:FocalPoint'] = ', '.join(fp_format.format(n) for n in camera.GetFocalPoint()) - res['Camera:Position'] = ', '.join(fp_format.format(n) for n in camera.GetPosition()) - res['Camera:ViewUp'] = ', '.join(fp_format.format(n) for n in camera.GetViewUp()) - res['Camera:ViewAngle'] = fp_format.format(camera.GetViewAngle()) - res['Camera:ClippingRange'] = ', '.join(fp_format.format(n) for n in camera.GetClippingRange()) - buffer = '' - for k, v in res.items(): - buffer += k + ' ' + v + '\n' - cameraArray = vtkStringArray() - cameraArray.SetNumberOfValues(1) - cameraArray.SetValue(0, buffer) - cameraArray.SetName('Camera') - data.GetFieldData().AddArray(cameraArray) - - -def RestoreSceneFromFieldData(data, actor, camera): - import re - - # Some regular expressions. - - reCP = re.compile(r'^Camera:Position') - reCFP = re.compile(r'^Camera:FocalPoint') - reCVU = re.compile(r'^Camera:ViewUp') - reCVA = re.compile(r'^Camera:ViewAngle') - reCCR = re.compile(r'^Camera:ClippingRange') - keys = [reCP, reCFP, reCVU, reCVA, reCCR] - - # float_number = re.compile(r'[^0-9.\-]*([0-9e.\-]*[^,])[^0-9.\-]*([0-9e.\-]*[^,])[^0-9.\-]*([0-9e.\-]*[^,])') - # float_scalar = re.compile(r'[^0-9.\-]*([0-9.\-e]*[^,])') - - buffer = data.GetFieldData().GetAbstractArray('Camera').GetValue(0).split('\n') - res = dict() - for line in buffer: - if not line.strip(): - continue - line = line.strip().replace(',', '').split() - for i in keys: - m = re.match(i, line[0]) - if m: - k = m.group(0) - if m: - # Convert the rest of the line to floats. - v = list(map(lambda x: float(x), line[1:])) - if len(v) == 1: - res[k] = v[0] - else: - res[k] = v - for k, v in res.items(): - if re.match(reCP, k): - camera.SetPosition(v) - elif re.match(reCFP, k): - camera.SetFocalPoint(v) - elif re.match(reCVU, k): - camera.SetViewUp(v) - elif re.match(reCVA, k): - camera.SetViewAngle(v) - elif re.match(reCCR, k): - camera.SetClippingRange(v) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/SaveSceneToFile.md b/data/examples/Utilities/SaveSceneToFile.md deleted file mode 100644 index 1b260a7..0000000 --- a/data/examples/Utilities/SaveSceneToFile.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example saves a vtkCamera's parameters in a file. - -To see how the scene is saved and restored, - -1. Interact with the scene. Press the **e key** to exit the first iteractor. The current state of the scene's vtkCamera will be saved in the file. -2. Interact with the scene again. Press the **e key** to exit the second interactor. The saved file is read and the scene will be restored to the previous state. -3. Press the **e key** to exit the example. - -!!! info - This example uses [snippets](../../Snippets). diff --git a/data/examples/Utilities/SaveSceneToFile.py b/data/examples/Utilities/SaveSceneToFile.py deleted file mode 100755 index 6eb4d80..0000000 --- a/data/examples/Utilities/SaveSceneToFile.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - pd_fn, scene_fn = get_program_parameters() - - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('SaveSceneToFile') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - - # Interact to change camera. - renderWindow.Render() - renderWindowInteractor.Start() - - # After the interaction is done, save the scene. - SaveSceneToFile(scene_fn, actor, renderer.GetActiveCamera()) - renderWindow.Render() - renderWindowInteractor.Start() - - # After interaction , restore the scene. - RestoreSceneFromFile(scene_fn, actor, renderer.GetActiveCamera()) - renderWindow.Render() - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Saving a scene to a file.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('data_file', help='A polydata file e.g. Armadillo.ply.') - parser.add_argument('scene_file', help='The file to save the scene to.') - args = parser.parse_args() - return args.data_file, args.scene_file - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == '.ply': - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -def SaveSceneToFile(file_name, actor, camera): - # Actor - # Position, orientation, origin, scale, usrmatrix, usertransform - # Camera - # FocalPoint, Position, ViewUp, ViewAngle, ClippingRange - - fp_format = '{0:.6f}' - res = dict() - res['Camera:FocalPoint'] = ', '.join(fp_format.format(n) for n in camera.GetFocalPoint()) - res['Camera:Position'] = ', '.join(fp_format.format(n) for n in camera.GetPosition()) - res['Camera:ViewUp'] = ', '.join(fp_format.format(n) for n in camera.GetViewUp()) - res['Camera:ViewAngle'] = fp_format.format(camera.GetViewAngle()) - res['Camera:ClippingRange'] = ', '.join(fp_format.format(n) for n in camera.GetClippingRange()) - with open(file_name, 'w') as f: - for k, v in res.items(): - f.write(k + ' ' + v + '\n') - - -def RestoreSceneFromFile(file_name, actor, camera): - import re - - # Some regular expressions. - - reCP = re.compile(r'^Camera:Position') - reCFP = re.compile(r'^Camera:FocalPoint') - reCVU = re.compile(r'^Camera:ViewUp') - reCVA = re.compile(r'^Camera:ViewAngle') - reCCR = re.compile(r'^Camera:ClippingRange') - keys = [reCP, reCFP, reCVU, reCVA, reCCR] - - # float_number = re.compile(r'[^0-9.\-]*([0-9e.\-]*[^,])[^0-9.\-]*([0-9e.\-]*[^,])[^0-9.\-]*([0-9e.\-]*[^,])') - # float_scalar = re.compile(r'[^0-9.\-]*([0-9.\-e]*[^,])') - - res = dict() - with open(file_name, 'r') as f: - for cnt, line in enumerate(f): - if not line.strip(): - continue - line = line.strip().replace(',', '').split() - for i in keys: - m = re.match(i, line[0]) - if m: - k = m.group(0) - if m: - # Convert the rest of the line to floats. - v = list(map(lambda x: float(x), line[1:])) - if len(v) == 1: - res[k] = v[0] - else: - res[k] = v - for k, v in res.items(): - if re.match(reCP, k): - camera.SetPosition(v) - elif re.match(reCFP, k): - camera.SetFocalPoint(v) - elif re.match(reCVU, k): - camera.SetViewUp(v) - elif re.match(reCVA, k): - camera.SetViewAngle(v) - elif re.match(reCCR, k): - camera.SetClippingRange(v) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/Screenshot.py b/data/examples/Utilities/Screenshot.py deleted file mode 100755 index 8fd046e..0000000 --- a/data/examples/Utilities/Screenshot.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOImage import vtkPNGWriter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkWindowToImageFilter -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('Screenshot') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create source - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(5.0) - source.SetPhiResolution(30) - source.SetThetaResolution(30) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # actor - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('IndianRed')) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.SetMapper(mapper) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('MistyRose')) - - renWin.Render() - - # screenshot code: - w2if = vtkWindowToImageFilter() - w2if.SetInput(renWin) - w2if.SetInputBufferTypeToRGB() - w2if.ReadFrontBufferOff() - w2if.Update() - - writer = vtkPNGWriter() - writer.SetFileName('TestScreenshot.png') - writer.SetInputConnection(w2if.GetOutputPort()) - writer.Write() - - # enable user interface interactor - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/SelectExamples.md b/data/examples/Utilities/SelectExamples.md deleted file mode 100644 index 3d863d2..0000000 --- a/data/examples/Utilities/SelectExamples.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -This script allows you to obtain a list of examples corresponding to a particular VTK Class and a given language. - -In order to do this, a JSON file listing the vtk examples by VTK class is obtained from the gh-pages branch of the vtk-examples GitHub site. When this script runs, it checks for the existence of this JSON file in your temporary folder, downloading it, if it doesn't exist. If it already exists, then it is updated if the file is more than ten minutes old. - -When you run this script by specifying the VTK Class and Language (one of: `CSharp`, `Cxx`, `Java`, `Python`, `PythonicAPI`), a list of links to the respective examples containing that class is returned. By default five or fewer examples are returned. If there are more than five examples for a class then five examples are randomly selected. You can override the maximum number of examples (e.g. `-n20`) or select all examples `-a`. - -!!! note - Options are also provided to force an overwrite of the downloaded the JSON file (`-o`) or to change the URL to the JSON file (`-j`) diff --git a/data/examples/Utilities/SelectExamples.py b/data/examples/Utilities/SelectExamples.py deleted file mode 100755 index d525d44..0000000 --- a/data/examples/Utilities/SelectExamples.py +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env python3 - -import json -import os -import random -import tempfile -from datetime import datetime -from operator import itemgetter -from pathlib import Path -from urllib.error import HTTPError -from urllib.request import urlretrieve - - -def get_program_parameters(): - import argparse - description = 'Get examples that use a particular VTK class for a given language.' - epilogue = ''' -The JSON file needed by this script is obtained from the gh-pages branch - of the vtk-examples GitHub site. -It is stored in your tempfile directory. -If you change the URL to the JSON file, remember that there is a ten minute -wait before you can overwrite the last downloaded file. To force the download -specify -o on the command line. - -Here is the URL for an alternative site for testing: -"https://raw.githubusercontent.com/ajpmaclean/web-test/gh-pages/src/Coverage/vtk_vtk-examples_xref.json" - -''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('vtk_class', help='The desired VTK class.') - parser.add_argument('language', help='The desired language, one of: CSharp, Cxx, Java, Python.') - parser.add_argument('-a', '--all_values', action="store_true", - help='All examples (Warning: Can be a very long list).') - parser.add_argument('-n', '--number', type=int, default=5, help='The maximum number of examples.') - parser.add_argument('-m', '--md', action='store_true', - help='Display links in markdown inline format e.g. [label](URL).') - parser.add_argument('-j', '--json_xref_url', - default='https://raw.githubusercontent.com/Kitware/vtk-examples/gh-pages/src/Coverage/vtk_vtk-examples_xref.json', - help='The URL for the JSON cross-reference file.') - parser.add_argument('-o', '--overwrite', action="store_true", - help='Force an initial download of the JSON cross-reference file.') - - args = parser.parse_args() - return args.vtk_class, args.language, args.all_values, args.md, args.number, args.json_xref_url, args.overwrite - - -def download_file(dl_path, dl_url, overwrite=False): - """ - Use the URL to get a file. - - :param dl_path: The path to download the file to. - :param dl_url: The URL of the file. - :param overwrite: If true, do a download even if the file exists. - :return: The path to the file as a pathlib Path. - """ - file_name = dl_url.split('/')[-1] - - # Create necessary subdirectories in the dl_path - # (if they don't exist). - Path(dl_path).mkdir(parents=True, exist_ok=True) - # Download if it doesn't exist in the directory overriding if overwrite is True. - path = Path(dl_path, file_name) - if not path.is_file() or overwrite: - try: - urlretrieve(dl_url, path) - except HTTPError as e: - raise RuntimeError(f'Failed to download {dl_url}. {e.reason}') - return path - - -def get_examples(d, vtk_class, lang, all_values=False, number=5, md_fmt=False): - """ - For the VTK Class and language return the - total number of examples and a list of examples. - - :param d: The dictionary. - :param vtk_class: The VTK Class e.g. vtkActor. - :param lang: The language, e.g. Cxx. - :param all_values: True if all examples are needed. - :param number: The number of values. - :param md_fmt: Use Markdown format with label and URL defined together. - :return: Total number of examples and a list of examples. - """ - try: - kv = d[vtk_class][lang].items() - except KeyError: - return None, None - if len(kv) > number: - if all_values: - samples = list(kv) - else: - samples = random.sample(list(kv), number) - else: - samples = kv - if md_fmt: - links = [f'[{s.rsplit("/", 1)[1]}]({s})' for s in sorted(map(itemgetter(1), samples))] - else: - links = sorted(map(itemgetter(1), samples)) - return len(links), links - - -def get_crossref_dict(ref_dir, xref_url, overwrite=False): - """ - Download and return the json cross-reference file. - - This function ensures that the dictionary is recent. - - :param ref_dir: The directory where the file will be downloaded. - :param xref_url: The URL for the JSON cross-reference file. - :param overwrite: If true, do a download even if the file exists. - :return: The dictionary cross-referencing vtk classes to examples. - """ - path = download_file(ref_dir, xref_url, overwrite=overwrite) - if not path.is_file(): - print(f'The path: {str(path)} does not exist.') - return None - dt = datetime.today().timestamp() - os.path.getmtime(path) - # Force a new download if the time difference is > 10 minutes. - if dt > 600: - path = download_file(ref_dir, xref_url, overwrite=True) - with open(path) as json_file: - return json.load(json_file) - - -def main(): - vtk_class, language, all_values, md, number, xref_url, overwrite = get_program_parameters() - language = language.lower() - available_languages = {k.lower(): k for k in ['CSharp', 'Cxx', 'Java', 'Python', 'PythonicAPI']} - available_languages.update({'cpp': 'Cxx', 'c++': 'Cxx', 'c#': 'CSharp'}) - if language not in available_languages: - print(f'The language: {language} is not available.') - tmp = ', '.join(sorted([lang for lang in set(available_languages.values())])) - print(f'Choose one of these: {tmp}.') - return - else: - language = available_languages[language] - xref_dict = get_crossref_dict(tempfile.gettempdir(), xref_url, overwrite) - if xref_dict is None: - print('The dictionary cross-referencing vtk classes to examples was not downloaded.') - return - - total_number, examples = get_examples(xref_dict, vtk_class, language, all_values=all_values, number=number, - md_fmt=md) - if examples: - if total_number <= number or all_values: - print(f'VTK Class: {vtk_class}, language: {language}\n' - f'Number of example(s): {total_number}.') - else: - print(f'VTK Class: {vtk_class}, language: {language}\n' - f'Number of example(s): {total_number} with {number} random sample(s) shown.') - print('\n'.join(examples)) - else: - print(f'No examples for the VTK Class: {vtk_class} and language: {language}') - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/ShareCamera.py b/data/examples/Utilities/ShareCamera.py deleted file mode 100755 index e3a8136..0000000 --- a/data/examples/Utilities/ShareCamera.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkCylinderSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # We store background colors in a vector. Then we extract the red, green and - # blue components later when coloring the reneder background. - rendererColors = list() - colorSeries = vtkColorSeries() - colorSeries.SetColorSchemeByName('Brewer Qualitative Pastel2') - rendererColors.append(colorSeries.GetColor(0)) - rendererColors.append(colorSeries.GetColor(1)) - rendererColors.append(colorSeries.GetColor(2)) - rendererColors.append(colorSeries.GetColor(3)) - - renderWindow = vtkRenderWindow() - - renderWindowInteractor = vtkRenderWindowInteractor() - - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Define viewport ranges - xmins = [0, 0.5, 0, 0.5] - xmaxs = [0.5, 1, 0.5, 1] - ymins = [0, 0, 0.5, 0.5] - ymaxs = [0.5, 0.5, 1, 1] - - # Using the superclass for the sources - sources = list() - - for i in range(0, 4): - if i == 0: - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.Update() - sources.append(sphereSource) - elif i == 1: - # Create a cone - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.Update() - sources.append(coneSource) - elif i == 2: - # Create a cube - cubeSource = vtkCubeSource() - cubeSource.SetCenter(0.0, 0.0, 0.0) - cubeSource.Update() - sources.append(cubeSource) - else: - # Create a cylinder - cylinderSource = vtkCylinderSource() - cylinderSource.SetCenter(0.0, 0.0, 0.0) - cylinderSource.Update() - sources.append(cylinderSource) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sources[i].GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - renderer = vtkRenderer() - renderer.AddActor(actor) - r = rendererColors[i].GetRed() / 255.0 - g = rendererColors[i].GetGreen() / 255.0 - b = rendererColors[i].GetBlue() / 255.0 - renderer.SetBackground(r, g, b) - - renderWindow.AddRenderer(renderer) - - if i == 0: - camera = renderer.GetActiveCamera() - camera.Azimuth(30) - camera.Elevation(30) - else: - renderer.SetActiveCamera(camera) - - renderer.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) - - renderer.ResetCamera() - - renderWindow.Render() - renderWindow.SetWindowName('ShareCamera') - - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/VTKImportsForPython.md b/data/examples/Utilities/VTKImportsForPython.md deleted file mode 100644 index 9d8b859..0000000 --- a/data/examples/Utilities/VTKImportsForPython.md +++ /dev/null @@ -1,25 +0,0 @@ -### Description - -Use this to generate a series of import statements for your Python code. - -The imports are generated using the VTK modules, along with the VTK classes and constants in your Python source file(s). -For older versions of VTK, `modules.json` is required, this is found in your VTK build directory. - -When this script is run against your code, a series of `from ... import` statements are generated, based on the classes you have used. The result will be output to the console, or, alternatively to a text file with extension `.txt`. The first line is the program name and subsequent lines are the import statements. - -At the end of the list there is a series of commented out statements consisting of imports that you may need to enable. Only enable the ones you really need and include the statement `# noinspection PyUnresolvedReferences` for PyCharm users, as this will prevent the statement from being removed. - -e.g The most common ones will be: - -``` Python - # noinspection PyUnresolvedReferences - import ?vtkmodules?.?vtkInteractionStyle? - # noinspection PyUnresolvedReferences - import ?vtkmodules?.?vtkRenderingOpenGL2? -``` - -Make sure that any of these statements are placed after the last `from ... import ...` statement. Also remove any unused ones. - -As an example, if you have used `import vtk`, you can replace it with with these statements. This means that only the relevant VTK modules are loaded when the Python program runs. - -Of course after adding these statements you may need to edit your code e.g. changing `x = vtk.?vtkSomeClass?()` to `x = ?vtkSomeClass?()`. diff --git a/data/examples/Utilities/VTKImportsForPython.py b/data/examples/Utilities/VTKImportsForPython.py deleted file mode 100755 index fd1ede1..0000000 --- a/data/examples/Utilities/VTKImportsForPython.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/env python - -import collections -import importlib -import json -import re -from pathlib import Path - -from vtkmodules.vtkCommonCore import vtkVersion - - -def get_program_parameters(argv): - import argparse - description = 'Generate import statements for the VTK classes in your Python code.' - epilogue = ''' -The output will contain program name(s) followed by the import statements. -You can specify a folder for the Python sources or paths to several sources. - -Note: If there are spaces in the paths, enclose the path in quotes. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('-j', '--json', - help='The path to the VTK JSON file (modules.json).') - parser.add_argument('sources', nargs='+', help='The path to a folder of Python files or to a Python file.') - parser.add_argument('-f', '--file', help='The file name to write the output too.') - args = parser.parse_args() - return args.json, args.sources, args.file - - -class Patterns: - vtk_patterns = [ - # Class pattern. - re.compile(r'(vtk[a-zA-Z0-9]+)\('), - # Constants pattern. - re.compile(r'(VTK_[A-Z_]+)'), - # Special patterns ... - re.compile(r'(mutable)\('), - # Handle vtkClass.yyy - re.compile(r'(vtk[a-zA-Z0-9]+)\.'), - # Handle class xx(vtkClass): - re.compile(r'\( ?(vtk[a-zA-Z0-9]+) ?\)'), - ] - skip_patterns = [ - # Empty lines - re.compile(r'^ *$'), - # import ... - re.compile(r'^ *import'), - # from ... import ... - re.compile(r'^ *from[ \S]+import'), - # Any vtk class on its own - re.compile(r'^ *vtk[a-zA-Z0-9]+,*$'), - # Single closing bracket - re.compile(r'^ *\)+$'), - ] - - -def get_available_modules(jpath): - """ - From the parsed JSON data file make a list of the VTK modules. - - :param jpath: The JSON file path. - :return: VTK Classes and modules. - """ - with open(jpath) as data_file: - json_data = json.load(data_file) - - res = list() - for k in json_data['modules'].keys(): - m = k.split('::') - if len(m) > 1: - res.append(f'vtk{m[1]}') - return sorted(res) - - -def get_classes_constants(paths): - """ - Extract the vtk class names and constants from the path. - - :param paths: The path(s) to the Python file(s). - :return: The file name, the VTK classes and any VTK constants. - """ - - res = collections.defaultdict(set) - for path in paths: - content = path.read_text().split('\n') - for line in content: - for pattern in Patterns.skip_patterns: - m = pattern.search(line) - if m: - continue - for pattern in Patterns.vtk_patterns: - m = pattern.search(line) - if m: - for g in m.groups(): - res[str(path)].add(g) - return res - - -def format_imports(imports): - name_keys = sorted(imports.keys()) - res = list() - for name in name_keys: - res.append(f'\n{name}') - module_keys = sorted(imports[name].keys()) - for module in module_keys: - classes = sorted(list(imports[name][module])) - if len(classes) == 1: - res.append(f'from vtkmodules.{module} import {classes[0]}') - else: - c_list = list() - for c in classes: - c_list.append(f' {c}') - s = '(\n' - s += ',\n'.join(c_list) - s += '\n )' - res.append(f'from vtkmodules.{module} import {s}') - additional_modules = ['vtkInteractionStyle', 'vtkRenderingFreeType', - 'vtkRenderingContextOpenGL2', 'vtkRenderingOpenGL2', 'vtkRenderingVolumeOpenGL2', - 'vtkRenderingUI'] - comments = [ - '', - '# You may need to uncomment one or more of the following imports.', - '# If vtkRenderWindow is used and you want to use OpenGL,', - '# you also need the vtkRenderingOpenGL2 module.', - '# If vtkRenderWindowInteractor is used, uncomment vtkInteractionStyle', - '# If text rendering is used, uncomment vtkRenderingFreeType.', - '#', - '# If using PyCharm, preface each one you select with this line:', - '# noinspection PyUnresolvedReferences', - '#', - ] - res += comments - for module in sorted(additional_modules): - res.append(f'# import vtkmodules.{module}') - res.append('') - return res - - -def main(json_path, src_paths, ofn): - use_json = not vtk_version_ok(9, 0, 20210918) - if use_json: - if not json_path: - print('modules.json (from your VTK build directory) is needed.') - return - jpath = Path(json_path) - if jpath.is_dir(): - jpath = jpath / 'modules.json' - if not jpath.is_file(): - print(f'Non existent JSON file: {jpath}') - else: - jpath = None - - paths = list() - for fn in src_paths: - path = Path(fn) - if path.is_file() and path.suffix == '.py': - paths.append(path) - elif path.is_dir(): - path_list = list(Path(fn).rglob('*.py')) - program_path = Path(__file__) - for path in path_list: - if path.resolve() != program_path.resolve(): - paths.append(path) - else: - print(f'Non existent path: {path}') - - classes_constants = get_classes_constants(paths) - if not classes_constants: - print('No classes or constants were present.') - return - - if use_json: - vtk_modules = get_available_modules(jpath) - else: - vtklib = importlib.__import__('vtkmodules') - vtk_modules = sorted(vtklib.__all__) - - name_to_module = dict() - for module in vtk_modules: - try: - module_dict = importlib.import_module('vtkmodules.' + module).__dict__ - for name in module_dict: - name_to_module[name] = module - except ModuleNotFoundError: - # print(module, ' not found.') - continue - - imports = collections.defaultdict(lambda: collections.defaultdict(set)) - for name, classes_constants in classes_constants.items(): - for vtk_class in classes_constants: - if vtk_class in name_to_module: - module = name_to_module[vtk_class] - imports[name][module].add(vtk_class) - - res = format_imports(imports) - if ofn: - path = Path(ofn) - if path.suffix == '': - path = Path(ofn).with_suffix('.txt') - path.write_text('\n'.join(res)) - else: - print('\n'.join(res)) - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -if __name__ == '__main__': - import sys - - json_path, src_paths, ofn = get_program_parameters(sys.argv) - main(json_path, src_paths, ofn) diff --git a/data/examples/Utilities/VTKModulesForCxx.md b/data/examples/Utilities/VTKModulesForCxx.md deleted file mode 100644 index 16f2a7c..0000000 --- a/data/examples/Utilities/VTKModulesForCxx.md +++ /dev/null @@ -1,11 +0,0 @@ -### Description - -Use this to generate a `find_package(VTK COMPONENTS ...)` command for CMake. - -It requires `modules.json`, found in your VTK build folder, and your source files. After running, it will generate a `find_package(VTK COMPONENTS ...)` command listing all the vtk modules needed by the C++ source and header files in your code. - -Paths for more than one source path can be specified. If there are spaces in the paths, enclose the path in quotes. - -If it is unable to find modules for your headers then a list of these, along with the files they are in, is produced so you can manually add the corresponding modules or rebuild VTK to include the missing modules. - -You will need to manually add any third-party modules (if used) to the find_package command. diff --git a/data/examples/Utilities/VTKModulesForCxx.py b/data/examples/Utilities/VTKModulesForCxx.py deleted file mode 100755 index 7e313ef..0000000 --- a/data/examples/Utilities/VTKModulesForCxx.py +++ /dev/null @@ -1,226 +0,0 @@ -#!/usr/bin/env python - -import collections -import json -import os -import re -from pathlib import Path - - -def get_program_parameters(argv): - import argparse - description = 'Generate a find_package(VTK COMPONENTS ...) command for CMake.' - epilogue = ''' -Uses modules.json and your source files to generate a - find_package(VTK COMPONENTS ...) command listing all the vtk modules - needed by the C++ source and header files in your code. - -Paths for more than one source path can be specified. - -Note than if there are spaces in the paths, enclose the path in quotes. - -If it is unable to find modules for your headers then - a list of these, along with the files they are in, is produced - so you can manually add the corresponding modules or rebuild VTK - to include the missing modules. - -You will need to manually add any third-party modules - (if used) to the find_package command. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('json', default=['modules.json'], help='The path to the VTK JSON file (modules.json).') - parser.add_argument('sources', nargs='+', help='The path to the source files.') - parser.add_argument('-f', '--file', help='The file name to write the output too.') - args = parser.parse_args() - return args.json, args.sources, args.file - - -class Patterns: - header_pattern = re.compile(r'^#include *[<\"](\S+)[>\"]') - vtk_include_pattern = re.compile(r'^(vtk\S+)') - vtk_qt_include_pattern = re.compile(r'^(QVTK\S+)') - - -def get_headers_modules(json_data): - """ - From the parsed JSON data file make a dictionary whose key is the - header filename and value is the module. - :param json_data: The parsed JSON file modules.json. - :return: - """ - - # The headers should be unique to a module, however we will not assume this. - res = collections.defaultdict(set) - for k, v in json_data['modules'].items(): - if 'headers' in v: - for k1 in v['headers']: - res[k1].add(k) - return res - - -def get_vtk_components(jpath, paths): - """ - Get the VTK components - :param jpath: The path to the JSON file. - :param paths: The C++ file paths. - :return: - """ - - with open(jpath) as data_file: - json_data = json.load(data_file) - vtk_headers_modules = get_headers_modules(json_data) - - modules = set() - inc_no_mod = set() - inc_no_mod_headers = collections.defaultdict(set) - mod_implements = collections.defaultdict(set) - headers = collections.defaultdict(set) - - for path in paths: - if path.is_file(): - content = path.read_text().split('\n') - for line in content: - m = Patterns.header_pattern.match(line.strip()) - if m: - # We have a header name, split it from its path (if the path exists). - header_parts = os.path.split(m.group(1)) - m = Patterns.vtk_include_pattern.match(header_parts[1]) - if m: - headers[m.group(1)].add(path) - continue - m = Patterns.vtk_qt_include_pattern.match(header_parts[1]) - if m: - headers[m.group(1)].add(path) - for incl in headers: - if incl in vtk_headers_modules: - m = vtk_headers_modules[incl] - for v in m: - modules.add(v) - else: - inc_no_mod.add(incl) - inc_no_mod_headers[incl] = headers[incl] - - if headers: - for m in modules: - if not json_data['modules'][m]['implementable']: - continue - for i in json_data['modules']: - if i in modules: - continue - if m in json_data['modules'][i]['implements']: - # Suggest module i since it implements m - mod_implements[i].add(m) - - return modules, mod_implements, inc_no_mod, inc_no_mod_headers - - -def disp_components(modules, module_implements): - """ - For the found modules display them in a form that the user can - copy/paste into their CMakeLists.txt file. - :param modules: The modules. - :param module_implements: Modules implementing other modules. - :return: - """ - res = ['find_package(VTK\n COMPONENTS'] - for m in sorted(modules): - res.append(' {:s}'.format(m.split('::')[1])) - if module_implements: - keys = sorted(module_implements) - max_width = len(max(keys, key=len).split('::')[1]) - comments = [ - ' #', - ' # These modules are suggested since they implement an existing module.', - ' # You may need to uncomment one or more of these.', - ' # If vtkRenderWindow is used and you want to use OpenGL,', - ' # you also need the RenderingOpenGL2 module.', - ' # If vtkRenderWindowInteractor is used,', - ' # uncomment RenderingUI and possibly InteractionStyle.', - ' # If text rendering is used, uncomment RenderingFreeType', - ' #' - ] - res.extend(comments) - for key in keys: - res.append( - f' # {key.split("::")[1]:<{max_width}} # implements {", ".join(sorted(module_implements[key]))}') - res.append(')\n') - - return res - - -def disp_missing_components(inc_no_mod, inc_no_mod_headers): - """ - Display the headers along with the missing VTK modules. - - :param inc_no_mod: Missing modules. - :param inc_no_mod_headers: Headers with missing modules. - :return: - """ - if inc_no_mod: - res = ['' - '*' * 64, - 'You will need to manually add the modules that', - ' use these headers to the find_package command.', - 'These could be external modules not in the modules.json file.', - 'Or you may need to rebuild VTK to include the missing modules.', - '', - 'Here are the vtk headers and corresponding files:'] - sinmd = sorted(inc_no_mod) - for i in sinmd: - sh = sorted(list(inc_no_mod_headers[i])) - res.append(f'in {i}:') - for j in sh: - res.append(f' {j}') - res.append('*' * 64) - - return res - else: - return None - - -def main(json_path, src_paths, ofn): - jpath = Path(json_path) - if jpath.is_dir(): - jpath = jpath / 'modules.json' - if not jpath.is_file(): - print(f'Non existent JSON file: {jpath}') - return - - paths = list() - valid_ext = ['.h', '.hxx', '.cxx', '.cpp', '.txx'] - path_list = list() - for fn in src_paths: - path = Path(fn) - if path.is_file() and path.suffix in valid_ext: - paths.append(path) - elif path.is_dir(): - for e in valid_ext: - path_list += list(Path(fn).rglob(f'*{e}')) - program_path = Path(__file__) - for path in path_list: - if path.resolve() != program_path.resolve(): - paths.append(path) - else: - print(f'Non existent path: {path}') - - modules, mod_implements, inc_no_mod, inc_no_mod_headers = get_vtk_components(jpath, paths) - - res = '\n'.join(disp_components(modules, mod_implements)) - if inc_no_mod: - res += '\n'.join(disp_missing_components(inc_no_mod, inc_no_mod_headers)) - - if ofn: - path = Path(ofn) - if path.suffix == '': - path = Path(ofn).with_suffix('.txt') - path.write_text(res) - else: - print(res) - - -if __name__ == '__main__': - import sys - - json_paths, src_paths, ofn = get_program_parameters(sys.argv) - main(json_paths, src_paths, ofn) diff --git a/data/examples/Utilities/VTKWithNumpy.py b/data/examples/Utilities/VTKWithNumpy.py deleted file mode 100755 index 5db95be..0000000 --- a/data/examples/Utilities/VTKWithNumpy.py +++ /dev/null @@ -1,118 +0,0 @@ -# An example from scipy cookbook demonstrating the use of numpy arrays in vtk - -import numpy as np -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPiecewiseFunction -from vtkmodules.vtkIOImage import vtkImageImport -from vtkmodules.vtkRenderingCore import ( - vtkColorTransferFunction, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkVolume, - vtkVolumeProperty -) -from vtkmodules.vtkRenderingVolume import vtkFixedPointVolumeRayCastMapper -# noinspection PyUnresolvedReferences -from vtkmodules.vtkRenderingVolumeOpenGL2 import vtkOpenGLRayCastImageDisplayHelper - - -def main(): - colors = vtkNamedColors() - - # We begin by creating the data we want to render. - # For this tutorial, we create a 3D-image containing three overlaping cubes. - # This data can of course easily be replaced by data from a medical CT-scan or anything else three dimensional. - # The only limit is that the data must be reduced to unsigned 8 bit or 16 bit integers. - data_matrix = np.zeros([75, 75, 75], dtype=np.uint8) - data_matrix[0:35, 0:35, 0:35] = 50 - data_matrix[25:55, 25:55, 25:55] = 100 - data_matrix[45:74, 45:74, 45:74] = 150 - - # For VTK to be able to use the data, it must be stored as a VTK-image. - # This can be done by the vtkImageImport-class which - # imports raw data and stores it. - dataImporter = vtkImageImport() - # The previously created array is converted to a string of chars and imported. - data_string = data_matrix.tobytes() - dataImporter.CopyImportVoidPointer(data_string, len(data_string)) - # The type of the newly imported data is set to unsigned char (uint8) - dataImporter.SetDataScalarTypeToUnsignedChar() - # Because the data that is imported only contains an intensity value - # (it isnt RGB-coded or someting similar), the importer must be told this is the case. - dataImporter.SetNumberOfScalarComponents(1) - # The following two functions describe how the data is stored and the dimensions of the array it is stored in. - # For this simple case, all axes are of length 75 and begins with the first element. - # For other data, this is probably not the case. - # I have to admit however, that I honestly dont know the difference between SetDataExtent() - # and SetWholeExtent() although VTK complains if not both are used. - dataImporter.SetDataExtent(0, 74, 0, 74, 0, 74) - dataImporter.SetWholeExtent(0, 74, 0, 74, 0, 74) - - # The following class is used to store transparency-values for later retrival. - # In our case, we want the value 0 to be - # completely opaque whereas the three different cubes are given different transparency-values to show how it works. - alphaChannelFunc = vtkPiecewiseFunction() - alphaChannelFunc.AddPoint(0, 0.0) - alphaChannelFunc.AddPoint(50, 0.05) - alphaChannelFunc.AddPoint(100, 0.1) - alphaChannelFunc.AddPoint(150, 0.2) - - # This class stores color data and can create color tables from a few color points. - # For this demo, we want the three cubes to be of the colors red green and blue. - colorFunc = vtkColorTransferFunction() - colorFunc.AddRGBPoint(50, 1.0, 0.0, 0.0) - colorFunc.AddRGBPoint(100, 0.0, 1.0, 0.0) - colorFunc.AddRGBPoint(150, 0.0, 0.0, 1.0) - - # The previous two classes stored properties. - # Because we want to apply these properties to the volume we want to render, - # we have to store them in a class that stores volume properties. - volumeProperty = vtkVolumeProperty() - volumeProperty.SetColor(colorFunc) - volumeProperty.SetScalarOpacity(alphaChannelFunc) - - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(dataImporter.GetOutputPort()) - - # The class vtkVolume is used to pair the previously declared volume as well as the properties - # to be used when rendering that volume. - volume = vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - - # With almost everything else ready, its time to initialize the renderer and window, as well as - # creating a method for exiting the application - renderer = vtkRenderer() - renderWin = vtkRenderWindow() - renderWin.AddRenderer(renderer) - renderInteractor = vtkRenderWindowInteractor() - renderInteractor.SetRenderWindow(renderWin) - - # We add the volume to the renderer ... - renderer.AddVolume(volume) - renderer.SetBackground(colors.GetColor3d("MistyRose")) - - # ... and set window size. - renderWin.SetSize(400, 400) - renderWin.SetWindowName('VTKWithNumpy') - - # A simple function to be called when the user decides to quit the application. - def exitCheck(obj, event): - if obj.GetEventPending() != 0: - obj.SetAbortRender(1) - - # Tell the application to use the function as an exit check. - renderWin.AddObserver("AbortCheckEvent", exitCheck) - - renderInteractor.Initialize() - # Because nothing will be rendered without any input, we order the first render manually - # before control is handed over to the main-loop. - renderWin.Render() - renderInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Utilities/Variant.py b/data/examples/Utilities/Variant.py deleted file mode 100755 index da391de..0000000 --- a/data/examples/Utilities/Variant.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -# These are templated functions in C++. -from vtkmodules.all import ( - vtkVariantCast, - vtkVariantCreate, - vtkVariantExtract, - vtkVariantEqual, - vtkVariantLessThan, - vtkVariantStrictEquality, - vtkVariantStrictWeakOrder -) -from vtkmodules.util.vtkVariant import vtkVariantStrictWeakOrderKey -from vtkmodules.vtkCommonCore import ( - VTK_UNSIGNED_SHORT, - vtkStringArray, - vtkVariant, - vtkVariantArray, -) - -# Unicode string for demonstration (etre with circumflex i.e. être) -if sys.hexversion >= 0x03000000: - unicodeEtre = '\xeatre' # unicode in Python 3 -else: - unicodeEtre = unicode('\xeatre', 'latin1') # noqa: F821 - -# -# Basic vtkVariant usage -# - -# Default constructor -v = vtkVariant() -print(f"Invalid variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Copy constructor -v = vtkVariant(vtkVariant("variant")) -print(f"Copied variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Conversion constructors -v = vtkVariant(1) -print(f"Integer variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(1.0) -print(f"Float variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant("hello") -print(f"String variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(unicodeEtre) -print(f"Unicode variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(vtkStringArray()) -print(f"Object variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Explicit type constructor -v1 = vtkVariant(1, VTK_UNSIGNED_SHORT) -v2 = vtkVariant(2, v1.GetType()) -print(f"UShort variant: {repr(v1)}, '{v1.GetTypeAsString()}'") - -# Type checking -if v2.IsUnsignedShort(): - print("v2 is UnsignedShort") -else: - print("v2 is not UnsignedShort, it is", v2.GetTypeAsString()) - -# Explicit value extraction -s = v2.ToString() -print("String value: %s, %s" % (s, type(s))) -i = v2.ToInt() -print("Int value: %i, %s" % (i, type(i))) - -# Automatic argument conversion -a = vtkVariantArray() -a.InsertNextValue(vtkVariant()) -a.InsertNextValue(1) -a.InsertNextValue(2.0) -a.InsertNextValue("hello") -a.InsertNextValue(unicodeEtre) -a.InsertNextValue(vtkVariantArray()) -print("Variant array:") -for i in range(a.GetNumberOfValues()): - v = a.GetValue(i) - print(f"{i}: {repr(v)}, '{v.GetTypeAsString()}'") - -# Comparison -if v2 == vtkVariant(2): - print("v2 is equal to 2") -if v2 > vtkVariant(1): - print("v2 is greater than 1") -if v2 < vtkVariant(3): - print("v2 is less than 3") -if v2 == vtkVariant("2"): - print("v2 is equal to '2'") - -# Use as a dict key (hashed as a string) -d = {vtkVariant(1): 0, vtkVariant('1'): 1, vtkVariant(): 3} -print("Index is %i" % d[vtkVariant(1.0)]) - -# -# Extra functionality from vtk.util.vtkVariant -# -# These are templated functions in C++, but in Python -# they take the template arg as a string instead, -# e.g. vtkVariantCreate(1) becomes -# vtkVariantCreate(1, 'unsigned int') - -# Creation -v = vtkVariantCreate(1, 'unsigned int') - -# Value extraction -v = vtkVariant(6.0) -f = vtkVariantExtract(v) - -# Value extraction with type specified -f = vtkVariantExtract(v, 'double') - -# Casting a variant -v = vtkVariant("10") -i = vtkVariantCast(v, 'int') -print(f"Valid cast result: {repr(i)}") - -# A failed cast returns None -v = vtkVariant("hello") -i = vtkVariantCast(v, 'int') -print(f"Invalid cast result: {repr(i)}") - -# -# Comparisons and sorting: See VTK docs for more info -# - -# Special function vtk.vtkVariantStrictWeakOrder: -# Compare variants by type first, and then by value. For Python 2, the -# return values are -1, 0, 1 like the Python 2 "cmp()" method. This is -# in contrast with the Python 3 and C++ versions of this function, which -# check if (v1 < v2) and return True or False. -v1 = vtkVariant(10) -v2 = vtkVariant("10") -r = vtkVariantStrictWeakOrder(v1, v2) -print("Strict weak order (10, '10') ->", r) - -# Sorting by strict weak order, using a key function: -unsorted = [1, 2.5, vtkVariant(), "0", unicodeEtre] -l = [vtkVariant(x) for x in unsorted] -l.sort(key=vtkVariantStrictWeakOrderKey) -print("Sort by weak order ->", l) - -# Check two variants for strict equality of type and value. -b = vtkVariantStrictEquality(v1, v2) -print(f"Strict equality (10, '10') -> {b}") - -# Two special-purpose methods. -# First is identical to (v1 < v2) -b = vtkVariantLessThan(v1, v2) -# Second is identical to (v1 == v2) -b = vtkVariantEqual(v1, v2) diff --git a/data/examples/Utilities/XMLColorMapToLUT.md b/data/examples/Utilities/XMLColorMapToLUT.md deleted file mode 100644 index b155604..0000000 --- a/data/examples/Utilities/XMLColorMapToLUT.md +++ /dev/null @@ -1,28 +0,0 @@ -### Description - -Generate a VTK colormap from an XML description of a colormap. - -A cone is rendered to demonstrate the resultant colormap. - - C++ and Python functions can also be generated which implement the colormap. You can copy/paste these directly into your code. Or they can replace the existing function in: - - - [ColorMapToLUT.py](../ColorMapToLUT) - - [ColorMapToLUT.cxx](../../../Cxx/Utilities/ColorMapToLUT) - -This program was inspired by this discussion: [Replacement default color map and background palette](https://discourse.paraview.org/t/replacement-default-color-map-and-background-palette/12712), and, the **Fast** colormap from this discussion is used as test data here. - -A good initial source for color maps is: [SciVisColor](https://sciviscolor.org/) -- this will provide you with plenty of XML examples. - -**Note:** - -- The XML parser is [lxml](https://lxml.de/) -- Currently, the parsing only works for XML colormaps with no Section key. - -Further information: - -- [VTK Examples - Some ColorMap to LookupTable tools](https://discourse.vtk.org/t/vtk-examples-some-colormap-to-lookuptable-tools/12237) -- [Color maps and transfer functions](https://docs.paraview.org/en/latest/ReferenceManual/colorMapping.html) -- [How to export ParaView colormap into a format that could be read by matplotlib](https://discourse.paraview.org/t/how-to-export-paraview-colormap-into-a-format-that-could-be-read-by-matplotlib/2436) -- [How to export ParaView colormap into a format that could be read by matplotlib?](https://discourse.paraview.org/t/how-to-export-paraview-colormap-into-a-format-that-could-be-read-by-matplotlib/2394) -- [Color map advice and resources](https://discourse.paraview.org/t/color-map-advice-and-resources/6452/4) -- [ParaView Default Colormaps](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Views/ColorMaps.json) will provide you with lots of colormaps. diff --git a/data/examples/Utilities/XMLColorMapToLUT.py b/data/examples/Utilities/XMLColorMapToLUT.py deleted file mode 100755 index 0442760..0000000 --- a/data/examples/Utilities/XMLColorMapToLUT.py +++ /dev/null @@ -1,490 +0,0 @@ -#!/usr/bin/env python3 - -import sys -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from lxml import etree -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersSources import vtkConeSource, vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingCore import ( - vtkDiscretizableColorTransferFunction, -) - - -def get_program_parameters(argv): - import argparse - description = 'Take an XML description of a colormap and convert it to a VTK colormap.' - epilogue = ''' - A color transfer function in C++ or Python can be optionally generated. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - - parser.add_argument('file_name', help='The path to the XML file e.g Fast.xml.') - parser.add_argument('-d', action='store_true', dest='discretize', help='Discretize the colormap.') - parser.add_argument('-s', dest='size', default=None, type=int, - help='Specify the size of the colormap.') - parser.add_argument('-g', dest='generate_function', default=None, - help='Generate code for the color transfer function,' - ' specify the desired language one of: Cxx, Python.') - - args = parser.parse_args() - return args.file_name, args.discretize, args.size, args.generate_function - - -def main(file_name, discretize, table_size, generate_function): - if file_name: - fn_path = Path(file_name) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".xml") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - return - else: - print('Please enter a path to the XML file.') - return - parameters = parse_xml(fn_path) - - if generate_function is not None: - generate_function = generate_function.lower() - available_languages = {k.lower(): k for k in ['Cxx', 'Python']} - available_languages.update({'cpp': 'Cxx', 'c++': 'Cxx', 'py': 'Python'}) - if generate_function not in available_languages: - print(f'The language: {generate_function} is not available.') - tmp = ', '.join(sorted([lang for lang in set(available_languages.values())])) - print(f'Choose one of these: {tmp}.') - return - else: - language = available_languages[generate_function] - else: - language = None - - # There is just one entry in the parameters dict. - colormap_name = list(parameters.keys())[0] - ctf = make_ctf(parameters[colormap_name], discretize, table_size) - - if language is not None and language in ['Cxx', 'Python']: - if language == 'Python': - generate_ctf_python(parameters[colormap_name], discretize, table_size) - else: - generate_ctf_cpp(parameters[colormap_name], discretize, table_size) - - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) - - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - - # bounds = sphere.GetOutput().GetBounds() - bounds = cone.GetOutput().GetBounds() - - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(elevation_filter.GetOutputPort()) - mapper.SetLookupTable(ctf) - mapper.SetColorModeToMapScalars() - mapper.InterpolateScalarsBeforeMappingOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - - ren_win.SetSize(640, 480) - ren_win.SetWindowName('ColorMapToLUT_XML') - - ren_win.Render() - iren.Start() - - -def parse_xml(fn_path): - """ - Parse the XML file of a colormap. - - Check out: https://sciviscolor.org/colormaps/ for some good XML files. - :param fn_path: The path to the XML file. - :return: The parameters for the color map. - """ - with open(fn_path) as data_file: - xml_doc = etree.parse(data_file) - - def extract(d): - """ - Pull out the data we need. - - :param d: The parsed XML data. - :return: The extracted data. - """ - color_map_details = dict() - data_values = list() - color_values = list() - opacity_values = list() - nan = None - above = None - below = None - if d is not None: - color_map_details = dict(d.attrib) - if 'space' in color_map_details: - # Some XML files use space instead of interpolation space. - if color_map_details['space'].lower() not in ['rgb', 'hsv']: - color_map_details['interpolationspace'] = color_map_details['space'] - # Assume RGB - color_map_details['space'] = 'RGB' - for pt in d.findall('.//Point'): - # "o" is opacity it (along with "cms" and "isMoT") are ignored. - # "x" is the scalar value associated with the color (specified by "r", "g", and "b"). - data_values.append(pt.attrib['x']) - color_values.append((pt.attrib['r'], pt.attrib['g'], pt.attrib['b'])) - if pt.attrib['o']: - opacity_values.append(pt.attrib['o']) - val = d.find('.//NaN') - if val is not None: - nan = (val.attrib['r'], val.attrib['g'], val.attrib['b']) - val = d.find('.//Above') - if val is not None: - above = (val.attrib['r'], val.attrib['g'], val.attrib['b']) - val = d.find('.//Below') - if val is not None: - below = (val.attrib['r'], val.attrib['g'], val.attrib['b']) - return {'color_map_details': color_map_details, 'data_values': data_values, - 'color_values': color_values, 'opacity_values': opacity_values, 'NaN': nan, 'Above': above, - 'Below': below} - - s = xml_doc.getroot().find('ColorMap') - if s is None: - sys.exit('The attribute "ColorMap" is not found.') - res = dict() - parameters = extract(s) - parameters['path'] = fn_path.name - cm_name = parameters['color_map_details']['name'] - # Do some checks. - if cm_name is not None: - if len(parameters['data_values']) != len(parameters['color_values']): - sys.exit(f'{parameters["path"]}: The data values length must be the same as colors.') - if len(parameters['opacity_values']) > 0: - if len(parameters['opacity_values']) != len(parameters['color_values']): - sys.exit(f'{parameters["path"]}: The opacity values length must be the same as colors.') - res[cm_name] = parameters - return res - - -def make_ctf(parameters, discretize, table_size=None): - """ - Generate the discretizable color transfer function - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - - ctf = vtkDiscretizableColorTransferFunction() - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - ctf.SetColorSpaceToHSV() - elif interp_space == 'lab': - ctf.SetColorSpaceToLab() - elif interp_space == 'cielab': - ctf.SetColorSpaceToLab() - elif interp_space == 'ciede2000': - ctf.SetColorSpaceToLabCIEDE2000() - elif interp_space == 'diverging': - ctf.SetColorSpaceToDiverging() - elif interp_space == 'step': - ctf.SetColorSpaceToStep() - else: - ctf.SetColorSpaceToRGB() - else: - ctf.SetColorSpaceToRGB() - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - ctf.SetScaleToLog10() - else: - ctf.SetScaleToLinear() - else: - ctf.SetScaleToLinear() - - if parameters['NaN'] is not None: - color = list(map(float, parameters['NaN'])) - ctf.SetNanColor(*color) - - if parameters['Above'] is not None: - color = list(map(float, parameters['Above'])) - ctf.SetAboveRangeColor(*color) - ctf.UseAboveRangeColorOn() - - if parameters['Below'] is not None: - color = list(map(float, parameters['Below'])) - ctf.SetBelowRangeColor(*color) - ctf.UseBelowRangeColorOn() - - space = parameters['color_map_details'].get('space', None) - if space: - space = space.lower() - for i in range(0, len(parameters['data_values'])): - color = list(map(float, parameters['color_values'][i])) - idx = float(parameters['data_values'][i]) - if space == 'hsv': - ctf.AddHSVPoint(idx, *color) - else: - ctf.AddRGBPoint(idx, *color) - - if table_size is not None: - ctf.SetNumberOfValues(table_size) - else: - ctf.SetNumberOfValues(len(parameters["data_values"])) - - if discretize: - ctf.DiscretizeOn() - else: - ctf.DiscretizeOff() - - return ctf - - -def generate_ctf_python(parameters, discretize, table_size=None): - """ - Generate a function for the ctf. - - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - indent = ' ' * 4 - - comment = f'{indent}#' - if 'name' in parameters['color_map_details']: - comment += f' name: {parameters["color_map_details"]["name"]},' - if 'creator' in parameters['color_map_details']: - comment += f' creator: {parameters["color_map_details"]["creator"]}' - if 'interpolationspace' in parameters['color_map_details']: - comment += f'\n{indent}# interpolationspace: {parameters["color_map_details"]["interpolationspace"]},' - if 'interpolationtype' in parameters['color_map_details']: - comment += f' interpolationtype: {parameters["color_map_details"]["interpolationtype"]},' - if 'space' in parameters['color_map_details']: - comment += f' space: {parameters["color_map_details"]["space"]}' - comment += f'\n{indent}# file name: {parameters["path"]}\n' - - s = ['', f'def get_ctf():', comment, f'{indent}ctf = vtkDiscretizableColorTransferFunction()', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - s.append(f'{indent}ctf.SetColorSpaceToHSV()') - elif interp_space == 'lab': - s.append(f'{indent}ctf.SetColorSpaceToLab()') - elif interp_space == 'cielab': - s.append(f'{indent}ctf.SetColorSpaceToLab()') - elif interp_space == 'ciede2000': - s.append(f'{indent}ctf.SetColorSpaceToLabCIEDE2000()') - elif interp_space == 'diverging': - s.append(f'{indent}ctf.SetColorSpaceToDiverging()') - elif interp_space == 'step': - s.append(f'{indent}ctf.SetColorSpaceToStep()') - else: - s.append(f'{indent}ctf.SetColorSpaceToRGB()') - else: - s.append(f'{indent}ctf.SetColorSpaceToRGB()') - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - s.append(f'{indent}ctf.SetScaleToLog10()') - else: - s.append(f'{indent}ctf.SetScaleToLinear()') - else: - s.append(f'{indent}ctf.SetScaleToLinear()') - s.append('') - - if parameters['NaN'] is not None: - color = ', '.join(parameters['NaN']) - s.append(f'{indent}ctf.SetNanColor({color})') - - if parameters['Above'] is not None: - color = ', '.join(parameters['Above']) - s.append(f'{indent}ctf.SetAboveRangeColor({color})') - s.append(f'{indent}ctf.UseAboveRangeColorOn()') - - if parameters['Below'] is not None: - color = ', '.join(parameters['Below']) - s.append(f'{indent}ctf.SetBelowRangeColor({color})') - s.append(f'{indent}ctf.UseBelowRangeColorOn()') - s.append('') - - space = parameters['color_map_details'].get('space', None) - if space: - space = space.lower() - for i in range(0, len(parameters['data_values'])): - color = ', '.join(parameters['color_values'][i]) - idx = parameters['data_values'][i] - if space == 'hsv': - s.append(f'{indent}ctf.AddHSVPoint({idx}, {color})') - else: - s.append(f'{indent}ctf.AddRGBPoint({idx}, {color})') - s.append('') - - if table_size is not None: - s.append(f'{indent}ctf.SetNumberOfValues({table_size})') - else: - s.append(f'{indent}ctf.SetNumberOfValues({len(parameters["data_values"])})') - - if discretize: - s.append(f'{indent}ctf.DiscretizeOn()') - else: - s.append(f'{indent}ctf.DiscretizeOff()') - s.append('') - - s.append(f'{indent}return ctf') - s.append('') - - print('\n'.join(s)) - - -def generate_ctf_cpp(parameters, discretize, table_size=None): - """ - Generate a function for the ctf. - - :param parameters: The parameters. - :param discretize: True if the values are to be mapped after discretization. - :param table_size: The table size. - :return: The discretizable color transfer function. - """ - indent = ' ' * 2 - - comment = f'{indent}//' - if 'name' in parameters['color_map_details']: - comment += f' name: {parameters["color_map_details"]["name"]},' - if 'creator' in parameters['color_map_details']: - comment += f' creator: {parameters["color_map_details"]["creator"]}' - if 'interpolationspace' in parameters['color_map_details']: - comment += f'\n{indent}// interpolationspace: {parameters["color_map_details"]["interpolationspace"]},' - if 'interpolationtype' in parameters['color_map_details']: - comment += f' interpolationtype: {parameters["color_map_details"]["interpolationtype"]},' - if 'space' in parameters['color_map_details']: - comment += f' space: {parameters["color_map_details"]["space"]}' - comment += f'\n{indent}// file name: {parameters["path"]}\n' - - s = ['', f'vtkNew GetCTF()', '{', comment, - f'{indent}vtkNew ctf;', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': - s.append(f'{indent}ctf->SetColorSpaceToHSV();') - elif interp_space == 'lab': - s.append(f'{indent}ctf->SetColorSpaceToLab();') - elif interp_space == 'cielab': - s.append(f'{indent}ctf->SetColorSpaceToLab();') - elif interp_space == 'ciede2000': - s.append(f'{indent}ctf->SetColorSpaceToLabCIEDE2000();') - elif interp_space == 'diverging': - s.append(f'{indent}ctf->SetColorSpaceToDiverging();') - elif interp_space == 'step': - s.append(f'{indent}ctf->SetColorSpaceToStep();') - else: - s.append(f'{indent}ctf->SetColorSpaceToRGB();') - else: - s.append(f'{indent}ctf->SetColorSpaceToRGB();') - - scale = parameters['color_map_details'].get('interpolationtype', None) - if scale: - scale = scale.lower() - if scale == 'log10': - s.append(f'{indent}ctf->SetScaleToLog10();') - else: - s.append(f'{indent}ctf->SetScaleToLinear();') - else: - s.append(f'{indent}ctf->SetScaleToLinear();') - s.append('') - - if parameters['NaN'] is not None: - color = ', '.join(parameters['NaN']) - s.append(f'{indent}ctf->SetNanColor({color});') - - if parameters['Above'] is not None: - color = ', '.join(parameters['Above']) - s.append(f'{indent}ctf->SetAboveRangeColor({color});') - s.append(f'{indent}ctf->UseAboveRangeColorOn();') - - if parameters['Below'] is not None: - color = ', '.join(parameters['Below']) - s.append(f'{indent}ctf->SetBelowRangeColor({color});') - s.append(f'{indent}ctf->UseBelowRangeColorOn();') - s.append('') - - space = parameters['color_map_details'].get('space', None) - if space: - space = space.lower() - for i in range(0, len(parameters['data_values'])): - color = ', '.join(parameters['color_values'][i]) - idx = parameters['data_values'][i] - if space == 'hsv': - s.append(f'{indent}ctf->AddHSVPoint({idx}, {color});') - else: - s.append(f'{indent}ctf->AddRGBPoint({idx}, {color});') - s.append('') - - if table_size is not None: - s.append(f'{indent}ctf->SetNumberOfValues({table_size});') - else: - s.append(f'{indent}ctf->SetNumberOfValues({len(parameters["data_values"])});') - - if discretize: - s.append(f'{indent}ctf->DiscretizeOn();') - else: - s.append(f'{indent}ctf->DiscretizeOff();') - s.append('') - - s.append(f'{indent}return ctf;') - s.append('}') - s.append('') - - print('\n'.join(s)) - - -if __name__ == '__main__': - file, discretise, size, generate = get_program_parameters(sys.argv) - main(file, discretise, size, generate) diff --git a/data/examples/Visualization/AlphaFrequency.py b/data/examples/Visualization/AlphaFrequency.py deleted file mode 100755 index 190ae4e..0000000 --- a/data/examples/Visualization/AlphaFrequency.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python - -import re -from collections import Counter - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersModeling import vtkLinearExtrusionFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Here we read the file keeping only the alpha characters - # and calculate the frequency of each letter. - with open(fileName) as f: - freq = Counter() - for x in f: - remove_digits = re.sub('[\d_]', '', x.strip().lower()) - freq += Counter(re.findall('\w', remove_digits, re.UNICODE)) - maxFreq = max(list(freq.values())) - keys = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'.lower()) - - # - # graphics stuff - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - # - # Setup letters - # - letters = list() - extrude = list() - mappers = list() - actors = list() - i = 0 - for k in keys: - letters.append(vtkVectorText()) - letters[i].SetText(k.upper()) - - extrude.append(vtkLinearExtrusionFilter()) - extrude[i].SetInputConnection(letters[i].GetOutputPort()) - extrude[i].SetExtrusionTypeToVectorExtrusion() - extrude[i].SetVector(0, 0, 1.0) - extrude[i].SetScaleFactor(float(freq[k]) / maxFreq * 2.50) - - mappers.append(vtkPolyDataMapper()) - mappers[i].SetInputConnection(extrude[i].GetOutputPort()) - mappers[i].ScalarVisibilityOff() - - actors.append(vtkActor()) - actors[i].SetMapper(mappers[i]) - actors[i].GetProperty().SetColor(colors.GetColor3d('Peacock')) - - if freq[k] <= 0: - actors[i].VisibilityOff() - ren.AddActor(actors[i]) - i += 1 - - # Position the actors. - y = 0.0 - for j in range(0, 2): - x = 0.0 - for i in range(0, 13): - actors[j * 13 + i].SetPosition(x, y, 0.0) - x += 1.5 - y += -3.0 - - ren.ResetCamera() - ren.SetBackground(colors.GetColor3d('Silver')) - ren.GetActiveCamera().Elevation(30.0) - ren.GetActiveCamera().Azimuth(-30.0) - ren.GetActiveCamera().Dolly(1.25) - ren.ResetCameraClippingRange() - - renWin.SetSize(640, 480) - renWin.SetWindowName('AlphaFrequency') - - # Interact with the data. - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Linearly extruded fonts to show letter frequency in text.' - epilogue = ''' - Any file containing text can be used. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Gettysburg.txt.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/AnnotatedCubeActor.md b/data/examples/Visualization/AnnotatedCubeActor.md deleted file mode 100644 index ab4d555..0000000 --- a/data/examples/Visualization/AnnotatedCubeActor.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -The example demonstrates how to create and label an annotated cube actor. - -To colour the individual cube faces, see: [ColoredAnnotatedCube](../ColoredAnnotatedCube). diff --git a/data/examples/Visualization/AnnotatedCubeActor.py b/data/examples/Visualization/AnnotatedCubeActor.py deleted file mode 100755 index eb3ec01..0000000 --- a/data/examples/Visualization/AnnotatedCubeActor.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkRenderingAnnotation import vtkAnnotatedCubeActor -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Set up the renderer, window, and interactor. - # - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('Wheat')) - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('AnnotatedCubeActor') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - cube = vtkAnnotatedCubeActor() - cube.SetFaceTextScale(2.0 / 3.0) - - # Anatomic labelling. - # - cube.SetXPlusFaceText('A') - cube.SetXMinusFaceText('P') - cube.SetYPlusFaceText('L') - cube.SetYMinusFaceText('R') - cube.SetZPlusFaceText('S') - cube.SetZMinusFaceText('I') - - # Change the vector text colors. - # - cube.GetTextEdgesProperty().SetColor( - colors.GetColor3d('Black')) - cube.GetTextEdgesProperty().SetLineWidth(4) - - cube.GetXPlusFaceProperty().SetColor( - colors.GetColor3d('Turquoise')) - cube.GetXMinusFaceProperty().SetColor( - colors.GetColor3d('Turquoise')) - cube.GetYPlusFaceProperty().SetColor( - colors.GetColor3d('Mint')) - cube.GetYMinusFaceProperty().SetColor( - colors.GetColor3d('Mint')) - cube.GetZPlusFaceProperty().SetColor( - colors.GetColor3d('Tomato')) - cube.GetZMinusFaceProperty().SetColor( - colors.GetColor3d('Tomato')) - - ren.AddActor(cube) - - # Set up an interesting view. - # - camera = ren.GetActiveCamera() - camera.SetViewUp(0, 0, 1) - camera.SetFocalPoint(0, 0, 0) - camera.SetPosition(4.5, 4.5, 2.5) - ren.ResetCamera() - camera.Dolly(1.0) - ren.ResetCameraClippingRange() - - ren_win.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/AssignCellColorsFromLUT.md b/data/examples/Visualization/AssignCellColorsFromLUT.md deleted file mode 100644 index f6b042f..0000000 --- a/data/examples/Visualization/AssignCellColorsFromLUT.md +++ /dev/null @@ -1,18 +0,0 @@ -### Description - -Demonstrates how to assign colors to cells in a vtkPolyData structure using lookup tables. -Two techniques are demonstrated: - - 1. Using a lookup table of predefined colors. - 2. Using a lookup table generated from a color transfer function. - -The resultant display shows in the left-hand column, the cells in a plane -colored by the two lookup tables and in the right-hand column, the same -polydata that has been read in from a file demonstrating that the structures -are identical. - -The top row of the display uses the color transfer function to create a -green to tan transition in a diverging color space. -Note that the central square is white indicating the midpoint. - -The bottom row of the display uses a lookup table of predefined colors. diff --git a/data/examples/Visualization/AssignCellColorsFromLUT.py b/data/examples/Visualization/AssignCellColorsFromLUT.py deleted file mode 100755 index 0aadbc5..0000000 --- a/data/examples/Visualization/AssignCellColorsFromLUT.py +++ /dev/null @@ -1,261 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Demonstrates how to assign colors to cells in a vtkPolyData structure using - lookup tables. -Two techniques are demonstrated: -1) Using a lookup table of predefined colors. -2) Using a lookup table generated from a color transfer function. - -The resultant display shows in the left-hand column, the cells in a plane -colored by the two lookup tables and in the right-hand column, the same -polydata that has been read in from a file demonstrating that the structures -are identical. - -The top row of the display uses the color transfer function to create a - green to tan transition in a diverging color space. - Note that the central square is white indicating the midpoint. -The bottom row of the display uses a lookup table of predefined colors. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkUnsignedCharArray, - vtkVersion -) -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOXML import ( - vtkXMLPolyDataReader, - vtkXMLPolyDataWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def MakeLUT(tableSize): - """ - Make a lookup table from a set of named colors. - :param: tableSize - The table size - :return: The lookup table. - """ - nc = vtkNamedColors() - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(tableSize) - lut.Build() - - # Fill in a few known colors, the rest will be generated if needed - lut.SetTableValue(0, nc.GetColor4d("Black")) - lut.SetTableValue(1, nc.GetColor4d("Banana")) - lut.SetTableValue(2, nc.GetColor4d("Tomato")) - lut.SetTableValue(3, nc.GetColor4d("Wheat")) - lut.SetTableValue(4, nc.GetColor4d("Lavender")) - lut.SetTableValue(5, nc.GetColor4d("Flesh")) - lut.SetTableValue(6, nc.GetColor4d("Raspberry")) - lut.SetTableValue(7, nc.GetColor4d("Salmon")) - lut.SetTableValue(8, nc.GetColor4d("Mint")) - lut.SetTableValue(9, nc.GetColor4d("Peacock")) - - return lut - - -def MakeLUTFromCTF(tableSize): - """ - Use a color transfer Function to generate the colors in the lookup table. - See: http://www.org/doc/nightly/html/classvtkColorTransferFunction.html - :param: tableSize - The table size - :return: The lookup table. - """ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Green to tan. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.677, 0.492, 0.093) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(tableSize) - lut.Build() - - for i in range(0, tableSize): - rgb = list(ctf.GetColor(float(i) / tableSize)) + [1] - lut.SetTableValue(i, rgb) - - return lut - - -def MakeCellData(tableSize, lut, colors): - """ - Create the cell data using the colors from the lookup table. - :param: tableSize - The table size - :param: lut - The lookup table. - :param: colors - A reference to a vtkUnsignedCharArray(). - """ - for i in range(1, tableSize): - rgb = [0.0, 0.0, 0.0] - lut.GetColor(float(i) / (tableSize - 1), rgb) - ucrgb = list(map(int, [x * 255 for x in rgb])) - colors.InsertNextTuple3(ucrgb[0], ucrgb[1], ucrgb[2]) - s = '[' + ', '.join(['{:0.6f}'.format(x) for x in rgb]) + ']' - print(s, ucrgb) - - -def main(): - """ - :return: The render window interactor. - """ - - nc = vtkNamedColors() - - # Provide some geometry - resolution = 3 - - plane11 = vtkPlaneSource() - plane11.SetXResolution(resolution) - plane11.SetYResolution(resolution) - - plane12 = vtkPlaneSource() - plane12.SetXResolution(resolution) - plane12.SetYResolution(resolution) - - tableSize = max(resolution * resolution + 1, 10) - - # Force an update so we can set cell data - plane11.Update() - plane12.Update() - - # Get the lookup tables mapping cell data to colors - lut1 = MakeLUT(tableSize) - lut2 = MakeLUTFromCTF(tableSize) - - colorData1 = vtkUnsignedCharArray() - colorData1.SetName('colors') # Any name will work here. - colorData1.SetNumberOfComponents(3) - print('Using a lookup table from a set of named colors.') - MakeCellData(tableSize, lut1, colorData1) - # Then use SetScalars() to add it to the vtkPolyData structure, - # this will then be interpreted as a color table. - plane11.GetOutput().GetCellData().SetScalars(colorData1) - - colorData2 = vtkUnsignedCharArray() - colorData2.SetName('colors') # Any name will work here. - colorData2.SetNumberOfComponents(3) - print('Using a lookup table created from a color transfer function.') - MakeCellData(tableSize, lut2, colorData2) - plane12.GetOutput().GetCellData().SetScalars(colorData2) - - # Set up actor and mapper - mapper11 = vtkPolyDataMapper() - mapper11.SetInputConnection(plane11.GetOutputPort()) - # Now, instead of doing this: - # mapper11.SetScalarRange(0, tableSize - 1) - # mapper11.SetLookupTable(lut1) - # We can just use the color data that we created from the lookup table and - # assigned to the cells: - mapper11.SetScalarModeToUseCellData() - mapper11.Update() - - mapper12 = vtkPolyDataMapper() - mapper12.SetInputConnection(plane12.GetOutputPort()) - mapper12.SetScalarModeToUseCellData() - mapper12.Update() - - writer = vtkXMLPolyDataWriter() - writer.SetFileName('pdlut.vtp') - writer.SetInputData(mapper11.GetInput()) - # This is set so we can see the data in a text editor. - writer.SetDataModeToAscii() - writer.Write() - writer.SetFileName('pdctf.vtp') - writer.SetInputData(mapper12.GetInput()) - writer.Write() - - actor11 = vtkActor() - actor11.SetMapper(mapper11) - actor12 = vtkActor() - actor12.SetMapper(mapper12) - - # Let's read in the data we wrote out. - reader1 = vtkXMLPolyDataReader() - reader1.SetFileName("pdlut.vtp") - - reader2 = vtkXMLPolyDataReader() - reader2.SetFileName("pdctf.vtp") - - mapper21 = vtkPolyDataMapper() - mapper21.SetInputConnection(reader1.GetOutputPort()) - mapper21.SetScalarModeToUseCellData() - mapper21.Update() - actor21 = vtkActor() - actor21.SetMapper(mapper11) - - mapper22 = vtkPolyDataMapper() - mapper22.SetInputConnection(reader2.GetOutputPort()) - mapper22.SetScalarModeToUseCellData() - mapper22.Update() - actor22 = vtkActor() - actor22.SetMapper(mapper22) - - # Define viewport ranges. - # (xmin, ymin, xmax, ymax) - viewport11 = [0.0, 0.0, 0.5, 0.5] - viewport12 = [0.0, 0.5, 0.5, 1.0] - viewport21 = [0.5, 0.0, 1.0, 0.5] - viewport22 = [0.5, 0.5, 1.0, 1.0] - - # Set up the renderers. - ren11 = vtkRenderer() - ren12 = vtkRenderer() - ren21 = vtkRenderer() - ren22 = vtkRenderer() - - # Setup the render windows - renWin = vtkRenderWindow() - renWin.SetSize(600, 600) - renWin.SetWindowName('AssignCellColorsFromLUT'); - - renWin.AddRenderer(ren11) - renWin.AddRenderer(ren12) - renWin.AddRenderer(ren21) - renWin.AddRenderer(ren22) - ren11.SetViewport(viewport11) - ren12.SetViewport(viewport12) - ren21.SetViewport(viewport21) - ren22.SetViewport(viewport22) - ren11.SetBackground(nc.GetColor3d('MidnightBlue')) - ren12.SetBackground(nc.GetColor3d('MidnightBlue')) - ren21.SetBackground(nc.GetColor3d('MidnightBlue')) - ren22.SetBackground(nc.GetColor3d('MidnightBlue')) - ren11.AddActor(actor11) - ren12.AddActor(actor12) - ren21.AddActor(actor21) - ren22.AddActor(actor22) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - renWin.Render() - - return iren - - -if __name__ == '__main__': - requiredMajorVersion = 6 - print(vtkVersion().GetVTKMajorVersion()) - if vtkVersion().GetVTKMajorVersion() < requiredMajorVersion: - print("You need VTK Version 6 or greater.") - print("The class vtkNamedColors is in VTK version 6 or greater.") - exit(0) - iren = main() - iren.Start() diff --git a/data/examples/Visualization/BillboardTextActor3D.py b/data/examples/Visualization/BillboardTextActor3D.py deleted file mode 100755 index a2080cd..0000000 --- a/data/examples/Visualization/BillboardTextActor3D.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -# noinspection PyUnresolvedReferences -from vtkmodules.vtkCommonCore import vtkCommand -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkBillboardTextActor3D, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # For testing - rng = vtkMinimalStandardRandomSequence() - # rng.SetSeed(8775070) - rng.SetSeed(5127) - - # Create a renderer - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('DarkSlateGray')) - - # Create a render window - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetWindowName('BillboardTextActor3D') - - # Create an interactor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(render_window) - - # Create a sphere - sphere_source = vtkSphereSource() - sphere_source.SetCenter(0.0, 0.0, 0.0) - sphere_source.SetRadius(1.0) - - min_r = -10.0 - max_r = 10.0 - - for i in range(0, 10): - if i == 0: - # Create an actor representing the origin - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphere_source.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetPosition(0, 0, 0) - actor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - renderer.AddActor(actor) - - # Create a mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphere_source.GetOutputPort()) - - # Create an actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetPosition(0, 0, 0) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Set up the text and add it to the renderer - text_actor = vtkBillboardTextActor3D() - text_actor.SetInput('') - text_actor.SetPosition(actor.GetPosition()) - text_actor.GetTextProperty().SetFontSize(12) - text_actor.GetTextProperty().SetColor(colors.GetColor3d('Gold')) - text_actor.GetTextProperty().SetJustificationToCentered() - - position = random_position(min_r, max_r, rng) - actor.SetPosition(position) - # If you want to use a callback, do this: - # observer = ActorCallback(text_actor) - # actor.AddObserver(vtkCommand.NoEvent, observer(actor)) - # Otherwise do this: - label = f'{position[0]:0.3g}, {position[1]:0.3g}, {position[2]:0.3g}' - text_actor.SetPosition(position) - text_actor.SetInput(label) - - renderer.AddActor(actor) - renderer.AddActor(text_actor) - - render_window.Render() - render_window.SetWindowName('BillboardTextActor3D') - iren.Start() - - -class ActorCallback: - def __init__(self, text_actor): - self.text_actor = text_actor - - def __call__(self, caller): - position = caller.GetPosition() - label = f'{position[0]:0.3g}, {position[1]:0.3g}, {position[2]:0.3g}' - self.text_actor.SetPosition(position) - self.text_actor.SetInput(label) - - -def random_position(min_r, max_r, rng): - p = list() - for i in range(0, 3): - p.append(rng.GetRangeValue(min_r, max_r)) - rng.Next() - return p - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/BlobbyLogo.md b/data/examples/Visualization/BlobbyLogo.md deleted file mode 100644 index d0fd3ec..0000000 --- a/data/examples/Visualization/BlobbyLogo.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This is the blobby vtk logo described in chapter 12 of the VTK textbook. The example uses vtkAppendPolyData to combine three vtkPolyData. A vtkImplicitModeller creates a vtkImageData of the distnaces from the polydata triangles. vtkContourFilter extracts an isosurface representing an offset surface. - -This examples uses the data `src/Testing/Data/v.vtk`, `src/Testing/Data/t.vtk` and `src/Testing/Data/k.vtk`. - -!!! info - See [Figure 12-13](../../../VTKBook/12Chapter12/#Figure%2012-13) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/BlobbyLogo.py b/data/examples/Visualization/BlobbyLogo.py deleted file mode 100755 index 0e78e01..0000000 --- a/data/examples/Visualization/BlobbyLogo.py +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python - -''' -''' - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkContourFilter, - vtkPolyDataNormals -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersHybrid import vtkImplicitModeller -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName1, fileName2, fileName3 = get_program_parameters() - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() - aRenderWindow.AddRenderer(aRenderer) - anInteractor = vtkRenderWindowInteractor() - anInteractor.SetRenderWindow(aRenderWindow) - aRenderWindow.SetSize(300, 300) - aRenderWindow.SetWindowName('BlobbyLogo') - - # Read the geometry file containing the letter v. - letterV = vtkPolyDataReader() - letterV.SetFileName(fileName1) - - # Read the geometry file containing the letter t. - letterT = vtkPolyDataReader() - letterT.SetFileName(fileName2) - - # Read the geometry file containing the letter k. - letterK = vtkPolyDataReader() - letterK.SetFileName(fileName3) - - # Create a transform and transform filter for each letter. - VTransform = vtkTransform() - VTransformFilter = vtkTransformPolyDataFilter() - VTransformFilter.SetInputConnection(letterV.GetOutputPort()) - VTransformFilter.SetTransform(VTransform) - - TTransform = vtkTransform() - TTransformFilter = vtkTransformPolyDataFilter() - TTransformFilter.SetInputConnection(letterT.GetOutputPort()) - TTransformFilter.SetTransform(TTransform) - - KTransform = vtkTransform() - KTransformFilter = vtkTransformPolyDataFilter() - KTransformFilter.SetInputConnection(letterK.GetOutputPort()) - KTransformFilter.SetTransform(KTransform) - - # Now append them all. - appendAll = vtkAppendPolyData() - appendAll.AddInputConnection(VTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(TTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(KTransformFilter.GetOutputPort()) - - # Create normals. - logoNormals = vtkPolyDataNormals() - logoNormals.SetInputConnection(appendAll.GetOutputPort()) - logoNormals.SetFeatureAngle(60) - - # Map to rendering primitives. - logoMapper = vtkPolyDataMapper() - logoMapper.SetInputConnection(logoNormals.GetOutputPort()) - - # Now an actor. - logo = vtkActor() - logo.SetMapper(logoMapper) - - # Now create an implicit model of the same letter. - blobbyLogoImp = vtkImplicitModeller() - blobbyLogoImp.SetInputConnection(appendAll.GetOutputPort()) - blobbyLogoImp.SetMaximumDistance(.075) - blobbyLogoImp.SetSampleDimensions(64, 64, 64) - blobbyLogoImp.SetAdjustDistance(0.05) - - # Extract an iso surface. - blobbyLogoIso = vtkContourFilter() - blobbyLogoIso.SetInputConnection(blobbyLogoImp.GetOutputPort()) - blobbyLogoIso.SetValue(1, 1.5) - - # Map to rendering primitives. - blobbyLogoMapper = vtkPolyDataMapper() - blobbyLogoMapper.SetInputConnection(blobbyLogoIso.GetOutputPort()) - blobbyLogoMapper.ScalarVisibilityOff() - - tomato = vtkProperty() - tomato.SetDiffuseColor(colors.GetColor3d('tomato')) - tomato.SetSpecular(.3) - tomato.SetSpecularPower(20) - - banana = vtkProperty() - banana.SetDiffuseColor(colors.GetColor3d('banana')) - banana.SetDiffuse(.7) - banana.SetSpecular(.4) - banana.SetSpecularPower(20) - - # Now an actor. - blobbyLogo = vtkActor() - blobbyLogo.SetMapper(blobbyLogoMapper) - blobbyLogo.SetProperty(banana) - - # Position the letters. - - VTransform.Translate(-16.0, 0.0, 12.5) - VTransform.RotateY(40) - - KTransform.Translate(14.0, 0.0, 0.0) - KTransform.RotateY(-40) - - # Move the polygonal letters to the front. - logo.SetProperty(tomato) - logo.SetPosition(0, 0, 6) - - aRenderer.AddActor(logo) - aRenderer.AddActor(blobbyLogo) - - aRenderer.SetBackground(colors.GetColor3d('SlateGray')) - - aRenderWindow.Render() - - # Interact with the data. - anInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Use implicit modeller to create the VTK logo.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename1', help='v.vtk') - parser.add_argument('filename2', help='t.vtk') - parser.add_argument('filename3', help='k.vtk') - args = parser.parse_args() - return args.filename1, args.filename2, args.filename3 - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Blow.md b/data/examples/Visualization/Blow.md deleted file mode 100644 index 8f176ba..0000000 --- a/data/examples/Visualization/Blow.md +++ /dev/null @@ -1,19 +0,0 @@ -### Description - -Extrusion blow molding process. - -In the extrusion blow molding process, a material is extruded through an annular die to form -a hollow cylinder. This cylinder is called a parison. Two mold halves are then closed on the parison, while at the same time the parison is inflated with air. -Some of the parison material remains within the mold while some becomes waste material. -The material is typically a polymer plastic softened with heat, but blow molding has been used to form metal parts. Plastic bottles are often manufactured using a blow molding process. - -In this example the polymer was molded using an isothermal, nonlinear-elastic, incompressible (rubber-like) material. Triangular membrane finite elements were used to model the parison, while a combination of triangular and quadrilateral finite elements were used to model the mold. The mold surface is assumed to be rigid, and the parison is -assumed to attach to the mold upon contact. Thus the thinning of the parison is controlled by its stretching during inflation and the sequence in which it contacts the mold. - -Ten steps of the analysis are illustrated. The color of the parison indicates its thickness. Using a rainbow scale, red areas are thinnest while blue regions are thickest. Our visualization shows clearly one problem with the analysis technique we are using. Note that while the nodes (i.e., points) of the finite element mesh are prevented from passing through the mold, the interior of the -triangular elements are not. This is apparent from the occlusion of the mold wireframe by the parison mesh. - -You can also view the individual steps. - -!!! info - See [Figure 12-17](../../../VTKBook/12Chapter12/#Figure%2012-17) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/Blow.py b/data/examples/Visualization/Blow.py deleted file mode 100755 index 3da01a3..0000000 --- a/data/examples/Visualization/Blow.py +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkConnectivityFilter, - vtkContourFilter, - vtkPolyDataNormals -) -from vtkmodules.vtkFiltersGeneral import vtkWarpVector -from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter -from vtkmodules.vtkIOLegacy import vtkDataSetReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName, dataPoint = get_program_parameters() - - colors = vtkNamedColors() - - thickness = list() - displacement = list() - for i in range(0, 10): - thickness.append('thickness' + str(i)) - displacement.append('displacement' + str(i)) - - reader = list() - warp = list() - connect = list() - mold = list() - moldMapper = list() - moldActor = list() - connect2 = list() - parison = list() - normals2 = list() - parisonMapper = list() - parisonActor = list() - cf = list() - contourMapper = list() - contours = list() - ren = list() - - lut = vtkLookupTable() - lut.SetHueRange(0.0, 0.66667) - - for i in range(0, 10): - # Create the reader and warp the data vith vectors. - reader.append(vtkDataSetReader()) - reader[i].SetFileName(fileName) - reader[i].SetScalarsName(thickness[i]) - reader[i].SetVectorsName(displacement[i]) - reader[i].Update() - - warp.append(vtkWarpVector()) - warp[i].SetInputData(reader[i].GetUnstructuredGridOutput()) - - # Extract the mold from the mesh using connectivity. - connect.append(vtkConnectivityFilter()) - connect[i].SetInputConnection(warp[i].GetOutputPort()) - connect[i].SetExtractionModeToSpecifiedRegions() - connect[i].AddSpecifiedRegion(0) - connect[i].AddSpecifiedRegion(1) - mold.append(vtkGeometryFilter()) - mold[i].SetInputConnection(connect[i].GetOutputPort()) - moldMapper.append(vtkDataSetMapper()) - moldMapper[i].SetInputConnection(mold[i].GetOutputPort()) - moldMapper[i].ScalarVisibilityOff() - moldActor.append(vtkActor()) - moldActor[i].SetMapper(moldMapper[i]) - moldActor[i].GetProperty().SetColor(colors.GetColor3d("ivory_black")) - moldActor[i].GetProperty().SetRepresentationToWireframe() - - # Extract the parison from the mesh using connectivity. - connect2.append(vtkConnectivityFilter()) - connect2[i].SetInputConnection(warp[i].GetOutputPort()) - connect2[i].SetExtractionModeToSpecifiedRegions() - connect2[i].AddSpecifiedRegion(2) - parison.append(vtkGeometryFilter()) - parison[i].SetInputConnection(connect2[i].GetOutputPort()) - normals2.append(vtkPolyDataNormals()) - normals2[i].SetInputConnection(parison[i].GetOutputPort()) - normals2[i].SetFeatureAngle(60) - parisonMapper.append(vtkPolyDataMapper()) - parisonMapper[i].SetInputConnection(normals2[i].GetOutputPort()) - parisonMapper[i].SetLookupTable(lut) - parisonMapper[i].SetScalarRange(0.12, 1.0) - parisonActor.append(vtkActor()) - parisonActor[i].SetMapper(parisonMapper[i]) - - cf.append(vtkContourFilter()) - cf[i].SetInputConnection(connect2[i].GetOutputPort()) - cf[i].SetValue(0, 0.5) - contourMapper.append(vtkPolyDataMapper()) - contourMapper[i].SetInputConnection(cf[i].GetOutputPort()) - contours.append(vtkActor()) - contours[i].SetMapper(contourMapper[i]) - - ren.append(vtkRenderer()) - ren[i].AddActor(moldActor[i]) - ren[i].AddActor(parisonActor[i]) - ren[i].AddActor(contours[i]) - ren[i].SetBackground(colors.GetColor3d("AliceBlue")) - ren[i].GetActiveCamera().SetPosition(50.973277, 12.298821, 29.102547) - ren[i].GetActiveCamera().SetFocalPoint(0.141547, 12.298821, -0.245166) - ren[i].GetActiveCamera().SetViewUp(-0.500000, 0.000000, 0.866025) - ren[i].GetActiveCamera().SetClippingRange(36.640827, 78.614680) - - # Create the RenderWindow and RenderWindowInteractor. - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - rendererSizeX = 750 - rendererSizeY = 400 - renWinScale = 0.5 - renWin.SetWindowName("Blow") - if 0 <= dataPoint < 10: - renWin.AddRenderer(ren[dataPoint]) - renWin.SetSize(rendererSizeX, rendererSizeY) - else: - gridDimensionsX = 2 - gridDimensionsY = 5 - renWin.SetSize(int(rendererSizeX * gridDimensionsX * renWinScale), - int(rendererSizeY * gridDimensionsY * renWinScale)) - # Add and position the renders to the render window. - viewPort = list() - for row in range(0, gridDimensionsY): - for col in range(0, gridDimensionsX): - idx = row * gridDimensionsX + col - x0 = float(col) / gridDimensionsX - y0 = float(gridDimensionsY - row - 1) / gridDimensionsY - x1 = float(col + 1) / gridDimensionsX - y1 = float(gridDimensionsY - row) / gridDimensionsY - viewPort[:] = [] - viewPort.append(x0) - viewPort.append(y0) - viewPort.append(x1) - viewPort.append(y1) - renWin.AddRenderer(ren[idx]) - ren[idx].SetViewport(viewPort) - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produce figure 12-17 from the VTK Textbook.' - epilogue = ''' - - It is a translation of the original blow.tcl. - - data_point allows you to specify which frame is to be displayed. - If data_point < 0 or data_point > 9 all ten frames are then displayed. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='blow.vtk') - parser.add_argument('-d', '--data_point', default=-1, type=int, nargs='?', - help='The frame to display (0...9).') - args = parser.parse_args() - return args.filename, args.data_point - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Camera.py b/data/examples/Visualization/Camera.py deleted file mode 100755 index 69ea38c..0000000 --- a/data/examples/Visualization/Camera.py +++ /dev/null @@ -1,64 +0,0 @@ -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 - - -def main(): - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(10) - sphereSource.SetPhiResolution(30) - sphereSource.SetThetaResolution(30) - sphereSource.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphereSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.GetProperty().SetColor(colors.GetColor3d('LightSkyBlue')) - - camera = vtkCamera() - camera.SetPosition(0, 0, 100) - camera.SetFocalPoint(0, 0, 0) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderer.SetActiveCamera(camera) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('Camera') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MistyRose')) - - # Render and interact - renderWindowInteractor.Initialize() - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CameraModel1.md b/data/examples/Visualization/CameraModel1.md deleted file mode 100644 index 9f05834..0000000 --- a/data/examples/Visualization/CameraModel1.md +++ /dev/null @@ -1,15 +0,0 @@ -### Description - -This example illustrates the camera movement around the focal point. - -!!! note - For camera movement centered at the camera position see [CameraModel2](../CameraModel2). - -!!! note - This is an adaptation of the code written by Chung Kai Lun Pete. - -!!! note - This example corresponds to Figure 3-12 in the VTK Text. - -!!! info - See [Figure 3-12](../../../VTKBook/03Chapter3/#Figure%203-12) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/CameraModel1.py b/data/examples/Visualization/CameraModel1.py deleted file mode 100755 index d7084cd..0000000 --- a/data/examples/Visualization/CameraModel1.py +++ /dev/null @@ -1,331 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkAppendFilter, - vtkContourFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkTransformFilter, - vtkTransformPolyDataFilter, - vtkWarpTo -) -from vtkmodules.vtkFiltersHybrid import vtkImplicitModeller -from vtkmodules.vtkFiltersModeling import vtkRotationalExtrusionFilter -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextActor -) -from vtkmodules.vtkRenderingLOD import vtkLODActor - - -def main(): - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('AzimuthArrowColor', [255, 77, 77, 255]) - colors.SetColor('ElevationArrowColor', [77, 255, 77, 255]) - colors.SetColor('RollArrowColor', [255, 255, 77, 255]) - colors.SetColor('SpikeColor', [255, 77, 255, 255]) - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # Create a rendering window, renderer and interactor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create a camera model. - camCS = vtkConeSource() - camCS.SetHeight(1.5) - camCS.SetResolution(12) - camCS.SetRadius(0.4) - - camCBS = vtkCubeSource() - camCBS.SetXLength(1.5) - camCBS.SetZLength(0.8) - camCBS.SetCenter(0.4, 0, 0) - - camAPD = vtkAppendFilter() - camAPD.AddInputConnection(camCBS.GetOutputPort()) - camAPD.AddInputConnection(camCS.GetOutputPort()) - - camMapper = vtkPolyDataMapper() - camMapper.SetInputConnection(camAPD.GetOutputPort()) - camActor = vtkLODActor() - camActor.SetMapper(camMapper) - camActor.SetScale(2, 2, 2) - - # Draw the arrows. - pd = vtkPolyData() - ca = vtkCellArray() - fp = vtkPoints() - fp.InsertNextPoint(0, 1, 0) - fp.InsertNextPoint(8, 1, 0) - fp.InsertNextPoint(8, 2, 0) - fp.InsertNextPoint(10, 0.01, 0) - fp.InsertNextPoint(8, -2, 0) - fp.InsertNextPoint(8, -1, 0) - fp.InsertNextPoint(0, -1, 0) - ca.InsertNextCell(7) - ca.InsertCellPoint(0) - ca.InsertCellPoint(1) - ca.InsertCellPoint(2) - ca.InsertCellPoint(3) - ca.InsertCellPoint(4) - ca.InsertCellPoint(5) - ca.InsertCellPoint(6) - pd.SetPoints(fp) - pd.SetPolys(ca) - - pd2 = vtkPolyData() - ca2 = vtkCellArray() - fp2 = vtkPoints() - fp2.InsertNextPoint(0, 1, 0) - fp2.InsertNextPoint(8, 1, 0) - fp2.InsertNextPoint(8, 2, 0) - fp2.InsertNextPoint(10, 0.01, 0) - ca2.InsertNextCell(4) - ca2.InsertCellPoint(0) - ca2.InsertCellPoint(1) - ca2.InsertCellPoint(2) - ca2.InsertCellPoint(3) - pd2.SetPoints(fp2) - pd2.SetLines(ca2) - - arrowIM = vtkImplicitModeller() - arrowIM.SetInputData(pd) - arrowIM.SetSampleDimensions(50, 20, 8) - - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) - arrowCF.SetValue(0, 0.2) - - arrowWT = vtkWarpTo() - arrowWT.SetInputConnection(arrowCF.GetOutputPort()) - arrowWT.SetPosition(5, 0, 5) - arrowWT.SetScaleFactor(0.85) - arrowWT.AbsoluteOn() - - arrowT = vtkTransform() - arrowT.RotateY(60) - arrowT.Translate(-1.33198, 0, -1.479) - arrowT.Scale(1, 0.5, 1) - - arrowTF = vtkTransformFilter() - arrowTF.SetInputConnection(arrowWT.GetOutputPort()) - arrowTF.SetTransform(arrowT) - - arrowMapper = vtkDataSetMapper() - arrowMapper.SetInputConnection(arrowTF.GetOutputPort()) - arrowMapper.ScalarVisibilityOff() - - # Draw the azimuth arrows. - a1Actor = vtkLODActor() - a1Actor.SetMapper(arrowMapper) - a1Actor.RotateZ(180) - a1Actor.SetPosition(1, 0, -1) - a1Actor.GetProperty().SetColor(colors.GetColor3d('AzimuthArrowColor')) - a1Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - a1Actor.GetProperty().SetSpecular(0.3) - a1Actor.GetProperty().SetSpecularPower(20) - a1Actor.GetProperty().SetAmbient(0.2) - a1Actor.GetProperty().SetDiffuse(0.8) - - a2Actor = vtkLODActor() - a2Actor.SetMapper(arrowMapper) - a2Actor.RotateZ(180) - a2Actor.RotateX(180) - a2Actor.SetPosition(1, 0, 1) - a2Actor.GetProperty().SetColor(colors.GetColor3d('AzimuthArrowColor')) - a2Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - a2Actor.GetProperty().SetSpecular(0.3) - a2Actor.GetProperty().SetSpecularPower(20) - a2Actor.GetProperty().SetAmbient(0.2) - a2Actor.GetProperty().SetDiffuse(0.8) - - # Draw the elevation arrows. - a3Actor = vtkLODActor() - a3Actor.SetMapper(arrowMapper) - a3Actor.RotateZ(180) - a3Actor.RotateX(90) - a3Actor.SetPosition(1, -1, 0) - a3Actor.GetProperty().SetColor(colors.GetColor3d('ElevationArrowColor')) - a3Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - a3Actor.GetProperty().SetSpecular(0.3) - a3Actor.GetProperty().SetSpecularPower(20) - a3Actor.GetProperty().SetAmbient(0.2) - a3Actor.GetProperty().SetDiffuse(0.8) - - a4Actor = vtkLODActor() - a4Actor.SetMapper(arrowMapper) - a4Actor.RotateZ(180) - a4Actor.RotateX(-90) - a4Actor.SetPosition(1, 1, 0) - a4Actor.GetProperty().SetColor(colors.GetColor3d('ElevationArrowColor')) - a4Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - a4Actor.GetProperty().SetSpecular(0.3) - a4Actor.GetProperty().SetSpecularPower(20) - a4Actor.GetProperty().SetAmbient(0.2) - a4Actor.GetProperty().SetDiffuse(0.8) - - # Draw the DOP. - arrowT2 = vtkTransform() - arrowT2.Scale(1, 0.6, 1) - arrowT2.RotateY(90) - - arrowTF2 = vtkTransformPolyDataFilter() - arrowTF2.SetInputData(pd2) - arrowTF2.SetTransform(arrowT2) - - arrowREF = vtkRotationalExtrusionFilter() - arrowREF.SetInputConnection(arrowTF2.GetOutputPort()) - arrowREF.CappingOff() - arrowREF.SetResolution(30) - - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(arrowREF.GetOutputPort()) - - a5Actor = vtkLODActor() - a5Actor.SetMapper(spikeMapper) - a5Actor.SetScale(.3, .3, .6) - a5Actor.RotateY(90) - a5Actor.SetPosition(-2, 0, 0) - a5Actor.GetProperty().SetColor(colors.GetColor3d('SpikeColor')) - a5Actor.GetProperty().SetAmbient(0.2) - a5Actor.GetProperty().SetDiffuse(0.8) - - # Focal point. - fps = vtkSphereSource() - fps.SetRadius(0.5) - fpMapper = vtkPolyDataMapper() - fpMapper.SetInputConnection(fps.GetOutputPort()) - fpActor = vtkLODActor() - fpActor.SetMapper(fpMapper) - fpActor.SetPosition(-9, 0, 0) - fpActor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - fpActor.GetProperty().SetSpecular(0.3) - fpActor.GetProperty().SetAmbient(0.2) - fpActor.GetProperty().SetDiffuse(0.8) - fpActor.GetProperty().SetSpecularPower(20) - - # Create the roll arrows. - arrowWT2 = vtkWarpTo() - arrowWT2.SetInputConnection(arrowCF.GetOutputPort()) - arrowWT2.SetPosition(5, 0, 2.5) - arrowWT2.SetScaleFactor(0.95) - arrowWT2.AbsoluteOn() - - arrowT3 = vtkTransform() - arrowT3.Translate(-2.50358, 0, -1.70408) - arrowT3.Scale(0.5, 0.3, 1) - - arrowTF3 = vtkTransformFilter() - arrowTF3.SetInputConnection(arrowWT2.GetOutputPort()) - arrowTF3.SetTransform(arrowT3) - - arrowMapper2 = vtkDataSetMapper() - arrowMapper2.SetInputConnection(arrowTF3.GetOutputPort()) - arrowMapper2.ScalarVisibilityOff() - - # Draw the roll arrows. - a6Actor = vtkLODActor() - a6Actor.SetMapper(arrowMapper2) - a6Actor.RotateZ(90) - a6Actor.SetPosition(-4, 0, 0) - a6Actor.SetScale(1.5, 1.5, 1.5) - a6Actor.GetProperty().SetColor(colors.GetColor3d('RollArrowColor')) - a6Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - a6Actor.GetProperty().SetSpecular(0.3) - a6Actor.GetProperty().SetSpecularPower(20) - a6Actor.GetProperty().SetAmbient(0.2) - a6Actor.GetProperty().SetDiffuse(0.8) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(camActor) - ren.AddActor(a1Actor) - ren.AddActor(a2Actor) - ren.AddActor(a3Actor) - ren.AddActor(a4Actor) - ren.AddActor(a5Actor) - ren.AddActor(a6Actor) - ren.AddActor(fpActor) - ren.SetBackground(colors.GetColor3d('BkgColor')) - ren.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('CameraModel1') - - # Render the image. - - cam1 = (ren.GetActiveCamera()) - ren.ResetCamera() - cam1.Azimuth(150) - cam1.Elevation(30) - cam1.Dolly(1.5) - ren.ResetCameraClippingRange() - - # Create a TextActor for azimuth (a1 and a2 actor's color). - text = vtkTextActor() - text.SetInput('Azimuth') - tprop = text.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a1Actor.GetProperty().GetColor()) - text.SetDisplayPosition(20, 50) - ren.AddActor2D(text) - - # Create a TextActor for elevation (a3 and a4 actor's color). - text2 = vtkTextActor() - text2.SetInput('Elevation') - tprop = text2.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a3Actor.GetProperty().GetColor()) - text2.SetDisplayPosition(20, 100) - ren.AddActor2D(text2) - - # Create a TextActor for roll (a6 actor's color). - text3 = vtkTextActor() - text3.SetInput('Roll') - tprop = text3.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a6Actor.GetProperty().GetColor()) - text3.SetDisplayPosition(20, 150) - ren.AddActor2D(text3) - - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CameraModel2.md b/data/examples/Visualization/CameraModel2.md deleted file mode 100644 index c7e4ab5..0000000 --- a/data/examples/Visualization/CameraModel2.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example illustrates the camera movement centered at the camera position. - -!!! note - For camera movement around the focal point see [CameraModel1](../CameraModel1). - -!!! note - This is an adaptation of the code written by Chung Kai Lun Pete. - -!!! info - See [Figure 3-13](../../../VTKBook/03Chapter3/#Figure%203-13) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/CameraModel2.py b/data/examples/Visualization/CameraModel2.py deleted file mode 100755 index 15120bd..0000000 --- a/data/examples/Visualization/CameraModel2.py +++ /dev/null @@ -1,343 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkContourFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkTransformFilter, - vtkTransformPolyDataFilter, - vtkWarpTo -) -from vtkmodules.vtkFiltersHybrid import vtkImplicitModeller -from vtkmodules.vtkFiltersModeling import vtkRotationalExtrusionFilter -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextActor -) -from vtkmodules.vtkRenderingLOD import vtkLODActor - - -def main(): - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor("AzimuthArrowColor", [255, 77, 77, 255]) - colors.SetColor("ElevationArrowColor", [77, 255, 77, 255]) - colors.SetColor("RollArrowColor", [255, 255, 77, 255]) - colors.SetColor("SpikeColor", [255, 77, 255, 255]) - colors.SetColor("UpSpikeColor", [77, 255, 255, 255]) - - # Create a rendering window, renderer and interactor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create a camera model. - camCS = vtkConeSource() - camCS.SetHeight(1.5) - camCS.SetResolution(12) - camCS.SetRadius(0.4) - - camCBS = vtkCubeSource() - camCBS.SetXLength(1.5) - camCBS.SetZLength(0.8) - camCBS.SetCenter(0.4, 0, 0) - - camAPD = vtkAppendPolyData() - camAPD.AddInputConnection(camCBS.GetOutputPort()) - camAPD.AddInputConnection(camCS.GetOutputPort()) - - camMapper = vtkPolyDataMapper() - camMapper.SetInputConnection(camAPD.GetOutputPort()) - camActor = vtkLODActor() - camActor.SetMapper(camMapper) - camActor.SetScale(2, 2, 2) - - # Draw the arrows. - pd = vtkPolyData() - ca = vtkCellArray() - pts = vtkPoints() - pts.InsertNextPoint(0, 1, 0) - pts.InsertNextPoint(8, 1, 0) - pts.InsertNextPoint(8, 2, 0) - pts.InsertNextPoint(10, 0, 0) - pts.InsertNextPoint(8, -2, 0) - pts.InsertNextPoint(8, -1, 0) - pts.InsertNextPoint(0, -1, 0) - ca.InsertNextCell(7) - ca.InsertCellPoint(0) - ca.InsertCellPoint(1) - ca.InsertCellPoint(2) - ca.InsertCellPoint(3) - ca.InsertCellPoint(4) - ca.InsertCellPoint(5) - ca.InsertCellPoint(6) - pd.SetPoints(pts) - pd.SetPolys(ca) - - pd2 = vtkPolyData() - ca2 = vtkCellArray() - pts2 = vtkPoints() - pts2.InsertNextPoint(0, 1, 0) - pts2.InsertNextPoint(8, 1, 0) - pts2.InsertNextPoint(8, 2, 0) - pts2.InsertNextPoint(10, 0.01, 0) - ca2.InsertNextCell(4) - ca2.InsertCellPoint(0) - ca2.InsertCellPoint(1) - ca2.InsertCellPoint(2) - ca2.InsertCellPoint(3) - pd2.SetPoints(pts2) - pd2.SetLines(ca2) - - arrowIM = vtkImplicitModeller() - arrowIM.SetInputData(pd) - arrowIM.SetSampleDimensions(50, 20, 8) - - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) - arrowCF.SetValue(0, 0.2) - - arrowWT = vtkWarpTo() - arrowWT.SetInputConnection(arrowCF.GetOutputPort()) - arrowWT.SetPosition(5, 0, 5) - arrowWT.SetScaleFactor(0.85) - arrowWT.AbsoluteOn() - - arrowT = vtkTransform() - arrowT.RotateY(60) - arrowT.Translate(-1.33198, 0, -1.479) - arrowT.Scale(1, 0.5, 1) - - arrowTF = vtkTransformFilter() - arrowTF.SetInputConnection(arrowWT.GetOutputPort()) - arrowTF.SetTransform(arrowT) - - arrowMapper = vtkDataSetMapper() - arrowMapper.SetInputConnection(arrowTF.GetOutputPort()) - arrowMapper.ScalarVisibilityOff() - - # Draw the azimuth arrows. - a1Actor = vtkLODActor() - a1Actor.SetMapper(arrowMapper) - a1Actor.SetPosition(-9, 0, -1) - a1Actor.GetProperty().SetColor(colors.GetColor3d("AzimuthArrowColor")) - a1Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a1Actor.GetProperty().SetSpecular(0.3) - a1Actor.GetProperty().SetSpecularPower(20) - a1Actor.GetProperty().SetAmbient(0.2) - a1Actor.GetProperty().SetDiffuse(0.8) - - a2Actor = vtkLODActor() - a2Actor.SetMapper(arrowMapper) - a2Actor.RotateX(180) - a2Actor.SetPosition(-9, 0, 1) - a2Actor.GetProperty().SetColor(colors.GetColor3d("AzimuthArrowColor")) - a2Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a2Actor.GetProperty().SetSpecular(0.3) - a2Actor.GetProperty().SetSpecularPower(20) - a2Actor.GetProperty().SetAmbient(0.2) - a2Actor.GetProperty().SetDiffuse(0.8) - - # Draw the elevation arrows. - a3Actor = vtkLODActor() - a3Actor.SetMapper(arrowMapper) - a3Actor.RotateX(-90) - a3Actor.SetPosition(-9, -1, 0) - a3Actor.GetProperty().SetColor(colors.GetColor3d("ElevationArrowColor")) - a3Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a3Actor.GetProperty().SetSpecular(0.3) - a3Actor.GetProperty().SetSpecularPower(20) - a3Actor.GetProperty().SetAmbient(0.2) - a3Actor.GetProperty().SetDiffuse(0.8) - - a4Actor = vtkLODActor() - a4Actor.SetMapper(arrowMapper) - a4Actor.RotateX(90) - a4Actor.SetPosition(-9, 1, 0) - a4Actor.GetProperty().SetColor(colors.GetColor3d("ElevationArrowColor")) - a4Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a4Actor.GetProperty().SetSpecular(0.3) - a4Actor.GetProperty().SetSpecularPower(20) - a4Actor.GetProperty().SetAmbient(0.2) - a4Actor.GetProperty().SetDiffuse(0.8) - - # Draw the DOP. - arrowT2 = vtkTransform() - arrowT2.Scale(1, 0.6, 1) - arrowT2.RotateY(90) - - arrowTF2 = vtkTransformPolyDataFilter() - arrowTF2.SetInputData(pd2) - arrowTF2.SetTransform(arrowT2) - - arrowREF = vtkRotationalExtrusionFilter() - arrowREF.SetInputConnection(arrowTF2.GetOutputPort()) - arrowREF.CappingOff() - arrowREF.SetResolution(30) - - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(arrowREF.GetOutputPort()) - - a5Actor = vtkLODActor() - a5Actor.SetMapper(spikeMapper) - a5Actor.SetScale(0.3, 0.3, 0.6) - a5Actor.RotateY(-90) - a5Actor.SetPosition(-8, 0, 0) - a5Actor.GetProperty().SetColor(colors.GetColor3d("SpikeColor")) - a5Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a5Actor.GetProperty().SetSpecular(0.3) - a5Actor.GetProperty().SetAmbient(0.2) - a5Actor.GetProperty().SetDiffuse(0.8) - a5Actor.GetProperty().SetSpecularPower(20) - - a7Actor = vtkLODActor() - a7Actor.SetMapper(spikeMapper) - a7Actor.SetScale(0.2, 0.2, 0.7) - a7Actor.RotateZ(90) - a7Actor.RotateY(-90) - a7Actor.SetPosition(-9, 1, 0) - a7Actor.GetProperty().SetColor(colors.GetColor3d("UpSpikeColor")) - a7Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a7Actor.GetProperty().SetSpecular(0.3) - a7Actor.GetProperty().SetAmbient(0.2) - a7Actor.GetProperty().SetDiffuse(0.8) - a7Actor.GetProperty().SetSpecularPower(20) - - # Focal point. - ss = vtkSphereSource() - ss.SetRadius(0.5) - fpMapper = vtkPolyDataMapper() - fpMapper.SetInputConnection(ss.GetOutputPort()) - fpActor = vtkLODActor() - fpActor.SetMapper(fpMapper) - fpActor.SetPosition(-9, 0, 0) - fpActor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - fpActor.GetProperty().SetSpecular(0.3) - fpActor.GetProperty().SetAmbient(0.2) - fpActor.GetProperty().SetDiffuse(0.8) - fpActor.GetProperty().SetSpecularPower(20) - - # Create the roll arrows. - arrowWT2 = vtkWarpTo() - arrowWT2.SetInputConnection(arrowCF.GetOutputPort()) - arrowWT2.SetPosition(5, 0, 2.5) - arrowWT2.SetScaleFactor(0.95) - arrowWT2.AbsoluteOn() - - arrowT3 = vtkTransform() - arrowT3.Translate(-2.50358, 0, -1.70408) - arrowT3.Scale(0.5, 0.3, 1) - - arrowTF3 = vtkTransformFilter() - arrowTF3.SetInputConnection(arrowWT2.GetOutputPort()) - arrowTF3.SetTransform(arrowT3) - - arrowMapper2 = vtkDataSetMapper() - arrowMapper2.SetInputConnection(arrowTF3.GetOutputPort()) - arrowMapper2.ScalarVisibilityOff() - - # Draw the roll arrows. - a6Actor = vtkLODActor() - a6Actor.SetMapper(arrowMapper2) - a6Actor.RotateZ(90) - a6Actor.SetPosition(-4, 0, 0) - a6Actor.SetScale(1.5, 1.5, 1.5) - a6Actor.GetProperty().SetColor(colors.GetColor3d("RollArrowColor")) - a6Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a6Actor.GetProperty().SetSpecular(0.3) - a6Actor.GetProperty().SetSpecularPower(20) - a6Actor.GetProperty().SetAmbient(0.2) - a6Actor.GetProperty().SetDiffuse(0.8) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(camActor) - ren.AddActor(a1Actor) - ren.AddActor(a2Actor) - ren.AddActor(a3Actor) - ren.AddActor(a4Actor) - ren.AddActor(a5Actor) - ren.AddActor(a6Actor) - ren.AddActor(a7Actor) - ren.AddActor(fpActor) - ren.SetBackground(colors.GetColor3d("SlateGray")) - renWin.SetSize(640, 480) - renWin.SetWindowName('CameraModel2') - - # Render the image. - - cam1 = (ren.GetActiveCamera()) - ren.ResetCamera() - cam1.Azimuth(150) - cam1.Elevation(30) - cam1.Dolly(1.5) - ren.ResetCameraClippingRange() - - # Create a TextActor for Yaw (a1 and a2 actor's color). - text = vtkTextActor() - text.SetInput("Yaw") - tprop = text.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a1Actor.GetProperty().GetColor()) - text.SetDisplayPosition(20, 50) - ren.AddActor2D(text) - - # Create a TextActor for Pitch (a3 and a4 actor's color). - text2 = vtkTextActor() - text2.SetInput("Pitch") - tprop = text2.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a3Actor.GetProperty().GetColor()) - text2.SetDisplayPosition(20, 100) - ren.AddActor2D(text2) - - # Create a TextActor for roll (a6 actor's color). - text3 = vtkTextActor() - text3.SetInput("Roll") - tprop = text3.GetTextProperty() - tprop.SetFontFamilyToArial() - tprop.ShadowOff() - tprop.SetLineSpacing(1.0) - tprop.SetFontSize(36) - tprop.SetColor(a6Actor.GetProperty().GetColor()) - text3.SetDisplayPosition(20, 150) - ren.AddActor2D(text3) - - iren.Initialize() - iren.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/Visualization/ClampGlyphSizes.py b/data/examples/Visualization/ClampGlyphSizes.py deleted file mode 100755 index a8381fe..0000000 --- a/data/examples/Visualization/ClampGlyphSizes.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env python - -# Example of how to use range clamping with vtkGlyph3D filter. -# -# Note that the internal algorithm does this to figure out the eventual scale -# of your data (say, if you're scaling by a scalar or vector magnitude): -# -# scale = (scalar value of that particular data index); -# denominator = Range[1] - Range[0]; -# scale = (scale < Range[0] ? Range[0] : (scale > Range[1] ? Range[1] : scale)); -# scale = (scale - Range[0]) / denominator; -# scale *= scaleFactor; -# -# So, step 4 is the unintuitive one. Say your data varies from [0, 1] and you set the -# Range to [0.5, 1]. Everything below 0.5 will be mapped to 0. If you want to set a -# minimum size to your glyphs, then you can set the Range as something like [-0.5, 1] - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkElevationFilter, - vtkGlyph3D -) -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkImagingCore import vtkRTAnalyticSource -from vtkmodules.vtkImagingGeneral import vtkImageGradient -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Generate an image data set with multiple attribute arrays to probe and view - # We will glyph these points with cones and scale/orient/color them with the - # various attributes - - # The Wavelet Source is nice for generating a test vtkImageData set - rt = vtkRTAnalyticSource() - rt.SetWholeExtent(-2, 2, -2, 2, 0, 0) - - # Take the gradient of the only scalar 'RTData' to get a vector attribute - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - - # Elevation just to generate another scalar attribute that varies nicely over the data range - elev = vtkElevationFilter() - # Elevation values will range from 0 to 1 between the Low and High Points - elev.SetLowPoint(-2, 0, 0) - elev.SetHighPoint(2, 0, 0) - elev.SetInputConnection(grad.GetOutputPort()) - - # Generate the cone for the glyphs - sph = vtkConeSource() - sph.SetRadius(0.1) - sph.SetHeight(0.5) - - # Set up the glyph filter - glyph = vtkGlyph3D() - glyph.SetInputConnection(elev.GetOutputPort()) - glyph.SetSourceConnection(sph.GetOutputPort()) - glyph.ScalingOn() - glyph.SetScaleModeToScaleByScalar() - glyph.SetVectorModeToUseVector() - glyph.OrientOn() - - # Tell the filter to 'clamp' the scalar range - glyph.ClampingOn() - - # Set the overall (multiplicative) scaling factor - glyph.SetScaleFactor(1) - - # Set the Range to 'clamp' the data to - # -- see equations above for nonintuitive definition of 'clamping' - # The fact that I'm setting the minimum value of the range below - # the minimum of my data (real min=0.0) with the equations above - # forces a minimum non-zero glyph size. - - glyph.SetRange(-0.5, 1) # Change these values to see effect on cone sizes - - # Tell glyph which attribute arrays to use for what - glyph.SetInputArrayToProcess(0, 0, 0, 0, 'Elevation') # scalars - glyph.SetInputArrayToProcess(1, 0, 0, 0, 'RTDataGradient') # vectors - # glyph.SetInputArrayToProcess(2,0,0,0,'nothing') # normals - glyph.SetInputArrayToProcess(3, 0, 0, 0, 'RTData') # colors - - # Calling update because I'm going to use the scalar range to set the color map range - glyph.Update() - - coloring_by = 'RTData' - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph.GetOutputPort()) - mapper.SetScalarModeToUsePointFieldData() - mapper.SetColorModeToMapScalars() - mapper.ScalarVisibilityOn() - mapper.SetScalarRange(glyph.GetOutputDataObject(0).GetPointData().GetArray(coloring_by).GetRange()) - mapper.SelectColorArray(coloring_by) - actor = vtkActor() - actor.SetMapper(mapper) - - ren = vtkRenderer() - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('ClampGlyphSizes') - - iren = vtkRenderWindowInteractor() - istyle = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(istyle) - iren.SetRenderWindow(renWin) - ren.ResetCamera() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CollisionDetection.md b/data/examples/Visualization/CollisionDetection.md deleted file mode 100644 index 2defa2a..0000000 --- a/data/examples/Visualization/CollisionDetection.md +++ /dev/null @@ -1,13 +0,0 @@ -### Description - -This examples uses vtkCollisionDetectionFilter to find the intersection between a fixed (solid white) and moving (red wireframe) sphere. The animation places the moving sphere some distance from the fixed sphere and moves the moving sphere until it contacts the fixed sphere. - -Three collision modes are available and can be set as the first argument on the command line. - -1. All contacts (0) finds all the contacting cell pairs with two points per collision. -2. First contact (1) quickly find the first contact point. -3. Half contacts (2) finds all the contacting cell pairs with one points per collision. - -The animation pauses between each frame. The total animation should be 3 seconds. - -Three videos on the [VTK Examples Project](https://www.youtube.com/watch?v=baumvJCFmSY&list=PLim3Sl9kwFYJASyM9cKFvQ-Sw343CSic-&index=3) youtube playlist show each of the collision modes. diff --git a/data/examples/Visualization/CollisionDetection.py b/data/examples/Visualization/CollisionDetection.py deleted file mode 100755 index 8ae1fdf..0000000 --- a/data/examples/Visualization/CollisionDetection.py +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/env python - -import time - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersModeling import vtkCollisionDetectionFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextActor -) - - -def get_program_parameters(): - import argparse - description = 'Collision detection.' - epilogue = ''' -This examples uses vtkCollisionDetectionFilter to find the intersection between a - fixed (solid white) and moving (red wireframe) sphere. -The animation places the moving sphere some distance from the fixed sphere and - moves the moving sphere until it contacts the fixed sphere. - -Three collision modes are available and can be set as the first argument on the command line. - -1. All contacts (0) finds all the contacting cell pairs with two points per collision. -2. First contact (1) quickly find the first contact point. -3. Half contacts (2) finds all the contacting cell pairs with one points per collision. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('contactMode', nargs='?', default=0, type=int, help='Contact mode 0 (default), 1, or 2.') - args = parser.parse_args() - return args.contactMode - - -def main(): - contactMode = get_program_parameters() - - # Define colors - colors = vtkNamedColors() - - sphere0 = vtkSphereSource() - sphere0.SetRadius(0.29) - sphere0.SetPhiResolution(31) - sphere0.SetThetaResolution(31) - sphere0.SetCenter(0.0, 0, 0) - - sphere1 = vtkSphereSource() - sphere1.SetPhiResolution(30) - sphere1.SetThetaResolution(30) - sphere1.SetRadius(0.3) - - matrix1 = vtkMatrix4x4() - transform0 = vtkTransform() - - collide = vtkCollisionDetectionFilter() - collide.SetInputConnection(0, sphere0.GetOutputPort()) - collide.SetTransform(0, transform0) - collide.SetInputConnection(1, sphere1.GetOutputPort()) - collide.SetMatrix(1, matrix1) - collide.SetBoxTolerance(0.0) - collide.SetCellTolerance(0.0) - collide.SetNumberOfCellsPerNode(2) - if contactMode == 0: - collide.SetCollisionModeToAllContacts() - elif contactMode == 1: - collide.SetCollisionModeToFirstContact() - else: - collide.SetCollisionModeToHalfContacts() - collide.GenerateScalarsOn() - - # Visualize - mapper1 = vtkPolyDataMapper() - mapper1.SetInputConnection(collide.GetOutputPort(0)) - mapper1.ScalarVisibilityOff() - actor1 = vtkActor() - actor1.SetMapper(mapper1) - actor1.GetProperty().BackfaceCullingOn() - actor1.SetUserTransform(transform0) - actor1.GetProperty().SetDiffuseColor(colors.GetColor3d("Tomato")) - actor1.GetProperty().SetRepresentationToWireframe() - - mapper2 = vtkPolyDataMapper() - mapper2.SetInputConnection(collide.GetOutputPort(1)) - - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().BackfaceCullingOn() - actor2.SetUserMatrix(matrix1) - - mapper3 = vtkPolyDataMapper() - mapper3.SetInputConnection(collide.GetContactsOutputPort()) - mapper3.SetResolveCoincidentTopologyToPolygonOffset() - - actor3 = vtkActor() - actor3.SetMapper(mapper3) - actor3.GetProperty().SetColor(colors.GetColor3d("Black")) - actor3.GetProperty().SetLineWidth(3.0) - - txt = vtkTextActor() - txt.GetTextProperty().SetFontSize(18) - - renderer = vtkRenderer() - renderer.UseHiddenLineRemovalOn() - renderer.AddActor(actor1) - renderer.AddActor(actor2) - renderer.AddActor(actor3) - renderer.AddActor(txt) - renderer.SetBackground(colors.GetColor3d("Gray")) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(640, 480) - renderWindow.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Move the first object - numSteps = 100 - dx = 1.0 / float(numSteps) * 2.0 - transform0.Translate(-numSteps * dx - .3, 0.0, 0.0) - renderWindow.Render() - renderer.GetActiveCamera().Azimuth(-60) - renderer.GetActiveCamera().Elevation(45) - renderer.GetActiveCamera().Dolly(1.2) - - renderWindow.SetWindowName('CollisionDetection') - renderWindow.Render() - - for i in range(0, numSteps): - transform0.Translate(dx, 0.0, 0.0) - renderer.ResetCameraClippingRange() - s = '{:s}: Number of contact cells is {:d}'.format(collide.GetCollisionModeAsString(), - collide.GetNumberOfContacts()) - txt.SetInput(s) - renderWindow.Render() - if collide.GetNumberOfContacts() > 0: - break - # The total animation time is 3 seconds - time.sleep(3.0 / numSteps) - - renderer.ResetCamera() - renderWindow.Render() - renderWindow.Render() - interactor.Start() - # In Field Data there will be an array named "ContactCells". - # This array indexes contacting cells (e.g.) index 10 of array 0 - # points to a cell (triangle) which contacts/intersects a cell - # at index 10 of array 1. - # You can directly obtain these, see GetContactCells(int i) - # in the documentation. - # print(collide.GetOutput(0)) - # print(collide.GetOutput(1)) - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ColorAnActor.py b/data/examples/Visualization/ColorAnActor.py deleted file mode 100755 index e169d7a..0000000 --- a/data/examples/Visualization/ColorAnActor.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('ColorAnActor') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create source - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(5.0) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('Navy')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ColorSeriesPatches.md b/data/examples/Visualization/ColorSeriesPatches.md deleted file mode 100644 index fc5871f..0000000 --- a/data/examples/Visualization/ColorSeriesPatches.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example shows how to produce a HTML page called [VTKColorSeriesPatches](https://htmlpreview.github.io/?https://github.com/Kitware/vtk-examples/blob/gh-pages/VTKColorSeriesPatches.html) showing the available colors series in vtkColorSeries. - -It also shows how to select the text color based on luminance. In this case, Digital CCIR601 is used, which gives less weight to the red and blue components of a color. diff --git a/data/examples/Visualization/ColorSeriesPatches.py b/data/examples/Visualization/ColorSeriesPatches.py deleted file mode 100755 index 4830fbe..0000000 --- a/data/examples/Visualization/ColorSeriesPatches.py +++ /dev/null @@ -1,254 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Produce a HTML page called VTKColorSeriesPatches.html showing the available - color series in vtkColorSeries. - -It also shows how to select the text color based on luminance. -In this case Digital CCIR601 is used which gives less weight to the - red and blue components of a color. - -""" - -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) - - -def main(): - ncpt = HTMLTableMaker() - res = ncpt.MakeHTMLTable() - f = open("VTKColorSeriesPatches.html", "w", newline="\n") - f.write(res) - f.close() - - -class HTMLToFromRGBAColor: - - @staticmethod - def RGBToHTMLColor(rgb): - """ - Convert an [R, G, B] list to #RRGGBB. - :param: rgb - The elements of the array rgb are unsigned chars (0..255). - :return: The html color. - """ - hexcolor = "#" + ''.join(['{:02x}'.format(x) for x in rgb]) - return hexcolor - - @staticmethod - def HTMLColorToRGB(colorString): - """ - Convert #RRGGBB to a [R, G, B] list. - :param: colorString a string in the form: #RRGGBB where RR, GG, BB are hexadecimal. - The elements of the array rgb are unsigned chars (0..255). - :return: The red, green and blue components as a list. - """ - colorString = colorString.strip() - if colorString[0] == '#': - colorString = colorString[1:] - if len(colorString) != 6: - raise ValueError("Input #%s is not in #RRGGBB format" % colorString) - r, g, b = colorString[:2], colorString[2:4], colorString[4:] - r, g, b = [int(n, 16) for n in (r, g, b)] - return [r, g, b] - - @staticmethod - def RGBToLumaCCIR601(rgb): - """ - RGB -> Luma conversion - Digital CCIR601 (gives less weight to the R and B components) - :param: rgb - The elements of the array rgb are unsigned chars (0..255). - :return: The luminance. - """ - Y = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2] - return Y - - -class ColorStructures: - """ - Holds the color series id, name and colors. - """ - - cs_colors = dict() - max_colors = 0 - - def __init__(self): - cs = vtkColorSeries() - sizes = list() - for i in range(0, cs.GetNumberOfColorSchemes()): - cs.SetColorScheme(i) - sizes.append(cs.GetNumberOfColors()) - vc = list() - for j in range(0, cs.GetNumberOfColors()): - vc.append(cs.GetColor(j)) - self.cs_colors[i] = [cs.GetColorSchemeName(), vc] - self.max_colors = max(sizes) - - -class HTMLTableMaker: - """ - This class creates HTML Tables displaying all the colors in - the class vtkNamedColors grouped by various categories. - """ - - def __init__(self): - self.cs = ColorStructures() - self.nc = vtkNamedColors() - self.htmlRGBA = HTMLToFromRGBAColor() - - @staticmethod - def MakeHTMLStyle(): - s = ' \n' - return s - - def MakeHTMLHeader(self): - s = '\n' - s += '\n' - s += '\n' - s += '\n' - s += 'vtkColorSeries\n' - s += self.MakeHTMLStyle() - s += '\n' - return s - - def MakeTableHeader(self): - s = '\n' - s += 'Index\n' - s += 'Name\n' - s += '\n' - s += '\n' - s += '\n' - s += 'Colors in the Series\n' - s += '\n' - return s - - def MakeTD1(self, idx, name): - s = '\n' - s += '' - s += '' + str(idx) + '' - s += '\n' - s += '' - s += '' + name + '' - s += '\n' - s += '\n' - return s - - def MakeTD2(self, rgbs): - s = '\n' - s += '\n' - - cnt = 0 - for p in rgbs: - ss = '{:3d} '.format(cnt) - ss = ss.replace(' ', ' ') - y = self.htmlRGBA.RGBToLumaCCIR601(p) - textColor = '#000000' # Black - if y < 255 / 2.0: - textColor = '#ffffff' # White - s += '' + ss + '\n' - cnt += 1 - if cnt < self.cs.max_colors: - s += '   \n' - s += '\n' - return s - - def MakeTable(self): - res = self.MakeTableHeader() - for idx, v in self.cs.cs_colors.items(): - name = v[0] - res += self.MakeTD1(idx, name) - res += self.MakeTD2(v[1]) - - return res - - def MakeHTMLTable(self): - - res = self.MakeHTMLHeader() - res += '\n' - res += '

Color series available in vtkColorSeries

\n' - res += '\n' - res += self.MakeTable() - res += '
\n' - res += '\n' - return res - - -if __name__ == "__main__": - main() diff --git a/data/examples/Visualization/ColoredAnnotatedCube.md b/data/examples/Visualization/ColoredAnnotatedCube.md deleted file mode 100644 index 5f27a2e..0000000 --- a/data/examples/Visualization/ColoredAnnotatedCube.md +++ /dev/null @@ -1,19 +0,0 @@ -### Description - -This example demonstrates how to color the individual faces of an annotated cube. - -This is based on a very nice example by Rodrigo Figueiredo - in [this discussion](https://discourse.vtk.org/t/colors-of-vtkannotatedcubeactor-faces-with-vtkorientationmarkerwidget/934/1). - -The process is: - -- Create the annotated cube actor using vtkAnnotatedCubeActor. -- Select the names on the faces, text colors and, if needed, any rotations of the text. -- Make the annotated cube transparent. -- Create a cube actor with colored faces. -- Combine the annotated cube actor and cube actor into a prop assembly using vtkPropAssembly. Since the annotated cube and the cube are the same size you get an assembly with colored cube faces and the requisite text. -- Create a vtkOrientationMarkerWidget and set the set the orientation marker to be the prop assembly. - -The function `MakeAnnotatedCubeActor` generates the annotated cube with different colored faces which is then added to a vtkOrientationMarkerWidget. - -The colored annotated cube is then placed in the lower left of the view (default). Additionally, a vtkOrientationMarkerWidget containing an axes actor has been added to the lower right of the view. diff --git a/data/examples/Visualization/ColoredAnnotatedCube.py b/data/examples/Visualization/ColoredAnnotatedCube.py deleted file mode 100755 index b5d53bd..0000000 --- a/data/examples/Visualization/ColoredAnnotatedCube.py +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import ( - vtkLookupTable, - vtkUnsignedCharArray -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkBandedPolyDataContourFilter -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource -) -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import ( - vtkAnnotatedCubeActor, - vtkAxesActor -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropAssembly, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # Basic stuff setup - # Set up the renderer, window, and interactor - colors = vtkNamedColors() - - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(640, 480) - iRen = vtkRenderWindowInteractor() - iRen.SetRenderWindow(renWin) - - # Create a cone with an elliptical base whose major axis is in the - # X-direction. - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetRadius(5.0) - coneSource.SetHeight(15.0) - coneSource.SetDirection(0, 1, 0) - coneSource.SetResolution(60) - coneSource.Update() - - transform = vtkTransform() - transform.Scale(1.0, 1.0, 0.75) - - transF = vtkTransformPolyDataFilter() - transF.SetInputConnection(coneSource.GetOutputPort()) - transF.SetTransform(transform) - - bounds = transF.GetOutput().GetBounds() - - elevation = vtkElevationFilter() - elevation.SetInputConnection(transF.GetOutputPort()) - elevation.SetLowPoint(0, bounds[2], 0) - elevation.SetHighPoint(0, bounds[3], 0) - - bandedContours = vtkBandedPolyDataContourFilter() - bandedContours.SetInputConnection(elevation.GetOutputPort()) - bandedContours.SetScalarModeToValue() - bandedContours.GenerateContourEdgesOn() - bandedContours.GenerateValues(11, elevation.GetScalarRange()) - - # Make a lookup table using a color series. - colorSeries = vtkColorSeries() - colorSeries.SetColorScheme(vtkColorSeries.BREWER_DIVERGING_SPECTRAL_11) - - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, vtkColorSeries.ORDINAL) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(bandedContours.GetOutputPort()) - coneMapper.SetScalarRange(elevation.GetScalarRange()) - coneMapper.SetLookupTable(lut) - - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # Contouring - contourLineMapper = vtkPolyDataMapper() - contourLineMapper.SetInputData(bandedContours.GetContourEdgesOutput()) - contourLineMapper.SetScalarRange(elevation.GetScalarRange()) - contourLineMapper.SetResolveCoincidentTopologyToPolygonOffset() - - contourLineActor = vtkActor() - contourLineActor.SetMapper(contourLineMapper) - contourLineActor.GetProperty().SetColor( - colors.GetColor3d('DimGray')) - - # Set up the Orientation Marker Widget. - prop_assembly = MakeAnnotatedCubeActor(colors) - om1 = vtkOrientationMarkerWidget() - om1.SetOrientationMarker(prop_assembly) - om1.SetInteractor(iRen) - om1.SetDefaultRenderer(ren) - om1.On() - om1.InteractiveOn() - - xyzLabels = ['X', 'Y', 'Z'] - scale = [1.0, 1.0, 1.0] - axes = MakeAxesActor(scale, xyzLabels) - - om2 = vtkOrientationMarkerWidget() - om2.SetOrientationMarker(axes) - # Position lower right in the viewport. - om2.SetViewport(0.8, 0, 1.0, 0.2) - om2.SetInteractor(iRen) - om2.EnabledOn() - om2.InteractiveOn() - - ren.AddActor(coneActor) - ren.AddActor(contourLineActor) - ren.SetBackground2(colors.GetColor3d('RoyalBlue')) - ren.SetBackground(colors.GetColor3d('MistyRose')) - ren.GradientBackgroundOn() - ren.GetActiveCamera().Azimuth(45) - ren.GetActiveCamera().Pitch(-22.5) - ren.ResetCamera() - - renWin.SetSize(600, 600) - renWin.Render() - renWin.SetWindowName('ColoredAnnotatedCube') - renWin.Render() - iRen.Start() - - -def MakeAnnotatedCubeActor(colors): - # Annotated Cube setup - annotated_cube = vtkAnnotatedCubeActor() - annotated_cube.SetFaceTextScale(0.366667) - - # Anatomic labeling - annotated_cube.SetXPlusFaceText('X+') - annotated_cube.SetXMinusFaceText('X-') - annotated_cube.SetYPlusFaceText('Y+') - annotated_cube.SetYMinusFaceText('Y-') - annotated_cube.SetZPlusFaceText('Z+') - annotated_cube.SetZMinusFaceText('Z-') - - # Change the vector text colors - annotated_cube.GetTextEdgesProperty().SetColor( - colors.GetColor3d('Black')) - annotated_cube.GetTextEdgesProperty().SetLineWidth(1) - - annotated_cube.GetXPlusFaceProperty().SetColor( - colors.GetColor3d('Turquoise')) - annotated_cube.GetXMinusFaceProperty().SetColor( - colors.GetColor3d('Turquoise')) - annotated_cube.GetYPlusFaceProperty().SetColor( - colors.GetColor3d('Mint')) - annotated_cube.GetYMinusFaceProperty().SetColor( - colors.GetColor3d('Mint')) - annotated_cube.GetZPlusFaceProperty().SetColor( - colors.GetColor3d('Tomato')) - annotated_cube.GetZMinusFaceProperty().SetColor( - colors.GetColor3d('Tomato')) - annotated_cube.SetXFaceTextRotation(90) - annotated_cube.SetYFaceTextRotation(180) - annotated_cube.SetZFaceTextRotation(-90) - # Make the annotated cube transparent - annotated_cube.GetCubeProperty().SetOpacity(0) - - # Colored faces cube setup - cube_source = vtkCubeSource() - cube_source.Update() - - face_colors = vtkUnsignedCharArray() - face_colors.SetNumberOfComponents(3) - face_x_plus = colors.GetColor3ub('Red') - face_x_minus = colors.GetColor3ub('Green') - face_y_plus = colors.GetColor3ub('Blue') - face_y_minus = colors.GetColor3ub('Yellow') - face_z_plus = colors.GetColor3ub('Cyan') - face_z_minus = colors.GetColor3ub('Magenta') - face_colors.InsertNextTypedTuple(face_x_minus) - face_colors.InsertNextTypedTuple(face_x_plus) - face_colors.InsertNextTypedTuple(face_y_minus) - face_colors.InsertNextTypedTuple(face_y_plus) - face_colors.InsertNextTypedTuple(face_z_minus) - face_colors.InsertNextTypedTuple(face_z_plus) - - cube_source.GetOutput().GetCellData().SetScalars(face_colors) - cube_source.Update() - - cube_mapper = vtkPolyDataMapper() - cube_mapper.SetInputData(cube_source.GetOutput()) - cube_mapper.Update() - - cube_actor = vtkActor() - cube_actor.SetMapper(cube_mapper) - - # Assemble the colored cube and annotated cube texts into a composite prop. - prop_assembly = vtkPropAssembly() - prop_assembly.AddPart(annotated_cube) - prop_assembly.AddPart(cube_actor) - return prop_assembly - - -def MakeAxesActor(scale, xyzLabels): - axes = vtkAxesActor() - axes.SetScale(scale[0], scale[1], scale[2]) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyzLabels[0]) - axes.SetYAxisLabelText(xyzLabels[1]) - axes.SetZAxisLabelText(xyzLabels[2]) - axes.SetCylinderRadius(0.5 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.025 * axes.GetConeRadius()) - axes.SetSphereRadius(1.5 * axes.GetSphereRadius()) - tprop = axes.GetXAxisCaptionActor2D().GetCaptionTextProperty() - tprop.ItalicOn() - tprop.ShadowOn() - tprop.SetFontFamilyToTimes() - # Use the same text properties on the other two axes. - axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - return axes - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ComplexV.md b/data/examples/Visualization/ComplexV.md deleted file mode 100644 index 97d7868..0000000 --- a/data/examples/Visualization/ComplexV.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -ComplexV from the VTK Textbook. The original example was written in TCL. - -The example shows 167,000 3D vectors (using oriented and scaled lines) in the region of the human carotid artery. The larger vectors lie inside the arteries, the smaller vectors lie outside the arteries and are randomly oriented (measurement error) but small in magnitude. Clearly the details of the vector field are not discernible from this image. - -!!! info - See [Figure 6-13](../../../VTKBook/06Chapter6/#Figure%206-13) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/ComplexV.py b/data/examples/Visualization/ComplexV.py deleted file mode 100755 index 4495780..0000000 --- a/data/examples/Visualization/ComplexV.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkHedgeHog -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - hhog = vtkHedgeHog() - hhog.SetInputConnection(reader.GetOutputPort()) - hhog.SetScaleFactor(0.3) - - lut = vtkLookupTable() - # lut.SetHueRange(.667, 0.0) - lut.Build() - - hhogMapper = vtkPolyDataMapper() - hhogMapper.SetInputConnection(hhog.GetOutputPort()) - hhogMapper.SetScalarRange(50, 550) - hhogMapper.SetLookupTable(lut) - - hhogActor = vtkActor() - hhogActor.SetMapper(hhogMapper) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() - aRenderWindow.AddRenderer(aRenderer) - anInteractor = vtkRenderWindowInteractor() - anInteractor.SetRenderWindow(aRenderWindow) - aRenderWindow.SetSize(640, 480) - aRenderWindow.SetWindowName('ComplexV') - - aRenderer.AddActor(outlineActor) - aRenderer.AddActor(hhogActor) - - aRenderer.SetBackground(colors.GetColor3d('SlateGray')) - - # Generate an interesting view. - - aRenderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - aRenderer.GetActiveCamera().SetPosition(1, 0, 0) - aRenderer.GetActiveCamera().SetViewUp(0, 0, 1) - aRenderer.ResetCamera() - - aRenderer.GetActiveCamera().Azimuth(60) - aRenderer.GetActiveCamera().Elevation(30) - aRenderer.GetActiveCamera().Dolly(1.1) - aRenderer.ResetCameraClippingRange() - - aRenderWindow.Render() - - # Interact with the data. - anInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Vector visualization techniques.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='carotid.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CreateColorSeriesDemo.md b/data/examples/Visualization/CreateColorSeriesDemo.md deleted file mode 100644 index 45c13ee..0000000 --- a/data/examples/Visualization/CreateColorSeriesDemo.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -This example demonstrates how to create a custom vtkColorSeries. The examples produces a vtkLookupTable explicitly. The vtkLookupTable is populated with colors from the vtkColorSeries using GetColorRepeating, since the size of the vtkLookupTable may be larger than the colors in the vtkColorSeries. - -A vtkPlaneSource generates the geometry. The vtkCellData is populated with increasing integers starting at 1. - -Ten different color series are generated from VTK color names in vtkNamedColors. The first argument of the example is one of "Blue", "Brown", "Red", "Orange", "White", "Grey", "Magenta", "Cyan", "Yellow" and "Green". - -The colors are added from left to right, row by row, from the bottom left-hand corner of the table. diff --git a/data/examples/Visualization/CreateColorSeriesDemo.py b/data/examples/Visualization/CreateColorSeriesDemo.py deleted file mode 100755 index 8c4c961..0000000 --- a/data/examples/Visualization/CreateColorSeriesDemo.py +++ /dev/null @@ -1,506 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkLookupTable -) -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'how to create a custom vtkColorSeries.' - epilogue = ''' -A vtkLookupTable is explicitly produced, it is populated with colors from the vtkColorSeries - using GetColorRepeating, since the size of the vtkLookupTable may be larger than the - colors in the vtkColorSeries. - -Ten different color series are generated from VTK color names in vtkNamedColors. -Choose from one of: Blue, Brown, Red, Orange, White, Grey, Magenta, Cyan, Yellow and Green. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('seriesName', default='Red', nargs='?', - help='The name of the color series to use (default is Red).') - args = parser.parse_args() - return args.seriesName - - -def CreateLookupTableVTKBlue(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKBlueColors') - - myColors.AddColor(nc.GetColor3ub('alice_blue')) - myColors.AddColor(nc.GetColor3ub('blue')) - myColors.AddColor(nc.GetColor3ub('blue_light')) - myColors.AddColor(nc.GetColor3ub('blue_medium')) - myColors.AddColor(nc.GetColor3ub('cadet')) - myColors.AddColor(nc.GetColor3ub('cobalt')) - myColors.AddColor(nc.GetColor3ub('cornflower')) - myColors.AddColor(nc.GetColor3ub('cerulean')) - myColors.AddColor(nc.GetColor3ub('dodger_blue')) - myColors.AddColor(nc.GetColor3ub('indigo')) - myColors.AddColor(nc.GetColor3ub('manganese_blue')) - myColors.AddColor(nc.GetColor3ub('midnight_blue')) - myColors.AddColor(nc.GetColor3ub('navy')) - myColors.AddColor(nc.GetColor3ub('peacock')) - myColors.AddColor(nc.GetColor3ub('powder_blue')) - myColors.AddColor(nc.GetColor3ub('royal_blue')) - myColors.AddColor(nc.GetColor3ub('slate_blue')) - myColors.AddColor(nc.GetColor3ub('slate_blue_dark')) - myColors.AddColor(nc.GetColor3ub('slate_blue_light')) - myColors.AddColor(nc.GetColor3ub('slate_blue_medium')) - myColors.AddColor(nc.GetColor3ub('sky_blue')) - myColors.AddColor(nc.GetColor3ub('sky_blue_deep')) - myColors.AddColor(nc.GetColor3ub('sky_blue_light')) - myColors.AddColor(nc.GetColor3ub('steel_blue')) - myColors.AddColor(nc.GetColor3ub('steel_blue_light')) - myColors.AddColor(nc.GetColor3ub('turquoise_blue')) - myColors.AddColor(nc.GetColor3ub('ultramarine')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKBrown(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKBrownColors') - - myColors.AddColor(nc.GetColor3ub('beige')) - myColors.AddColor(nc.GetColor3ub('brown')) - myColors.AddColor(nc.GetColor3ub('brown_madder')) - myColors.AddColor(nc.GetColor3ub('brown_ochre')) - myColors.AddColor(nc.GetColor3ub('burlywood')) - myColors.AddColor(nc.GetColor3ub('burnt_sienna')) - myColors.AddColor(nc.GetColor3ub('burnt_umber')) - myColors.AddColor(nc.GetColor3ub('chocolate')) - myColors.AddColor(nc.GetColor3ub('deep_ochre')) - myColors.AddColor(nc.GetColor3ub('flesh')) - myColors.AddColor(nc.GetColor3ub('flesh_ochre')) - myColors.AddColor(nc.GetColor3ub('gold_ochre')) - myColors.AddColor(nc.GetColor3ub('greenish_umber')) - myColors.AddColor(nc.GetColor3ub('khaki')) - myColors.AddColor(nc.GetColor3ub('khaki_dark')) - myColors.AddColor(nc.GetColor3ub('light_beige')) - myColors.AddColor(nc.GetColor3ub('peru')) - myColors.AddColor(nc.GetColor3ub('rosy_brown')) - myColors.AddColor(nc.GetColor3ub('raw_sienna')) - myColors.AddColor(nc.GetColor3ub('raw_umber')) - myColors.AddColor(nc.GetColor3ub('sepia')) - myColors.AddColor(nc.GetColor3ub('sienna')) - myColors.AddColor(nc.GetColor3ub('saddle_brown')) - myColors.AddColor(nc.GetColor3ub('sandy_brown')) - myColors.AddColor(nc.GetColor3ub('tan')) - myColors.AddColor(nc.GetColor3ub('van_dyke_brown')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKRed(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKRedColors') - - myColors.AddColor(nc.GetColor3ub('alizarin_crimson')) - myColors.AddColor(nc.GetColor3ub('brick')) - myColors.AddColor(nc.GetColor3ub('cadmium_red_deep')) - myColors.AddColor(nc.GetColor3ub('coral')) - myColors.AddColor(nc.GetColor3ub('coral_light')) - myColors.AddColor(nc.GetColor3ub('deep_pink')) - myColors.AddColor(nc.GetColor3ub('english_red')) - myColors.AddColor(nc.GetColor3ub('firebrick')) - myColors.AddColor(nc.GetColor3ub('geranium_lake')) - myColors.AddColor(nc.GetColor3ub('hot_pink')) - myColors.AddColor(nc.GetColor3ub('indian_red')) - myColors.AddColor(nc.GetColor3ub('light_salmon')) - myColors.AddColor(nc.GetColor3ub('madder_lake_deep')) - myColors.AddColor(nc.GetColor3ub('maroon')) - myColors.AddColor(nc.GetColor3ub('pink')) - myColors.AddColor(nc.GetColor3ub('pink_light')) - myColors.AddColor(nc.GetColor3ub('raspberry')) - myColors.AddColor(nc.GetColor3ub('red')) - myColors.AddColor(nc.GetColor3ub('rose_madder')) - myColors.AddColor(nc.GetColor3ub('salmon')) - myColors.AddColor(nc.GetColor3ub('tomato')) - myColors.AddColor(nc.GetColor3ub('venetian_red')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKOrange(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKOrangeColors') - - myColors.AddColor(nc.GetColor3ub('cadmium_orange')) - myColors.AddColor(nc.GetColor3ub('cadmium_red_light')) - myColors.AddColor(nc.GetColor3ub('carrot')) - myColors.AddColor(nc.GetColor3ub('dark_orange')) - myColors.AddColor(nc.GetColor3ub('mars_orange')) - myColors.AddColor(nc.GetColor3ub('mars_yellow')) - myColors.AddColor(nc.GetColor3ub('orange')) - myColors.AddColor(nc.GetColor3ub('orange_red')) - myColors.AddColor(nc.GetColor3ub('yellow_ochre')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKWhite(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKWhiteColors') - - myColors.AddColor(nc.GetColor3ub('antique_white')) - myColors.AddColor(nc.GetColor3ub('azure')) - myColors.AddColor(nc.GetColor3ub('bisque')) - myColors.AddColor(nc.GetColor3ub('blanched_almond')) - myColors.AddColor(nc.GetColor3ub('cornsilk')) - myColors.AddColor(nc.GetColor3ub('eggshell')) - myColors.AddColor(nc.GetColor3ub('floral_white')) - myColors.AddColor(nc.GetColor3ub('gainsboro')) - myColors.AddColor(nc.GetColor3ub('ghost_white')) - myColors.AddColor(nc.GetColor3ub('honeydew')) - myColors.AddColor(nc.GetColor3ub('ivory')) - myColors.AddColor(nc.GetColor3ub('lavender')) - myColors.AddColor(nc.GetColor3ub('lavender_blush')) - myColors.AddColor(nc.GetColor3ub('lemon_chiffon')) - myColors.AddColor(nc.GetColor3ub('linen')) - myColors.AddColor(nc.GetColor3ub('mint_cream')) - myColors.AddColor(nc.GetColor3ub('misty_rose')) - myColors.AddColor(nc.GetColor3ub('moccasin')) - myColors.AddColor(nc.GetColor3ub('navajo_white')) - myColors.AddColor(nc.GetColor3ub('old_lace')) - myColors.AddColor(nc.GetColor3ub('papaya_whip')) - myColors.AddColor(nc.GetColor3ub('peach_puff')) - myColors.AddColor(nc.GetColor3ub('seashell')) - myColors.AddColor(nc.GetColor3ub('snow')) - myColors.AddColor(nc.GetColor3ub('thistle')) - myColors.AddColor(nc.GetColor3ub('titanium_white')) - myColors.AddColor(nc.GetColor3ub('wheat')) - myColors.AddColor(nc.GetColor3ub('white')) - myColors.AddColor(nc.GetColor3ub('white_smoke')) - myColors.AddColor(nc.GetColor3ub('zinc_white')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKGrey(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKGreyColors') - - myColors.AddColor(nc.GetColor3ub('cold_grey')) - myColors.AddColor(nc.GetColor3ub('dim_grey')) - myColors.AddColor(nc.GetColor3ub('grey')) - myColors.AddColor(nc.GetColor3ub('light_grey')) - myColors.AddColor(nc.GetColor3ub('slate_grey')) - myColors.AddColor(nc.GetColor3ub('slate_grey_dark')) - myColors.AddColor(nc.GetColor3ub('slate_grey_light')) - myColors.AddColor(nc.GetColor3ub('warm_grey')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKMagenta(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKMagentaColors') - - myColors.AddColor(nc.GetColor3ub('blue_violet')) - myColors.AddColor(nc.GetColor3ub('cobalt_violet_deep')) - myColors.AddColor(nc.GetColor3ub('magenta')) - myColors.AddColor(nc.GetColor3ub('orchid')) - myColors.AddColor(nc.GetColor3ub('orchid_dark')) - myColors.AddColor(nc.GetColor3ub('orchid_medium')) - myColors.AddColor(nc.GetColor3ub('permanent_red_violet')) - myColors.AddColor(nc.GetColor3ub('plum')) - myColors.AddColor(nc.GetColor3ub('purple')) - myColors.AddColor(nc.GetColor3ub('purple_medium')) - myColors.AddColor(nc.GetColor3ub('ultramarine_violet')) - myColors.AddColor(nc.GetColor3ub('violet')) - myColors.AddColor(nc.GetColor3ub('violet_dark')) - myColors.AddColor(nc.GetColor3ub('violet_red')) - myColors.AddColor(nc.GetColor3ub('violet_red_medium')) - myColors.AddColor(nc.GetColor3ub('violet_red_pale')) - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKCyan(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKCyanColors') - - myColors.AddColor(nc.GetColor3ub('aquamarine')) - myColors.AddColor(nc.GetColor3ub('aquamarine_medium')) - myColors.AddColor(nc.GetColor3ub('cyan')) - myColors.AddColor(nc.GetColor3ub('cyan_white')) - myColors.AddColor(nc.GetColor3ub('turquoise')) - myColors.AddColor(nc.GetColor3ub('turquoise_dark')) - myColors.AddColor(nc.GetColor3ub('turquoise_medium')) - myColors.AddColor(nc.GetColor3ub('turquoise_pale')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKYellow(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKYellowColors') - - myColors.AddColor(nc.GetColor3ub('aureoline_yellow')) - myColors.AddColor(nc.GetColor3ub('banana')) - myColors.AddColor(nc.GetColor3ub('cadmium_lemon')) - myColors.AddColor(nc.GetColor3ub('cadmium_yellow')) - myColors.AddColor(nc.GetColor3ub('cadmium_yellow_light')) - myColors.AddColor(nc.GetColor3ub('gold')) - myColors.AddColor(nc.GetColor3ub('goldenrod')) - myColors.AddColor(nc.GetColor3ub('goldenrod_dark')) - myColors.AddColor(nc.GetColor3ub('goldenrod_light')) - myColors.AddColor(nc.GetColor3ub('goldenrod_pale')) - myColors.AddColor(nc.GetColor3ub('light_goldenrod')) - myColors.AddColor(nc.GetColor3ub('melon')) - myColors.AddColor(nc.GetColor3ub('naples_yellow_deep')) - myColors.AddColor(nc.GetColor3ub('yellow')) - myColors.AddColor(nc.GetColor3ub('yellow_light')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def CreateLookupTableVTKGreen(size): - nc = vtkNamedColors() - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKGreenColors') - - myColors.AddColor(nc.GetColor3ub('chartreuse')) - myColors.AddColor(nc.GetColor3ub('chrome_oxide_green')) - myColors.AddColor(nc.GetColor3ub('cinnabar_green')) - myColors.AddColor(nc.GetColor3ub('cobalt_green')) - myColors.AddColor(nc.GetColor3ub('emerald_green')) - myColors.AddColor(nc.GetColor3ub('forest_green')) - myColors.AddColor(nc.GetColor3ub('green')) - myColors.AddColor(nc.GetColor3ub('green_dark')) - myColors.AddColor(nc.GetColor3ub('green_pale')) - myColors.AddColor(nc.GetColor3ub('green_yellow')) - myColors.AddColor(nc.GetColor3ub('lawn_green')) - myColors.AddColor(nc.GetColor3ub('lime_green')) - myColors.AddColor(nc.GetColor3ub('mint')) - myColors.AddColor(nc.GetColor3ub('olive')) - myColors.AddColor(nc.GetColor3ub('olive_drab')) - myColors.AddColor(nc.GetColor3ub('olive_green_dark')) - myColors.AddColor(nc.GetColor3ub('permanent_green')) - myColors.AddColor(nc.GetColor3ub('sap_green')) - myColors.AddColor(nc.GetColor3ub('sea_green')) - myColors.AddColor(nc.GetColor3ub('sea_green_dark')) - myColors.AddColor(nc.GetColor3ub('sea_green_medium')) - myColors.AddColor(nc.GetColor3ub('sea_green_light')) - myColors.AddColor(nc.GetColor3ub('spring_green')) - myColors.AddColor(nc.GetColor3ub('spring_green_medium')) - myColors.AddColor(nc.GetColor3ub('terre_verte')) - myColors.AddColor(nc.GetColor3ub('viridian_light')) - myColors.AddColor(nc.GetColor3ub('yellow_green')) - - numberOfColors = myColors.GetNumberOfColors() - print('Number of colors:', numberOfColors) - - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) - for i in range(lut.GetNumberOfTableValues()): - color = myColors.GetColorRepeating(i) - c = [color.GetRed(), color.GetGreen(), color.GetBlue(), 255] - lut.SetTableValue(i, [x / 255.0 for x in c]) - return lut - - -def main(): - seriesName = get_program_parameters() - seriesName = seriesName.capitalize() - available_color_series = ['Blue', 'Brown', 'Red', 'Orange', 'White', 'Grey', 'Magenta', 'Cyan', 'Yellow', 'Green'] - if seriesName not in available_color_series: - print('Available color maps are:', ", ".join(available_color_series)) - return - - colors = vtkNamedColors() - - # Provide some geometry. - xResolution = 6 - yResolution = 6 - aPlane = vtkPlaneSource() - aPlane.SetXResolution(xResolution) - aPlane.SetYResolution(yResolution) - size = xResolution * yResolution + 1 - - # Create cell data. - cellData = vtkFloatArray() - for i in range(0, xResolution * yResolution): - cellData.InsertNextValue(i) - aPlane.Update() # Force an update so we can set cell data. - aPlane.GetOutput().GetCellData().SetScalars(cellData) - - # Get the lookup table. - lut = eval('CreateLookupTableVTK' + seriesName + '(size)') - - # Set up the actor and mapper. - mapper = vtkPolyDataMapper() - mapper.SetLookupTable(lut) - mapper.SetInputConnection(aPlane.GetOutputPort()) - mapper.SetScalarModeToUseCellData() - mapper.SetScalarRange(0, size) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - - # Setup render window, renderer, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('CreateColorSeriesDemo') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CubeAxesActor.py b/data/examples/Visualization/CubeAxesActor.py deleted file mode 100755 index f88d7b8..0000000 --- a/data/examples/Visualization/CubeAxesActor.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSuperquadricSource -from vtkmodules.vtkRenderingAnnotation import vtkCubeAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - backgroundColor = colors.GetColor3d("DarkSlateGray") - actorColor = colors.GetColor3d("Tomato") - axis1Color = colors.GetColor3d("Salmon") - axis2Color = colors.GetColor3d("PaleGreen") - axis3Color = colors.GetColor3d("LightSkyBlue") - - # Create a superquadric - superquadricSource = vtkSuperquadricSource() - superquadricSource.SetPhiRoundness(3.1) - superquadricSource.SetThetaRoundness(1.0) - superquadricSource.Update() # needed to GetBounds later - - renderer = vtkRenderer() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(superquadricSource.GetOutputPort()) - - superquadricActor = vtkActor() - superquadricActor.SetMapper(mapper) - superquadricActor.GetProperty().SetDiffuseColor(actorColor) - superquadricActor.GetProperty().SetDiffuse(.7) - superquadricActor.GetProperty().SetSpecular(.7) - superquadricActor.GetProperty().SetSpecularPower(50.0) - - cubeAxesActor = vtkCubeAxesActor() - cubeAxesActor.SetUseTextActor3D(1) - cubeAxesActor.SetBounds(superquadricSource.GetOutput().GetBounds()) - cubeAxesActor.SetCamera(renderer.GetActiveCamera()) - cubeAxesActor.GetTitleTextProperty(0).SetColor(axis1Color) - cubeAxesActor.GetTitleTextProperty(0).SetFontSize(48) - cubeAxesActor.GetLabelTextProperty(0).SetColor(axis1Color) - - cubeAxesActor.GetTitleTextProperty(1).SetColor(axis2Color) - cubeAxesActor.GetLabelTextProperty(1).SetColor(axis2Color) - - cubeAxesActor.GetTitleTextProperty(2).SetColor(axis3Color) - cubeAxesActor.GetLabelTextProperty(2).SetColor(axis3Color) - - cubeAxesActor.DrawXGridlinesOn() - cubeAxesActor.DrawYGridlinesOn() - cubeAxesActor.DrawZGridlinesOn() - cubeAxesActor.SetGridLineLocation(cubeAxesActor.VTK_GRID_LINES_FURTHEST) - - cubeAxesActor.XAxisMinorTickVisibilityOff() - cubeAxesActor.YAxisMinorTickVisibilityOff() - cubeAxesActor.ZAxisMinorTickVisibilityOff() - - cubeAxesActor.SetFlyModeToStaticEdges() - renderer.AddActor(cubeAxesActor) - renderer.AddActor(superquadricActor) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - renderer.ResetCamera() - renderer.SetBackground(backgroundColor) - - renderWindow = vtkRenderWindow() - - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('CubeAxesActor') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderWindow.Render() - renderer.GetActiveCamera().Zoom(0.8) - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/CurvatureBandsWithGlyphs.md b/data/examples/Visualization/CurvatureBandsWithGlyphs.md deleted file mode 100644 index 7987253..0000000 --- a/data/examples/Visualization/CurvatureBandsWithGlyphs.md +++ /dev/null @@ -1,30 +0,0 @@ -### Description - -In this example we are coloring the surface by partitioning the gaussian curvature into bands and using arrows to display the normals on the surface. - -Rather beautiful surfaces are generated. - -The banded contour filter and an indexed lookup table are used to generate the curvature bands on the surface. To further enhance the surface, the surface normals are glyphed and colored by elevation using a diverging lookup table. - -Note that: - -- If the regions on a surface have zero Gaussian curvature, then they can be flattened into a plane with no distortion, and the geometry of the region is Euclidean geometry. - -- If the regions on a surface have positive Gaussian curvature, then the geometry of the surface is spherical geometry. - -- If the regions on the surface have a negative Gaussian curvature, then the geometry of the surface is hyperbolic geometry. - -In the above image you can see that the random hills incorporate all of these geometries. - -The surface selected is the parametric random hills surface. The problem with the random hills surface is: - -- Most of the gaussian curvatures will lie in the range -1 to 0.2 (say) with a few large values say 20 to 40 at the peaks of the hills. -- The edges of the random hills surface also have large irregular values so we need to handle these also. In order to fix this, a function is provided to adjust the edges. - -So we need to manually generate custom bands to group the curvatures. The bands selected in the examples show that the surface is mostly planar with some hyperbolic regions (saddle points) and some spherical regions. - -Feel free to experiment with different color schemes and/or the other sources from the parametric function group or the torus etc. - -You will usually need to adjust the parameters for `maskPts`, `arrow` and `glyph` for a nice appearance. - -A histogram of the frequencies is also output to the console. This is useful if you want to get an idea of the distribution of the scalars in each band. diff --git a/data/examples/Visualization/CurvatureBandsWithGlyphs.py b/data/examples/Visualization/CurvatureBandsWithGlyphs.py deleted file mode 100755 index 3d07c3a..0000000 --- a/data/examples/Visualization/CurvatureBandsWithGlyphs.py +++ /dev/null @@ -1,1077 +0,0 @@ -#!/usr/bin/env python - -import math - -import numpy as np -from vtkmodules.numpy_interface import dataset_adapter as dsa -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - VTK_DOUBLE, - vtkDoubleArray, - vtkFloatArray, - vtkIdList, - vtkLookupTable, - vtkPoints, - vtkVariant, - vtkVariantArray, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkDelaunay2D, - vtkElevationFilter, - vtkFeatureEdges, - vtkGlyph3D, - vtkIdFilter, - vtkMaskPoints, - vtkPolyDataNormals, - vtkReverseSense, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import ( - vtkCurvatures, - vtkTransformPolyDataFilter -) -from vtkmodules.vtkFiltersModeling import vtkBandedPolyDataContourFilter -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkParametricFunctionSource, - vtkPlaneSource, - vtkSphereSource, - vtkSuperquadricSource -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtk.util import numpy_support - - -def main(argv): - # ------------------------------------------------------------ - # Create the surface, lookup tables, contour filter etc. - # ------------------------------------------------------------ - # desired_surface = 'Hills' - # desired_surface = 'ParametricTorus' - # desired_surface = 'Plane' - desired_surface = 'RandomHills' - # desired_surface = 'Sphere' - # desired_surface = 'Torus' - source = get_source(desired_surface) - if not source: - print('The surface is not available.') - return - - # The length of the normal arrow glyphs. - scale_factor = 1.0 - if desired_surface == 'Hills': - scale_factor = 0.5 - elif desired_surface == 'Sphere': - scale_factor = 2.0 - print(desired_surface) - - gaussian_curvature = True - if gaussian_curvature: - curvature = 'Gauss_Curvature' - else: - curvature = 'Mean_Curvature' - - cc = vtkCurvatures() - cc.SetInputData(source) - needs_adjusting = ['Hills', 'ParametricTorus', 'Plane', 'RandomHills', 'Torus'] - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() - if desired_surface in needs_adjusting: - adjust_edge_curvatures(cc.GetOutput(), curvature) - if desired_surface == 'Plane': - constrain_curvatures(cc.GetOutput(), curvature, 0.0, 0.0) - if desired_surface == 'Sphere': - # Gaussian curvature is 1/r^2 - constrain_curvatures(cc.GetOutput(), curvature, 4.0, 4.0) - else: - cc.SetCurvatureTypeToMean() - cc.Update() - if desired_surface in needs_adjusting: - adjust_edge_curvatures(cc.GetOutput(), curvature) - if desired_surface == 'Plane': - constrain_curvatures(cc.GetOutput(), curvature, 0.0, 0.0) - if desired_surface == 'Sphere': - # Mean curvature is 1/r - constrain_curvatures(cc.GetOutput(), curvature, 2.0, 2.0) - - cc.GetOutput().GetPointData().SetActiveScalars(curvature) - scalar_range_curvatures = cc.GetOutput().GetPointData().GetScalars(curvature).GetRange() - scalar_range_elevation = cc.GetOutput().GetPointData().GetScalars('Elevation').GetRange() - - lut = get_categorical_lut() - lut1 = get_diverging_lut() - lut.SetTableRange(scalar_range_curvatures) - lut1.SetTableRange(scalar_range_elevation) - number_of_bands = lut.GetNumberOfTableValues() - bands = get_bands(scalar_range_curvatures, number_of_bands, 10) - if desired_surface == 'RandomHills': - # These are my custom bands. - # Generated by first running: - # bands = get_bands(scalar_range_curvatures, number_of_bands, False) - # then: - # freq = frequencies(bands, src) - # print_bands_frequencies(bands, freq) - # Finally using the output to create this table: - # my_bands = [ - # [-0.630, -0.190], [-0.190, -0.043], [-0.043, -0.0136], - # [-0.0136, 0.0158], [0.0158, 0.0452], [0.0452, 0.0746], - # [0.0746, 0.104], [0.104, 0.251], [0.251, 1.131]] - # This demonstrates that the gaussian curvature of the surface - # is mostly planar with some hyperbolic regions (saddle points) - # and some spherical regions. - my_bands = [ - [-0.630, -0.190], [-0.190, -0.043], [-0.043, 0.0452], [0.0452, 0.0746], - [0.0746, 0.104], [0.104, 0.251], [0.251, 1.131]] - # Comment this out if you want to see how allocating - # equally spaced bands works. - bands = get_custom_bands(scalar_range_curvatures, number_of_bands, my_bands) - # Adjust the number of table values - lut.SetNumberOfTableValues(len(bands)) - elif desired_surface == 'Hills': - my_bands = [ - [-2.104, -0.15], [-0.15, -0.1], [-0.1, -0.05], - [-0.05, -0.02], [-0.02, -0.005], [-0.005, -0.0005], - [-0.0005, 0.0005], [0.0005, 0.09], [0.09, 4.972]] - # Comment this out if you want to see how allocating - # equally spaced bands works. - bands = get_custom_bands(scalar_range_curvatures, number_of_bands, my_bands) - # Adjust the number of table values - lut.SetNumberOfTableValues(len(bands)) - - # Let's do a frequency table. - # The number of scalars in each band. - freq = get_frequencies(bands, cc.GetOutput()) - bands, freq = adjust_ranges(bands, freq) - print_bands_frequencies(bands, freq) - - lut.SetTableRange(scalar_range_curvatures) - lut.SetNumberOfTableValues(len(bands)) - - # We will use the midpoint of the band as the label. - labels = [] - for k in bands: - labels.append('{:4.2f}'.format(bands[k][1])) - - # Annotate - values = vtkVariantArray() - for i in range(len(labels)): - values.InsertNextValue(vtkVariant(labels[i])) - for i in range(values.GetNumberOfTuples()): - lut.SetAnnotation(i, values.GetValue(i).ToString()) - - # Create a lookup table with the colors reversed. - lutr = reverse_lut(lut) - - # Create the contour bands. - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputData(cc.GetOutput()) - # Use either the minimum or maximum value for each band. - for k in bands: - bcf.SetValue(k, bands[k][2]) - # We will use an indexed lookup table. - bcf.SetScalarModeToIndex() - bcf.GenerateContourEdgesOn() - - # Generate the glyphs on the original surface. - glyph = get_glyphs(cc.GetOutput(), scale_factor, False) - - # ------------------------------------------------------------ - # Create the mappers and actors - # ------------------------------------------------------------ - - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [179, 204, 255, 255]) - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - src_mapper = vtkPolyDataMapper() - src_mapper.SetInputConnection(bcf.GetOutputPort()) - src_mapper.SetScalarRange(scalar_range_curvatures) - src_mapper.SetLookupTable(lut) - src_mapper.SetScalarModeToUseCellData() - - src_actor = vtkActor() - src_actor.SetMapper(src_mapper) - - # Create contour edges - edge_mapper = vtkPolyDataMapper() - edge_mapper.SetInputData(bcf.GetContourEdgesOutput()) - edge_mapper.SetResolveCoincidentTopologyToPolygonOffset() - - edge_actor = vtkActor() - edge_actor.SetMapper(edge_mapper) - edge_actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - glyph_mapper = vtkPolyDataMapper() - glyph_mapper.SetInputConnection(glyph.GetOutputPort()) - glyph_mapper.SetScalarModeToUsePointFieldData() - glyph_mapper.SetColorModeToMapScalars() - glyph_mapper.ScalarVisibilityOn() - glyph_mapper.SelectColorArray('Elevation') - # Colour by scalars. - glyph_mapper.SetLookupTable(lut1) - glyph_mapper.SetScalarRange(scalar_range_elevation) - - glyph_actor = vtkActor() - glyph_actor.SetMapper(glyph_mapper) - - window_width = 800 - window_height = 800 - - # Add scalar bars. - scalar_bar = vtkScalarBarActor() - # This LUT puts the lowest value at the top of the scalar bar. - # scalar_bar->SetLookupTable(lut); - # Use this LUT if you want the highest value at the top. - scalar_bar.SetLookupTable(lutr) - scalar_bar.SetTitle(curvature.replace('_', '\n')) - scalar_bar.GetTitleTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.GetLabelTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.GetAnnotationTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 3) - scalar_bar.SetPosition(0.85, 0.05) - - scalar_bar_elev = vtkScalarBarActor() - # This LUT puts the lowest value at the top of the scalar bar. - # scalar_bar_elev->SetLookupTable(lut); - # Use this LUT if you want the highest value at the top. - scalar_bar_elev.SetLookupTable(lut1) - scalar_bar_elev.SetTitle('Elevation') - scalar_bar_elev.GetTitleTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar_elev.GetLabelTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar_elev.GetAnnotationTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar_elev.UnconstrainedFontSizeOn() - if desired_surface == 'Plane': - scalar_bar_elev.SetNumberOfLabels(1) - else: - scalar_bar_elev.SetNumberOfLabels(5) - scalar_bar_elev.SetMaximumWidthInPixels(window_width // 8) - scalar_bar_elev.SetMaximumHeightInPixels(window_height // 3) - # scalar_bar_elev.SetBarRatio(scalar_bar_elev.GetBarRatio() * 0.5) - scalar_bar_elev.SetPosition(0.85, 0.4) - - # ------------------------------------------------------------ - # Create the RenderWindow, Renderer and Interactor - # ------------------------------------------------------------ - ren = vtkRenderer() - ren_win = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren_win.AddRenderer(ren) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren) - # Enable the widget. - cam_orient_manipulator.On() - - # add actors - ren.AddViewProp(src_actor) - ren.AddViewProp(edge_actor) - ren.AddViewProp(glyph_actor) - ren.AddActor2D(scalar_bar) - ren.AddActor2D(scalar_bar_elev) - - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - ren_win.SetSize(window_width, window_height) - ren_win.SetWindowName('CurvatureBandsWithGlyphs') - - if desired_surface == "RandomHills": - camera = ren.GetActiveCamera() - camera.SetPosition(10.9299, 59.1505, 24.9823) - camera.SetFocalPoint(2.21692, 7.97545, 7.75135) - camera.SetViewUp(-0.230136, 0.345504, -0.909761) - camera.SetDistance(54.6966) - camera.SetClippingRange(36.3006, 77.9852) - ren_win.Render() - - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -def adjust_edge_curvatures(source, curvature_name, epsilon=1.0e-08): - """ - This function adjusts curvatures along the edges of the surface by replacing - the value with the average value of the curvatures of points in the neighborhood. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param epsilon: Absolute curvature values less than this will be set to zero. - :return: - """ - - def point_neighbourhood(pt_id): - """ - Find the ids of the neighbours of pt_id. - - :param pt_id: The point id. - :return: The neighbour ids. - """ - """ - Extract the topological neighbors for point pId. In two steps: - 1) source.GetPointCells(pt_id, cell_ids) - 2) source.GetCellPoints(cell_id, cell_point_ids) for all cell_id in cell_ids - """ - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - - def compute_distance(pt_id_a, pt_id_b): - """ - Compute the distance between two points given their ids. - - :param pt_id_a: - :param pt_id_b: - :return: - """ - pt_a = np.array(source.GetPoint(pt_id_a)) - pt_b = np.array(source.GetPoint(pt_id_b)) - return np.linalg.norm(pt_a - pt_b) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Get the boundary point IDs. - array_name = 'ids' - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) - id_filter.Update() - - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() - edges.Update() - - edge_array = edges.GetOutput().GetPointData().GetArray(array_name) - boundary_ids = [] - for i in range(edges.GetOutput().GetNumberOfPoints()): - boundary_ids.append(edge_array.GetValue(i)) - # Remove duplicate Ids. - p_ids_set = set(boundary_ids) - - # Iterate over the edge points and compute the curvature as the weighted - # average of the neighbours. - count_invalid = 0 - for p_id in boundary_ids: - p_ids_neighbors = point_neighbourhood(p_id) - # Keep only interior points. - p_ids_neighbors -= p_ids_set - # Compute distances and extract curvature values. - curvs = [curvatures[p_id_n] for p_id_n in p_ids_neighbors] - dists = [compute_distance(p_id_n, p_id) for p_id_n in p_ids_neighbors] - curvs = np.array(curvs) - dists = np.array(dists) - curvs = curvs[dists > 0] - dists = dists[dists > 0] - if len(curvs) > 0: - weights = 1 / np.array(dists) - weights /= weights.sum() - new_curv = np.dot(curvs, weights) - else: - # Corner case. - count_invalid += 1 - # Assuming the curvature of the point is planar. - new_curv = 0.0 - # Set the new curvature value. - curvatures[p_id] = new_curv - - # Set small values to zero. - if epsilon != 0.0: - curvatures = np.where(abs(curvatures) < epsilon, 0, curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -def constrain_curvatures(source, curvature_name, lower_bound=0.0, upper_bound=0.0): - """ - This function constrains curvatures to the range [lower_bound ... upper_bound]. - - Remember to update the vtkCurvatures object before calling this. - - :param source: A vtkPolyData object corresponding to the vtkCurvatures object. - :param curvature_name: The name of the curvature, 'Gauss_Curvature' or 'Mean_Curvature'. - :param lower_bound: The lower bound. - :param upper_bound: The upper bound. - :return: - """ - - bounds = list() - if lower_bound < upper_bound: - bounds.append(lower_bound) - bounds.append(upper_bound) - else: - bounds.append(upper_bound) - bounds.append(lower_bound) - - # Get the active scalars - source.GetPointData().SetActiveScalars(curvature_name) - np_source = dsa.WrapDataObject(source) - curvatures = np_source.PointData[curvature_name] - - # Set upper and lower bounds. - curvatures = np.where(curvatures < bounds[0], bounds[0], curvatures) - curvatures = np.where(curvatures > bounds[1], bounds[1], curvatures) - # Curvatures is now an ndarray - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) - source.GetPointData().SetActiveScalars(curvature_name) - - -def get_elevations(src): - """ - Generate elevations over the surface. - :param: src - the vtkPolyData source. - :return: - vtkPolyData source with elevations. - """ - bounds = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - src.GetBounds(bounds) - if abs(bounds[2]) < 1.0e-8 and abs(bounds[3]) < 1.0e-8: - bounds[3] = bounds[2] + 1 - elev_filter = vtkElevationFilter() - elev_filter.SetInputData(src) - elev_filter.SetLowPoint(0, bounds[2], 0) - elev_filter.SetHighPoint(0, bounds[3], 0) - elev_filter.SetScalarRange(bounds[2], bounds[3]) - elev_filter.Update() - return elev_filter.GetPolyDataOutput() - - -def get_hills(): - # Create four hills on a plane. - # This will have regions of negative, zero and positive Gsaussian curvatures. - - x_res = 50 - y_res = 50 - x_min = -5.0 - x_max = 5.0 - dx = (x_max - x_min) / (x_res - 1) - y_min = -5.0 - y_max = 5.0 - dy = (y_max - y_min) / (x_res - 1) - - # Make a grid. - points = vtkPoints() - for i in range(0, x_res): - x = x_min + i * dx - for j in range(0, y_res): - y = y_min + j * dy - points.InsertNextPoint(x, y, 0) - - # Add the grid points to a polydata object. - plane = vtkPolyData() - plane.SetPoints(points) - - # Triangulate the grid. - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], - [5.0, -2.5, 1.5, 1.5, 2.5], [-5.0, 5, 2.5, 3.0, 3]] - xx = [0.0] * 2 - for i in range(0, points.GetNumberOfPoints()): - x = list(polydata.GetPoint(i)) - for j in range(0, len(hd)): - xx[0] = (x[0] - hd[j][0] / hd[j][2]) ** 2.0 - xx[1] = (x[1] - hd[j][1] / hd[j][3]) ** 2.0 - x[2] += hd[j][4] * math.exp(-(xx[0] + xx[1]) / 2.0) - polydata.GetPoints().SetPoint(i, x) - elevation.SetValue(i, x[2]) - - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): - tc = [i / (x_res - 1.0), 0.0] - for j in range(0, y_res): - # tc[1] = 1.0 - j / (y_res - 1.0) - tc[1] = j / (y_res - 1.0) - textures.SetTuple(i * y_res + j, tc) - - polydata.GetPointData().SetScalars(elevation) - polydata.GetPointData().GetScalars().SetName("Elevation") - polydata.GetPointData().SetTCoords(textures) - - normals = vtkPolyDataNormals() - normals.SetInputData(polydata) - normals.SetInputData(polydata) - normals.SetFeatureAngle(30) - normals.SplittingOff() - - tr1 = vtkTransform() - tr1.RotateX(-90) - - tf1 = vtkTransformPolyDataFilter() - tf1.SetInputConnection(normals.GetOutputPort()) - tf1.SetTransform(tr1) - tf1.Update() - - return tf1.GetOutput() - - -def get_parametric_hills(): - """ - Make a parametric hills surface as the source. - :return: vtkPolyData with normal and scalar data. - """ - fn = vtkParametricRandomHills() - fn.AllowRandomGenerationOn() - fn.SetRandomSeed(1) - fn.SetNumberOfHills(30) - # Make the normals face out of the surface. - # Not needed with VTK 8.0 or later. - # if fn.GetClassName() == 'vtkParametricRandomHills': - # fn.ClockwiseOrderingOff() - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() - # Name the arrays (not needed in VTK 6.2+ for vtkParametricFunctionSource). - # source.GetOutput().GetPointData().GetNormals().SetName('Normals') - # source.GetOutput().GetPointData().GetScalars().SetName('Scalars') - # Rename the scalars to 'Elevation' since we are using the Z-scalars as elevations. - source.GetOutput().GetPointData().GetScalars().SetName('Elevation') - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_parametric_torus(): - """ - Make a parametric torus as the source. - :return: vtkPolyData with normal and scalar data. - """ - - fn = vtkParametricTorus() - fn.SetRingRadius(5) - fn.SetCrossSectionRadius(2) - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() - - # Name the arrays (not needed in VTK 6.2+ for vtkParametricFunctionSource). - # source.GetOutput().GetPointData().GetNormals().SetName('Normals') - # source.GetOutput().GetPointData().GetScalars().SetName('Scalars') - # Rename the scalars to 'Elevation' since we are using the Z-scalars as elevations. - source.GetOutput().GetPointData().GetScalars().SetName('Elevation') - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_plane(): - """ - Make a plane as the source. - :return: vtkPolyData with normal and scalar data. - """ - - source = vtkPlaneSource() - source.SetOrigin(-10.0, -10.0, 0.0) - source.SetPoint2(-10.0, 10.0, 0.0) - source.SetPoint1(10.0, -10.0, 0.0) - source.SetXResolution(20) - source.SetYResolution(20) - source.Update() - - transform = vtkTransform() - transform.Translate(0.0, 0.0, 0.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - # We have a m x n array of quadrilaterals arranged as a regular tiling in a - # plane. So pass it through a triangle filter since the curvature filter only - # operates on polys. - tri = vtkTriangleFilter() - tri.SetInputConnection(transform_filter.GetOutputPort()) - - # Pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() - - -def get_sphere(): - source = vtkSphereSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetRadius(10.0) - source.SetThetaResolution(32) - source.SetPhiResolution(32) - source.Update() - - return source.GetOutput() - - -def get_torus(): - """ - Make a torus as the source. - :return: vtkPolyData with normal and scalar data. - """ - source = vtkSuperquadricSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetScale(1.0, 1.0, 1.0) - source.SetPhiResolution(64) - source.SetThetaResolution(64) - source.SetThetaRoundness(1) - source.SetThickness(0.5) - source.SetSize(10) - source.SetToroidal(1) - - # The quadric is made of strips, so pass it through a triangle filter as - # the curvature filter only operates on polys - tri = vtkTriangleFilter() - tri.SetInputConnection(source.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() - - -def get_source(source): - surface = source.lower() - available_surfaces = ['hills', 'parametrictorus', 'plane', 'randomhills', 'sphere', 'torus'] - if surface not in available_surfaces: - return None - elif surface == 'hills': - return get_hills() - elif surface == 'parametrictorus': - return get_parametric_torus() - elif surface == 'plane': - return get_elevations(get_plane()) - elif surface == 'randomhills': - return get_parametric_hills() - elif surface == 'sphere': - return get_elevations(get_sphere()) - elif surface == 'torus': - return get_elevations(get_torus()) - return None - - -def get_color_series(): - color_series = vtkColorSeries() - # Select a color scheme. - # color_series_enum = color_series.BREWER_DIVERGING_BROWN_BLUE_GREEN_9 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_10 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_3 - # color_series_enum = color_series.BREWER_DIVERGING_PURPLE_ORANGE_9 - # color_series_enum = color_series.BREWER_SEQUENTIAL_BLUE_PURPLE_9 - # color_series_enum = color_series.BREWER_SEQUENTIAL_BLUE_GREEN_9 - color_series_enum = color_series.BREWER_QUALITATIVE_SET3 - # color_series_enum = color_series.CITRUS - color_series.SetColorScheme(color_series_enum) - return color_series - - -def get_categorical_lut(): - """ - Make a lookup table using vtkColorSeries. - :return: An indexed (categorical) lookup table. - """ - color_series = get_color_series() - # Make the lookup table. - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.CATEGORICAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - -def get_ordinal_lut(): - """ - Make a lookup table using vtkColorSeries. - :return: An ordinal (not indexed) lookup table. - """ - color_series = get_color_series() - # Make the lookup table. - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.ORDINAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - -def get_diverging_lut(): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start point midPoint end point - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150 - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046 - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631 - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093 - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233 - - :return: - """ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.758, 0.214, 0.233) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def reverse_lut(lut): - """ - Create a lookup table with the colors reversed. - :param: lut - An indexed lookup table. - :return: The reversed indexed lookup table. - """ - lutr = vtkLookupTable() - lutr.DeepCopy(lut) - t = lut.GetNumberOfTableValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - rgba = [0.0] * 3 - v = float(i) - lut.GetColor(v, rgba) - rgba.append(lut.GetOpacity(v)) - lutr.SetTableValue(t - i, rgba) - t = lut.GetNumberOfAnnotatedValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - lutr.SetAnnotation(t - i, lut.GetAnnotation(i)) - return lutr - - -def get_glyphs(src, scale_factor=1.0, reverse_normals=False): - """ - Glyph the normals on the surface. - - You may need to adjust the parameters for mask_pts, arrow and glyph for a - nice appearance. - - :param: src - the surface to glyph. - :param: reverse_normals - if True the normals on the surface are reversed. - :return: The glyph object. - - """ - # Sometimes the contouring algorithm can create a volume whose gradient - # vector and ordering of polygon (using the right hand rule) are - # inconsistent. vtkReverseSense cures this problem. - reverse = vtkReverseSense() - - # Choose a random subset of points. - mask_pts = vtkMaskPoints() - mask_pts.SetOnRatio(5) - mask_pts.RandomModeOn() - if reverse_normals: - reverse.SetInputData(src) - reverse.ReverseCellsOn() - reverse.ReverseNormalsOn() - mask_pts.SetInputConnection(reverse.GetOutputPort()) - else: - mask_pts.SetInputData(src) - - # Source for the glyph filter - arrow = vtkArrowSource() - arrow.SetTipResolution(16) - arrow.SetTipLength(0.3) - arrow.SetTipRadius(0.1) - - glyph = vtkGlyph3D() - glyph.SetSourceConnection(arrow.GetOutputPort()) - glyph.SetInputConnection(mask_pts.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleFactor(scale_factor) - glyph.SetColorModeToColorByVector() - glyph.SetScaleModeToScaleByVector() - glyph.OrientOn() - glyph.Update() - return glyph - - -def get_bands(d_r, number_of_bands, precision=2, nearest_integer=False): - """ - Divide a range into bands - :param: d_r - [min, max] the range that is to be covered by the bands. - :param: number_of_bands - The number of bands, a positive integer. - :param: precision - The decimal precision of the bounds. - :param: nearest_integer - If True then [floor(min), ceil(max)] is used. - :return: A dictionary consisting of the band number and [min, midpoint, max] for each band. - """ - prec = abs(precision) - if prec > 14: - prec = 14 - - bands = dict() - if (d_r[1] < d_r[0]) or (number_of_bands <= 0): - return bands - x = list(d_r) - if nearest_integer: - x[0] = math.floor(x[0]) - x[1] = math.ceil(x[1]) - dx = (x[1] - x[0]) / float(number_of_bands) - b = [x[0], x[0] + dx / 2.0, x[0] + dx] - i = 0 - while i < number_of_bands: - b = list(map(lambda ele_b: round(ele_b, prec), b)) - if i == 0: - b[0] = x[0] - bands[i] = b - b = [b[0] + dx, b[1] + dx, b[2] + dx] - i += 1 - return bands - - -def get_custom_bands(d_r, number_of_bands, my_bands): - """ - Divide a range into custom bands. - - You need to specify each band as an list [r1, r2] where r1 < r2 and - append these to a list. - The list should ultimately look - like this: [[r1, r2], [r2, r3], [r3, r4]...] - - :param: d_r - [min, max] the range that is to be covered by the bands. - :param: number_of_bands - the number of bands, a positive integer. - :return: A dictionary consisting of band number and [min, midpoint, max] for each band. - """ - bands = dict() - if (d_r[1] < d_r[0]) or (number_of_bands <= 0): - return bands - x = my_bands - # Determine the index of the range minimum and range maximum. - idx_min = 0 - for idx in range(0, len(my_bands)): - if my_bands[idx][1] > d_r[0] >= my_bands[idx][0]: - idx_min = idx - break - - idx_max = len(my_bands) - 1 - for idx in range(len(my_bands) - 1, -1, -1): - if my_bands[idx][1] > d_r[1] >= my_bands[idx][0]: - idx_max = idx - break - - # Set the minimum to match the range minimum. - x[idx_min][0] = d_r[0] - x[idx_max][1] = d_r[1] - x = x[idx_min: idx_max + 1] - for idx, e in enumerate(x): - bands[idx] = [e[0], e[0] + (e[1] - e[0]) / 2, e[1]] - return bands - - -def get_frequencies(bands, src): - """ - Count the number of scalars in each band. - The scalars used are the active scalars in the polydata. - - :param: bands - The bands. - :param: src - The vtkPolyData source. - :return: The frequencies of the scalars in each band. - """ - freq = dict() - for i in range(len(bands)): - freq[i] = 0 - tuples = src.GetPointData().GetScalars().GetNumberOfTuples() - for i in range(tuples): - x = src.GetPointData().GetScalars().GetTuple1(i) - for j in range(len(bands)): - if x <= bands[j][2]: - freq[j] += 1 - break - return freq - - -def adjust_ranges(bands, freq): - """ - The bands and frequencies are adjusted so that the first and last - frequencies in the range are non-zero. - :param bands: The bands dictionary. - :param freq: The frequency dictionary. - :return: Adjusted bands and frequencies. - """ - # Get the indices of the first and last non-zero elements. - first = 0 - for k, v in freq.items(): - if v != 0: - first = k - break - rev_keys = list(freq.keys())[::-1] - last = rev_keys[0] - for idx in list(freq.keys())[::-1]: - if freq[idx] != 0: - last = idx - break - # Now adjust the ranges. - min_key = min(freq.keys()) - max_key = max(freq.keys()) - for idx in range(min_key, first): - freq.pop(idx) - bands.pop(idx) - for idx in range(last + 1, max_key + 1): - freq.popitem() - bands.popitem() - old_keys = freq.keys() - adj_freq = dict() - adj_bands = dict() - - for idx, k in enumerate(old_keys): - adj_freq[idx] = freq[k] - adj_bands[idx] = bands[k] - - return adj_bands, adj_freq - - -def print_bands_frequencies(bands, freq, precision=2): - prec = abs(precision) - if prec > 14: - prec = 14 - - if len(bands) != len(freq): - print('Bands and Frequencies must be the same size.') - return - s = f'Bands & Frequencies:\n' - total = 0 - width = prec + 6 - for k, v in bands.items(): - total += freq[k] - for j, q in enumerate(v): - if j == 0: - s += f'{k:4d} [' - if j == len(v) - 1: - s += f'{q:{width}.{prec}f}]: {freq[k]:8d}\n' - else: - s += f'{q:{width}.{prec}f}, ' - width = 3 * width + 13 - s += f'{"Total":{width}s}{total:8d}\n' - print(s) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Visualization/DisplayCoordinateAxes.md b/data/examples/Visualization/DisplayCoordinateAxes.md deleted file mode 100644 index 6bee3fd..0000000 --- a/data/examples/Visualization/DisplayCoordinateAxes.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example shows how to display the coordinate axes in the render window. - -!!! seealso - [Axes](../../GeometricObjects/Axes). diff --git a/data/examples/Visualization/DisplayCoordinateAxes.py b/data/examples/Visualization/DisplayCoordinateAxes.py deleted file mode 100755 index cdd5588..0000000 --- a/data/examples/Visualization/DisplayCoordinateAxes.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(1.0) - sphereSource.Update() - - polydata = sphereSource.GetOutput() - - # Create a mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(polydata) - - # Create an actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # A renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('DisplayCoordinateAxes') - renderWindow.AddRenderer(renderer) - - # An interactor - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - axes = vtkAxesActor() - - widget = vtkOrientationMarkerWidget() - rgba = [0] * 4 - colors.GetColor('Carrot', rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(renderWindowInteractor) - widget.SetViewport(0.0, 0.0, 0.4, 0.4) - widget.SetEnabled(1) - widget.InteractiveOn() - - renderer.GetActiveCamera().Azimuth(50) - renderer.GetActiveCamera().Elevation(-30) - - renderer.ResetCamera() - renderWindow.Render() - - # Begin mouse interaction - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/DisplayQuadricSurfaces.md b/data/examples/Visualization/DisplayQuadricSurfaces.md deleted file mode 100644 index 5525101..0000000 --- a/data/examples/Visualization/DisplayQuadricSurfaces.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example demonstrates how to create and display a quadratic surface. diff --git a/data/examples/Visualization/DisplayQuadricSurfaces.py b/data/examples/Visualization/DisplayQuadricSurfaces.py deleted file mode 100755 index 0e124f7..0000000 --- a/data/examples/Visualization/DisplayQuadricSurfaces.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def Sphere(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, 1, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 + 1*z^2 - - PlotFunction(quadric, 1.0) - - -def EllipticParaboloid(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, 0, 0, 0, 0, 0, 0, -1, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 - - PlotFunction(quadric, 10.0) - - -def HyperbolicParaboloid(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, -1, 0, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 - 1*y^2 - - PlotFunction(quadric, 10.0) - - -def Cylinder(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, 0, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 - - PlotFunction(quadric, 1.0) - - -def HyperboloidOneSheet(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, -1, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 - - PlotFunction(quadric, 1.0) - - -def HyperboloidTwoSheets(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, -1, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 - - PlotFunction(quadric, -1.0) - - -def Ellipsoid(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, 2, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 + 1*z^2 - - PlotFunction(quadric, 1.0) - - -def Cone(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(1, 1, -1, 0, 0, 0, 0, 0, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 1*x^2 + 1*y^2 - 1*z^2 - PlotFunction(quadric, 0.0) - - -def Other(): - # create the quadric function definition - quadric = vtkQuadric() - quadric.SetCoefficients(.5, 1, .2, 0, .1, 0, 0, .2, 0, 0) - - # F(x,y,z) = a0*x^2 + a1*y^2 + a2*z^2 + a3*x*y + a4*y*z + a5*x*z + a6*x + a7*y + a8*z + a9 - # F(x,y,z) = 0.5*x^2 + 1*y^2 + 0.2*z^2 + 0*x*y + 0.1*y*z + 0*x*z + 0*x + 0.2*y + 0*z + 0 - PlotFunction(quadric, 1.0) - - -def PlotFunction(quadric, value): - colors = vtkNamedColors() - - # sample the quadric function - sample = vtkSampleFunction() - sample.SetSampleDimensions(50, 50, 50) - sample.SetImplicitFunction(quadric) - # double xmin = 0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1 - bounds = [-10, 11, -10, 10, -10, 10] - sample.SetModelBounds(bounds) - - # create the 0 isosurface - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, value, value) - - # map the contours to graphical primitives - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contours.GetOutputPort()) - contourMapper.SetScalarRange(0.0, 1.2) - - # create an actor for the contours - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # -- create a box around the function to indicate the sampling volume -- - - # create outline - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) - - # map it to graphics primitives - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - # create an actor for it - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # setup the window - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetWindowName('DisplayQuadricSurfaces') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # add the actors to the scene - ren1.AddActor(contourActor) - ren1.AddActor(outlineActor) - ren1.SetBackground(colors.GetColor3d('AliceBlue')) - - # render and interact - renWin.Render() - ren1.GetActiveCamera().Azimuth(-55) - ren1.GetActiveCamera().Elevation(15) - - iren.Start() - - -def main(): - # Choose one! - - # Other() - # Sphere() - # Cone() - # Ellipsoid() - # Cylinder() - # HyperboloidOneSheet() - # HyperboloidTwoSheets() - # HyperbolicParaboloid() - EllipticParaboloid() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ElevationBandsWithGlyphs.md b/data/examples/Visualization/ElevationBandsWithGlyphs.md deleted file mode 100644 index 3362602..0000000 --- a/data/examples/Visualization/ElevationBandsWithGlyphs.md +++ /dev/null @@ -1,16 +0,0 @@ -### Description - -In this example we are coloring the surface by partitioning the elevation into bands and using arrows to display the normals on the surface. - -Rather beautiful surfaces are generated. - -The banded contour filter and an indexed lookup table are used along with the elevation filter to generate the banding on the surface. To further enhance the surface, the surface normals are glyphed and colored by elevation using an ordinal lookup table. - -Feel free to experiment with different color schemes and/or the other sources from the parametric function group or a cone etc. - -You will usually need to adjust the parameters for `mask_p_ts`, `arrow` and `glyph` for a nice appearance. -Do this in the function `make_glyphs()`. - -You may also need to add an elevation filter to generate the scalars as demonstrated in `make_sphere()`. - -`print_bands_frequencies()` allows you to inspect the bands and the number of scalars in each band. This are useful if you want to get an idea of the distribution of the scalars in each band. diff --git a/data/examples/Visualization/ElevationBandsWithGlyphs.py b/data/examples/Visualization/ElevationBandsWithGlyphs.py deleted file mode 100755 index 42f79c9..0000000 --- a/data/examples/Visualization/ElevationBandsWithGlyphs.py +++ /dev/null @@ -1,847 +0,0 @@ -#!/usr/bin/env python - -import math - -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkFloatArray, - vtkLookupTable, - vtkPoints, - vtkVariant, - vtkVariantArray, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkDelaunay2D, - vtkElevationFilter, - vtkGlyph3D, - vtkMaskPoints, - vtkPolyDataNormals, - vtkReverseSense, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkBandedPolyDataContourFilter -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkParametricFunctionSource, - vtkPlaneSource, - vtkSphereSource, - vtkSuperquadricSource -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 - - -def main(argv): - # ------------------------------------------------------------ - # Create the surface, lookup tables, contour filter etc. - # ------------------------------------------------------------ - # desired_surface = 'Hills' - # desired_surface = 'ParametricTorus' - # desired_surface = 'Plane' - desired_surface = 'RandomHills' - # desired_surface = 'Sphere' - # desired_surface = 'Torus' - source = get_source(desired_surface) - if not source: - print('The surface is not available.') - return - - # The length of the normal arrow glyphs. - scale_factor = 1.0 - if desired_surface == 'Hills': - scale_factor = 0.5 - elif desired_surface == 'Sphere': - scale_factor = 2.0 - print(desired_surface) - - source.GetPointData().SetActiveScalars('Elevation') - scalar_range = source.GetPointData().GetScalars('Elevation').GetRange() - - lut = get_categorical_lut() - lut1 = get_ordinal_lut() - lut.SetTableRange(scalar_range) - lut1.SetTableRange(scalar_range) - number_of_bands = lut.GetNumberOfTableValues() - lut.SetNumberOfTableValues(number_of_bands) - precision = 10 - bands = get_bands(scalar_range, number_of_bands, precision, False) - - if desired_surface == 'RandomHills': - # These are my custom bands. - # Generated by first running: - # bands = get_bands(scalar_range, number_of_bands, precision, False) - # then: - # freq = get_frequencies(bands, source) - # print_bands_frequencies(bands, freq) - # Finally using the output to create this table: - my_bands = [ - [0, 1.0], [1.0, 2.0], [2.0, 3.0], - [3.0, 4.0], [4.0, 5.0], [5.0, 6.0], - [6.0, 7.0], [7.0, 8.0]] - # Comment this out if you want to see how allocating - # equally spaced bands works. - bands = get_custom_bands(scalar_range, number_of_bands, my_bands) - # bands = get_bands(scalar_range, number_of_bands, precision, False) - - # Let's do a frequency table. - # The number of scalars in each band. - freq = get_frequencies(bands, source) - bands, freq = adjust_ranges(bands, freq) - print_bands_frequencies(bands, freq) - - scalar_range = (bands[0][0], bands[len(bands) - 1][2]) - lut.SetTableRange(scalar_range) - lut.SetNumberOfTableValues(len(bands)) - lut1.SetNumberOfTableValues(len(bands)) - - # We will use the midpoint of the band as the label. - labels = [] - for k in bands: - labels.append('{:4.2f}'.format(bands[k][1])) - - # Annotate - values = vtkVariantArray() - for i in range(len(labels)): - values.InsertNextValue(vtkVariant(labels[i])) - for i in range(values.GetNumberOfTuples()): - lut.SetAnnotation(i, values.GetValue(i).ToString()) - - # Create a lookup table with the colors reversed. - lutr = reverse_lut(lut) - - # Create the contour bands. - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputData(source) - # Use either the minimum or maximum value for each band. - for i in range(len(bands)): - bcf.SetValue(i, bands[i][2]) - # We will use an indexed lookup table. - bcf.SetScalarModeToIndex() - bcf.GenerateContourEdgesOn() - - # Generate the glyphs on the original surface. - glyph = get_glyphs(source, scale_factor, False) - - # ------------------------------------------------------------ - # Create the mappers and actors - # ------------------------------------------------------------ - - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [179, 204, 255, 255]) - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - src_mapper = vtkPolyDataMapper() - src_mapper.SetInputConnection(bcf.GetOutputPort()) - src_mapper.SetScalarRange(scalar_range) - src_mapper.SetLookupTable(lut) - src_mapper.SetScalarModeToUseCellData() - - src_actor = vtkActor() - src_actor.SetMapper(src_mapper) - - # Create contour edges - edge_mapper = vtkPolyDataMapper() - edge_mapper.SetInputData(bcf.GetContourEdgesOutput()) - edge_mapper.SetResolveCoincidentTopologyToPolygonOffset() - - edge_actor = vtkActor() - edge_actor.SetMapper(edge_mapper) - edge_actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - glyph_mapper = vtkPolyDataMapper() - glyph_mapper.SetInputConnection(glyph.GetOutputPort()) - glyph_mapper.SetScalarModeToUsePointFieldData() - glyph_mapper.SetColorModeToMapScalars() - glyph_mapper.ScalarVisibilityOn() - glyph_mapper.SelectColorArray('Elevation') - # Colour by scalars. - glyph_mapper.SetLookupTable(lut1) - glyph_mapper.SetScalarRange(scalar_range) - - glyph_actor = vtkActor() - glyph_actor.SetMapper(glyph_mapper) - - window_width = 800 - window_height = 800 - - # Add a scalar bar. - scalar_bar = vtkScalarBarActor() - # This LUT puts the lowest value at the top of the scalar bar. - # scalar_bar->SetLookupTable(lut); - # Use this LUT if you want the highest value at the top. - scalar_bar.SetLookupTable(lutr) - scalar_bar.SetTitle('Elevation') - scalar_bar.GetTitleTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.GetLabelTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.GetAnnotationTextProperty().SetColor( - colors.GetColor3d('AliceBlue')) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetMaximumWidthInPixels(window_width // 8) - scalar_bar.SetMaximumHeightInPixels(window_height // 3) - scalar_bar.SetPosition(0.85, 0.05) - - # ------------------------------------------------------------ - # Create the RenderWindow, Renderer and Interactor - # ------------------------------------------------------------ - ren = vtkRenderer() - ren_win = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren_win.AddRenderer(ren) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren) - # Enable the widget. - cam_orient_manipulator.On() - - # add actors - ren.AddViewProp(src_actor) - ren.AddViewProp(edge_actor) - ren.AddViewProp(glyph_actor) - ren.AddActor2D(scalar_bar) - - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - ren_win.SetSize(window_width, window_height) - ren_win.SetWindowName('ElevationBandsWithGlyphs') - - if desired_surface == "RandomHills": - camera = ren.GetActiveCamera() - camera.SetPosition(10.9299, 59.1505, 24.9823) - camera.SetFocalPoint(2.21692, 7.97545, 7.75135) - camera.SetViewUp(-0.230136, 0.345504, -0.909761) - camera.SetDistance(54.6966) - camera.SetClippingRange(36.3006, 77.9852) - ren_win.Render() - - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -def get_elevations(src): - """ - Generate elevations over the surface. - :param: src - the vtkPolyData source. - :return: - vtkPolyData source with elevations. - """ - bounds = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - src.GetBounds(bounds) - if abs(bounds[2]) < 1.0e-8 and abs(bounds[3]) < 1.0e-8: - bounds[3] = bounds[2] + 1 - elev_filter = vtkElevationFilter() - elev_filter.SetInputData(src) - elev_filter.SetLowPoint(0, bounds[2], 0) - elev_filter.SetHighPoint(0, bounds[3], 0) - elev_filter.SetScalarRange(bounds[2], bounds[3]) - elev_filter.Update() - return elev_filter.GetPolyDataOutput() - - -def get_hills(): - # Create four hills on a plane. - # This will have regions of negative, zero and positive Gsaussian curvatures. - - x_res = 50 - y_res = 50 - x_min = -5.0 - x_max = 5.0 - dx = (x_max - x_min) / (x_res - 1) - y_min = -5.0 - y_max = 5.0 - dy = (y_max - y_min) / (x_res - 1) - - # Make a grid. - points = vtkPoints() - for i in range(0, x_res): - x = x_min + i * dx - for j in range(0, y_res): - y = y_min + j * dy - points.InsertNextPoint(x, y, 0) - - # Add the grid points to a polydata object. - plane = vtkPolyData() - plane.SetPoints(points) - - # Triangulate the grid. - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], - [5.0, -2.5, 1.5, 1.5, 2.5], [-5.0, 5, 2.5, 3.0, 3]] - xx = [0.0] * 2 - for i in range(0, points.GetNumberOfPoints()): - x = list(polydata.GetPoint(i)) - for j in range(0, len(hd)): - xx[0] = (x[0] - hd[j][0] / hd[j][2]) ** 2.0 - xx[1] = (x[1] - hd[j][1] / hd[j][3]) ** 2.0 - x[2] += hd[j][4] * math.exp(-(xx[0] + xx[1]) / 2.0) - polydata.GetPoints().SetPoint(i, x) - elevation.SetValue(i, x[2]) - - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): - tc = [i / (x_res - 1.0), 0.0] - for j in range(0, y_res): - # tc[1] = 1.0 - j / (y_res - 1.0) - tc[1] = j / (y_res - 1.0) - textures.SetTuple(i * y_res + j, tc) - - polydata.GetPointData().SetScalars(elevation) - polydata.GetPointData().GetScalars().SetName("Elevation") - polydata.GetPointData().SetTCoords(textures) - - normals = vtkPolyDataNormals() - normals.SetInputData(polydata) - normals.SetInputData(polydata) - normals.SetFeatureAngle(30) - normals.SplittingOff() - - tr1 = vtkTransform() - tr1.RotateX(-90) - - tf1 = vtkTransformPolyDataFilter() - tf1.SetInputConnection(normals.GetOutputPort()) - tf1.SetTransform(tr1) - tf1.Update() - - return tf1.GetOutput() - - -def get_parametric_hills(): - """ - Make a parametric hills surface as the source. - :return: vtkPolyData with normal and scalar data. - """ - fn = vtkParametricRandomHills() - fn.AllowRandomGenerationOn() - fn.SetRandomSeed(1) - fn.SetNumberOfHills(30) - # Make the normals face out of the surface. - # Not needed with VTK 8.0 or later. - # if fn.GetClassName() == 'vtkParametricRandomHills': - # fn.ClockwiseOrderingOff() - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() - # Name the arrays (not needed in VTK 6.2+ for vtkParametricFunctionSource). - # source.GetOutput().GetPointData().GetNormals().SetName('Normals') - # source.GetOutput().GetPointData().GetScalars().SetName('Scalars') - # Rename the scalars to 'Elevation' since we are using the Z-scalars as elevations. - source.GetOutput().GetPointData().GetScalars().SetName('Elevation') - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_parametric_torus(): - """ - Make a parametric torus as the source. - :return: vtkPolyData with normal and scalar data. - """ - - fn = vtkParametricTorus() - fn.SetRingRadius(5) - fn.SetCrossSectionRadius(2) - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() - - # Name the arrays (not needed in VTK 6.2+ for vtkParametricFunctionSource). - # source.GetOutput().GetPointData().GetNormals().SetName('Normals') - # source.GetOutput().GetPointData().GetScalars().SetName('Scalars') - # Rename the scalars to 'Elevation' since we are using the Z-scalars as elevations. - source.GetOutput().GetPointData().GetScalars().SetName('Elevation') - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() - - -def get_plane(): - """ - Make a plane as the source. - :return: vtkPolyData with normal and scalar data. - """ - - source = vtkPlaneSource() - source.SetOrigin(-10.0, -10.0, 0.0) - source.SetPoint2(-10.0, 10.0, 0.0) - source.SetPoint1(10.0, -10.0, 0.0) - source.SetXResolution(20) - source.SetYResolution(20) - source.Update() - - transform = vtkTransform() - transform.Translate(0.0, 0.0, 0.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - # We have a m x n array of quadrilaterals arranged as a regular tiling in a - # plane. So pass it through a triangle filter since the curvature filter only - # operates on polys. - tri = vtkTriangleFilter() - tri.SetInputConnection(transform_filter.GetOutputPort()) - - # Pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() - - -def get_sphere(): - source = vtkSphereSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetRadius(10.0) - source.SetThetaResolution(32) - source.SetPhiResolution(32) - source.Update() - - return source.GetOutput() - - -def get_torus(): - """ - Make a torus as the source. - :return: vtkPolyData with normal and scalar data. - """ - source = vtkSuperquadricSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetScale(1.0, 1.0, 1.0) - source.SetPhiResolution(64) - source.SetThetaResolution(64) - source.SetThetaRoundness(1) - source.SetThickness(0.5) - source.SetSize(10) - source.SetToroidal(1) - - # The quadric is made of strips, so pass it through a triangle filter as - # the curvature filter only operates on polys - tri = vtkTriangleFilter() - tri.SetInputConnection(source.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() - - -def get_source(source): - surface = source.lower() - available_surfaces = ['hills', 'parametrictorus', 'plane', 'randomhills', 'sphere', 'torus'] - if surface not in available_surfaces: - return None - elif surface == 'hills': - return get_hills() - elif surface == 'parametrictorus': - return get_parametric_torus() - elif surface == 'plane': - return get_elevations(get_plane()) - elif surface == 'randomhills': - return get_parametric_hills() - elif surface == 'sphere': - return get_elevations(get_sphere()) - elif surface == 'torus': - return get_elevations(get_torus()) - return None - - -def get_color_series(): - color_series = vtkColorSeries() - # Select a color scheme. - # color_series_enum = color_series.BREWER_DIVERGING_BROWN_BLUE_GREEN_9 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_10 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_3 - # color_series_enum = color_series.BREWER_DIVERGING_PURPLE_ORANGE_9 - # color_series_enum = color_series.BREWER_SEQUENTIAL_BLUE_PURPLE_9 - # color_series_enum = color_series.BREWER_SEQUENTIAL_BLUE_GREEN_9 - color_series_enum = color_series.BREWER_QUALITATIVE_SET3 - # color_series_enum = color_series.CITRUS - color_series.SetColorScheme(color_series_enum) - return color_series - - -def get_categorical_lut(): - """ - Make a lookup table using vtkColorSeries. - :return: An indexed (categorical) lookup table. - """ - color_series = get_color_series() - # Make the lookup table. - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.CATEGORICAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - -def get_ordinal_lut(): - """ - Make a lookup table using vtkColorSeries. - :return: An ordinal (not indexed) lookup table. - """ - color_series = get_color_series() - # Make the lookup table. - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.ORDINAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - -def get_diverging_lut(): - """ - See: [Diverging Color Maps for Scientific Visualization](https://www.kennethmoreland.com/color-maps/) - start point midPoint end point - cool to warm: 0.230, 0.299, 0.754 0.865, 0.865, 0.865 0.706, 0.016, 0.150 - purple to orange: 0.436, 0.308, 0.631 0.865, 0.865, 0.865 0.759, 0.334, 0.046 - green to purple: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.436, 0.308, 0.631 - blue to brown: 0.217, 0.525, 0.910 0.865, 0.865, 0.865 0.677, 0.492, 0.093 - green to red: 0.085, 0.532, 0.201 0.865, 0.865, 0.865 0.758, 0.214, 0.233 - - :return: - """ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.758, 0.214, 0.233) - - table_size = 256 - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) - rgba.append(1) - lut.SetTableValue(i, rgba) - - return lut - - -def reverse_lut(lut): - """ - Create a lookup table with the colors reversed. - :param: lut - An indexed lookup table. - :return: The reversed indexed lookup table. - """ - lutr = vtkLookupTable() - lutr.DeepCopy(lut) - t = lut.GetNumberOfTableValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - rgba = [0.0] * 3 - v = float(i) - lut.GetColor(v, rgba) - rgba.append(lut.GetOpacity(v)) - lutr.SetTableValue(t - i, rgba) - t = lut.GetNumberOfAnnotatedValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - lutr.SetAnnotation(t - i, lut.GetAnnotation(i)) - return lutr - - -def get_glyphs(src, scale_factor=1.0, reverse_normals=False): - """ - Glyph the normals on the surface. - - You may need to adjust the parameters for mask_pts, arrow and glyph for a - nice appearance. - - :param: src - the surface to glyph. - :param: reverse_normals - if True the normals on the surface are reversed. - :return: The glyph object. - - """ - # Sometimes the contouring algorithm can create a volume whose gradient - # vector and ordering of polygon (using the right hand rule) are - # inconsistent. vtkReverseSense cures this problem. - reverse = vtkReverseSense() - - # Choose a random subset of points. - mask_pts = vtkMaskPoints() - mask_pts.SetOnRatio(5) - mask_pts.RandomModeOn() - if reverse_normals: - reverse.SetInputData(src) - reverse.ReverseCellsOn() - reverse.ReverseNormalsOn() - mask_pts.SetInputConnection(reverse.GetOutputPort()) - else: - mask_pts.SetInputData(src) - - # Source for the glyph filter - arrow = vtkArrowSource() - arrow.SetTipResolution(16) - arrow.SetTipLength(0.3) - arrow.SetTipRadius(0.1) - - glyph = vtkGlyph3D() - glyph.SetSourceConnection(arrow.GetOutputPort()) - glyph.SetInputConnection(mask_pts.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleFactor(scale_factor) - glyph.SetColorModeToColorByVector() - glyph.SetScaleModeToScaleByVector() - glyph.OrientOn() - glyph.Update() - return glyph - - -def get_bands(d_r, number_of_bands, precision=2, nearest_integer=False): - """ - Divide a range into bands - :param: d_r - [min, max] the range that is to be covered by the bands. - :param: number_of_bands - The number of bands, a positive integer. - :param: precision - The decimal precision of the bounds. - :param: nearest_integer - If True then [floor(min), ceil(max)] is used. - :return: A dictionary consisting of the band number and [min, midpoint, max] for each band. - """ - prec = abs(precision) - if prec > 14: - prec = 14 - - bands = dict() - if (d_r[1] < d_r[0]) or (number_of_bands <= 0): - return bands - x = list(d_r) - if nearest_integer: - x[0] = math.floor(x[0]) - x[1] = math.ceil(x[1]) - dx = (x[1] - x[0]) / float(number_of_bands) - b = [x[0], x[0] + dx / 2.0, x[0] + dx] - i = 0 - while i < number_of_bands: - b = list(map(lambda ele_b: round(ele_b, prec), b)) - if i == 0: - b[0] = x[0] - bands[i] = b - b = [b[0] + dx, b[1] + dx, b[2] + dx] - i += 1 - return bands - - -def get_custom_bands(d_r, number_of_bands, my_bands): - """ - Divide a range into custom bands. - - You need to specify each band as an list [r1, r2] where r1 < r2 and - append these to a list. - The list should ultimately look - like this: [[r1, r2], [r2, r3], [r3, r4]...] - - :param: d_r - [min, max] the range that is to be covered by the bands. - :param: number_of_bands - the number of bands, a positive integer. - :return: A dictionary consisting of band number and [min, midpoint, max] for each band. - """ - bands = dict() - if (d_r[1] < d_r[0]) or (number_of_bands <= 0): - return bands - x = my_bands - # Determine the index of the range minimum and range maximum. - idx_min = 0 - for idx in range(0, len(my_bands)): - if my_bands[idx][1] > d_r[0] >= my_bands[idx][0]: - idx_min = idx - break - - idx_max = len(my_bands) - 1 - for idx in range(len(my_bands) - 1, -1, -1): - if my_bands[idx][1] > d_r[1] >= my_bands[idx][0]: - idx_max = idx - break - - # Set the minimum to match the range minimum. - x[idx_min][0] = d_r[0] - x[idx_max][1] = d_r[1] - x = x[idx_min: idx_max + 1] - for idx, e in enumerate(x): - bands[idx] = [e[0], e[0] + (e[1] - e[0]) / 2, e[1]] - return bands - - -def get_frequencies(bands, src): - """ - Count the number of scalars in each band. - The scalars used are the active scalars in the polydata. - - :param: bands - The bands. - :param: src - The vtkPolyData source. - :return: The frequencies of the scalars in each band. - """ - freq = dict() - for i in range(len(bands)): - freq[i] = 0 - tuples = src.GetPointData().GetScalars().GetNumberOfTuples() - for i in range(tuples): - x = src.GetPointData().GetScalars().GetTuple1(i) - for j in range(len(bands)): - if x <= bands[j][2]: - freq[j] += 1 - break - return freq - - -def adjust_ranges(bands, freq): - """ - The bands and frequencies are adjusted so that the first and last - frequencies in the range are non-zero. - :param bands: The bands dictionary. - :param freq: The frequency dictionary. - :return: Adjusted bands and frequencies. - """ - # Get the indices of the first and last non-zero elements. - first = 0 - for k, v in freq.items(): - if v != 0: - first = k - break - rev_keys = list(freq.keys())[::-1] - last = rev_keys[0] - for idx in list(freq.keys())[::-1]: - if freq[idx] != 0: - last = idx - break - # Now adjust the ranges. - min_key = min(freq.keys()) - max_key = max(freq.keys()) - for idx in range(min_key, first): - freq.pop(idx) - bands.pop(idx) - for idx in range(last + 1, max_key + 1): - freq.popitem() - bands.popitem() - old_keys = freq.keys() - adj_freq = dict() - adj_bands = dict() - - for idx, k in enumerate(old_keys): - adj_freq[idx] = freq[k] - adj_bands[idx] = bands[k] - - return adj_bands, adj_freq - - -def print_bands_frequencies(bands, freq, precision=2): - prec = abs(precision) - if prec > 14: - prec = 14 - - if len(bands) != len(freq): - print('Bands and Frequencies must be the same size.') - return - s = f'Bands & Frequencies:\n' - total = 0 - width = prec + 6 - for k, v in bands.items(): - total += freq[k] - for j, q in enumerate(v): - if j == 0: - s += f'{k:4d} [' - if j == len(v) - 1: - s += f'{q:{width}.{prec}f}]: {freq[k]:8d}\n' - else: - s += f'{q:{width}.{prec}f}, ' - width = 3 * width + 13 - s += f'{"Total":{width}s}{total:8d}\n' - print(s) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Visualization/FrogBrain.md b/data/examples/Visualization/FrogBrain.md deleted file mode 100644 index 0451891..0000000 --- a/data/examples/Visualization/FrogBrain.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -The frog's brain. Model extracted without smoothing (left) and with smoothing (right). - -!!! info - See [Figure 12-7](../../../VTKBook/12Chapter12/#Figure%2012-7) in [Chapter 12](../../..//VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/FrogBrain.py b/data/examples/Visualization/FrogBrain.py deleted file mode 100755 index 567dca6..0000000 --- a/data/examples/Visualization/FrogBrain.py +++ /dev/null @@ -1,284 +0,0 @@ -#!/usr/bin/env python - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkLookupTable, - vtkVersion -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkPolyDataNormals, - vtkStripper, - vtkWindowedSincPolyDataFilter -) -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkImageThreshold -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(argv): - import argparse - description = 'The frog\'s brain.' - epilogue = ''' - Model extracted without smoothing (left) and with smoothing (right). - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('data_folder', help='The path to the file: frogtissue.mhd.') - parser.add_argument('tissue', default='brain', nargs='?', help='The tissue to use.') - args = parser.parse_args() - return args.data_folder, args.tissue - - -def main(data_folder, tissue): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - path = Path(data_folder) - if path.is_dir(): - s = '' - file_name = path.joinpath('frogtissue').with_suffix('.mhd') - if not file_name.is_file(): - s += 'The file: {:s} does not exist.'.format(str(file_name)) - if s: - print(s) - return - else: - print('Expected a path to frogtissue.mhd') - return - - tissue_map = create_tissue_map() - lut = create_frog_lut(colors) - - # Setup render window, renderer, and interactor. - renderer_left = vtkRenderer() - renderer_left.SetViewport(0, 0, 0.5, 1) - renderer_right = vtkRenderer() - renderer_right.SetViewport(0.5, 0, 1, 1) - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer_left) - render_window.AddRenderer(renderer_right) - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - actor = create_frog_actor(file_name, tissue_map[tissue], use_flying_edges) - actor.GetProperty().SetDiffuseColor(lut.GetTableValue(tissue_map[tissue])[:3]) - renderer_left.AddActor(actor) - - actor_smooth = create_smooth_frog_actor(file_name, tissue_map[tissue], use_flying_edges) - actor_smooth.GetProperty().SetDiffuseColor(lut.GetTableValue(tissue_map[tissue])[:3]) - actor_smooth.GetProperty().SetDiffuse(1.0) - actor_smooth.GetProperty().SetSpecular(.5) - actor_smooth.GetProperty().SetSpecularPower(100) - - renderer_right.AddActor(actor_smooth) - - renderer_left.ResetCamera() - renderer_left.GetActiveCamera().SetViewUp(-1, 0, 0) - renderer_left.GetActiveCamera().Azimuth(180) - renderer_left.ResetCameraClippingRange() - - renderer_left.SetBackground(colors.GetColor3d('LightSteelBlue')) - renderer_right.SetBackground(colors.GetColor3d('LightSteelBlue')) - renderer_right.SetActiveCamera(renderer_left.GetActiveCamera()) - - render_window.SetSize(640, 480) - render_window.SetWindowName('FrogBrain') - render_window.Render() - - render_window_interactor.Start() - - -def create_smooth_frog_actor(file_name, tissue, use_flying_edges): - reader = vtkMetaImageReader() - reader.SetFileName(str(file_name)) - reader.Update() - - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(reader.GetOutputPort()) - - gaussian_radius = 1 - gaussian_standard_deviation = 2.0 - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviations(gaussian_standard_deviation, gaussian_standard_deviation, - gaussian_standard_deviation) - gaussian.SetRadiusFactors(gaussian_radius, gaussian_radius, gaussian_radius) - gaussian.SetInputConnection(select_tissue.GetOutputPort()) - - # iso_value = 63.5 - iso_value = 127.5 - if use_flying_edges: - try: - iso_surface = vtkFlyingEdges3D() - except AttributeError: - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(gaussian.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) - - smoothing_iterations = 20 - pass_band = 0.001 - feature_angle = 60.0 - smoother = vtkWindowedSincPolyDataFilter() - smoother.SetInputConnection(iso_surface.GetOutputPort()) - smoother.SetNumberOfIterations(smoothing_iterations) - smoother.BoundarySmoothingOff() - smoother.FeatureEdgeSmoothingOff() - smoother.SetFeatureAngle(feature_angle) - smoother.SetPassBand(pass_band) - smoother.NonManifoldSmoothingOn() - smoother.NormalizeCoordinatesOff() - smoother.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(smoother.GetOutputPort()) - normals.SetFeatureAngle(feature_angle) - - stripper = vtkStripper() - stripper.SetInputConnection(normals.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(stripper.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - -def create_frog_actor(file_name, tissue, use_flying_edges): - reader = vtkMetaImageReader() - reader.SetFileName(str(file_name)) - reader.Update() - - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(reader.GetOutputPort()) - - iso_value = 63.5 - if use_flying_edges: - try: - iso_surface = vtkFlyingEdges3D() - except AttributeError: - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(select_tissue.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOn() - iso_surface.SetValue(0, iso_value) - - stripper = vtkStripper() - stripper.SetInputConnection(iso_surface.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(stripper.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - -def create_frog_lut(colors): - lut = vtkLookupTable() - lut.SetNumberOfColors(16) - lut.SetTableRange(0, 15) - lut.Build() - - lut.SetTableValue(0, colors.GetColor4d('Black')) - lut.SetTableValue(1, colors.GetColor4d('salmon')) # blood - lut.SetTableValue(2, colors.GetColor4d('beige')) # brain - lut.SetTableValue(3, colors.GetColor4d('orange')) # duodenum - lut.SetTableValue(4, colors.GetColor4d('misty_rose')) # eye_retina - lut.SetTableValue(5, colors.GetColor4d('white')) # eye_white - lut.SetTableValue(6, colors.GetColor4d('tomato')) # heart - lut.SetTableValue(7, colors.GetColor4d('raspberry')) # ileum - lut.SetTableValue(8, colors.GetColor4d('banana')) # kidney - lut.SetTableValue(9, colors.GetColor4d('peru')) # l_intestine - lut.SetTableValue(10, colors.GetColor4d('pink')) # liver - lut.SetTableValue(11, colors.GetColor4d('powder_blue')) # lung - lut.SetTableValue(12, colors.GetColor4d('carrot')) # nerve - lut.SetTableValue(13, colors.GetColor4d('wheat')) # skeleton - lut.SetTableValue(14, colors.GetColor4d('violet')) # spleen - lut.SetTableValue(15, colors.GetColor4d('plum')) # stomach - - return lut - - -def create_tissue_map(): - tissue_map = dict() - tissue_map['blood'] = 1 - tissue_map['brain'] = 2 - tissue_map['duodenum'] = 3 - tissue_map['eyeRetina'] = 4 - tissue_map['eyeWhite'] = 5 - tissue_map['heart'] = 6 - tissue_map['ileum'] = 7 - tissue_map['kidney'] = 8 - tissue_map['intestine'] = 9 - tissue_map['liver'] = 10 - tissue_map['lung'] = 11 - tissue_map['nerve'] = 12 - tissue_map['skeleton'] = 13 - tissue_map['spleen'] = 14 - tissue_map['stomach'] = 15 - - return tissue_map - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - import sys - - data_folder, tissue = get_program_parameters(sys.argv) - - main(data_folder, tissue) diff --git a/data/examples/Visualization/FrogSlice.md b/data/examples/Visualization/FrogSlice.md deleted file mode 100644 index ab4b380..0000000 --- a/data/examples/Visualization/FrogSlice.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -This example uses a dataset derived from a frog. This data was prepared at Lawrence Berkeley National Laboratories and is included with their permission. The data was acquired by physically slicing the frog and photographing the slices. The original segmented data is in the form of tissue masks with one file per tissue. There are 136 slices per tissue and 15 different tissues. Each slice is 470 by 500 pixels. - -To accommodate the volume readers we have in VTK, we processed the mask files and combined them all into one vtkMetaImageReader *.mhd* file. Integer numbers 1–15 to represent the 15 tissues. A similar process was done for the frog skin. - -This example shows a photographic slice of frog (upper left), segmented frog (upper right) and composite of photo and segmentation (bottom). The purple color represents the stomach and the kidneys are yellow. diff --git a/data/examples/Visualization/FrogSlice.py b/data/examples/Visualization/FrogSlice.py deleted file mode 100755 index ef8e7d6..0000000 --- a/data/examples/Visualization/FrogSlice.py +++ /dev/null @@ -1,397 +0,0 @@ -#!/usr/bin/env python - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkImageConstantPad -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture, - vtkWindowLevelLookupTable -) - - -def get_program_parameters(argv): - import argparse - description = 'Visualization of a frog.' - epilogue = ''' -Photographic slice of frog (upper left), segmented frog (upper right) and - composite of photo and segmentation (bottom). -The purple color represents the stomach and the kidneys are yellow. -If slice = 39 it matches Figure 12-6 in the VTK Book. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('data_folder', help='The path to the files: frog.mhd and frogtissue.mhd.') - parser.add_argument('slice_number', default=39, type=int, nargs='?', help='Slice number.') - args = parser.parse_args() - return args.data_folder, args.slice_number - - -def main(data_folder, slice_number): - colors = vtkNamedColors() - - path = Path(data_folder) - if path.is_dir(): - s = '' - fn_1 = path.joinpath('frog').with_suffix('.mhd') - if not fn_1.is_file(): - s += 'The file: {:s} does not exist.\n'.format(str(fn_1)) - print(s) - fn_2 = path.joinpath('frogtissue').with_suffix('.mhd') - if not fn_2.is_file(): - s += 'The file: {:s} does not exist.'.format(str(fn_2)) - if s: - print(s) - return - else: - print('Expected a path to frog.mhs and frogtissue.mhd') - return - - so = SliceOrder() - - # Now create the RenderWindow, Renderer and Interactor - # - ren1 = vtkRenderer() - ren2 = vtkRenderer() - ren3 = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren1) - ren_win.AddRenderer(ren2) - ren_win.AddRenderer(ren3) - ren_win.SetWindowName('FrogSlice') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - grey_reader = vtkMetaImageReader() - grey_reader.SetFileName(str(fn_1)) - grey_reader.Update() - - grey_padder = vtkImageConstantPad() - grey_padder.SetInputConnection(grey_reader.GetOutputPort()) - grey_padder.SetOutputWholeExtent(0, 511, 0, 511, slice_number, slice_number) - grey_padder.SetConstant(0) - - grey_plane = vtkPlaneSource() - - grey_transform = vtkTransformPolyDataFilter() - grey_transform.SetTransform(so.get('hfsi')) - grey_transform.SetInputConnection(grey_plane.GetOutputPort()) - - grey_normals = vtkPolyDataNormals() - grey_normals.SetInputConnection(grey_transform.GetOutputPort()) - grey_normals.FlipNormalsOff() - - wllut = vtkWindowLevelLookupTable() - wllut.SetWindow(255) - wllut.SetLevel(128) - wllut.SetTableRange(0, 255) - wllut.Build() - - grey_mapper = vtkPolyDataMapper() - grey_mapper.SetInputConnection(grey_plane.GetOutputPort()) - - grey_texture = vtkTexture() - grey_texture.SetInputConnection(grey_padder.GetOutputPort()) - grey_texture.SetLookupTable(wllut) - grey_texture.SetColorModeToMapScalars() - grey_texture.InterpolateOn() - - grey_actor = vtkActor() - grey_actor.SetMapper(grey_mapper) - grey_actor.SetTexture(grey_texture) - - segment_reader = vtkMetaImageReader() - segment_reader.SetFileName(str(fn_2)) - segment_reader.Update() - - segment_padder = vtkImageConstantPad() - segment_padder.SetInputConnection(segment_reader.GetOutputPort()) - segment_padder.SetOutputWholeExtent(0, 511, 0, 511, slice_number, slice_number) - segment_padder.SetConstant(0) - - segment_plane = vtkPlaneSource() - - segment_transform = vtkTransformPolyDataFilter() - segment_transform.SetTransform(so.get('hfsi')) - segment_transform.SetInputConnection(segment_plane.GetOutputPort()) - - segment_normals = vtkPolyDataNormals() - segment_normals.SetInputConnection(segment_transform.GetOutputPort()) - segment_normals.FlipNormalsOn() - - lut = create_frog_lut(colors) - - segment_mapper = vtkPolyDataMapper() - segment_mapper.SetInputConnection(segment_plane.GetOutputPort()) - - segment_texture = vtkTexture() - segment_texture.SetInputConnection(segment_padder.GetOutputPort()) - segment_texture.SetLookupTable(lut) - segment_texture.SetColorModeToMapScalars() - segment_texture.InterpolateOff() - - segment_actor = vtkActor() - segment_actor.SetMapper(segment_mapper) - segment_actor.SetTexture(segment_texture) - - segment_overlay_actor = vtkActor() - segment_overlay_actor.SetMapper(segment_mapper) - segment_overlay_actor.SetTexture(segment_texture) - - segment_overlay_actor.GetProperty().SetOpacity(.5) - ren1.SetBackground(0, 0, 0) - ren1.SetViewport(0, 0.5, 0.5, 1) - ren_win.SetSize(640, 480) - ren1.AddActor(grey_actor) - - ren2.SetBackground(0, 0, 0) - ren2.SetViewport(0.5, 0.5, 1, 1) - ren2.AddActor(segment_actor) - - cam1 = vtkCamera() - cam1.SetViewUp(0, -1, 0) - cam1.SetPosition(0, 0, -1) - ren1.SetActiveCamera(cam1) - ren1.ResetCamera() - cam1.SetViewUp(0, -1, 0) - cam1.SetPosition(0.0554068, -0.0596001, -0.491383) - cam1.SetFocalPoint(0.0554068, -0.0596001, 0) - ren1.ResetCameraClippingRange() - - ren3.AddActor(grey_actor) - ren3.AddActor(segment_overlay_actor) - segment_overlay_actor.SetPosition(0, 0, -0.01) - - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren2.SetBackground(colors.GetColor3d('SlateGray')) - ren3.SetBackground(colors.GetColor3d('SlateGray')) - - ren3.SetViewport(0, 0, 1, 0.5) - - ren2.SetActiveCamera(ren1.GetActiveCamera()) - ren3.SetActiveCamera(ren1.GetActiveCamera()) - - ren_win.Render() - iren.Start() - - -def create_frog_lut(colors): - lut = vtkLookupTable() - lut.SetNumberOfColors(16) - lut.SetTableRange(0, 15) - lut.Build() - - lut.SetTableValue(0, colors.GetColor4d('Black')) - lut.SetTableValue(1, colors.GetColor4d('salmon')) # blood - lut.SetTableValue(2, colors.GetColor4d('beige')) # brain - lut.SetTableValue(3, colors.GetColor4d('orange')) # duodenum - lut.SetTableValue(4, colors.GetColor4d('misty_rose')) # eye_retina - lut.SetTableValue(5, colors.GetColor4d('white')) # eye_white - lut.SetTableValue(6, colors.GetColor4d('tomato')) # heart - lut.SetTableValue(7, colors.GetColor4d('raspberry')) # ileum - lut.SetTableValue(8, colors.GetColor4d('banana')) # kidney - lut.SetTableValue(9, colors.GetColor4d('peru')) # l_intestine - lut.SetTableValue(10, colors.GetColor4d('pink')) # liver - lut.SetTableValue(11, colors.GetColor4d('powder_blue')) # lung - lut.SetTableValue(12, colors.GetColor4d('carrot')) # nerve - lut.SetTableValue(13, colors.GetColor4d('wheat')) # skeleton - lut.SetTableValue(14, colors.GetColor4d('violet')) # spleen - lut.SetTableValue(15, colors.GetColor4d('plum')) # stomach - - return lut - - -class SliceOrder: - """ - These transformations permute image and other geometric data to maintain proper - orientation regardless of the acquisition order. After applying these transforms with - vtkTransformFilter, a view up of 0,-1,0 will result in the body part - facing the viewer. - NOTE: some transformations have a -1 scale factor for one of the components. - To ensure proper polygon orientation and normal direction, you must - apply the vtkPolyDataNormals filter. - - Naming (the nomenclature is medical): - si - superior to inferior (top to bottom) - is - inferior to superior (bottom to top) - ap - anterior to posterior (front to back) - pa - posterior to anterior (back to front) - lr - left to right - rl - right to left - """ - - def __init__(self): - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) - - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) - - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) - - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) - - """ - The previous transforms assume radiological views of the slices (viewed from the feet). other - modalities such as physical sectioning may view from the head. These transforms modify the original - with a 180° rotation about y - """ - - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) - - def s_i(self): - t = vtkTransform() - t.SetMatrix(self.si_mat) - return t - - def i_s(self): - t = vtkTransform() - t.SetMatrix(self.is_mat) - return t - - @staticmethod - def a_p(): - t = vtkTransform() - return t.Scale(1, -1, 1) - - @staticmethod - def p_a(): - t = vtkTransform() - return t.Scale(1, -1, -1) - - def l_r(self): - t = vtkTransform() - t.SetMatrix(self.lr_mat) - t.Update() - return t - - def r_l(self): - t = vtkTransform() - t.SetMatrix(self.lr_mat) - return t - - def h_f(self): - t = vtkTransform() - t.SetMatrix(self.hf_mat) - return t - - def hf_si(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Concatenate(self.si_mat) - return t - - def hf_is(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Concatenate(self.is_mat) - return t - - def hf_ap(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Scale(1, -1, 1) - return t - - def hf_pa(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Scale(1, -1, -1) - return t - - def hf_lr(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Concatenate(self.lr_mat) - return t - - def hf_rl(self): - t = vtkTransform() - t.Concatenate(self.hf_mat) - t.Concatenate(self.rl_mat) - return t - - def get(self, order): - """ - Returns the vtkTransform corresponding to the slice order. - - :param order: The slice order - :return: The vtkTransform to use - """ - if order == 'si': - return self.s_i() - elif order == 'is': - return self.i_s() - elif order == 'ap': - return self.a_p() - elif order == 'pa': - return self.p_a() - elif order == 'lr': - return self.l_r() - elif order == 'rl': - return self.r_l() - elif order == 'hf': - return self.h_f() - elif order == 'hfsi': - return self.hf_si() - elif order == 'hfis': - return self.hf_is() - elif order == 'hfap': - return self.hf_ap() - elif order == 'hfpa': - return self.hf_pa() - elif order == 'hflr': - return self.hf_lr() - elif order == 'hfrl': - return self.hf_rl() - else: - s = 'No such transform "{:s}" exists.'.format(order) - raise Exception(s) - - -if __name__ == '__main__': - import sys - - data_folder, slice_number = get_program_parameters(sys.argv) - main(data_folder, slice_number) diff --git a/data/examples/Visualization/FroggieSurface.md b/data/examples/Visualization/FroggieSurface.md deleted file mode 100644 index adbaf0a..0000000 --- a/data/examples/Visualization/FroggieSurface.md +++ /dev/null @@ -1,47 +0,0 @@ -### Description - -Construct surfaces from a segmented frog dataset. Up to fifteen different surfaces may be extracted. The example, `FroggieView` is similar to this example and uses sliders to control the opacities of the tissues. - -By default the frog is oriented so that we look down on the dorsal (posterior) surface and the superior surface faces the top of the screen. The frog is rendered with the skin being translucent so that you can see the internal organs. - -In the lower left of the image there is a prop assembly with labelled XYZ axes and a cube labelled with anatomical orientations: - -- **Sagittal plane** - - L - left - - R - right -- **Coronal plane** - - A - anterior - - P - posterior -- **Transverse plane** - - S - superior - - I - inferior - -This prop assembly can be moved and resized. - -Individual tissues can be specified by using the "**-t**" option e.g. "**-t skin skeleton**". - -We use vtkFlyingEdges3D to take the 3D structured point set and generate the iso-surfaces. However, if desired, you can specify vtkMarchingCubes instead, use the option "**-m**". - -The parameters used to generate the example image are loaded from a JSON file containing the data needed to access and generate the actors for each tissue along with other supplementary data such as the data file names. This means that the user need only load this one file in order to generate the data for rendering. This file is called: - -``` text -/Frog_mhd.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [Frog_mhd_format](../../Documentation/Frog_mhd_format.md). - -The code uses a general way of specifying transformations that can permute image and other geometric data in order to maintain proper orientation regardless of the acquisition order. See the class `SliceOrder`. - -The dataset was prepared at the Lawrence Berkeley National Laboratories and is included with their permission. The data was acquired by physically slicing the frog and photographing the slices. The original segmented data is in the form of tissue masks with one file per tissue. There are 136 slices per tissue and 15 different tissues. Each slice is 470 by 500 pixels. - -To accommodate the volume readers in VTK, the mask files were processed and combined into one vtkMetaImageReader file, called `frogtissue.mhd`. Integer numbers 1-15 are used to represent the 15 tissues. A similar process was done for the frog skin with the result being stored in a file called `frog.mhd`. - -Further information: - -- [VTK Examples - FroggieSurface and FroggieView](https://discourse.vtk.org/t/vtk-examples-froggiesurface-and-froggieview/11952) - - -!!! info - Mutually exclusive options "**-a, -b, -c, -d**" are provided to let you generate approximations to the following figures: [Figure 12-9a](../../../VTKBook/12Chapter12/#Figure%2012-9a), [Figure 12-9b](../../../VTKBook/12Chapter12/#Figure%2012-9b), [Figure 12-9c](../../../VTKBook/12Chapter12/#Figure%2012-9c), and [Figure 12-9d](../../../VTKBook/12Chapter12/#Figure%2012-9d) in [Chapter 12](../../../VTKBook/12Chapter12) of the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/FroggieSurface.py b/data/examples/Visualization/FroggieSurface.py deleted file mode 100755 index 0cab6d9..0000000 --- a/data/examples/Visualization/FroggieSurface.py +++ /dev/null @@ -1,767 +0,0 @@ -#!/usr/bin/env python3 - -import copy -import json -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkDecimatePro, - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkPolyDataNormals, - vtkStripper, - vtkWindowedSincPolyDataFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import ( - vtkImageShrink3D, - vtkImageThreshold -) -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkImagingMorphological import vtkImageIslandRemoval2D -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget -) -from vtkmodules.vtkRenderingAnnotation import ( - vtkAnnotatedCubeActor, - vtkAxesActor -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropAssembly, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(argv): - import argparse - description = 'Construct surfaces from a segmented frog dataset.' - epilogue = ''' -Up to fifteen different surfaces may be extracted. - -Note: - If you want to use brainbin (the brain with no gaussian smoothing), - instead of brain, then request it with -t brainbin - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - - group = parser.add_mutually_exclusive_group() - group.add_argument('-a', action='store_const', dest='view', const='a', - help='The view corresponds to Fig 12-9a in the VTK Textbook') - group.add_argument('-b', action='store_const', dest='view', const='b', - help='The view corresponds to Fig 12-9b in the VTK Textbook') - group.add_argument('-c', action='store_const', dest='view', const='c', - help='The view corresponds to Fig 12-9c in the VTK Textbook') - group.add_argument('-d', action='store_const', dest='view', const='d', - help='The view corresponds to Fig 12-9d in the VTK Textbook') - group.add_argument('-l', action='store_const', dest='view', const='l', - help='The view corresponds to looking down on the anterior surface') - group.add_argument('-p', action='store_const', dest='view', const='p', - help='The view corresponds to looking down on the posterior surface (the default)') - parser.set_defaults(type=None) - - parser.add_argument('file_name', help='The path to the JSON file e.g. Frog_mhd.json.') - parser.add_argument('-t', nargs='+', dest='tissues', action='append', help='Select one or more tissues.') - parser.add_argument('-m', action='store_false', dest='flying_edges', - help='Use flying edges by default, marching cubes if set.') - # -o: obliterate a synonym for decimation. - parser.add_argument('-o', action='store_true', dest='decimation', help='Decimate if set.') - args = parser.parse_args() - return args.file_name, args.view, args.tissues, args.flying_edges, args.decimation - - -def main(fn, select_figure, chosen_tissues, flying_edges, decimate): - if not select_figure: - select_figure = 'p' - - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - parsed_ok, parameters = parse_json(fn_path) - if not parsed_ok: - print('Unable to parse the JSON file.') - return - - tissues = list() - indices = dict() - for n in parameters['names']: - if n != 'brainbin': - tissues.append(n) - indices[n] = parameters[n]['tissue'] - color_lut = create_tissue_lut(indices, parameters['colors']) - - if select_figure: - if select_figure == 'b': - # No skin. - tissues = parameters['fig12-9b'] - if select_figure in ['c', 'd']: - # No skin, blood and skeleton. - tissues = parameters['fig12-9cd'] - - if chosen_tissues: - chosen_tissues = [x.lower() for x in chosen_tissues[0]] - res = list() - has_brainbin = False - if 'brainbin' in chosen_tissues: - print('Using brainbin instead of brain.') - res.append('brainbin') - indices.pop('brain', None) - indices['brainbin'] = 2 - parameters['colors'].pop('brain', None) - parameters['colors']['brainbin'] = 'beige' - has_brainbin = True - for ct in chosen_tissues: - if has_brainbin and ct in ['brain', 'brainbin']: - continue - if ct in tissues: - res.append(ct) - else: - print(f'Tissue: {ct} is not available.') - print(f'Available tissues are: {", ".join(tissues)} and brainbin') - return - if len(res) == 1 and 'skin' in res: - parameters['skin']['opacity'] = 1.0 - tissues = res - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - # Setup render window, renderer, and interactor. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - color_size = len(max(parameters['colors'].values(), key=len)) - name_size = len(max(parameters['names'], key=len)) - int_size = 2 - line = '-' * (7 + name_size + color_size) - res = [line, - f'{"Tissue":<{name_size}s}{" Label "}{"Color"}', - line] - - so = SliceOrder() - - for name in tissues: - actor = create_tissue_actor(name, parameters[name], parameters['mhd_files'], flying_edges, decimate, - color_lut, so) - ren.AddActor(actor) - res.append(f'{name:<{name_size}s} {indices[name]:{int_size + 3}d} {parameters["colors"][name]:<{color_size}s}') - - res.append(line) - print('\n'.join(res)) - - ren_win.SetSize(1024, 1024) - ren_win.SetWindowName('FroggieSurface') - - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - - # Final view. - camera = ren.GetActiveCamera() - # Superior Anterior Left - labels = 'sal' - if select_figure == 'a': - # Fig 12-9a in the VTK Textbook - camera.SetPosition(742.731237, -441.329635, -877.192015) - camera.SetFocalPoint(247.637687, 120.680880, -253.487473) - camera.SetViewUp(-0.323882, -0.816232, 0.478398) - camera.SetDistance(974.669585) - camera.SetClippingRange(311.646383, 1803.630763) - elif select_figure == 'b': - # Fig 12-9b in the VTK Textbook - camera.SetPosition(717.356065, -429.889054, -845.381584) - camera.SetFocalPoint(243.071719, 100.996487, -247.446340) - camera.SetViewUp(-0.320495, -0.820148, 0.473962) - camera.SetDistance(929.683631) - camera.SetClippingRange(293.464446, 1732.794957) - elif select_figure == 'c': - # Fig 12-9c in the VTK Textbook - camera.SetPosition(447.560023, -136.611491, -454.753689) - camera.SetFocalPoint(253.142277, 91.949451, -238.583973) - camera.SetViewUp(-0.425438, -0.786048, 0.448477) - camera.SetDistance(369.821187) - camera.SetClippingRange(0.829116, 829.115939) - elif select_figure == 'd': - # Fig 12-9d in the VTK Textbook - camera.SetPosition(347.826249, -469.633647, -236.234262) - camera.SetFocalPoint(296.893207, 89.307704, -225.156581) - camera.SetViewUp(-0.687345, -0.076948, 0.722244) - camera.SetDistance(561.366478) - camera.SetClippingRange(347.962064, 839.649856) - elif select_figure == 'l': - # Orient so that we look down on the anterior surface and - # the superior surface faces the top of the screen. - # Left Superior Anterior - labels = 'lsa' - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() - else: - # The default. - # Orient so that we look down on the posterior surface and - # the superior surface faces the top of the screen. - # Right Superior Posterior - labels = 'rsp' - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(-90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() - - cow = vtkCameraOrientationWidget() - cow.SetParentRenderer(ren) - # Turn off if you do not want it. - cow.On() - cow.EnabledOn() - - axes = make_cube_actor(labels, colors) - om = vtkOrientationMarkerWidget() - om.SetOrientationMarker(axes) - # Position upper left in the viewport. - # om.SetViewport(0.0, 0.8, 0.2, 1.0) - # Position lower left in the viewport. - om.SetViewport(0, 0, 0.2, 0.2) - om.SetInteractor(iren) - om.EnabledOn() - om.InteractiveOn() - - ren_win.Render() - - iren.Start() - - -def parse_json(fn_path): - """ - Parse the JSON file selecting the components that we want. - - We also check that the file paths are valid. - - :param fn_path: The path the JSON file. - :return: A dictionary of the parameters that we require. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - paths_ok = True - parameters = dict() - # The names of the tissues as a list. - parameters['names'] = list() - for k, v in json_data.items(): - if k == 'files': - if 'root' in v: - root = Path(v['root']) - if not root.exists(): - print(f'Bad path: {root}') - paths_ok = False - else: - if 'mhd_files' not in v: - print('Expected mhd files.') - paths_ok = False - continue - for kk in v: - if kk == 'mhd_files': - if len(v[kk]) != 2: - print(f'Expected two file names.') - paths_ok = False - # The stem of the file path becomes the key. - path_map = dict() - for p in list(map(lambda pp: root / pp, v[kk])): - path_map[p.stem] = p - if not p.is_file(): - paths_ok = False - print(f'Not a file {p}') - if paths_ok: - parameters[kk] = path_map - else: - paths_ok = False - print('Missing the key "root" and/or the key "files" for the files.') - else: - if k in ['tissues', 'figures']: - for kk, vv in v.items(): - parameters[kk] = vv - if k == "tissue_parameters": - # Assemble the parameters for each tissue. - # Create the base parameters. - bp = dict() - for kk, vv in v['default'].items(): - bp[kk.lower()] = vv - frog = copy.deepcopy(bp) - for kk, vv in v['frog'].items(): - frog[kk.lower()] = vv - for kk, vv in v.items(): - if kk not in ['default', 'frog', 'parameter types']: - if kk == 'skin': - parameters[kk] = copy.deepcopy(bp) - else: - parameters[kk] = copy.deepcopy(frog) - for kkk, vvv in vv.items(): - parameters[kk][kkk.lower()] = vvv - if kkk == 'NAME': - parameters['names'].append(vvv) - return paths_ok, parameters - - -def create_tissue_actor(name, tissue, files, flying_edges, decimate, lut, so): - """ - Create the actor for a specific tissue. - - :param name: The tissue name. - :param tissue: The tissue parameters. - :param files: The path to the tissue files. - :param flying_edges: If true use flying edges. - :param decimate: If true decimate. - :param lut: The color lookup table for the tissues. - :param so: The transforms corresponding to the slice order. - :return: The actor. - """ - - pixel_size = tissue['pixel_size'] - spacing = tissue['spacing'] - start_slice = tissue['start_slice'] - data_spacing = [pixel_size, pixel_size, spacing] - columns = tissue['columns'] - rows = tissue['rows'] - data_origin = [-(columns / 2.0) * pixel_size, -(rows / 2.0) * pixel_size, start_slice * spacing] - - voi = [ - tissue['start_column'], - tissue['end_column'], - tissue['start_row'], - tissue['end_row'], - tissue['start_slice'], - tissue['end_slice'], - ] - # Adjust y bounds for PNM coordinate system. - tmp = voi[2] - voi[2] = rows - voi[3] - 1 - voi[3] = rows - tmp - 1 - - if name == 'skin': - fn = files['frog'] - else: - fn = files['frogtissue'] - - reader = vtkMetaImageReader() - reader.SetFileName(str(fn)) - reader.SetDataSpacing(data_spacing) - reader.SetDataOrigin(data_origin) - reader.SetDataExtent(voi) - reader.Update() - - last_connection = reader - - if not name == 'skin': - if tissue['island_replace'] >= 0: - island_remover = vtkImageIslandRemoval2D() - island_remover.SetAreaThreshold(tissue['island_area']) - island_remover.SetIslandValue(tissue['island_replace']) - island_remover.SetReplaceValue(tissue['tissue']) - island_remover.SetInput(last_connection.GetOutput()) - island_remover.Update() - last_connection = island_remover - - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue['tissue'], tissue['tissue']) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(last_connection.GetOutputPort()) - last_connection = select_tissue - - sample_rate = [ - tissue['sample_rate_column'], - tissue['sample_rate_row'], - tissue['sample_rate_slice'], - ] - - shrinker = vtkImageShrink3D() - shrinker.SetInputConnection(last_connection.GetOutputPort()) - shrinker.SetShrinkFactors(sample_rate) - shrinker.AveragingOn() - last_connection = shrinker - - gsd = [ - tissue['gaussian_standard_deviation_column'], - tissue['gaussian_standard_deviation_row'], - tissue['gaussian_standard_deviation_slice'], - ] - - if not all(v == 0 for v in gsd): - grf = [ - tissue['gaussian_radius_factor_column'], - tissue['gaussian_radius_factor_row'], - tissue['gaussian_radius_factor_slice'], - ] - - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviation(*gsd) - gaussian.SetRadiusFactors(*grf) - gaussian.SetInputConnection(shrinker.GetOutputPort()) - last_connection = gaussian - - iso_value = tissue['value'] - if flying_edges: - iso_surface = vtkFlyingEdges3D() - iso_surface.SetInputConnection(last_connection.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) - iso_surface.Update() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(last_connection.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) - iso_surface.Update() - - transform = so.get(tissue['slice_order']) - tf = vtkTransformPolyDataFilter() - tf.SetTransform(transform) - tf.SetInputConnection(iso_surface.GetOutputPort()) - last_connection = tf - - if decimate: - decimator = vtkDecimatePro() - decimator.SetInputConnection(last_connection.GetOutputPort()) - decimator.SetFeatureAngle(tissue['decimate_angle']) - decimator.PreserveTopologyOn() - decimator.SetErrorIsAbsolute(1) - decimator.SetAbsoluteError(tissue['decimate_error']) - decimator.SetTargetReduction(tissue['decimate_reduction']) - last_connection = decimator - - smooth_iterations = tissue['smooth_iterations'] - if smooth_iterations != 0: - smoother = vtkWindowedSincPolyDataFilter() - smoother.SetInputConnection(last_connection.GetOutputPort()) - smoother.BoundarySmoothingOff() - smoother.FeatureEdgeSmoothingOff() - smoother.SetFeatureAngle(tissue['smooth_angle']) - smoother.SetPassBand(tissue['smooth_factor']) - smoother.NonManifoldSmoothingOn() - smoother.NormalizeCoordinatesOff() - last_connection = smoother - - normals = vtkPolyDataNormals() - normals.SetInputConnection(last_connection.GetOutputPort()) - normals.SetFeatureAngle(tissue['feature_angle']) - - stripper = vtkStripper() - stripper.SetInputConnection(normals.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(stripper.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetOpacity(tissue['opacity']) - actor.GetProperty().SetDiffuseColor(lut.GetTableValue(tissue['tissue'])[:3]) - actor.GetProperty().SetSpecular(0.5) - actor.GetProperty().SetSpecularPower(10) - - return actor - - -class SliceOrder: - """ - These transformations permute image and other geometric data to maintain proper - orientation regardless of the acquisition order. After applying these transforms with - vtkTransformFilter, a view up of 0, -1, 0 will result in the body part - facing the viewer. - NOTE: some transformations have a -1 scale factor for one of the components. - To ensure proper polygon orientation and normal direction, you must - apply the vtkPolyDataNormals filter. - - Naming (the nomenclature is medical): - si - superior to inferior (top to bottom) - is - inferior to superior (bottom to top) - ap - anterior to posterior (front to back) - pa - posterior to anterior (back to front) - lr - left to right - rl - right to left - """ - - def __init__(self): - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) - - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) - - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) - - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) - - """ - The previous transforms assume radiological views of the slices - (viewed from the feet). - Other modalities such as physical sectioning may view from the head. - The following transforms modify the original with a 180° rotation about y - """ - - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) - - self.transform = dict() - - si_trans = vtkTransform() - si_trans.SetMatrix(self.si_mat) - self.transform['si'] = si_trans - - is_trans = vtkTransform() - is_trans.SetMatrix(self.is_mat) - self.transform['is'] = is_trans - - ap_trans = vtkTransform() - ap_trans.Scale(1, -1, 1) - self.transform['ap'] = ap_trans - - pa_trans = vtkTransform() - pa_trans.Scale(1, -1, -1) - self.transform['pa'] = pa_trans - - lr_trans = vtkTransform() - lr_trans.SetMatrix(self.lr_mat) - self.transform['lr'] = lr_trans - - rl_trans = vtkTransform() - rl_trans.SetMatrix(self.rl_mat) - self.transform['rl'] = rl_trans - - hf_trans = vtkTransform() - hf_trans.SetMatrix(self.hf_mat) - self.transform['hf'] = hf_trans - - hf_si_trans = vtkTransform() - hf_si_trans.SetMatrix(self.hf_mat) - hf_si_trans.Concatenate(self.si_mat) - self.transform['hfsi'] = hf_si_trans - - hf_is_trans = vtkTransform() - hf_is_trans.SetMatrix(self.hf_mat) - hf_is_trans.Concatenate(self.is_mat) - self.transform['hfis'] = hf_is_trans - - hf_ap_trans = vtkTransform() - hf_ap_trans.SetMatrix(self.hf_mat) - hf_ap_trans.Scale(1, -1, 1) - self.transform['hfap'] = hf_ap_trans - - hf_pa_trans = vtkTransform() - hf_pa_trans.SetMatrix(self.hf_mat) - hf_pa_trans.Scale(1, -1, -1) - self.transform['hfpa'] = hf_pa_trans - - hf_lr_trans = vtkTransform() - hf_lr_trans.SetMatrix(self.hf_mat) - hf_lr_trans.Concatenate(self.lr_mat) - self.transform['hflr'] = hf_lr_trans - - hf_rl_trans = vtkTransform() - hf_rl_trans.SetMatrix(self.hf_mat) - hf_rl_trans.Concatenate(self.rl_mat) - self.transform['hfrl'] = hf_rl_trans - - def print_transform(self, order): - """ - Print the homogenous matrix corresponding to the slice order. - :param order: The slice order. - :return: - """ - print(order) - m = self.transform[order].GetMatrix() - for i in range(0, 4): - row = list() - for j in range(0, 4): - row.append(f'{m.GetElement(i, j):6.2g}') - print(' '.join(row)) - - def print_all_transforms(self): - """ - Print all the homogenous matrices corresponding to the slice orders. - :return: - """ - for k in self.transform.keys(): - self.print_transform(k) - - def get(self, order): - """ - Returns the vtkTransform corresponding to the slice order. - - :param order: The slice order. - :return: The vtkTransform to use. - """ - if order in self.transform.keys(): - return self.transform[order] - else: - s = 'No such transform "{:s}" exists.'.format(order) - raise Exception(s) - - -def create_tissue_lut(indices, colors): - """ - Create the lookup table for the frog tissues. - - Each table value corresponds the color of one of the frog tissues. - - :param indices: The tissue name and index. - :param colors: The tissue name and color. - :return: The lookup table. - """ - lut = vtkLookupTable() - lut.SetNumberOfColors(len(colors)) - lut.SetTableRange(0, len(colors) - 1) - lut.Build() - - nc = vtkNamedColors() - - for k in indices.keys(): - lut.SetTableValue(indices[k], nc.GetColor4d(colors[k])) - - return lut - - -def make_axes_actor(scale, xyz_labels): - """ - :param scale: Sets the scale and direction of the axes. - :param xyz_labels: Labels for the axes. - :return: The axes actor. - """ - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyz_labels[0]) - axes.SetYAxisLabelText(xyz_labels[1]) - axes.SetZAxisLabelText(xyz_labels[2]) - axes.SetCylinderRadius(0.5 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.025 * axes.GetConeRadius()) - axes.SetSphereRadius(1.5 * axes.GetSphereRadius()) - tprop = axes.GetXAxisCaptionActor2D().GetCaptionTextProperty() - tprop.ItalicOn() - tprop.ShadowOn() - tprop.SetFontFamilyToTimes() - # Use the same text properties on the other two axes. - axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - return axes - - -def make_annotated_cube_actor(cube_labels, colors): - """ - :param cube_labels: The labels for the cube faces. - :param colors: Used to determine the cube color. - :return: The annotated cube actor. - """ - # A cube with labeled faces. - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText(cube_labels[0]) - cube.SetXMinusFaceText(cube_labels[1]) - cube.SetYPlusFaceText(cube_labels[2]) - cube.SetYMinusFaceText(cube_labels[3]) - cube.SetZPlusFaceText(cube_labels[4]) - cube.SetZMinusFaceText(cube_labels[5]) - cube.SetFaceTextScale(0.5) - cube.GetCubeProperty().SetColor(colors.GetColor3d('Gainsboro')) - - cube.GetTextEdgesProperty().SetColor(colors.GetColor3d('LightSlateGray')) - - # Change the vector text colors. - cube.GetXPlusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetXMinusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetYPlusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetYMinusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetZPlusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - cube.GetZMinusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - return cube - - -def make_cube_actor(label_selector, colors): - """ - :param label_selector: The selector used to define labels for the axes and cube. - :param colors: Used to set the colors of the cube faces. - :return: The combined axes and annotated cube prop. - """ - if label_selector == 'sal': - # xyz_labels = ['S', 'A', 'L'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['S', 'I', 'A', 'P', 'L', 'R'] - scale = [1.5, 1.5, 1.5] - elif label_selector == 'rsp': - # xyz_labels = ['R', 'S', 'P'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['R', 'L', 'S', 'I', 'P', 'A'] - scale = [1.5, 1.5, 1.5] - elif label_selector == 'lsa': - # xyz_labels = ['L', 'S', 'A'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['L', 'R', 'S', 'I', 'A', 'P'] - scale = [1.5, 1.5, 1.5] - else: - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['+X', '-X', '+Y', '-Y', '+Z', '-Z'] - scale = [1.5, 1.5, 1.5] - - # We are combining a vtkAxesActor and a vtkAnnotatedCubeActor - # into a vtkPropAssembly - cube = make_annotated_cube_actor(cube_labels, colors) - axes = make_axes_actor(scale, xyz_labels) - - # Combine orientation markers into one with an assembly. - assembly = vtkPropAssembly() - assembly.AddPart(axes) - assembly.AddPart(cube) - return assembly - - -if __name__ == '__main__': - import sys - - data_folder, view, selected_tissues, use_flying_edges, use_decimate = get_program_parameters(sys.argv) - main(data_folder, view, selected_tissues, use_flying_edges, use_decimate) diff --git a/data/examples/Visualization/FroggieView.md b/data/examples/Visualization/FroggieView.md deleted file mode 100644 index 3454e77..0000000 --- a/data/examples/Visualization/FroggieView.md +++ /dev/null @@ -1,48 +0,0 @@ -### Description - -View surfaces of a segmented frog dataset using preprocessed `*.vtk` tissue files. This means that loading and processing is much faster when comapred with `FroggieSurface`. - -FroggieView provides the ability to turn on and off surfaces, control their opacity through the use of sliders and control the camera position. - -By default the frog is oriented so that we look down on the dorsal (posterior) surface and the superior surface faces the top of the screen. The frog is rendered with the skin being translucent so that you can see the internal organs. - -In the lower left of the image there is a prop assembly with labelled XYZ axes and a cube labelled with anatomical orientations: - -- **Sagittal plane** - - L - left - - R - right -- **Coronal plane** - - A - anterior - - P - posterior -- **Transverse plane** - - S - superior - - I - inferior - -This prop assembly can be moved and resized. - -The opacity of each tissue is controlled by a slider, additionally you can turn all the sliders on or off by pressing the "**n**" key. - -If the option "**-n**" is selected, no sliders will displayed. - -Individual tissues can be specified by using the "**-t**" option e.g. "**-t skin skeleton**". - -The parameters used to generate the example image are loaded from a JSON file containing the data needed to access and generate the actors for each tissue along with other supplementary data such as the data file names. This means that the user need only load this one file in order to generate the data for rendering. This file is called: - -``` text -/Frog_vtk.json -``` - -Where `` is the path to `?vtk-?examples/src/Testing/Data`. - -For information about the parameters in the JSON file, please see [Frog_vtk_format](../../Documentation/Frog_vtk_format.md). - -The code uses a general way of specifying transformations that can permute image and other geometric data in order to maintain proper orientation regardless of the acquisition order. See the class `SliceOrder`. - -The dataset was prepared at the Lawrence Berkeley National Laboratories. It is included with their permission. The data was acquired by physically slicing the frog and photographing the slices. The original segmented data is in the form of tissue masks with one file per tissue. There are 136 slices per tissue and 15 different tissues. Each slice is 470 by 500 pixels. - -Further information: - -- [VTK Examples - FroggieSurface and FroggieView](https://discourse.vtk.org/t/vtk-examples-froggiesurface-and-froggieview/11952) - -!!! info - Mutually exclusive options "**-a -b -c -d**" are provided to let you generate approximations to the following figures: [Figure 12-9a](../../../VTKBook/12Chapter12/#Figure%2012-9a), [Figure 12-9b](../../../VTKBook/12Chapter12/#Figure%2012-9b), [Figure 12-9c](../../../VTKBook/12Chapter12/#Figure%2012-9c), and [Figure 12-9d](../../../VTKBook/12Chapter12/#Figure%2012-9d) in [Chapter 12](../../../VTKBook/12Chapter12) of the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/FroggieView.py b/data/examples/Visualization/FroggieView.py deleted file mode 100755 index b91b557..0000000 --- a/data/examples/Visualization/FroggieView.py +++ /dev/null @@ -1,754 +0,0 @@ -#!/usr/bin/env python3 - -import json -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkLookupTable -) -from vtkmodules.vtkCommonMath import vtkMatrix4x4 -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkOrientationMarkerWidget, - vtkSliderRepresentation2D, - vtkSliderWidget -) -from vtkmodules.vtkRenderingAnnotation import ( - vtkAxesActor, - vtkAnnotatedCubeActor, -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropAssembly, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(argv): - import argparse - description = 'View surfaces of a segmented frog dataset using preprocessed VTK tissue files.' - epilogue = ''' -Sliders are provided to control the opacity of the displayed tissues. -Up to fifteen different surfaces may be viewed. - -Note: - If you want to use brainbin (the brain with no gaussian smoothing), - instead of brain, then request it with -t brainbin - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - - group = parser.add_mutually_exclusive_group() - group.add_argument('-a', action='store_const', dest='view', const='a', - help='The view corresponds to Fig 12-9a in the VTK Textbook') - group.add_argument('-b', action='store_const', dest='view', const='b', - help='The view corresponds to Fig 12-9b in the VTK Textbook') - group.add_argument('-c', action='store_const', dest='view', const='c', - help='The view corresponds to Fig 12-9c in the VTK Textbook') - group.add_argument('-d', action='store_const', dest='view', const='d', - help='The view corresponds to Fig 12-9d in the VTK Textbook') - group.add_argument('-l', action='store_const', dest='view', const='l', - help='The view corresponds to looking down on the anterior surface') - group.add_argument('-p', action='store_const', dest='view', const='p', - help='The view corresponds to looking down on the posterior surface (the default)') - parser.set_defaults(type=None) - - parser.add_argument('file_name', help='The path to the JSON file e.g. Frog_vtk.json.') - parser.add_argument('-n', action='store_true', dest='omit_sliders', help='No sliders.') - parser.add_argument('-t', nargs='+', dest='tissues', action='append', help='Select one or more tissues.') - args = parser.parse_args() - return args.file_name, args.view, args.omit_sliders, args.tissues - - -def main(fn, select_figure, no_sliders, chosen_tissues): - if not select_figure: - select_figure = 'p' - - fn_path = Path(fn) - if not fn_path.suffix: - fn_path = fn_path.with_suffix(".json") - if not fn_path.is_file(): - print('Unable to find: ', fn_path) - parsed_ok, parameters = parse_json(fn_path) - if not parsed_ok: - print('Unable to parse the JSON file.') - return - - color_lut = create_tissue_lut(parameters['indices'], parameters['colors']) - - tissues = parameters['names'] - if select_figure: - if select_figure == 'b': - # No skin. - tissues = parameters['fig12-9b'] - if select_figure in ['c', 'd']: - # No skin, blood and skeleton. - tissues = parameters['fig12-9cd'] - - if chosen_tissues: - chosen_tissues = [x.lower() for x in chosen_tissues[0]] - res = list() - has_brainbin = False - if 'brainbin' in chosen_tissues: - print('Using brainbin instead of brain.') - res.append('brainbin') - parameters['indices'].pop('brain', None) - parameters['indices']['brainbin'] = 2 - parameters['colors'].pop('brain', None) - parameters['colors']['brainbin'] = 'beige' - has_brainbin = True - for ct in chosen_tissues: - if has_brainbin and ct in ['brain', 'brainbin']: - continue - if ct in tissues: - res.append(ct) - else: - print(f'Tissue: {ct} is not available.') - print(f'Available tissues are: {", ".join(tissues)} and brainbin') - return - if len(res) == 1 and 'skin' in res: - parameters['opacity']['skin'] = 1.0 - tissues = res - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - # Setup render window, renderers, and interactor. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - sliders = dict() - left_step_size = 1.0 / 9 - left_pos_y = 0.275 - left_pos_x0 = 0.02 - left_pos_x1 = 0.18 - right_step_size = 1.0 / 9 - right_pos_y = 0.05 - right_pos_x0 = 0.8 + 0.02 - right_pos_x1 = 0.8 + 0.18 - - slider_count = 0 - - color_size = len(max(parameters['colors'].values(), key=len)) - name_size = len(max(parameters['names'], key=len)) - int_size = 2 - line = '-' * (7 + name_size + color_size) - res = [line, - f'{"Tissue":<{name_size}s}{" Label "}{"Color"}', - line] - - for tissue in tissues: - reader = vtkPolyDataReader() - reader.SetFileName(parameters['vtk_files'][tissue]) - reader.Update() - - trans = SliceOrder().get(parameters['orientation'][tissue]) - trans.Scale(1, -1, -1) - - tf = vtkTransformPolyDataFilter() - tf.SetInputConnection(reader.GetOutputPort()) - tf.SetTransform(trans) - tf.SetInputConnection(reader.GetOutputPort()) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(tf.GetOutputPort()) - normals.SetFeatureAngle(60.0) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(normals.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - actor.GetProperty().SetOpacity(parameters['opacity'][tissue]) - actor.GetProperty().SetDiffuseColor(color_lut.GetTableValue(parameters['indices'][tissue])[:3]) - actor.GetProperty().SetSpecular(0.2) - actor.GetProperty().SetSpecularPower(10) - - ren.AddActor(actor) - - if not no_sliders: - slider_properties = SliderProperties() - slider_properties.value_initial = parameters['opacity'][tissue] - slider_properties.title = tissue - - # Screen coordinates. - if slider_count < 7: - slider_properties.p1 = [left_pos_x0, left_pos_y] - slider_properties.p2 = [left_pos_x1, left_pos_y] - left_pos_y += left_step_size - else: - slider_properties.p1 = [right_pos_x0, right_pos_y] - slider_properties.p2 = [right_pos_x1, right_pos_y] - right_pos_y += right_step_size - - slider_widget = make_slider_widget(slider_properties, color_lut, parameters['indices'][tissue]) - slider_widget.SetInteractor(iren) - slider_widget.SetAnimationModeToAnimate() - slider_widget.EnabledOn() - - cb = SliderCallback(actor.GetProperty()) - slider_widget.AddObserver(vtkCommand.InteractionEvent, cb) - sliders[tissue] = slider_widget - slider_count += 1 - - res.append( - f'{tissue:<{name_size}s} {parameters["indices"][tissue]:{int_size + 3}d}' - f' {parameters["colors"][tissue]:<{color_size}s}') - - res.append(line) - print('\n'.join(res)) - - if no_sliders: - ren_win.SetSize(1024, 1024) - else: - ren_win.SetSize(1024 + 400, 1024) - ren_win.SetWindowName('FroggieView') - - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - - # Final view. - camera = ren.GetActiveCamera() - # Superior Anterior Left - labels = 'sal' - if select_figure == 'a': - # Fig 12-9a in the VTK Textbook - camera.SetPosition(495.722368, -447.474954, -646.308030) - camera.SetFocalPoint(137.612066, -40.962376, -195.171023) - camera.SetViewUp(-0.323882, -0.816232, 0.478398) - camera.SetDistance(704.996499) - camera.SetClippingRange(319.797039, 1809.449285) - elif select_figure == 'b': - # Fig 12-9b in the VTK Textbook - camera.SetPosition(478.683494, -420.477744, -643.112038) - camera.SetFocalPoint(135.624874, -36.478435, -210.614440) - camera.SetViewUp(-0.320495, -0.820148, 0.473962) - camera.SetDistance(672.457328) - camera.SetClippingRange(307.326771, 1765.990822) - elif select_figure == 'c': - # Fig 12-9c in the VTK Textbook - camera.SetPosition(201.363313, -147.260834, -229.885066) - camera.SetFocalPoint(140.626206, -75.857216, -162.352531) - camera.SetViewUp(-0.425438, -0.786048, 0.448477) - camera.SetDistance(115.534047) - camera.SetClippingRange(7.109870, 854.091718) - elif select_figure == 'd': - # Fig 12-9d in the VTK Textbook - camera.SetPosition(115.361727, -484.656410, -6.193827) - camera.SetFocalPoint(49.126343, 98.501094, 1.323317) - camera.SetViewUp(-0.649127, -0.083475, 0.756086) - camera.SetDistance(586.955116) - camera.SetClippingRange(360.549218, 866.876230) - elif select_figure == 'l': - # Orient so that we look down on the anterior surface and - # the superior surface faces the top of the screen. - # Left Superior Anterior - labels = 'lsa' - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() - else: - # The default. - # Orient so that we look down on the posterior surface and - # the superior surface faces the top of the screen. - # Right Superior Posterior - labels = 'rsp' - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(-90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() - - cow = vtkCameraOrientationWidget() - cow.SetParentRenderer(ren) - if no_sliders: - # Turn off if you do not want it. - cow.On() - cow.EnabledOn() - else: - cow.Off() - cow.EnabledOff() - - axes = make_cube_actor(labels, colors) - om = vtkOrientationMarkerWidget() - om.SetOrientationMarker(axes) - # Position upper left in the viewport. - # om.SetViewport(0.0, 0.8, 0.2, 1.0) - # Position lower left in the viewport. - om.SetViewport(0, 0, 0.2, 0.2) - om.SetInteractor(iren) - om.EnabledOn() - om.InteractiveOn() - - ren_win.Render() - - slider_toggle = SliderToggleCallback(sliders) - iren.AddObserver('KeyPressEvent', slider_toggle) - - iren.Start() - - -def parse_json(fn_path): - """ - Parse the JSON file selecting the components that we want. - - We also check that the file paths are valid. - - :param fn_path: The path the JSON file. - :return: A dictionary of the parameters that we require. - """ - with open(fn_path) as data_file: - json_data = json.load(data_file) - paths_ok = True - parameters = dict() - for k, v in json_data.items(): - if k == 'files': - if 'root' in v: - root = Path(v['root']) - if not root.exists(): - print(f'Bad path: {root}') - paths_ok = False - else: - if 'vtk_files' not in v: - print('Expected vtk files.') - paths_ok = False - continue - for kk in v: - if kk == 'vtk_files': - if len(v[kk]) != 17: - print(f'Expected seventeen file names.') - paths_ok = False - # The stem of the file path becomes the key. - path_map = dict() - for p in list(map(lambda pp: root / pp, v[kk])): - path_map[p.stem] = p - if not p.is_file(): - paths_ok = False - print(f'Not a file {p}') - if paths_ok: - parameters[kk] = path_map - else: - paths_ok = False - print('Missing the key "root" and/or the key "files" for the files.') - else: - if k in ['tissues', 'figures']: - for kk, vv in v.items(): - parameters[kk] = vv - return paths_ok, parameters - - -class SliceOrder: - """ - These transformations permute image and other geometric data to maintain proper - orientation regardless of the acquisition order. After applying these transforms with - vtkTransformFilter, a view up of 0, -1, 0 will result in the body part - facing the viewer. - NOTE: some transformations have a -1 scale factor for one of the components. - To ensure proper polygon orientation and normal direction, you must - apply the vtkPolyDataNormals filter. - - Naming (the nomenclature is medical): - si - superior to inferior (top to bottom) - is - inferior to superior (bottom to top) - ap - anterior to posterior (front to back) - pa - posterior to anterior (back to front) - lr - left to right - rl - right to left - """ - - def __init__(self): - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) - - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) - - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) - - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) - - """ - The previous transforms assume radiological views of the slices - (viewed from the feet). - Other modalities such as physical sectioning may view from the head. - The following transforms modify the original with a 180° rotation about y - """ - - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) - - self.transform = dict() - - si_trans = vtkTransform() - si_trans.SetMatrix(self.si_mat) - self.transform['si'] = si_trans - - is_trans = vtkTransform() - is_trans.SetMatrix(self.is_mat) - self.transform['is'] = is_trans - - ap_trans = vtkTransform() - ap_trans.Scale(1, -1, 1) - self.transform['ap'] = ap_trans - - pa_trans = vtkTransform() - pa_trans.Scale(1, -1, -1) - self.transform['pa'] = pa_trans - - lr_trans = vtkTransform() - lr_trans.SetMatrix(self.lr_mat) - self.transform['lr'] = lr_trans - - rl_trans = vtkTransform() - rl_trans.SetMatrix(self.rl_mat) - self.transform['rl'] = rl_trans - - hf_trans = vtkTransform() - hf_trans.SetMatrix(self.hf_mat) - self.transform['hf'] = hf_trans - - hf_si_trans = vtkTransform() - hf_si_trans.SetMatrix(self.hf_mat) - hf_si_trans.Concatenate(self.si_mat) - self.transform['hfsi'] = hf_si_trans - - hf_is_trans = vtkTransform() - hf_is_trans.SetMatrix(self.hf_mat) - hf_is_trans.Concatenate(self.is_mat) - self.transform['hfis'] = hf_is_trans - - hf_ap_trans = vtkTransform() - hf_ap_trans.SetMatrix(self.hf_mat) - hf_ap_trans.Scale(1, -1, 1) - self.transform['hfap'] = hf_ap_trans - - hf_pa_trans = vtkTransform() - hf_pa_trans.SetMatrix(self.hf_mat) - hf_pa_trans.Scale(1, -1, -1) - self.transform['hfpa'] = hf_pa_trans - - hf_lr_trans = vtkTransform() - hf_lr_trans.SetMatrix(self.hf_mat) - hf_lr_trans.Concatenate(self.lr_mat) - self.transform['hflr'] = hf_lr_trans - - hf_rl_trans = vtkTransform() - hf_rl_trans.SetMatrix(self.hf_mat) - hf_rl_trans.Concatenate(self.rl_mat) - self.transform['hfrl'] = hf_rl_trans - - # Identity - self.transform['I'] = vtkTransform() - - # Zero - z_trans = vtkTransform() - z_trans.Scale(0, 0, 0) - self.transform['Z'] = z_trans - - def print_transform(self, order): - """ - Print the homogenous matrix corresponding to the slice order. - :param order: The slice order. - :return: - """ - print(order) - m = self.transform[order].GetMatrix() - for i in range(0, 4): - row = list() - for j in range(0, 4): - row.append(f'{m.GetElement(i, j):6.2g}') - print(' '.join(row)) - - def print_all_transforms(self): - """ - Print all the homogenous matrices corresponding to the slice orders. - :return: - """ - for k in self.transform.keys(): - self.print_transform(k) - - def get(self, order): - """ - Returns the vtkTransform corresponding to the slice order. - - :param order: The slice order. - :return: The vtkTransform to use. - """ - if order in self.transform.keys(): - return self.transform[order] - else: - s = 'No such transform "{:s}" exists.'.format(order) - raise Exception(s) - - -def create_tissue_lut(indices, colors): - """ - Create the lookup table for the frog tissues. - - Each table value corresponds the color of one of the frog tissues. - - :param indices: The tissue name and index. - :param colors: The tissue name and color. - :return: The lookup table. - """ - lut = vtkLookupTable() - lut.SetNumberOfColors(len(colors)) - lut.SetTableRange(0, len(colors) - 1) - lut.Build() - - nc = vtkNamedColors() - - for k in indices.keys(): - lut.SetTableValue(indices[k], nc.GetColor4d(colors[k])) - - return lut - - -def make_axes_actor(scale, xyz_labels): - """ - :param scale: Sets the scale and direction of the axes. - :param xyz_labels: Labels for the axes. - :return: The axes actor. - """ - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyz_labels[0]) - axes.SetYAxisLabelText(xyz_labels[1]) - axes.SetZAxisLabelText(xyz_labels[2]) - axes.SetCylinderRadius(0.5 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.025 * axes.GetConeRadius()) - axes.SetSphereRadius(1.5 * axes.GetSphereRadius()) - tprop = axes.GetXAxisCaptionActor2D().GetCaptionTextProperty() - tprop.ItalicOn() - tprop.ShadowOn() - tprop.SetFontFamilyToTimes() - # Use the same text properties on the other two axes. - axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - return axes - - -def make_annotated_cube_actor(cube_labels, colors): - """ - :param cube_labels: The labels for the cube faces. - :param colors: Used to determine the cube color. - :return: The annotated cube actor. - """ - # A cube with labeled faces. - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText(cube_labels[0]) - cube.SetXMinusFaceText(cube_labels[1]) - cube.SetYPlusFaceText(cube_labels[2]) - cube.SetYMinusFaceText(cube_labels[3]) - cube.SetZPlusFaceText(cube_labels[4]) - cube.SetZMinusFaceText(cube_labels[5]) - cube.SetFaceTextScale(0.5) - cube.GetCubeProperty().SetColor(colors.GetColor3d('Gainsboro')) - - cube.GetTextEdgesProperty().SetColor(colors.GetColor3d('LightSlateGray')) - - # Change the vector text colors. - cube.GetXPlusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetXMinusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetYPlusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetYMinusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetZPlusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - cube.GetZMinusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - return cube - - -def make_cube_actor(label_selector, colors): - """ - :param label_selector: The selector used to define labels for the axes and cube. - :param colors: Used to set the colors of the cube faces. - :return: The combined axes and annotated cube prop. - """ - if label_selector == 'sal': - # xyz_labels = ['S', 'A', 'L'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['S', 'I', 'A', 'P', 'L', 'R'] - scale = [1.5, 1.5, 1.5] - elif label_selector == 'rsp': - # xyz_labels = ['R', 'S', 'P'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['R', 'L', 'S', 'I', 'P', 'A'] - scale = [1.5, 1.5, 1.5] - elif label_selector == 'lsa': - # xyz_labels = ['R', 'S', 'P'] - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['L', 'R', 'S', 'I', 'A', 'P'] - scale = [1.5, 1.5, 1.5] - else: - xyz_labels = ['+X', '+Y', '+Z'] - cube_labels = ['+X', '-X', '+Y', '-Y', '+Z', '-Z'] - scale = [1.5, 1.5, 1.5] - - # We are combining a vtkAxesActor and a vtkAnnotatedCubeActor - # into a vtkPropAssembly - cube = make_annotated_cube_actor(cube_labels, colors) - axes = make_axes_actor(scale, xyz_labels) - - # Combine orientation markers into one with an assembly. - assembly = vtkPropAssembly() - assembly.AddPart(axes) - assembly.AddPart(cube) - return assembly - - -class SliderProperties: - tube_width = 0.004 - slider_length = 0.015 - slider_width = 0.008 - end_cap_length = 0.008 - end_cap_width = 0.02 - title_height = 0.02 - label_height = 0.02 - - value_minimum = 0.0 - value_maximum = 1.0 - value_initial = 1.0 - - p1 = [0.02, 0.1] - p2 = [0.18, 0.1] - - title = None - - title_color = 'Black' - label_color = 'Black' - value_color = 'DarkSlateGray' - slider_color = 'BurlyWood' - selected_color = 'Lime' - bar_color = 'Black' - bar_ends_color = 'Indigo' - - -def make_slider_widget(properties, lut, idx): - """ - Make the slider widget. - - :param properties: The slider properties. - :param lut: The color lookup table. - :param idx: The tissue index. - :return: The slider widget. - """ - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.value_minimum) - slider.SetMaximumValue(properties.value_maximum) - slider.SetValue(properties.value_initial) - slider.SetTitleText(properties.title) - - slider.GetPoint1Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint1Coordinate().SetValue(properties.p1[0], properties.p1[1]) - slider.GetPoint2Coordinate().SetCoordinateSystemToNormalizedDisplay() - slider.GetPoint2Coordinate().SetValue(properties.p2[0], properties.p2[1]) - - slider.SetTubeWidth(properties.tube_width) - slider.SetSliderLength(properties.slider_length) - slider.SetSliderWidth(properties.slider_width) - slider.SetEndCapLength(properties.end_cap_length) - slider.SetEndCapWidth(properties.end_cap_width) - slider.SetTitleHeight(properties.title_height) - slider.SetLabelHeight(properties.label_height) - - colors = vtkNamedColors() - # Set the colors of the slider components. - # Change the color of the bar. - slider.GetTubeProperty().SetColor(colors.GetColor3d(properties.bar_color)) - # Change the color of the ends of the bar. - slider.GetCapProperty().SetColor(colors.GetColor3d(properties.bar_ends_color)) - # Change the color of the knob that slides. - slider.GetSliderProperty().SetColor(colors.GetColor3d(properties.slider_color)) - # Change the color of the knob when the mouse is held on it. - slider.GetSelectedProperty().SetColor(colors.GetColor3d(properties.selected_color)) - # Change the color of the text displaying the value. - slider.GetLabelProperty().SetColor(colors.GetColor3d(properties.value_color)) - # Use the one color for the labels. - # slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.label_color)) - # Change the color of the text indicating what the slider controls - if idx in range(0, 16): - slider.GetTitleProperty().SetColor(lut.GetTableValue(idx)[:3]) - slider.GetTitleProperty().ShadowOff() - else: - slider.GetTitleProperty().SetColor(colors.GetColor3d(properties.title_color)) - - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - -class SliderCallback: - def __init__(self, actor_property): - self.actor_property = actor_property - - def __call__(self, caller, ev): - slider_widget = caller - value = slider_widget.GetRepresentation().GetValue() - self.actor_property.SetOpacity(value) - - -class SliderToggleCallback: - def __init__(self, sliders): - self.sliders = sliders - - def __call__(self, caller, ev): - if caller.GetKeyCode() == "n": - for k, v in self.sliders.items(): - if v.GetEnabled(): - v.Off() - else: - v.On() - - -if __name__ == '__main__': - import sys - - data_folder, view, omit_sliders, selected_tissues = get_program_parameters(sys.argv) - main(data_folder, view, omit_sliders, selected_tissues) diff --git a/data/examples/Visualization/GlyphTable.py b/data/examples/Visualization/GlyphTable.py deleted file mode 100755 index 3dfe32e..0000000 --- a/data/examples/Visualization/GlyphTable.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkElevationFilter, - vtkGlyph3D -) -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkImagingCore import vtkRTAnalyticSource -from vtkmodules.vtkImagingGeneral import vtkImageGradient -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -# This example uses a "glyph table" to change the shape of the 3d glyphs -# according to a scalar value. - -# NOTE: The vtkGlyph3D filter doesn't copy over scalars to the glyphs -# generated by a table like this for some reason... - -def main(): - colors = vtkNamedColors() - - # The Wavelet Source is nice for generating a test vtkImageData set - rt = vtkRTAnalyticSource() - rt.SetWholeExtent(-2, 2, -2, 2, 0, 0) - - # Take the gradient of the only scalar 'RTData' to get a vector attribute - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - - # Elevation just to generate another scalar attribute that varies nicely over the data range - elev = vtkElevationFilter() - # Elevation values will range from 0 to 1 between the Low and High Points - elev.SetLowPoint(-2, -2, 0) - elev.SetHighPoint(2, 2, 0) - elev.SetInputConnection(grad.GetOutputPort()) - - # Create simple PolyData for glyph table - cs = vtkCubeSource() - cs.SetXLength(0.5) - cs.SetYLength(1) - cs.SetZLength(2) - ss = vtkSphereSource() - ss.SetRadius(0.25) - cs2 = vtkConeSource() - cs2.SetRadius(0.25) - cs2.SetHeight(0.5) - - # Set up the glyph filter - glyph = vtkGlyph3D() - glyph.SetInputConnection(elev.GetOutputPort()) - - # Here is where we build the glyph table - # that will be indexed into according to the IndexMode - glyph.SetSourceConnection(0, cs.GetOutputPort()) - glyph.SetSourceConnection(1, ss.GetOutputPort()) - glyph.SetSourceConnection(2, cs2.GetOutputPort()) - - glyph.ScalingOn() - glyph.SetScaleModeToScaleByScalar() - glyph.SetVectorModeToUseVector() - glyph.OrientOn() - glyph.SetScaleFactor(1) # Overall scaling factor - glyph.SetRange(0, 1) # Default is (0,1) - - # Tell it to index into the glyph table according to scalars - glyph.SetIndexModeToScalar() - - # Tell glyph which attribute arrays to use for what - glyph.SetInputArrayToProcess(0, 0, 0, 0, 'Elevation') # scalars - glyph.SetInputArrayToProcess(1, 0, 0, 0, 'RTDataGradient') # vectors - - coloring_by = 'Elevation' - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph.GetOutputPort()) - mapper.SetScalarModeToUsePointFieldData() - mapper.SetColorModeToMapScalars() - mapper.ScalarVisibilityOn() - - # GetRange() call doesn't work because attributes weren't copied to glyphs - # as they should have been... - # mapper.SetScalarRange(glyph.GetOutputDataObject(0).GetPointData().GetArray(coloring_by).GetRange()) - - mapper.SelectColorArray(coloring_by) - actor = vtkActor() - actor.SetMapper(mapper) - - ren = vtkRenderer() - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d("DarkGray")) - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('GlyphTable') - - iren = vtkRenderWindowInteractor() - istyle = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(istyle) - iren.SetRenderWindow(renWin) - ren.ResetCamera() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Hanoi.md b/data/examples/Visualization/Hanoi.md deleted file mode 100644 index 7633e43..0000000 --- a/data/examples/Visualization/Hanoi.md +++ /dev/null @@ -1,14 +0,0 @@ -### Description - -This is three-dimensional implementation of the Towers of Hanoi. - -Here we visualize the operation of the recursive Towers of Hanoi puzzle. In this puzzle there are three pegs. In the initial position there are one or more disks(or pucks) of varying diameter on the pegs. The disks are sorted according to disk diameter, so that -the largest disk is on the bottom, followed by the next largest, and so on. The goal of the puzzle is to move the disks from one peg to another, moving the disks one at a time, and never placing a larger disk on top of a smaller disk. - -Here we first set up the scene with the table, pegs and pucks. Then we use a function called `Hanoi()` to begin the recursion. A second function `MovePuck()` moves the puck from one peg to another. - -To give a pleasing visual effect we move the disk in small, user-specified increments, flipping the disc over as it moves -from one peg to the next. Option `-s` controls the user-defined increments. The option `-c 2` freezes a disk in mid air moving from one peg to another. - -!!! info - See [Figure 12-20c](../../../VTKBook/12Chapter12/#Figure%2012-20c) in [Chapter 12](../../../VTKBook/12Chapter12) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/Hanoi.py b/data/examples/Visualization/Hanoi.py deleted file mode 100755 index bc38a4b..0000000 --- a/data/examples/Visualization/Hanoi.py +++ /dev/null @@ -1,391 +0,0 @@ -#!/usr/bin/env python - -# Translated from Hanoi.cxx. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkMinimalStandardRandomSequence -from vtkmodules.vtkFiltersSources import ( - vtkCylinderSource, - vtkPlaneSource -) -from vtkmodules.vtkIOImage import ( - vtkBMPWriter, - vtkJPEGWriter, - vtkPNGWriter, - vtkPNMWriter, - vtkPostScriptWriter, - vtkTIFFWriter -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkWindowToImageFilter -) - - -class GV(object): - """ - Used to store global variables. - """ - - def __init__(self, numberOfPucks=5, numberOfSteps=5, puckResolution=48, configuration=0): - self.numberOfPucks = numberOfPucks - self.numberOfSteps = numberOfSteps - self.puckResolution = puckResolution - self.configuration = configuration - self.gotFigure2 = False # Used to bail out of recursion if configuration == 2. - self.L = 1.0 # Puck height. - self.H = 1.1 * self.numberOfPucks * self.L # Peg height. - self.R = 0.5 # Peg radius. - self.rMin = 4.0 * self.R # The minimum allowable radius of disks. - self.rMax = 12.0 * self.R # The maximum allowable radius of disks - self.D = 1.1 * 1.25 * self.rMax # The distance between the pegs. - self.numberOfMoves = 0 - - def update(self, numberOfPucks, numberOfSteps, puckResolution, configuration): - self.numberOfPucks = numberOfPucks - self.numberOfSteps = numberOfSteps - self.puckResolution = puckResolution - self.configuration = configuration - self.H = 1.1 * self.numberOfPucks * self.L # Peg height. - - -# Globals -gv = GV() -renWin = vtkRenderWindow() -""" - For pegStack we use a list of lists where the sublists correspond to the - source, target and helper pegs. - Python lists can be used as a stack since they have append() (corresponding - to push()) and pop(). -""" -pegStack = [[], [], []] - - -def hanoi(): - colors = vtkNamedColors() - - # Create the renderer and render window interactor. - ren = vtkRenderer() - renWin.AddRenderer(ren) - renWin.SetSize(1200, 750) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - ren.SetBackground(colors.GetColor3d('PapayaWhip')) - - camera = vtkCamera() - camera.SetPosition(41.0433, 27.9637, 30.442) - camera.SetFocalPoint(11.5603, -1.51931, 0.95899) - camera.SetClippingRange(18.9599, 91.6042) - camera.SetViewUp(0, 1, 0) - - ren.SetActiveCamera(camera) - - # Create geometry: table, pegs, and pucks. - pegGeometry = vtkCylinderSource() - pegGeometry.SetResolution(8) - pegMapper = vtkPolyDataMapper() - pegMapper.SetInputConnection(pegGeometry.GetOutputPort()) - - puckGeometry = vtkCylinderSource() - puckGeometry.SetResolution(gv.puckResolution) - puckMapper = vtkPolyDataMapper() - puckMapper.SetInputConnection(puckGeometry.GetOutputPort()) - - tableGeometry = vtkPlaneSource() - tableGeometry.SetResolution(10, 10) - tableMapper = vtkPolyDataMapper() - tableMapper.SetInputConnection(tableGeometry.GetOutputPort()) - - # Create the actors: table top, pegs, and pucks - # The table - table = vtkActor() - ren.AddActor(table) - table.SetMapper(tableMapper) - # table.GetProperty().SetColor(0.9569, 0.6431, 0.3765) - table.GetProperty().SetColor(colors.GetColor3d('SaddleBrown')) - table.AddPosition(gv.D, 0, 0) - table.SetScale(4 * gv.D, 2 * gv.D, 3 * gv.D) - table.RotateX(90) - - # The pegs (using cylinder geometry). Note that the pegs have to translated - # in the y-direction because the cylinder is centered about the origin. - gv.H = 1.1 * gv.numberOfPucks * gv.L - peg = list() - for i in range(0, 3): - peg.append(vtkActor()) - ren.AddActor(peg[i]) - peg[i].SetMapper(pegMapper) - # peg[i].GetProperty().SetColor(1, 1, 1) - peg[i].GetProperty().SetColor(colors.GetColor3d('Lavender')) - peg[i].AddPosition(i * gv.D, gv.H / 2, 0) - peg[i].SetScale(1, gv.H, 1) - - # The pucks (using cylinder geometry). Always loaded on peg# 0. - puck = list() - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(1) - for i in range(0, gv.numberOfPucks): - puck.append(vtkActor()) - puck[i].SetMapper(puckMapper) - color = [0, 0, 0] - for j in range(0, 3): - color[j] = randomSequence.GetValue() - randomSequence.Next() - puck[i].GetProperty().SetColor(*color) - puck[i].AddPosition(0, i * gv.L + gv.L / 2, 0) - scale = gv.rMax - i * (gv.rMax - gv.rMin) / (gv.numberOfPucks - 1) - puck[i].SetScale(scale, 1, scale) - ren.AddActor(puck[i]) - pegStack[0].append(puck[i]) - - # Reset the camera to view all actors. - renWin.Render() - renWin.SetWindowName('Hanoi') - - if gv.configuration == 3: - WriteImage('hanoi0.png', renWin, rgba=False) - - if gv.configuration != 1: - # Begin recursion. - Hanoi(gv.numberOfPucks - 1, 0, 2, 1) - Hanoi(1, 0, 1, 2) - if not gv.gotFigure2: - Hanoi(gv.numberOfPucks - 1, 2, 1, 0) - - renWin.Render() - if gv.configuration == 3: - WriteImage('hanoi2.png', renWin, rgba=False) - # Report output. - s = 'Number of moves: {:d}\nPolygons rendered each frame: {:d}\nTotal number of frames: {:d}' - print(s.format(gv.numberOfMoves, 3 * 8 + 1 + gv.numberOfPucks * (2 + gv.puckResolution), - gv.numberOfMoves * 3 * gv.numberOfSteps)) - - iren.AddObserver('EndInteractionEvent', OrientationObserver(ren.GetActiveCamera())) - - # Render the image. - iren.Initialize() - iren.Start() - - -def main(): - maxPucks = 20 - if not verify_parameters(maxPucks): - return - hanoi() - - -def get_program_parameters(): - import argparse - description = 'Towers of Hanoi. .' - epilogue = ''' -Where: -p specifies the number of pucks. - -s specifies the number of steps. - -r specifies the puck resolution. - -c specifies configuration. - 0 final configuration. - 1 initial configuration. - 2 intermediate configuration. - 3 final configuration and save images -Defaults: -p 5 -s 5 -r 48 -c 0 - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--numberOfPucks', '-p', default=5, type=int, nargs='?', help='The number of pucks.') - parser.add_argument('--numberOfSteps', '-s', default=5, type=int, nargs='?', help='The number of steps.') - parser.add_argument('--puckResolution', '-r', default=48, type=int, nargs='?', help='The puck resolution.') - parser.add_argument('--configuration', '-c', default=0, type=int, nargs='?', help='The configuration.') - args = parser.parse_args() - return args.numberOfPucks, args.numberOfSteps, args.puckResolution, args.configuration - - -def verify_parameters(maxPucks): - numberOfPucks, numberOfSteps, puckResolution, configuration = get_program_parameters() - numberOfPucks = abs(numberOfPucks) - numberOfSteps = abs(numberOfSteps) - puckResolution = abs(puckResolution) - configuration = abs(configuration) - check = True - if numberOfPucks < 2: - print('Please use more pucks!') - check = False - if numberOfPucks > maxPucks: - print('Too many pucks specified! Maximum is', maxPucks) - check = False - if numberOfSteps < 3: - print('Please use more steps!') - check = False - if configuration > 3: - print('0 >= configuration <= 3') - check = False - if check: - gv.update(numberOfPucks, numberOfSteps, puckResolution, configuration) - return check - - -def MovePuck(peg1, peg2): - """ - This routine is responsible for moving pucks from peg1 to peg2. - :param peg1: Initial peg. - :param peg2: Final peg. - :return: - """ - gv.numberOfMoves += 1 - - # Get the actor to move - movingActor = pegStack[peg1].pop() - - # Get the distance to move up. - distance = (gv.H - (gv.L * (len(pegStack[peg1]) - 1)) + gv.rMax) / gv.numberOfSteps - - for i in range(0, gv.numberOfSteps): - movingActor.AddPosition(0, distance, 0) - renWin.Render() - - # Get the distance to move across - distance = (peg2 - peg1) * gv.D / gv.numberOfSteps - flipAngle = 180.0 / gv.numberOfSteps - for i in range(0, gv.numberOfSteps): - movingActor.AddPosition(distance, 0, 0) - movingActor.RotateX(flipAngle) - renWin.Render() - if gv.numberOfMoves == 13 and i == 3: # for making book image - if gv.configuration == 3 or gv.configuration == 2: - cam = renWin.GetRenderers().GetFirstRenderer().GetActiveCamera() - camera1 = vtkCamera() - camera1.SetPosition(54.7263, 41.6467, 44.125) - camera1.SetFocalPoint(11.5603, -1.51931, 0.95899) - camera1.SetClippingRange(42.4226, 115.659) - camera1.SetViewUp(0, 1, 0) - renWin.GetRenderers().GetFirstRenderer().SetActiveCamera(camera1) - renWin.Render() - if gv.configuration == 3: - WriteImage('hanoi1.png', renWin, rgba=False) - if gv.configuration == 2: - gv.gotFigure2 = True - break - renWin.GetRenderers().GetFirstRenderer().SetActiveCamera(cam) - renWin.Render() - if gv.gotFigure2: - pegStack[peg2].append(movingActor) - return - - # Get the distance to move down. - distance = ((gv.L * (len(pegStack[peg2]) - 1)) - gv.H - gv.rMax) / gv.numberOfSteps - - for i in range(0, gv.numberOfSteps): - movingActor.AddPosition(0, distance, 0) - renWin.Render() - pegStack[peg2].append(movingActor) - - -def Hanoi(n, peg1, peg2, peg3): - """ - Tower of Hanoi. - :param n: Number of disks. - :param peg1: Source - :param peg2: Target - :param peg3: Helper - :return: - """ - # If gotFigure2 is true, we break out of the recursion. - if gv.gotFigure2: - return - if n != 1: - Hanoi(n - 1, peg1, peg3, peg2) - if gv.gotFigure2: - return - Hanoi(1, peg1, peg2, peg3) - Hanoi(n - 1, peg3, peg2, peg1) - else: - MovePuck(peg1, peg2) - - -class OrientationObserver(object): - def __init__(self, cam): - self.cam = cam - - def __call__(self, caller, ev): - # Just do this to demonstrate who called callback and the event that triggered it. - print(caller.GetClassName(), 'Event Id:', ev) - # Now print the camera orientation. - CameraOrientation(self.cam) - - -def CameraOrientation(cam): - fmt1 = '{:>15s}' - fmt2 = '{:9.6g}' - print(fmt1.format('Position:'), ', '.join(map(fmt2.format, cam.GetPosition()))) - print(fmt1.format('Focal point:'), ', '.join(map(fmt2.format, cam.GetFocalPoint()))) - print(fmt1.format('Clipping range:'), ', '.join(map(fmt2.format, cam.GetClippingRange()))) - print(fmt1.format('View up:'), ', '.join(map(fmt2.format, cam.GetViewUp()))) - print(fmt1.format('Distance:'), fmt2.format(cam.GetDistance())) - - -def WriteImage(fileName, renWin1, rgba=True): - """ - Write the render window view to an image file. - - Image types supported are: - BMP, JPEG, PNM, PNG, PostScript, TIFF. - The default parameters are used for all writers, change as needed. - - :param fileName: The file name, if no extension then PNG is assumed. - :param renWin1: The render window. - :param rgba: Used to set the buffer type. - :return: - """ - - import os - - if fileName: - # Select the writer to use. - path, ext = os.path.splitext(fileName) - ext = ext.lower() - if not ext: - ext = '.png' - fileName = fileName + ext - if ext == '.bmp': - writer = vtkBMPWriter() - elif ext == '.jpg': - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': - if rgba: - rgba = False - writer = vtkPostScriptWriter() - elif ext == '.tiff': - writer = vtkTIFFWriter() - else: - writer = vtkPNGWriter() - - windowto_image_filter = vtkWindowToImageFilter() - windowto_image_filter.SetInput(renWin1) - windowto_image_filter.SetScale(1) # image quality - if rgba: - windowto_image_filter.SetInputBufferTypeToRGBA() - else: - windowto_image_filter.SetInputBufferTypeToRGB() - # Read from the front buffer. - windowto_image_filter.ReadFrontBufferOff() - windowto_image_filter.Update() - - writer.SetFileName(fileName) - writer.SetInputConnection(windowto_image_filter.GetOutputPort()) - writer.Write() - else: - raise RuntimeError('Need a filename.') - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/HanoiInitial.py b/data/examples/Visualization/HanoiInitial.py deleted file mode 100755 index 1e99129..0000000 --- a/data/examples/Visualization/HanoiInitial.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -""" -HanoiInitial - -Note: Make sure Hanoi.py is in the same directory as this program. -""" - -import Hanoi - - -def main(): - Hanoi.gv.configuration = 1 - Hanoi.hanoi() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/HanoiIntermediate.py b/data/examples/Visualization/HanoiIntermediate.py deleted file mode 100755 index 145d6db..0000000 --- a/data/examples/Visualization/HanoiIntermediate.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -""" -HanoiIntermediate - -Note: Make sure Hanoi.py is in the same directory as this program. -""" - -import Hanoi - - -def main(): - Hanoi.gv.configuration = 2 - Hanoi.hanoi() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/HardwareSelector.py b/data/examples/Visualization/HardwareSelector.py deleted file mode 100755 index bce0ed4..0000000 --- a/data/examples/Visualization/HardwareSelector.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkDataObject -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkHardwareSelector, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -# Callback for when selection is changed - -# This is global - fix later. -ren1 = vtkRenderer() - - -def selectionCallback(caller, eventId): - hsel = vtkHardwareSelector() - hsel.SetFieldAssociation(vtkDataObject.FIELD_ASSOCIATION_CELLS) - hsel.SetRenderer(ren1) - - x, y = caller.GetRenderWindow().GetSize() - - # Create a small area around clicked point for selector area - hsel.SetArea(0, 0, x, y) - res = hsel.Select() - - numNodes = res.GetNumberOfNodes() - if (numNodes < 1): - print("No visible cells") - else: - sel_node = res.GetNode(0) - print('Visible cell IDs: ', VN.vtk_to_numpy(sel_node.GetSelectionList()).tolist()) - - -def main(): - colors = vtkNamedColors() - - sphere = vtkSphereSource() - sphere.SetCenter(0, 0, 0) - sphere.SetRadius(5.0) - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) - - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - ren1.AddActor(sphereActor) - ren1.GetActiveCamera().ParallelProjectionOn() - ren1.SetBackground(colors.GetColor3d('Navy')) - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetSize(300, 300) - renWin.SetWindowName('HardwareSelector') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - iren.AddObserver("UserEvent", selectionCallback) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - renWin.GetInteractor().SetInteractorStyle(style) - - ren1.ResetCamera() - renWin.Render() - - iren.Initialize() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Hawaii.md b/data/examples/Visualization/Hawaii.md deleted file mode 100644 index 0c2e39b..0000000 --- a/data/examples/Visualization/Hawaii.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -Visualize elevations by coloring the scalar values with a lookup table. - -This is a translation of the original hawaii.tcl with a few additional enhancements. -The image is centered on Honolulu. Diamond Head is the crater lower left. Punchbowl is the crater in the centre. - -!!! info - See [Figure 6-12](../../../VTKBook/06Chapter6/#Figure%206-12) in [Chapter 6](../../..//VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/Hawaii.py b/data/examples/Visualization/Hawaii.py deleted file mode 100755 index 3ad8a85..0000000 --- a/data/examples/Visualization/Hawaii.py +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env python - -# Translated from hawaii.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - file_name, color_scheme = get_program_parameters() - - color_scheme = abs(color_scheme) - if color_scheme > 2: - color_scheme = 0; - - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - # Read a vtk file - # - hawaii = vtkPolyDataReader() - hawaii.SetFileName(file_name) - hawaii.Update() - bounds = [0.0] * 6 - hawaii.GetOutput().GetBounds(bounds) - - elevation = vtkElevationFilter() - elevation.SetInputConnection(hawaii.GetOutputPort()) - elevation.SetLowPoint(0, 0, 0) - elevation.SetHighPoint(0, 0, 1000) - elevation.SetScalarRange(0, 1000) - - lut = MakeLUT(color_scheme) - - hawaiiMapper = vtkDataSetMapper() - hawaiiMapper.SetInputConnection(elevation.GetOutputPort()) - hawaiiMapper.SetScalarRange(0, 1000) - hawaiiMapper.ScalarVisibilityOn() - hawaiiMapper.SetLookupTable(lut) - - hawaiiActor = vtkActor() - hawaiiActor.SetMapper(hawaiiMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(hawaiiActor) - # Match the window shape to the object. - # renWin.SetSize(500, int(500 * bounds[1] / bounds[3])) - renWin.SetSize(500, 500) - renWin.SetWindowName('Hawaii') - - iren.Initialize() - - # Render the image. - # Centered on Honolulu. - # Diamond Head is the crater lower left. - # Punchbowl is the crater in the centre. - renWin.Render() - ren.SetBackground(colors.GetColor3d("BkgColor")) - ren.GetActiveCamera().Zoom(1.5) - ren.GetActiveCamera().Roll(-90) - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produce figure 6–12 from the VTK Textbook.' - epilogue = ''' - Produce figure 6–12 from the VTK Textbook. - It is a translation of the original hawaii.tcl with a few additional enhancements. - The image is centered on Honolulu, O'ahu. - Diamond Head is the crater lower left. Punchbowl is the crater in the centre. - - The color_scheme option allows you to select a series of colour schemes. - 0: The default, a lookup using a "Brewer" palette. - 1: The original: A lookup table of 256 colours ranging from deep blue (water) to yellow-white (mountain top). - 2: A lookup table with a preset number of colours. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='honolulu.vtk') - parser.add_argument('color_scheme', default=0, type=int, nargs='?', help='The particular color scheme to use.') - args = parser.parse_args() - return args.filename, args.color_scheme - - -def MakeLUT(color_scheme=0): - """ - Make a lookup table. - :param color_scheme: Select the type of lookup table. - :return: The lookup table. - """ - colors = vtkNamedColors() - if color_scheme == 1: - # A lookup table of 256 colours ranging from - # deep blue (water) to yellow-white (mountain top) - # is used to color map this figure. - lut = vtkLookupTable() - lut.SetHueRange(0.7, 0) - lut.SetSaturationRange(1.0, 0) - lut.SetValueRange(0.5, 1.0) - elif color_scheme == 2: - # Make the lookup table with a preset number of colours. - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeries.SetColorSchemeName('Hawaii') - colorSeries.SetColor(0, colors.GetColor3ub("turquoise_blue")) - colorSeries.SetColor(1, colors.GetColor3ub("sea_green_medium")) - colorSeries.SetColor(2, colors.GetColor3ub("sap_green")) - colorSeries.SetColor(3, colors.GetColor3ub("green_dark")) - colorSeries.SetColor(4, colors.GetColor3ub("tan")) - colorSeries.SetColor(5, colors.GetColor3ub("beige")) - colorSeries.SetColor(6, colors.GetColor3ub("light_beige")) - colorSeries.SetColor(7, colors.GetColor3ub("bisque")) - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - else: - # Make the lookup using a Brewer palette. - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeriesEnum = colorSeries.BREWER_DIVERGING_BROWN_BLUE_GREEN_8 - colorSeries.SetColorScheme(colorSeriesEnum) - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - return lut - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/IsosurfaceSampling.md b/data/examples/Visualization/IsosurfaceSampling.md deleted file mode 100644 index be43430..0000000 --- a/data/examples/Visualization/IsosurfaceSampling.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example illustrates how to create an isosurface and create point data on that isosurface that is sampled from another dataset. This example creates an isosurface of a sphere and then uses the vtkProbeFilter to compute point data from a sampled cylinder. - -!!! note - All point data is sampled, even the normals. This example restores the original isosurface normals after the probe. The example has one optional command line argument that controls the sample resolution of the sphere and cylinder. The default is 50. diff --git a/data/examples/Visualization/IsosurfaceSampling.py b/data/examples/Visualization/IsosurfaceSampling.py deleted file mode 100755 index 6cb773a..0000000 --- a/data/examples/Visualization/IsosurfaceSampling.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import ( - vtkCylinder, - vtkSphere -) -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes, - vtkProbeFilter -) -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - sample_resolution = get_program_parameters() - - # Create a sampled sphere - implicit_sphere = vtkSphere() - radius = 1.0 - implicit_sphere.SetRadius(radius) - - sampled_sphere = vtkSampleFunction() - sampled_sphere.SetSampleDimensions(sample_resolution, sample_resolution, sample_resolution) - x_min = -radius * 2.0 - x_max = radius * 2.0 - sampled_sphere.SetModelBounds(x_min, x_max, x_min, x_max, x_min, x_max) - sampled_sphere.SetImplicitFunction(implicit_sphere) - - if use_flying_edges: - try: - iso_sphere = vtkFlyingEdges3D() - except AttributeError: - iso_sphere = vtkMarchingCubes() - else: - iso_sphere = vtkMarchingCubes() - iso_sphere.SetValue(0, 1.0) - iso_sphere.SetInputConnection(sampled_sphere.GetOutputPort()) - - # Create a sampled cylinder - implicit_cylinder = vtkCylinder() - implicit_cylinder.SetRadius(radius / 2.0) - sampled_cylinder = vtkSampleFunction() - sampled_cylinder.SetSampleDimensions(sample_resolution, sample_resolution, sample_resolution) - sampled_cylinder.SetModelBounds(x_min, x_max, x_min, x_max, x_min, x_max) - sampled_cylinder.SetImplicitFunction(implicit_cylinder) - - # Probe cylinder with the sphere isosurface - probe_cylinder = vtkProbeFilter() - probe_cylinder.SetInputConnection(0, iso_sphere.GetOutputPort()) - probe_cylinder.SetInputConnection(1, sampled_cylinder.GetOutputPort()) - probe_cylinder.Update() - - # Restore the original normals - probe_cylinder.GetOutput().GetPointData().SetNormals( - iso_sphere.GetOutput().GetPointData().GetNormals()) - - print('Scalar range: {:6.3f}, {:6.3f}'.format(probe_cylinder.GetOutput().GetScalarRange()[0], - probe_cylinder.GetOutput().GetScalarRange()[1])) - - # Create a mapper and actor - map_sphere = vtkPolyDataMapper() - map_sphere.SetInputConnection(probe_cylinder.GetOutputPort()) - map_sphere.SetScalarRange(probe_cylinder.GetOutput().GetScalarRange()) - - sphere = vtkActor() - sphere.SetMapper(map_sphere) - - # Visualize - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetWindowName('IsosurfaceSampling') - - render_window_interactor = vtkRenderWindowInteractor() - render_window_interactor.SetRenderWindow(render_window) - - renderer.AddActor(sphere) - renderer.SetBackground(colors.GetColor3d('AliceBlue')) - - render_window.Render() - render_window_interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Create an isosurface and create point data on that isosurface that is sampled from another dataset.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-r', '--resolution', type=int, default=50, - help='The sample resolution of the sphere and cylinder') - args = parser.parse_args() - return args.resolution - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Kitchen.md b/data/examples/Visualization/Kitchen.md deleted file mode 100644 index 5b75a91..0000000 --- a/data/examples/Visualization/Kitchen.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -The example shows forty streamlines in a small kitchen. The room has two windows, a door(with air leakage), and a cooking area with a hot stove. The air leakage and temperature variation combine to produce air convection currents throughout the kitchen. The starting positions of the streamlines were defined by creating a rake, or curve (and its associated points). Here the rake was a straight line modeled with a vtkLineSource. These streamlines clearly show features of the flow field. By releasing many streamlines simultaneously we obtain even more information, as the eye tends to assemble nearby streamlines into a “global” understanding of flow field features. - -!!! info - See [Figure 6-18](../../../VTKBook/06Chapter6/#Figure%206-18) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/Kitchen.py b/data/examples/Visualization/Kitchen.py deleted file mode 100755 index 65fe207..0000000 --- a/data/examples/Visualization/Kitchen.py +++ /dev/null @@ -1,331 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkIOLegacy import vtkStructuredGridReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Set the furniture colors. - colors.SetColor('Furniture', [204, 204, 153, 255]) - - scalarRange = [0.0, 0.0] - maxTime = 0 - - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # Read the data. - # - reader = vtkStructuredGridReader() - reader.SetFileName(fileName) - reader.Update() # Force a read to occur. - reader.GetOutput().GetLength() - - if reader.GetOutput().GetPointData().GetScalars(): - reader.GetOutput().GetPointData().GetScalars().GetRange(scalarRange) - - if reader.GetOutput().GetPointData().GetVectors(): - maxVelocity = reader.GetOutput().GetPointData().GetVectors().GetMaxNorm() - maxTime = 4.0 * reader.GetOutput().GetLength() / maxVelocity - - # - # Outline around the data. - # - outlineF = vtkStructuredGridOutlineFilter() - outlineF.SetInputConnection(reader.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outlineF.GetOutputPort()) - outline = vtkActor() - outline.SetMapper(outlineMapper) - outline.GetProperty().SetColor(colors.GetColor3d('LampBlack')) - - # - # Set up shaded surfaces (i.e., supporting geometry). - # - doorGeom = vtkStructuredGridGeometryFilter() - doorGeom.SetInputConnection(reader.GetOutputPort()) - doorGeom.SetExtent(27, 27, 14, 18, 0, 11) - mapDoor = vtkPolyDataMapper() - mapDoor.SetInputConnection(doorGeom.GetOutputPort()) - mapDoor.ScalarVisibilityOff() - door = vtkActor() - door.SetMapper(mapDoor) - door.GetProperty().SetColor(colors.GetColor3d('Burlywood')) - - window1Geom = vtkStructuredGridGeometryFilter() - window1Geom.SetInputConnection(reader.GetOutputPort()) - window1Geom.SetExtent(0, 0, 9, 18, 6, 12) - mapWindow1 = vtkPolyDataMapper() - mapWindow1.SetInputConnection(window1Geom.GetOutputPort()) - mapWindow1.ScalarVisibilityOff() - window1 = vtkActor() - window1.SetMapper(mapWindow1) - window1.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window1.GetProperty().SetOpacity(.6) - - window2Geom = vtkStructuredGridGeometryFilter() - window2Geom.SetInputConnection(reader.GetOutputPort()) - window2Geom.SetExtent(5, 12, 23, 23, 6, 12) - mapWindow2 = vtkPolyDataMapper() - mapWindow2.SetInputConnection(window2Geom.GetOutputPort()) - mapWindow2.ScalarVisibilityOff() - window2 = vtkActor() - window2.SetMapper(mapWindow2) - window2.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window2.GetProperty().SetOpacity(.6) - - klower1Geom = vtkStructuredGridGeometryFilter() - klower1Geom.SetInputConnection(reader.GetOutputPort()) - klower1Geom.SetExtent(17, 17, 0, 11, 0, 6) - mapKlower1 = vtkPolyDataMapper() - mapKlower1.SetInputConnection(klower1Geom.GetOutputPort()) - mapKlower1.ScalarVisibilityOff() - klower1 = vtkActor() - klower1.SetMapper(mapKlower1) - klower1.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower2Geom = vtkStructuredGridGeometryFilter() - klower2Geom.SetInputConnection(reader.GetOutputPort()) - klower2Geom.SetExtent(19, 19, 0, 11, 0, 6) - mapKlower2 = vtkPolyDataMapper() - mapKlower2.SetInputConnection(klower2Geom.GetOutputPort()) - mapKlower2.ScalarVisibilityOff() - klower2 = vtkActor() - klower2.SetMapper(mapKlower2) - klower2.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower3Geom = vtkStructuredGridGeometryFilter() - klower3Geom.SetInputConnection(reader.GetOutputPort()) - klower3Geom.SetExtent(17, 19, 0, 0, 0, 6) - mapKlower3 = vtkPolyDataMapper() - mapKlower3.SetInputConnection(klower3Geom.GetOutputPort()) - mapKlower3.ScalarVisibilityOff() - klower3 = vtkActor() - klower3.SetMapper(mapKlower3) - klower3.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower4Geom = vtkStructuredGridGeometryFilter() - klower4Geom.SetInputConnection(reader.GetOutputPort()) - klower4Geom.SetExtent(17, 19, 11, 11, 0, 6) - mapKlower4 = vtkPolyDataMapper() - mapKlower4.SetInputConnection(klower4Geom.GetOutputPort()) - mapKlower4.ScalarVisibilityOff() - klower4 = vtkActor() - klower4.SetMapper(mapKlower4) - klower4.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower5Geom = vtkStructuredGridGeometryFilter() - klower5Geom.SetInputConnection(reader.GetOutputPort()) - klower5Geom.SetExtent(17, 19, 0, 11, 0, 0) - mapKlower5 = vtkPolyDataMapper() - mapKlower5.SetInputConnection(klower5Geom.GetOutputPort()) - mapKlower5.ScalarVisibilityOff() - klower5 = vtkActor() - klower5.SetMapper(mapKlower5) - klower5.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower6Geom = vtkStructuredGridGeometryFilter() - klower6Geom.SetInputConnection(reader.GetOutputPort()) - klower6Geom.SetExtent(17, 19, 0, 7, 6, 6) - mapKlower6 = vtkPolyDataMapper() - mapKlower6.SetInputConnection(klower6Geom.GetOutputPort()) - mapKlower6.ScalarVisibilityOff() - klower6 = vtkActor() - klower6.SetMapper(mapKlower6) - klower6.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower7Geom = vtkStructuredGridGeometryFilter() - klower7Geom.SetInputConnection(reader.GetOutputPort()) - klower7Geom.SetExtent(17, 19, 9, 11, 6, 6) - mapKlower7 = vtkPolyDataMapper() - mapKlower7.SetInputConnection(klower7Geom.GetOutputPort()) - mapKlower7.ScalarVisibilityOff() - klower7 = vtkActor() - klower7.SetMapper(mapKlower7) - klower7.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - hood1Geom = vtkStructuredGridGeometryFilter() - hood1Geom.SetInputConnection(reader.GetOutputPort()) - hood1Geom.SetExtent(17, 17, 0, 11, 11, 16) - mapHood1 = vtkPolyDataMapper() - mapHood1.SetInputConnection(hood1Geom.GetOutputPort()) - mapHood1.ScalarVisibilityOff() - hood1 = vtkActor() - hood1.SetMapper(mapHood1) - hood1.GetProperty().SetColor(colors.GetColor3d('Silver')) - - hood2Geom = vtkStructuredGridGeometryFilter() - hood2Geom.SetInputConnection(reader.GetOutputPort()) - hood2Geom.SetExtent(19, 19, 0, 11, 11, 16) - mapHood2 = vtkPolyDataMapper() - mapHood2.SetInputConnection(hood2Geom.GetOutputPort()) - mapHood2.ScalarVisibilityOff() - hood2 = vtkActor() - hood2.SetMapper(mapHood2) - hood2.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood3Geom = vtkStructuredGridGeometryFilter() - hood3Geom.SetInputConnection(reader.GetOutputPort()) - hood3Geom.SetExtent(17, 19, 0, 0, 11, 16) - mapHood3 = vtkPolyDataMapper() - mapHood3.SetInputConnection(hood3Geom.GetOutputPort()) - mapHood3.ScalarVisibilityOff() - hood3 = vtkActor() - hood3.SetMapper(mapHood3) - hood3.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood4Geom = vtkStructuredGridGeometryFilter() - hood4Geom.SetInputConnection(reader.GetOutputPort()) - hood4Geom.SetExtent(17, 19, 11, 11, 11, 16) - mapHood4 = vtkPolyDataMapper() - mapHood4.SetInputConnection(hood4Geom.GetOutputPort()) - mapHood4.ScalarVisibilityOff() - hood4 = vtkActor() - hood4.SetMapper(mapHood4) - hood4.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood6Geom = vtkStructuredGridGeometryFilter() - hood6Geom.SetInputConnection(reader.GetOutputPort()) - hood6Geom.SetExtent(17, 19, 0, 11, 16, 16) - mapHood6 = vtkPolyDataMapper() - mapHood6.SetInputConnection(hood6Geom.GetOutputPort()) - mapHood6.ScalarVisibilityOff() - hood6 = vtkActor() - hood6.SetMapper(mapHood6) - hood6.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - cookingPlateGeom = vtkStructuredGridGeometryFilter() - cookingPlateGeom.SetInputConnection(reader.GetOutputPort()) - cookingPlateGeom.SetExtent(17, 19, 7, 9, 6, 6) - mapCookingPlate = vtkPolyDataMapper() - mapCookingPlate.SetInputConnection(cookingPlateGeom.GetOutputPort()) - mapCookingPlate.ScalarVisibilityOff() - cookingPlate = vtkActor() - cookingPlate.SetMapper(mapCookingPlate) - cookingPlate.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - filterGeom = vtkStructuredGridGeometryFilter() - filterGeom.SetInputConnection(reader.GetOutputPort()) - filterGeom.SetExtent(17, 19, 7, 9, 11, 11) - mapFilter = vtkPolyDataMapper() - mapFilter.SetInputConnection(filterGeom.GetOutputPort()) - mapFilter.ScalarVisibilityOff() - sgfilter = vtkActor() - sgfilter.SetMapper(mapFilter) - sgfilter.GetProperty().SetColor(colors.GetColor3d('Furniture')) - # - # regular streamlines - # - line = vtkLineSource() - line.SetResolution(39) - line.SetPoint1(0.08, 2.50, 0.71) - line.SetPoint2(0.08, 4.50, 0.71) - rakeMapper = vtkPolyDataMapper() - rakeMapper.SetInputConnection(line.GetOutputPort()) - rake = vtkActor() - rake.SetMapper(rakeMapper) - - streamers = vtkStreamTracer() - # streamers.DebugOn() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(line.GetOutputPort()) - streamers.SetMaximumPropagation(maxTime) - streamers.SetInitialIntegrationStep(.5) - streamers.SetMinimumIntegrationStep(.1) - streamers.SetIntegratorType(2) - streamers.Update() - - streamersMapper = vtkPolyDataMapper() - streamersMapper.SetInputConnection(streamers.GetOutputPort()) - streamersMapper.SetScalarRange(scalarRange) - - lines = vtkActor() - lines.SetMapper(streamersMapper) - lines.GetProperty().SetColor(colors.GetColor3d('Black')) - - aren.TwoSidedLightingOn() - - aren.AddActor(outline) - aren.AddActor(door) - aren.AddActor(window1) - aren.AddActor(window2) - aren.AddActor(klower1) - aren.AddActor(klower2) - aren.AddActor(klower3) - aren.AddActor(klower4) - aren.AddActor(klower5) - aren.AddActor(klower6) - aren.AddActor(klower7) - aren.AddActor(hood1) - aren.AddActor(hood2) - aren.AddActor(hood3) - aren.AddActor(hood4) - aren.AddActor(hood6) - aren.AddActor(cookingPlate) - aren.AddActor(sgfilter) - aren.AddActor(lines) - aren.AddActor(rake) - - aren.SetBackground(colors.GetColor3d('SlateGray')) - - aCamera = vtkCamera() - aren.SetActiveCamera(aCamera) - aren.ResetCamera() - - aCamera.SetFocalPoint(3.505, 2.505, 1.255) - aCamera.SetPosition(3.505, 24.6196, 1.255) - aCamera.SetViewUp(0, 0, 1) - aCamera.Azimuth(60) - aCamera.Elevation(30) - aCamera.Dolly(1.4) - aren.ResetCameraClippingRange() - - renWin.SetSize(640, 512) - renWin.Render() - renWin.SetWindowName('Kitchen') - - # interact with data - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Flow velocity computed for a small kitchen (top and side view).' - epilogue = ''' - Forty streamlines start along the rake positioned under the window. - Some eventually travel over the hot stove and are convected upwards. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='kitchen.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/KochSnowflake.md b/data/examples/Visualization/KochSnowflake.md deleted file mode 100644 index a767e80..0000000 --- a/data/examples/Visualization/KochSnowflake.md +++ /dev/null @@ -1,4 +0,0 @@ -### Description - -This demo uses recursion to represent a Koch snowflake fractal. For more information about this fractal, there are many resources on the web: -http://en.wikipedia.org/wiki/Koch_snowflake, http://mathworld.wolfram.com/KochSnowflake.html. diff --git a/data/examples/Visualization/KochSnowflake.py b/data/examples/Visualization/KochSnowflake.py deleted file mode 100755 index 2ae53b4..0000000 --- a/data/examples/Visualization/KochSnowflake.py +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env python - -from math import pi, cos, sin, sqrt - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkIntArray, - vtkLookupTable, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData, - vtkPolyLine, - vtkTriangle -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -LEVEL = 6 - - -def as_polyline(points, level): - ''' - Koch Snowflake as a vtkPolyLine - ''' - # Use the points from the previous iteration to create the points of the next - # level. There is an assumption on my part that the curve is traversed in a - # counterclockwise fashion. If the initial triangle above is written to - # describe clockwise motion, the points will face inward instead of outward. - for i in range(level): - temp = vtkPoints() - # The first point of the previous vtkPoints is the first point of the next vtkPoints. - temp.InsertNextPoint(*points.GetPoint(0)) - - # Iterate over 'edges' in the vtkPoints - for i in range(1, points.GetNumberOfPoints()): - x0, y0, z0 = points.GetPoint(i - 1) - x1, y1, z1 = points.GetPoint(i) - t = sqrt((x1 - x0) ** 2 + (y1 - y0) ** 2) - nx = (x1 - x0) / t # x-component of edge unit tangent - ny = (y1 - y0) / t # y-component of edge unit tangent - - # the points describing the Koch snowflake edge - temp.InsertNextPoint(x0 + nx * t / 3, y0 + ny * t / 3, 0.) - temp.InsertNextPoint(x0 + nx * t / 2 + ny * t * sqrt(3) / 6, y0 + ny * t / 2 - nx * t * sqrt(3) / 6, 0.) - temp.InsertNextPoint(x0 + nx * 2 * t / 3, y0 + ny * 2 * t / 3, 0.) - temp.InsertNextPoint(x0 + nx * t, y0 + ny * t, 0.) - - points = temp - - # draw the outline - lines = vtkCellArray() - pl = vtkPolyLine() - pl.GetPointIds().SetNumberOfIds(points.GetNumberOfPoints()) - for i in range(points.GetNumberOfPoints()): - pl.GetPointIds().SetId(i, i) - lines.InsertNextCell(pl) - - # complete the polydata - polydata = vtkPolyData() - polydata.SetLines(lines) - polydata.SetPoints(points) - - return polydata - - -def as_triangles(indices, cellarray, level, data): - ''' - Koch Snowflake as a collection of vtkTriangles - ''' - if len(indices) >= 3: - stride = len(indices) // 4 - indices.append(indices[-1] + 1) - - triangle = vtkTriangle() - triangle.GetPointIds().SetId(0, indices[stride]) - triangle.GetPointIds().SetId(1, indices[2 * stride]) - triangle.GetPointIds().SetId(2, indices[3 * stride]) - - cellarray.InsertNextCell(triangle) - data.InsertNextValue(level) - - as_triangles(indices[0: stride], cellarray, level + 1, data) - as_triangles(indices[stride: 2 * stride], cellarray, level + 1, data) - as_triangles(indices[2 * stride: 3 * stride], cellarray, level + 1, data) - as_triangles(indices[3 * stride: -1], cellarray, level + 1, data) - - -def main(): - colors = vtkNamedColors() - - # Initially, set up the points to be an equilateral triangle. Note that the - # first point is the same as the last point to make this a closed curve when - # I create the vtkPolyLine. - points = vtkPoints() - for i in range(4): - points.InsertNextPoint(cos(2.0 * pi * i / 3), sin(2 * pi * i / 3.0), 0.0) - - outline_pd = as_polyline(points, LEVEL) - # You have already gone through the trouble of putting the points in the - # right places - so 'all' you need to do now is to create polygons from the - # points that are in the vtkPoints. - - # The points that are passed in, have an overlap of the beginning and the - # end. For this next trick, I will need a list of the indices in the - # vtkPoints. They're consecutive, so thats pretty straightforward. - - indices = [i for i in range(outline_pd.GetPoints().GetNumberOfPoints() + 1)] - triangles = vtkCellArray() - - # Set this up for each of the initial sides, then call the recursive function. - stride = (len(indices) - 1) // 3 - - # The cell data will allow us to color the triangles based on the level of - # the iteration of the Koch snowflake. - data = vtkIntArray() - data.SetNumberOfComponents(0) - data.SetName('Iteration Level') - - # This is the starting triangle. - t = vtkTriangle() - t.GetPointIds().SetId(0, 0) - t.GetPointIds().SetId(1, stride) - t.GetPointIds().SetId(2, 2 * stride) - triangles.InsertNextCell(t) - data.InsertNextValue(0) - - as_triangles(indices[0: stride + 1], triangles, 1, data) - as_triangles(indices[stride: 2 * stride + 1], triangles, 1, data) - as_triangles(indices[2 * stride: -1], triangles, 1, data) - - triangle_pd = vtkPolyData() - triangle_pd.SetPoints(outline_pd.GetPoints()) - triangle_pd.SetPolys(triangles) - triangle_pd.GetCellData().SetScalars(data) - - # ---------------- # - # rendering stuff # - # ---------------- # - outline_mapper = vtkPolyDataMapper() - outline_mapper.SetInputData(outline_pd) - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(256) - lut.SetHueRange(0.6, 0.6) - lut.SetSaturationRange(0.0, 1.0) - lut.Build() - - triangle_mapper = vtkPolyDataMapper() - triangle_mapper.SetInputData(triangle_pd) - triangle_mapper.SetScalarRange(0.0, LEVEL) - triangle_mapper.SetLookupTable(lut) - - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - - triangle_actor = vtkActor() - triangle_actor.SetMapper(triangle_mapper) - - outline_ren = vtkRenderer() - outline_ren.AddActor(outline_actor) - outline_ren.SetViewport(0.0, 0.0, 0.5, 1.0) - - triangle_ren = vtkRenderer() - triangle_ren.AddActor(triangle_actor) - triangle_ren.SetViewport(0.5, 0.0, 1.0, 1.0) - triangle_ren.SetActiveCamera(outline_ren.GetActiveCamera()) - - renw = vtkRenderWindow() - renw.AddRenderer(outline_ren) - renw.AddRenderer(triangle_ren) - renw.SetSize(800, 400) - renw.SetWindowName('KochSnowflake') - - outline_ren.SetBackground(colors.GetColor3d('CornFlowerBLue')) - triangle_ren.SetBackground(colors.GetColor3d('MistyRose')) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renw) - - outline_ren.ResetCamera() - renw.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/LoopShrink.py b/data/examples/Visualization/LoopShrink.py deleted file mode 100755 index 301a491..0000000 --- a/data/examples/Visualization/LoopShrink.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - renderer = vtkRenderer() - renderer.GetCullers().RemoveAllItems() - - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(12) - sphere.SetPhiResolution(12) - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(sphere.GetOutputPort()) - shrink.SetShrinkFactor(0.9) - - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(shrink.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -.5) - colorIt.SetHighPoint(0, 0, .5) - - mapper = vtkDataSetMapper() - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('LavenderBlush')) - renWin.SetSize(600, 600) - renWin.SetWindowName('LoopShrink') - - renWin.Render() - - renderer.GetActiveCamera().Zoom(1.5) - - # Interact with the data. - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/Lorenz.py b/data/examples/Visualization/Lorenz.py deleted file mode 100755 index 774143f..0000000 --- a/data/examples/Visualization/Lorenz.py +++ /dev/null @@ -1,152 +0,0 @@ -#!/usr/bin/env python - -""" -Create an iso-surface of the Lorenz attractor. - -Here we visualize a Lorenz strange attractor by integrating the Lorenz equations in a volume. -The number of visits in each voxel is recorded as a scalar function. -The surface is extracted via marching cubes using a visit value of 50. -The number of integration steps is 10 million, in a volume of dimensions 200 x 200 x 200. -The surface roughness is caused by the discrete nature of the evaluation function. - -""" -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkMinimalStandardRandomSequence, - vtkShortArray -) -from vtkmodules.vtkCommonDataModel import vtkStructuredPoints -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - Pr = 10.0 # The Lorenz parameters - b = 2.667 - r = 28.0 - # x = 0.0 - # y = 0.0 - # z = 0.0 # starting (and current) x, y, z - h = 0.01 # integration step size - resolution = 200 # slice resolution - iterations = 10000000 # number of iterations - xmin = -30.0 # x, y, z range for voxels - xmax = 30.0 - ymin = -30.0 - ymax = 30.0 - zmin = -10.0 - zmax = 60.0 - - # Take a stab at an integration step size. - xIncr = resolution / (xmax - xmin) - yIncr = resolution / (ymax - ymin) - zIncr = resolution / (zmax - zmin) - - print('The Lorenz Attractor\n') - print(' Pr =', Pr) - print(' b =', b) - print(' r =', r) - print(' integration step size =', h) - print(' slice resolution =', resolution) - print(' # of iterations =', iter) - print(' specified range:') - print(' x: {:f}, {:f}'.format(xmin, xmax)) - print(' y: {:f}, {:f}'.format(ymin, ymax)) - print(' z: {:f}, {:f}'.format(zmin, zmax)) - - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(8775070) - x = randomSequence.GetRangeValue(xmin, xmax) - randomSequence.Next() - y = randomSequence.GetRangeValue(ymin, ymax) - randomSequence.Next() - z = randomSequence.GetRangeValue(zmin, zmax) - randomSequence.Next() - print(' starting at {:f}, {:f}, {:f}'.format(x, y, z)) - # allocate memory for the slices - sliceSize = resolution * resolution - numPts = sliceSize * resolution - scalars = vtkShortArray() - for i in range(0, numPts): - scalars.InsertTuple1(i, 0) - for j in range(0, iterations): - # Integrate to the next time step. - xx = x + h * Pr * (y - x) - yy = y + h * (x * (r - z) - y) - zz = z + h * (x * y - (b * z)) - - x = xx - y = yy - z = zz - - # Calculate the voxel index. - if xmax > x > xmin and ymax > y > ymin and zmax > z > zmin: - xxx = int(float(xx - xmin) * xIncr) - yyy = int(float(yy - ymin) * yIncr) - zzz = int(float(zz - zmin) * zIncr) - index = xxx + yyy * resolution + zzz * sliceSize - scalars.SetTuple1(index, scalars.GetTuple1(index) + 1) - - volume = vtkStructuredPoints() - volume.GetPointData().SetScalars(scalars) - volume.SetDimensions(resolution, resolution, resolution) - volume.SetOrigin(xmin, ymin, zmin) - volume.SetSpacing((xmax - xmin) / resolution, (ymax - ymin) / resolution, (zmax - zmin) / resolution) - - print(' contouring...') - # Do the graphics dance. - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create iso-surface - contour = vtkContourFilter() - contour.SetInputData(volume) - contour.SetValue(0, 50) - - # Create mapper. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(contour.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create actor. - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('DodgerBlue')) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('PaleGoldenrod')) - - renWin.SetSize(640, 480) - - # interact with data - renWin.Render() - renWin.SetWindowName('Lorenz') - - camera = renderer.GetActiveCamera() - camera.SetPosition(-67.645167, -25.714343, 63.483516) - camera.SetFocalPoint(3.224902, -4.398594, 29.552112) - camera.SetViewUp(-0.232264, 0.965078, 0.121151) - camera.SetDistance(81.414176) - camera.SetClippingRange(18.428905, 160.896031) - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/MultipleRenderWindows.md b/data/examples/Visualization/MultipleRenderWindows.md deleted file mode 100644 index e4eb8b7..0000000 --- a/data/examples/Visualization/MultipleRenderWindows.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -This example creates four render windows. Three of the windows will close individually and closing one window will close all the others. Guess which one! - -You can also press **'q'** or **'e'** to close a window. - -If the parameter **'s'** (C++) or **'-s** (Python) is specified, then updating the camera position in one window will also update the position in the other windows. Pressing **'q'** or **'e'** closes all windows. Note that in this mode you **must** use **'q'** or **'e'** to close the windows. - -!!!Note - The image you see here is the test image. When you run this program you will see an image similar to [MultipleViewports](../MultipleViewports) however each object will be in a separate window. diff --git a/data/examples/Visualization/MultipleRenderWindows.py b/data/examples/Visualization/MultipleRenderWindows.py deleted file mode 100755 index 0a9b0be..0000000 --- a/data/examples/Visualization/MultipleRenderWindows.py +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkCylinderSource, - vtkSphereSource -) -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Display multiple render windows.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-s', default=False, action='store_true', - help='Simultaneous camera position updating.') - args = parser.parse_args() - return args.s - - -def main(): - simultaneous_update = get_program_parameters() - - colors = vtkNamedColors() - # Have some fun with colors - ren_bkg = ['AliceBlue', 'GhostWhite', 'WhiteSmoke', 'Seashell'] - actor_color = ['Bisque', 'RosyBrown', 'Goldenrod', 'Chocolate'] - - # Window sizes and spacing. - width = 300 - height = 300 - # Add extra space around each window. - dx = 20 - dy = 40 - w = width + dx - h = height + dy - - interactors = list() - running = [True, True, True, True] - - camera = None - sources = get_sources() - - kpis = list() - for i in range(0, 4): - ren_win = vtkRenderWindow() - ren_win.SetSize(width, height) - - renderer = vtkRenderer() - - # Share the camera between viewports. - if i == 0: - camera = renderer.GetActiveCamera() - camera.Azimuth(30) - camera.Elevation(30) - else: - renderer.SetActiveCamera(camera) - - ren_win.AddRenderer(renderer) - - iren = vtkRenderWindowInteractor() - - interactors.append(iren) - - iren.SetRenderWindow(ren_win) - ren_win.Render() - ren_win.SetWindowName('MultipleRenderWindows {:d}'.format(i)) - ren_win.SetPosition((i % 2) * w, h - (i // 2) * h) - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sources[i].GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(actor_color[i])) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d(ren_bkg[i])) - - renderer.ResetCamera() - - running[i] = True - kpis.append(KeyPressInteractorStyle(parent=iren)) - interactors[i].SetInteractorStyle(kpis[i]) - kpis[i].status = running[i] - - if simultaneous_update: - interactors[0].Initialize() - while all(x is True for x in running): - for i in range(0, 4): - running[i] = kpis[i].status - if running[i]: - interactors[i].ProcessEvents() - interactors[i].Render() - else: - interactors[i].TerminateApp() - print('Window', i, 'has stopped running.') - else: - interactors[0].Start() - - -def get_sources(): - sources = list() - - # Create a sphere - sphere = vtkSphereSource() - sphere.SetCenter(0.0, 0.0, 0.0) - sphere.Update() - sources.append(sphere) - # Create a cone - cone = vtkConeSource() - cone.SetCenter(0.0, 0.0, 0.0) - cone.SetDirection(0, 1, 0) - cone.Update() - sources.append(cone) - # Create a cube - cube = vtkCubeSource() - cube.SetCenter(0.0, 0.0, 0.0) - cube.Update() - sources.append(cube) - # Create a cylinder - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.Update() - sources.append(cylinder) - - return sources - - -class KeyPressInteractorStyle(vtkInteractorStyleTrackballCamera): - - def __init__(self, parent=None, status=True): - self.parent = vtkRenderWindowInteractor() - self.status = status - if parent is not None: - self.parent = parent - - self.AddObserver('KeyPressEvent', self.key_press_event) - - def key_press_event(self, obj, event): - key = self.parent.GetKeySym().lower() - if key == 'e' or key == 'q': - self.status = False - return - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/MultipleViewports.md b/data/examples/Visualization/MultipleViewports.md deleted file mode 100644 index 0cc55a4..0000000 --- a/data/examples/Visualization/MultipleViewports.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example creates a window with 4 viewports. Updating the camera position in one viewport will also update the position in the other viewports. - -See [MultipleRenderWindows](../MultipleRenderWindows) for an example using multiple windows. diff --git a/data/examples/Visualization/MultipleViewports.py b/data/examples/Visualization/MultipleViewports.py deleted file mode 100755 index 2320e16..0000000 --- a/data/examples/Visualization/MultipleViewports.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkCylinderSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # One render window, multiple viewports. - rw = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(rw) - - # Define viewport ranges. - xmins = [0, .5, 0, .5] - xmaxs = [0.5, 1, 0.5, 1] - ymins = [0, 0, .5, .5] - ymaxs = [0.5, 0.5, 1, 1] - - # Have some fun with colors. - ren_bkg = ['AliceBlue', 'GhostWhite', 'WhiteSmoke', 'Seashell'] - actor_color = ['Bisque', 'RosyBrown', 'Goldenrod', 'Chocolate'] - - sources = get_sources() - for i in range(4): - ren = vtkRenderer() - rw.AddRenderer(ren) - ren.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i]) - - # Share the camera between viewports. - if i == 0: - camera = ren.GetActiveCamera() - camera.Azimuth(30) - camera.Elevation(30) - else: - ren.SetActiveCamera(camera) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sources[i].GetOutputPort()) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d(actor_color[i])) - actor.SetMapper(mapper) - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d(ren_bkg[i])) - - ren.ResetCamera() - - rw.Render() - rw.SetWindowName('MultipleViewPorts') - rw.SetSize(600, 600) - iren.Start() - - -def get_sources(): - sources = list() - - # Create a sphere - sphere = vtkSphereSource() - sphere.SetCenter(0.0, 0.0, 0.0) - sphere.Update() - sources.append(sphere) - # Create a cone - cone = vtkConeSource() - cone.SetCenter(0.0, 0.0, 0.0) - cone.SetDirection(0, 1, 0) - cone.Update() - sources.append(cone) - # Create a cube - cube = vtkCubeSource() - cube.SetCenter(0.0, 0.0, 0.0) - cube.Update() - sources.append(cube) - # Create a cylinder - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.Update() - sources.append(cylinder) - - return sources - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/NamedColorPatches.md b/data/examples/Visualization/NamedColorPatches.md deleted file mode 100644 index 836874d..0000000 --- a/data/examples/Visualization/NamedColorPatches.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example shows how to produce a HTML page called [VTKNamedColorPatches](https://htmlpreview.github.io/?https://github.com/Kitware/vtk-examples/blob/gh-pages/VTKNamedColorPatches.html) showing the available colors in vtkNamedColors. - -It also shows how to select the text color based on luminance. In this case, Digital CCIR601 is used, which gives less weight to the red and blue components of a color. - -In the class HTMLTableMaker there are four methods for generating HTML pages: - -- **MakeCombinedColorPage()** -- Makes an indexed page with all the colors and names in the class vtkNamedColors *(the default)*. -- **MakeWebColorPage()** -- Makes a page of just the colors and names known to Web Browsers. -- **MakeVTKColorPage()** -- Makes a page of colors and names corresponding to to additional colors commonly used in VTK. -- **MakeSynonymColorPage()** -- Makes a page of color names and their synonyms. diff --git a/data/examples/Visualization/NamedColorPatches.py b/data/examples/Visualization/NamedColorPatches.py deleted file mode 100755 index 40a2a38..0000000 --- a/data/examples/Visualization/NamedColorPatches.py +++ /dev/null @@ -1,578 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -Produce a HTML page called VTKNamedColorPatches.html showing the available - colors in vtkNamedColors. - -It also shows how to select the text color based on luminance. -In this case Digital CCIR601 is used which gives less weight to the - red and blue components of a color. - -""" - -from vtkmodules.vtkCommonColor import vtkNamedColors - - -def main(): - ncp = HTMLTableMaker() - res = ncp.MakeCombinedColorPage() - # res = ncp.MakeWebColorPage() - # res = ncp.MakeVTKColorPage() - # res = ncp.MakeSynonymColorPage() - f = open("VTKNamedColorPatches.html", "w", newline="\n") - f.write(res) - f.close() - - -class HTMLToFromRGBAColor: - - @staticmethod - def RGBToHTMLColor(rgb): - """ - Convert an [R, G, B] list to #RRGGBB. - :param: rgb - The elements of the array rgb are unsigned chars (0..255). - :return: The html color. - """ - hexcolor = "#" + ''.join(['{:02x}'.format(x) for x in rgb]) - return hexcolor - - @staticmethod - def HTMLColorToRGB(colorString): - """ - Convert #RRGGBB to a [R, G, B] list. - :param: colorString a string in the form: #RRGGBB where RR, GG, BB are hexadecimal. - The elements of the array rgb are unsigned chars (0..255). - :return: The red, green and blue components as a list. - """ - colorString = colorString.strip() - if colorString[0] == '#': - colorString = colorString[1:] - if len(colorString) != 6: - raise ValueError("Input #%s is not in #RRGGBB format" % colorString) - r, g, b = colorString[:2], colorString[2:4], colorString[4:] - r, g, b = [int(n, 16) for n in (r, g, b)] - return [r, g, b] - - @staticmethod - def RGBToLumaCCIR601(rgb): - """ - RGB -> Luma conversion - Digital CCIR601 (gives less weight to the R and B components) - :param: rgb - The elements of the array rgb are unsigned chars (0..255). - :return: The luminance. - """ - Y = 0.299 * rgb[0] + 0.587 * rgb[1] + 0.114 * rgb[2] - return Y - - @staticmethod - def FormatRGBForHTML(rgb): - """ - Format the rgb colors for display on a html table. - :param: rgb - The elements of the array rgb are unsigned chars (0..255). - :return: A formatted string for the html table. - """ - s = ','.join(['{:3d}'.format(x) for x in rgb]) - s = s.replace(' ', ' ') - s = s.replace(',', '  ') - return s - - -class ColorStructures: - """ - Holds the color names, grouped by color class, and information about table - layout and ordering. - """ - - def __init__(self): - self.cn = { - 'Red': ['IndianRed', 'LightCoral', 'Salmon', 'DarkSalmon', - 'LightSalmon', 'Red', 'Crimson', 'FireBrick', 'DarkRed'], - 'Pink': ['Pink', 'LightPink', 'HotPink', 'DeepPink', - 'MediumVioletRed', 'PaleVioletRed'], - 'Orange': ['LightSalmon', 'Coral', 'Tomato', 'OrangeRed', - 'DarkOrange', 'Orange'], - 'Yellow': ['Gold', 'Yellow', 'LightYellow', 'LemonChiffon', - 'LightGoldenrodYellow', 'PapayaWhip', 'Moccasin', - 'PeachPuff', 'PaleGoldenrod', 'Khaki', 'DarkKhaki'], - 'Purple': ['Lavender', 'Thistle', 'Plum', 'Violet', 'Orchid', - 'Fuchsia', 'Magenta', 'MediumOrchid', 'MediumPurple', - 'BlueViolet', 'DarkViolet', 'DarkOrchid', 'DarkMagenta', - 'Purple', 'Indigo', 'DarkSlateBlue', 'SlateBlue', - 'MediumSlateBlue'], - 'Green': ['GreenYellow', 'Chartreuse', 'LawnGreen', 'Lime', - 'LimeGreen', 'PaleGreen', 'LightGreen', - 'MediumSpringGreen', 'SpringGreen', 'MediumSeaGreen', - 'SeaGreen', 'ForestGreen', 'Green', 'DarkGreen', - 'YellowGreen', 'OliveDrab', 'Olive', 'DarkOliveGreen', - 'MediumAquamarine', 'DarkSeaGreen', 'LightSeaGreen', - 'DarkCyan', 'Teal'], - 'Blue/Cyan': ['Aqua', 'Cyan', 'LightCyan', 'PaleTurquoise', - 'Aquamarine', 'Turquoise', 'MediumTurquoise', - 'DarkTurquoise', 'CadetBlue', 'SteelBlue', - 'LightSteelBlue', 'PowderBlue', 'LightBlue', - 'SkyBlue', 'LightSkyBlue', 'DeepSkyBlue', - 'DodgerBlue', 'CornflowerBlue', 'RoyalBlue', 'Blue', - 'MediumBlue', 'DarkBlue', 'Navy', 'MidnightBlue'], - 'Brown': ['Cornsilk', 'BlanchedAlmond', 'Bisque', 'NavajoWhite', - 'Wheat', 'BurlyWood', 'Tan', 'RosyBrown', 'SandyBrown', - 'Goldenrod', 'DarkGoldenrod', 'Peru', 'Chocolate', - 'SaddleBrown', 'Sienna', 'Brown', 'Maroon'], - 'White': ['White', 'Snow', 'Honeydew', 'MintCream', 'Azure', - 'AliceBlue', 'GhostWhite', 'WhiteSmoke', 'Seashell', - 'Beige', 'OldLace', 'FloralWhite', 'Ivory', - 'AntiqueWhite', 'Linen', - 'LavenderBlush', 'MistyRose'], - 'Gray': ['Gainsboro', 'LightGrey', 'Silver', 'DarkGray', 'Gray', - 'DimGray', 'LightSlateGray', 'SlateGray', 'DarkSlateGray', - 'Black'] - } - # Ordering of the tables and when to start and end a column of tables - # in the layout. - self.cnOrder = ['Red', 'Pink', 'Orange', 'Yellow', 'Purple', 'Green', - 'Blue/Cyan', 'Brown', 'White', 'Gray'] - self.cnStartTable = ['Red', 'Green', 'Brown'] - self.cnEndTable = ['Purple', 'Blue/Cyan', 'Gray'] - - self.vtkcn = { - 'Whites': ['antique_white', 'azure', 'bisque', 'blanched_almond', - 'cornsilk', 'eggshell', 'floral_white', 'gainsboro', - 'ghost_white', 'honeydew', 'ivory', 'lavender', - 'lavender_blush', 'lemon_chiffon', 'linen', 'mint_cream', - 'misty_rose', 'moccasin', 'navajo_white', 'old_lace', - 'papaya_whip', 'peach_puff', 'seashell', 'snow', - 'thistle', 'titanium_white', 'wheat', 'white', - 'white_smoke', 'zinc_white'], - 'Greys': ['cold_grey', 'dim_grey', 'grey', 'light_grey', - 'slate_grey', 'slate_grey_dark', 'slate_grey_light', - 'warm_grey'], - 'Blacks': ['black', 'ivory_black', 'lamp_black'], - 'Reds': ['alizarin_crimson', 'brick', 'cadmium_red_deep', 'coral', - 'coral_light', 'deep_pink', 'english_red', 'firebrick', - 'geranium_lake', 'hot_pink', 'indian_red', 'light_salmon', - 'madder_lake_deep', 'maroon', 'pink', 'pink_light', - 'raspberry', 'red', 'rose_madder', 'salmon', 'tomato', - 'venetian_red'], - 'Browns': ['beige', 'brown', 'brown_madder', 'brown_ochre', - 'burlywood', 'burnt_sienna', 'burnt_umber', 'chocolate', - 'deep_ochre', 'flesh', 'flesh_ochre', 'gold_ochre', - 'greenish_umber', 'khaki', 'khaki_dark', 'light_beige', - 'peru', 'rosy_brown', 'raw_sienna', 'raw_umber', 'sepia', - 'sienna', 'saddle_brown', 'sandy_brown', 'tan', - 'van_dyke_brown'], - 'Oranges': ['cadmium_orange', 'cadmium_red_light', 'carrot', - 'dark_orange', 'mars_orange', 'mars_yellow', 'orange', - 'orange_red', 'yellow_ochre'], - 'Yellows': ['aureoline_yellow', 'banana', 'cadmium_lemon', - 'cadmium_yellow', 'cadmium_yellow_light', 'gold', - 'goldenrod', 'goldenrod_dark', 'goldenrod_light', - 'goldenrod_pale', 'light_goldenrod', 'melon', - 'naples_yellow_deep', 'yellow', 'yellow_light'], - 'Greens': ['chartreuse', 'chrome_oxide_green', 'cinnabar_green', - 'cobalt_green', 'emerald_green', 'forest_green', 'green', - 'green_dark', 'green_pale', 'green_yellow', 'lawn_green', - 'lime_green', 'mint', 'olive', 'olive_drab', - 'olive_green_dark', 'permanent_green', 'sap_green', - 'sea_green', 'sea_green_dark', 'sea_green_medium', - 'sea_green_light', 'spring_green', 'spring_green_medium', - 'terre_verte', 'viridian_light', 'yellow_green'], - 'Cyans': ['aquamarine', 'aquamarine_medium', 'cyan', 'cyan_white', - 'turquoise', 'turquoise_dark', 'turquoise_medium', - 'turquoise_pale'], - 'Blues': ['alice_blue', 'blue', 'blue_light', 'blue_medium', - 'cadet', 'cobalt', 'cornflower', 'cerulean', 'dodger_blue', - 'indigo', 'manganese_blue', 'midnight_blue', 'navy', - 'peacock', 'powder_blue', 'royal_blue', 'slate_blue', - 'slate_blue_dark', 'slate_blue_light', - 'slate_blue_medium', 'sky_blue', 'sky_blue_deep', - 'sky_blue_light', 'steel_blue', 'steel_blue_light', - 'turquoise_blue', 'ultramarine'], - 'Magentas': ['blue_violet', 'cobalt_violet_deep', 'magenta', - 'orchid', 'orchid_dark', 'orchid_medium', - 'permanent_red_violet', 'plum', 'purple', - 'purple_medium', 'ultramarine_violet', 'violet', - 'violet_dark', 'violet_red', 'violet_red_medium', - 'violet_red_pale'] - } - # Ordering of the tables and when to start and end a column of tables - # in the layout. - self.vtkcnOrder = ['Whites', 'Greys', 'Blacks', 'Reds', 'Oranges', 'Browns', 'Yellows', 'Greens', 'Cyans', - 'Blues', - 'Magentas'] - self.vtkcnStartTable = ['Whites', 'Browns', 'Cyans'] - self.vtkcnEndTable = ['Oranges', 'Greens', 'Magentas'] - - -class HTMLTableMaker: - """ - This class creates HTML Tables displaying all the colors in - the class vtkNamedColors grouped by various categories. - """ - - def __init__(self): - self.cs = ColorStructures() - self.nc = vtkNamedColors() - self.htmlRGBA = HTMLToFromRGBAColor() - - @staticmethod - def MakeHTMLStyle(): - s = ' \n' - return s - - @staticmethod - def MakeHTMLHeader(): - s = '\n' - s += '\n' - s += '\n' - s += '\n' - s += 'vtkNamedColors\n' - s += HTMLTableMaker.MakeHTMLStyle() - s += '\n' - return s - - @staticmethod - def MakeHTMLIndex(): - s = '

Index

\n' - s += '
    \n' - s += '\t
  • Web color Names' - s += ' These colors correspond to those in' - s += ' ' - s += '\n' - s += '\n' - return s - - def MakeTR(self, name, rgb, textColor): - """ - Use when the name is a color name known to the web browser. - """ - s = '\n' - s += '' + name + '\n' - s += '' + self.htmlRGBA.FormatRGBForHTML(rgb) + '\n' - s += '\n' - return s - - def MakeTR_HTML(self, name, htmlColor, rgb, textColor): - """ - Use when the name is not a color name known to the web browser. - """ - s = '\n' - s += '' + name + '\n' - s += '' + self.htmlRGBA.FormatRGBForHTML(rgb) + '\n' - s += '\n' - return s - - def FindLongestColorName(self): - """ Find the longest color name. """ - maxLength = -1 - for key, value in self.cs.cn.items(): - for val in value: - if len(val) > maxLength: - maxLength = len(val) - for key, value in self.cs.vtkcn.items(): - for val in value: - if len(val) > maxLength: - maxLength = len(val) - return maxLength - - def MakeWebColorTables(self): - res = '' - for key in self.cs.cnOrder: - if key in self.cs.cnStartTable: - res += '\n' - res += '\n' - res += self.MakeTableHeader('HTML name') - # Add in the name of the group in the color table. - res += self.MakeTD(key + ' colors') - values = self.cs.cn[key] - for name in values: - rgb = self.nc.GetColor3ub(name) - Y = self.htmlRGBA.RGBToLumaCCIR601(rgb) - textColor = '#000000' # Black - if Y < 255 / 2.0: - textColor = '#ffffff' # White - # Make the row for each color in the group. - # Here we use the name to set the background color - # as it is known to the web browser. - res += self.MakeTR(name, rgb, textColor) - if key in self.cs.cnEndTable: - res += '
    \n' - res += '\n' - return res - - def MakeVTKColorTables(self): - res = '' - for key in self.cs.vtkcnOrder: - if key in self.cs.vtkcnStartTable: - res += '\n' - res += '\n' - res += self.MakeTableHeader('HTML name') - # Add in the name of the group in the color table. - res += self.MakeTD(key) - values = self.cs.vtkcn[key] - for name in values: - rgb = self.nc.GetColor3ub(name) - Y = self.htmlRGBA.RGBToLumaCCIR601(rgb) - textColor = '#000000' # Black - if Y < 255 / 2.0: - textColor = '#ffffff' # White - # We must set the background color to a specific - # HTML color as the color name may not be a standard - # name known to the web browser. - htmlColor = self.htmlRGBA.RGBToHTMLColor(rgb) - # Make the row for each color in the group. - res += self.MakeTR_HTML(name, htmlColor, rgb, textColor) - if key in self.cs.vtkcnEndTable: - res += '
    \n' - res += '\n' - return res - - def MakeSynonymColorTable(self): - syn = self.nc.GetSynonyms() - # Convert to a list where each element is a list of the - # color and its synonyms. - syn = syn.split('\n\n') - synonyms = [] - for ele in syn: - synonyms.append(ele.split('\n')) - cn = list() - for key, value in self.cs.cn.items(): - cn = cn + value - # Create a dictionary where the key is the lowercase name. - d = dict() - for n in cn: - d.update({n.lower(): n}) - # End point of first table. - end1 = len(synonyms) // 2 - if end1 * 2 < len(synonyms): - end1 += 1 - res = '\n' - res += '\n' - res += self.MakeTableHeader('Synonyms') - count = 0 - for colorNames in synonyms: - if count == end1: - res += '
    \n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeTableHeader('Synonyms') - for idx, name in enumerate(colorNames): - if name in d: - colorNames[idx] = d[name] - colorNames.sort() - name = ", ".join(colorNames) - rgb = self.nc.GetColor3ub(colorNames[0]) - Y = self.htmlRGBA.RGBToLumaCCIR601(rgb) - textColor = '#000000' # Black - if Y < 255 / 2.0: - textColor = '#ffffff' # White - # We must set the background color to a specific - # HTML color names is just a list of - # synonyms for that particular color. - htmlColor = self.htmlRGBA.RGBToHTMLColor(rgb) - # Make the row for each color in the group. - res += self.MakeTR_HTML(name, htmlColor, rgb, textColor) - count += 1 - res += '
    \n' - res += '\n' - return res - - def MakeWebColorPage(self): - res = self.MakeHTMLHeader() - res += '\n' - res += '

    Colors available in vtkNamedColors

    \n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeWebColorTables() - res += '\n' - res += '
    Web Color Names
    \n' - res += '\n' - return res - - def MakeVTKColorPage(self): - res = self.MakeHTMLHeader() - res += '\n' - res += '

    Colors available in vtkNamedColors

    \n' - res += 'The web colors take precedence over colors of the same' - res += ' name in VTK Color Names.\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeVTKColorTables() - res += '\n' - res += '
    VTK Color Names
    \n' - res += '\n' - return res - - def MakeSynonymColorPage(self): - res = self.MakeHTMLHeader() - res += '\n' - res += '

    Synonyms in vtkNamedColors

    \n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeSynonymColorTable() - res += '\n' - res += '
    Synonyms
    \n' - res += '\n' - return res - - def MakeCombinedColorPage(self): - res = self.MakeHTMLHeader() - res += '\n' - res += '

    Colors available in vtkNamedColors

    \n' - res += 'The class vtkNamedColors provides color names and their' - res += ' values for the convenience of the user.\n' - res += '
    The following tables show the available colors along with' - res += ' their red, green and blue values.\n' - res += self.MakeHTMLIndex() - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeWebColorTables() - res += '\n' - res += '
    Web color Names
    \n' - res += '
    \n' - - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeVTKColorTables() - res += '\n' - res += '
    VTK color Names
    \n' - res += '
    \n' - - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += '\n' - res += self.MakeSynonymColorTable() - res += '\n' - res += '
    Synonyms
    \n' - res += '\n' - return res - - -if __name__ == "__main__": - main() diff --git a/data/examples/Visualization/NamedColors.md b/data/examples/Visualization/NamedColors.md deleted file mode 100644 index a2977f7..0000000 --- a/data/examples/Visualization/NamedColors.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -This example demonstrates the usage of the vtkNamedColors class. Some helper functions are also implemented. - -A cone is created and contoured using the BandedPolyDataContourFilter, it is then colored using a LookupTable where the colors have been assigned using color names. - -A list of available color names and any synonyms are also output. diff --git a/data/examples/Visualization/NamedColors.py b/data/examples/Visualization/NamedColors.py deleted file mode 100755 index 53cff3c..0000000 --- a/data/examples/Visualization/NamedColors.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" - This example demonstrates the usage of the vtNamedColor class. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersModeling import vtkBandedPolyDataContourFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - nc = vtkNamedColors() - # We can print out the variables. - # The color name and RGBA values are displayed. - print(nc) - - # Here we just print out the colors and any - # synonyms. - PrintColors(nc) - PrintSynonyms(nc) - - """ - Create a cone, contour it using the banded contour filter and - color it with the primary additive and subtractive colors. - """ - # Create a cone - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetRadius(5.0) - coneSource.SetHeight(10) - coneSource.SetDirection(0, 1, 0) - coneSource.SetResolution(6) - coneSource.Update() - - bounds = [1.0, -1.0, 1.0, -1.0, 1.0, -1.0] - coneSource.GetOutput().GetBounds(bounds) - - elevation = vtkElevationFilter() - elevation.SetInputConnection(coneSource.GetOutputPort()) - elevation.SetLowPoint(0, bounds[2], 0) - elevation.SetHighPoint(0, bounds[3], 0) - - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputConnection(elevation.GetOutputPort()) - bcf.SetScalarModeToValue() - bcf.GenerateContourEdgesOn() - bcf.GenerateValues(7, elevation.GetScalarRange()) - - # Test setting and getting a color here. - # We are also modifying alpha. - # Convert to a list so that - # SetColor(name,rgba) works. - rgba = list(nc.GetColor4d("Red")) - rgba[3] = 0.5 - nc.SetColor("My Red", rgba) - # Does "My Red" match anything? - match = FindSynonyms(nc, "My Red") - print("Matching colors to My Red:", ', '.join(match)) - # Build a simple lookup table of - # primary additive and subtractive colors. - lut = vtkLookupTable() - lut.SetNumberOfTableValues(7) - lut.SetTableValue(0, nc.GetColor4d("My Red")) - # Let's make the dark green one partially transparent. - rgba = nc.GetColor4d("Lime") - rgba[3] = 0.3 - lut.SetTableValue(1, rgba) - lut.SetTableValue(2, nc.GetColor4d("Blue")) - lut.SetTableValue(3, nc.GetColor4d("Cyan")) - lut.SetTableValue(4, nc.GetColor4d("Magenta")) - lut.SetTableValue(5, nc.GetColor4d("Yellow")) - lut.SetTableValue(6, nc.GetColor4d("White")) - lut.SetTableRange(elevation.GetScalarRange()) - lut.Build() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(bcf.GetOutputPort()) - mapper.SetLookupTable(lut) - mapper.SetScalarModeToUseCellData() - - contourLineMapper = vtkPolyDataMapper() - contourLineMapper.SetInputData(bcf.GetContourEdgesOutput()) - contourLineMapper.SetScalarRange(elevation.GetScalarRange()) - contourLineMapper.SetResolveCoincidentTopologyToPolygonOffset() - - actor = vtkActor() - actor.SetMapper(mapper) - - contourLineActor = vtkActor() - actor.SetMapper(mapper) - contourLineActor.SetMapper(contourLineMapper) - contourLineActor.GetProperty().SetColor( - nc.GetColor3d("black")) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.AddActor(contourLineActor) - renderer.SetBackground2(nc.GetColor3d('RoyalBlue')) - renderer.SetBackground(nc.GetColor3d('MistyRose')) - renderer.GradientBackgroundOn() - renderWindow.SetSize(600, 600) - renderWindow.Render() - renderWindow.SetWindowName('NamedColors') - renderWindow.Render() - renderWindow.Render() - - renderWindowInteractor.Start() - - -def FindSynonyms(nc, colorName): - """ - Find any synonyms for a specified color. - :param: nc: The vtkNamedColor class - :param: colorName: the name of the color to find the synonyms for. - :return: The synonyms for colorName. - """ - availableColors = nc.GetColorNames() - # Make a list - availableColors = availableColors.split('\n') - synonyms = [] - # We use lower case for comparison and - # just the red, green, and blue components - # of the color. - myColor = nc.GetColor3ub(colorName) - for color in availableColors: - rgb = nc.GetColor3ub(color) - if list(myColor) == list(rgb): - synonyms.append(color) - return synonyms - - -def PrintColors(nc): - colorNames = nc.GetColorNames().split('\n') - print("There are", len(colorNames), "colors:") - max_str_len = len(max(colorNames, key=len)) - n = 0 - s = '' - for p in colorNames: - n += 1 - if n % 5 == 0: - s += '{:s}\n'.format(p) - else: - s += '{:s} '.format(p.ljust(max_str_len)) - s = s.strip() + '\n' - print(s) - - -def PrintSynonyms(nc): - syn = nc.GetSynonyms().split('\n\n') - print("There are", len(syn), "synonyms:") - synonyms = [] - for ele in syn: - synonyms.append(ele.split('\n')) - max_str_len = 0 - for p in synonyms: - max_len = len(max(p, key=len)) - if max_len > max_str_len: - max_str_len = max_len - s = '' - for p in synonyms: - n = 0 - for q in p: - n += 1 - if n < len(p): - s += '{:s} '.format(q.ljust(max_str_len)) - else: - s += '{:s}\n'.format(q) - s = s.strip() + '\n' - print(s) - - -if __name__ == "__main__": - main() diff --git a/data/examples/Visualization/NormalsDemo.md b/data/examples/Visualization/NormalsDemo.md deleted file mode 100644 index 5bf0146..0000000 --- a/data/examples/Visualization/NormalsDemo.md +++ /dev/null @@ -1,12 +0,0 @@ -### Description - -This example demonstrates the generation of normals. The left image -shows the orignal faceted model. The center image shows the model with -generated normals, but no consideration for sharp features. The third -image shows the model with a 30 degree feature angle and splitting -on. - -Theis example uses the `src/Testing/Data/42400-IDGH.stl` dataset. - -!!! info - See [Figure 9-24](../../../VTKBook/09Chapter9/#Figure%209-24) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/NormalsDemo.py b/data/examples/Visualization/NormalsDemo.py deleted file mode 100755 index 78711dd..0000000 --- a/data/examples/Visualization/NormalsDemo.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkIOGeometry import ( - vtkBYUReader, - vtkOBJReader, - vtkSTLReader -) -from vtkmodules.vtkIOPLY import vtkPLYReader -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - polyData = ReadPolyData(fileName) - - # A renderer. - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d("White")) - - # Create background colors for each viewport. - backgroundColors = list() - backgroundColors.append(colors.GetColor3d("Cornsilk")) - backgroundColors.append(colors.GetColor3d("NavajoWhite")) - backgroundColors.append(colors.GetColor3d("Tan")) - - # Create a renderer for each view port. - ren = list() - ren.append(vtkRenderer()) - ren.append(vtkRenderer()) - ren.append(vtkRenderer()) - ren[0].SetViewport(0, 0, 1.0 / 3.0, 1) # Input - ren[1].SetViewport(1.0 / 3.0, 0, 2.0 / 3.0, 1) # Normals (no split) - ren[2].SetViewport(2.0 / 3.0, 0, 1, 1) # Normals (split) - - # Shared camera. - camera = vtkCamera() - - normals = vtkPolyDataNormals() - normals.SetInputData(polyData) - normals.SetFeatureAngle(30.0) - for i in range(0, 3): - if i == 0: - normals.ComputePointNormalsOff() - elif i == 1: - normals.ComputePointNormalsOn() - normals.SplittingOff() - else: - normals.ComputePointNormalsOn() - normals.SplittingOn() - - normals.Update() - - normalsPolyData = vtkPolyData() - normalsPolyData.DeepCopy(normals.GetOutput()) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(normalsPolyData) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d("Peacock")) - actor.GetProperty().SetDiffuse(.7) - actor.GetProperty().SetSpecularPower(20) - actor.GetProperty().SetSpecular(.5) - - # add the actor - ren[i].SetBackground(backgroundColors[i]) - ren[i].SetActiveCamera(camera) - ren[i].AddActor(actor) - - # Render window. - renwin = vtkRenderWindow() - renwin.AddRenderer(ren[0]) - renwin.AddRenderer(ren[1]) - renwin.AddRenderer(ren[2]) - renwin.SetWindowName('NormalsDemo') - - # An interactor. - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - renwin.SetSize(900, 300) - ren[0].GetActiveCamera().SetFocalPoint(0, 0, 0) - ren[0].GetActiveCamera().SetPosition(1, 0, 0) - ren[0].GetActiveCamera().SetViewUp(0, 0, -1) - ren[0].ResetCamera() - - ren[0].GetActiveCamera().Azimuth(120) - ren[0].GetActiveCamera().Elevation(30) - ren[0].GetActiveCamera().Dolly(1.1) - ren[0].ResetCameraClippingRange() - - renwin.Render() - ren[0].ResetCamera() - renwin.Render() - - # Start. - interactor.Initialize() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Surface normal generation.' - epilogue = ''' - (a) Faceted model without normals. - (b) Polygons must be consistently oriented to accurately compute normals. - (c) Sharp edges are poorly represented using shared normals as shown on the corners of this model. - (d) Normal generation with sharp edges split. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='42400-IDGH.stl.') - args = parser.parse_args() - return args.filename1 - - -def ReadPolyData(file_name): - import os - path, extension = os.path.splitext(file_name) - extension = extension.lower() - if extension == ".ply": - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtp": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".obj": - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".stl": - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtk": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".g": - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. - poly_data = None - return poly_data - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/OrientedGlyphs.py b/data/examples/Visualization/OrientedGlyphs.py deleted file mode 100755 index 23f6d08..0000000 --- a/data/examples/Visualization/OrientedGlyphs.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersCore import vtkGlyph3D -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphereSource = vtkSphereSource() - sphereSource.Update() - - input_data = vtkPolyData() - input_data.ShallowCopy(sphereSource.GetOutput()) - - arrowSource = vtkArrowSource() - - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(arrowSource.GetOutputPort()) - glyph3D.SetVectorModeToUseNormal() - glyph3D.SetInputData(input_data) - glyph3D.SetScaleFactor(.2) - glyph3D.Update() - - # Visualize - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph3D.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('OrientedGlyphs') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DarkGreen')) - - renderWindow.Render() - - camera = renderer.GetActiveCamera() - camera.SetPosition(-0.399941, -1.070475, 2.931458) - camera.SetFocalPoint(-0.000000, -0.000000, 0.000000) - camera.SetViewUp(-0.028450, 0.940195, 0.339448) - camera.SetDistance(3.146318) - camera.SetClippingRange(1.182293, 5.626211) - - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/PointDataSubdivision.md b/data/examples/Visualization/PointDataSubdivision.md deleted file mode 100644 index 5954ebd..0000000 --- a/data/examples/Visualization/PointDataSubdivision.md +++ /dev/null @@ -1,22 +0,0 @@ -### Description - -#### Introduction - -This example demonstrates the use of the vtkLinearSubdivisionFilter and vtkButterflySubdivisionFilter. - -In order to see the effects of these filters a triptych is created that demonstrates the effect of applying the filter. - -The user can select from a list of sources to render, specify whether normals are displayed, what type of shading to use and the number of normals to glyph. - -A representative set of sources to render are provided in the class called **Sources**. The user is encouraged to experiment with different sources to see the effect of the filters. - -#### Adding more sources. -If you add more sources, you may need to provide one or all of these filters: - -- A vtkTriangleFilter -- A vtkPolyDataNormals filter -- A vtkElevationFilter. -- A vtkCleanPolyData filter. -- For parametric sources, you may need to apply one of both of **JoinUOff()** or **JoinVOff()**. - -The representative sources provided in the class **Sources** should provide good templates. diff --git a/data/examples/Visualization/PointDataSubdivision.py b/data/examples/Visualization/PointDataSubdivision.py deleted file mode 100755 index 8b247ec..0000000 --- a/data/examples/Visualization/PointDataSubdivision.py +++ /dev/null @@ -1,528 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonComputationalGeometry import ( - vtkParametricBoy, - vtkParametricEllipsoid, - vtkParametricMobius, - vtkParametricRandomHills, - vtkParametricTorus -) -from vtkmodules.vtkCommonCore import vtkVersion -from vtkmodules.vtkCommonDataModel import vtkColor3ub -from vtkmodules.vtkFiltersCore import ( - vtkCleanPolyData, - vtkElevationFilter, - vtkGlyph3D, - vtkMaskPoints, - vtkPolyDataNormals, - vtkTriangleFilter -) -from vtkmodules.vtkFiltersHybrid import vtkRenderLargeImage -from vtkmodules.vtkFiltersModeling import ( - vtkButterflySubdivisionFilter, - vtkLinearSubdivisionFilter -) -from vtkmodules.vtkFiltersSources import ( - vtkArrowSource, - vtkConeSource, - vtkParametricFunctionSource, - vtkSphereSource, - vtkSuperquadricSource -) -from vtkmodules.vtkIOImage import vtkPNGWriter -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAxesActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkActor2D, - vtkColorTransferFunction, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextMapper, - vtkTextProperty -) - -nc = vtkNamedColors() - - -def GetProgramParameters(): - import argparse - description = 'Demonstrates point data subdivision with the glyphing of normals on the surface.' - epilogue = ''' - This program takes a surface and displays three surfaces. - - The first surface is the original surface and the second and third surfaces have - had linear and butterfly interpolation applied respectively. - The user can control the object to use, normal generation, type of shading - and number of points to use for the normals. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('sourceToUse', help='The surface to use.', nargs='?', default='Boy') - parser.add_argument('-g', '--glyphPoints', help='Number of points to be used for glyphing.', nargs='?', default=50, - type=int) - parser.add_argument('--no-normals', help='Do not display normals.', dest='displayNormals', action='store_false') - parser.add_argument('--no-gouraud', help='Use flat interpolation. Gouraud interpolation is used by default.', - dest='gouraudInterpolation', action='store_false') - parser.set_defaults(displayNormals=True) - parser.set_defaults(gouraudInterpolation=True) - args = parser.parse_args() - return args.sourceToUse, args.displayNormals, args.gouraudInterpolation, args.glyphPoints - - -class Sources(object): - """ - This class acts as a storage vehicle for the various sources. - - If you add more sources, you may need to provide one or all of these filters: - - A Triangle filter - - A Normal filter - - An elevation filter. - - A CleanPolyData filter. - - For parametric sources, we may need to apply one of both of JoinUOff() or JoinVOff(). - - Use the representative sources provided here as templates. - """ - - def __init__(self): - # If you add more sources update this dictionary. - self.sources = {'ParametricTorus': self.ParametricTorusSource(), 'ParametricEllipsoid': self.EllipsoidSource(), - 'Boy': self.BoySource(), 'Sphere': self.SphereSource(), 'Mobius': self.MobiusSource(), - 'Cone': self.ConeSource(), 'RandomHills': self.ParametricRandomHills(), - 'Superquadric': self.SuperquadricSource()} - - @staticmethod - def ParametricTorusSource(): - torus = vtkParametricTorus() - torus.JoinUOff() - torus.JoinVOff() - torusSource = vtkParametricFunctionSource() - torusSource.SetParametricFunction(torus) - torusSource.SetScalarModeToZ() - return torusSource - - @staticmethod - def EllipsoidSource(): - ellipsoid = vtkParametricEllipsoid() - ellipsoid.SetXRadius(0.5) - ellipsoid.SetYRadius(1.0) - ellipsoid.SetZRadius(2.0) - ellipsoid.JoinUOff() - # ellipsoid.JoinVOff() - ellipsoidSource = vtkParametricFunctionSource() - ellipsoidSource.SetParametricFunction(ellipsoid) - ellipsoidSource.SetScalarModeToZ() - return ellipsoidSource - - @staticmethod - def BoySource(): - boy = vtkParametricBoy() - boy.JoinUOff() - # boy.JoinVOff() - boySource = vtkParametricFunctionSource() - boySource.SetParametricFunction(boy) - boySource.SetScalarModeToZ() - return boySource - - @staticmethod - def MobiusSource(): - mobius = vtkParametricMobius() - mobius.SetRadius(2) - mobius.SetMinimumV(-0.5) - mobius.SetMaximumV(0.5) - mobius.JoinUOff() - mobiusSource = vtkParametricFunctionSource() - mobiusSource.SetParametricFunction(mobius) - mobiusSource.SetScalarModeToX() - return mobiusSource - - @staticmethod - def ParametricRandomHills(): - randomHills = vtkParametricRandomHills() - # randomHills.AllowRandomGenerationOff() - randomHills.SetRandomSeed(1) - randomHills.SetNumberOfHills(30) - randomHillsSource = vtkParametricFunctionSource() - randomHillsSource.SetParametricFunction(randomHills) - randomHillsSource.SetScalarModeToZ() - randomHillsSource.SetUResolution(10) - randomHillsSource.SetVResolution(10) - return randomHillsSource - - @staticmethod - def SphereSource(): - sphere = vtkSphereSource() - sphere.SetPhiResolution(11) - sphere.SetThetaResolution(11) - sphere.Update() - sphereBounds = sphere.GetOutput().GetBounds() - - elev = vtkElevationFilter() - elev.SetInputConnection(sphere.GetOutputPort()) - elev.SetLowPoint(0, sphereBounds[2], 0) - elev.SetHighPoint(0, sphereBounds[3], 0) - elev.Update() - return elev - - @staticmethod - def SuperquadricSource(): - """ - Make a torus as the source. - """ - source = vtkSuperquadricSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetScale(1.0, 1.0, 1.0) - source.SetPhiResolution(64) - source.SetThetaResolution(64) - source.SetThetaRoundness(1) - source.SetThickness(0.5) - source.SetSize(10) - source.SetToroidal(1) - - # The quadric is made of strips, so pass it through a triangle filter as - # the curvature filter only operates on polys - tri = vtkTriangleFilter() - tri.SetInputConnection(source.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - cleanerBounds = cleaner.GetOutput().GetBounds() - - elev = vtkElevationFilter() - elev.SetInputConnection(cleaner.GetOutputPort()) - elev.SetLowPoint(0, cleanerBounds[2], 0) - elev.SetHighPoint(0, cleanerBounds[3], 0) - elev.Update() - return elev - - @staticmethod - def ConeSource(): - cone = vtkConeSource() - cone.SetResolution(6) - cone.CappingOn() - cone.Update() - coneBounds = cone.GetOutput().GetBounds() - - coneNormals = vtkPolyDataNormals() - coneNormals.SetInputConnection(cone.GetOutputPort()) - - elev = vtkElevationFilter() - elev.SetInputConnection(coneNormals.GetOutputPort()) - elev.SetLowPoint(coneBounds[0], 0, 0) - elev.SetHighPoint(coneBounds[1], 0, 0) - - # vtkButterflySubdivisionFilter and vtkLinearSubdivisionFilter operate on triangles. - tf = vtkTriangleFilter() - tf.SetInputConnection(elev.GetOutputPort()) - tf.Update() - return tf - - -def MakeLUT(scalarRange): - """ - Make a lookup table using a predefined color series. - - :param scalarRange: The range of the scalars to be coloured. - :return: A lookup table. - """ - colorSeries = vtkColorSeries() - # Select a color scheme. - # for i in range(0,62): - # colorSeries.SetColorScheme(i) - # print('Colour scheme {:2d}: {:s}'.format(colorSeries.GetColorScheme(), colorSeries.GetColorSchemeName())) - - # Colour scheme 61: Brewer Qualitative Set3 - colorSeries.SetColorScheme(61) - # We use this colour series to create the transfer function. - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() - numColors = colorSeries.GetNumberOfColors() - for i in range(0, numColors): - color = vtkColor3ub(colorSeries.GetColor(i)) - c = list() - for j in range(0, 3): - c.append(color[j] / 255.0) - t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i - lut.AddRGBPoint(t, *c) - return lut - - -def GlyphActor(source, glyphPoints, scalarRange, scaleFactor, lut): - """ - Create the actor for glyphing the normals. - - :param: source: the surface. - :param: glyphPoints: The number of points used by the mask filter. - :param: scalarRange: The range in terms of scalar minimum and maximum. - :param: scaleFactor: The scaling factor for the glyph. - :param: lut: The lookup table to use. - - :return: The glyph actor. - """ - arrowSource = vtkArrowSource() - # Subsample the dataset. - maskPts = vtkMaskPoints() - maskPts.SetInputConnection(source.GetOutputPort()) - maskPts.SetOnRatio(source.GetOutput().GetNumberOfPoints() // glyphPoints) - maskPts.SetRandomMode(1) - - arrowGlyph = vtkGlyph3D() - arrowGlyph.SetScaleFactor(scaleFactor) - arrowGlyph.SetVectorModeToUseNormal() - arrowGlyph.SetColorModeToColorByScalar() - arrowGlyph.SetScaleModeToScaleByVector() - arrowGlyph.OrientOn() - arrowGlyph.SetSourceConnection(arrowSource.GetOutputPort()) - arrowGlyph.SetInputConnection(maskPts.GetOutputPort()) - arrowGlyph.Update() - - arrowGlyphMapper = vtkDataSetMapper() - # Colour by scalars. - arrowGlyphMapper.SetScalarRange(scalarRange) - arrowGlyphMapper.SetColorModeToMapScalars() - arrowGlyphMapper.ScalarVisibilityOn() - arrowGlyphMapper.SetLookupTable(lut) - arrowGlyphMapper.SetInputConnection(arrowGlyph.GetOutputPort()) - - glyphActor = vtkActor() - glyphActor.SetMapper(arrowGlyphMapper) - return glyphActor - - -def MakeSurfaceActor(surface, scalarRange, lut): - """ - Create the actor for a surface. - - :param: surface: The surface. - :param: scalarRange: The range in terms of scalar minimum and maximum. - :param: lut: The lookup table to use. - - :return: The actor for the surface. - """ - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) - mapper.SetLookupTable(lut) - mapper.SetScalarRange(scalarRange) - mapper.SetColorModeToMapScalars() - mapper.ScalarVisibilityOn() - actor = vtkActor() - actor.SetMapper(mapper) - return actor - - -def MakeLabel(textLabel, renWinSize): - """ - Create a label. - - :param textLabel: The label. - :param renWinSize: The size of the render window. Used to set the font size. - - :return: The actor for the text label. - """ - # Create one text property for all - textProperty = vtkTextProperty() - textProperty.SetJustificationToCentered() - textProperty.SetFontSize(int(renWinSize / 20)) - - mapper = vtkTextMapper() - mapper.SetInput(textLabel) - mapper.SetTextProperty(textProperty) - - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.SetPosition(renWinSize / 2.0, 16) - actor.GetProperty().SetColor(nc.GetColor3d("Gold")) - return actor - - -def MakeAxesActor(): - """ - Make an axis actor. - - :return: The axis actor. - """ - axes = vtkAxesActor() - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText('X') - axes.SetYAxisLabelText('Y') - axes.SetZAxisLabelText('Z') - axes.SetTotalLength(1.0, 1.0, 1.0) - axes.SetCylinderRadius(1.0 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.75 * axes.GetConeRadius()) - axes.SetSphereRadius(1.0 * axes.GetSphereRadius()) - axes.GetXAxisCaptionActor2D().GetTextActor().GetScaledTextProperty() - axes.GetXAxisCaptionActor2D().GetTextActor().SetTextScaleModeToNone() - axes.GetYAxisCaptionActor2D().GetTextActor().GetScaledTextProperty() - axes.GetYAxisCaptionActor2D().GetTextActor().SetTextScaleModeToNone() - axes.GetZAxisCaptionActor2D().GetTextActor().GetScaledTextProperty() - axes.GetZAxisCaptionActor2D().GetTextActor().SetTextScaleModeToNone() - return axes - - -def MakeOrientationMarker(renderer, iren): - """ - Create an orientation marker for a given renderer. - - :param renderer: The renderer. - :param iren: The interactor. - - :return: The orientation marker. - """ - om = vtkOrientationMarkerWidget() - om.SetOrientationMarker(MakeAxesActor()) - # Position lower left in the viewport. - om.SetViewport(0, 0, 0.2, 0.2) - om.SetInteractor(iren) - om.SetDefaultRenderer(renderer) - om.EnabledOn() - om.InteractiveOn() - renderer.ResetCamera() - return om - - -def WritePNG(ren, fn, magnification=1): - """ - Save the image as a PNG - :param: ren - the renderer. - :param: fn - the file name. - :param: magnification - the magnification, usually 1. - """ - renLgeIm = vtkRenderLargeImage() - renLgeIm.SetInput(ren) - renLgeIm.SetMagnification(magnification) - imgWriter = vtkPNGWriter() - imgWriter.SetInputConnection(renLgeIm.GetOutputPort()) - imgWriter.SetFileName(fn) - imgWriter.Write() - - -def main(): - def FlatInterpolation(): - for actor in actors: - actor.GetProperty().SetInterpolationToFlat() - renWin.Render() - - def GouraudInterpolation(): - for actor in actors: - actor.GetProperty().SetInterpolationToGouraud() - renWin.Render() - - sourceToUse, displayNormals, gouraudInterpolation, glyphPoints = GetProgramParameters() - - if sourceToUse in Sources().sources: - src = Sources().sources[sourceToUse] - else: - print('The source {:s} is not available.'.format(sourceToUse)) - print('Available sources are:\n', ', '.join(sorted(list(Sources().sources.keys())))) - return - - src.Update() - - # The size of the render window. - renWinXSize = 1200 - renWinYSize = renWinXSize // 3 - minRenWinDim = min(renWinXSize, renWinYSize) - - # [xMin, xMax, yMin, yMax, zMin, zMax] - bounds = src.GetOutput().GetBounds() - # Use this to scale the normal glyph. - scaleFactor = min(map(lambda x, y: x - y, bounds[1::2], bounds[::2])) * 0.2 - src.GetOutput().GetPointData().GetScalars().SetName("Elevation") - scalarRange = src.GetOutput().GetScalarRange() - - butterfly = vtkButterflySubdivisionFilter() - butterfly.SetInputConnection(src.GetOutputPort()) - butterfly.SetNumberOfSubdivisions(3) - butterfly.Update() - - linear = vtkLinearSubdivisionFilter() - linear.SetInputConnection(src.GetOutputPort()) - linear.SetNumberOfSubdivisions(3) - linear.Update() - - lut = MakeLUT(scalarRange) - - actors = list() - actors.append(MakeSurfaceActor(butterfly, scalarRange, lut)) - actors.append(MakeSurfaceActor(linear, scalarRange, lut)) - actors.append(MakeSurfaceActor(src, scalarRange, lut)) - - # Let's visualise the normals. - glyphActors = list() - if displayNormals: - glyphActors.append(GlyphActor(butterfly, glyphPoints, scalarRange, scaleFactor, lut)) - glyphActors.append(GlyphActor(linear, glyphPoints, scalarRange, scaleFactor, lut)) - glyphActors.append(GlyphActor(src, glyphPoints, scalarRange, scaleFactor, lut)) - - labelActors = list() - labelActors.append(MakeLabel('Butterfly Subdivision', minRenWinDim)) - labelActors.append(MakeLabel('Linear Subdivision', minRenWinDim)) - labelActors.append(MakeLabel('Original', minRenWinDim)) - - ren = list() - ren.append(vtkRenderer()) - ren.append(vtkRenderer()) - ren.append(vtkRenderer()) - ren[2].SetViewport(0, 0, 1.0 / 3.0, 1) # Original - ren[1].SetViewport(1.0 / 3.0, 0, 2.0 / 3.0, 1) # Linear - ren[0].SetViewport(2.0 / 3.0, 0, 1, 1) # Butterfly - - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Orientation markers. - om = list() - # Make the imaging pipelines. - for i in range(0, len(ren)): - renWin.AddRenderer(ren[i]) - - ren[i].AddActor(actors[i]) - ren[i].AddActor(labelActors[i]) - ren[i].SetBackground(nc.GetColor3d('SlateGray')) - - if displayNormals: - ren[i].AddActor(glyphActors[i]) - - om.append(MakeOrientationMarker(ren[i], iren)) - - if gouraudInterpolation: - GouraudInterpolation() - else: - FlatInterpolation() - - renWin.SetSize(renWinXSize, renWinYSize) - renWin.Render() - # renWin.SetWindowName() needs to be called after renWin.Render() - renWin.SetWindowName('PointDataSubdivision') - - iren.Initialize() - # WritePNG(iren.GetRenderWindow().GetRenderers().GetFirstRenderer(), "TestPointDataSubdivision.png") - iren.Start() - - -if __name__ == '__main__': - requiredMajorVersion = 6 - # print(vtkVersion().GetVTKMajorVersion()) - if vtkVersion().GetVTKMajorVersion() < requiredMajorVersion: - print("You need VTK Version 6 or greater.") - print("The class vtkNamedColors is in VTK version 6 or greater.") - exit(0) - - main() diff --git a/data/examples/Visualization/PointSize.py b/data/examples/Visualization/PointSize.py deleted file mode 100755 index 8328c36..0000000 --- a/data/examples/Visualization/PointSize.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('PointSize') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create source - src = vtkPointSource() - src.SetCenter(0, 0, 0) - src.SetNumberOfPoints(10) - src.SetRadius(5) - src.Update() - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(src.GetOutputPort()) - - # actor - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - actor.GetProperty().SetPointSize(5) - - # assign actor to the renderer - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('RoyalBLue')) - - # enable user interface interactor - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ProgrammableGlyphFilter.py b/data/examples/Visualization/ProgrammableGlyphFilter.py deleted file mode 100755 index 68cd73e..0000000 --- a/data/examples/Visualization/ProgrammableGlyphFilter.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkFiltersProgrammable import vtkProgrammableGlyphFilter -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - - # Create points. - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(5, 0, 0) - points.InsertNextPoint(10, 0, 0) - - # Combine into a polydata. - polydata = vtkPolyData() - polydata.SetPoints(points) - - glyph_filter = vtkProgrammableGlyphFilter() - glyph_filter.SetInputData(polydata) - # Create the observer. - observer = CalcGlyph(glyph_filter) - glyph_filter.SetGlyphMethod(observer) - # It needs a default glyph, but this should not be used. - cone_source = vtkConeSource() - glyph_filter.SetSourceConnection(cone_source.GetOutputPort()) - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph_filter.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetWindowName('ProgrammableGlyphFilter') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Add the actor to the scene. - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - # Render and interact. - ren_win.Render() - renderer.GetActiveCamera().Zoom(0.9) - iren.Start() - - -class CalcGlyph(object): - def __init__(self, glyph_filter): - self.glyph_filter = glyph_filter - - def __call__(self): - point_coords = self.glyph_filter.GetPoint() - - print('Calling CalcGlyph for point ', self.glyph_filter.GetPointId()) - print('Point coords are: ', point_coords[0], point_coords[1], point_coords[2]) - if self.glyph_filter.GetPointId() == 0: - cone_source = vtkConeSource() - cone_source.SetCenter(point_coords) - self.glyph_filter.SetSourceConnection(cone_source.GetOutputPort()) - elif self.glyph_filter.GetPointId() == 1: - cube_source = vtkCubeSource() - cube_source.SetCenter(point_coords) - self.glyph_filter.SetSourceConnection(cube_source.GetOutputPort()) - elif self.glyph_filter.GetPointId() == 2: - sphere_source = vtkSphereSource() - sphere_source.SetCenter(point_coords) - self.glyph_filter.SetSourceConnection(sphere_source.GetOutputPort()) - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Visualization/ProgrammableGlyphs.py b/data/examples/Visualization/ProgrammableGlyphs.py deleted file mode 100755 index 42c14ce..0000000 --- a/data/examples/Visualization/ProgrammableGlyphs.py +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env python - -# Python example translated directly from Tcl test -# [vtk_source]/Graphics/Testing/Tcl/progGlyphs.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkElevationFilter -from vtkmodules.vtkFiltersProgrammable import vtkProgrammableGlyphFilter -from vtkmodules.vtkFiltersSources import ( - vtkPlaneSource, - vtkSuperquadricSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - res = 6 - plane = vtkPlaneSource() - plane.SetResolution(res, res) - colors = vtkElevationFilter() - colors.SetInputConnection(plane.GetOutputPort()) - colors.SetLowPoint(-0.25, -0.25, -0.25) - colors.SetHighPoint(0.25, 0.25, 0.25) - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputData(colors.GetPolyDataOutput()) - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.GetProperty().SetRepresentationToWireframe() - - # create simple poly data so we can apply glyph - squad = vtkSuperquadricSource() - - def Glyph(): - """ - # procedure for generating glyphs - :return: - """ - xyz = glypher.GetPoint() - x = xyz[0] - y = xyz[1] - length = glypher.GetInput(0).GetLength() - scale = length / (2.0 * res) - - squad.SetScale(scale, scale, scale) - squad.SetCenter(xyz) - squad.SetPhiRoundness(abs(x) * 5.0) - squad.SetThetaRoundness(abs(y) * 5.0) - - glypher = vtkProgrammableGlyphFilter() - glypher.SetInputConnection(colors.GetOutputPort()) - glypher.SetSourceConnection(squad.GetOutputPort()) - glypher.SetGlyphMethod(Glyph) - glyphMapper = vtkPolyDataMapper() - glyphMapper.SetInputConnection(glypher.GetOutputPort()) - glyphActor = vtkActor() - glyphActor.SetMapper(glyphMapper) - - colors = vtkNamedColors() - - # Create the rendering stuff - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetMultiSamples(0) - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - ren1.AddActor(planeActor) - ren1.AddActor(glyphActor) - ren1.SetBackground(colors.GetColor3d('Silver')) - - renWin.SetSize(450, 450) - renWin.SetWindowName('ProgrammableGlyphs') - renWin.Render() - - ren1.GetActiveCamera().Zoom(1.3) - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/QuadricVisualization.md b/data/examples/Visualization/QuadricVisualization.md deleted file mode 100644 index 484aca6..0000000 --- a/data/examples/Visualization/QuadricVisualization.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Visualizing a quadric function F(x,y,z) = c - -This example is inspired by the Figure 4-1, page 83, in the [VTK Book](https://www.kitware.com/products/books/VTKTextbook.pdf). - -!!! info - See [Figure 4-1](../../../VTKBook/04Chapter4/#Figure%204-1) in [Chapter 4](../../../VTKBook/04Chapter4) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/Visualization/QuadricVisualization.py b/data/examples/Visualization/QuadricVisualization.py deleted file mode 100755 index 1f01ccb..0000000 --- a/data/examples/Visualization/QuadricVisualization.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersCore import ( - vtkAppendFilter, - vtkContourFilter -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingCore import vtkExtractVOI -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - renderer = vtkRenderer() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - renderWindow.SetSize(640, 480) - - # - # Create surface of implicit function. - # - - # Sample quadric function. - quadric = vtkQuadric() - quadric.SetCoefficients(1, 2, 3, 0, 1, 0, 0, 0, 0, 0) - - sample = vtkSampleFunction() - sample.SetSampleDimensions(25, 25, 25) - sample.SetImplicitFunction(quadric) - - isoActor = vtkActor() - CreateIsosurface(sample, isoActor) - outlineIsoActor = vtkActor() - CreateOutline(sample, outlineIsoActor) - - planesActor = vtkActor() - CreatePlanes(sample, planesActor, 3) - outlinePlanesActor = vtkActor() - CreateOutline(sample, outlinePlanesActor) - planesActor.AddPosition(isoActor.GetBounds()[0] * 2.0, 0, 0) - outlinePlanesActor.AddPosition(isoActor.GetBounds()[0] * 2.0, 0, 0) - - contourActor = vtkActor() - CreateContours(sample, contourActor, 3, 15) - outlineContourActor = vtkActor() - CreateOutline(sample, outlineContourActor) - contourActor.AddPosition(isoActor.GetBounds()[0] * 4.0, 0, 0) - outlineContourActor.AddPosition(isoActor.GetBounds()[0] * 4.0, 0, 0) - - renderer.AddActor(planesActor) - renderer.AddActor(outlinePlanesActor) - renderer.AddActor(contourActor) - renderer.AddActor(outlineContourActor) - renderer.AddActor(isoActor) - renderer.AddActor(outlineIsoActor) - - renderer.TwoSidedLightingOn() - - renderer.SetBackground(colors.GetColor3d("SlateGray")) - - # Try to set camera to match figure on book - renderer.GetActiveCamera().SetPosition(0, -1, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 0, -1) - renderer.ResetCamera() - renderer.GetActiveCamera().Elevation(20) - renderer.GetActiveCamera().Azimuth(10) - renderer.GetActiveCamera().Dolly(1.2) - renderer.ResetCameraClippingRange() - - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('QuadricVisualization'); - - renderWindow.Render() - - # interact with data - interactor.Start() - - -def CreateIsosurface(func, actor, numberOfContours=5): - # Generate implicit surface. - contour = vtkContourFilter() - contour.SetInputConnection(func.GetOutputPort()) - ranges = [1.0, 6.0] - contour.GenerateValues(numberOfContours, ranges) - - # Map contour - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) - contourMapper.SetScalarRange(0, 7) - - actor.SetMapper(contourMapper) - return - - -def CreatePlanes(func, actor, numberOfPlanes): - # - # Extract planes from implicit function. - # - - append = vtkAppendFilter() - - dims = func.GetSampleDimensions() - sliceIncr = (dims[2] - 1) // (numberOfPlanes + 1) - sliceNum = -4 - for i in range(0, numberOfPlanes): - extract = vtkExtractVOI() - extract.SetInputConnection(func.GetOutputPort()) - extract.SetVOI(0, dims[0] - 1, - 0, dims[1] - 1, - sliceNum + sliceIncr, sliceNum + sliceIncr) - append.AddInputConnection(extract.GetOutputPort()) - sliceNum += sliceIncr - append.Update() - - # Map planes - planesMapper = vtkDataSetMapper() - planesMapper.SetInputConnection(append.GetOutputPort()) - planesMapper.SetScalarRange(0, 7) - - actor.SetMapper(planesMapper) - actor.GetProperty().SetAmbient(1.) - return - - -def CreateContours(func, actor, numberOfPlanes, numberOfContours): - # - # Extract planes from implicit function - # - - append = vtkAppendFilter() - - dims = func.GetSampleDimensions() - sliceIncr = (dims[2] - 1) // (numberOfPlanes + 1) - - sliceNum = -4 - for i in range(0, numberOfPlanes): - extract = vtkExtractVOI() - extract.SetInputConnection(func.GetOutputPort()) - extract.SetVOI(0, dims[0] - 1, - 0, dims[1] - 1, - sliceNum + sliceIncr, sliceNum + sliceIncr) - ranges = [1.0, 6.0] - contour = vtkContourFilter() - contour.SetInputConnection(extract.GetOutputPort()) - contour.GenerateValues(numberOfContours, ranges) - append.AddInputConnection(contour.GetOutputPort()) - sliceNum += sliceIncr - append.Update() - - # Map planes - planesMapper = vtkDataSetMapper() - planesMapper.SetInputConnection(append.GetOutputPort()) - planesMapper.SetScalarRange(0, 7) - - actor.SetMapper(planesMapper) - actor.GetProperty().SetAmbient(1.) - return - - -def CreateOutline(source, actor): - outline = vtkOutlineFilter() - outline.SetInputConnection(source.GetOutputPort()) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(outline.GetOutputPort()) - actor.SetMapper(mapper) - return - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/ShadowsLightsDemo.py b/data/examples/Visualization/ShadowsLightsDemo.py deleted file mode 100755 index 5cbc9a1..0000000 --- a/data/examples/Visualization/ShadowsLightsDemo.py +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env python3 - -""" -The scene consists of: -1) four actors: a rectangle, a box, a cone and a sphere. - The box, the cone and the sphere are above the rectangle. -2) Two spotlights, one in the direction of the box, another one in the - direction of the sphere. - Both lights are above the box, the cone and the sphere. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkCubeSource, - vtkPlaneSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkLight, - vtkLightActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor -) -from vtkmodules.vtkRenderingOpenGL2 import ( - vtkCameraPass, - vtkOpaquePass, - vtkOpenGLRenderer, - vtkRenderPassCollection, - vtkSequencePass, - vtkShadowMapPass -) - - -def main(): - iren = vtkRenderWindowInteractor() - - renwin = vtkRenderWindow() - renwin.SetSize(400, 400) - renwin.SetMultiSamples(0) - - renwin.SetAlphaBitPlanes(1) - iren.SetRenderWindow(renwin) - - renderer = vtkOpenGLRenderer() - renwin.AddRenderer(renderer) - renwin.SetSize(640, 480) - - seq = vtkSequencePass() - - passes = vtkRenderPassCollection() - - shadows = vtkShadowMapPass() - passes.AddItem(shadows.GetShadowMapBakerPass()) - passes.AddItem(shadows) - - opaque = vtkOpaquePass() - passes.AddItem(opaque) - - seq.SetPasses(passes) - - camera_p = vtkCameraPass() - camera_p.SetDelegatePass(seq) - - # Tell the renderer to use our render pass pipeline. - renderer.SetPass(camera_p) - - colors = vtkNamedColors() - box_color = colors.GetColor3d('Tomato') - rectangle_color = colors.GetColor3d('Beige') - cone_color = colors.GetColor3d('Peacock') - sphere_color = colors.GetColor3d('Banana') - - rectangle_source = vtkPlaneSource() - rectangle_source.SetOrigin(-5.0, 0.0, 5.0) - rectangle_source.SetPoint1(5.0, 0.0, 5.0) - rectangle_source.SetPoint2(-5.0, 0.0, -5.0) - rectangle_source.SetResolution(100, 100) - - rectangle_mapper = vtkPolyDataMapper() - rectangle_mapper.SetInputConnection(rectangle_source.GetOutputPort()) - - rectangle_mapper.SetScalarVisibility(0) - - rectangle_actor = vtkActor() - rectangle_actor.SetMapper(rectangle_mapper) - rectangle_actor.VisibilityOn() - rectangle_actor.GetProperty().SetColor(rectangle_color) - - box_source = vtkCubeSource() - box_source.SetXLength(2.0) - - box_normals = vtkPolyDataNormals() - box_normals.SetInputConnection(box_source.GetOutputPort()) - box_normals.ComputePointNormalsOff() - box_normals.ComputeCellNormalsOn() - box_normals.Update() - box_normals.GetOutput().GetPointData().SetNormals(None) - - box_mapper = vtkPolyDataMapper() - box_mapper.SetInputConnection(box_normals.GetOutputPort()) - box_mapper.ScalarVisibilityOff() - - box_actor = vtkActor() - box_actor.SetMapper(box_mapper) - box_actor.VisibilityOn() - box_actor.SetPosition(-2.0, 2.0, 0.0) - box_actor.GetProperty().SetColor(box_color) - - cone_source = vtkConeSource() - cone_source.SetResolution(24) - cone_source.SetDirection(1.0, 1.0, 1.0) - - cone_mapper = vtkPolyDataMapper() - cone_mapper.SetInputConnection(cone_source.GetOutputPort()) - cone_mapper.SetScalarVisibility(0) - - cone_actor = vtkActor() - cone_actor.SetMapper(cone_mapper) - cone_actor.VisibilityOn() - cone_actor.SetPosition(0.0, 1.0, 1.0) - cone_actor.GetProperty().SetColor(cone_color) - - sphere_source = vtkSphereSource() - sphere_source.SetThetaResolution(32) - sphere_source.SetPhiResolution(32) - - sphere_mapper = vtkPolyDataMapper() - sphere_mapper.SetInputConnection(sphere_source.GetOutputPort()) - sphere_mapper.ScalarVisibilityOff() - - sphere_actor = vtkActor() - sphere_actor.SetMapper(sphere_mapper) - - sphere_actor.VisibilityOn() - sphere_actor.SetPosition(2.0, 2.0, -1.0) - sphere_actor.GetProperty().SetColor(sphere_color) - - renderer.AddViewProp(rectangle_actor) - renderer.AddViewProp(box_actor) - renderer.AddViewProp(cone_actor) - renderer.AddViewProp(sphere_actor) - - # Spotlights. - - # Lighting the box. - l1 = vtkLight() - l1.SetPosition(-4.0, 4.0, -1.0) - l1.SetFocalPoint(box_actor.GetPosition()) - l1.SetColor(colors.GetColor3d('White')) - l1.PositionalOn() - renderer.AddLight(l1) - l1.SwitchOn() - - # Lighting the sphere. - l2 = vtkLight() - l2.SetPosition(4.0, 5.0, 1.0) - l2.SetFocalPoint(sphere_actor.GetPosition()) - l2.SetColor(colors.GetColor3d('Magenta')) - l2.PositionalOn() - renderer.AddLight(l2) - l2.SwitchOn() - - # For each spotlight, add a light frustum wireframe representation and a cone - # wireframe representation, colored with the light color. - angle = l1.GetConeAngle() - if l1.LightTypeIsSceneLight() and l1.GetPositional() and angle < 180.0: # spotlight - la = vtkLightActor() - la.SetLight(l1) - renderer.AddViewProp(la) - angle = l2.GetConeAngle() - if l2.LightTypeIsSceneLight() and l2.GetPositional() and angle < 180.0: # spotlight - la = vtkLightActor() - la.SetLight(l2) - renderer.AddViewProp(la) - - renderer.SetBackground2(colors.GetColor3d('Black')) - renderer.SetBackground(colors.GetColor3d('Silver')) - renderer.SetGradientBackground(True) - - renwin.Render() - renwin.SetWindowName('ShadowsLightsDemo') - - renderer.ResetCamera() - - camera = renderer.GetActiveCamera() - camera.Azimuth(40.0) - camera.Elevation(10.0) - - renwin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/SphereTexture.md b/data/examples/Visualization/SphereTexture.md deleted file mode 100644 index 6c7adaf..0000000 --- a/data/examples/Visualization/SphereTexture.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows how to apply an vtkImageData texture to an sphere vtkPolyData object. There is a sample data file `src/Testing/Data/masonry-wide.jpg`. diff --git a/data/examples/Visualization/SphereTexture.py b/data/examples/Visualization/SphereTexture.py deleted file mode 100755 index c84fea7..0000000 --- a/data/examples/Visualization/SphereTexture.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -## -# This example shows how to apply an vtkImageData texture to an sphere -# vtkPolyData object. -# Note: Input jpg file can be located in the VTKData repository. -# -# @author JBallesteros -## - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkFiltersTexture import vtkTextureMapToSphere -from vtkmodules.vtkIOImage import vtkJPEGReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def get_program_parameters(): - import argparse - description = 'Texture an object with an image.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='masonry-wide.jpg.') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - jpegfile = get_program_parameters() - - # Create a render window - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(480, 480) - renWin.SetWindowName('SphereTexture') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Generate an sphere polydata - sphere = vtkSphereSource() - sphere.SetThetaResolution(12) - sphere.SetPhiResolution(12) - - # Read the image data from a file - reader = vtkJPEGReader() - reader.SetFileName(jpegfile) - - # Create texture object - texture = vtkTexture() - texture.SetInputConnection(reader.GetOutputPort()) - - # Map texture coordinates - map_to_sphere = vtkTextureMapToSphere() - map_to_sphere.SetInputConnection(sphere.GetOutputPort()) - map_to_sphere.PreventSeamOn() - - # Create mapper and set the mapped texture as input - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(map_to_sphere.GetOutputPort()) - - # Create actor and set the mapper and the texture - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetTexture(texture) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('RosyBrown')) - - iren.Initialize() - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/StreamLines.py b/data/examples/Visualization/StreamLines.py deleted file mode 100755 index 6318990..0000000 --- a/data/examples/Visualization/StreamLines.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Streamlines.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('xyz_file', help='combxyz.bin.') - parser.add_argument('q_file', help='combq.bin.') - args = parser.parse_args() - return args.xyz_file, args.q_file - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.1, 0.2, 0.4, 1.0]) - - xyz_file, q_file = get_program_parameters() - - # Read the data. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyz_file) - pl3d.SetQFileName(q_file) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - seeds = vtkPlaneSource() - seeds.SetXResolution(4) - seeds.SetYResolution(4) - seeds.SetOrigin(2, -2, 26) - seeds.SetPoint1(2, 2, 26) - seeds.SetPoint2(2, -2, 32) - - streamline = vtkStreamTracer() - streamline.SetInputData(pl3d.GetOutput().GetBlock(0)) - streamline.SetSourceConnection(seeds.GetOutputPort()) - streamline.SetMaximumPropagation(200) - streamline.SetInitialIntegrationStep(.2) - streamline.SetIntegrationDirectionToForward() - - streamline_mapper = vtkPolyDataMapper() - streamline_mapper.SetInputConnection(streamline.GetOutputPort()) - streamline_actor = vtkActor() - streamline_actor.SetMapper(streamline_mapper) - streamline_actor.VisibilityOn() - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3d.GetOutput().GetBlock(0)) - outline_mapper = vtkPolyDataMapper() - outline_mapper.SetInputConnection(outline.GetOutputPort()) - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - outline_actor.GetProperty().SetColor(colors.GetColor3d('White')) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetWindowName('StreamLines') - - interactor = vtkRenderWindowInteractor() - interactor.SetInteractorStyle(vtkInteractorStyleTrackballCamera()) - render_window.SetInteractor(interactor) - - renderer.AddActor(streamline_actor) - renderer.AddActor(outline_actor) - - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - interactor.Initialize() - render_window.Render() - renderer.GetActiveCamera().SetPosition(-32.8, -12.3, 46.3) - renderer.GetActiveCamera().SetFocalPoint(8.3, 0.03, 29.8) - renderer.GetActiveCamera().SetViewUp(0.2, 0.5, 0.9) - render_window.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/TextSource.py b/data/examples/Visualization/TextSource.py deleted file mode 100755 index 50f16aa..0000000 --- a/data/examples/Visualization/TextSource.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkTextSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - textSource = vtkTextSource() - textSource.SetText("Hello") - textSource.SetForegroundColor(colors.GetColor3d('DarkSlateGray')) - textSource.SetBackgroundColor(colors.GetColor3d('NavajoWhite')) - # Turn off if you don't want the background drawn with the text. - textSource.BackingOn() - textSource.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(textSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('TextSource') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Bisque')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/VTKColorSeriesPatches.html b/data/examples/Visualization/VTKColorSeriesPatches.html deleted file mode 100644 index 8136265..0000000 --- a/data/examples/Visualization/VTKColorSeriesPatches.html +++ /dev/null @@ -1,1017 +0,0 @@ - - - - -vtkColorSeries - - - -

    Color series available in vtkColorSeries

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    IndexName
    Colors in the Series
    0Spectrum
      0    1    2    3    4    5    6    
    1Warm
      0    1    2    3    4    5    
    2Cool
      0    1    2    3    4    5    6    
    3Blues
      0    1    2    3    4    5    6    
    4Wild Flower
      0    1    2    3    4    5    6    
    5Citrus
      0    1    2    3    4    5    
    6Brewer Diverging Purple-Orange (11)
      0    1    2    3    4    5    6    7    8    9   10    
    7Brewer Diverging Purple-Orange (10)
      0    1    2    3    4    5    6    7    8    9    
    8Brewer Diverging Purple-Orange (9)
      0    1    2    3    4    5    6    7    8    
    9Brewer Diverging Purple-Orange (8)
      0    1    2    3    4    5    6    7    
    10Brewer Diverging Purple-Orange (7)
      0    1    2    3    4    5    6    
    11Brewer Diverging Purple-Orange (6)
      0    1    2    3    4    5    
    12Brewer Diverging Purple-Orange (5)
      0    1    2    3    4    
    13Brewer Diverging Purple-Orange (4)
      0    1    2    3    
    14Brewer Diverging Purple-Orange (3)
      0    1    2    
    15Brewer Diverging Spectral (11)
      0    1    2    3    4    5    6    7    8    9   10    
    16Brewer Diverging Spectral (10)
      0    1    2    3    4    5    6    7    8    9    
    17Brewer Diverging Spectral (9)
      0    1    2    3    4    5    6    7    8    
    18Brewer Diverging Spectral (8)
      0    1    2    3    4    5    6    7    
    19Brewer Diverging Spectral (7)
      0    1    2    3    4    5    6    
    20Brewer Diverging Spectral (6)
      0    1    2    3    4    5    
    21Brewer Diverging Spectral (5)
      0    1    2    3    4    
    22Brewer Diverging Spectral (4)
      0    1    2    3    
    23Brewer Diverging Spectral (3)
      0    1    2    
    24Brewer Diverging Brown-Blue-Green (11)
      0    1    2    3    4    5    6    7    8    9   10    
    25Brewer Diverging Brown-Blue-Green (10)
      0    1    2    3    4    5    6    7    8    9    
    26Brewer Diverging Brown-Blue-Green (9)
      0    1    2    3    4    5    6    7    8    
    27Brewer Diverging Brown-Blue-Green (8)
      0    1    2    3    4    5    6    7    
    28Brewer Diverging Brown-Blue-Green (7)
      0    1    2    3    4    5    6    
    29Brewer Diverging Brown-Blue-Green (6)
      0    1    2    3    4    5    
    30Brewer Diverging Brown-Blue-Green (5)
      0    1    2    3    4    
    31Brewer Diverging Brown-Blue-Green (4)
      0    1    2    3    
    32Brewer Diverging Brown-Blue-Green (3)
      0    1    2    
    33Brewer Sequential Blue-Green (9)
      0    1    2    3    4    5    6    7    8    
    34Brewer Sequential Blue-Green (8)
      0    1    2    3    4    5    6    7    
    35Brewer Sequential Blue-Green (7)
      0    1    2    3    4    5    6    
    36Brewer Sequential Blue-Green (6)
      0    1    2    3    4    5    
    37Brewer Sequential Blue-Green (5)
      0    1    2    3    4    
    38Brewer Sequential Blue-Green (4)
      0    1    2    3    
    39Brewer Sequential Blue-Green (3)
      0    1    2    
    40Brewer Sequential Yellow-Orange-Brown (9)
      0    1    2    3    4    5    6    7    8    
    41Brewer Sequential Yellow-Orange-Brown (8)
      0    1    2    3    4    5    6    7    
    42Brewer Sequential Yellow-Orange-Brown (7)
      0    1    2    3    4    5    6    
    43Brewer Sequential Yellow-Orange-Brown (6)
      0    1    2    3    4    5    
    44Brewer Sequential Yellow-Orange-Brown (5)
      0    1    2    3    4    
    45Brewer Sequential Yellow-Orange-Brown (4)
      0    1    2    3    
    46Brewer Sequential Yellow-Orange-Brown (3)
      0    1    2    
    47Brewer Sequential Blue-Purple (9)
      0    1    2    3    4    5    6    7    8    
    48Brewer Sequential Blue-Purple (8)
      0    1    2    3    4    5    6    7    
    49Brewer Sequential Blue-Purple (7)
      0    1    2    3    4    5    6    
    50Brewer Sequential Blue-Purple (6)
      0    1    2    3    4    5    
    51Brewer Sequential Blue-Purple (5)
      0    1    2    3    4    
    52Brewer Sequential Blue-Purple (4)
      0    1    2    3    
    53Brewer Sequential Blue-Purple (3)
      0    1    2    
    54Brewer Qualitative Accent
      0    1    2    3    4    5    6    7    
    55Brewer Qualitative Dark2
      0    1    2    3    4    5    6    7    
    56Brewer Qualitative Set2
      0    1    2    3    4    5    6    7    
    57Brewer Qualitative Pastel2
      0    1    2    3    4    5    6    7    
    58Brewer Qualitative Pastel1
      0    1    2    3    4    5    6    7    8    
    59Brewer Qualitative Set1
      0    1    2    3    4    5    6    7    8    
    60Brewer Qualitative Paired
      0    1    2    3    4    5    6    7    8    9   10    
    61Brewer Qualitative Set3
      0    1    2    3    4    5    6    7    8    9   10   11  
    - diff --git a/data/examples/Visualization/VTKNamedColorPatches.html b/data/examples/Visualization/VTKNamedColorPatches.html deleted file mode 100644 index 780cc3b..0000000 --- a/data/examples/Visualization/VTKNamedColorPatches.html +++ /dev/null @@ -1,1907 +0,0 @@ - - - - -vtkNamedColors - - - -

    Colors available in vtkNamedColors

    -The class vtkNamedColors provides color names and their values for the convenience of the user. -
    The following tables show the available colors along with their red, green and blue values. -

    Index

    -
      -
    • Web color Names These colors correspond to those in Web Colors. -
    • -
    • VTK color Names - The colors correspond to additional colors commonly used in VTK. -
      The web colors take precedence over colors with - the same name (case insensitive) here. -
    • -
    • Synonyms
    • -
    - - - - - - - - - -
    Web color Names
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Red colors
    IndianRed205   92   92
    LightCoral240  128  128
    Salmon250  128  114
    DarkSalmon233  150  122
    LightSalmon255  160  122
    Red255    0    0
    Crimson220   20   60
    FireBrick178   34   34
    DarkRed139    0    0
    Pink colors
    Pink255  192  203
    LightPink255  182  193
    HotPink255  105  180
    DeepPink255   20  147
    MediumVioletRed199   21  133
    PaleVioletRed219  112  147
    Orange colors
    LightSalmon255  160  122
    Coral255  127   80
    Tomato255   99   71
    OrangeRed255   69    0
    DarkOrange255  140    0
    Orange255  165    0
    Yellow colors
    Gold255  215    0
    Yellow255  255    0
    LightYellow255  255  224
    LemonChiffon255  250  205
    LightGoldenrodYellow250  250  210
    PapayaWhip255  239  213
    Moccasin255  228  181
    PeachPuff255  218  185
    PaleGoldenrod238  232  170
    Khaki240  230  140
    DarkKhaki189  183  107
    Purple colors
    Lavender230  230  250
    Thistle216  191  216
    Plum221  160  221
    Violet238  130  238
    Orchid218  112  214
    Fuchsia255    0  255
    Magenta255    0  255
    MediumOrchid186   85  211
    MediumPurple147  112  219
    BlueViolet138   43  226
    DarkViolet148    0  211
    DarkOrchid153   50  204
    DarkMagenta139    0  139
    Purple128    0  128
    Indigo 75    0  130
    DarkSlateBlue 72   61  139
    SlateBlue106   90  205
    MediumSlateBlue123  104  238
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Green colors
    GreenYellow173  255   47
    Chartreuse127  255    0
    LawnGreen124  252    0
    Lime  0  255    0
    LimeGreen 50  205   50
    PaleGreen152  251  152
    LightGreen144  238  144
    MediumSpringGreen  0  250  154
    SpringGreen  0  255  127
    MediumSeaGreen 60  179  113
    SeaGreen 46  139   87
    ForestGreen 34  139   34
    Green  0  128    0
    DarkGreen  0  100    0
    YellowGreen154  205   50
    OliveDrab107  142   35
    Olive128  128    0
    DarkOliveGreen 85  107   47
    MediumAquamarine102  205  170
    DarkSeaGreen143  188  143
    LightSeaGreen 32  178  170
    DarkCyan  0  139  139
    Teal  0  128  128
    Blue/Cyan colors
    Aqua  0  255  255
    Cyan  0  255  255
    LightCyan224  255  255
    PaleTurquoise175  238  238
    Aquamarine127  255  212
    Turquoise 64  224  208
    MediumTurquoise 72  209  204
    DarkTurquoise  0  206  209
    CadetBlue 95  158  160
    SteelBlue 70  130  180
    LightSteelBlue176  196  222
    PowderBlue176  224  230
    LightBlue173  216  230
    SkyBlue135  206  235
    LightSkyBlue135  206  250
    DeepSkyBlue  0  191  255
    DodgerBlue 30  144  255
    CornflowerBlue100  149  237
    RoyalBlue 65  105  225
    Blue  0    0  255
    MediumBlue  0    0  205
    DarkBlue  0    0  139
    Navy  0    0  128
    MidnightBlue 25   25  112
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Brown colors
    Cornsilk255  248  220
    BlanchedAlmond255  235  205
    Bisque255  228  196
    NavajoWhite255  222  173
    Wheat245  222  179
    BurlyWood222  184  135
    Tan210  180  140
    RosyBrown188  143  143
    SandyBrown244  164   96
    Goldenrod218  165   32
    DarkGoldenrod184  134   11
    Peru205  133   63
    Chocolate210  105   30
    SaddleBrown139   69   19
    Sienna160   82   45
    Brown165   42   42
    Maroon128    0    0
    White colors
    White255  255  255
    Snow255  250  250
    Honeydew240  255  240
    MintCream245  255  250
    Azure240  255  255
    AliceBlue240  248  255
    GhostWhite248  248  255
    WhiteSmoke245  245  245
    Seashell255  245  238
    Beige245  245  220
    OldLace253  245  230
    FloralWhite255  250  240
    Ivory255  255  240
    AntiqueWhite250  235  215
    Linen250  240  230
    LavenderBlush255  240  245
    MistyRose255  228  225
    Gray colors
    Gainsboro220  220  220
    LightGrey211  211  211
    Silver192  192  192
    DarkGray169  169  169
    Gray128  128  128
    DimGray105  105  105
    LightSlateGray119  136  153
    SlateGray112  128  144
    DarkSlateGray 47   79   79
    Black  0    0    0
    -
    -
    - - - - - - - - - -
    VTK color Names
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Whites
    antique_white250  235  215
    azure240  255  255
    bisque255  228  196
    blanched_almond255  235  205
    cornsilk255  248  220
    eggshell252  230  201
    floral_white255  250  240
    gainsboro220  220  220
    ghost_white248  248  255
    honeydew240  255  240
    ivory255  255  240
    lavender230  230  250
    lavender_blush255  240  245
    lemon_chiffon255  250  205
    linen250  240  230
    mint_cream245  255  250
    misty_rose255  228  225
    moccasin255  228  181
    navajo_white255  222  173
    old_lace253  245  230
    papaya_whip255  239  213
    peach_puff255  218  185
    seashell255  245  238
    snow255  250  250
    thistle216  191  216
    titanium_white252  255  240
    wheat245  222  179
    white255  255  255
    white_smoke245  245  245
    zinc_white252  247  255
    Greys
    cold_grey128  138  135
    dim_grey105  105  105
    grey192  192  192
    light_grey211  211  211
    slate_grey112  128  144
    slate_grey_dark 47   79   79
    slate_grey_light119  136  153
    warm_grey128  128  105
    Blacks
    black  0    0    0
    ivory_black 41   36   33
    lamp_black 46   71   59
    Reds
    alizarin_crimson227   38   54
    brick156  102   31
    cadmium_red_deep227   23   13
    coral255  127   80
    coral_light240  128  128
    deep_pink255   20  147
    english_red212   61   26
    firebrick178   34   34
    geranium_lake227   18   48
    hot_pink255  105  180
    indian_red176   23   31
    light_salmon255  160  122
    madder_lake_deep227   46   48
    maroon128    0    0
    pink255  192  203
    pink_light255  182  193
    raspberry135   38   87
    red255    0    0
    rose_madder227   54   56
    salmon250  128  114
    tomato255   99   71
    venetian_red212   26   31
    Oranges
    cadmium_orange255   97    3
    cadmium_red_light255    3   13
    carrot237  145   33
    dark_orange255  140    0
    mars_orange150   69   20
    mars_yellow227  112   26
    orange255  165    0
    orange_red255   69    0
    yellow_ochre227  130   23
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Browns
    beige245  245  220
    brown165   42   42
    brown_madder219   41   41
    brown_ochre135   66   31
    burlywood222  184  135
    burnt_sienna138   54   15
    burnt_umber138   51   36
    chocolate210  105   30
    deep_ochre115   61   26
    flesh255  125   64
    flesh_ochre255   87   33
    gold_ochre199  120   38
    greenish_umber255   61   13
    khaki240  230  140
    khaki_dark189  183  107
    light_beige245  245  220
    peru205  133   63
    rosy_brown188  143  143
    raw_sienna199   97   20
    raw_umber115   74   18
    sepia 94   38   18
    sienna160   82   45
    saddle_brown139   69   19
    sandy_brown244  164   96
    tan210  180  140
    van_dyke_brown 94   38    5
    Yellows
    aureoline_yellow255  168   36
    banana227  207   87
    cadmium_lemon255  227    3
    cadmium_yellow255  153   18
    cadmium_yellow_light255  176   15
    gold255  215    0
    goldenrod218  165   32
    goldenrod_dark184  134   11
    goldenrod_light250  250  210
    goldenrod_pale238  232  170
    light_goldenrod238  221  130
    melon227  168  105
    naples_yellow_deep255  168   18
    yellow255  255    0
    yellow_light255  255  224
    Greens
    chartreuse127  255    0
    chrome_oxide_green102  128   20
    cinnabar_green 97  179   41
    cobalt_green 61  145   64
    emerald_green  0  201   87
    forest_green 34  139   34
    green  0  128    0
    green_dark  0  100    0
    green_pale152  251  152
    green_yellow173  255   47
    lawn_green124  252    0
    lime_green 50  205   50
    mint189  252  201
    olive128  128    0
    olive_drab107  142   35
    olive_green_dark 85  107   47
    permanent_green 10  201   43
    sap_green 48  128   20
    sea_green 46  139   87
    sea_green_dark143  188  143
    sea_green_medium 60  179  113
    sea_green_light 32  178  170
    spring_green  0  255  127
    spring_green_medium  0  250  154
    terre_verte 56   94   15
    viridian_light110  255  112
    yellow_green154  205   50
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    HTML nameDecimal code
    -  R    G    B
    Cyans
    aquamarine127  255  212
    aquamarine_medium102  205  170
    cyan  0  255  255
    cyan_white224  255  255
    turquoise 64  224  208
    turquoise_dark  0  206  209
    turquoise_medium 72  209  204
    turquoise_pale175  238  238
    Blues
    alice_blue240  248  255
    blue  0    0  255
    blue_light173  216  230
    blue_medium  0    0  205
    cadet 95  158  160
    cobalt 61   89  171
    cornflower100  149  237
    cerulean  5  184  204
    dodger_blue 30  144  255
    indigo 75    0  130
    manganese_blue  3  168  158
    midnight_blue 25   25  112
    navy  0    0  128
    peacock 51  161  201
    powder_blue176  224  230
    royal_blue 65  105  225
    slate_blue106   90  205
    slate_blue_dark 72   61  139
    slate_blue_light132  112  255
    slate_blue_medium123  104  238
    sky_blue135  206  235
    sky_blue_deep  0  191  255
    sky_blue_light135  206  250
    steel_blue 70  130  180
    steel_blue_light176  196  222
    turquoise_blue  0  199  140
    ultramarine 18   10  143
    Magentas
    blue_violet138   43  226
    cobalt_violet_deep145   33  158
    magenta255    0  255
    orchid218  112  214
    orchid_dark153   50  204
    orchid_medium186   85  211
    permanent_red_violet219   38   69
    plum221  160  221
    purple128    0  128
    purple_medium147  112  219
    ultramarine_violet 92   36  110
    violet238  130  238
    violet_dark148    0  211
    violet_red208   32  144
    violet_red_medium199   21  133
    violet_red_pale219  112  147
    -
    -
    - - - - - - - - -
    Synonyms
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SynonymsDecimal code
    -  R    G    B
    AliceBlue, alice_blue240  248  255
    AntiqueWhite, antique_white250  235  215
    Aqua, Cyan  0  255  255
    MediumAquamarine, aquamarine_medium102  205  170
    Beige, light_beige245  245  220
    BlanchedAlmond, blanched_almond255  235  205
    LightBlue, blue_light173  216  230
    MediumBlue, blue_medium  0    0  205
    BlueViolet, blue_violet138   43  226
    CadetBlue, cadet 95  158  160
    LightCoral, coral_light240  128  128
    CornflowerBlue, cornflower100  149  237
    LightCyan, cyan_white224  255  255
    DarkOrange, dark_orange255  140    0
    DarkGoldenrod, goldenrod_dark184  134   11
    DarkGreen, green_dark  0  100    0
    DarkKhaki, khaki_dark189  183  107
    DarkOliveGreen, olive_green_dark 85  107   47
    DarkOrchid, orchid_dark153   50  204
    DarkSeaGreen, sea_green_dark143  188  143
    DarkSlateBlue, slate_blue_dark 72   61  139
    DarkSlateGray, slate_grey_dark 47   79   79
    DarkTurquoise, turquoise_dark  0  206  209
    DarkViolet, violet_dark148    0  211
    DeepPink, deep_pink255   20  147
    DeepSkyBlue, sky_blue_deep  0  191  255
    DimGray, dim_grey105  105  105
    DodgerBlue, dodger_blue 30  144  255
    FloralWhite, floral_white255  250  240
    ForestGreen, forest_green 34  139   34
    Fuchsia, Magenta255    0  255
    GhostWhite, ghost_white248  248  255
    LightGoldenrodYellow, goldenrod_light250  250  210
    PaleGoldenrod, goldenrod_pale238  232  170
    PaleGreen, green_pale152  251  152
    GreenYellow, green_yellow173  255   47
    Silver, grey192  192  192
    HotPink, hot_pink255  105  180
    LavenderBlush, lavender_blush255  240  245
    LawnGreen, lawn_green124  252    0
    LemonChiffon, lemon_chiffon255  250  205
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SynonymsDecimal code
    -  R    G    B
    LightGrey, light_grey211  211  211
    LightSalmon, light_salmon255  160  122
    LightPink, pink_light255  182  193
    LightSeaGreen, sea_green_light 32  178  170
    LightSkyBlue, sky_blue_light135  206  250
    LightSlateGray, slate_grey_light119  136  153
    LightSteelBlue, steel_blue_light176  196  222
    LightYellow, yellow_light255  255  224
    LimeGreen, lime_green 50  205   50
    MediumOrchid, orchid_medium186   85  211
    MediumPurple, purple_medium147  112  219
    MediumSeaGreen, sea_green_medium 60  179  113
    MediumSlateBlue, slate_blue_medium123  104  238
    MediumSpringGreen, spring_green_medium  0  250  154
    MediumTurquoise, turquoise_medium 72  209  204
    MediumVioletRed, violet_red_medium199   21  133
    MidnightBlue, midnight_blue 25   25  112
    MintCream, mint_cream245  255  250
    MistyRose, misty_rose255  228  225
    NavajoWhite, navajo_white255  222  173
    OldLace, old_lace253  245  230
    OliveDrab, olive_drab107  142   35
    OrangeRed, orange_red255   69    0
    PaleTurquoise, turquoise_pale175  238  238
    PaleVioletRed, violet_red_pale219  112  147
    PapayaWhip, papaya_whip255  239  213
    PeachPuff, peach_puff255  218  185
    PowderBlue, powder_blue176  224  230
    RosyBrown, rosy_brown188  143  143
    RoyalBlue, royal_blue 65  105  225
    SaddleBrown, saddle_brown139   69   19
    SandyBrown, sandy_brown244  164   96
    SeaGreen, sea_green 46  139   87
    SkyBlue, sky_blue135  206  235
    SlateBlue, slate_blue106   90  205
    SlateGray, slate_grey112  128  144
    SpringGreen, spring_green  0  255  127
    SteelBlue, steel_blue 70  130  180
    WhiteSmoke, white_smoke245  245  245
    YellowGreen, yellow_green154  205   50
    -
    - diff --git a/data/examples/Visualization/VectorText.py b/data/examples/Visualization/VectorText.py deleted file mode 100755 index b955a33..0000000 --- a/data/examples/Visualization/VectorText.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - colors = vtkNamedColors() - - textSource = vtkVectorText() - textSource.SetText('Hello') - textSource.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(textSource.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('DarkSlateGray')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('VectorText') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Bisque')) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Visualization/WindowTitle.md b/data/examples/Visualization/WindowTitle.md deleted file mode 100644 index 71de0e3..0000000 --- a/data/examples/Visualization/WindowTitle.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example demonstrates how to change the title of a render window. - -* Contributed by Bryan P. Conrad diff --git a/data/examples/Visualization/WindowTitle.py b/data/examples/Visualization/WindowTitle.py deleted file mode 100755 index 52b36fa..0000000 --- a/data/examples/Visualization/WindowTitle.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(5) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphereSource.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Setup a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - # renderWindow.SetWindowName('Test') - - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actor to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - # Render and interact - renderWindow.Render() - # *** SetWindowName after renderWindow.Render() is called *** - renderWindow.SetWindowName('WindowTitle') - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/AnatomicalOrientation.md b/data/examples/VisualizationAlgorithms/AnatomicalOrientation.md deleted file mode 100644 index 286ef31..0000000 --- a/data/examples/VisualizationAlgorithms/AnatomicalOrientation.md +++ /dev/null @@ -1,32 +0,0 @@ -### Description - -This depicts a human figure transected by the three commonly used anatomical planes: - -- **Sagittal plane** – is perpendicular to the ground divides the body into a left section and a right section. -- **Coronal plane** – is perpendicular to the ground and divides the body into a front (anterior) section and back (posterior) section. -- **Transverse plane** – or *axial plane* is parallel to the ground divides the body into an upper (superior) section and a bottom (inferior) section. - -Four annotated cube actors are also provided demonstrating different coordinate systems. -The annotations on the faces of the cube actors are: - -- **Sagittal plane** - - **L** - left. - - **R** - right. -- **Coronal plane** - - **A** - anterior. - - **P** - posterior. -- **Transverse plane** - - **S** - superior. - - **I** - inferior. - -The annotated cube actors demonstrate the various coordinate systems: -- The anatomical coordinate system forming a 3D basis is defined along the anatomical axes of anterior-posterior, inferior-superior, and left-right. These are the positive directions. In a Cartesian system this is RPS (Right, Posterior, Superior). The top-left annotated cube actor shows this basis, this is a left-handed system. -- RAS (Right, Anterior, Superior), left-right, posterior-anterior, and inferior-superior. This is the usual right-handed system used by VTK and Slicer. -The bottom left annotated cube actor shows this basis. -- LPS (Left, Posterior, Superior), right-left, anterior-posterior, and inferior-superior. This is used in DICOM images and by the ITK toolkit. -The bottom right annotated cube actor shows this basis. -- The upper right cube actor has no axes and simply shows the planes. - -RPS is a left-handed system whilst RAS and LPS are right-handed. - -Note that the text for the planes is carefully placed to avoid obstructing the figure and it also sits slightly above the plane. diff --git a/data/examples/VisualizationAlgorithms/AnatomicalOrientation.py b/data/examples/VisualizationAlgorithms/AnatomicalOrientation.py deleted file mode 100755 index 8521546..0000000 --- a/data/examples/VisualizationAlgorithms/AnatomicalOrientation.py +++ /dev/null @@ -1,379 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -The human data file is taken from: - https://github.com/Slicer/Slicer/blob/master/Base/Logic/Resources/OrientationMarkers/Human.vtp - Thanks to the Slicer people for providing this. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import ( - vtkAnnotatedCubeActor, - vtkAxesActor -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkPropAssembly, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create a rendering window, renderer and interactor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetSize(780, 780) - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Make an annotated cube actor with axes and then add it into an orientation marker widget. - # Three of these need to be made. - - # Right Posterior Superior - xyzLabels = ['X', 'Y', 'Z'] - scale = [1.5, -1.5, 1.5] - axes = MakeCubeActor(scale, xyzLabels, colors) - om = vtkOrientationMarkerWidget() - om.SetOrientationMarker(axes) - # Position upper left in the viewport. - om.SetViewport(0.0, 0.8, 0.2, 1.0) - om.SetInteractor(iren) - om.EnabledOn() - om.InteractiveOn() - - # Right, Anterior, Superior. - scale = [1.5, 1.5, 1.5] - axes1 = MakeCubeActor(scale, xyzLabels, colors) - om1 = vtkOrientationMarkerWidget() - om1.SetOrientationMarker(axes1) - # Position lower left in the viewport. - om1.SetViewport(0, 0, 0.2, 0.2) - om1.SetInteractor(iren) - om1.EnabledOn() - om1.InteractiveOn() - - # Left, Posterior, Superior. - scale = (-1.5, -1.5, 1.5) - axes2 = MakeCubeActor(scale, xyzLabels, colors) - om2 = vtkOrientationMarkerWidget() - om2.SetOrientationMarker(axes2) - # Position lower right in the viewport. - om2.SetViewport(0.8, 0, 1.0, 0.2) - om2.SetInteractor(iren) - om2.EnabledOn() - om2.InteractiveOn() - - # Finally create an annotated cube actor adding it into an orientation marker widget. - axes3 = MakeAnnotatedCubeActor(colors) - om3 = vtkOrientationMarkerWidget() - om3.SetOrientationMarker(axes3) - # Position upper right in the viewport. - om3.SetViewport(0.8, 0.8, 1.0, 1.0) - om3.SetInteractor(iren) - om3.EnabledOn() - om3.InteractiveOn() - - # Read in the model. - reader = vtkXMLPolyDataReader() - reader.SetFileName(fileName) - reader.Update() - - humanMapper = vtkPolyDataMapper() - humanMapper.SetInputConnection(reader.GetOutputPort()) - humanMapper.SetScalarModeToUsePointFieldData() - humanMapper.SelectColorArray('Color') - humanMapper.SetColorModeToDirectScalars() - - humanActor = vtkActor() - humanActor.SetMapper(humanMapper) - bounds = humanActor.GetBounds() - # Scale the actor - humanActor.SetScale(1.0 / max(bounds)) - ren.AddActor(humanActor) - - # Make the planes. - actors = MakePlanesActors(colors) - for actor in actors: - ren.AddViewProp(actor) - # Label them. - textActors = AddTextToPlanes() - for actor in textActors: - ren.AddViewProp(actor) - - # Interact - ren.SetBackground2(colors.GetColor3d('OldLace')) - ren.SetBackground(colors.GetColor3d('MistyRose')) - ren.GradientBackgroundOn() - ren.ResetCamera() - ren.GetActiveCamera().Zoom(1.6) - ren.GetActiveCamera().SetPosition(-2.3, 4.1, 4.2) - # ren.GetActiveCamera().SetPosition(-3.4, 5.5, 0.0) - ren.GetActiveCamera().SetViewUp(0.0, 0.0, 1.0) - ren.ResetCameraClippingRange() - renWin.Render() - # Call SetWindowName after renWin.Render() is called. - renWin.SetWindowName('AnatomicalOrientation') - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Show a labelled set of anatomical planes transecting a human figure.' - epilogue = ''' - Show a labelled set of anatomical planes transecting a human figure. - Annotated cube actors and axes for the various coordinate systems are also shown. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Human.vtp.') - args = parser.parse_args() - return args.filename - - -def MakeAxesActor(scale, xyzLabels): - """ - :param scale: Sets the scale and direction of the axes. - :param xyzLabels: Labels for the axes. - :return: The axes actor. - """ - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyzLabels[0]) - axes.SetYAxisLabelText(xyzLabels[1]) - axes.SetZAxisLabelText(xyzLabels[2]) - axes.SetCylinderRadius(0.5 * axes.GetCylinderRadius()) - axes.SetConeRadius(1.025 * axes.GetConeRadius()) - axes.SetSphereRadius(1.5 * axes.GetSphereRadius()) - tprop = axes.GetXAxisCaptionActor2D().GetCaptionTextProperty() - tprop.ItalicOn() - tprop.ShadowOn() - tprop.SetFontFamilyToTimes() - # Use the same text properties on the other two axes. - axes.GetYAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - axes.GetZAxisCaptionActor2D().GetCaptionTextProperty().ShallowCopy(tprop) - return axes - - -def MakeAnnotatedCubeActor(colors): - """ - :param colors: Used to determine the cube color. - :return: The annotated cube actor. - """ - # A cube with labeled faces. - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText('R') # Right - cube.SetXMinusFaceText('L') # Left - cube.SetYPlusFaceText('A') # Anterior - cube.SetYMinusFaceText('P') # Posterior - cube.SetZPlusFaceText('S') # Superior/Cranial - cube.SetZMinusFaceText('I') # Inferior/Caudal - cube.SetFaceTextScale(0.5) - cube.GetCubeProperty().SetColor(colors.GetColor3d('Gainsboro')) - - cube.GetTextEdgesProperty().SetColor(colors.GetColor3d('LightSlateGray')) - - # Change the vector text colors. - cube.GetXPlusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetXMinusFaceProperty().SetColor(colors.GetColor3d('Tomato')) - cube.GetYPlusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetYMinusFaceProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) - cube.GetZPlusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - cube.GetZMinusFaceProperty().SetColor(colors.GetColor3d('SeaGreen')) - return cube - - -def MakeCubeActor(scale, xyzLabels, colors): - """ - :param scale: Sets the scale and direction of the axes. - :param xyzLabels: Labels for the axes. - :param colors: Used to set the colors of the cube faces. - :return: The combined axes and annotated cube prop. - """ - # We are combining a vtkAxesActor and a vtkAnnotatedCubeActor - # into a vtkPropAssembly - cube = MakeAnnotatedCubeActor(colors) - axes = MakeAxesActor(scale, xyzLabels) - - # Combine orientation markers into one with an assembly. - assembly = vtkPropAssembly() - assembly.AddPart(axes) - assembly.AddPart(cube) - return assembly - - -def MakePlane(resolution, origin, point1, point2, wxyz, translate): - plane = vtkPlaneSource() - plane.SetResolution(*resolution) - plane.SetOrigin(origin) - plane.SetPoint1(point1) - plane.SetPoint2(point2) - trnf = vtkTransform() - trnf.RotateWXYZ(*wxyz) - trnf.Translate(translate) - tpdPlane = vtkTransformPolyDataFilter() - tpdPlane.SetTransform(trnf) - tpdPlane.SetInputConnection(plane.GetOutputPort()) - return tpdPlane - - -def MakePlanesActors(colors): - """ - Make the traverse, coronal and saggital planes. - :param colors: Used to set the color of the planes. - :return: The planes actors. - """ - planes = list() - mappers = list() - actors = list() - - # Parameters for a plane lying in the x-y plane. - resolution = [10, 10] - origin = [0.0, 0.0, 0.0] - point1 = [1, 0, 0] - point2 = [0, 1, 0] - - planes.append(MakePlane(resolution, origin, point1, point2, [0, 0, 0, 0], [-0.5, -0.5, 0])) # x-y plane - planes.append(MakePlane(resolution, origin, point1, point2, [-90, 1, 0, 0], [-0.5, -0.5, 0.0])) # x-z plane - planes.append(MakePlane(resolution, origin, point1, point2, [-90, 0, 1, 0], [-0.5, -0.5, 0.0])) # y-z plane - for plane in planes: - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(plane.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - mappers.append(mapper) - actors.append(actor) - actors[0].GetProperty().SetColor(colors.GetColor3d('SeaGreen')) # Transverse plane - actors[1].GetProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) # Coronal plane - actors[2].GetProperty().SetColor(colors.GetColor3d('Tomato')) # Saggital plane - return actors - - -def AddTextToPlanes(): - """ - Generate text to place on the planes. - Careful placement is needed here. - :return: The text actors. - """ - textActors = list() - scale = [0.04, 0.04, 0.04] - - text1 = vtkVectorText() - text1.SetText('Transverse\nPlane\n\nSuperior\nCranial') - trnf1 = vtkTransform() - trnf1.RotateZ(-90) - tpdPlane1 = vtkTransformPolyDataFilter() - tpdPlane1.SetTransform(trnf1) - tpdPlane1.SetInputConnection(text1.GetOutputPort()) - textMapper1 = vtkPolyDataMapper() - textMapper1.SetInputConnection(tpdPlane1.GetOutputPort()) - textActor1 = vtkActor() - textActor1.SetMapper(textMapper1) - textActor1.SetScale(scale) - textActor1.AddPosition(0.4, 0.49, 0.01) - textActors.append(textActor1) - - text2 = vtkVectorText() - text2.SetText('Transverse\nPlane\n\nInferior\n(Caudal)') - trnf2 = vtkTransform() - trnf2.RotateZ(270) - trnf2.RotateWXYZ(*[180, 0, 1, 0]) - tpdPlane2 = vtkTransformPolyDataFilter() - tpdPlane2.SetTransform(trnf2) - tpdPlane2.SetInputConnection(text2.GetOutputPort()) - textMapper2 = vtkPolyDataMapper() - textMapper2.SetInputConnection(tpdPlane2.GetOutputPort()) - textActor2 = vtkActor() - textActor2.SetMapper(textMapper2) - textActor2.SetScale(scale) - textActor2.AddPosition(0.4, -0.49, -0.01) - textActors.append(textActor2) - - text3 = vtkVectorText() - text3.SetText('Sagittal\nPlane\n\nLeft') - trnf3 = vtkTransform() - trnf3.RotateX(90) - trnf3.RotateWXYZ(*[-90, 0, 1, 0]) - tpdPlane3 = vtkTransformPolyDataFilter() - tpdPlane3.SetTransform(trnf3) - tpdPlane3.SetInputConnection(text3.GetOutputPort()) - textMapper3 = vtkPolyDataMapper() - textMapper3.SetInputConnection(tpdPlane3.GetOutputPort()) - textActor3 = vtkActor() - textActor3.SetMapper(textMapper3) - textActor3.SetScale(scale) - textActor3.AddPosition(-0.01, 0.49, 0.4) - textActors.append(textActor3) - - text4 = vtkVectorText() - text4.SetText('Sagittal\nPlane\n\nRight') - trnf4 = vtkTransform() - trnf4.RotateX(90) - trnf4.RotateWXYZ(*[-270, 0, 1, 0]) - tpdPlane4 = vtkTransformPolyDataFilter() - tpdPlane4.SetTransform(trnf4) - tpdPlane4.SetInputConnection(text4.GetOutputPort()) - textMapper4 = vtkPolyDataMapper() - textMapper4.SetInputConnection(tpdPlane4.GetOutputPort()) - textActor4 = vtkActor() - textActor4.SetMapper(textMapper4) - textActor4.SetScale(scale) - textActor4.AddPosition(0.01, -0.49, 0.4) - textActors.append(textActor4) - - text5 = vtkVectorText() - text5.SetText('Coronal\nPlane\n\nAnterior') - trnf5 = vtkTransform() - trnf5.RotateY(-180) - trnf5.RotateWXYZ(*[-90, 1, 0, 0]) - tpdPlane5 = vtkTransformPolyDataFilter() - tpdPlane5.SetTransform(trnf5) - tpdPlane5.SetInputConnection(text5.GetOutputPort()) - textMapper5 = vtkPolyDataMapper() - textMapper5.SetInputConnection(tpdPlane5.GetOutputPort()) - textActor5 = vtkActor() - textActor5.SetMapper(textMapper5) - textActor5.SetScale(scale) - textActor5.AddPosition(0.49, 0.01, 0.20) - textActors.append(textActor5) - - text6 = vtkVectorText() - text6.SetText('Coronal\nPlane\n\nPosterior') - trnf6 = vtkTransform() - trnf6.RotateWXYZ(*[90, 1, 0, 0]) - tpdPlane6 = vtkTransformPolyDataFilter() - tpdPlane6.SetTransform(trnf6) - tpdPlane6.SetInputConnection(text6.GetOutputPort()) - textMapper6 = vtkPolyDataMapper() - textMapper6.SetInputConnection(tpdPlane6.GetOutputPort()) - textActor6 = vtkActor() - textActor6.SetMapper(textMapper6) - textActor6.SetScale(scale) - textActor6.AddPosition(-0.49, -0.01, 0.3) - textActors.append(textActor6) - return textActors - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/BluntStreamlines.md b/data/examples/VisualizationAlgorithms/BluntStreamlines.md deleted file mode 100644 index 53cf405..0000000 --- a/data/examples/VisualizationAlgorithms/BluntStreamlines.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example shows airflow around a blunt fin. This example consists of a wall with half a rounded fin projecting into the fluid flow. (Using arguments of symmetry, only half of the domain was modeled.) Twenty-five streamlines are released upstream of the fin. The boundary layer effects near the junction of the fin and wall are clearly evident from the streamlines. In this area, flow recirculation is apparent, as well as the reduced flow speed. - -!!! info - See [Figure 6-19](../../../VTKBook/06Chapter6/#Figure%206-19) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/BluntStreamlines.py b/data/examples/VisualizationAlgorithms/BluntStreamlines.py deleted file mode 100755 index 9144614..0000000 --- a/data/examples/VisualizationAlgorithms/BluntStreamlines.py +++ /dev/null @@ -1,155 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkLineSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFilename, qFilename = get_program_parameters() - - colors = vtkNamedColors() - - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - scalarRange = [0.0] * 2 - c = [0.0] * 3 - maxTime = 0.0 - - reader = vtkMultiBlockPLOT3DReader() - reader.SetXYZFileName(xyzFilename) - reader.SetQFileName(qFilename) - reader.Update() # Force a read to occur. - - pd = reader.GetOutput().GetBlock(0) - pd.GetCenter(c) - if pd.GetPointData().GetScalars(): - pd.GetPointData().GetScalars().GetRange(scalarRange) - if pd.GetPointData().GetVectors(): - maxVelocity = pd.GetPointData().GetVectors().GetMaxNorm() - maxTime = 20.0 * pd.GetLength() / maxVelocity - - outlineF = vtkStructuredGridOutlineFilter() - outlineF.SetInputData(pd) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outlineF.GetOutputPort()) - - outline = vtkActor() - outline.SetMapper(outlineMapper) - outline.GetProperty().SetColor(colors.GetColor3d('Moccasin')) - outline.GetProperty().SetLineWidth(2.0) - - # - # Some geometry for context - # - wall = vtkStructuredGridGeometryFilter() - wall.SetInputData(pd) - wall.SetExtent(0, 100, 0, 100, 0, 0) - - wallMap = vtkPolyDataMapper() - wallMap.SetInputConnection(wall.GetOutputPort()) - wallMap.ScalarVisibilityOff() - - wallActor = vtkActor() - wallActor.SetMapper(wallMap) - wallActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - fin = vtkStructuredGridGeometryFilter() - fin.SetInputData(pd) - fin.SetExtent(0, 100, 0, 0, 0, 100) - - finMap = vtkPolyDataMapper() - finMap.SetInputConnection(fin.GetOutputPort()) - finMap.ScalarVisibilityOff() - - finActor = vtkActor() - finActor.SetMapper(finMap) - finActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - # - # regular streamlines - # - line1 = vtkLineSource() - line1.SetResolution(25) - line1.SetPoint1(-6.36, 0.25, 0.06) - line1.SetPoint2(-6.36, 0.25, 5.37) - - rakeMapper = vtkPolyDataMapper() - rakeMapper.SetInputConnection(line1.GetOutputPort()) - - rake1 = vtkActor() - rake1.SetMapper(rakeMapper) - rake1.GetProperty().SetColor(colors.GetColor3d('Black')) - rake1.GetProperty().SetLineWidth(5) - - streamers = vtkStreamTracer() - # streamers.DebugOn() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(line1.GetOutputPort()) - streamers.SetMaximumPropagation(maxTime) - streamers.SetInitialIntegrationStep(0.2) - streamers.SetMinimumIntegrationStep(0.01) - streamers.SetIntegratorType(2) - streamers.Update() - - streamersMapper = vtkPolyDataMapper() - streamersMapper.SetInputConnection(streamers.GetOutputPort()) - streamersMapper.SetScalarRange(scalarRange) - - lines = vtkActor() - lines.SetMapper(streamersMapper) - - aren.AddActor(outline) - aren.AddActor(wallActor) - aren.AddActor(finActor) - aren.AddActor(rake1) - aren.AddActor(lines) - aren.SetBackground(colors.GetColor3d('Gray')) - - aren.ResetCamera() - aren.GetActiveCamera().Elevation(30.0) - aren.GetActiveCamera().Azimuth(30.0) - aren.GetActiveCamera().Dolly(1.2) - aren.ResetCameraClippingRange() - - renWin.SetSize(640, 480) - renWin.SetWindowName('BluntStreamlines') - renWin.Render() - - # Interact with the data. - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'This example shows airflow around a blunt fin.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='bluntfinxyz.bin.') - parser.add_argument('filename2', help='bluntfinq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CarotidFlow.md b/data/examples/VisualizationAlgorithms/CarotidFlow.md deleted file mode 100644 index 7ac5c0d..0000000 --- a/data/examples/VisualizationAlgorithms/CarotidFlow.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -This example generates streamtubes of blood velocity. an isosurface of speed provides context. The starting positions for the streamtubes were determined by experimenting with the data. Because of the way the data was measured and the resolution of the velocity field, many streamers travel outside the artery. This is because the boundary layer of the blood flow is not captured due to limitations in data resolution. Consequently, as the blood flows around curves, there is a component of the velocity field that directs the streamtube outside the artery. As a result it is hard to find starting positions for the streamtubes that yield interesting results. The examples uses the source object vtkPointSource in combination with vtkThresholdPoints to work around this problem. vtkPointSource generates random points centered around a sphere of a specified radius. We need only find an approximate position for the starting points of the streamtubes and then generate a cloud of random seed points. vtkThresholdPoints is used to cull points that may be generated outside the regions of high flow velocity. - -!!! cite - See [*3D Phase Contrast MRI of Cerebral Blood Flow and Surface Anatomy*](http://marchingcubes.org/images/c/c6/3DPhaseContrastMRIofCerebralBloodFlowandSurfaceAnatomy.pdf) for background. - -!!! info - See [Figure 6-44](../../../VTKBook/06Chapter6/#Figure%206-44) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/CarotidFlow.py b/data/examples/VisualizationAlgorithms/CarotidFlow.py deleted file mode 100755 index 98c1325..0000000 --- a/data/examples/VisualizationAlgorithms/CarotidFlow.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkThresholdPoints, - vtkTubeFilter -) -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - psource = vtkPointSource() - psource.SetNumberOfPoints(25) - psource.SetCenter(133.1, 116.3, 5.0) - psource.SetRadius(2.0) - - threshold = vtkThresholdPoints() - threshold.SetInputConnection(reader.GetOutputPort()) - threshold.ThresholdByUpper(275) - - streamers = vtkStreamTracer() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(psource.GetOutputPort()) - # streamers.SetMaximumPropagationUnitToTimeUnit() - streamers.SetMaximumPropagation(100.0) - # streamers.SetInitialIntegrationStepUnitToCellLengthUnit() - streamers.SetInitialIntegrationStep(0.2) - streamers.SetTerminalSpeed(.01) - streamers.Update() - scalarRange = [0] * 2 - scalarRange[0] = streamers.GetOutput().GetPointData().GetScalars().GetRange()[0] - scalarRange[1] = streamers.GetOutput().GetPointData().GetScalars().GetRange()[1] - print("range: ", scalarRange[0], ", ", scalarRange[1]) - - tubes = vtkTubeFilter() - tubes.SetInputConnection(streamers.GetOutputPort()) - tubes.SetRadius(0.3) - tubes.SetNumberOfSides(6) - tubes.SetVaryRadius(0) - - lut = vtkLookupTable() - lut.SetHueRange(.667, 0.0) - lut.Build() - - streamerMapper = vtkPolyDataMapper() - streamerMapper.SetInputConnection(tubes.GetOutputPort()) - streamerMapper.SetScalarRange(scalarRange[0], scalarRange[1]) - streamerMapper.SetLookupTable(lut) - - streamerActor = vtkActor() - streamerActor.SetMapper(streamerMapper) - - # Speed contours. - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 175) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetRepresentationToWireframe() - isoActor.GetProperty().SetOpacity(0.25) - - # Outline - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(streamerActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d("Wheat")) - renWin.SetSize(640, 480) - renWin.SetWindowName('CarotidFlow') - - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) - ren1.SetActiveCamera(cam1) - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Visualizing blood flow in human carotid arteries.' - epilogue = ''' - Streamtubes of blood velocity are generated. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='carotid.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CarotidFlowGlyphs.py b/data/examples/VisualizationAlgorithms/CarotidFlowGlyphs.py deleted file mode 100755 index ff8db21..0000000 --- a/data/examples/VisualizationAlgorithms/CarotidFlowGlyphs.py +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkGlyph3D, - vtkMaskPoints, - vtkThresholdPoints -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - threshold = vtkThresholdPoints() - threshold.SetInputConnection(reader.GetOutputPort()) - threshold.ThresholdByUpper(200) - - mask = vtkMaskPoints() - mask.SetInputConnection(threshold.GetOutputPort()) - mask.SetOnRatio(5) - - cone = vtkConeSource() - cone.SetResolution(11) - cone.SetHeight(1) - cone.SetRadius(0.25) - - cones = vtkGlyph3D() - cones.SetInputConnection(mask.GetOutputPort()) - cones.SetSourceConnection(cone.GetOutputPort()) - cones.SetScaleFactor(0.4) - cones.SetScaleModeToScaleByVector() - - lut = vtkLookupTable() - lut.SetHueRange(.667, 0.0) - lut.Build() - - scalarRange = [0] * 2 - cones.Update() - scalarRange[0] = cones.GetOutput().GetPointData().GetScalars().GetRange()[0] - scalarRange[1] = cones.GetOutput().GetPointData().GetScalars().GetRange()[1] - print("range: ", scalarRange[0], ", ", scalarRange[1]) - - vectorMapper = vtkPolyDataMapper() - vectorMapper.SetInputConnection(cones.GetOutputPort()) - vectorMapper.SetScalarRange(scalarRange[0], scalarRange[1]) - vectorMapper.SetLookupTable(lut) - - vectorActor = vtkActor() - vectorActor.SetMapper(vectorMapper) - - # Speed contours. - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 175) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetRepresentationToWireframe() - isoActor.GetProperty().SetOpacity(0.25) - - # Outline - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(vectorActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d("Wheat")) - renWin.SetSize(640, 480) - renWin.SetWindowName('CarotidFlowGlyphs') - - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) - ren1.SetActiveCamera(cam1) - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Visualizing blood flow in human carotid arteries.' - epilogue = ''' - Cone glyphs indicate flow direction and magnitude. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='carotid.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ClipSphereCylinder.md b/data/examples/VisualizationAlgorithms/ClipSphereCylinder.md deleted file mode 100644 index 4984a1e..0000000 --- a/data/examples/VisualizationAlgorithms/ClipSphereCylinder.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -Clipping is implemented in vtkClipPolyData . Each polygonal data primitive implements the operation in its Clip() method using case tables. vtkClipPolyData has methods to control whether an implicit function provides the scalar data or whether the dataset’s scalar data will be used. Compute*ScalarDataOn()* uses the implicit function and *ComputeScalarDataOff()* uses the dataset’s scalar data. Two output polygonal datasets are produced. These are accessed with *GetOutput()* and *GetClippedOutput()* methods. *GetOutput()* returns the polygonal data that is “inside” the clipping region while *GetClippedOutput()* returns polygonal data that is “outside” the region. (Note that *GenerateClippedOutputOn()* must be enabled if you are to get the clipped output.) The meaning of inside and outside can be reversed using the *InsideOutOn()*. - -This example shows a plane of quadrilaterals clipped with a boolean implicit function. - -!!! info - See [Figure 9-48](../../../VTKBook/09Chapter9/#Figure%209-48) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/ClipSphereCylinder.py b/data/examples/VisualizationAlgorithms/ClipSphereCylinder.py deleted file mode 100755 index 0eefcaf..0000000 --- a/data/examples/VisualizationAlgorithms/ClipSphereCylinder.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkCylinder, - vtkImplicitBoolean, - vtkSphere -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkClipPolyData -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Demonstrate the use of clipping on polygonal data - # - - # create pipeline - # - plane = vtkPlaneSource() - plane.SetXResolution(25) - plane.SetYResolution(25) - plane.SetOrigin(-1, -1, 0) - plane.SetPoint1(1, -1, 0) - plane.SetPoint2(-1, 1, 0) - - transformSphere = vtkTransform() - transformSphere.Identity() - transformSphere.Translate(0.4, -0.4, 0) - transformSphere.Inverse() - - sphere = vtkSphere() - sphere.SetTransform(transformSphere) - sphere.SetRadius(.5) - - transformCylinder = vtkTransform() - transformCylinder.Identity() - transformCylinder.Translate(-0.4, 0.4, 0) - transformCylinder.RotateZ(30) - transformCylinder.RotateY(60) - transformCylinder.RotateX(90) - transformCylinder.Inverse() - - cylinder = vtkCylinder() - cylinder.SetTransform(transformCylinder) - cylinder.SetRadius(.3) - - boolean = vtkImplicitBoolean() - boolean.AddFunction(cylinder) - boolean.AddFunction(sphere) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(plane.GetOutputPort()) - clipper.SetClipFunction(boolean) - clipper.GenerateClippedOutputOn() - clipper.GenerateClipScalarsOn() - clipper.SetValue(0) - - clipMapper = vtkPolyDataMapper() - clipMapper.SetInputConnection(clipper.GetOutputPort()) - clipMapper.ScalarVisibilityOff() - - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(colors.GetColor3d('MidnightBlue')) - clipActor.GetProperty().SetRepresentationToWireframe() - - clipInsideMapper = vtkPolyDataMapper() - clipInsideMapper.SetInputData(clipper.GetClippedOutput()) - clipInsideMapper.ScalarVisibilityOff() - - clipInsideActor = vtkActor() - clipInsideActor.SetMapper(clipInsideMapper) - clipInsideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('LightBlue')) - - # Create graphics stuff - # - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetWindowName('ClipSphereCylinder') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren1.AddActor(clipActor) - - ren1.AddActor(clipInsideActor) - ren1.SetBackground(colors.GetColor3d('Wheat')) - ren1.ResetCamera() - ren1.GetActiveCamera().Dolly(1.4) - ren1.ResetCameraClippingRange() - - renWin.SetSize(640, 480) - - # render the image - # - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CombustorIsosurface.py b/data/examples/VisualizationAlgorithms/CombustorIsosurface.py deleted file mode 100755 index a75d395..0000000 --- a/data/examples/VisualizationAlgorithms/CombustorIsosurface.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkPolyDataNormals, - vtkStructuredGridOutlineFilter -) -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFile, qFile = get_program_parameters() - - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - iso = vtkContourFilter() - iso.SetInputData(pl3d.GetOutput().GetBlock(0)) - iso.SetValue(0, 0.38) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(iso.GetOutputPort()) - normals.SetFeatureAngle(45) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(normals.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('WhiteSmoke')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputConnection(pl3d.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d('DarkSlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('CombustorIsosurface') - - ren1.GetActiveCamera().SetFocalPoint(9.71821, 0.458166, 29.3999) - ren1.GetActiveCamera().SetPosition(2.7439, -37.3196, 38.7167) - ren1.GetActiveCamera().SetViewUp(-0.16123, 0.264271, 0.950876) - ren1.GetActiveCamera().Zoom(1.3) - ren1.ResetCameraClippingRange() - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Marching cubes surface of flow density.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ContourQuadric.py b/data/examples/VisualizationAlgorithms/ContourQuadric.py deleted file mode 100755 index 9bf0681..0000000 --- a/data/examples/VisualizationAlgorithms/ContourQuadric.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkQuadric -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - aren = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # Create surfaces F(x,y,z) = constant - # - # Sample quadric function - quadric = vtkQuadric() - quadric.SetCoefficients(.5, 1, .2, 0, .1, 0, 0, .2, 0, 0) - sample = vtkSampleFunction() - sample.SetSampleDimensions(50, 50, 50) - sample.SetImplicitFunction(quadric) - - contour = vtkContourFilter() - contour.SetInputConnection(sample.GetOutputPort()) - contour.GenerateValues(5, 0, 1.2) - - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) - contourMapper.SetScalarRange(0, 1.2) - - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Create outline - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Brown")) - outlineActor.GetProperty().SetLineWidth(3.0) - - # - # Rendering stuff - # - aren.SetBackground(colors.GetColor3d("SlateGray")) - aren.AddActor(contourActor) - aren.AddActor(outlineActor) - - aren.ResetCamera() - aren.GetActiveCamera().Azimuth(30) - aren.GetActiveCamera().Elevation(30) - - renWin.SetSize(640, 512) - renWin.SetWindowName('ContourQuadric') - renWin.Render() - - # interact with data - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CreateBFont.py b/data/examples/VisualizationAlgorithms/CreateBFont.py deleted file mode 100755 index c1bd9b0..0000000 --- a/data/examples/VisualizationAlgorithms/CreateBFont.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkClipPolyData -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkIOImage import vtkPNMReader -from vtkmodules.vtkImagingGeneral import vtkImageGaussianSmooth -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Now create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - imageIn = vtkPNMReader() - imageIn.SetFileName(fileName) - - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviations(2, 2) - gaussian.SetDimensionality(2) - gaussian.SetRadiusFactors(1, 1) - gaussian.SetInputConnection(imageIn.GetOutputPort()) - - geometry = vtkImageDataGeometryFilter() - geometry.SetInputConnection(gaussian.GetOutputPort()) - - aClipper = vtkClipPolyData() - aClipper.SetInputConnection(geometry.GetOutputPort()) - aClipper.SetValue(127.5) - aClipper.GenerateClipScalarsOff() - aClipper.InsideOutOn() - aClipper.GetOutput().GetPointData().CopyScalarsOff() - aClipper.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(aClipper.GetOutputPort()) - mapper.ScalarVisibilityOff() - - letter = vtkActor() - letter.SetMapper(mapper) - - ren1.AddActor(letter) - letter.GetProperty().SetDiffuseColor(colors.GetColor3d("LampBlack")) - letter.GetProperty().SetRepresentationToWireframe() - - ren1.SetBackground(colors.GetColor3d("WhiteSmoke")) - ren1.ResetCamera() - ren1.GetActiveCamera().Dolly(1.2) - ren1.ResetCameraClippingRange() - - renWin.SetSize(640, 480) - renWin.SetWindowName('CreateBFont') - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'A scanned image clipped with a scalar value.' - epilogue = ''' - A scanned image clipped with a scalar value of 1/2 its maximum intensity - produces a mixture of quadrilaterals and triangles. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='B.pgm.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CutStructuredGrid.py b/data/examples/VisualizationAlgorithms/CutStructuredGrid.py deleted file mode 100755 index 1faf681..0000000 --- a/data/examples/VisualizationAlgorithms/CutStructuredGrid.py +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import ( - vtkCutter, - vtkStructuredGridOutlineFilter -) -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFile, qFile = get_program_parameters() - - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # The cut data. - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - sg = pl3d.GetOutput().GetBlock(0) - - plane = vtkPlane() - plane.SetOrigin(sg.GetCenter()) - plane.SetNormal(-0.287, 0, 0.9579) - - planeCut = vtkCutter() - planeCut.SetInputData(pl3d.GetOutput().GetBlock(0)) - planeCut.SetCutFunction(plane) - - cutMapper = vtkDataSetMapper() - cutMapper.SetInputConnection(planeCut.GetOutputPort()) - cutMapper.SetScalarRange(sg.GetPointData().GetScalars().GetRange()) - - cutActor = vtkActor() - cutActor.SetMapper(cutMapper) - - # Extract the plane. - compPlane = vtkStructuredGridGeometryFilter() - compPlane.SetInputData(sg) - compPlane.SetExtent(0, 100, 0, 100, 9, 9) - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(compPlane.GetOutputPort()) - planeMapper.ScalarVisibilityOff() - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.GetProperty().SetRepresentationToWireframe() - planeActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - # Outline. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3d.GetOutput().GetBlock(0)) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(planeActor) - ren1.AddActor(cutActor) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - - renWin.SetSize(640, 480) - renWin.SetWindowName('CutStructuredGrid') - - camera = ren1.GetActiveCamera() - camera.SetPosition(5.02611, -23.535, 50.3979) - camera.SetFocalPoint(9.33614, 0.0414149, 30.112) - camera.SetViewUp(-0.0676794, 0.657814, 0.750134) - camera.SetDistance(31.3997) - camera.SetClippingRange(12.1468, 55.8147) - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Cut through structured grid with plane.' - epilogue = ''' - The cut plane is shown solid shaded. - A computational plane of constant k value is shown in wireframe for comparison. - The colors correspond to flow density. - Cutting surfaces are not necessarily planes: implicit functions such as spheres, cylinders, - and quadrics can also be used. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CutWithCutFunction.py b/data/examples/VisualizationAlgorithms/CutWithCutFunction.py deleted file mode 100755 index e8de30d..0000000 --- a/data/examples/VisualizationAlgorithms/CutWithCutFunction.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import vtkCutter -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName, numberOfCuts = get_program_parameters() - reader = vtkXMLPolyDataReader() - reader.SetFileName(fileName) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - print('Bounds:', ', '.join(['{:.3f}'.format(f) for f in bounds])) - - plane = vtkPlane() - plane.SetOrigin((bounds[1] + bounds[0]) / 2.0, (bounds[3] + bounds[2]) / 2.0, bounds[4]) - plane.SetNormal(0, 0, 1) - - # Create cutter - high = plane.EvaluateFunction((bounds[1] + bounds[0]) / 2.0, (bounds[3] + bounds[2]) / 2.0, bounds[5]) - - cutter = vtkCutter() - cutter.SetInputConnection(reader.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateValues(numberOfCuts, 0.99, 0.99 * high) - - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) - cutterMapper.ScalarVisibilityOff() - - # Create cut actor - cutterActor = vtkActor() - cutterActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - cutterActor.GetProperty().SetLineWidth(2) - cutterActor.SetMapper(cutterMapper) - - # Create model actor - modelMapper = vtkPolyDataMapper() - modelMapper.SetInputConnection(reader.GetOutputPort()) - modelMapper.ScalarVisibilityOff() - - modelActor = vtkActor() - modelActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - modelActor.SetMapper(modelMapper) - - # Create renderers and add actors of plane and model - renderer = vtkRenderer() - renderer.AddActor(cutterActor) - renderer.AddActor(modelActor) - - # Add renderer to renderwindow and render - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(600, 600) - renderWindow.SetWindowName('CutWithCutFunction') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.SetBackground(colors.GetColor3d('Burlywood')) - renderer.GetActiveCamera().SetPosition(0, -1, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 0, 1) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - renderer.ResetCamera() - renderWindow.Render() - - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Cut with a cut function.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='Torso.vtp') - parser.add_argument('numberOfCuts', default=10, type=int, nargs='?', help='The number of cuts e.g 10.') - args = parser.parse_args() - return args.filename, args.numberOfCuts - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/CutWithScalars.py b/data/examples/VisualizationAlgorithms/CutWithScalars.py deleted file mode 100755 index 830f6b7..0000000 --- a/data/examples/VisualizationAlgorithms/CutWithScalars.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkDoubleArray -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - inputFilename, numberOfCuts = get_program_parameters() - - colors = vtkNamedColors() - - reader = vtkXMLPolyDataReader() - reader.SetFileName(inputFilename) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - print(bounds) - - plane = vtkPlane() - plane.SetOrigin((bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, - (bounds[5] + bounds[4]) / 2.0) - plane.SetNormal(0, 0, 1) - - # Create Scalars. - scalars = vtkDoubleArray() - numberOfPoints = reader.GetOutput().GetNumberOfPoints() - scalars.SetNumberOfTuples(numberOfPoints) - pts = reader.GetOutput().GetPoints() - for i in range(0, numberOfPoints): - point = pts.GetPoint(i) - scalars.SetTuple1(i, plane.EvaluateFunction(point)) - reader.GetOutput().GetPointData().SetScalars(scalars) - reader.GetOutput().GetPointData().GetScalars().GetRange() - - # Create the cutter. - cutter = vtkContourFilter() - cutter.SetInputConnection(reader.GetOutputPort()) - cutter.ComputeScalarsOff() - cutter.ComputeNormalsOff() - cutter.GenerateValues( - numberOfCuts, - 0.99 * reader.GetOutput().GetPointData().GetScalars().GetRange()[0], - 0.99 * reader.GetOutput().GetPointData().GetScalars().GetRange()[1]) - - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) - cutterMapper.ScalarVisibilityOff() - - # Create the cut actor. - cutterActor = vtkActor() - cutterActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - cutterActor.GetProperty().SetLineWidth(2) - cutterActor.SetMapper(cutterMapper) - - # Create the model actor - modelMapper = vtkPolyDataMapper() - modelMapper.SetInputConnection(reader.GetOutputPort()) - modelMapper.ScalarVisibilityOff() - - modelActor = vtkActor() - modelActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - modelActor.SetMapper(modelMapper) - - # Create renderers and add the plane and model actors. - renderer = vtkRenderer() - renderer.AddActor(cutterActor) - renderer.AddActor(modelActor) - - # Add renderer to renderwindow and render - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(600, 600) - renderWindow.SetWindowName('CutWithCutScalars') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.SetBackground(colors.GetColor3d('Burlywood')) - renderer.GetActiveCamera().SetPosition(0, -1, 0) - renderer.GetActiveCamera().SetFocalPoint(0, 0, 0) - renderer.GetActiveCamera().SetViewUp(0, 0, 1) - renderer.GetActiveCamera().Azimuth(30) - renderer.GetActiveCamera().Elevation(30) - - renderer.ResetCamera() - renderWindow.Render() - - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Cutting a surface model of the skin with a series of planes produces contour lines.' - epilogue = ''' - Lines are wrapped with tubes for visual clarity. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='Torso.vtp.') - parser.add_argument('-n', type=int, default=20, help='Number of cuts.') - args = parser.parse_args() - return args.filename1, args.n - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/Cutter.md b/data/examples/VisualizationAlgorithms/Cutter.md deleted file mode 100644 index b01a72b..0000000 --- a/data/examples/VisualizationAlgorithms/Cutter.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example demonstrates how to use vtkCutter by cutting through a cube. - -* Contributed by Jothy diff --git a/data/examples/VisualizationAlgorithms/Cutter.py b/data/examples/VisualizationAlgorithms/Cutter.py deleted file mode 100755 index c1ef862..0000000 --- a/data/examples/VisualizationAlgorithms/Cutter.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python - -# A simple script to demonstrate the vtkCutter function - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import vtkCutter -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create a cube - cube = vtkCubeSource() - cube.SetXLength(40) - cube.SetYLength(30) - cube.SetZLength(20) - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cube.GetOutputPort()) - - # create a plane to cut,here it cuts in the XZ direction (xz normal=(1,0,0);XY =(0,0,1),YZ =(0,1,0) - plane = vtkPlane() - plane.SetOrigin(10, 0, 0) - plane.SetNormal(1, 0, 0) - - # create cutter - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputConnection(cube.GetOutputPort()) - cutter.Update() - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) - - # create plane actor - planeActor = vtkActor() - planeActor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - planeActor.GetProperty().SetLineWidth(2) - planeActor.GetProperty().SetAmbient(1.0) - planeActor.GetProperty().SetDiffuse(0.0) - planeActor.SetMapper(cutterMapper) - - # create cube actor - cubeActor = vtkActor() - cubeActor.GetProperty().SetColor(colors.GetColor3d('Aquamarine')) - cubeActor.GetProperty().SetOpacity(0.5) - cubeActor.SetMapper(cubeMapper) - - # create renderers and add actors of plane and cube - ren = vtkRenderer() - ren.AddActor(planeActor) - ren.AddActor(cubeActor) - ren.SetBackground(colors.GetColor3d('Silver')) - - # Add renderer to renderwindow and render - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(600, 600) - renWin.SetWindowName('Cutter') - renWin.Render() - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - camera = ren.GetActiveCamera() - camera.SetPosition(-37.2611, -86.2155, 44.841) - camera.SetFocalPoint(0.569422, -1.65124, -2.49482) - camera.SetViewUp(0.160129, 0.42663, 0.890138) - camera.SetDistance(104.033) - camera.SetClippingRange(55.2019, 165.753) - - renWin.Render() - - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/DataSetSurface.py b/data/examples/VisualizationAlgorithms/DataSetSurface.py deleted file mode 100755 index 5a140bd..0000000 --- a/data/examples/VisualizationAlgorithms/DataSetSurface.py +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkPoints -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkHexahedron, - vtkPlane, - vtkUnstructuredGrid -) -from vtkmodules.vtkFiltersCore import vtkCutter -from vtkmodules.vtkFiltersGeometry import vtkDataSetSurfaceFilter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Setup the coordinates of eight points - # (the two faces must be in counter clockwise order as viewed from the - # outside) - pointCoords = [ - [0.0, 0.0, 0.0], - [1.0, 0.0, 0.0], - [1.0, 1.0, 0.0], - [0.0, 1.0, 0.0], - [0.0, 0.0, 1.0], - [1.0, 0.0, 1.0], - [1.0, 1.0, 1.0], - [0.0, 1.0, 1.0] - ] - - # Create the points and a hexahedron from the points. - points = vtkPoints() - hexa = vtkHexahedron() - for i, pointCoord in enumerate(pointCoords): - points.InsertNextPoint(pointCoord) - hexa.GetPointIds().SetId(i, i) - - # Add the hexahedron to a cell array. - hexs = vtkCellArray() - hexs.InsertNextCell(hexa) - - # Add the points and hexahedron to an unstructured grid. - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) - uGrid.InsertNextCell(hexa.GetCellType(), hexa.GetPointIds()) - - # Extract the outer (polygonal) surface. - surface = vtkDataSetSurfaceFilter() - surface.SetInputData(uGrid) - surface.Update() - - aBeamMapper = vtkDataSetMapper() - aBeamMapper.SetInputConnection(surface.GetOutputPort()) - aBeamActor = vtkActor() - aBeamActor.SetMapper(aBeamMapper) - aBeamActor.AddPosition(0, 0, 0) - aBeamActor.GetProperty().SetColor( - colors.GetColor3d('Yellow')) - aBeamActor.GetProperty().SetOpacity(0.60) - aBeamActor.GetProperty().EdgeVisibilityOn() - aBeamActor.GetProperty().SetEdgeColor( - colors.GetColor3d('Black')) - aBeamActor.GetProperty().SetLineWidth(1.5) - - # Create a plane to cut, here it cuts in the XZ direction - # (xz normal=(1,0,0) XY =(0,0,1), YZ =(0,1,0) - plane = vtkPlane() - plane.SetOrigin(0.5, 0, 0) - plane.SetNormal(1, 0, 0) - - # Create cutter - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputData(aBeamActor.GetMapper().GetInput()) - cutter.Update() - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) - - # Create plane actor - planeActor = vtkActor() - planeActor.GetProperty().SetColor( - colors.GetColor3d('Red')) - planeActor.GetProperty().SetLineWidth(2) - planeActor.SetMapper(cutterMapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.SetWindowName('DatasetSurface') - renderWindow.AddRenderer(renderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Add the actors to the scene - renderer.AddActor(aBeamActor) - renderer.AddActor(planeActor) - renderer.SetBackground( - colors.GetColor3d('Seashell')) - - renderer.ResetCamera() - renderer.GetActiveCamera().Azimuth(-25) - renderer.GetActiveCamera().Elevation(30) - - # Render and interact - renderWindow.Render() - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/DecimateFran.py b/data/examples/VisualizationAlgorithms/DecimateFran.py deleted file mode 100755 index 13f0ee7..0000000 --- a/data/examples/VisualizationAlgorithms/DecimateFran.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkDecimatePro, - vtkPolyDataNormals -) -from vtkmodules.vtkIOImage import vtkPNGReader -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. - # - - # We start by reading some data that was originally captured from - # a Cyberware laser digitizing system. - # - fran = vtkPolyDataReader() - fran.SetFileName(fileName1) - - # Read the corresponding texture. - textureReader = vtkPNGReader() - textureReader.SetFileName(fileName2) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(textureReader.GetOutputPort()) - - # We want to preserve topology (not let any cracks form). This may limit - # the total reduction possible, which we have specified at 90%. - # - deci = vtkDecimatePro() - deci.SetInputConnection(fran.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() - decimatedNormals.SetInputConnection(deci.GetOutputPort()) - decimatedNormals.FlipNormalsOn() - decimatedNormals.SetFeatureAngle(60) - - originalNormals = vtkPolyDataNormals() - originalNormals.SetInputConnection(fran.GetOutputPort()) - originalNormals.FlipNormalsOn() - originalNormals.SetFeatureAngle(60) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetAmbient(.5) - decimatedActor.GetProperty().SetDiffuse(.5) - decimatedActor.SetTexture(texture) - - originalMapper = vtkPolyDataMapper() - originalMapper.SetInputConnection(originalNormals.GetOutputPort()) - - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetAmbient(.5) - originalActor.GetProperty().SetDiffuse(.5) - originalActor.SetTexture(texture) - - # Create the RenderWindow, Renderer and Interactor. - # - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - renderWindow.SetWindowName('DecimateFran') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer, set the background and size. - # - renderer1.AddActor(originalActor) - renderer2.AddActor(decimatedActor) - renderer1.SetBackground(colors.GetColor3d("Wheat")) - renderer2.SetBackground(colors.GetColor3d("Papaya_Whip")) - renderWindow.SetSize(800, 400) - - # Render the image. - # - cam1 = vtkCamera() - cam1.SetClippingRange(0.0475572, 2.37786) - cam1.SetFocalPoint(0.052665, -0.129454, -0.0573973) - cam1.SetPosition(0.327637, -0.116299, -0.256418) - cam1.SetViewUp(-0.0225386, 0.999137, 0.034901) - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) - - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Examples of the decimation algorithm.' - epilogue = ''' - (a) Decimation of laser digitizer. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='fran_cut.vtk') - parser.add_argument('filename2', help='fran_cut.png.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/DecimateHawaii.py b/data/examples/VisualizationAlgorithms/DecimateHawaii.py deleted file mode 100755 index 6227847..0000000 --- a/data/examples/VisualizationAlgorithms/DecimateHawaii.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkDecimatePro, - vtkPolyDataNormals -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. - # - - hawaii = vtkPolyDataReader() - hawaii.SetFileName(fileName) - - # We want to preserve topology (not let any cracks form). This may limit - # the total reduction possible, which we have specified at 90%. - # - deci = vtkDecimatePro() - deci.SetInputConnection(hawaii.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() - decimatedNormals.SetInputConnection(deci.GetOutputPort()) - decimatedNormals.FlipNormalsOn() - decimatedNormals.SetFeatureAngle(60) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - decimatedActor.GetProperty().SetRepresentationToWireframe() - - originalMapper = vtkPolyDataMapper() - originalMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - - # Create the RenderWindow, Renderer and Interactor. - # - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer, set the background and size. - # - renderer1.AddActor(originalActor) - renderer2.AddActor(decimatedActor) - renderer1.SetBackground(colors.GetColor3d('Wheat')) - renderer2.SetBackground(colors.GetColor3d('Papaya_Whip')) - renderWindow.SetSize(800, 400) - renderWindow.SetWindowName('DecimateHawaii') - - # Render the image. - # - cam1 = vtkCamera() - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) - renderer1.ResetCamera() - cam1.Elevation(-30) - cam1.Dolly(1.2) - renderer1.ResetCameraClippingRange() - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Examples of decimation algorithm.' - epilogue = ''' - Decimation of terrain data. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='honolulu.vtk') - args = parser.parse_args() - return args.filename1 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/DisplacementPlot.md b/data/examples/VisualizationAlgorithms/DisplacementPlot.md deleted file mode 100644 index e945ddc..0000000 --- a/data/examples/VisualizationAlgorithms/DisplacementPlot.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -This example shows modal lines for a vibrating rectangular beam. The vibration mode in this figure is the second torsional mode, clearly indicated by the crossing modal lines. - -The default color scheme shows cool color for maximum negative motion, warm color maximum positive motion, with white at the nodes. - -For other possible color maps see: [Diverging Color Maps for Scientific Visualization](http://www.kennethmoreland.com/color-maps/). - -!!! info - See [Figure 6-15](../../../VTKBook/06Chapter6/#Figure%206-15) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/DisplacementPlot.py b/data/examples/VisualizationAlgorithms/DisplacementPlot.py deleted file mode 100755 index 805c642..0000000 --- a/data/examples/VisualizationAlgorithms/DisplacementPlot.py +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env python - -# Translated from dispPlot.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataNormals, - vtkVectorDot -) -from vtkmodules.vtkFiltersGeneral import vtkWarpVector -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkColorTransferFunction, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - file_name, color_scheme = get_program_parameters() - - color_scheme = abs(color_scheme) - if color_scheme > 2: - color_scheme = 0 - - colors = vtkNamedColors() - - # Read a vtk file - # - plate = vtkPolyDataReader() - plate.SetFileName(file_name) - plate.SetVectorsName("mode8") - plate.Update() - - warp = vtkWarpVector() - warp.SetInputConnection(plate.GetOutputPort()) - warp.SetScaleFactor(0.5) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(warp.GetOutputPort()) - - color = vtkVectorDot() - color.SetInputConnection(normals.GetOutputPort()) - - lut = vtkLookupTable() - MakeLUT(color_scheme, lut) - - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(color.GetOutputPort()) - plateMapper.SetLookupTable(lut) - plateMapper.SetScalarRange(-1, 1) - - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(plateActor) - ren.SetBackground(colors.GetColor3d("Wheat")) - renWin.SetSize(512, 512) - renWin.SetWindowName('DisplacementPlot') - - ren.GetActiveCamera().SetPosition(13.3991, 14.0764, 9.97787) - ren.GetActiveCamera().SetFocalPoint(1.50437, 0.481517, 4.52992) - ren.GetActiveCamera().SetViewAngle(30) - ren.GetActiveCamera().SetViewUp(- 0.120861, 0.458556, - 0.880408) - ren.GetActiveCamera().SetClippingRange(12.5724, 26.8374) - # Render the image. - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produce figure 6–15(b) from the VTK Textbook.' - epilogue = ''' - Produce figure 6–15(b) from the VTK Textbook. - Surface plot of a vibrating plane. - - The color_scheme option allows you to select a series of colour schemes. - 0: The default:- cool maximum negative motion, warm maximum positive motion, white at the nodes. - 1: An alternative:- green maximum negative motion, purple maximum positive motion, white at the nodes. - 2: The original:- white at maximum motion, black at the nodes. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='plate.vtk') - parser.add_argument('color_scheme', default=0, type=int, nargs='?', help='The particular color scheme to use.') - args = parser.parse_args() - return args.filename, args.color_scheme - - -def MakeLUT(colorScheme, lut): - # See: [Diverging Color Maps for Scientific Visualization] - # (http:#www.kennethmoreland.com/color-maps/) - nc = 256 - ctf = vtkColorTransferFunction() - - if colorScheme == 1: - # Green to purple diverging. - ctf.SetColorSpaceToDiverging() - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.436, 0.308, 0.631) - lut.SetNumberOfTableValues(nc) - lut.Build() - for i in range(0, nc): - rgb = list(ctf.GetColor(float(i) / nc)) - rgb.append(1.0) - lut.SetTableValue(i, *rgb) - elif colorScheme == 2: - # Make a lookup table, black in the centre with bright areas - # at the beginning and end of the table. - # This is from the original code. - nc2 = nc / 2.0 - lut.SetNumberOfColors(nc) - lut.Build() - for i in range(0, int(nc2)): - # White to black. - v = (nc2 - i) / nc2 - lut.SetTableValue(i, v, v, v, 1) - for i in range(int(nc2), nc): - # Black to white. - v = (i - nc2) / nc2 - lut.SetTableValue(i, v, v, v, 1) - else: - # Cool to warm diverging. - ctf.SetColorSpaceToDiverging() - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) - lut.SetNumberOfTableValues(nc) - lut.Build() - for i in range(0, nc): - rgb = list(ctf.GetColor(float(i) / nc)) - rgb.append(1.0) - lut.SetTableValue(i, *rgb) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ExponentialCosine.py b/data/examples/VisualizationAlgorithms/ExponentialCosine.py deleted file mode 100755 index 5d1c7be..0000000 --- a/data/examples/VisualizationAlgorithms/ExponentialCosine.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python - -import math - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersGeneral import ( - vtkTransformPolyDataFilter, - vtkWarpScalar -) -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # create plane to warp - plane = vtkPlaneSource() - plane.SetResolution(300, 300) - - transform = vtkTransform() - transform.Scale(10.0, 10.0, 1.0) - - transF = vtkTransformPolyDataFilter() - transF.SetInputConnection(plane.GetOutputPort()) - transF.SetTransform(transform) - transF.Update() - - # Compute the Bessel function and derivatives. This portion could be - # encapsulated into source or filter object. - # - inputPd = transF.GetOutput() - numPts = inputPd.GetNumberOfPoints() - - newPts = vtkPoints() - newPts.SetNumberOfPoints(numPts) - - derivs = vtkDoubleArray() - derivs.SetNumberOfTuples(numPts) - - bessel = vtkPolyData() - bessel.CopyStructure(inputPd) - bessel.SetPoints(newPts) - bessel.GetPointData().SetScalars(derivs) - - x = [0.0] * 3 - for i in range(0, numPts): - inputPd.GetPoint(i, x) - r = math.sqrt(float(x[0] * x[0]) + x[1] * x[1]) - x[2] = math.exp(-r) * math.cos(10.0 * r) - newPts.SetPoint(i, x) - deriv = -math.exp(-r) * (math.cos(10.0 * r) + 10.0 * math.sin(10.0 * r)) - derivs.SetValue(i, deriv) - - # Warp the plane. - warp = vtkWarpScalar() - warp.SetInputData(bessel) - warp.XYPlaneOn() - warp.SetScaleFactor(0.5) - - # Mapper and actor. - mapper = vtkDataSetMapper() - mapper.SetInputConnection(warp.GetOutputPort()) - tmp = bessel.GetScalarRange() - mapper.SetScalarRange(tmp[0], tmp[1]) - - carpet = vtkActor() - carpet.SetMapper(mapper) - - # Assign our actor to the renderer. - ren.AddActor(carpet) - ren.SetBackground(colors.GetColor3d('Beige')) - renWin.SetSize(640, 480) - renWin.SetWindowName('ExponentialCosine') - - # draw the resulting scene - ren.ResetCamera() - ren.GetActiveCamera().Zoom(1.35) - ren.GetActiveCamera().Elevation(-55) - ren.GetActiveCamera().Azimuth(25) - ren.ResetCameraClippingRange() - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ExtractData.md b/data/examples/VisualizationAlgorithms/ExtractData.md deleted file mode 100644 index e315c67..0000000 --- a/data/examples/VisualizationAlgorithms/ExtractData.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example takes advantage of the properties of implicit functions to select and cut data. In particular it uses the region separation property to select data. Selecting or extracting data with an implicit function means choosing cells and points (and associated attribute data) that lie within a particular region of the function. To determine whether a point x-y-z lies within a region, we simply evaluate the point and examine the sign of the result. A cell lies in a region if all its points lie in the region. Here, two ellipses are used in combination to select voxels within a volume dataset. Note that extracting data often changes the structure of the dataset. In this example the input type is a image data dataset, while the output type is an unstructured grid dataset. - -!!! info - See [Figure 6-24](../../../VTKBook/06Chapter6/#Figure%206-24) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/ExtractData.py b/data/examples/VisualizationAlgorithms/ExtractData.py deleted file mode 100755 index 92d8164..0000000 --- a/data/examples/VisualizationAlgorithms/ExtractData.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkImplicitBoolean, - vtkQuadric, - vtkSphere -) -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersExtraction import vtkExtractGeometry -from vtkmodules.vtkFiltersGeneral import vtkShrinkFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - quadric = vtkQuadric() - quadric.SetCoefficients(0.5, 1, 0.2, 0, 0.1, 0, 0, 0.2, 0, 0) - - sample = vtkSampleFunction() - sample.SetSampleDimensions(50, 50, 50) - sample.SetImplicitFunction(quadric) - sample.ComputeNormalsOff() - - trans = vtkTransform() - trans.Scale(1, 0.5, 0.333) - - sphere = vtkSphere() - sphere.SetRadius(0.25) - sphere.SetTransform(trans) - - trans2 = vtkTransform() - trans2.Scale(0.25, 0.5, 1.0) - - sphere2 = vtkSphere() - sphere2.SetRadius(0.25) - sphere2.SetTransform(trans2) - - booleanUnion = vtkImplicitBoolean() - booleanUnion.AddFunction(sphere) - booleanUnion.AddFunction(sphere2) - booleanUnion.SetOperationType(0) # boolean Union - - extract = vtkExtractGeometry() - extract.SetInputConnection(sample.GetOutputPort()) - extract.SetImplicitFunction(booleanUnion) - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(extract.GetOutputPort()) - shrink.SetShrinkFactor(0.5) - - dataMapper = vtkDataSetMapper() - dataMapper.SetInputConnection(shrink.GetOutputPort()) - dataActor = vtkActor() - dataActor.SetMapper(dataMapper) - - # outline - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(0, 0, 0) - - # Add the actors to the renderer, set the background and size - # - ren1.AddActor(outlineActor) - ren1.AddActor(dataActor) - ren1.SetBackground(colors.GetColor3d("SlateGray")) - - renWin.SetSize(640, 480) - renWin.SetWindowName('ExtractData') - - renWin.Render() - ren1.GetActiveCamera().Azimuth(30) - ren1.GetActiveCamera().Elevation(30) - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/FlyingHeadSlice.md b/data/examples/VisualizationAlgorithms/FlyingHeadSlice.md deleted file mode 100644 index d82f47e..0000000 --- a/data/examples/VisualizationAlgorithms/FlyingHeadSlice.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This example generates 2D contour lines on one CT slice through the head. The contours correspond to density values of the tissues and are colored according to density value. - -This example is a modification of [HeadSlice](../../../Cxx/VisualizationAlgorithms/HeadSlice) using vtkFlyingEdges2D for contouring. However there is an option to use vtkContourFilter instead. - -!!! info - See [Figure 6-11a](../../../VTKBook/06Chapter6/#Figure%206-11a) in [Chapter 6](../../../VTKBook/06Chapter6) of the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/FlyingHeadSlice.py b/data/examples/VisualizationAlgorithms/FlyingHeadSlice.py deleted file mode 100755 index c6d308e..0000000 --- a/data/examples/VisualizationAlgorithms/FlyingHeadSlice.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkFlyingEdges2D -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkExtractVOI -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName, useContouring = get_program_parameters() - if useContouring: - print('Using vtkContourFilter.') - else: - print('Using vtkFlyingEdges2D.') - - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) - extractVOI.SetVOI(0, 255, 0, 255, 45, 45) - # scalarRange = extractVOI.GetOutput().GetScalarRange() - scalarRange = [500, 1150] - # print(scalarRange) - - contour = vtkContourFilter() - flyingEdges = vtkFlyingEdges2D() - isoMapper = vtkPolyDataMapper() - if useContouring: - contour.SetInputConnection(extractVOI.GetOutputPort()) - contour.GenerateValues(12, scalarRange) - isoMapper.SetInputConnection(contour.GetOutputPort()) - else: - flyingEdges.SetInputConnection(extractVOI.GetOutputPort()) - flyingEdges.GenerateValues(12, scalarRange) - isoMapper.SetInputConnection(flyingEdges.GetOutputPort()) - - isoMapper.ScalarVisibilityOn() - isoMapper.SetScalarRange(scalarRange) - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(extractVOI.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren1.AddActor(outlineActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.ResetCamera() - ren1.GetActiveCamera().Dolly(1.5) - ren1.ResetCameraClippingRange() - - renWin.SetSize(640, 640) - renWin.SetWindowName('FlyingHeadSlice') - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Either vtkFlyingEdges2D or vtkContourFilter is used to generate contour lines.' - epilogue = ''' - Generate 2D contour lines, corresponding to tissue density, on one CT slice through the head. - The contour lines are colored by the tissue density. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - parser.add_argument('-useContouring', '--useContouring', action='store_true', - help='Use vtkContourFilter instead of vtkFlyingEdges2D.') - args = parser.parse_args() - return args.filename, args.useContouring - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/HeadBone.md b/data/examples/VisualizationAlgorithms/HeadBone.md deleted file mode 100644 index eb448a2..0000000 --- a/data/examples/VisualizationAlgorithms/HeadBone.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example generates an isosurface of human bone. - -!!! info - See [Figure 6-11b](../../../VTKBook/06Chapter6/#Figure%206-11b) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/HeadBone.py b/data/examples/VisualizationAlgorithms/HeadBone.py deleted file mode 100755 index 02e0677..0000000 --- a/data/examples/VisualizationAlgorithms/HeadBone.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkVersion -) -from vtkmodules.vtkCommonDataModel import vtkMergePoints -from vtkmodules.vtkFiltersCore import ( - vtkFlyingEdges3D, - vtkMarchingCubes -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - # vtkFlyingEdges3D was introduced in VTK >= 8.2 - use_flying_edges = vtk_version_ok(8, 2, 0) - - file_name = get_program_parameters() - - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Create the pipeline. - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - locator = vtkMergePoints() - locator.SetDivisions(64, 64, 92) - locator.SetNumberOfPointsPerBucket(2) - locator.AutomaticOff() - - if use_flying_edges: - try: - using_marching_cubes = False - iso = vtkFlyingEdges3D() - except AttributeError: - using_marching_cubes = True - iso = vtkMarchingCubes() - else: - using_marching_cubes = True - iso = vtkMarchingCubes() - iso.SetInputConnection(reader.GetOutputPort()) - iso.ComputeGradientsOn() - iso.ComputeScalarsOff() - iso.SetValue(0, 1150) - if using_marching_cubes: - iso.SetLocator(locator) - - iso_mapper = vtkPolyDataMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) - iso_mapper.ScalarVisibilityOff() - - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor(colors.GetColor3d('Ivory')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outline_mapper = vtkPolyDataMapper() - outline_mapper.SetInputConnection(outline.GetOutputPort()) - - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - - # Add the actors to the renderer, set the background and size. - # - ren.AddActor(outline_actor) - ren.AddActor(iso_actor) - ren.SetBackground(colors.GetColor3d('SlateGray')) - ren.GetActiveCamera().SetFocalPoint(0, 0, 0) - ren.GetActiveCamera().SetPosition(0, -1, 0) - ren.GetActiveCamera().SetViewUp(0, 0, -1) - ren.ResetCamera() - ren.GetActiveCamera().Dolly(1.5) - ren.ResetCameraClippingRange() - - ren_win.SetSize(640, 480) - ren_win.SetWindowName('HeadBone') - - ren_win.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Marching cubes surface of human bone.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) + 100000000 * int(minor) + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: # as error: - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/HeadSlice.md b/data/examples/VisualizationAlgorithms/HeadSlice.md deleted file mode 100644 index 1425a39..0000000 --- a/data/examples/VisualizationAlgorithms/HeadSlice.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example generates contours on one CT slice through the head, - -!!! info - See [Figure 6-11a](../../../VTKBook/06Chapter6/#Figure%206-11a) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/HeadSlice.py b/data/examples/VisualizationAlgorithms/HeadSlice.py deleted file mode 100755 index 164233f..0000000 --- a/data/examples/VisualizationAlgorithms/HeadSlice.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingCore import vtkExtractVOI -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) - extractVOI.SetVOI(0, 255, 0, 255, 45, 45) - - iso = vtkContourFilter() - iso.SetInputConnection(extractVOI.GetOutputPort()) - iso.GenerateValues(12, 500, 1150) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(extractVOI.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.ResetCamera() - ren1.GetActiveCamera().Dolly(1.5) - ren1.ResetCameraClippingRange() - - renWin.SetSize(640, 640) - renWin.SetWindowName('HeadSlice') - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Marching squares are used to generate contour lines.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='FullHead.mhd.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/Hello.py b/data/examples/VisualizationAlgorithms/Hello.py deleted file mode 100755 index f2c7063..0000000 --- a/data/examples/VisualizationAlgorithms/Hello.py +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersHybrid import vtkImplicitModeller -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Create lines which serve as the 'seed' geometry. The lines spell the - # word 'hello'. - # - reader = vtkPolyDataReader() - reader.SetFileName(fileName) - - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputConnection(reader.GetOutputPort()) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - lineActor.GetProperty().SetLineWidth(3.0) - - # Create implicit model with vtkImplicitModeller. This computes a scalar - # field which is the distance from the generating geometry. The contour - # filter then extracts the geometry at the distance value 0.25 from the - # generating geometry. - # - imp = vtkImplicitModeller() - imp.SetInputConnection(reader.GetOutputPort()) - imp.SetSampleDimensions(110, 40, 20) - imp.SetMaximumDistance(0.25) - imp.SetModelBounds(-1.0, 10.0, -1.0, 3.0, -1.0, 1.0) - - contour = vtkContourFilter() - contour.SetInputConnection(imp.GetOutputPort()) - contour.SetValue(0, 0.25) - - impMapper = vtkPolyDataMapper() - impMapper.SetInputConnection(contour.GetOutputPort()) - impMapper.ScalarVisibilityOff() - - impActor = vtkActor() - impActor.SetMapper(impMapper) - impActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - impActor.GetProperty().SetOpacity(0.5) - - # Create the usual graphics stuff. - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetWindowName('Hello') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren1.AddActor(lineActor) - ren1.AddActor(impActor) - ren1.SetBackground(colors.GetColor3d('Wheat')) - renWin.SetSize(640, 480) - - camera = vtkCamera() - camera.SetFocalPoint(4.5, 1, 0) - camera.SetPosition(4.5, 1.0, 6.73257) - camera.SetViewUp(0, 1, 0) - - ren1.SetActiveCamera(camera) - ren1.ResetCamera() - camera.Dolly(1.3) - camera.SetClippingRange(1.81325, 90.6627) - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Implicit modelling is used to thicken a stroked font.' - epilogue = ''' - Implicit modelling is used to thicken a stroked font. - The original lines can be seen within the translucent implicit surface. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='hello.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/HyperStreamline.md b/data/examples/VisualizationAlgorithms/HyperStreamline.md deleted file mode 100644 index 149b1ae..0000000 --- a/data/examples/VisualizationAlgorithms/HyperStreamline.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This is an example of hyperstreamlines. The data is from a point load applied to semi-infinite domain. Compare this image to [TensorEllipsoids](../TensorEllipsoids) that used tensor ellipsoids to visualize the same data. Notice that there is less clutter and more information available from the hyperstreamline visualization. - -!!! info - See [Figure 9-15](../../../VTKBook/09Chapter9/#Figure%209-15) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/HyperStreamline.py b/data/examples/VisualizationAlgorithms/HyperStreamline.py deleted file mode 100755 index 0e51ce6..0000000 --- a/data/examples/VisualizationAlgorithms/HyperStreamline.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersGeneral import vtkHyperStreamline -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkImagingHybrid import vtkPointLoad -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkLogLookupTable, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Generate the tensors. - ptLoad = vtkPointLoad() - ptLoad.SetLoadValue(100.0) - ptLoad.SetSampleDimensions(20, 20, 20) - ptLoad.ComputeEffectiveStressOn() - ptLoad.SetModelBounds(-10, 10, -10, 10, -10, 10) - ptLoad.Update() - - # Generate the hyperstreamlines. - s1 = vtkHyperStreamline() - s1.SetInputData(ptLoad.GetOutput()) - s1.SetStartPosition(9, 9, -9) - s1.IntegrateMinorEigenvector() - s1.SetMaximumPropagationDistance(18.0) - s1.SetIntegrationStepLength(0.1) - s1.SetStepLength(0.01) - s1.SetRadius(0.25) - s1.SetNumberOfSides(18) - s1.SetIntegrationDirectionToIntegrateBothDirections() - s1.Update() - - # Map the hyperstreamlines. - lut = vtkLogLookupTable() - lut.SetHueRange(.6667, 0.0) - - s1Mapper = vtkPolyDataMapper() - s1Mapper.SetInputConnection(s1.GetOutputPort()) - s1Mapper.SetLookupTable(lut) - s1Mapper.SetScalarRange(ptLoad.GetOutput().GetScalarRange()) - - s1Actor = vtkActor() - s1Actor.SetMapper(s1Mapper) - - s2 = vtkHyperStreamline() - s2.SetInputData(ptLoad.GetOutput()) - s2.SetStartPosition(-9, -9, -9) - s2.IntegrateMinorEigenvector() - s2.SetMaximumPropagationDistance(18.0) - s2.SetIntegrationStepLength(0.1) - s2.SetStepLength(0.01) - s2.SetRadius(0.25) - s2.SetNumberOfSides(18) - s2.SetIntegrationDirectionToIntegrateBothDirections() - s2.Update() - - s2Mapper = vtkPolyDataMapper() - s2Mapper.SetInputConnection(s2.GetOutputPort()) - s2Mapper.SetLookupTable(lut) - s2Mapper.SetScalarRange(ptLoad.GetOutput().GetScalarRange()) - - s2Actor = vtkActor() - s2Actor.SetMapper(s2Mapper) - - s3 = vtkHyperStreamline() - s3.SetInputData(ptLoad.GetOutput()) - s3.SetStartPosition(9, -9, -9) - s3.IntegrateMinorEigenvector() - s3.SetMaximumPropagationDistance(18.0) - s3.SetIntegrationStepLength(0.1) - s3.SetStepLength(0.01) - s3.SetRadius(0.25) - s3.SetNumberOfSides(18) - s3.SetIntegrationDirectionToIntegrateBothDirections() - s3.Update() - - s3Mapper = vtkPolyDataMapper() - s3Mapper.SetInputConnection(s3.GetOutputPort()) - s3Mapper.SetLookupTable(lut) - s3Mapper.SetScalarRange(ptLoad.GetOutput().GetScalarRange()) - - s3Actor = vtkActor() - s3Actor.SetMapper(s3Mapper) - - s4 = vtkHyperStreamline() - s4.SetInputData(ptLoad.GetOutput()) - s4.SetStartPosition(-9, 9, -9) - s4.IntegrateMinorEigenvector() - s4.SetMaximumPropagationDistance(18.0) - s4.SetIntegrationStepLength(0.1) - s4.SetStepLength(0.01) - s4.SetRadius(0.25) - s4.SetNumberOfSides(18) - s4.SetIntegrationDirectionToIntegrateBothDirections() - s4.Update() - - s4Mapper = vtkPolyDataMapper() - s4Mapper.SetInputConnection(s4.GetOutputPort()) - s4Mapper.SetLookupTable(lut) - s4Mapper.SetScalarRange(ptLoad.GetOutput().GetScalarRange()) - - s4Actor = vtkActor() - s4Actor.SetMapper(s4Mapper) - - # A plane for context. - # - g = vtkImageDataGeometryFilter() - g.SetInputData(ptLoad.GetOutput()) - g.SetExtent(0, 100, 0, 100, 0, 0) - g.Update() # for scalar range - - gm = vtkPolyDataMapper() - gm.SetInputConnection(g.GetOutputPort()) - gm.SetScalarRange(g.GetOutput().GetScalarRange()) - - ga = vtkActor() - ga.SetMapper(gm) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() - outline.SetInputData(ptLoad.GetOutput()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create a cone indicating the application of the load. - # - coneSrc = vtkConeSource() - coneSrc.SetRadius(0.5) - coneSrc.SetHeight(2) - - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) - - ren1.AddActor(s1Actor) - ren1.AddActor(s2Actor) - ren1.AddActor(s3Actor) - ren1.AddActor(s4Actor) - ren1.AddActor(outlineActor) - ren1.AddActor(coneActor) - ren1.AddActor(ga) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.SetActiveCamera(camera) - - renWin.SetSize(640, 480) - renWin.SetWindowName('HyperStreamline') - - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/IceCream.md b/data/examples/VisualizationAlgorithms/IceCream.md deleted file mode 100644 index fd16e35..0000000 --- a/data/examples/VisualizationAlgorithms/IceCream.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description -This example demonstrates how to use boolean combinations of implicit functions to create a model of an ice cream cone. - -!!! info - See [Figure 6-23c](../../../VTKBook/06Chapter6/#Figure%206-23c) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/IceCream.py b/data/examples/VisualizationAlgorithms/IceCream.py deleted file mode 100755 index 33b9fa7..0000000 --- a/data/examples/VisualizationAlgorithms/IceCream.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python - -""" -This example demonstrates how to use boolean combinations of implicit - functions to create a model of an ice cream cone. - -""" -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import ( - vtkCone, - vtkImplicitBoolean, - vtkPlane, - vtkSphere -) -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkImagingHybrid import vtkSampleFunction -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create implicit function primitives. These have been carefully placed to - # give the effect that we want. We are going to use various combinations of - # these functions to create the shape we want for example, we use planes - # intersected with a cone (which is infinite in extent) to get a finite - # cone. - # - cone = vtkCone() - cone.SetAngle(20) - - vertPlane = vtkPlane() - vertPlane.SetOrigin(.1, 0, 0) - vertPlane.SetNormal(-1, 0, 0) - - basePlane = vtkPlane() - basePlane.SetOrigin(1.2, 0, 0) - basePlane.SetNormal(1, 0, 0) - - iceCream = vtkSphere() - iceCream.SetCenter(1.333, 0, 0) - iceCream.SetRadius(0.5) - - bite = vtkSphere() - bite.SetCenter(1.5, 0, 0.5) - bite.SetRadius(0.25) - - # Combine primitives to build ice-cream cone. Clip the cone with planes. - theCone = vtkImplicitBoolean() - theCone.SetOperationTypeToIntersection() - theCone.AddFunction(cone) - theCone.AddFunction(vertPlane) - theCone.AddFunction(basePlane) - - # Take a bite out of the ice cream. - theCream = vtkImplicitBoolean() - theCream.SetOperationTypeToDifference() - theCream.AddFunction(iceCream) - theCream.AddFunction(bite) - - # The sample function generates a distance function from the - # implicit function (which in this case is the cone). This is - # then contoured to get a polygonal surface. - # - theConeSample = vtkSampleFunction() - theConeSample.SetImplicitFunction(theCone) - theConeSample.SetModelBounds(-1, 1.5, -1.25, 1.25, -1.25, 1.25) - theConeSample.SetSampleDimensions(128, 128, 128) - theConeSample.ComputeNormalsOff() - - theConeSurface = vtkContourFilter() - theConeSurface.SetInputConnection(theConeSample.GetOutputPort()) - theConeSurface.SetValue(0, 0.0) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(theConeSurface.GetOutputPort()) - coneMapper.ScalarVisibilityOff() - - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Chocolate')) - - # The same here for the ice cream. - # - theCreamSample = vtkSampleFunction() - theCreamSample.SetImplicitFunction(theCream) - theCreamSample.SetModelBounds(0, 2.5, -1.25, 1.25, -1.25, 1.25) - theCreamSample.SetSampleDimensions(128, 128, 128) - theCreamSample.ComputeNormalsOff() - - theCreamSurface = vtkContourFilter() - theCreamSurface.SetInputConnection(theCreamSample.GetOutputPort()) - theCreamSurface.SetValue(0, 0.0) - - creamMapper = vtkPolyDataMapper() - creamMapper.SetInputConnection(theCreamSurface.GetOutputPort()) - creamMapper.ScalarVisibilityOff() - - creamActor = vtkActor() - creamActor.SetMapper(creamMapper) - creamActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Mint')) - creamActor.GetProperty().SetSpecular(.6) - creamActor.GetProperty().SetSpecularPower(50) - - # Create the usual rendering stuff. - # - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(coneActor) - ren1.AddActor(creamActor) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(640, 480) - renWin.SetWindowName('IceCream') - - ren1.ResetCamera() - ren1.GetActiveCamera().Roll(90) - ren1.GetActiveCamera().Dolly(1.25) - ren1.ResetCameraClippingRange() - iren.Initialize() - - # render the image - # - renWin.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ImageGradient.md b/data/examples/VisualizationAlgorithms/ImageGradient.md deleted file mode 100644 index c6afd83..0000000 --- a/data/examples/VisualizationAlgorithms/ImageGradient.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -We create an imaging pipeline to visualize gradient information. - -The gradient direction is mapped into color hue value while the gradient magnitude is mapped into the color saturation. - -!!! info - See [Figure 10-16](../../../VTKBook/10Chapter10/#Figure%2010-16) in [Chapter 10](../../../VTKBook/10Chapter10) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/ImageGradient.py b/data/examples/VisualizationAlgorithms/ImageGradient.py deleted file mode 100755 index 98448ac..0000000 --- a/data/examples/VisualizationAlgorithms/ImageGradient.py +++ /dev/null @@ -1,124 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOImage import vtkMetaImageReader -from vtkmodules.vtkImagingColor import vtkImageHSVToRGB -from vtkmodules.vtkImagingCore import ( - vtkImageCast, - vtkImageConstantPad, - vtkImageExtractComponents, - vtkImageMagnify -) -from vtkmodules.vtkImagingGeneral import ( - vtkImageEuclideanToPolar, - vtkImageGaussianSmooth, - vtkImageGradient -) -from vtkmodules.vtkInteractionImage import vtkImageViewer -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindowInteractor -) - - -def main(): - fileName = get_program_parameters() - colors = vtkNamedColors() - - # Read the CT data of the human head. - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToFloat() - - # Magnify the image. - magnify = vtkImageMagnify() - magnify.SetInputConnection(cast.GetOutputPort()) - magnify.SetMagnificationFactors(2, 2, 1) - magnify.InterpolateOn() - - # Smooth the data. - # Remove high frequency artifacts due to linear interpolation. - smooth = vtkImageGaussianSmooth() - smooth.SetInputConnection(magnify.GetOutputPort()) - smooth.SetDimensionality(2) - smooth.SetStandardDeviations(1.5, 1.5, 0.0) - smooth.SetRadiusFactors(2.01, 2.01, 0.0) - - # Compute the 2D gradient. - gradient = vtkImageGradient() - gradient.SetInputConnection(smooth.GetOutputPort()) - gradient.SetDimensionality(2) - - # Convert the data to polar coordinates. - # The image magnitude is mapped into saturation value, - # whilst the gradient direction is mapped into hue value. - polar = vtkImageEuclideanToPolar() - polar.SetInputConnection(gradient.GetOutputPort()) - polar.SetThetaMaximum(255.0) - - # Add a third component to the data. - # This is needed since the gradient filter only generates two components, - # and we need three components to represent color. - pad = vtkImageConstantPad() - pad.SetInputConnection(polar.GetOutputPort()) - pad.SetOutputNumberOfScalarComponents(3) - pad.SetConstant(200.0) - - # At this point we have Hue, Value, Saturation. - # Permute components so saturation will be constant. - # Re-arrange components into HSV order. - permute = vtkImageExtractComponents() - permute.SetInputConnection(pad.GetOutputPort()) - permute.SetComponents(0, 2, 1) - - # Convert back into RGB values. - rgb = vtkImageHSVToRGB() - rgb.SetInputConnection(permute.GetOutputPort()) - rgb.SetMaximum(255.0) - - # Set up a viewer for the image. - # Note that vtkImageViewer and vtkImageViewer2 are convenience wrappers around - # vtkActor2D, vtkImageMapper, vtkRenderer, and vtkRenderWindow. - # So all that needs to be supplied is the interactor. - viewer = vtkImageViewer() - viewer.SetInputConnection(rgb.GetOutputPort()) - viewer.SetZSlice(22) - viewer.SetColorWindow(255.0) - viewer.SetColorLevel(127.0) - viewer.GetRenderWindow().SetSize(512, 512) - viewer.GetRenderer().SetBackground(colors.GetColor3d('Silver')) - viewer.GetRenderWindow().SetWindowName('ImageGradient') - - # Create the RenderWindowInteractor. - iren = vtkRenderWindowInteractor() - viewer.SetupInteractor(iren) - viewer.Render() - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'ImageGradient.' - epilogue = ''' -Visualization of gradient information. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('fileName', - help='The file FullHead.mhd. Note: file FullHead.raw.gz must also be present in the same folder.') - args = parser.parse_args() - return args.fileName - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/IronIsoSurface.py b/data/examples/VisualizationAlgorithms/IronIsoSurface.py deleted file mode 100755 index 07d87a5..0000000 --- a/data/examples/VisualizationAlgorithms/IronIsoSurface.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 128) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d("Banana")) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(isoActor) - ren1.SetBackground(colors.GetColor3d("SlateGray")) - renWin.SetSize(640, 640) - renWin.SetWindowName('IronIsoSurface') - - # Render the image. - # - ren1.ResetCamera() - ren1.GetActiveCamera().Azimuth(30) - ren1.GetActiveCamera().Elevation(30) - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Marching cubes surface of iron-protein.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='ironProt.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/LOx.py b/data/examples/VisualizationAlgorithms/LOx.py deleted file mode 100755 index 0263378..0000000 --- a/data/examples/VisualizationAlgorithms/LOx.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkStructuredGridOutlineFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) - pl3d.Update() - - sg = pl3d.GetOutput().GetBlock(0) - - # blue to red lut - # - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - # Computational planes. - floorComp = vtkStructuredGridGeometryFilter() - floorComp.SetExtent(0, 37, 0, 75, 0, 0) - floorComp.SetInputData(sg) - floorComp.Update() - - floorMapper = vtkPolyDataMapper() - floorMapper.SetInputConnection(floorComp.GetOutputPort()) - floorMapper.ScalarVisibilityOff() - floorMapper.SetLookupTable(lut) - - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - floorActor.GetProperty().SetLineWidth(2) - - subFloorComp = vtkStructuredGridGeometryFilter() - - subFloorComp.SetExtent(0, 37, 0, 15, 22, 22) - subFloorComp.SetInputData(sg) - - subFloorMapper = vtkPolyDataMapper() - subFloorMapper.SetInputConnection(subFloorComp.GetOutputPort()) - subFloorMapper.SetLookupTable(lut) - subFloorMapper.SetScalarRange(sg.GetScalarRange()) - - subFloorActor = vtkActor() - - subFloorActor.SetMapper(subFloorMapper) - - subFloor2Comp = vtkStructuredGridGeometryFilter() - subFloor2Comp.SetExtent(0, 37, 60, 75, 22, 22) - subFloor2Comp.SetInputData(sg) - - subFloor2Mapper = vtkPolyDataMapper() - subFloor2Mapper.SetInputConnection(subFloor2Comp.GetOutputPort()) - subFloor2Mapper.SetLookupTable(lut) - subFloor2Mapper.SetScalarRange(sg.GetScalarRange()) - - subFloor2Actor = vtkActor() - - subFloor2Actor.SetMapper(subFloor2Mapper) - - postComp = vtkStructuredGridGeometryFilter() - postComp.SetExtent(10, 10, 0, 75, 0, 37) - postComp.SetInputData(sg) - - postMapper = vtkPolyDataMapper() - postMapper.SetInputConnection(postComp.GetOutputPort()) - postMapper.SetLookupTable(lut) - postMapper.SetScalarRange(sg.GetScalarRange()) - - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - fanComp = vtkStructuredGridGeometryFilter() - fanComp.SetExtent(0, 37, 38, 38, 0, 37) - fanComp.SetInputData(sg) - - fanMapper = vtkPolyDataMapper() - fanMapper.SetInputConnection(fanComp.GetOutputPort()) - fanMapper.SetLookupTable(lut) - fanMapper.SetScalarRange(sg.GetScalarRange()) - - fanActor = vtkActor() - - fanActor.SetMapper(fanMapper) - fanActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # streamers - # - # spherical seed points - rake = vtkPointSource() - rake.SetCenter(-0.74, 0, 0.3) - rake.SetNumberOfPoints(10) - - # a line of seed points - seedsComp = vtkStructuredGridGeometryFilter() - seedsComp.SetExtent(10, 10, 37, 39, 1, 27) - seedsComp.SetInputData(sg) - - streamers = vtkStreamTracer() - streamers.SetInputConnection(pl3d.GetOutputPort()) - - # streamers SetSource [rake GetOutput] - streamers.SetSourceConnection(seedsComp.GetOutputPort()) - streamers.SetMaximumPropagation(250) - streamers.SetInitialIntegrationStep(.2) - streamers.SetMinimumIntegrationStep(.01) - streamers.SetIntegratorType(2) - streamers.Update() - - tubes = vtkTubeFilter() - tubes.SetInputConnection(streamers.GetOutputPort()) - tubes.SetNumberOfSides(8) - tubes.SetRadius(0.08) - tubes.SetVaryRadius(0) - - mapTubes = vtkPolyDataMapper() - - mapTubes.SetInputConnection(tubes.GetOutputPort()) - mapTubes.SetScalarRange(sg.GetScalarRange()) - - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - # outline - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # Create graphics stuff. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(floorActor) - # ren1.AddActor(subFloorActor) - # ren1.AddActor(subFloor2Actor) - ren1.AddActor(postActor) - # ren1.AddActor(fanActor) - ren1.AddActor(tubesActor) - - aCam = vtkCamera() - aCam.SetFocalPoint(2.47736, -0.150024, 2.42361) - aCam.SetPosition(1.57547, -13.4601, 5.47872) - aCam.SetViewUp(0.00197003, 0.223588, 0.974682) - # aCam.Dolly(4.0) - aCam.SetClippingRange(1, 100) - - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.SetActiveCamera(aCam) - renWin.SetSize(640, 480) - renWin.SetWindowName('LOx') - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Streamtubes created by using the computational grid just in front of the post as a source for seeds.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('xyz_file', help='postxyz.bin.') - parser.add_argument('q_file', help='postq.bin.') - args = parser.parse_args() - return args.xyz_file, args.q_file - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/LOxGrid.py b/data/examples/VisualizationAlgorithms/LOxGrid.py deleted file mode 100755 index 4a716b9..0000000 --- a/data/examples/VisualizationAlgorithms/LOxGrid.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkStructuredGridOutlineFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) - pl3d.Update() - - sg = pl3d.GetOutput().GetBlock(0) - - # blue to red lut - # - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - # Computational planes. - floorComp = vtkStructuredGridGeometryFilter() - floorComp.SetExtent(0, 37, 0, 75, 0, 0) - floorComp.SetInputData(sg) - floorComp.Update() - - floorMapper = vtkPolyDataMapper() - floorMapper.SetInputConnection(floorComp.GetOutputPort()) - floorMapper.ScalarVisibilityOff() - floorMapper.SetLookupTable(lut) - - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - floorActor.GetProperty().SetLineWidth(2) - - subFloorComp = vtkStructuredGridGeometryFilter() - - subFloorComp.SetExtent(0, 37, 0, 15, 22, 22) - subFloorComp.SetInputData(sg) - - subFloorMapper = vtkPolyDataMapper() - subFloorMapper.SetInputConnection(subFloorComp.GetOutputPort()) - subFloorMapper.SetLookupTable(lut) - subFloorMapper.SetScalarRange(sg.GetScalarRange()) - - subFloorActor = vtkActor() - - subFloorActor.SetMapper(subFloorMapper) - - subFloor2Comp = vtkStructuredGridGeometryFilter() - subFloor2Comp.SetExtent(0, 37, 60, 75, 22, 22) - subFloor2Comp.SetInputData(sg) - - subFloor2Mapper = vtkPolyDataMapper() - subFloor2Mapper.SetInputConnection(subFloor2Comp.GetOutputPort()) - subFloor2Mapper.SetLookupTable(lut) - subFloor2Mapper.SetScalarRange(sg.GetScalarRange()) - - subFloor2Actor = vtkActor() - - subFloor2Actor.SetMapper(subFloor2Mapper) - - postComp = vtkStructuredGridGeometryFilter() - - postComp.SetExtent(10, 10, 0, 75, 0, 37) - postComp.SetInputData(sg) - - postMapper = vtkPolyDataMapper() - postMapper.SetInputConnection(postComp.GetOutputPort()) - postMapper.SetLookupTable(lut) - postMapper.SetScalarRange(sg.GetScalarRange()) - - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - fanComp = vtkStructuredGridGeometryFilter() - fanComp.SetExtent(0, 37, 38, 38, 0, 37) - fanComp.SetInputData(sg) - - fanMapper = vtkPolyDataMapper() - fanMapper.SetInputConnection(fanComp.GetOutputPort()) - fanMapper.SetLookupTable(lut) - fanMapper.SetScalarRange(sg.GetScalarRange()) - - fanActor = vtkActor() - - fanActor.SetMapper(fanMapper) - fanActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # streamers - # - # spherical seed points - rake = vtkPointSource() - rake.SetCenter(-0.74, 0, 0.3) - rake.SetNumberOfPoints(10) - - # a line of seed points - seedsComp = vtkStructuredGridGeometryFilter() - seedsComp.SetExtent(10, 10, 37, 39, 1, 35) - seedsComp.SetInputData(sg) - - streamers = vtkStreamTracer() - streamers.SetInputConnection(pl3d.GetOutputPort()) - - # streamers SetSource [rake GetOutput] - streamers.SetSourceConnection(seedsComp.GetOutputPort()) - streamers.SetMaximumPropagation(250) - streamers.SetInitialIntegrationStep(.2) - streamers.SetMinimumIntegrationStep(.01) - streamers.SetIntegratorType(2) - streamers.Update() - - tubes = vtkTubeFilter() - tubes.SetInputConnection(streamers.GetOutputPort()) - tubes.SetNumberOfSides(8) - tubes.SetRadius(0.08) - tubes.SetVaryRadius(0) - - mapTubes = vtkPolyDataMapper() - - mapTubes.SetInputConnection(tubes.GetOutputPort()) - mapTubes.SetScalarRange(sg.GetScalarRange()) - - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - # outline - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # Create graphics stuff. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - ren1.AddActor(floorActor) - ren1.AddActor(subFloorActor) - ren1.AddActor(subFloor2Actor) - ren1.AddActor(postActor) - ren1.AddActor(fanActor) - ren1.AddActor(tubesActor) - - aCam = vtkCamera() - aCam.SetFocalPoint(0.00657892, 0, 2.41026) - aCam.SetPosition(-1.94838, -47.1275, 39.4607) - aCam.SetViewUp(0.00653193, 0.617865, 0.786257) - ren1.ResetCamera() - aCam.Dolly(1.) - aCam.SetClippingRange(1, 100) - - ren1.SetBackground(colors.GetColor3d('SlateGray')) - ren1.SetActiveCamera(aCam) - renWin.SetSize(640, 480) - renWin.SetWindowName('LOxGrid') - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'LOx post CFD case study.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('xyz_file', help='postxyz.bin.') - parser.add_argument('q_file', help='postq.bin.') - args = parser.parse_args() - return args.xyz_file, args.q_file - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/LOxSeeds.py b/data/examples/VisualizationAlgorithms/LOxSeeds.py deleted file mode 100755 index a6d1777..0000000 --- a/data/examples/VisualizationAlgorithms/LOxSeeds.py +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import vtkTubeFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) - pl3d.Update() - - sg = pl3d.GetOutput().GetBlock(0) - - # blue to red lut - # - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - seeds = [[-0.74, 0.0, 0.3], [-0.74, 0.0, 1.0], [-0.74, 0.0, 2.0], [-0.74, 0.0, 3.0]] - - renderers = list() - - for s in range(0, len(seeds)): - # computational planes - floorComp = vtkStructuredGridGeometryFilter() - floorComp.SetExtent(0, 37, 0, 75, 0, 0) - floorComp.SetInputData(sg) - floorComp.Update() - - floorMapper = vtkPolyDataMapper() - floorMapper.SetInputConnection(floorComp.GetOutputPort()) - floorMapper.ScalarVisibilityOff() - floorMapper.SetLookupTable(lut) - - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Black')) - floorActor.GetProperty().SetLineWidth(2) - - postComp = vtkStructuredGridGeometryFilter() - postComp.SetExtent(10, 10, 0, 75, 0, 37) - postComp.SetInputData(sg) - - postMapper = vtkPolyDataMapper() - postMapper.SetInputConnection(postComp.GetOutputPort()) - postMapper.SetLookupTable(lut) - postMapper.SetScalarRange(sg.GetScalarRange()) - - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # streamers - # - # spherical seed points - rake = vtkPointSource() - rake.SetCenter(seeds[s]) - rake.SetNumberOfPoints(10) - - streamers = vtkStreamTracer() - streamers.SetInputConnection(pl3d.GetOutputPort()) - - # streamers SetSource [rake GetOutput] - streamers.SetSourceConnection(rake.GetOutputPort()) - streamers.SetMaximumPropagation(250) - streamers.SetInitialIntegrationStep(.2) - streamers.SetMinimumIntegrationStep(.01) - streamers.SetIntegratorType(2) - streamers.Update() - - tubes = vtkTubeFilter() - tubes.SetInputConnection(streamers.GetOutputPort()) - tubes.SetNumberOfSides(8) - tubes.SetRadius(0.08) - tubes.SetVaryRadius(0) - - mapTubes = vtkPolyDataMapper() - - mapTubes.SetInputConnection(tubes.GetOutputPort()) - mapTubes.SetScalarRange(sg.GetScalarRange()) - - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - renderer = vtkRenderer() - - renderer.AddActor(floorActor) - renderer.AddActor(postActor) - renderer.AddActor(tubesActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderers.append(renderer) - - renderWindow = vtkRenderWindow() - - # Setup viewports for the renderers - rendererSize = 256 - xGridDimensions = 2 - yGridDimensions = 2 - renderWindow.SetSize(rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(xGridDimensions): - index = row * xGridDimensions + col - # (xmin, ymin, xmax, ymax) - viewport = [float(col) / xGridDimensions, float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, float(yGridDimensions - row) / yGridDimensions] - renderers[index].SetViewport(viewport) - - camera = vtkCamera() - camera.SetFocalPoint(0.918037, -0.0779233, 2.69513) - camera.SetPosition(0.840735, -23.6176, 8.50211) - camera.SetViewUp(0.00227904, 0.239501, 0.970893) - camera.SetClippingRange(1, 100) - - renderers[0].SetActiveCamera(camera) - for r in range(0, len(renderers)): - renderWindow.AddRenderer(renderers[r]) - if r > 0: - renderers[r].SetActiveCamera(camera) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.SetSize(512, 512) - renderWindow.SetWindowName('LOxSeeds') - - renderWindow.Render() - interactor.Start() - - -def get_program_parameters(): - import argparse - description = 'Streamlines seeded with spherical cloud of points. Four separate cloud positions are shown.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('xyz_file', help='postxyz.bin.') - parser.add_argument('q_file', help='postq.bin.') - args = parser.parse_args() - return args.xyz_file, args.q_file - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/MarchingCases.md b/data/examples/VisualizationAlgorithms/MarchingCases.md deleted file mode 100644 index 1aa3bc3..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCases.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example will help you understand the [Marching Cubes Algorithm](http://marchingcubes.org/images/f/f9/MarchingCubes.pdf). The example takes one optional argument, a case number. There are 15 Marching Cubes cases, 0-14. There are also 15 complementary cases where the inside/outside value is flipped. To see a complementary case, supply a negative case number. For example, -7 is the complementary case of 7. - -!!! note - According to the [ACM Digital Library](http://dl.acm.org/sig.cfm?id=SP932), the Marching Cubes paper is the most cited Siggraph paper. diff --git a/data/examples/VisualizationAlgorithms/MarchingCases.py b/data/examples/VisualizationAlgorithms/MarchingCases.py deleted file mode 100755 index b6ba5fc..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCases.py +++ /dev/null @@ -1,606 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkIdList, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkUnstructuredGrid -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkGlyph3D, - vtkThresholdPoints, - vtkTubeFilter -) - -# vtkExtractEdges moved from vtkFiltersExtraction to vtkFiltersCore in -# VTK commit d9981b9aeb93b42d1371c6e295d76bfdc18430bd -try: - from vtkmodules.vtkFiltersCore import vtkExtractEdges -except ImportError: - from vtkmodules.vtkFiltersExtraction import vtkExtractEdges -from vtkmodules.vtkFiltersGeneral import ( - vtkShrinkPolyData, - vtkTransformPolyDataFilter -) -from vtkmodules.vtkFiltersSources import ( - vtkCubeSource, - vtkSphereSource -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - mc_cases, rotation, label = get_program_parameters() - if not mc_cases: - mc_cases = [7] - else: - # Ensure that they are unique. - mc_cases = list(set(mc_cases)) - # Check that they lie in the correct range. - badCases = [] - for item in mc_cases: - if abs(int(item) > 14): - badCases.append(item) - if badCases: - print('Bad case number(s)', ','.join(map(str, badCases))) - for item in badCases: - mc_cases.remove(item) - if not mc_cases: - print('No cases.') - return - marching_cubes(mc_cases, rotation, label) - - -def get_program_parameters(): - import argparse - description = 'Marching cubes cases for 3D isosurface generation.' - epilogue = ''' - Marching cubes cases for 3D isosurface generation. - The 256 possible cases have been reduced to 15 cases using symmetry. - Dark vertices are greater than the selected isosurface value. - - For the cases, enter them as integers separated by a space e.g: 1 2 3 - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('cases', nargs='*', type=int, default=[], - help='A list of integers i such that 0 <= abs(i) < 14, corresponding to the cases desired.') - parser.add_argument('-r', '--rotation', type=int, default=0, - help='Rotate camera around the cube, for i such that 0 <= abs(i) < 4,\ - corresponding to 0, 90, 180, 270 degrees.') - # Use a mutually exclusive group. - label_parser = parser.add_mutually_exclusive_group(required=False) - label_parser.add_argument('-l', '--label', action='store_true', dest='label', - help='Display a label, true by default.') - label_parser.add_argument('-n', '--no_label', action='store_false', dest='label', - help='Supress diaplaying a label.') - parser.set_defaults(label=True) - args = parser.parse_args() - return args.cases, args.rotation, args.label - - -def marching_cubes(mcCases, rotation=0, label=True): - color = vtkNamedColors() - - # Rotate the final figure 0, 90, 180, 270 degrees. - rotation = abs(int(rotation)) - if rotation > 3: - rotation = 0 - - if len(mcCases) > 1: - print('Cases', ', '.join(map(str, mcCases))) - else: - print('Cases', ','.join(map(str, mcCases))) - print('Rotated', rotation * 90, 'degrees.') - - renWin = vtkRenderWindow() - renWin.SetSize(640, 480) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Always use a grid of four columns unless number of cases < 4. - renderers = list() - gridSize = ((len(mcCases) + 3) // 4) * 4 - if len(mcCases) < 4: - gridSize = len(mcCases) - for i in range(0, gridSize): - # Create the Renderer - renderer = vtkRenderer() - renderers.append(renderer) - # Set the background color. - renderers[i].SetBackground(color.GetColor3d('slate_grey')) - renWin.AddRenderer(renderer) - - for i in range(0, len(mcCases)): - # Define a Single Cube - Scalars = vtkFloatArray() - Scalars.InsertNextValue(1.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(1.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(0.0) - - Points = vtkPoints() - Points.InsertNextPoint(0, 0, 0) - Points.InsertNextPoint(1, 0, 0) - Points.InsertNextPoint(1, 1, 0) - Points.InsertNextPoint(0, 1, 0) - Points.InsertNextPoint(0, 0, 1) - Points.InsertNextPoint(1, 0, 1) - Points.InsertNextPoint(1, 1, 1) - Points.InsertNextPoint(0, 1, 1) - - Ids = vtkIdList() - Ids.InsertNextId(0) - Ids.InsertNextId(1) - Ids.InsertNextId(2) - Ids.InsertNextId(3) - Ids.InsertNextId(4) - Ids.InsertNextId(5) - Ids.InsertNextId(6) - Ids.InsertNextId(7) - - Grid = vtkUnstructuredGrid() - Grid.Allocate(10, 10) - Grid.InsertNextCell(12, Ids) - Grid.SetPoints(Points) - Grid.GetPointData().SetScalars(Scalars) - - # Find the triangles that lie along the 0.5 contour in this cube. - Marching = vtkContourFilter() - Marching.SetInputData(Grid) - Marching.SetValue(0, 0.5) - Marching.Update() - - # Extract the edges of the triangles just found. - triangleEdges = vtkExtractEdges() - triangleEdges.SetInputConnection(Marching.GetOutputPort()) - - # Draw the edges as tubes instead of lines. Also create the associated - # mapper and actor to display the tubes. - triangleEdgeTubes = vtkTubeFilter() - triangleEdgeTubes.SetInputConnection(triangleEdges.GetOutputPort()) - triangleEdgeTubes.SetRadius(.005) - triangleEdgeTubes.SetNumberOfSides(6) - triangleEdgeTubes.UseDefaultNormalOn() - triangleEdgeTubes.SetDefaultNormal(.577, .577, .577) - - triangleEdgeMapper = vtkPolyDataMapper() - triangleEdgeMapper.SetInputConnection(triangleEdgeTubes.GetOutputPort()) - triangleEdgeMapper.ScalarVisibilityOff() - - triangleEdgeActor = vtkActor() - triangleEdgeActor.SetMapper(triangleEdgeMapper) - triangleEdgeActor.GetProperty().SetDiffuseColor( - color.GetColor3d('lamp_black')) - triangleEdgeActor.GetProperty().SetSpecular(.4) - triangleEdgeActor.GetProperty().SetSpecularPower(10) - - # Shrink the triangles we found earlier. Create the associated mapper - # and actor. Set the opacity of the shrunken triangles. - aShrinker = vtkShrinkPolyData() - aShrinker.SetShrinkFactor(1) - aShrinker.SetInputConnection(Marching.GetOutputPort()) - - aMapper = vtkPolyDataMapper() - aMapper.ScalarVisibilityOff() - aMapper.SetInputConnection(aShrinker.GetOutputPort()) - - Triangles = vtkActor() - Triangles.SetMapper(aMapper) - Triangles.GetProperty().SetDiffuseColor( - color.GetColor3d('banana')) - Triangles.GetProperty().SetOpacity(.6) - - # Draw a cube the same size and at the same position as the one - # created previously. Extract the edges because we only want to see - # the outline of the cube. Pass the edges through a vtkTubeFilter so - # they are displayed as tubes rather than lines. - CubeModel = vtkCubeSource() - CubeModel.SetCenter(.5, .5, .5) - - Edges = vtkExtractEdges() - Edges.SetInputConnection(CubeModel.GetOutputPort()) - - Tubes = vtkTubeFilter() - Tubes.SetInputConnection(Edges.GetOutputPort()) - Tubes.SetRadius(.01) - Tubes.SetNumberOfSides(6) - Tubes.UseDefaultNormalOn() - Tubes.SetDefaultNormal(.577, .577, .577) - # Create the mapper and actor to display the cube edges. - TubeMapper = vtkPolyDataMapper() - TubeMapper.SetInputConnection(Tubes.GetOutputPort()) - CubeEdges = vtkActor() - CubeEdges.SetMapper(TubeMapper) - CubeEdges.GetProperty().SetDiffuseColor( - color.GetColor3d('khaki')) - CubeEdges.GetProperty().SetSpecular(.4) - CubeEdges.GetProperty().SetSpecularPower(10) - - # Create a sphere to use as a glyph source for vtkGlyph3D. - Sphere = vtkSphereSource() - Sphere.SetRadius(0.04) - Sphere.SetPhiResolution(20) - Sphere.SetThetaResolution(20) - # Remove the part of the cube with data values below 0.5. - ThresholdIn = vtkThresholdPoints() - ThresholdIn.SetInputData(Grid) - ThresholdIn.ThresholdByUpper(.5) - # Display spheres at the vertices remaining in the cube data set after - # it was passed through vtkThresholdPoints. - Vertices = vtkGlyph3D() - Vertices.SetInputConnection(ThresholdIn.GetOutputPort()) - Vertices.SetSourceConnection(Sphere.GetOutputPort()) - # Create a mapper and actor to display the glyphs. - SphereMapper = vtkPolyDataMapper() - SphereMapper.SetInputConnection(Vertices.GetOutputPort()) - SphereMapper.ScalarVisibilityOff() - - CubeVertices = vtkActor() - CubeVertices.SetMapper(SphereMapper) - CubeVertices.GetProperty().SetDiffuseColor( - color.GetColor3d('tomato')) - - # Define the text for the label - caseLabel = vtkVectorText() - caseLabel.SetText('Case 1') - - if label: - # Set up a transform to move the label to a new position. - aLabelTransform = vtkTransform() - aLabelTransform.Identity() - # Position the label according to the rotation of the figure. - if rotation == 0: - aLabelTransform.Translate(-0.2, 0, 1.25) - aLabelTransform.Scale(.05, .05, .05) - elif rotation == 1: - aLabelTransform.RotateY(90) - aLabelTransform.Translate(-1.25, 0, 1.25) - aLabelTransform.Scale(.05, .05, .05) - elif rotation == 2: - aLabelTransform.RotateY(180) - aLabelTransform.Translate(-1.25, 0, 0.2) - aLabelTransform.Scale(.05, .05, .05) - else: - aLabelTransform.RotateY(270) - aLabelTransform.Translate(-0.2, 0, 0.2) - aLabelTransform.Scale(.05, .05, .05) - - # Move the label to a new position. - labelTransform = vtkTransformPolyDataFilter() - labelTransform.SetTransform(aLabelTransform) - labelTransform.SetInputConnection(caseLabel.GetOutputPort()) - - # Create a mapper and actor to display the text. - labelMapper = vtkPolyDataMapper() - labelMapper.SetInputConnection(labelTransform.GetOutputPort()) - - labelActor = vtkActor() - labelActor.SetMapper(labelMapper) - - # Define the base that the cube sits on. Create its associated mapper - # and actor. Set the position of the actor. - baseModel = vtkCubeSource() - baseModel.SetXLength(1.5) - baseModel.SetYLength(.01) - baseModel.SetZLength(1.5) - - baseMapper = vtkPolyDataMapper() - baseMapper.SetInputConnection(baseModel.GetOutputPort()) - - base = vtkActor() - base.SetMapper(baseMapper) - base.SetPosition(.5, -0.09, .5) - - # Set the scalar values for this case of marching cubes. - # A negative case number will generate a complementary case - mcCase = mcCases[i] - if mcCase < 0: - cases[-mcCase](Scalars, caseLabel, 0, 1) - else: - cases[mcCase](Scalars, caseLabel, 1, 0) - # Force the grid to update. - Grid.Modified() - - # Add the actors to the renderer - renderers[i].AddActor(triangleEdgeActor) - renderers[i].AddActor(base) - if label: - renderers[i].AddActor(labelActor) - renderers[i].AddActor(CubeEdges) - renderers[i].AddActor(CubeVertices) - renderers[i].AddActor(Triangles) - - # Position the camera. - renderers[i].GetActiveCamera().Dolly(1.2) - # Rotate the camera an extra 30 degrees so the cube is not face on. - if rotation == 0: - renderers[i].GetActiveCamera().Azimuth(30) - elif rotation == 1: - renderers[i].GetActiveCamera().Azimuth(30 + 90) - elif rotation == 2: - renderers[i].GetActiveCamera().Azimuth(30 + 180) - else: - renderers[i].GetActiveCamera().Azimuth(30 + 270) - - renderers[i].GetActiveCamera().Elevation(20) - renderers[i].ResetCamera() - renderers[i].ResetCameraClippingRange() - if i > 0: - renderers[i].SetActiveCamera(renderers[0].GetActiveCamera()) - - # Setup viewports for the renderers - rendererSize = 300 - xGridDimensions = 4 - if len(mcCases) < 4: - xGridDimensions = len(mcCases) - yGridDimensions = (len(mcCases) - 1) // 4 + 1 - print('Grid dimensions, (x, y): ({:d}, {:d})'.format(xGridDimensions, yGridDimensions)) - renWin.SetSize( - rendererSize * xGridDimensions, rendererSize * yGridDimensions) - renWin.SetWindowName('MarchingCases') - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): - index = row * xGridDimensions + col - - # (xmin, ymin, xmax, ymax) - viewport = [ - float(col) / xGridDimensions, - float(yGridDimensions - (row + 1)) / yGridDimensions, - float(col + 1) / xGridDimensions, - float(yGridDimensions - row) / yGridDimensions] - - renderers[index].SetViewport(viewport) - - iren.Initialize() - renWin.Render() - iren.Start() - - -def case0(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 0 - 00000000') - else: - caseLabel.SetText('Case 0c - 11111111') - - -def case1(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 1 - 00000001') - else: - caseLabel.SetText('Case 1c - 11111110') - - -def case2(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 2 - 00000011') - else: - caseLabel.SetText('Case 2c - 11111100') - - -def case3(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, IN) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 3 - 00000101') - else: - caseLabel.SetText('Case 3c - 11111010') - - -def case4(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 4 - 01000001') - else: - caseLabel.SetText('Case 4c - 10111110') - - -def case5(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 5 - 00110010') - else: - caseLabel.SetText('Case 5c - 11001101') - - -def case6(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 6 - 00011010') - else: - caseLabel.SetText('Case 6c - 11100101') - - -def case7(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 7 - 01000011') - else: - caseLabel.SetText('Case 7c - 10111100') - - -def case8(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 8 - 00110011') - else: - caseLabel.SetText('Case 8c - 11001100') - - -def case9(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, IN) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 9 - 01001110') - else: - caseLabel.SetText('Case 9c - 10110001') - - -def case10(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 10 - 01101001') - else: - caseLabel.SetText('Case 10c - 10010110') - - -def case11(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, OUT) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 11 - 01110001') - else: - caseLabel.SetText('Case 11c - 10001110') - - -def case12(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, OUT) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 12 - 00111010') - else: - caseLabel.SetText('Case 12c - 11000101') - - -def case13(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, OUT) - scalars.InsertValue(1, IN) - scalars.InsertValue(2, OUT) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, IN) - scalars.InsertValue(5, OUT) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, OUT) - if IN == 1: - caseLabel.SetText('Case 13 - 01011010') - else: - caseLabel.SetText('Case 13c - 10100101') - - -def case14(scalars, caseLabel, IN, OUT): - scalars.InsertValue(0, IN) - scalars.InsertValue(1, OUT) - scalars.InsertValue(2, IN) - scalars.InsertValue(3, IN) - scalars.InsertValue(4, OUT) - scalars.InsertValue(5, IN) - scalars.InsertValue(6, IN) - scalars.InsertValue(7, IN) - if IN == 1: - caseLabel.SetText('Case 14 - 11101101') - else: - caseLabel.SetText('Case 14c - 00010010') - - -cases = [case0, case1, case2, case3, case4, case5, case6, case7, case8, case9, case10, case11, case12, case13, case14] - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/MarchingCasesA.py b/data/examples/VisualizationAlgorithms/MarchingCasesA.py deleted file mode 100755 index 3b6e388..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCasesA.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python - -""" -Marching cubes cases for 3D isosurface generation. -The 256 possible cases have been reduced to 15 cases using symmetry. -Dark vertices are greater than the selected isosurface value. - -Note: Make sure MarchingCases.py is in the same directory as this program. -""" - -import MarchingCases - - -def main(): - mc_cases = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - MarchingCases.marching_cubes(mc_cases) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/MarchingCasesB.py b/data/examples/VisualizationAlgorithms/MarchingCasesB.py deleted file mode 100755 index 3986e7b..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCasesB.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python - -""" -Marching cubes complementary cases. - -Cases 3c, 6c, 7c, 10c, 12c and 13c are displayed. - -Note: Make sure MarchingCases.py is in the same directory as this program. -""" - -import MarchingCases - - -def main(): - mc_cases = [-3, -6, -7, -10, -12, -13] - MarchingCases.marching_cubes(mc_cases) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/MarchingCasesC.py b/data/examples/VisualizationAlgorithms/MarchingCasesC.py deleted file mode 100755 index fd5a02e..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCasesC.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -""" -Marching cubes cases. - -Case 3 is rotated 90 degrees about the y-axis with no label. - -Note: Make sure MarchingCases.py is in the same directory as this program. -""" - -import MarchingCases - - -def main(): - mc_cases = [3] - rotation = 1 - label = False - MarchingCases.marching_cubes(mc_cases, rotation, label) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/MarchingCasesD.py b/data/examples/VisualizationAlgorithms/MarchingCasesD.py deleted file mode 100755 index 2111411..0000000 --- a/data/examples/VisualizationAlgorithms/MarchingCasesD.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -""" -Marching cubes cases. - -Case 7 is rotated 180 degrees about the y-axis with no label. - -Note: Make sure MarchingCases.py is in the same directory as this program. -""" - -import MarchingCases - - -def main(): - mc_cases = [7] - rotation = 2 - label = False - MarchingCases.marching_cubes(mc_cases, rotation, label) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/Motor.md b/data/examples/VisualizationAlgorithms/Motor.md deleted file mode 100644 index ff8584c..0000000 --- a/data/examples/VisualizationAlgorithms/Motor.md +++ /dev/null @@ -1,10 +0,0 @@ -### Description - -This is an example of texture clipping using a transparent texture map. The motor shown consists of five complex parts, some of which are hidden by the outer casing. To see the inside of the motor, we define an implicit clipping function. This function is simply the intersection of two planes to form a clipping "corner". The object **vtkImplicitTextureCoords** is used in combination with this implicit function to generate texture coordinates. These objects are then rendered with the appropriate texture map and the internal parts of the motor can be seen. - -The texture map consists of three regions (as described previously in the chapter). The concealed region is transparent. The transition region is opaque but with a black (zero intensity) color. The highlighted region is full intensity and opaque. As can be seen from the result , the boundaries appear as black borders giving a nice visual effect. - -Note the use of vectors in the C++ version and lists in the Python version to reduce repetitious code. - -!!! info - See [Figure 9-53](../../../VTKBook/09Chapter9/#Figure%209-53) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/Motor.py b/data/examples/VisualizationAlgorithms/Motor.py deleted file mode 100755 index 0211f2e..0000000 --- a/data/examples/VisualizationAlgorithms/Motor.py +++ /dev/null @@ -1,137 +0,0 @@ -#!/usr/bin/env python - -# This code is based on the VTK file: /IO/Geometry/Testing/Python/motor.py. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkFloatArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import vtkPlanes -from vtkmodules.vtkFiltersCore import vtkPolyDataNormals -from vtkmodules.vtkFiltersTexture import vtkImplicitTextureCoords -from vtkmodules.vtkIOGeometry import vtkBYUReader -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTexture -) - - -def main(): - colors = vtkNamedColors() - - textureFile, motorFile = get_program_parameters() - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the cutting planes. - planes = vtkPlanes() - points = vtkPoints() - norms = vtkFloatArray() - - norms.SetNumberOfComponents(3) - points.InsertPoint(0, 0.0, 0.0, 0.0) - norms.InsertTuple3(0, 0.0, 0.0, 1.0) - points.InsertPoint(1, 0.0, 0.0, 0.0) - norms.InsertTuple3(1, -1.0, 0.0, 0.0) - planes.SetPoints(points) - planes.SetNormals(norms) - - # Get the texture. - texReader = vtkStructuredPointsReader() - texReader.SetFileName(textureFile) - texture = vtkTexture() - texture.SetInputConnection(texReader.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - - # Set up the pipelines for the parts of the motor. - # We will use lists of pipeline objects. - numberOfParts = 5 - byu = list() - normals = list() - tex = list() - byuMapper = list() - byuActor = list() - partColours = ['cold_grey', 'peacock', 'raw_sienna', 'banana', 'peach_puff'] - # Use this to control which parts to display. - displayParts = [True] * numberOfParts - # If displayParts[2] = False then an image like that in the VTK tests is produced. - - # Build the pipelines. - for i in range(0, numberOfParts): - byu.append(vtkBYUReader()) - byu[i].SetGeometryFileName(motorFile) - byu[i].SetPartNumber(i + 1) - - normals.append(vtkPolyDataNormals()) - normals[i].SetInputConnection(byu[i].GetOutputPort()) - - tex.append(vtkImplicitTextureCoords()) - tex[i].SetInputConnection(normals[i].GetOutputPort()) - tex[i].SetRFunction(planes) - # tex[i].FlipTextureOn() - - byuMapper.append(vtkDataSetMapper()) - byuMapper[i].SetInputConnection(tex[i].GetOutputPort()) - - byuActor.append(vtkActor()) - byuActor[i].SetMapper(byuMapper[i]) - byuActor[i].SetTexture(texture) - byuActor[i].GetProperty().SetColor(colors.GetColor3d(partColours[i])) - - ren.AddActor(byuActor[i]) - if displayParts[i]: - byuActor[i].VisibilityOn() - else: - byuActor[i].VisibilityOff() - - ren.SetBackground(colors.GetColor3d('AliceBlue')) - - renWin.SetSize(512, 512) - renWin.SetWindowName('Motor') - - camera = vtkCamera() - camera.SetFocalPoint(0.0286334, 0.0362996, 0.0379685) - camera.SetPosition(1.37067, 1.08629, -1.30349) - camera.SetViewAngle(17.673) - camera.SetClippingRange(1, 10) - camera.SetViewUp(-0.376306, -0.5085, -0.774482) - ren.SetActiveCamera(camera) - - # Render the image. - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Texture clipping using a transparent texture map.' - epilogue = ''' - Texture clipping using a transparent texture map. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('textureFile', help='The texture file: texThres2.vtk') - parser.add_argument('motorFile', help='The motor file: motor.g.') - args = parser.parse_args() - return args.textureFile, args.motorFile - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/Office.md b/data/examples/VisualizationAlgorithms/Office.md deleted file mode 100644 index 50db75b..0000000 --- a/data/examples/VisualizationAlgorithms/Office.md +++ /dev/null @@ -1,21 +0,0 @@ - -### Description - -Using random point seeds to create streamlines. - -This example demonstrates the use of vtkPointSource to generate streamlines. -The dataset is a structured grid representation of a CFD simulation of flow in a small office with flow velocity and a scalar pressure field. -As this picture shows, there are a couple of bookcases, desks, a window, and an inlet and outlet for the ventilation system. -On one of the desks is a small, intense heat source (e.g., a cigarette). - -We generate 25 streamlines that are started near the inlet using a vtkPointSource point generator. -By adjusting a single parameter (e.g., the center of the point source) it is possible to quickly explore our simulation data. - -This program provides you with an optional parameter to select from one of several point source centers. The figure was created using: - -``` c++ -./Office office.vtk 3 -``` - -!!! info - See [Figure 9-47](../../../VTKBook/09Chapter9/#Figure%209-47) in [Chapter 9](../../../VTKBook/09Chapter9) in the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/Office.py b/data/examples/VisualizationAlgorithms/Office.py deleted file mode 100755 index ac0d916..0000000 --- a/data/examples/VisualizationAlgorithms/Office.py +++ /dev/null @@ -1,347 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkFiltersSources import vtkPointSource -from vtkmodules.vtkIOLegacy import vtkDataSetReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def office(fileName, center): - # These are the centers for the streamline seed. - seedCenters = [ - [0.0, 2.1, 0.5], - [0.1, 2.1, 0.5], - [0.1, 2.7, 0.5], - [0.08, 2.7, 0.5] - ] - center = abs(center) - if center >= len(seedCenters): - center = len(seedCenters) - 1 - - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] - colors.SetColor('TableTop', *tableTopColor) - colors.SetColor('FilingCabinet', *filingCabinetColor) - colors.SetColor('BookShelf', *bookShelfColor) - colors.SetColor('WindowColor', *windowColor) - - # We read a data file that represents a CFD analysis of airflow in an office - # (with ventilation and a burning cigarette). - reader = vtkDataSetReader() - reader.SetFileName(fileName) - - # Create the scene. - # We generate a whole bunch of planes which correspond to - # the geometry in the analysis; tables, bookshelves and so on. - table1 = vtkStructuredGridGeometryFilter() - table1.SetInputData(reader.GetStructuredGridOutput()) - table1.SetExtent(11, 15, 7, 9, 8, 8) - mapTable1 = vtkPolyDataMapper() - mapTable1.SetInputConnection(table1.GetOutputPort()) - mapTable1.ScalarVisibilityOff() - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) - table2.SetExtent(11, 15, 10, 12, 8, 8) - mapTable2 = vtkPolyDataMapper() - mapTable2.SetInputConnection(table2.GetOutputPort()) - mapTable2.ScalarVisibilityOff() - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet1.SetExtent(15, 15, 7, 9, 0, 8) - mapFilingCabinet1 = vtkPolyDataMapper() - mapFilingCabinet1.SetInputConnection(FilingCabinet1.GetOutputPort()) - mapFilingCabinet1.ScalarVisibilityOff() - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet2.SetExtent(15, 15, 10, 12, 0, 8) - mapFilingCabinet2 = vtkPolyDataMapper() - mapFilingCabinet2.SetInputConnection(FilingCabinet2.GetOutputPort()) - mapFilingCabinet2.ScalarVisibilityOff() - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Top.SetExtent(13, 13, 0, 4, 0, 11) - mapBookshelf1Top = vtkPolyDataMapper() - mapBookshelf1Top.SetInputConnection(bookshelf1Top.GetOutputPort()) - mapBookshelf1Top.ScalarVisibilityOff() - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Bottom.SetExtent(20, 20, 0, 4, 0, 11) - mapBookshelf1Bottom = vtkPolyDataMapper() - mapBookshelf1Bottom.SetInputConnection(bookshelf1Bottom.GetOutputPort()) - mapBookshelf1Bottom.ScalarVisibilityOff() - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Front.SetExtent(13, 20, 0, 0, 0, 11) - mapBookshelf1Front = vtkPolyDataMapper() - mapBookshelf1Front.SetInputConnection(bookshelf1Front.GetOutputPort()) - mapBookshelf1Front.ScalarVisibilityOff() - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Back.SetExtent(13, 20, 4, 4, 0, 11) - mapBookshelf1Back = vtkPolyDataMapper() - mapBookshelf1Back.SetInputConnection(bookshelf1Back.GetOutputPort()) - mapBookshelf1Back.ScalarVisibilityOff() - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1LHS.SetExtent(13, 20, 0, 4, 0, 0) - mapBookshelf1LHS = vtkPolyDataMapper() - mapBookshelf1LHS.SetInputConnection(bookshelf1LHS.GetOutputPort()) - mapBookshelf1LHS.ScalarVisibilityOff() - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1RHS.SetExtent(13, 20, 0, 4, 11, 11) - mapBookshelf1RHS = vtkPolyDataMapper() - mapBookshelf1RHS.SetInputConnection(bookshelf1RHS.GetOutputPort()) - mapBookshelf1RHS.ScalarVisibilityOff() - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Top.SetExtent(13, 13, 15, 19, 0, 11) - mapBookshelf2Top = vtkPolyDataMapper() - mapBookshelf2Top.SetInputConnection(bookshelf2Top.GetOutputPort()) - mapBookshelf2Top.ScalarVisibilityOff() - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Bottom.SetExtent(20, 20, 15, 19, 0, 11) - mapBookshelf2Bottom = vtkPolyDataMapper() - mapBookshelf2Bottom.SetInputConnection(bookshelf2Bottom.GetOutputPort()) - mapBookshelf2Bottom.ScalarVisibilityOff() - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Front.SetExtent(13, 20, 15, 15, 0, 11) - mapBookshelf2Front = vtkPolyDataMapper() - mapBookshelf2Front.SetInputConnection(bookshelf2Front.GetOutputPort()) - mapBookshelf2Front.ScalarVisibilityOff() - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Back.SetExtent(13, 20, 19, 19, 0, 11) - mapBookshelf2Back = vtkPolyDataMapper() - mapBookshelf2Back.SetInputConnection(bookshelf2Back.GetOutputPort()) - mapBookshelf2Back.ScalarVisibilityOff() - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2LHS.SetExtent(13, 20, 15, 19, 0, 0) - mapBookshelf2LHS = vtkPolyDataMapper() - mapBookshelf2LHS.SetInputConnection(bookshelf2LHS.GetOutputPort()) - mapBookshelf2LHS.ScalarVisibilityOff() - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2RHS.SetExtent(13, 20, 15, 19, 11, 11) - mapBookshelf2RHS = vtkPolyDataMapper() - mapBookshelf2RHS.SetInputConnection(bookshelf2RHS.GetOutputPort()) - mapBookshelf2RHS.ScalarVisibilityOff() - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) - window.SetExtent(20, 20, 6, 13, 10, 13) - mapWindow = vtkPolyDataMapper() - mapWindow.SetInputConnection(window.GetOutputPort()) - mapWindow.ScalarVisibilityOff() - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) - outlet.SetExtent(0, 0, 9, 10, 14, 16) - mapOutlet = vtkPolyDataMapper() - mapOutlet.SetInputConnection(outlet.GetOutputPort()) - mapOutlet.ScalarVisibilityOff() - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) - inlet.SetExtent(0, 0, 9, 10, 0, 6) - mapInlet = vtkPolyDataMapper() - mapInlet.SetInputConnection(inlet.GetOutputPort()) - mapInlet.ScalarVisibilityOff() - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) - mapOutline = vtkPolyDataMapper() - mapOutline.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the source for the streamtubes. - seeds = vtkPointSource() - seeds.SetRadius(0.075) - seeds.SetCenter(seedCenters[center]) - seeds.SetNumberOfPoints(25) - streamers = vtkStreamTracer() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(seeds.GetOutputPort()) - streamers.SetMaximumPropagation(500) - streamers.SetMinimumIntegrationStep(0.1) - streamers.SetMaximumIntegrationStep(1.0) - streamers.SetInitialIntegrationStep(0.2) - streamers.SetIntegratorType(2) - streamers.Update() - mapStreamers = vtkPolyDataMapper() - mapStreamers.SetInputConnection(streamers.GetOutputPort()) - mapStreamers.SetScalarRange(reader.GetOutput().GetPointData().GetScalars().GetRange()) - streamersActor = vtkActor() - streamersActor.SetMapper(mapStreamers) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('Office') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the remaining actors to the renderer, set the background and size. - ren.AddActor(table1Actor) - ren.AddActor(table2Actor) - ren.AddActor(FilingCabinet1Actor) - ren.AddActor(FilingCabinet2Actor) - ren.AddActor(bookshelf1TopActor) - ren.AddActor(bookshelf1BottomActor) - ren.AddActor(bookshelf1FrontActor) - ren.AddActor(bookshelf1BackActor) - ren.AddActor(bookshelf1LHSActor) - ren.AddActor(bookshelf1RHSActor) - ren.AddActor(bookshelf2TopActor) - ren.AddActor(bookshelf2BottomActor) - ren.AddActor(bookshelf2FrontActor) - ren.AddActor(bookshelf2BackActor) - ren.AddActor(bookshelf2LHSActor) - ren.AddActor(bookshelf2RHSActor) - ren.AddActor(windowActor) - ren.AddActor(outletActor) - ren.AddActor(inletActor) - ren.AddActor(outlineActor) - ren.AddActor(streamersActor) - - ren.SetBackground(colors.GetColor3d('SlateGray')) - - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) - aCamera.SetViewAngle(18.604) - aCamera.Zoom(1.2) - - ren.SetActiveCamera(aCamera) - - renWin.SetSize(640, 400) - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Demonstrate the use of vtkPointSource to generate streamlines.' - epilogue = ''' - center: An optional parameter choosing the center for the seeds. - 0 - Corresponds to Fig 9-47(a) in the VTK textbook. - 1 - A slight shift to the left. - 2 - A slight shift to the upper left (from the original code). - 3 - The default, a slight shift to the upper left. - Roughly corresponds to Fig 9-47(b) in the VTK textbook. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('fileName', help='office.binary.vtk') - parser.add_argument('center', default=3, type=int, nargs='?', help='seed center.') - args = parser.parse_args() - return args.fileName, args.center - - -def main(): - fileName, center = get_program_parameters() - office(fileName, center) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/OfficeA.py b/data/examples/VisualizationAlgorithms/OfficeA.py deleted file mode 100755 index c1df2d6..0000000 --- a/data/examples/VisualizationAlgorithms/OfficeA.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -""" -OfficeA. - -Note: Make sure Office.py is in the same directory as this program. -""" - -import Office - - -def main(): - file_name, center = Office.get_program_parameters() - center = 0 - Office.office(file_name, center) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/OfficeTube.py b/data/examples/VisualizationAlgorithms/OfficeTube.py deleted file mode 100755 index 6954847..0000000 --- a/data/examples/VisualizationAlgorithms/OfficeTube.py +++ /dev/null @@ -1,353 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkDataObject -from vtkmodules.vtkCommonMath import vtkRungeKutta4 -from vtkmodules.vtkFiltersCore import ( - vtkStructuredGridOutlineFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOLegacy import vtkDataSetReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] - colors.SetColor('TableTop', *tableTopColor) - colors.SetColor('FilingCabinet', *filingCabinetColor) - colors.SetColor('BookShelf', *bookShelfColor) - colors.SetColor('WindowColor', *windowColor) - - # We read a data file that represents a CFD analysis of airflow in an office - # (with ventilation and a burning cigarette). We force an update so that we - # can query the output for its length, i.e., the length of the diagonal - # of the bounding box. This is useful for normalizing the data. - reader = vtkDataSetReader() - reader.SetFileName(fileName) - reader.Update() - - # Now we will generate a single streamline in the data. We select the - # integration order to use (RungeKutta order 4) and associate it with - # the streamer. The start position is the position in world space where - # we want to begin streamline integration; and we integrate in both - # directions. The step length is the length of the line segments that - # make up the streamline (i.e., related to display). The - # IntegrationStepLength specifies the integration step length as a - # fraction of the cell size that the streamline is in. - integ = vtkRungeKutta4() - - streamer = vtkStreamTracer() - streamer.SetInputConnection(reader.GetOutputPort()) - streamer.SetStartPosition(0.1, 2.1, 0.5) - streamer.SetMaximumPropagation(500) - streamer.SetInitialIntegrationStep(0.05) - streamer.SetIntegrationDirectionToBoth() - streamer.SetIntegrator(integ) - - # The tube is wrapped around the generated streamline. By varying the radius - # by the inverse of vector magnitude, we are creating a tube whose radius is - # proportional to mass flux (in incompressible flow). - streamTube = vtkTubeFilter() - streamTube.SetInputConnection(streamer.GetOutputPort()) - streamTube.SetInputArrayToProcess(1, 0, 0, vtkDataObject.FIELD_ASSOCIATION_POINTS, 'vectors') - streamTube.SetRadius(0.02) - streamTube.SetNumberOfSides(12) - streamTube.SetVaryRadiusToVaryRadiusByVector() - - mapStreamTube = vtkPolyDataMapper() - mapStreamTube.SetInputConnection(streamTube.GetOutputPort()) - mapStreamTube.SetScalarRange(reader.GetOutput().GetPointData().GetScalars().GetRange()) - - streamTubeActor = vtkActor() - streamTubeActor.SetMapper(mapStreamTube) - streamTubeActor.GetProperty().BackfaceCullingOn() - - # Create the scene. - # We generate a whole bunch of planes which correspond to - # the geometry in the analysis; tables, bookshelves and so on. - table1 = vtkStructuredGridGeometryFilter() - table1.SetInputData(reader.GetStructuredGridOutput()) - table1.SetExtent(11, 15, 7, 9, 8, 8) - mapTable1 = vtkPolyDataMapper() - mapTable1.SetInputConnection(table1.GetOutputPort()) - mapTable1.ScalarVisibilityOff() - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) - table2.SetExtent(11, 15, 10, 12, 8, 8) - mapTable2 = vtkPolyDataMapper() - mapTable2.SetInputConnection(table2.GetOutputPort()) - mapTable2.ScalarVisibilityOff() - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet1.SetExtent(15, 15, 7, 9, 0, 8) - mapFilingCabinet1 = vtkPolyDataMapper() - mapFilingCabinet1.SetInputConnection(FilingCabinet1.GetOutputPort()) - mapFilingCabinet1.ScalarVisibilityOff() - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet2.SetExtent(15, 15, 10, 12, 0, 8) - mapFilingCabinet2 = vtkPolyDataMapper() - mapFilingCabinet2.SetInputConnection(FilingCabinet2.GetOutputPort()) - mapFilingCabinet2.ScalarVisibilityOff() - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Top.SetExtent(13, 13, 0, 4, 0, 11) - mapBookshelf1Top = vtkPolyDataMapper() - mapBookshelf1Top.SetInputConnection(bookshelf1Top.GetOutputPort()) - mapBookshelf1Top.ScalarVisibilityOff() - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Bottom.SetExtent(20, 20, 0, 4, 0, 11) - mapBookshelf1Bottom = vtkPolyDataMapper() - mapBookshelf1Bottom.SetInputConnection(bookshelf1Bottom.GetOutputPort()) - mapBookshelf1Bottom.ScalarVisibilityOff() - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Front.SetExtent(13, 20, 0, 0, 0, 11) - mapBookshelf1Front = vtkPolyDataMapper() - mapBookshelf1Front.SetInputConnection(bookshelf1Front.GetOutputPort()) - mapBookshelf1Front.ScalarVisibilityOff() - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Back.SetExtent(13, 20, 4, 4, 0, 11) - mapBookshelf1Back = vtkPolyDataMapper() - mapBookshelf1Back.SetInputConnection(bookshelf1Back.GetOutputPort()) - mapBookshelf1Back.ScalarVisibilityOff() - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1LHS.SetExtent(13, 20, 0, 4, 0, 0) - mapBookshelf1LHS = vtkPolyDataMapper() - mapBookshelf1LHS.SetInputConnection(bookshelf1LHS.GetOutputPort()) - mapBookshelf1LHS.ScalarVisibilityOff() - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1RHS.SetExtent(13, 20, 0, 4, 11, 11) - mapBookshelf1RHS = vtkPolyDataMapper() - mapBookshelf1RHS.SetInputConnection(bookshelf1RHS.GetOutputPort()) - mapBookshelf1RHS.ScalarVisibilityOff() - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Top.SetExtent(13, 13, 15, 19, 0, 11) - mapBookshelf2Top = vtkPolyDataMapper() - mapBookshelf2Top.SetInputConnection(bookshelf2Top.GetOutputPort()) - mapBookshelf2Top.ScalarVisibilityOff() - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Bottom.SetExtent(20, 20, 15, 19, 0, 11) - mapBookshelf2Bottom = vtkPolyDataMapper() - mapBookshelf2Bottom.SetInputConnection(bookshelf2Bottom.GetOutputPort()) - mapBookshelf2Bottom.ScalarVisibilityOff() - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Front.SetExtent(13, 20, 15, 15, 0, 11) - mapBookshelf2Front = vtkPolyDataMapper() - mapBookshelf2Front.SetInputConnection(bookshelf2Front.GetOutputPort()) - mapBookshelf2Front.ScalarVisibilityOff() - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Back.SetExtent(13, 20, 19, 19, 0, 11) - mapBookshelf2Back = vtkPolyDataMapper() - mapBookshelf2Back.SetInputConnection(bookshelf2Back.GetOutputPort()) - mapBookshelf2Back.ScalarVisibilityOff() - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2LHS.SetExtent(13, 20, 15, 19, 0, 0) - mapBookshelf2LHS = vtkPolyDataMapper() - mapBookshelf2LHS.SetInputConnection(bookshelf2LHS.GetOutputPort()) - mapBookshelf2LHS.ScalarVisibilityOff() - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2RHS.SetExtent(13, 20, 15, 19, 11, 11) - mapBookshelf2RHS = vtkPolyDataMapper() - mapBookshelf2RHS.SetInputConnection(bookshelf2RHS.GetOutputPort()) - mapBookshelf2RHS.ScalarVisibilityOff() - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) - window.SetExtent(20, 20, 6, 13, 10, 13) - mapWindow = vtkPolyDataMapper() - mapWindow.SetInputConnection(window.GetOutputPort()) - mapWindow.ScalarVisibilityOff() - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) - outlet.SetExtent(0, 0, 9, 10, 14, 16) - mapOutlet = vtkPolyDataMapper() - mapOutlet.SetInputConnection(outlet.GetOutputPort()) - mapOutlet.ScalarVisibilityOff() - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) - inlet.SetExtent(0, 0, 9, 10, 0, 6) - mapInlet = vtkPolyDataMapper() - mapInlet.SetInputConnection(inlet.GetOutputPort()) - mapInlet.ScalarVisibilityOff() - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) - mapOutline = vtkPolyDataMapper() - mapOutline.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the remaining actors to the renderer, set the background and size. - ren.AddActor(table1Actor) - ren.AddActor(table2Actor) - ren.AddActor(FilingCabinet1Actor) - ren.AddActor(FilingCabinet2Actor) - ren.AddActor(bookshelf1TopActor) - ren.AddActor(bookshelf1BottomActor) - ren.AddActor(bookshelf1FrontActor) - ren.AddActor(bookshelf1BackActor) - ren.AddActor(bookshelf1LHSActor) - ren.AddActor(bookshelf1RHSActor) - ren.AddActor(bookshelf2TopActor) - ren.AddActor(bookshelf2BottomActor) - ren.AddActor(bookshelf2FrontActor) - ren.AddActor(bookshelf2BackActor) - ren.AddActor(bookshelf2LHSActor) - ren.AddActor(bookshelf2RHSActor) - ren.AddActor(windowActor) - ren.AddActor(outletActor) - ren.AddActor(inletActor) - ren.AddActor(outlineActor) - ren.AddActor(streamTubeActor) - - ren.SetBackground(colors.GetColor3d('SlateGray')) - - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) - aCamera.SetViewAngle(18.604) - aCamera.Zoom(1.2) - - ren.SetActiveCamera(aCamera) - - renWin.SetSize(640, 400) - renWin.SetWindowName('OfficeTube') - - iren.Initialize() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'The stream polygon. Sweeping a polygon to form a tube..' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('fileName', help='office.binary.vtk') - args = parser.parse_args() - return args.fileName - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/PineRootConnectivity.md b/data/examples/VisualizationAlgorithms/PineRootConnectivity.md deleted file mode 100644 index 3eefeb8..0000000 --- a/data/examples/VisualizationAlgorithms/PineRootConnectivity.md +++ /dev/null @@ -1,26 +0,0 @@ -### Description - -Demonstrates how to apply the connectivity filter to remove noisy isosurfaces. - -To illustrate the application of connectivity analysis, we will use an MRI dataset generated by Janet MacFall at the [Center for In Vivo Microscopy](http://www.civm.duhs.duke.edu/) at Duke University. The dataset is a volume of dimensions 256^3. The data is of the root system of a small pine tree. Using the class vtkSliceCubes , an implementation of marching cubes for large volumes, we generate an initial isosurface represented by 351,536 triangles. This is a faster way of manipulating this data. If you have a large enough computer you can process the volume directly with a vtk image reader and vtkMarchingCubes. -[The example on this other page](../PineRootConnectivityA) shows the initial dataset. Notice that there are many small, disconnected isosurfaces due to noise and isolated moisture in the data. We use vtkConnectivityFilter to remove these small, disconnected surfaces. The example on this page shows the result of applying the filter. Over 50,000 triangles were removed, leaving 299,380 triangles. The vtkConnectivityFilter is a general filter taking datasets as input, and generating an unstructured grid as output. It functions by extracting cells that are connected at points (i.e., share common points). In this example the single largest surface is extracted. It is also possible to specify cell ids and point ids and extract surfaces connected to these. - -!!! info - To count the number of triangles in the polydata we do the following: - #### C++ - We use a lambda function - ``` c++ - auto NumberofTriangles = [](auto *pd) - ``` - #### Python - We just implement: - ``` python - def NumberOfTriangles(pd): - ``` - within the scope of the calling function. - -!!! cite - *Comparative Water Uptake by Roots of Different Ages in Seedlings of Loblolly Pine (Pinus taeda L.)* December 1991. New Phytologist 119(4):551 - 560. - -!!! info - See [Figure 9-51](../../../VTKBook/09Chapter9/#Figure%209-51b) in [Chapter 9](../../../VTKBook/09Chapter9) in the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/PineRootConnectivity.py b/data/examples/VisualizationAlgorithms/PineRootConnectivity.py deleted file mode 100755 index 76add2d..0000000 --- a/data/examples/VisualizationAlgorithms/PineRootConnectivity.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdList -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataConnectivityFilter -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOGeometry import vtkMCubesReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def pine_root_connectivity(fileName, noConnectivity): - def NumberOfTriangles(pd): - """ - Count the number of triangles. - :param pd: vtkPolyData. - :return: The number of triangles. - """ - cells = pd.GetPolys() - numOfTriangles = 0 - idList = vtkIdList() - for i in range(0, cells.GetNumberOfCells()): - cells.GetNextCell(idList) - # If a cell has three points it is a triangle. - if idList.GetNumberOfIds() == 3: - numOfTriangles += 1 - return numOfTriangles - - colors = vtkNamedColors() - - # Create the pipeline. - reader = vtkMCubesReader() - reader.SetFileName(fileName) - if not noConnectivity: - reader.Update() - print('Before Connectivity.') - print('There are: ', NumberOfTriangles(reader.GetOutput()), 'triangles') - - connect = vtkPolyDataConnectivityFilter() - connect.SetInputConnection(reader.GetOutputPort()) - connect.SetExtractionModeToLargestRegion() - if not noConnectivity: - connect.Update() - print('After Connectivity.') - print('There are: ', NumberOfTriangles(connect.GetOutput()), 'triangles') - - isoMapper = vtkPolyDataMapper() - if noConnectivity: - isoMapper.SetInputConnection(reader.GetOutputPort()) - else: - isoMapper.SetInputConnection(connect.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('raw_sienna')) - - # Get an outline of the data set for context. - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(outlineActor) - ren.AddActor(isoActor) - renWin.SetSize(512, 512) - renWin.SetWindowName('PineRootConnectivity') - - ren.SetBackground(colors.GetColor3d('SlateGray')) - - # render the image - # - # iren AddObserver UserEvent {wm deiconify .vtkInteract} - cam = ren.GetActiveCamera() - cam.SetFocalPoint(40.6018, 37.2813, 50.1953) - cam.SetPosition(40.6018, -280.533, 47.0172) - cam.ComputeViewPlaneNormal() - cam.SetClippingRange(26.1073, 1305.36) - cam.SetViewAngle(20.9219) - cam.SetViewUp(0.0, 0.0, 1.0) - - iren.Initialize() - renWin.Render() - iren.Start() - - -def main(): - fileName, noConnectivity = get_program_parameters() - noConnectivity = noConnectivity != 0 - pine_root_connectivity(fileName, noConnectivity) - - -def get_program_parameters(): - import argparse - description = 'Applying connectivity filter to remove noisy isosurfaces.' - epilogue = ''' - Applying connectivity filter to remove noisy isosurfaces. - -This example demonstrates how to use the vtkConnectivityFilter. -If the extra parameter 'noConnectivity' is non zero, the connectivity filter will not be used. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='pine_root.tri.') - parser.add_argument('noConnectivity', default=0, type=int, nargs='?', - help='If non-zero do not use the connectivity filter.') - args = parser.parse_args() - return args.filename, args.noConnectivity - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/PineRootConnectivityA.py b/data/examples/VisualizationAlgorithms/PineRootConnectivityA.py deleted file mode 100755 index ec49b51..0000000 --- a/data/examples/VisualizationAlgorithms/PineRootConnectivityA.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -""" -PineRootConnectivityA - -Note: Make sure PineRootConnectivity.py is in the same directory as this program. -""" - -import PineRootConnectivity - - -def main(): - fileName, noConnectivity = PineRootConnectivity.get_program_parameters() - noConnectivity = 1 - PineRootConnectivity.pine_root_connectivity(fileName, noConnectivity) - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/PineRootDecimation.md b/data/examples/VisualizationAlgorithms/PineRootDecimation.md deleted file mode 100644 index 60b0732..0000000 --- a/data/examples/VisualizationAlgorithms/PineRootDecimation.md +++ /dev/null @@ -1,24 +0,0 @@ -### Description - -Demonstrates how to apply the decimation filter to get a reduced data size and then the connectivity filter to remove noisy isosurfaces. The data is from the root system of a pine tree. - -To count the number of triangles in the polydata we do the following: - -#### C++ -We use a lambda function - -``` c++ -auto NumberofTriangles = [](auto *pd) -``` - -#### Python -We just implement: - -``` python -def NumberOfTriangles(pd): -``` - -within the scope of the calling function. - -!!! info - See [Figure 9-52](../../../VTKBook/09Chapter9/#Figure%209-52b) in [Chapter 9](../../../VTKBook/09Chapter9) in the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VisualizationAlgorithms/PineRootDecimation.py b/data/examples/VisualizationAlgorithms/PineRootDecimation.py deleted file mode 100755 index a7a823b..0000000 --- a/data/examples/VisualizationAlgorithms/PineRootDecimation.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkIdList -from vtkmodules.vtkFiltersCore import ( - vtkConnectivityFilter, - vtkDecimatePro -) -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOGeometry import vtkMCubesReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - def NumberOfTriangles(pd): - """ - Count the number of triangles. - :param pd: vtkPolyData. - :return: The number of triangles. - """ - cells = pd.GetPolys() - numOfTriangles = 0 - idList = vtkIdList() - for i in range(0, cells.GetNumberOfCells()): - cells.GetNextCell(idList) - # If a cell has three points it is a triangle. - if idList.GetNumberOfIds() == 3: - numOfTriangles += 1 - return numOfTriangles - - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the pipeline. - reader = vtkMCubesReader() - reader.SetFileName(fileName) - reader.FlipNormalsOff() - reader.Update() - print('Before Decimation.') - print('There are: ', NumberOfTriangles(reader.GetOutput()), 'triangles') - - deci = vtkDecimatePro() - deci.SetInputConnection(reader.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.SetAbsoluteError(0.0005) - deci.MaximumIterations = 6 - deci.SetFeatureAngle(30) - deci.SetErrorIsAbsolute(1) - deci.AccumulateErrorOn() - # deci.SplittingOff() - deci.Update() - print('After Decimation.') - print('There are: ', NumberOfTriangles(deci.GetOutput()), 'triangles') - - connect = vtkConnectivityFilter() - connect.SetInputConnection(deci.GetOutputPort()) - connect.SetExtractionModeToLargestRegion() - connect.Update() - print('After Connectivity.') - print('There are: ', NumberOfTriangles(connect.GetOutput()), 'triangles') - - isoMapper = vtkDataSetMapper() - isoMapper.SetInputConnection(connect.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('raw_sienna')) - - # Get an outline of the data set for context. - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(outlineActor) - ren.AddActor(isoActor) - ren.SetBackground(1, 1, 1) - # renWin.SetSize(750, 750) - renWin.SetSize(512, 512) - renWin.SetWindowName('PineRootDecimation') - - ren.SetBackground(colors.GetColor3d('SlateGray')) - - # render the image - - cam = ren.GetActiveCamera() - cam.SetFocalPoint(40.6018, 37.2813, 50.1953) - cam.SetPosition(40.6018, -280.533, 47.0172) - cam.ComputeViewPlaneNormal() - cam.SetClippingRange(26.1073, 1305.36) - cam.SetViewAngle(20.9219) - cam.SetViewUp(0.0, 0.0, 1.0) - - iren.Initialize() - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Applying connectivity and decimation filters to remove noisy isosurfaces and reduce data size.' - epilogue = ''' - Applying connectivity and decimation filters to remove noisy isosurfaces and reduce data size.. - -This example demonstrates how to use the vtkConnectivityFilter and vtkDecimate. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='pine_root.tri.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/PlateVibration.md b/data/examples/VisualizationAlgorithms/PlateVibration.md deleted file mode 100644 index 4183a12..0000000 --- a/data/examples/VisualizationAlgorithms/PlateVibration.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -The motion of a vibrating beam is shown. The original undeformed outline is shown as a wireframe. - -!!! info - See [Figure 6-14a](../../../VTKBook/06Chapter6/#Figure%206-14a) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/PlateVibration.py b/data/examples/VisualizationAlgorithms/PlateVibration.py deleted file mode 100755 index a25fc84..0000000 --- a/data/examples/VisualizationAlgorithms/PlateVibration.py +++ /dev/null @@ -1,110 +0,0 @@ -# Translated from vib.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataNormals, - vtkVectorDot -) -from vtkmodules.vtkFiltersGeneral import vtkWarpVector -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - file_name = get_program_parameters() - - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('PlateColor', [255, 160, 140, 255]) - colors.SetColor('BkgColor', [65, 99, 149, 255]) - - # Read a vtk file - # - plate = vtkPolyDataReader() - plate.SetFileName(file_name) - plate.Update() - bounds = [0] * 6 - plate.GetOutput().GetBounds(bounds) - plate.SetVectorsName('mode2') - - normals = vtkPolyDataNormals() - normals.SetInputConnection(plate.GetOutputPort()) - warp = vtkWarpVector() - warp.SetInputConnection(normals.GetOutputPort()) - warp.SetScaleFactor(0.5) - color = vtkVectorDot() - color.SetInputConnection(warp.GetOutputPort()) - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(warp.GetOutputPort()) - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - plateActor.GetProperty().SetColor( - colors.GetColor3d('PlateColor')) - plateActor.RotateX(-90) - - # Create the outline. - # - outline = vtkOutlineFilter() - outline.SetInputConnection(plate.GetOutputPort()) - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(spikeMapper) - outlineActor.RotateX(-90) - outlineActor.GetProperty().SetColor(colors.GetColor3d('White')) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(plateActor) - ren.AddActor(outlineActor) - renWin.SetSize(500, 500) - renWin.SetWindowName('PlateVibration') - - # Render the image. - renWin.Render() - ren.SetBackground(colors.GetColor3d('BkgColor')) - # This closely matches the original illustration. - ren.GetActiveCamera().SetPosition(-3.7, 13, 15.5) - ren.ResetCameraClippingRange() - - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produces figure 6-14(a) Beam displacement from the VTK Textbook.' - epilogue = ''' - Produce figure 6–14(a) Beam displacement from the VTK Textbook.. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename', help='plate.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/ProbeCombustor.md b/data/examples/VisualizationAlgorithms/ProbeCombustor.md deleted file mode 100644 index 3b20703..0000000 --- a/data/examples/VisualizationAlgorithms/ProbeCombustor.md +++ /dev/null @@ -1,9 +0,0 @@ -### Description - -Probing obtains dataset attributes by sampling one dataset (the input) with a set of points (the probe). Probing is also called “resampling.” Examples include probing an input dataset with a sequence of points along a line, on a plane, or in a volume. The result of the probing is a new dataset (the output) with the topological and geometric structure of the probe dataset, and point attributes interpolated from the input dataset. Once the probing operation is completed, the output dataset can be visualized with any of the appropriate techniques in VTK. - -This example illustrates the details of the probing process. For every point in the probe dataset, the location in the input dataset (i.e., cell, subcell, and parametric coordinates) and interpolation weights are determined. Then the data values from the cell are interpolated to the probe -point. Probe points that are outside the input dataset are assigned a nil (or appropriate) value. This process repeats for all points in the probe dataset. - -!!! info - See [Figure 9-19](../../../VTKBook/09Chapter9/#Figure%209-19) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/ProbeCombustor.py b/data/examples/VisualizationAlgorithms/ProbeCombustor.py deleted file mode 100755 index ad58a2b..0000000 --- a/data/examples/VisualizationAlgorithms/ProbeCombustor.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkContourFilter, - vtkProbeFilter, - vtkStructuredGridOutlineFilter -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkPlaneSource -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # Create the pipeline. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - sg = pl3d.GetOutput().GetBlock(0) - - # We create three planes and position them in the correct position - # using transform filters. They are then appended together and used as - # a probe. - plane = vtkPlaneSource() - plane.SetResolution(50, 50) - - transP1 = vtkTransform() - transP1.Translate(3.7, 0.0, 28.37) - transP1.Scale(5, 5, 5) - transP1.RotateY(90) - - tpd1 = vtkTransformPolyDataFilter() - tpd1.SetInputConnection(plane.GetOutputPort()) - tpd1.SetTransform(transP1) - - outTpd1 = vtkOutlineFilter() - outTpd1.SetInputConnection(tpd1.GetOutputPort()) - - mapTpd1 = vtkPolyDataMapper() - mapTpd1.SetInputConnection(outTpd1.GetOutputPort()) - - tpd1Actor = vtkActor() - tpd1Actor.SetMapper(mapTpd1) - tpd1Actor.GetProperty().SetColor(0, 0, 0) - tpd1Actor.GetProperty().SetLineWidth(2.0) - - transP2 = vtkTransform() - transP2.Translate(9.2, 0.0, 31.20) - transP2.Scale(5, 5, 5) - transP2.RotateY(90) - - tpd2 = vtkTransformPolyDataFilter() - tpd2.SetInputConnection(plane.GetOutputPort()) - tpd2.SetTransform(transP2) - - outTpd2 = vtkOutlineFilter() - outTpd2.SetInputConnection(tpd2.GetOutputPort()) - - mapTpd2 = vtkPolyDataMapper() - mapTpd2.SetInputConnection(outTpd2.GetOutputPort()) - - tpd2Actor = vtkActor() - tpd2Actor.SetMapper(mapTpd2) - tpd2Actor.GetProperty().SetColor(0, 0, 0) - tpd2Actor.GetProperty().SetLineWidth(2.0) - - transP3 = vtkTransform() - transP3.Translate(13.27, 0.0, 33.30) - transP3.Scale(5, 5, 5) - transP3.RotateY(90) - - tpd3 = vtkTransformPolyDataFilter() - tpd3.SetInputConnection(plane.GetOutputPort()) - tpd3.SetTransform(transP3) - - outTpd3 = vtkOutlineFilter() - outTpd3.SetInputConnection(tpd3.GetOutputPort()) - - mapTpd3 = vtkPolyDataMapper() - mapTpd3.SetInputConnection(outTpd3.GetOutputPort()) - - tpd3Actor = vtkActor() - tpd3Actor.SetMapper(mapTpd3) - tpd3Actor.GetProperty().SetColor(0, 0, 0) - tpd3Actor.GetProperty().SetLineWidth(2.0) - - appendF = vtkAppendPolyData() - appendF.AddInputConnection(tpd1.GetOutputPort()) - appendF.AddInputConnection(tpd2.GetOutputPort()) - appendF.AddInputConnection(tpd3.GetOutputPort()) - - # The vtkProbeFilter takes two inputs. One is a dataset to use as the probe - # geometry (SetInputConnection) the other is the data to probe - # (SetSourceConnection). The output dataset structure (geometry and - # topology) of the probe is the same as the structure of the input. The - # probing process generates new data values resampled from the source. - probe = vtkProbeFilter() - probe.SetInputConnection(appendF.GetOutputPort()) - probe.SetSourceData(sg) - - contour = vtkContourFilter() - contour.SetInputConnection(probe.GetOutputPort()) - contour.GenerateValues(50, sg.GetScalarRange()) - - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) - contourMapper.SetScalarRange(sg.GetScalarRange()) - - planeActor = vtkActor() - planeActor.SetMapper(contourMapper) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(0, 0, 0) - outlineActor.GetProperty().SetLineWidth(2.0) - - # Create the RenderWindow, Renderer and both Actors - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - ren1.AddActor(outlineActor) - ren1.AddActor(planeActor) - ren1.AddActor(tpd1Actor) - ren1.AddActor(tpd2Actor) - ren1.AddActor(tpd3Actor) - ren1.SetBackground(colors.GetColor3d('Gainsboro')) - renWin.SetSize(640, 480) - renWin.SetWindowName('ProbeCombustor') - - ren1.ResetCamera() - ren1.GetActiveCamera().SetClippingRange(3.95297, 50) - ren1.GetActiveCamera().SetFocalPoint(8.88908, 0.595038, 29.3342) - ren1.GetActiveCamera().SetPosition(-12.3332, 31.7479, 41.2387) - ren1.GetActiveCamera().SetViewUp(0.060772, -0.319905, 0.945498) - - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'This shows how to probe a dataset with a plane. The probed data is then contoured. ' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/SingleSplat.py b/data/examples/VisualizationAlgorithms/SingleSplat.py deleted file mode 100755 index 43e2d59..0000000 --- a/data/examples/VisualizationAlgorithms/SingleSplat.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkDoubleArray, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkFiltersCore import vtkContourFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkImagingHybrid import vtkGaussianSplatter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create single splat point - pts = vtkPoints() - verts = vtkCellArray() - norms = vtkDoubleArray() - scalars = vtkDoubleArray() - - x = [0.0] * 3 - pts.InsertNextPoint(x) - norms.SetNumberOfTuples(1) - norms.SetNumberOfComponents(3) - n = [0] * 3 - n[0] = 0.707 - n[1] = 0.707 - n[2] = 0.0 - norms.InsertTuple(0, n) - scalars.SetNumberOfTuples(1) - scalars.SetNumberOfComponents(1) - scalars.InsertTuple1(0, 1.0) - - verts.InsertNextCell(1) - verts.InsertCellPoint(0) - - pData = vtkPolyData() - pData.SetPoints(pts) - pData.SetVerts(verts) - pData.GetPointData().SetNormals(norms) - pData.GetPointData().SetScalars(scalars) - - # Splat point and generate isosurface. - splat = vtkGaussianSplatter() - splat.SetInputData(pData) - splat.SetModelBounds(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0) - splat.SetSampleDimensions(75, 75, 75) - splat.SetRadius(0.5) - splat.SetEccentricity(5.0) - splat.SetExponentFactor(-3.25) - contour = vtkContourFilter() - contour.SetInputConnection(splat.GetOutputPort()) - contour.SetValue(0, 0.9) - splatMapper = vtkPolyDataMapper() - splatMapper.SetInputConnection(contour.GetOutputPort()) - splatActor = vtkActor() - splatActor.SetMapper(splatMapper) - - # Create outline. - outline = vtkOutlineFilter() - outline.SetInputConnection(splat.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Brown')) - - # Create cone to indicate direction. - cone = vtkConeSource() - cone.SetResolution(24) - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.SetScale(0.75, 0.75, 0.75) - coneActor.RotateZ(45.0) - coneActor.AddPosition(0.50, 0.50, 0.0) - coneActor.GetProperty().SetColor(colors.GetColor3d('DeepPink')) - # - # Rendering stuff. - # - aren.SetBackground(colors.GetColor3d('Beige')) - aren.AddActor(splatActor) - aren.AddActor(outlineActor) - aren.AddActor(coneActor) - - renWin.SetSize(640, 640) - renWin.SetWindowName('SingleSplat') - renWin.Render() - - # Interact with the data. - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/SpikeFran.py b/data/examples/VisualizationAlgorithms/SpikeFran.py deleted file mode 100755 index 0145db7..0000000 --- a/data/examples/VisualizationAlgorithms/SpikeFran.py +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import ( - vtkGlyph3D, - vtkMaskPoints, - vtkPolyDataNormals -) -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - fran = vtkPolyDataReader() - fran.SetFileName(fileName) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(fran.GetOutputPort()) - normals.FlipNormalsOn() - - franMapper = vtkPolyDataMapper() - franMapper.SetInputConnection(normals.GetOutputPort()) - - franActor = vtkActor() - franActor.SetMapper(franMapper) - franActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # We subsample the dataset because we want to glyph just a subset of - # the points. Otherwise the display is cluttered and cannot be easily - # read. The RandomModeOn and SetOnRatio combine to random select one out - # of every 10 points in the dataset. - # - ptMask = vtkMaskPoints() - ptMask.SetInputConnection(normals.GetOutputPort()) - ptMask.SetOnRatio(10) - ptMask.RandomModeOn() - - # In this case we are using a cone as a glyph. We transform the cone so - # its base is at 0,0,0. This is the point where glyph rotation occurs. - cone = vtkConeSource() - cone.SetResolution(6) - - transform = vtkTransform() - transform.Translate(0.5, 0.0, 0.0) - - transformF = vtkTransformPolyDataFilter() - transformF.SetInputConnection(cone.GetOutputPort()) - transformF.SetTransform(transform) - - # vtkGlyph3D takes two inputs: the input point set (SetInputConnection) - # which can be any vtkDataSet and the glyph (SetSourceConnection) which - # must be a vtkPolyData. We are interested in orienting the glyphs by the - # surface normals that we previously generated. - glyph = vtkGlyph3D() - glyph.SetInputConnection(ptMask.GetOutputPort()) - glyph.SetSourceConnection(transformF.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.004) - - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(glyph.GetOutputPort()) - - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor.GetProperty().SetColor(colors.GetColor3d('Emerald_Green')) - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(franActor) - ren1.AddActor(spikeActor) - - renWin.SetSize(640, 480) - renWin.SetWindowName('SpikeFran') - - ren1.SetBackground(colors.GetColor3d('SlateGray')) - - # Render the image. - # - renWin.Render() - - ren1.GetActiveCamera().Zoom(1.4) - ren1.GetActiveCamera().Azimuth(110) - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'This example demonstrates the use of glyphing.' - epilogue = ''' - We also use a mask filter to select a subset of points to glyph. - - About the data file: - This originally was a Cyberware laser digitizer scan - of Fran J.'s face. Surface normals are generated based on local geometry - (i.e., the polygon normals surrounding each point are averaged). We flip - the normals because we want them to point out from Fran's face. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/SplatFace.py b/data/examples/VisualizationAlgorithms/SplatFace.py deleted file mode 100755 index 3136023..0000000 --- a/data/examples/VisualizationAlgorithms/SplatFace.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkMaskPoints, - vtkPolyDataNormals -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkImagingHybrid import vtkGaussianSplatter -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Read cyberware file. - # - cyber = vtkPolyDataReader() - cyber.SetFileName(fileName) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cyber.GetOutputPort()) - - mask = vtkMaskPoints() - mask.SetInputConnection(normals.GetOutputPort()) - mask.SetOnRatio(8) - # mask.RandomModeOn() - - splatter = vtkGaussianSplatter() - splatter.SetInputConnection(mask.GetOutputPort()) - splatter.SetSampleDimensions(100, 100, 100) - splatter.SetEccentricity(2.5) - splatter.NormalWarpingOn() - splatter.SetScaleFactor(1.0) - splatter.SetRadius(0.025) - - contour = vtkContourFilter() - contour.SetInputConnection(splatter.GetOutputPort()) - contour.SetValue(0, 0.25) - - splatMapper = vtkPolyDataMapper() - splatMapper.SetInputConnection(contour.GetOutputPort()) - splatMapper.ScalarVisibilityOff() - - splatActor = vtkActor() - splatActor.SetMapper(splatMapper) - splatActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(cyber.GetOutputPort()) - cyberMapper.ScalarVisibilityOff() - - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetRepresentationToWireframe() - cyberActor.GetProperty().SetColor(colors.GetColor3d('Turquoise')) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(cyberActor) - ren1.AddActor(splatActor) - ren1.SetBackground(colors.GetColor3d('Wheat')) - renWin.SetSize(640, 480) - renWin.SetWindowName('SplatFace') - - camera = vtkCamera() - camera.SetClippingRange(0.0332682, 1.66341) - camera.SetFocalPoint(0.0511519, -0.127555, -0.0554379) - camera.SetPosition(0.516567, -0.124763, -0.349538) - camera.SetViewAngle(18.1279) - camera.SetViewUp(-0.013125, 0.99985, -0.0112779) - ren1.SetActiveCamera(camera) - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Elliptical splatting.' - epilogue = ''' - b) Surface reconstructed using elliptical splats into 100^3 volume followed by isosurface extraction. - Points regularly subsampled and overlaid on original mesh. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/Stocks.py b/data/examples/VisualizationAlgorithms/Stocks.py deleted file mode 100755 index e094790..0000000 --- a/data/examples/VisualizationAlgorithms/Stocks.py +++ /dev/null @@ -1,177 +0,0 @@ -#!/usr/bin/env python - - -import os - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersCore import vtkTubeFilter -from vtkmodules.vtkFiltersGeneral import vtkTransformPolyDataFilter -from vtkmodules.vtkFiltersModeling import ( - vtkLinearExtrusionFilter, - vtkRibbonFilter -) -from vtkmodules.vtkIOLegacy import vtkPolyDataReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkFollower, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) -from vtkmodules.vtkRenderingFreeType import vtkVectorText - - -def main(): - colors = vtkNamedColors() - - fileNames, useRibbons = get_program_parameters() - useTubes = not useRibbons - - # Set up the stocks - renderers = list() - topRenderer = vtkRenderer() - bottomRenderer = vtkRenderer() - renderers.append(topRenderer) - renderers.append(bottomRenderer) - - zPosition = 0.0 - for fn in fileNames: - zPosition = AddStock(renderers, fn, os.path.basename((os.path.splitext(fn)[0])), zPosition, useTubes) - - # Setup the render window and interactor. - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderers[0]) - renderWindow.AddRenderer(renderers[1]) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderers[0].SetViewport(0.0, 0.4, 1.0, 1.0) - renderers[1].SetViewport(0.0, 0.0, 1.0, 0.4) - - renderers[0].GetActiveCamera().SetViewAngle(5.0) - renderers[0].ResetCamera() - renderers[0].GetActiveCamera().Zoom(1.4) - renderers[0].ResetCameraClippingRange() - renderers[0].SetBackground(colors.GetColor3d("SteelBlue")) - - renderers[1].GetActiveCamera().SetViewUp(0, 0, -1) - renderers[1].GetActiveCamera().SetPosition(0, 1, 0) - renderers[1].GetActiveCamera().SetViewAngle(5.0) - renderers[1].ResetCamera() - renderers[1].GetActiveCamera().Zoom(2.2) - renderers[1].ResetCameraClippingRange() - renderers[1].SetBackground(colors.GetColor3d("LightSteelBlue")) - - renderWindow.SetSize(500, 800) - renderWindow.SetWindowName('Stocks') - renderWindow.Render() - - renderWindowInteractor.Start() - - -def get_program_parameters(): - import argparse - description = 'Two views from the stock visualization script.' - epilogue = ''' - The top shows closing price over time; the bottom shows volume over time. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filenames', nargs='+', - help='List of one or more filenames corresponding to stocks. e.g. GE.vtk GM.vtk IBM.vtk DEC.vtk') - parser.add_argument('-r', dest='useRibbons', action='store_true', help='Use ribbons instead of tubes.') - - args = parser.parse_args() - return args.filenames, args.useRibbons - - -def AddStock(renderers, filename, name, zPosition, useTubes): - print("Adding", name) - - # Read the data - PolyDataRead = vtkPolyDataReader() - PolyDataRead.SetFileName(filename) - PolyDataRead.Update() - - # Create the labels. - TextSrc = vtkVectorText() - TextSrc.SetText(name) - - numberOfPoints = PolyDataRead.GetOutput().GetNumberOfPoints() - - nameIndex = int((numberOfPoints - 1) * 0.8) - - nameLocation = PolyDataRead.GetOutput().GetPoint(nameIndex) - - x = nameLocation[0] * 0.15 - y = nameLocation[1] + 5.0 - z = zPosition - - # Create a tube and ribbpn filter. One or the other will be used - TubeFilter = vtkTubeFilter() - TubeFilter.SetInputConnection(PolyDataRead.GetOutputPort()) - TubeFilter.SetNumberOfSides(8) - TubeFilter.SetRadius(0.5) - TubeFilter.SetRadiusFactor(10000) - - RibbonFilter = vtkRibbonFilter() - RibbonFilter.SetInputConnection(PolyDataRead.GetOutputPort()) - RibbonFilter.VaryWidthOn() - RibbonFilter.SetWidthFactor(5) - RibbonFilter.SetDefaultNormal(0, 1, 0) - RibbonFilter.UseDefaultNormalOn() - - Extrude = vtkLinearExtrusionFilter() - Extrude.SetInputConnection(RibbonFilter.GetOutputPort()) - Extrude.SetVector(0, 1, 0) - Extrude.SetExtrusionType(1) - Extrude.SetScaleFactor(0.7) - - Transform = vtkTransform() - Transform.Translate(0, 0, zPosition) - Transform.Scale(0.15, 1, 1) - - TransformFilter = vtkTransformPolyDataFilter() - TransformFilter.SetInputConnection(Extrude.GetOutputPort()) - TransformFilter.SetTransform(Transform) - - # Select tubes or ribbons - if useTubes: - TransformFilter.SetInputConnection(TubeFilter.GetOutputPort()) - else: - TransformFilter.SetInputConnection(Extrude.GetOutputPort()) - - for r in range(0, len(renderers)): - LabelMapper = vtkPolyDataMapper() - LabelMapper.SetInputConnection(TextSrc.GetOutputPort()) - - LabelActor = vtkFollower() - LabelActor.SetMapper(LabelMapper) - LabelActor.SetPosition(x, y, z) - LabelActor.SetScale(2, 2, 2) - LabelActor.SetOrigin(TextSrc.GetOutput().GetCenter()) - - # Increment zPosition. - zPosition += 8.0 - - StockMapper = vtkPolyDataMapper() - StockMapper.SetInputConnection(TransformFilter.GetOutputPort()) - StockMapper.SetScalarRange(0, 8000) - StockActor = vtkActor() - StockActor.SetMapper(StockMapper) - - renderers[r].AddActor(StockActor) - renderers[r].AddActor(LabelActor) - LabelActor.SetCamera(renderers[r].GetActiveCamera()) - return zPosition - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.md b/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.md deleted file mode 100644 index e175f41..0000000 --- a/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.md +++ /dev/null @@ -1,19 +0,0 @@ -### Description - -#### Produce streamlines in the combustor dataset. - -This example demonstrates how to use the vtkLineWidget to seed and -manipulate streamlines. Two line widgets are created. The first is invoked -by pressing '**i**', the second by pressing '**L**' (capital). Both can exist -together. - -If the fourth parameter is non-zero, it is used to generate an image with streamlines: - -1. The third parameter value is changed to 25. -2. The camera position and first line widget are positioned differently. -3. The streamlines are displayed running from the first line widget. -4. The second line widget is still available. - -In the C++ version, note how we handle callbacks by first implementing a class, then instantiating it and then passing references to the needed variables to it. Finally we add it as an observer. - -For the Python version we define a class passing the needed variables in the `__init__` function and then implementing a `_call__` function that does the work. diff --git a/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.py b/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.py deleted file mode 100755 index 5d0849e..0000000 --- a/data/examples/VisualizationAlgorithms/StreamlinesWithLineWidget.py +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python - -""" -Modified from VTK/Examples/GUI/Python/StreamlinesWithLineWidget.py. -This program encompasses the functionality of - StreamlinesWithLineWidget.tcl and LineWidget.tcl. -""" - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPolyData -from vtkmodules.vtkCommonMath import vtkRungeKutta4 -from vtkmodules.vtkFiltersCore import vtkStructuredGridOutlineFilter -from vtkmodules.vtkFiltersFlowPaths import vtkStreamTracer -from vtkmodules.vtkFiltersModeling import vtkRibbonFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkInteractionWidgets import vtkLineWidget -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName1, fileName2, numOfStreamLines, illustration = get_program_parameters() - if illustration: - numOfStreamLines = 25 - - # Start by loading some data. - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) # Density - pl3d.SetVectorFunctionNumber(202) # Momentum - pl3d.Update() - - pl3d_output = pl3d.GetOutput().GetBlock(0) - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Needed by: vtkStreamTracer and vtkLineWidget. - seeds = vtkPolyData() - streamline = vtkActor() - seeds2 = vtkPolyData() - streamline2 = vtkActor() - - # The line widget is used seed the streamlines. - lineWidget = vtkLineWidget() - lineWidget.SetResolution(numOfStreamLines) - lineWidget.SetInputData(pl3d_output) - lineWidget.GetPolyData(seeds) - if illustration: - lineWidget.SetAlignToNone() - lineWidget.SetPoint1(0.974678, 5.073630, 31.217961) - lineWidget.SetPoint2(0.457544, -4.995921, 31.080175) - else: - lineWidget.SetAlignToYAxis() - lineWidget.ClampToBoundsOn() - lineWidget.PlaceWidget() - # Associate the line widget with the interactor and setup callbacks. - lineWidget.SetInteractor(iren) - lineWidget.AddObserver("StartInteractionEvent", EnableActorCallback(streamline)) - lineWidget.AddObserver("InteractionEvent", GenerateStreamlinesCallback(seeds, renWin)) - - # The second line widget is used seed more streamlines. - lineWidget2 = vtkLineWidget() - lineWidget2.SetResolution(numOfStreamLines) - lineWidget2.SetInputData(pl3d_output) - lineWidget2.GetPolyData(seeds2) - lineWidget2.SetKeyPressActivationValue('L') - lineWidget2.SetAlignToZAxis() - lineWidget.ClampToBoundsOn() - lineWidget2.PlaceWidget() - # Associate the line widget with the interactor and setup callbacks. - lineWidget2.SetInteractor(iren) - lineWidget2.AddObserver("StartInteractionEvent", EnableActorCallback(streamline2)) - lineWidget2.AddObserver("InteractionEvent", GenerateStreamlinesCallback(seeds2, renWin)) - - # Here we set up two streamlines. - rk4 = vtkRungeKutta4() - streamer = vtkStreamTracer() - streamer.SetInputData(pl3d_output) - streamer.SetSourceData(seeds) - streamer.SetMaximumPropagation(100) - streamer.SetInitialIntegrationStep(0.2) - streamer.SetIntegrationDirectionToForward() - streamer.SetComputeVorticity(1) - streamer.SetIntegrator(rk4) - rf = vtkRibbonFilter() - rf.SetInputConnection(streamer.GetOutputPort()) - rf.SetWidth(0.1) - rf.SetWidthFactor(5) - streamMapper = vtkPolyDataMapper() - streamMapper.SetInputConnection(rf.GetOutputPort()) - streamMapper.SetScalarRange(pl3d_output.GetScalarRange()) - streamline.SetMapper(streamMapper) - streamline.VisibilityOff() - - streamer2 = vtkStreamTracer() - streamer2.SetInputData(pl3d_output) - streamer2.SetSourceData(seeds2) - streamer2.SetMaximumPropagation(100) - streamer2.SetInitialIntegrationStep(0.2) - streamer2.SetIntegrationDirectionToForward() - streamer2.SetComputeVorticity(1) - streamer2.SetIntegrator(rk4) - rf2 = vtkRibbonFilter() - rf2.SetInputConnection(streamer2.GetOutputPort()) - rf2.SetWidth(0.1) - rf2.SetWidthFactor(5) - streamMapper2 = vtkPolyDataMapper() - streamMapper2.SetInputConnection(rf2.GetOutputPort()) - streamMapper2.SetScalarRange(pl3d_output.GetScalarRange()) - streamline2.SetMapper(streamMapper2) - streamline2.VisibilityOff() - - # Get an outline of the data set for context. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3d_output) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(outlineActor) - ren.AddActor(streamline) - ren.AddActor(streamline2) - renWin.SetSize(512, 512) - renWin.SetWindowName('StreamlinesWithLineWidget') - - cam = ren.GetActiveCamera() - if illustration: - # We need to directly display the streamlines in this case. - lineWidget.EnabledOn() - streamline.VisibilityOn() - lineWidget.GetPolyData(seeds) - renWin.Render() - - cam.SetClippingRange(14.216207, 68.382915) - cam.SetFocalPoint(9.718210, 0.458166, 29.399900) - cam.SetPosition(-15.827551, -16.997463, 54.003120) - cam.SetViewUp(0.616076, 0.179428, 0.766979) - ren.SetBackground(colors.GetColor3d("Silver")) - else: - cam.SetClippingRange(3.95297, 50) - cam.SetFocalPoint(9.71821, 0.458166, 29.3999) - cam.SetPosition(2.7439, -37.3196, 38.7167) - cam.SetViewUp(-0.16123, 0.264271, 0.950876) - ren.SetBackground(colors.GetColor3d("Silver")) - - iren.Initialize() - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produce streamlines in the combustor dataset.' - epilogue = ''' - Produce streamlines in the combustor dataset. - -This example demonstrates how to use the vtkLineWidget to seed and -manipulate streamlines. Two line widgets are created. The first is invoked -by pressing 'i', the second by pressing 'L' (capital). Both can exist -together. - -If the fourth parameter is non-zero, it is used to generate - an image with streamlines: - 1) The third parameter value is changed to 25. - 2) The camera position and first line widget are positioned differently. - 3) The streamlines are displayed running from the first line widget. - 4) The second line widget is still available. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - parser.add_argument('numOfStreamLines', default=25, type=int, nargs='?', help='The number of stream lines.') - parser.add_argument('illustration', default=0, type=int, nargs='?', - help='If non-zero, reproduce Fig 7-39 of the VTK Textbook.') - args = parser.parse_args() - return args.filename1, args.filename2, args.numOfStreamLines, args.illustration - - -class EnableActorCallback(object): - def __init__(self, actor): - self.actor = actor - - def __call__(self, caller, ev): - self.actor.VisibilityOn() - - -class GenerateStreamlinesCallback(object): - def __init__(self, polyData, renWin): - self.polyData = polyData - self.renWin = renWin - - def __call__(self, caller, ev): - caller.GetPolyData(self.polyData) - self.renWin.Render() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/TensorAxes.md b/data/examples/VisualizationAlgorithms/TensorAxes.md deleted file mode 100644 index 4360c60..0000000 --- a/data/examples/VisualizationAlgorithms/TensorAxes.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example visualizes the analytical results of Boussinesq's problem from Saada. The figure shows the results by displaying the scaled and oriented principal axes of the stress tensor. (These are called *tensor axes*.) - -!!! info - See [Figure 6-22a](../../../VTKBook/06Chapter6/#Figure%206-22a) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/TensorAxes.py b/data/examples/VisualizationAlgorithms/TensorAxes.py deleted file mode 100755 index e3ac0ed..0000000 --- a/data/examples/VisualizationAlgorithms/TensorAxes.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python - -# Translated from TenAxes.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkTensorGlyph, - vtkTubeFilter -) -from vtkmodules.vtkFiltersGeneral import vtkAxes -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkImagingHybrid import vtkPointLoad -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and interactive renderer. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Generate the tensors. - ptLoad = vtkPointLoad() - ptLoad.SetLoadValue(100.0) - ptLoad.SetSampleDimensions(6, 6, 6) - ptLoad.ComputeEffectiveStressOn() - ptLoad.SetModelBounds(-10, 10, -10, 10, -10, 10) - - # Extract a plane of data. - plane = vtkImageDataGeometryFilter() - plane.SetInputConnection(ptLoad.GetOutputPort()) - plane.SetExtent(2, 2, 0, 99, 0, 99) - - # Generate the tensor axes. - axes = vtkAxes() - axes.SetScaleFactor(0.5) - - tubeAxes = vtkTubeFilter() - tubeAxes.SetInputConnection(axes.GetOutputPort()) - tubeAxes.SetRadius(0.1) - tubeAxes.SetNumberOfSides(6) - - tensorAxes = vtkTensorGlyph() - tensorAxes.SetInputConnection(ptLoad.GetOutputPort()) - tensorAxes.SetSourceConnection(axes.GetOutputPort()) - tensorAxes.SetScaleFactor(10) - tensorAxes.ClampScalingOn() - - # Map contour - lut = vtkLookupTable() - MakeLogLUT(lut) - # lut.SetHueRange(.6667, 0.0) - tensorAxesMapper = vtkPolyDataMapper() - tensorAxesMapper.SetInputConnection(tensorAxes.GetOutputPort()) - tensorAxesMapper.SetLookupTable(lut) - plane.Update() # force update for scalar range - # This is deprecated from vtk 8.1 onwards. - # tensorAxesMapper.ImmediateModeRenderingOn() - tensorAxesMapper.SetScalarRange(plane.GetOutput().GetScalarRange()) - - tensorActor = vtkActor() - tensorActor.SetMapper(tensorAxesMapper) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() - outline.SetInputConnection(ptLoad.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # - # Create a cone whose apex indicates the application of load. - # - coneSrc = vtkConeSource() - coneSrc.SetRadius(.5) - coneSrc.SetHeight(2) - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('BurlyWood')) - - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) - - ren.AddActor(tensorActor) - ren.AddActor(outlineActor) - ren.AddActor(coneActor) - ren.SetBackground(colors.GetColor3d('WhiteSmoke')) - ren.SetActiveCamera(camera) - - renWin.SetSize(512, 512) - renWin.SetWindowName('TensorAxes') - - iren.Initialize() - renWin.Render() - iren.Start() - - -def MakeLogLUT(lut): - # Original - lut.SetScaleToLog10() - lut.SetHueRange(.6667, 0.0) - lut.Build() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/TensorEllipsoids.md b/data/examples/VisualizationAlgorithms/TensorEllipsoids.md deleted file mode 100644 index a75d8a8..0000000 --- a/data/examples/VisualizationAlgorithms/TensorEllipsoids.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example visualizes the analytical results of Boussinesq's problem from Saada. The figure shows the results by displaying the scaled and oriented principal axes as tensor ellipsoids representing the stress tensor. (These are called *tensor axes*.) - -!!! info - See [Figure 6-22b](../../../VTKBook/06Chapter6/#Figure%206-22b) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/TensorEllipsoids.py b/data/examples/VisualizationAlgorithms/TensorEllipsoids.py deleted file mode 100755 index a0cfc5a..0000000 --- a/data/examples/VisualizationAlgorithms/TensorEllipsoids.py +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env python - -# Translated from TenEllip.tcl - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import ( - vtkColorSeries, - vtkNamedColors -) -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkFiltersCore import ( - vtkPolyDataNormals, - vtkTensorGlyph -) -from vtkmodules.vtkFiltersGeometry import vtkImageDataGeometryFilter -from vtkmodules.vtkFiltersModeling import vtkOutlineFilter -from vtkmodules.vtkFiltersSources import ( - vtkConeSource, - vtkSphereSource -) -from vtkmodules.vtkImagingHybrid import vtkPointLoad -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkCamera, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and interactive renderer. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Generate the tensors. - ptLoad = vtkPointLoad() - ptLoad.SetLoadValue(100.0) - ptLoad.SetSampleDimensions(6, 6, 6) - ptLoad.ComputeEffectiveStressOn() - ptLoad.SetModelBounds(-10, 10, -10, 10, -10, 10) - - # Extract a plane of data. - plane = vtkImageDataGeometryFilter() - plane.SetInputConnection(ptLoad.GetOutputPort()) - plane.SetExtent(2, 2, 0, 99, 0, 99) - - # Generate the ellipsoids. - sphere = vtkSphereSource() - sphere.SetThetaResolution(8) - sphere.SetPhiResolution(8) - tensorEllipsoids = vtkTensorGlyph() - tensorEllipsoids.SetInputConnection(ptLoad.GetOutputPort()) - tensorEllipsoids.SetSourceConnection(sphere.GetOutputPort()) - tensorEllipsoids.SetScaleFactor(10) - tensorEllipsoids.ClampScalingOn() - - ellipNormals = vtkPolyDataNormals() - ellipNormals.SetInputConnection(tensorEllipsoids.GetOutputPort()) - - # Map contour - lut = vtkLookupTable() - MakeLogLUT(lut) - # lut.SetHueRange(.6667, 0.0) - tensorEllipsoidsMapper = vtkPolyDataMapper() - tensorEllipsoidsMapper.SetInputConnection(ellipNormals.GetOutputPort()) - tensorEllipsoidsMapper.SetLookupTable(lut) - plane.Update() # force update for scalar range - tensorEllipsoidsMapper.SetScalarRange(plane.GetOutput().GetScalarRange()) - - tensorActor = vtkActor() - tensorActor.SetMapper(tensorEllipsoidsMapper) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() - outline.SetInputConnection(ptLoad.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create a cone whose apex indicates the application of load. - # - coneSrc = vtkConeSource() - coneSrc.SetRadius(.5) - coneSrc.SetHeight(2) - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) - - ren.AddActor(tensorActor) - ren.AddActor(outlineActor) - ren.AddActor(coneActor) - ren.SetBackground(colors.GetColor3d('WhiteSmoke')) - ren.SetActiveCamera(camera) - - renWin.SetSize(512, 512) - renWin.SetWindowName('TensorEllipsoids') - - iren.Initialize() - renWin.Render() - iren.Start() - - -def MakeLogLUT(lut): - # Make the lookup using a Brewer palette. - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeriesEnum = colorSeries.BREWER_DIVERGING_SPECTRAL_8 - colorSeries.SetColorScheme(colorSeriesEnum) - lut.SetScaleToLog10() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - # Original - # lut.SetScaleToLog10() - # lut.SetHueRange(.6667, 0.0) - # lut.Build() - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/VelocityProfile.md b/data/examples/VisualizationAlgorithms/VelocityProfile.md deleted file mode 100644 index b229c9f..0000000 --- a/data/examples/VisualizationAlgorithms/VelocityProfile.md +++ /dev/null @@ -1,7 +0,0 @@ -### Description - -This example shows shows warped planes in a structured grid dataset. The planes are warped according to flow -momentum. The relative back and forward flow are clearly visible in the deformation of the planes. - -!!! info - See [Figure 6-14b](../../../VTKBook/06Chapter6/#Figure%206-14b) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/VelocityProfile.py b/data/examples/VisualizationAlgorithms/VelocityProfile.py deleted file mode 100755 index 4b9c0db..0000000 --- a/data/examples/VisualizationAlgorithms/VelocityProfile.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python - -# Translated from velProf.tcl. - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkPolyDataNormals, - vtkStructuredGridOutlineFilter -) -from vtkmodules.vtkFiltersGeneral import vtkWarpVector -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - fileName1, fileName2 = get_program_parameters() - - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [65, 99, 149, 255]) - - # Read a vtk file - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) # Density - pl3d.SetVectorFunctionNumber(202) # Momentum - pl3d.Update() - - pl3dOutput = pl3d.GetOutput().GetBlock(0) - - # What do we know about the data? - # Get the extent of the data: imin,imax, jmin,jmax, kmin,kmax - extent = pl3dOutput.GetExtent() - scalarRange = pl3dOutput.GetScalarRange() - - # Planes are specified using a imin,imax, jmin,jmax, kmin,kmax coordinate - # specification. Min and max i,j,k values are clamped to 0 and maximum value. - # See the variable named extent for the values. - # - plane = vtkStructuredGridGeometryFilter() - plane.SetInputData(pl3dOutput) - plane.SetExtent(10, 10, 1, extent[3], 1, extent[5]) - - plane2 = vtkStructuredGridGeometryFilter() - plane2.SetInputData(pl3dOutput) - plane2.SetExtent(30, 30, 1, extent[3], 1, extent[5]) - - plane3 = vtkStructuredGridGeometryFilter() - plane3.SetInputData(pl3dOutput) - plane3.SetExtent(45, 45, 1, extent[3], 1, extent[5]) - - # We use an append filter because that way we can do the warping, etc. just - # using a single pipeline and actor. - # - appendF = vtkAppendPolyData() - appendF.AddInputConnection(plane.GetOutputPort()) - appendF.AddInputConnection(plane2.GetOutputPort()) - appendF.AddInputConnection(plane3.GetOutputPort()) - - # Warp - warp = vtkWarpVector() - warp.SetInputConnection(appendF.GetOutputPort()) - warp.SetScaleFactor(0.005) - warp.Update() - - normals = vtkPolyDataNormals() - normals.SetInputData(warp.GetPolyDataOutput()) - normals.SetFeatureAngle(45) - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(normals.GetOutputPort()) - planeMapper.SetScalarRange(scalarRange) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # The outline provides context for the data and the planes. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(planeActor) - ren.AddActor(outlineActor) - ren.SetBackground(colors.GetColor3d('BkgColor')) - - renWin.SetSize(512, 512) - renWin.SetWindowName('VelocityProfile') - - iren.Initialize() - - renWin.Render() - - ren.GetActiveCamera().SetPosition(19.8562, -31.8912, 47.0755) - ren.GetActiveCamera().SetFocalPoint(8.255, 0.147815, 29.7631) - ren.GetActiveCamera().SetViewUp(-0.0333325, 0.465756, 0.884285) - ren.GetActiveCamera().SetClippingRange(17.3078, 64.6375) - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Produce figure 6–14(b) Flow momentum from the VTK Textbook.' - epilogue = ''' - Produce figure 6–14(b) Flow momentum from the VTK Textbook. - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VisualizationAlgorithms/WarpCombustor.md b/data/examples/VisualizationAlgorithms/WarpCombustor.md deleted file mode 100644 index 168b7ae..0000000 --- a/data/examples/VisualizationAlgorithms/WarpCombustor.md +++ /dev/null @@ -1,8 +0,0 @@ -### Description - -This example demonstrates how to extract "computational planes" from a structured dataset. Structured data has a natural, logical coordinate system based on i-j-k indices. Specifying imin,imax, jmin,jmax, kmin,kmax pairs can indicate a point, line, plane, or volume of data. - -In this example, we extract three planes and warp them using scalar values in the direction of the local normal at each point. This gives a sort of "velocity profile" that indicates the nature of the flow. - -!!! info - See [Figure 9-4b](../../../VTKBook/09Chapter9/#Figure%209-4b) in [Chapter 9](../../../VTKBook/09Chapter9) The [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VisualizationAlgorithms/WarpCombustor.py b/data/examples/VisualizationAlgorithms/WarpCombustor.py deleted file mode 100755 index de5ebf9..0000000 --- a/data/examples/VisualizationAlgorithms/WarpCombustor.py +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/bin/env python - - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersCore import ( - vtkAppendPolyData, - vtkPolyDataNormals, - vtkStructuredGridOutlineFilter -) -from vtkmodules.vtkFiltersGeneral import vtkWarpScalar -from vtkmodules.vtkFiltersGeometry import vtkStructuredGridGeometryFilter -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # Here we read data from a annular combustor. A combustor burns fuel and air - # in a gas turbine (e.g., a jet engine) and the hot gas eventually makes its - # way to the turbine section. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - pl3dOutput = pl3d.GetOutput().GetBlock(0) - - # Planes are specified using a imin,imax, jmin,jmax, kmin,kmax coordinate - # specification. Min and max i,j,k values are clamped to 0 and maximum value. - # - plane = vtkStructuredGridGeometryFilter() - plane.SetInputData(pl3dOutput) - plane.SetExtent(10, 10, 1, 100, 1, 100) - - plane2 = vtkStructuredGridGeometryFilter() - plane2.SetInputData(pl3dOutput) - plane2.SetExtent(30, 30, 1, 100, 1, 100) - plane3 = vtkStructuredGridGeometryFilter() - plane3.SetInputData(pl3dOutput) - plane3.SetExtent(45, 45, 1, 100, 1, 100) - - # We use an append filter because that way we can do the warping, etc. just - # using a single pipeline and actor. - # - appendF = vtkAppendPolyData() - appendF.AddInputConnection(plane.GetOutputPort()) - appendF.AddInputConnection(plane2.GetOutputPort()) - appendF.AddInputConnection(plane3.GetOutputPort()) - - warp = vtkWarpScalar() - warp.SetInputConnection(appendF.GetOutputPort()) - warp.UseNormalOn() - warp.SetNormal(1.0, 0.0, 0.0) - warp.SetScaleFactor(2.5) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(warp.GetOutputPort()) - normals.SetFeatureAngle(60) - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(normals.GetOutputPort()) - planeMapper.SetScalarRange(pl3dOutput.GetScalarRange()) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # The outline provides context for the data and the planes. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the usual graphics stuff. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - ren1.AddActor(outlineActor) - ren1.AddActor(planeActor) - ren1.SetBackground(colors.GetColor3d('Silver')) - - renWin.SetSize(640, 480) - renWin.SetWindowName('WarpCombustor') - - # Create an initial view. - ren1.GetActiveCamera().SetClippingRange(3.95297, 50) - ren1.GetActiveCamera().SetFocalPoint(8.88908, 0.595038, 29.3342) - ren1.GetActiveCamera().SetPosition(-12.3332, 31.7479, 41.2387) - ren1.GetActiveCamera().SetViewUp(0.060772, -0.319905, 0.945498) - iren.Initialize() - - # Render the image. - # - renWin.Render() - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Extract "computational planes" from a structured dataset. ' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VolumeRendering/PseudoVolumeRendering.md b/data/examples/VolumeRendering/PseudoVolumeRendering.md deleted file mode 100644 index 3d08072..0000000 --- a/data/examples/VolumeRendering/PseudoVolumeRendering.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -This example uses 20 cut planes with opacity of 0.25. Rendered back-to-front to simulate volume rendering. - -!!! info - See [Figure 6-32](../../../VTKBook/06Chapter6/#Figure%206-32) in [Chapter 6](../../../VTKBook/06Chapter6) the [VTK Textbook](../../../VTKBook/01Chapter1). diff --git a/data/examples/VolumeRendering/PseudoVolumeRendering.py b/data/examples/VolumeRendering/PseudoVolumeRendering.py deleted file mode 100755 index 9e1f72e..0000000 --- a/data/examples/VolumeRendering/PseudoVolumeRendering.py +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import ( - vtkContourFilter, - vtkCutter, - vtkPolyDataNormals, - vtkStripper, - vtkStructuredGridOutlineFilter, - vtkTubeFilter -) -from vtkmodules.vtkFiltersExtraction import vtkExtractGrid -from vtkmodules.vtkIOParallel import vtkMultiBlockPLOT3DReader -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - xyzFile, qFile = get_program_parameters() - - colors = vtkNamedColors() - - # Create pipeline. Read structured grid data. - # - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() - - pl3dOutput = pl3d.GetOutput().GetBlock(0) - - # A convenience, use this filter to limit data for experimentation. - extract = vtkExtractGrid() - extract.SetVOI(1, 55, -1000, 1000, -1000, 1000) - extract.SetInputData(pl3dOutput) - - # The (implicit) plane is used to do the cutting - plane = vtkPlane() - plane.SetOrigin(0, 4, 2) - plane.SetNormal(0, 1, 0) - - # The cutter is set up to process each contour value over all cells - # (SetSortByToSortByCell). This results in an ordered output of polygons - # which is key to the compositing. - cutter = vtkCutter() - cutter.SetInputConnection(extract.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateCutScalarsOff() - cutter.SetSortByToSortByCell() - - clut = vtkLookupTable() - clut.SetHueRange(0, 0.67) - clut.Build() - - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) - cutterMapper.SetScalarRange(0.18, 0.7) - cutterMapper.SetLookupTable(clut) - - cut = vtkActor() - cut.SetMapper(cutterMapper) - - # Add in some surface geometry for interest. - iso = vtkContourFilter() - iso.SetInputData(pl3dOutput) - iso.SetValue(0, .22) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(iso.GetOutputPort()) - normals.SetFeatureAngle(60) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(normals.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - isoActor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - isoActor.GetProperty().SetDiffuse(0.8) - isoActor.GetProperty().SetSpecular(0.5) - isoActor.GetProperty().SetSpecularPower(30) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) - - outlineStrip = vtkStripper() - outlineStrip.SetInputConnection(outline.GetOutputPort()) - - outlineTubes = vtkTubeFilter() - outlineTubes.SetInputConnection(outline.GetOutputPort()) - outlineTubes.SetInputConnection(outlineStrip.GetOutputPort()) - outlineTubes.SetRadius(0.1) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outlineTubes.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - ren1.AddActor(isoActor) - isoActor.VisibilityOn() - ren1.AddActor(cut) - - n = 20 - opacity = 1.0 / float(n) * 5.0 - cut.GetProperty().SetOpacity(1) - ren1.SetBackground(colors.GetColor3d('SlateGray')) - - renWin.SetSize(640, 480) - renWin.SetWindowName('PseudoVolumeRendering') - - ren1.GetActiveCamera().SetClippingRange(3.95297, 50) - ren1.GetActiveCamera().SetFocalPoint(9.71821, 0.458166, 29.3999) - ren1.GetActiveCamera().SetPosition(2.7439, -37.3196, 38.7167) - ren1.GetActiveCamera().ComputeViewPlaneNormal() - ren1.GetActiveCamera().SetViewUp(-0.16123, 0.264271, 0.950876) - - # Cut: generates n cut planes normal to camera's view plane. - # - plane.SetNormal(ren1.GetActiveCamera().GetViewPlaneNormal()) - plane.SetOrigin(ren1.GetActiveCamera().GetFocalPoint()) - cutter.GenerateValues(n, -5, 5) - clut.SetAlphaRange(opacity, opacity) - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Perform psuedo volume rendering in a structured grid by compositing translucent cut planes.' - epilogue = ''' - This same trick can be used for unstructured grids. - Note that for better results, more planes can be created. - Also, if your data is vtkImageData, there are much faster - methods for volume rendering. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename1', help='combxyz.bin.') - parser.add_argument('filename2', help='combq.bin.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': - main() diff --git a/data/examples/VolumeRendering/SimpleRayCast.md b/data/examples/VolumeRendering/SimpleRayCast.md deleted file mode 100644 index 52eabcb..0000000 --- a/data/examples/VolumeRendering/SimpleRayCast.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -Volume rendering of a high potential iron protein. - -!!! info - See [Figure 7-34](../../../VTKBook/07Chapter7/#Figure%207-34) in [Chapter 7](../../../VTKBook/07Chapter7) the [VTK Textbook](../../../VTKBook/01Chapter1/). diff --git a/data/examples/VolumeRendering/SimpleRayCast.py b/data/examples/VolumeRendering/SimpleRayCast.py deleted file mode 100755 index 4031fd9..0000000 --- a/data/examples/VolumeRendering/SimpleRayCast.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonDataModel import vtkPiecewiseFunction -from vtkmodules.vtkIOLegacy import vtkStructuredPointsReader -from vtkmodules.vtkRenderingCore import ( - vtkColorTransferFunction, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkVolume, - vtkVolumeProperty -) -from vtkmodules.vtkRenderingVolume import vtkFixedPointVolumeRayCastMapper -# noinspection PyUnresolvedReferences -from vtkmodules.vtkRenderingVolumeOpenGL2 import vtkOpenGLRayCastImageDisplayHelper - - -def main(): - fileName = get_program_parameters() - - colors = vtkNamedColors() - - # This is a simple volume rendering example that - # uses a vtkFixedPointVolumeRayCastMapper - - # Create the standard renderer, render window - # and interactor. - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the reader for the data. - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - # Create transfer mapping scalar value to opacity. - opacityTransferFunction = vtkPiecewiseFunction() - opacityTransferFunction.AddPoint(20, 0.0) - opacityTransferFunction.AddPoint(255, 0.2) - - # Create transfer mapping scalar value to color. - colorTransferFunction = vtkColorTransferFunction() - colorTransferFunction.AddRGBPoint(0.0, 0.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(64.0, 1.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(128.0, 0.0, 0.0, 1.0) - colorTransferFunction.AddRGBPoint(192.0, 0.0, 1.0, 0.0) - colorTransferFunction.AddRGBPoint(255.0, 0.0, 0.2, 0.0) - - # The property describes how the data will look. - volumeProperty = vtkVolumeProperty() - volumeProperty.SetColor(colorTransferFunction) - volumeProperty.SetScalarOpacity(opacityTransferFunction) - volumeProperty.ShadeOn() - volumeProperty.SetInterpolationTypeToLinear() - - # The mapper / ray cast function know how to render the data. - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(reader.GetOutputPort()) - - # The volume holds the mapper and the property and - # can be used to position/orient the volume. - volume = vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - - ren1.AddVolume(volume) - ren1.SetBackground(colors.GetColor3d('Wheat')) - ren1.GetActiveCamera().Azimuth(45) - ren1.GetActiveCamera().Elevation(30) - ren1.ResetCameraClippingRange() - ren1.ResetCamera() - - renWin.SetSize(600, 600) - renWin.SetWindowName('SimpleRayCast') - renWin.Render() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'Volume rendering of a high potential iron protein.' - epilogue = ''' - This is a simple volume rendering example that uses a vtkFixedPointVolumeRayCastMapper. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='ironProt.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/BalloonWidget.py b/data/examples/Widgets/BalloonWidget.py deleted file mode 100755 index 3e22d50..0000000 --- a/data/examples/Widgets/BalloonWidget.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import ( - vtkRegularPolygonSource, - vtkSphereSource -) -from vtkmodules.vtkInteractionWidgets import ( - vtkBalloonRepresentation, - vtkBalloonWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # Sphere. - sphere_source = vtkSphereSource() - sphere_source.SetCenter(-4.0, 0.0, 0.0) - sphere_source.SetRadius(4.0) - - sphere_mapper = vtkPolyDataMapper() - sphere_mapper.SetInputConnection(sphere_source.GetOutputPort()) - - sphereActor = vtkActor() - sphereActor.SetMapper(sphere_mapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Regular Polygon. - regular_polygon_source = vtkRegularPolygonSource() - regular_polygon_source.SetCenter(4.0, 0.0, 0.0) - regular_polygon_source.SetRadius(4.0) - - regular_polygon_mapper = vtkPolyDataMapper() - regular_polygon_mapper.SetInputConnection(regular_polygon_source.GetOutputPort()) - - regularPolygonActor = vtkActor() - regularPolygonActor.SetMapper(regular_polygon_mapper) - regularPolygonActor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - - # A renderer and render window. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetWindowName('BalloonWidget') - - # An interactor. - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # Create the widget. - balloonRep = vtkBalloonRepresentation() - balloonRep.SetBalloonLayoutToImageRight() - - balloonWidget = vtkBalloonWidget() - balloonWidget.SetInteractor(iren) - balloonWidget.SetRepresentation(balloonRep) - balloonWidget.AddBalloon(sphereActor, 'This is a sphere') - balloonWidget.AddBalloon(regularPolygonActor, 'This is a regular polygon') - - # Add the actors to the scene. - ren.AddActor(sphereActor) - ren.AddActor(regularPolygonActor) - ren.SetBackground(colors.GetColor3d('SlateGray')) - - # Render an image (lights and cameras are created automatically). - ren_win.Render() - balloonWidget.EnabledOn() - - # Begin mouse interaction. - iren.Start() - iren.Initialize() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/BoxWidget.md b/data/examples/Widgets/BoxWidget.md deleted file mode 100644 index 2a12e7f..0000000 --- a/data/examples/Widgets/BoxWidget.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example uses a vtkBoxWidget to manipulate an actor. The class includes geometry to draw a box around the object, which is bound to it via *SetProp3D*. The box is dimensioned using the `SetPlaceFactor` method, and positioned with the `PlaceWidget` method. After the initial setup, synchronizing the box with the object is done through a custom callback class, which is passed to the box widget through the `AddObserver` method. - -For a widget that isn't tied to a specific vtkProp3D and has its geometric representation separate from the interaction logic, see the example [BoxWidget2](../BoxWidget2) - to be written. diff --git a/data/examples/Widgets/BoxWidget.py b/data/examples/Widgets/BoxWidget.py deleted file mode 100755 index 86645d3..0000000 --- a/data/examples/Widgets/BoxWidget.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonTransforms import vtkTransform -from vtkmodules.vtkFiltersSources import vtkConeSource -from vtkmodules.vtkInteractionWidgets import vtkBoxWidget -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -# Call back function to resize the cone - - -def boxCallback(obj, event): - t = vtkTransform() - obj.GetTransform(t) - obj.GetProp3D().SetUserTransform(t) - - -def main(): - colors = vtkNamedColors() - - # Create a Cone - cone = vtkConeSource() - cone.SetResolution(20) - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('BurlyWood')) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Blue')) - renderer.AddActor(coneActor) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName('BoxWidget') - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # A Box widget - boxWidget = vtkBoxWidget() - boxWidget.SetInteractor(interactor) - boxWidget.SetProp3D(coneActor) - boxWidget.SetPlaceFactor(1.25) # Make the box 1.25x larger than the actor - boxWidget.PlaceWidget() - boxWidget.On() - - # Connect the event to a function - boxWidget.AddObserver('InteractionEvent', boxCallback) - - # Start - interactor.Initialize() - renwin.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/CameraOrientationWidget.md b/data/examples/Widgets/CameraOrientationWidget.md deleted file mode 100644 index bc298c9..0000000 --- a/data/examples/Widgets/CameraOrientationWidget.md +++ /dev/null @@ -1,17 +0,0 @@ -### Description - -This example demonstrates a 3D camera orientation gizmo. - -The widget representation has shafts and -little spheres with text on them. The spheres always -follow the camera. - -The widget representation's orientation is synchronized with -the camera of the parent renderer. - -To look down on any particular axis, simply click on -a handle. - -To rotate the camera and get a feel of the camera orientation, -either move mouse in the renderer or click on a handle -and move it around. diff --git a/data/examples/Widgets/CameraOrientationWidget.py b/data/examples/Widgets/CameraOrientationWidget.py deleted file mode 100755 index c5a055f..0000000 --- a/data/examples/Widgets/CameraOrientationWidget.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -# This example demonstrates how to use the vtkCameraOrientationWidget to control -# a renderer's camera orientation. - -from pathlib import Path - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionWidgets import vtkCameraOrientationWidget -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Demonstrates a 3D camera orientation widget.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('path', help='The path to the file to render e.g. cow.vtp.') - args = parser.parse_args() - return args.path - - -def main(): - colors = vtkNamedColors() - - path = get_program_parameters() - if not Path(path).is_file(): - print('Unable to find the file:', path) - return - - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - interactor = vtkRenderWindowInteractor() - - reader = vtkXMLPolyDataReader() - reader.SetFileName(path) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Beige')) - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DimGray')) - - ren_win.AddRenderer(renderer) - ren_win.SetSize(600, 600) - ren_win.SetWindowName('CameraOrientationWidget') - - # Important: The interactor must be set prior to enabling the widget. - interactor.SetRenderWindow(ren_win) - - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - ren_win.Render() - interactor.Initialize() - interactor.Start() - - -if __name__ == "__main__": - main() diff --git a/data/examples/Widgets/CompassWidget.md b/data/examples/Widgets/CompassWidget.md deleted file mode 100644 index 55b97d1..0000000 --- a/data/examples/Widgets/CompassWidget.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example creates a compass widget in the top right corner of the window. The widget can be used to modify the camera position via its distance and tilt sliders and its heading compass wheel. - -Note for this example to work correctly VTK with version >= 9.2.20220831 is required. diff --git a/data/examples/Widgets/CompassWidget.py b/data/examples/Widgets/CompassWidget.py deleted file mode 100755 index 67667ce..0000000 --- a/data/examples/Widgets/CompassWidget.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python3 - -import math -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonCore import ( - VTK_VERSION_NUMBER, - vtkCommand, - vtkMath, - vtkVersion -) -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkRenderingAnnotation import vtkAnnotatedCubeActor -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - -try: - from vtkmodules.vtkInteractionWidgets import ( - vtkCompassRepresentation, - vtkCompassWidget - ) -except: - from vtkmodules.vtkGeovisCore import ( - vtkCompassRepresentation, - vtkCompassWidget - ) - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Major version. - :param minor: Minor version. - :param build: Build version. - :return: True if the requested VTK version is greater or equal to the actual VTK version. - """ - needed_version = 10000000000 * int(major) \ - + 100000000 * int(minor) \ - + int(build) - try: - vtk_version_number = VTK_VERSION_NUMBER - except AttributeError: - # Expand component-wise comparisons for VTK versions < 8.90. - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() \ - + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: - return False - -def CompassWidgetValueChangedCallback(widget, event): - """ - Callback to set the camera position according to the position parameters given by the vtkCompassWidget. - """ - try: - camera = widget.GetCurrentRenderer().GetActiveCamera() - except AttributeError: - return - - # calculate new camera position from compass widget parameters - distance = widget.GetDistance() - tilt = widget.GetTilt() - heading = widget.GetHeading() - - x = distance * math.cos(vtkMath.RadiansFromDegrees(heading)) * math.cos(vtkMath.RadiansFromDegrees(tilt)) - y = distance * math.sin(vtkMath.RadiansFromDegrees(heading)) * math.cos(vtkMath.RadiansFromDegrees(tilt)) - z = distance * math.sin(vtkMath.RadiansFromDegrees(tilt)) - - camera.SetPosition(x, y, z) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.SetClippingRange(0.1, distance + 1) - - widget.GetCurrentRenderer().Render() - - - -def main(): - use_improved_compass_widget = vtk_version_ok(9, 2, 20220831) - - colors = vtkNamedColors() - - actor = vtkAnnotatedCubeActor() - actor.GetCubeProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # a renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - - # an interactor - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - # create the widget and its representation - compassRepresentation = vtkCompassRepresentation() - - compassWidget = vtkCompassWidget() - compassWidget.SetInteractor(renderWindowInteractor) - compassWidget.SetRepresentation(compassRepresentation) - - # add a callback to update the camera position on vtkCommand::WidgetValueChangedEvent - compassWidget.AddObserver(vtkCommand.WidgetValueChangedEvent, CompassWidgetValueChangedCallback) - - if use_improved_compass_widget: - compassRepresentation.SetMinimumDistance(2) - compassRepresentation.SetMaximumDistance(10) - compassWidget.SetDistance(5) - compassWidget.SetTiltSpeed(45) - compassWidget.SetDistanceSpeed(2) - - # add the actors to the scene - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('CompassWidget') - - renderWindow.Render() - compassWidget.EnabledOn() - - if use_improved_compass_widget: - # no interactor style - camera is moved by widget callback - renderWindowInteractor.SetInteractorStyle(None) - # set camera to initial position - compassWidget.InvokeEvent(vtkCommand.WidgetValueChangedEvent) - - # begin interaction - renderWindowInteractor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/ContourWidget.md b/data/examples/Widgets/ContourWidget.md deleted file mode 100644 index 568b1f4..0000000 --- a/data/examples/Widgets/ContourWidget.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example generates a set of points which lie on a circle, and the contour through these points. This contour can be interactively warped/modified by dragging the control points. diff --git a/data/examples/Widgets/ContourWidget.py b/data/examples/Widgets/ContourWidget.py deleted file mode 100755 index 1067b9f..0000000 --- a/data/examples/Widgets/ContourWidget.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/python3 - -import math -import sys - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkPoints -) -from vtkmodules.vtkCommonDataModel import ( - vtkCellArray, - vtkPolyData -) -from vtkmodules.vtkInteractionWidgets import ( - vtkContourWidget, - vtkOrientedGlyphContourRepresentation, - vtkWidgetEvent -) -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.1, 0.2, 0.4, 1.0]) - - # Create the RenderWindow, Renderer and both Actors - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('ContourWidget') - renderWindow.SetSize(600, 600) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - contourRep = vtkOrientedGlyphContourRepresentation() - contourRep.GetLinesProperty().SetColor(colors.GetColor3d('Red')) - - contourWidget = vtkContourWidget() - contourWidget.SetInteractor(interactor) - contourWidget.SetRepresentation(contourRep) - contourWidget.On() - - for arg in sys.argv: - if '-Shift' == arg: - contourWidget.GetEventTranslator().RemoveTranslation( - vtkCommand.LeftButtonPressEvent) - contourWidget.GetEventTranslator().SetTranslation( - vtkCommand.LeftButtonPressEvent, - vtkWidgetEvent.Translate) - elif '-Scale' == arg: - contourWidget.GetEventTranslator().RemoveTranslation( - vtkCommand.LeftButtonPressEvent) - contourWidget.GetEventTranslator().SetTranslation( - vtkCommand.LeftButtonPressEvent, - vtkWidgetEvent.Scale) - - pd = vtkPolyData() - - points = vtkPoints() - - num_pts = 21 - for i in range(0, num_pts): - angle = 2.0 * math.pi * i / 20.0 - points.InsertPoint(i, 0.1 * math.cos(angle), - 0.1 * math.sin(angle), 0.0) - # lines.InsertNextCell(i) - vertex_indices = list(range(0, num_pts)) - vertex_indices.append(0) - lines = vtkCellArray() - lines.InsertNextCell(num_pts + 1, vertex_indices) - - pd.SetPoints(points) - pd.SetLines(lines) - - # contourWidget.Initialize(pd, 1) - contourWidget.Initialize(pd, 1) - contourWidget.Render() - renderer.ResetCamera() - renderWindow.Render() - - interactor.Initialize() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/EmbedInPyQt.md b/data/examples/Widgets/EmbedInPyQt.md deleted file mode 100644 index 147eb02..0000000 --- a/data/examples/Widgets/EmbedInPyQt.md +++ /dev/null @@ -1,6 +0,0 @@ -### Description - -'''Minimal working example of vtk embedding in PyQt.''' - -*Contributed by Michka Popoff, inspired by the example from Eric E Monson -*See notes at the end for more details. diff --git a/data/examples/Widgets/EmbedInPyQt.py b/data/examples/Widgets/EmbedInPyQt.py deleted file mode 100755 index 0e280b1..0000000 --- a/data/examples/Widgets/EmbedInPyQt.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from PyQt4 import QtGui -from qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderer -) - - -class MainWindow(QtGui.QMainWindow): - - def __init__(self, parent=None): - QtGui.QMainWindow.__init__(self, parent) - - self.frame = QtGui.QFrame() - - self.vl = QtGui.QVBoxLayout() - self.vtkWidget = QVTKRenderWindowInteractor(self.frame) - self.vl.addWidget(self.vtkWidget) - - self.ren = vtkRenderer() - self.vtkWidget.GetRenderWindow().AddRenderer(self.ren) - self.iren = self.vtkWidget.GetRenderWindow().GetInteractor() - - # Create source - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(5.0) - - # Create a mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # Create an actor - actor = vtkActor() - actor.SetMapper(mapper) - - self.ren.AddActor(actor) - - self.ren.ResetCamera() - - self.frame.setLayout(self.vl) - self.setCentralWidget(self.frame) - - self.show() - self.iren.Initialize() - - -if __name__ == "__main__": - app = QtGui.QApplication(sys.argv) - - window = MainWindow() - - sys.exit(app.exec_()) diff --git a/data/examples/Widgets/EmbedInPyQt2.md b/data/examples/Widgets/EmbedInPyQt2.md deleted file mode 100644 index 7c85c2e..0000000 --- a/data/examples/Widgets/EmbedInPyQt2.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -Another example on how to embed VTK in PyQT, with a QVTKRenderWindowInteractor diff --git a/data/examples/Widgets/EmbedInPyQt2.py b/data/examples/Widgets/EmbedInPyQt2.py deleted file mode 100755 index f25511d..0000000 --- a/data/examples/Widgets/EmbedInPyQt2.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python3 -# Contributed by Eric E Monson - -import sys - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from PyQt4 import QtGui -from PyQt4.QtGui import QApplication -from qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderer -) - - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(603, 553) - self.centralWidget = QtGui.QWidget(MainWindow) - self.gridlayout = QtGui.QGridLayout(self.centralWidget) - self.vtkWidget = QVTKRenderWindowInteractor(self.centralWidget) - self.gridlayout.addWidget(self.vtkWidget, 0, 0, 1, 1) - MainWindow.setCentralWidget(self.centralWidget) - - -class SimpleView(QtGui.QMainWindow): - - def __init__(self, parent=None): - QtGui.QMainWindow.__init__(self, parent) - self.ui = Ui_MainWindow() - self.ui.setupUi(self) - self.ren = vtkRenderer() - self.ui.vtkWidget.GetRenderWindow().AddRenderer(self.ren) - self.iren = self.ui.vtkWidget.GetRenderWindow().GetInteractor() - - # Create source - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(5.0) - - # Create a mapper - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - # Create an actor - actor = vtkActor() - actor.SetMapper(mapper) - - self.ren.AddActor(actor) - - -if __name__ == "__main__": - app = QApplication(sys.argv) - window = SimpleView() - window.show() - window.iren.Initialize() # Need this line to actually show the render inside Qt - sys.exit(app.exec_()) diff --git a/data/examples/Widgets/ImplicitPlaneWidget2.md b/data/examples/Widgets/ImplicitPlaneWidget2.md deleted file mode 100644 index b0f4357..0000000 --- a/data/examples/Widgets/ImplicitPlaneWidget2.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -This example shows how to use the second generation ImplicitPlaneWidget2 to interactively define the clipping plane for a polydata. If no arguments are specified, a vtkSphereSource generates the polydata. By specifying a .vtp file, the example can operate on arbitrary polydata. - -For example, try `src/Testing/Data/cow.vtp`. diff --git a/data/examples/Widgets/ImplicitPlaneWidget2.py b/data/examples/Widgets/ImplicitPlaneWidget2.py deleted file mode 100755 index 473c075..0000000 --- a/data/examples/Widgets/ImplicitPlaneWidget2.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 - -from pathlib import Path - -# You may need to uncomment one or more of the following imports. -# If vtkRenderWindow is used and you want to use OpenGL, -# you also need the vtkRenderingOpenGL2 module. -# If vtkRenderWindowInteractor is used, uncomment vtkInteractionStyle -# If text rendering is used, uncomment vtkRenderingFreeType. -# -# If using PyCharm, preface each one you select with this line: -# noinspection PyUnresolvedReferences -# -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -# import vtkmodules.vtkRenderingContextOpenGL2 -# import vtkmodules.vtkRenderingFreeType -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingUI -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkCommand -from vtkmodules.vtkCommonDataModel import vtkPlane -from vtkmodules.vtkFiltersCore import ( - vtkClipPolyData -) -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionWidgets import ( - vtkImplicitPlaneRepresentation, - vtkImplicitPlaneWidget2 -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkProperty, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(fn): - colors = vtkNamedColors() - sphere_source = vtkSphereSource() - sphere_source.SetRadius(10.0) - - fp = None - if fn: - fp = Path(fn) - if not (fp.is_file() and fp.suffix == '.vtp'): - print('Expected an existing file name with extension .vtp:') - print('Got', fp) - return - - # Setup a visualization pipeline. - plane = vtkPlane() - clipper = vtkClipPolyData() - clipper.SetClipFunction(plane) - clipper.InsideOutOn() - if fn: - reader = vtkXMLPolyDataReader() - reader.SetFileName(fp) - clipper.SetInputConnection(reader.GetOutputPort()) - else: - clipper.SetInputConnection(sphere_source.GetOutputPort()) - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(clipper.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - - back_faces = vtkProperty() - back_faces.SetDiffuseColor(colors.GetColor3d('Gold')) - - actor.SetBackfaceProperty(back_faces) - - # A renderer and render window - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetWindowName('ImplicitPlaneWidget2') - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - # An interactor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - # The callback will do the work. - my_callback = IPWCallback(plane) - - rep = vtkImplicitPlaneRepresentation() - rep.SetPlaceFactor(1.25) # This must be set prior to placing the widget - rep.PlaceWidget(actor.GetBounds()) - rep.SetNormal(plane.GetNormal()) - - plane_widget = vtkImplicitPlaneWidget2() - plane_widget.SetInteractor(iren) - plane_widget.SetRepresentation(rep) - plane_widget.AddObserver(vtkCommand.InteractionEvent, my_callback) - - renderer.GetActiveCamera().Azimuth(-60) - renderer.GetActiveCamera().Elevation(30) - renderer.ResetCamera() - renderer.GetActiveCamera().Zoom(0.75) - - # Render and interact. - iren.Initialize() - ren_win.Render() - plane_widget.On() - - # Begin mouse interaction. - iren.Start() - - -class IPWCallback: - def __init__(self, plane): - self.plane = plane - - def __call__(self, caller, ev): - rep = caller.GetRepresentation() - rep.GetPlane(self.plane) - - -def get_program_parameters(): - import argparse - description = 'How to use the second generation ImplicitPlaneWidget2 to interactively' \ - ' define the clipping plane for a polydata.' - epilogue = ''' - If no arguments are specified, a vtkSphereSource generates the polydata. - By specifying a .vtp file, the example can operate on arbitrary polydata. -''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('file_name', nargs='?', default=None, help='A VTK Poly Data file e.g. cow.vtp') - - args = parser.parse_args() - return args.file_name - - -if __name__ == '__main__': - file_name = get_program_parameters() - main(file_name) diff --git a/data/examples/Widgets/OrientationMarkerWidget.py b/data/examples/Widgets/OrientationMarkerWidget.py deleted file mode 100755 index 3a99c5e..0000000 --- a/data/examples/Widgets/OrientationMarkerWidget.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -# Contributed by Eric E Monson - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkCubeSource -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingAnnotation import vtkAnnotatedCubeActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.2, 0.3, 0.7, 1.0]) - - # create a rendering window and renderer - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - ren_win.SetWindowName('OrientationMarkerWidget') - - # create a renderwindowinteractor - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - cube = vtkCubeSource() - cube.SetXLength(200) - cube.SetYLength(200) - cube.SetZLength(200) - cube.Update() - cm = vtkPolyDataMapper() - cm.SetInputConnection(cube.GetOutputPort()) - ca = vtkActor() - ca.SetMapper(cm) - ca.GetProperty().SetColor(colors.GetColor3d("BurlyWood")) - ca.GetProperty().EdgeVisibilityOn() - ca.GetProperty().SetEdgeColor(colors.GetColor3d("Red")) - - # assign actor to the renderer - ren.AddActor(ca) - ren.SetBackground(colors.GetColor3d('CornflowerBlue')) - - axes_actor = vtkAnnotatedCubeActor() - axes_actor.SetXPlusFaceText('L') - axes_actor.SetXMinusFaceText('R') - axes_actor.SetYMinusFaceText('I') - axes_actor.SetYPlusFaceText('S') - axes_actor.SetZMinusFaceText('P') - axes_actor.SetZPlusFaceText('A') - axes_actor.GetTextEdgesProperty().SetColor(colors.GetColor3d("Yellow")) - axes_actor.GetTextEdgesProperty().SetLineWidth(2) - axes_actor.GetCubeProperty().SetColor(colors.GetColor3d("Blue")) - axes = vtkOrientationMarkerWidget() - axes.SetOrientationMarker(axes_actor) - axes.SetInteractor(iren) - axes.EnabledOn() - axes.InteractiveOn() - ren.ResetCamera() - - # enable user interface interactor - iren.Initialize() - ren_win.Render() - ren.GetActiveCamera().Azimuth(45) - ren.GetActiveCamera().Elevation(30) - ren_win.Render() - iren.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/OrientationMarkerWidget1.md b/data/examples/Widgets/OrientationMarkerWidget1.md deleted file mode 100644 index 92ec8d6..0000000 --- a/data/examples/Widgets/OrientationMarkerWidget1.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example uses a polydata as an orientation icon. You can get the bunny data `src/Testing/Data/Bunny.vtp`. diff --git a/data/examples/Widgets/OrientationMarkerWidget1.py b/data/examples/Widgets/OrientationMarkerWidget1.py deleted file mode 100755 index d605117..0000000 --- a/data/examples/Widgets/OrientationMarkerWidget1.py +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSuperquadricSource -from vtkmodules.vtkIOXML import vtkXMLPolyDataReader -from vtkmodules.vtkInteractionWidgets import vtkOrientationMarkerWidget -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(): - colors = vtkNamedColors() - - file_name = get_program_parameters() - - # Read the polydata for the icon - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - - icon_mapper = vtkDataSetMapper() - icon_mapper.SetInputConnection(reader.GetOutputPort()) - - icon_actor = vtkActor() - icon_actor.SetMapper(icon_mapper) - icon_actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Set up the renderer, window, and interactor - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) - - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(400, 400) - ren_win.SetWindowName('OrientationMarkerWidget1') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - rgb = [0.0, 0.0, 0.0] - colors.GetColorRGB('Wheat', rgb) - # Set up the widget - widget = vtkOrientationMarkerWidget() - widget.SetOrientationMarker(icon_actor) - widget.SetInteractor(iren) - widget.SetViewport(0.0, 0.0, 0.2, 0.2) - widget.SetOutlineColor(*rgb) - widget.SetEnabled(1) - widget.InteractiveOn() - - # Create a superquadric - superquadric_source = vtkSuperquadricSource() - superquadric_source.SetPhiRoundness(.2) - superquadric_source.SetThetaRoundness(.8) - - # Create a mapper and actor - superquadric_mapper = vtkPolyDataMapper() - superquadric_mapper.SetInputConnection(superquadric_source.GetOutputPort()) - - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - superquadric_actor.GetProperty().SetInterpolationToFlat() - superquadric_actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Carrot')) - superquadric_actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - superquadric_actor.GetProperty().SetDiffuse(0.6) - superquadric_actor.GetProperty().SetSpecular(0.5) - superquadric_actor.GetProperty().SetSpecularPower(5.0) - - renderer.AddActor(superquadric_actor) - renderer.ResetCamera() - - ren_win.Render() - - iren.Initialize() - - iren.Start() - - -def get_program_parameters(): - import argparse - description = 'OrientationMarkerWidget1' - epilogue = """ - """ - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('file_name', help='Bunny.vtp') - args = parser.parse_args() - return args.file_name - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/ScalarBarWidget.md b/data/examples/Widgets/ScalarBarWidget.md deleted file mode 100644 index d628587..0000000 --- a/data/examples/Widgets/ScalarBarWidget.md +++ /dev/null @@ -1,5 +0,0 @@ -### Description - -Display a movable and resizable scalar bar. - -An example input file is uGridEx.vtk (folder Data at [VTKData](http://vtk.org/gitweb?p=VTKData.git;a=tree)). diff --git a/data/examples/Widgets/ScalarBarWidget.py b/data/examples/Widgets/ScalarBarWidget.py deleted file mode 100755 index 2a06cec..0000000 --- a/data/examples/Widgets/ScalarBarWidget.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 - -# by Panos Mavrogiorgos, email : pmav99 >a< gmail - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import vtkLookupTable -from vtkmodules.vtkIOLegacy import vtkUnstructuredGridReader -from vtkmodules.vtkInteractionWidgets import vtkScalarBarWidget -from vtkmodules.vtkRenderingAnnotation import vtkScalarBarActor -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkDataSetMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def get_program_parameters(): - import argparse - description = 'Scalar bar widget.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='uGridEx.vtkp') - args = parser.parse_args() - return args.filename - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.1, 0.2, 0.4, 1.0]) - - # The source file - file_name = get_program_parameters() - - # Create a custom lut. The lut is used for both at the mapper and at the - # scalar_bar - lut = vtkLookupTable() - lut.Build() - - # Read the source file. - reader = vtkUnstructuredGridReader() - reader.SetFileName(file_name) - reader.Update() # Needed because of GetScalarRange - output = reader.GetOutput() - scalar_range = output.GetScalarRange() - - mapper = vtkDataSetMapper() - mapper.SetInputData(output) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) - - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MidnightBLue')) - - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - render_window.SetSize(300, 300) - render_window.SetWindowName("ScalarBarWidget") - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - # create the scalar_bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetOrientationToHorizontal() - scalar_bar.SetLookupTable(lut) - - # create the scalar_bar_widget - scalar_bar_widget = vtkScalarBarWidget() - scalar_bar_widget.SetInteractor(interactor) - scalar_bar_widget.SetScalarBarActor(scalar_bar) - scalar_bar_widget.On() - - interactor.Initialize() - render_window.Render() - renderer.GetActiveCamera().SetPosition(-6.4, 10.3, 1.4) - renderer.GetActiveCamera().SetFocalPoint(1.0, 0.5, 3.0) - renderer.GetActiveCamera().SetViewUp(0.6, 0.4, -0.7) - render_window.Render() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/SphereWidget.md b/data/examples/Widgets/SphereWidget.md deleted file mode 100644 index 87c31fb..0000000 --- a/data/examples/Widgets/SphereWidget.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows how to use the SphereWidget. diff --git a/data/examples/Widgets/SphereWidget.py b/data/examples/Widgets/SphereWidget.py deleted file mode 100755 index 2731af6..0000000 --- a/data/examples/Widgets/SphereWidget.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkInteractionWidgets import vtkSphereWidget -from vtkmodules.vtkRenderingCore import ( - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -# Call back function - - -def sphereCallback(obj, event): - print('Center: {}, {}, {}'.format(*obj.GetCenter())) - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.1, 0.2, 0.4, 1.0]) - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('MidnightBlue')) - - renwin = vtkRenderWindow() - renwin.AddRenderer(renderer) - renwin.SetWindowName("SphereWidget") - - # An interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - # A Sphere widget - sphereWidget = vtkSphereWidget() - sphereWidget.SetInteractor(interactor) - sphereWidget.SetRepresentationToSurface() - sphereWidget.GetSphereProperty().SetColor(colors.GetColor3d("BurlyWood")) - - # Connect the event to a function - sphereWidget.AddObserver("InteractionEvent", sphereCallback) - - # Start - interactor.Initialize() - renwin.Render() - sphereWidget.On() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/Widgets/SplineWidget.md b/data/examples/Widgets/SplineWidget.md deleted file mode 100644 index 67bd583..0000000 --- a/data/examples/Widgets/SplineWidget.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -This example shows how to use vtkSplineWidget with a callback being used to get the length of the spline widget. diff --git a/data/examples/Widgets/SplineWidget.py b/data/examples/Widgets/SplineWidget.py deleted file mode 100755 index 62f736c..0000000 --- a/data/examples/Widgets/SplineWidget.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/python3 - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 - -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkCommonCore import ( - vtkCommand, - vtkVersion -) -from vtkmodules.vtkFiltersSources import vtkCylinderSource -from vtkmodules.vtkInteractionStyle import vtkInteractorStyleTrackballCamera -from vtkmodules.vtkInteractionWidgets import ( - vtkCameraOrientationWidget, - vtkSplineWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer -) - - -def main(argv): - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', [82, 87, 110, 255]) - - has_cow = False - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - has_cow = True - - window_width = 1024 - window_height = 1024 - - ren_win = vtkRenderWindow() - ren_win.SetSize(window_width, window_height) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - - # Create a cylinder. - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.SetRadius(3.0) - cylinder.SetHeight(5.0) - cylinder.SetResolution(100) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cylinder.GetOutputPort()) - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - actor.SetMapper(mapper) - # Add the actor to the scene - renderer.AddActor(actor) - - ren_win.AddRenderer(renderer) - - # A spline widget - spline_widget = vtkSplineWidget() - spline_widget.SetInteractor(iren) - spline_widget.SetProp3D(actor) - spline_widget.PlaceWidget(-2.5, 2.5, 3.5, 3.5, 0, 0, ) - spline_widget.On() - - spline_widget.AddObserver(vtkCommand.EndInteractionEvent, SplineCallback(spline_widget)) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) - - if has_cow: - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - ren_win.Render() - ren_win.SetWindowName('SplineWidget') - iren.Start() - - -def vtk_version_ok(major, minor, build): - """ - Check the VTK version. - - :param major: Requested major version. - :param minor: Requested minor version. - :param build: Requested build version. - :return: True if the requested VTK version is >= the actual VTK version. - """ - requested_version = (100 * int(major) + int(minor)) * 100000000 + int(build) - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: - return False - - -class SplineCallback: - def __init__(self, spline_widget): - self.spline = spline_widget - - def __call__(self, caller, ev): - spline_widget = caller - length = spline_widget.GetSummedLength() - print(f'Length: {length}') - - -if __name__ == '__main__': - import sys - - main(sys.argv) diff --git a/data/examples/Widgets/TextWidget.md b/data/examples/Widgets/TextWidget.md deleted file mode 100644 index 9e44ba6..0000000 --- a/data/examples/Widgets/TextWidget.md +++ /dev/null @@ -1,3 +0,0 @@ -### Description - -A simple example of annotating a VTK image with movable and resizable text. diff --git a/data/examples/Widgets/TextWidget.py b/data/examples/Widgets/TextWidget.py deleted file mode 100755 index 064e620..0000000 --- a/data/examples/Widgets/TextWidget.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python3 - -# by Panos Mavrogiorgos, email : pmav99 >a< gmail - -# noinspection PyUnresolvedReferences -import vtkmodules.vtkInteractionStyle -# noinspection PyUnresolvedReferences -import vtkmodules.vtkRenderingOpenGL2 -from vtkmodules.vtkCommonColor import vtkNamedColors -from vtkmodules.vtkFiltersSources import vtkSphereSource -from vtkmodules.vtkInteractionWidgets import ( - vtkTextRepresentation, - vtkTextWidget -) -from vtkmodules.vtkRenderingCore import ( - vtkActor, - vtkPolyDataMapper, - vtkRenderWindow, - vtkRenderWindowInteractor, - vtkRenderer, - vtkTextActor -) - - -def main(): - colors = vtkNamedColors() - - # colors.SetColor('bkg', [0.1, 0.2, 0.4, 1.0]) - - source = vtkSphereSource() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(source.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - # Create the TextActor - text_actor = vtkTextActor() - text_actor.SetInput('This is a test') - text_actor.GetTextProperty().SetColor(colors.GetColor3d('Lime')) - - # Create the text representation. Used for positioning the text_actor - text_representation = vtkTextRepresentation() - text_representation.GetPositionCoordinate().SetValue(0.15, 0.15) - text_representation.GetPosition2Coordinate().SetValue(0.7, 0.2) - - # Create the TextWidget - # Note that the SelectableOff method MUST be invoked! - # According to the documentation : - # - # SelectableOn/Off indicates whether the interior region of the widget can be - # selected or not. If not, then events (such as left mouse down) allow the user - # to 'move' the widget, and no selection is possible. Otherwise the - # SelectRegion() method is invoked. - text_widget = vtkTextWidget() - text_widget.SetRepresentation(text_representation) - - text_widget.SetInteractor(interactor) - text_widget.SetTextActor(text_actor) - text_widget.SelectableOff() - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MidnightBLue')) - render_window.SetSize(300, 300) - render_window.SetWindowName('TextWidget') - - interactor.Initialize() - render_window.Render() - text_widget.On() - interactor.Start() - - -if __name__ == '__main__': - main() diff --git a/data/examples/index.json b/data/examples/index.json deleted file mode 100644 index 5b02210..0000000 --- a/data/examples/index.json +++ /dev/null @@ -1,9391 +0,0 @@ -{ - "vtkOBBTree": [ - "PolyData/AlignTwoPolyDatas.py" - ], - "vtkVariantEqual": [ - "Utilities/Variant.py" - ], - "vtkSequencePass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Shadows.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkClass": [ - "Utilities/VTKImportsForPython.py" - ], - "vtkImageMapper": [ - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkCurvatures": [ - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Visualization/CurvatureBandsWithGlyphs.py" - ], - "vtkToneMappingPass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkStructuredPointsReader": [ - "Modelling/ExtractLargestIsosurface.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutSphere.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/Motor.py", - "Visualization/ComplexV.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkParametricCrossCap": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkImagingHybrid": [ - "Filtering/GaussianSplat.py", - "Filtering/PerlinNoise.py", - "ImageProcessing/Attenuation.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Rendering/FlatVersusGouraud.py", - "Texture/TextureCutQuadric.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/QuadricVisualization.py" - ], - "vtkVariantExtract": [ - "Utilities/Variant.py" - ], - "vtkCamera": [ - "GeometricObjects/Cube.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/Planes.py", - "Interaction/CallBack.py", - "IO/3DSImporter.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Meshes/Decimation.py", - "Modelling/FinanceFieldData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "Rendering/StripFran.py", - "Texture/AnimateVectors.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/Camera.py", - "Visualization/FrogSlice.py", - "Visualization/Hanoi.py", - "Visualization/Kitchen.py", - "Visualization/NormalsDemo.py" - ], - "vtkGeovisCore": [ - "Widgets/CompassWidget.py" - ], - "vtkActor2D": [ - "Annotation/MultiLineText.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/SourceObjectsDemo.py", - "Images/Actor2D.py", - "IO/ReadDICOMSeries.py", - "IO/ReadLegacyUnstructuredGrid.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/GradientBackground.py", - "Utilities/RescaleReverseLUT.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkHyperStreamline": [ - "VisualizationAlgorithms/HyperStreamline.py" - ], - "vtkRenderWinodwInteractor": [ - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py" - ], - "vtkSimpleMotionBlurPass": [ - "Rendering/MotionBlur.py" - ], - "vtkScalarBarWidget": [ - "Widgets/ScalarBarWidget.py" - ], - "vtkGenericCell": [ - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkRenderedGraphRepresentation": [ - "Graphs/ColorVertexLabels.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py" - ], - "vtkPiecewiseFunction": [ - "Medical/MedicalDemo4.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkRenderingVolumeOpenGL2": [ - "Medical/MedicalDemo4.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkAxesActor": [ - "GeometricObjects/Axes.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Interaction/CallBack.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/AlignTwoPolyDatas.py", - "Rendering/LayeredActors.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkTessellatorFilter": [ - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py" - ], - "vtkImageLaplacian": [ - "ImageProcessing/EnhanceEdges.py" - ], - "vtkContourTriangulator": [ - "Modelling/ContourTriangulator.py" - ], - "vtkImplicitPlaneWidget2": [ - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkImageViewer2": [ - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkXMLUnstructuredGridReader": [ - "ExplicitStructuredGrid/LoadESGrid.py", - "IO/ReadUnstructuredGrid.py" - ], - "vtkCell": [ - "GeometricObjects/CellTypeSource.py" - ], - "vtkImplicitDataSet": [ - "Problems/ImplicitFunctions/ImplicitDataSet.py" - ], - "vtkLODActor": [ - "DataManipulation/MeshLabelImageColor.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py" - ], - "vtkEarthSource": [ - "GeometricObjects/EarthSource.py" - ], - "vtkViewTheme": [ - "Graphs/ColorEdges.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/CreateTree.py", - "Graphs/ScaleVertices.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkImageData": [ - "ImageData/SumVTKImages.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "IO/PolyDataToImageDataConverter.py", - "Meshes/PointInterpolator.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "PolyData/PolyDataContourToImageData.py", - "Rendering/StippledLine.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/GlyphTable.py", - "Visualization/SphereTexture.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkStructuredGridReader": [ - "Visualization/Kitchen.py" - ], - "vtkUnstructured": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py" - ], - "vtkIOImage": [ - "DataManipulation/MeshLabelImageColor.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/ParametricObjectsDemo.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/BackgroundImage.py", - "Images/ImageWarp.py", - "IO/HDRReader.py", - "IO/ImageWriter.py", - "IO/PolyDataToImageDataConverter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadSLC.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Modelling/ContourTriangulator.py", - "Modelling/MarchingCubes.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/WalkCow.py", - "Texture/TexturePlane.py", - "Utilities/Screenshot.py", - "Utilities/VTKWithNumpy.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FrogSlice.py", - "Visualization/Hanoi.py", - "Visualization/PointDataSubdivision.py", - "Visualization/SphereTexture.py" - ], - "vtkStreamTracer": [ - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/Kitchen.py", - "Visualization/StreamLines.py" - ], - "vtkDiscretizableColorTransferFunction": [ - "IO/TransientHDFReader.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/XMLColorMapToLUT.py" - ], - "vtkRandomGraphSource": [ - "Graphs/RandomGraphSource.py", - "Graphs/SelectedVerticesAndEdges.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtk_qt_include_pattern": [ - "Utilities/VTKModulesForCxx.py" - ], - "vtkFloatArray": [ - "CompositeData/OverlappingAMR.py", - "GeometricObjects/Cube.py", - "Graphs/ScaleVertices.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Modelling/Finance.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/ImplicitPolyDataDistance.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtk_source": [ - "Visualization/ProgrammableGlyphs.py" - ], - "vtkDeformPointSet": [ - "Meshes/DeformPointSet.py" - ], - "vtkLinearExtrusionFilter": [ - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "PolyData/PolyDataContourToImageData.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/AlphaFrequency.py" - ], - "vtkGraphMapper": [ - "Deprecated/Geovis/GeoAssignCoordinates.py" - ], - "vtkp": [ - "Widgets/ScalarBarWidget.py" - ], - "vtkhdf": [ - "IO/TransientHDFReader.py" - ], - "vtkExtractSelection": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py" - ], - "vtkClipPolyData": [ - "Meshes/CapClip.py", - "Meshes/SolidClip.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CreateBFont.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkInteract": [ - "VisualizationAlgorithms/PineRootConnectivity.py" - ], - "vtkImplicitBoolean": [ - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/IceCream.py" - ], - "vtkXMLPolyDataReader": [ - "Deprecated/Geovis/GeoGraticle.py", - "IO/ReadPolyData.py", - "IO/ReadVTP.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/Curvatures.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/NormalsDemo.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py" - ], - "vtkInteractorStyleRubberBandPick": [ - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py" - ], - "vtkBYUReader": [ - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/WalkCow.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "VisualizationAlgorithms/Motor.py", - "Visualization/NormalsDemo.py" - ], - "vtkDataObject": [ - "CompositeData/CompositePolyDataMapper.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Plotting/SpiderPlot.py", - "PolyData/CellsInsideObject.py", - "VisualizationAlgorithms/OfficeTube.py", - "Visualization/HardwareSelector.py" - ], - "vtkContextActor": [ - "Plotting/MultiplePlots.py" - ], - "vtkImageMapToColors": [ - "ImageProcessing/VTKSpectrum.py", - "Medical/MedicalDemo3.py" - ], - "vtkHedgeHog": [ - "StructuredGrid/SGrid.py", - "Visualization/ComplexV.py" - ], - "vtkRungeKutta4": [ - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py" - ], - "vtkAppendPolyData": [ - "Filtering/CombinePolyData.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel2.py" - ], - "vtkClipDataSet": [ - "Medical/TissueLens.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" - ], - "vtkLine": [ - "GeometricObjects/ColoredLines.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/LongLine.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py", - "Modelling/CappedSphere.py", - "PolyData/IterateOverLines.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/WarpVector.py" - ], - "vtkInfovisCore": [ - "Graphs/RandomGraphSource.py", - "Graphs/SelectedVerticesAndEdges.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkRenderingCore": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/HDRReader.py", - "IO/ImageWriter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/SpiderPlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkPNMWriter": [ - "IO/ImageWriter.py", - "Visualization/Hanoi.py" - ], - "vtkWindowedSincPolyDataFilter": [ - "DataManipulation/MeshLabelImageColor.py", - "Medical/GenerateModelsFromLabels.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py" - ], - "vtkImageHybridMedian2D": [ - "ImageProcessing/HybridMedianComparison.py" - ], - "vtkUnstructuredGridWriter": [ - "IO/WriteLegacyLinearCells.py" - ], - "vtkWarpTo": [ - "Filtering/WarpTo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py" - ], - "vtkUnstructuredGridVolumeZSweepMapper": [ - "Problems/Visualization/UnstructuredTransientVolumeRendering.py" - ], - "vtkRenderingUI": [ - "Utilities/VTKImportsForPython.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkSliderWidget": [ - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/FroggieView.py" - ], - "vtkPixel": [ - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkBalloonWidget": [ - "Widgets/BalloonWidget.py" - ], - "vtkStructuredGridOutlineFilter": [ - "Rendering/Rainbow.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/Kitchen.py", - "Visualization/StreamLines.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkHexagonalPrism": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkExtractEdges": [ - "CompositeData/MultiBlockDataSet.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Modelling/DelaunayMesh.py", - "VisualizationAlgorithms/MarchingCases.py" - ], - "vtkRenderingContextOpenGL2": [ - "IO/ReadDICOMSeries.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/TransientHDFReader.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SurfacePlot.py", - "Utilities/VTKImportsForPython.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkConeSource": [ - "Filtering/CombinePolyData.py", - "GeometricObjects/Cone.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/SourceObjectsDemo.py", - "Interaction/CallBack.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "PolyData/Outline.py", - "Rendering/CameraBlur.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/GradientBackground.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/TransparentBackground.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/ShareCamera.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/GlyphTable.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ShadowsLightsDemo.py", - "Widgets/BoxWidget.py" - ], - "vtkPolyDataTangents": [ - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkIOExodus": [ - "IO/ReadExodusData.py" - ], - "vtkIOPLY": [ - "IO/WritePLY.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/MotionBlur.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Visualization/NormalsDemo.py" - ], - "vtkImageMirrorPad": [ - "ImageProcessing/Pad.py" - ], - "vtkTransformFilter": [ - "Deprecated/Geovis/GeoGraticle.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "Medical/GenerateCubesFromLabels.py", - "PolyData/CurvaturesDemo.py", - "Rendering/TransformSphere.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py" - ], - "vtkBiQuadraticQuad": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkLightKit": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py" - ], - "vtkCameraPass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Shadows.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkQuadraticWedge": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkWindowToImageFilter": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/ParametricObjectsDemo.py", - "Images/Actor2D.py", - "IO/ImageWriter.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/WalkCow.py", - "Utilities/Screenshot.py", - "Visualization/Hanoi.py" - ], - "vtkRenderingVolume": [ - "Medical/MedicalDemo4.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkLookupTable": [ - "DataManipulation/MeshLabelImageColor.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/PlatonicSolids.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ScaleVertices.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Meshes/ColoredElevationMap.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/Rainbow.py", - "Rendering/TransformSphere.py", - "Utilities/LUTUtilities.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/Blow.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/Hawaii.py", - "Visualization/KochSnowflake.py", - "Visualization/NamedColors.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkImageGradient": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/GlyphTable.py" - ], - "vtkPoints": [ - "Annotation/MultiLineText.py", - "DataManipulation/LineOnMesh.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/GraphToPolyData.py", - "Graphs/NOVCAGraph.py", - "Graphs/SideBySideGraphs.py", - "Images/Actor2D.py", - "IO/CSVReadEdit.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Meshes/ColoredElevationMap.py", - "Meshes/DeformPointSet.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/DelaunayMesh.py", - "Modelling/Finance.py", - "Modelling/Spring.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/WarpVector.py", - "Rendering/GradientBackground.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "Texture/TextureCutSphere.py", - "UnstructuredGrid/UGrid.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/SingleSplat.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/KochSnowflake.py", - "Visualization/ProgrammableGlyphFilter.py", - "Widgets/ContourWidget.py" - ], - "vtkBiQuadraticQuadraticHexahedron": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkRenderer": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/SpiderPlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkPlanes": [ - "GeometricObjects/Frustum.py", - "GeometricObjects/Planes.py", - "Texture/TextureCutSphere.py", - "VisualizationAlgorithms/Motor.py" - ], - "vtkPolyDataNormals": [ - "DataManipulation/MeshLabelImageColor.py", - "Modelling/Spring.py", - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/StripFran.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/NormalsDemo.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ShadowsLightsDemo.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkElevationFilter": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "Meshes/DeformPointSet.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Rendering/ColoredSphere.py", - "Rendering/TransformSphere.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/XMLColorMapToLUT.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/GlyphTable.py", - "Visualization/Hawaii.py", - "Visualization/LoopShrink.py", - "Visualization/NamedColors.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphs.py" - ], - "vtkHDFReader": [ - "IO/TransientHDFReader.py" - ], - "vtkParametricFunctionSource": [ - "DataManipulation/LineOnMesh.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkAnnotationLink": [ - "Graphs/SelectedVerticesAndEdges.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkMarchingSquares": [ - "Modelling/ContourTriangulator.py" - ], - "vtkParametricHenneberg": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkPNGReader": [ - "Modelling/ContourTriangulator.py", - "PolyData/PolyDataToImageDataStencil.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "VisualizationAlgorithms/DecimateFran.py" - ], - "vtkLogLookupTable": [ - "VisualizationAlgorithms/HyperStreamline.py" - ], - "vtkDoubleArray": [ - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Graphs/EdgeWeights.py", - "Graphs/LabelVerticesAndEdges.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/StippledLine.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/TextureCutSphere.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/SingleSplat.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtkPropPicker": [ - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py" - ], - "vtkChart": [ - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py" - ], - "vtkExplicitStructuredGridToUnstructuredGrid": [ - "ExplicitStructuredGrid/CreateESGrid.py" - ], - "vtkParametricKuen": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkPolyDataWriter": [ - "PolyData/AlignTwoPolyDatas.py" - ], - "vtkDataSetMapper": [ - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/ConnectivityFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TriangleStrip.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "Images/ImageWarp.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadUnstructuredGrid.py", - "Medical/TissueLens.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Modelling/ContourTriangulator.py", - "Picking/CellPicking.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/ColoredSphere.py", - "Rendering/TransformSphere.py", - "StructuredGrid/BlankPoint.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TextureThreshold.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Hawaii.py", - "Visualization/LoopShrink.py", - "Visualization/PointDataSubdivision.py", - "Visualization/QuadricVisualization.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkPlanesIntersection": [ - "GeometricObjects/PlanesIntersection.py" - ], - "vtkGlyph3D": [ - "Filtering/Glyph3D.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "Graphs/VisualizeDirectedGraph.py", - "Modelling/DelaunayMesh.py", - "Rendering/CameraBlur.py", - "Rendering/Mace.py", - "Texture/AnimateVectors.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/SpikeFran.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/GlyphTable.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkMyCallback": [ - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step6.py" - ], - "vtkDiskSource": [ - "GeometricObjects/Disk.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/SourceObjectsDemo.py", - "Meshes/BoundaryEdges.py" - ], - "vtk_patterns": [ - "Utilities/VTKImportsForPython.py" - ], - "vtkInfovisLayout": [ - "Graphs/ConstructGraph.py", - "Graphs/EdgeWeights.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/VisualizeDirectedGraph.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkCommand": [ - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/FroggieView.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/SplineWidget.py" - ], - "vtkcnOrder": [ - "Visualization/NamedColorPatches.py" - ], - "vtkHull": [ - "GeometricObjects/Planes.py" - ], - "vtkCubeAxesActor": [ - "Visualization/CubeAxesActor.py" - ], - "vtkPointGaussianMapper": [ - "Meshes/PointInterpolator.py" - ], - "vtkArrowSource": [ - "GeometricObjects/Arrow.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/RotationAroundLine.py", - "Rendering/OutlineGlowPass.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkBooleanOperationPolyDataFilter": [ - "PolyData/BooleanOperationPolyDataFilter.py" - ], - "vtkDataSet": [ - "GeometricObjects/PolyLine1.py", - "VisualizationAlgorithms/SpikeFran.py" - ], - "vtkTriangle": [ - "DataManipulation/LineOnMesh.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Triangle.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "PolyData/ColoredTriangle.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "Visualization/KochSnowflake.py" - ], - "vtkTriangleFilter": [ - "Meshes/Decimation.py", - "Picking/CellPicking.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/PolyDataToImageDataStencil.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkFiltersSources": [ - "Arrays/GetValues.py", - "Arrays/RenameArray.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "DataManipulation/LineOnMesh.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/TransformPolyData.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "Graphs/GraphToPolyData.py", - "Graphs/NOVCAGraph.py", - "Graphs/VisualizeDirectedGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "Images/BackgroundImage.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/ImageWriter.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/SolidClip.py", - "Modelling/DelaunayMesh.py", - "Modelling/MarchingCubes.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/TubeFilter.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Kitchen.py", - "Visualization/LoopShrink.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/WindowTitle.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkPolyDataMapper2D": [ - "Annotation/MultiLineText.py", - "Images/Actor2D.py", - "Rendering/GradientBackground.py" - ], - "vtkOBJReader": [ - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Visualization/NormalsDemo.py" - ], - "vtk_class": [ - "Utilities/SelectExamples.py", - "Utilities/VTKImportsForPython.py" - ], - "vtkGraphToGlyphs": [ - "Graphs/ScaleVertices.py" - ], - "vtkCutter": [ - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/FilledPolygon.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkContextView": [ - "IO/ReadLegacyUnstructuredGrid.py", - "Plotting/ScatterPlot.py", - "Plotting/SurfacePlot.py" - ], - "vtkVariantStrictWeakOrderKey": [ - "Utilities/Variant.py" - ], - "vtkDelimitedTextReader": [ - "IO/CSVReadEdit1.py", - "Meshes/PointInterpolator.py" - ], - "vtkTextActor": [ - "GeometricObjects/TextActor.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CollisionDetection.py", - "Widgets/TextWidget.py" - ], - "vtkImageMagnify": [ - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkFiltersPoints": [ - "Meshes/PointInterpolator.py" - ], - "vtk_version_number": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/MarchingCubes.py", - "PolyData/AlignTwoPolyDatas.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Utilities/CheckVTKVersion.py", - "VisualizationAlgorithms/HeadBone.py", - "Visualization/FrogBrain.py", - "Visualization/IsosurfaceSampling.py", - "Widgets/CompassWidget.py" - ], - "vtkRenderingAnnotation": [ - "GeometricObjects/Axes.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Interaction/CallBack.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "Plotting/SpiderPlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Rendering/LayeredActors.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Utilities/RescaleReverseLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/PointDataSubdivision.py", - "Widgets/CompassWidget.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkNamedColor": [ - "Visualization/NamedColors.py" - ], - "vtkLightActor": [ - "Visualization/ShadowsLightsDemo.py" - ], - "vtkPolyDataToImageStencil": [ - "IO/PolyDataToImageDataConverter.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py" - ], - "vtkImagingFourier": [ - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/VTKSpectrum.py" - ], - "vtkMetaImageReader": [ - "DataManipulation/MeshLabelImageColor.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FrogSlice.py" - ], - "vtkCompositeDataGeometryFilter": [ - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "IO/ReadExodusData.py" - ], - "vtkImageMedian3D": [ - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py" - ], - "vtkCameraOrientationWidget": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/Curvatures.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/SplineWidget.py" - ], - "vtkTIFFWriter": [ - "IO/ImageWriter.py", - "Visualization/Hanoi.py" - ], - "vtk_include_pattern": [ - "Utilities/VTKModulesForCxx.py" - ], - "vtkVolumeProperty": [ - "Medical/MedicalDemo4.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkThresholdPoints": [ - "Texture/AnimateVectors.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/MarchingCases.py" - ], - "vtkHyperTreeGridToUnstructuredGrid": [ - "HyperTreeGrid/HyperTreeGridSource.py" - ], - "vtkGaussianKernel": [ - "Meshes/PointInterpolator.py" - ], - "vtkMergeFilter": [ - "Images/ImageWarp.py" - ], - "vtkRibbonFilter": [ - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py" - ], - "vtkRectf": [ - "Plotting/SurfacePlot.py" - ], - "vtkHausdorffDistancePointSetFilter": [ - "PolyData/AlignTwoPolyDatas.py" - ], - "vtkCategoryLegend": [ - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkOpenGLRayCastImageDisplayHelper": [ - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkDataSetAttributes": [ - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py" - ], - "vtkChartsCore": [ - "IO/ReadLegacyUnstructuredGrid.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SurfacePlot.py" - ], - "vtkTexture": [ - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/StippledLine.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/Motor.py", - "Visualization/FrogSlice.py", - "Visualization/SphereTexture.py" - ], - "vtkXMLImageDataWriter": [ - "ImageData/WriteReadVtkImageData.py" - ], - "vtkPNMReader": [ - "VisualizationAlgorithms/CreateBFont.py" - ], - "vtkViewsCore": [ - "Graphs/ColorEdges.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/CreateTree.py", - "Graphs/ScaleVertices.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkPerlinNoise": [ - "Filtering/PerlinNoise.py" - ], - "vtkWedge": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkBrownianPoints": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py" - ], - "vtkCleanPolyData": [ - "DataManipulation/LineOnMesh.py", - "Filtering/CombinePolyData.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CurvaturesDemo.py", - "PolyData/SmoothMeshGrid.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkVolume": [ - "Medical/MedicalDemo4.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkFieldDataToAttributeDataFilter": [ - "Modelling/FinanceFieldData.py" - ], - "vtkUnstructuredGridReader": [ - "IO/ReadLegacyUnstructuredGrid.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkPentagonalPrism": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkIntArray": [ - "GeometricObjects/CellTypeSource.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/ScaleVertices.py", - "Visualization/KochSnowflake.py" - ], - "vtkTubeFilter": [ - "Filtering/WarpTo.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Modelling/Bottle.py", - "Modelling/DelaunayMesh.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "PolyData/TubeFilter.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/TensorAxes.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkCollisionDetectionFilter": [ - "Visualization/CollisionDetection.py" - ], - "vtkContextTransform": [ - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkParallelCoordinatesRepresentation": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py" - ], - "vtkDelaunay2D": [ - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/TriangulateTerrainMap.py", - "Meshes/ColoredElevationMap.py", - "Modelling/DelaunayMesh.py", - "PolyData/CurvaturesAdjustEdges.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtkPolyDataConnectivityFilter": [ - "Modelling/ExtractLargestIsosurface.py", - "VisualizationAlgorithms/PineRootConnectivity.py" - ], - "vtkExtractGrid": [ - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkSelectionNode": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py" - ], - "vtkStripper": [ - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Meshes/CapClip.py", - "Modelling/Bottle.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/FilledPolygon.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "Rendering/StripFran.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkPolyDataSilhouette": [ - "Picking/HighlightWithSilhouette.py" - ], - "vtkFixedPointVolumeRayCastMapper": [ - "Medical/MedicalDemo4.py", - "Utilities/VTKWithNumpy.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkStructuredPoints": [ - "StructuredPoints/Vol.py", - "Visualization/Lorenz.py" - ], - "vtkPlanesSource": [ - "Texture/TexturePlane.py" - ], - "vtkConvexPointSet": [ - "GeometricObjects/ConvexPointSet.py" - ], - "vtkRenderingFreeType": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/TextActor.py", - "Modelling/FinanceFieldData.py", - "Rendering/GradientBackground.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/VTKImportsForPython.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/AlphaFrequency.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CollisionDetection.py", - "Visualization/VectorText.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkHyperTreeGridSource": [ - "HyperTreeGrid/HyperTreeGridSource.py" - ], - "vtkOverlappingAMR": [ - "CompositeData/OverlappingAMR.py" - ], - "vtkImageLuminance": [ - "Images/ImageWarp.py" - ], - "vtk": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "Graphs/NOVCAGraph.py", - "ImageData/WriteReadVtkImageData.py", - "IO/CSVReadEdit.py", - "IO/ReadUnstructuredGrid.py", - "IO/WriteLegacyLinearCells.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Rendering/GradientBackground.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/StripFran.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutSphere.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/SelectExamples.py", - "Utilities/Variant.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKModulesForCxx.py", - "Utilities/VTKWithNumpy.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/VelocityProfile.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/ComplexV.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/FroggieView.py", - "Visualization/Hawaii.py", - "Visualization/Kitchen.py", - "Visualization/NormalsDemo.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkIOGeometry": [ - "IO/PolyDataToImageDataConverter.py", - "IO/ReadSTL.py", - "IO/WriteSTL.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "Meshes/PointInterpolator.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/WalkCow.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "Visualization/NormalsDemo.py" - ], - "vtkPLYWriter": [ - "IO/WritePLY.py" - ], - "vtkRenderingLabel": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkSelection": [ - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py" - ], - "vtkPointSource": [ - "Filtering/AppendFilter.py", - "GeometricObjects/SourceObjectsDemo.py", - "Graphs/NOVCAGraph.py", - "Interaction/InteractorStyleTrackballCamera.py", - "PolyData/ExtractSelection.py", - "PolyData/PointSource.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Office.py", - "Visualization/PointSize.py" - ], - "vtkImageActor": [ - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Medical/MedicalDemo3.py" - ], - "vtkViewUpdater": [ - "InfoVis/ParallelCoordinatesExtraction.py" - ], - "vtk_to_numpy": [ - "Visualization/HardwareSelector.py" - ], - "vtkSuperquadricSource": [ - "Images/BackgroundImage.py", - "Meshes/SolidClip.py", - "PolyData/CurvaturesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphs.py", - "Widgets/OrientationMarkerWidget1.py" - ], - "vtkIOImport": [ - "IO/3DSImporter.py" - ], - "vtkUnstructuredGrid": [ - "ExplicitStructuredGrid/CreateESGrid.py", - "Filtering/AppendFilter.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/Tetrahedron.py", - "Graphs/NOVCAGraph.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py", - "Modelling/Finance.py", - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/MarchingCases.py" - ], - "vtkChartXY": [ - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py" - ], - "vtkParametricMobius": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkCylinder": [ - "VisualizationAlgorithms/ClipSphereCylinder.py", - "Visualization/IsosurfaceSampling.py" - ], - "vtkPolyDataReader": [ - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/StripFran.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/BlobbyLogo.py", - "Visualization/FroggieView.py", - "Visualization/Hawaii.py" - ], - "vtkSplineWidget": [ - "Widgets/SplineWidget.py" - ], - "vtkGeometryFilter": [ - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Visualization/Blow.py" - ], - "vtkFlyingEdges2D": [ - "VisualizationAlgorithms/FlyingHeadSlice.py" - ], - "vtkOpenGLSkybox": [ - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py" - ], - "vtk_headers_modules": [ - "Utilities/VTKModulesForCxx.py" - ], - "vtkTable": [ - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SurfacePlot.py" - ], - "vtkUnstructuredGridToExplicitStructuredGrid": [ - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py" - ], - "vtkThresholdTextureCoords": [ - "Texture/TextureThreshold.py" - ], - "vtkColorSeries": [ - "GeometricObjects/CellTypeSource.py", - "PolyData/Curvatures.py", - "Utilities/LUTUtilities.py", - "Utilities/ShareCamera.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ColorSeriesPatches.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/Hawaii.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkVoxelModeller": [ - "Modelling/MarchingCubes.py" - ], - "vtkTextRepresentation": [ - "Widgets/TextWidget.py" - ], - "vtkBMPWriter": [ - "IO/ImageWriter.py", - "Visualization/Hanoi.py" - ], - "vtkImagingStatistics": [ - "Medical/GenerateModelsFromLabels.py" - ], - "vtkTensorGlyph": [ - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py" - ], - "vtkImageWeightedSum": [ - "ImageData/ImageWeightedSum.py", - "ImageData/SumVTKImages.py" - ], - "vtkPlatonicSolidSource": [ - "GeometricObjects/PlatonicSolids.py" - ], - "vtkVariant": [ - "Utilities/LUTUtilities.py", - "Utilities/Variant.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtkLandmarkTransform": [ - "PolyData/AlignTwoPolyDatas.py" - ], - "vtkOrientedGlyphContourRepresentation": [ - "Widgets/ContourWidget.py" - ], - "vtkcnEndTable": [ - "Visualization/NamedColorPatches.py" - ], - "vtkInteractorStyle": [ - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py" - ], - "vtkVariantStrictEquality": [ - "Utilities/Variant.py" - ], - "vtkRectilinearGrid": [ - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py" - ], - "vtkProperty": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/TessellatedBoxSource.py", - "IO/ReadUnstructuredGrid.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/TissueLens.py", - "Meshes/Decimation.py", - "Meshes/SolidClip.py", - "Modelling/ExtractLargestIsosurface.py", - "Picking/HighlightPickedActor.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/LayeredActors.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Visualization/BlobbyLogo.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkAMRBox": [ - "CompositeData/OverlappingAMR.py" - ], - "vtkQuadraticTetra": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py" - ], - "vtkTessellatedBoxSource": [ - "GeometricObjects/TessellatedBoxSource.py" - ], - "vtkImageNoiseSource": [ - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py" - ], - "vtkLightsPass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkImagingSources": [ - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "Images/BackgroundImage.py", - "Images/Cast.py" - ], - "vtkAlgorithm": [ - "GeometricObjects/TessellatedBoxSource.py" - ], - "vtkVoxel": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkMutableUndirectedGraph": [ - "Graphs/ConstructGraph.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py" - ], - "vtkFiltersProgrammable": [ - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py" - ], - "vtkImagingMorphological": [ - "ImageProcessing/MorphologyComparison.py", - "Visualization/FroggieSurface.py" - ], - "vtkPlane": [ - "Meshes/CapClip.py", - "Meshes/SolidClip.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/FilledPolygon.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/IceCream.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkInteractorStyleSwitch": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py" - ], - "vtkButterflySubdivisionFilter": [ - "PolyData/SmoothMeshGrid.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkImagingStencil": [ - "IO/PolyDataToImageDataConverter.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py" - ], - "vtkRTAnalyticSource": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/GlyphTable.py" - ], - "vtkCommonExecutionModel": [ - "GeometricObjects/TessellatedBoxSource.py" - ], - "vtkChartXYZ": [ - "Plotting/SurfacePlot.py" - ], - "vtkImageCanvasSource2D": [ - "ImageData/ImageDataGeometryFilter.py", - "Images/BackgroundImage.py" - ], - "vtkCompositePolyDataMapper": [ - "CompositeData/CompositePolyDataMapper.py" - ], - "vtkImageMagnitude": [ - "ImageProcessing/VTKSpectrum.py" - ], - "vtkXMLImageDataReader": [ - "ImageData/WriteReadVtkImageData.py", - "IO/ReadImageData.py" - ], - "vtkParametricRoman": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkDecimate": [ - "VisualizationAlgorithms/PineRootDecimation.py" - ], - "vtkImageStencil": [ - "IO/PolyDataToImageDataConverter.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py" - ], - "vtkExplicitStructuredGrid": [ - "ExplicitStructuredGrid/CreateESGrid.py" - ], - "vtkVectorDot": [ - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/PlateVibration.py" - ], - "vtkInteractorStyleImage": [ - "Filtering/Glyph2D.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Cast.py", - "IO/ReadDICOMSeries.py" - ], - "vtkBalloonRepresentation": [ - "Widgets/BalloonWidget.py" - ], - "vtkConnectivityFilter": [ - "Filtering/ConnectivityFilter.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "Visualization/Blow.py" - ], - "vtkCommonDataModel": [ - "Annotation/MultiLineText.py", - "Arrays/GetValues.py", - "Arrays/RenameArray.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/PerlinNoise.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "Images/Actor2D.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "Interaction/InteractorStyleTrackballCamera.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/PolyDataToImageDataConverter.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/StippledLine.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/VTKWithNumpy.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/HardwareSelector.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/KochSnowflake.py", - "Visualization/Lorenz.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/QuadricVisualization.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkImageViewer": [ - "IO/HDRReader.py", - "PolyData/PolyDataToImageDataStencil.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkImplicitPolyDataDistance": [ - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "PolyData/ImplicitPolyDataDistance.py" - ], - "vtkLinearSubdivisionFilter": [ - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkCoordinate": [ - "Annotation/MultiLineText.py", - "Rendering/GradientBackground.py" - ], - "vtkXMLpoly_dataReader": [ - "Meshes/CapClip.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py" - ], - "vtkMaskFields": [ - "Medical/GenerateModelsFromLabels.py" - ], - "vtkQuad": [ - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Quad.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkMaskPolyData": [ - "Rendering/StripFran.py" - ], - "vtkParametricFigure8Klein": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkImageAppend": [ - "PolyData/PolyDataToImageDataStencil.py" - ], - "vtkShrinkPolyData": [ - "GeometricObjects/Frustum.py", - "GeometricObjects/RegularPolygonSource.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "VisualizationAlgorithms/MarchingCases.py" - ], - "vtkColor3ub": [ - "Visualization/PointDataSubdivision.py" - ], - "vtkContourWidget": [ - "Widgets/ContourWidget.py" - ], - "vtkHDRReader": [ - "IO/HDRReader.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkParametricBohemianDome": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkActor": [ - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "Graphs/VisualizeDirectedGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/IsoSubsample.py", - "Images/BackgroundImage.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/SelectExamples.py", - "Utilities/ShareCamera.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkImageExtractComponents": [ - "ImageProcessing/IdealHighPass.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkPLYReader": [ - "IO/WritePLY.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/MotionBlur.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Visualization/NormalsDemo.py" - ], - "vtkNamedColors": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ColorSeriesPatches.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColorPatches.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkViewsInfovis": [ - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkContourFilter": [ - "CompositeData/OverlappingAMR.py", - "Filtering/GaussianSplat.py", - "Filtering/PerlinNoise.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "IO/ReadSLC.py", - "Modelling/Finance.py", - "Rendering/FlatVersusGouraud.py", - "StructuredPoints/Vol.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SplatFace.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/Lorenz.py", - "Visualization/QuadricVisualization.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkIdTypeArray": [ - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py" - ], - "vtkDataObjectToDataSetFilter": [ - "Modelling/FinanceFieldData.py" - ], - "vtkBooleanTexture": [ - "Texture/TextureCutQuadric.py" - ], - "vtkRenderLargeImage": [ - "Visualization/PointDataSubdivision.py" - ], - "vtk_files": [ - "Visualization/FroggieView.py" - ], - "vtkCellLocator": [ - "DataManipulation/LineOnMesh.py" - ], - "vtkIdType": [ - "GeometricObjects/Cube.py", - "PolyData/PolyDataContourToImageData.py" - ], - "vtkTetra": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Tetrahedron.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkQuadraticPyramid": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkCellPicker": [ - "Picking/CellPicking.py" - ], - "vtkOpenGLRenderer": [ - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkSphereWidget": [ - "Widgets/SphereWidget.py" - ], - "vtkGraphLayoutView": [ - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkForceDirectedLayoutStrategy": [ - "Graphs/ConstructGraph.py", - "Graphs/EdgeWeights.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py" - ], - "vtkPlaneSource": [ - "GeometricObjects/Plane.py", - "GeometricObjects/SourceObjectsDemo.py", - "Picking/CellPicking.py", - "Texture/TexturePlane.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogSlice.py", - "Visualization/Hanoi.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/StreamLines.py" - ], - "vtkParametricBoy": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkIOLegacy": [ - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WriteLegacyLinearCells.py", - "Meshes/Decimation.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/StripFran.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutSphere.py", - "Texture/TextureThreshold.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/ComplexV.py", - "Visualization/FroggieView.py", - "Visualization/Hawaii.py", - "Visualization/Kitchen.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkMCubesReader": [ - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py" - ], - "vtkLineWidget": [ - "VisualizationAlgorithms/StreamlinesWithLineWidget.py" - ], - "vtkPyramid": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Pyramid.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkBiQuadraticTriangle": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkVariantCreate": [ - "Utilities/Variant.py" - ], - "vtkIOParallel": [ - "IO/ReadPLOT3D.py", - "Rendering/Rainbow.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/StreamLines.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkCone": [ - "VisualizationAlgorithms/IceCream.py" - ], - "vtkDiscreteMarchingCubes": [ - "DataManipulation/MeshLabelImageColor.py", - "Medical/GenerateModelsFromLabels.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py" - ], - "vtkIOInfovis": [ - "IO/CSVReadEdit1.py", - "Meshes/PointInterpolator.py" - ], - "vtkVertex": [ - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Vertex.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkOpaquePass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkShadowMapPass": [ - "Rendering/Shadows.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkWidget": [ - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py" - ], - "vtkTextWidget": [ - "Widgets/TextWidget.py" - ], - "vtkTableBasedClipDataSet": [ - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py" - ], - "vtkImageButterworthHighPass": [ - "ImageProcessing/IdealHighPass.py" - ], - "vtkBillboardTextActor3D": [ - "Visualization/BillboardTextActor3D.py" - ], - "vtkFollower": [ - "Annotation/TextOrigin.py", - "Modelling/FinanceFieldData.py", - "VisualizationAlgorithms/Stocks.py" - ], - "vtkPostScriptWriter": [ - "IO/ImageWriter.py", - "Visualization/Hanoi.py" - ], - "vtkViewsContext2D": [ - "IO/ReadLegacyUnstructuredGrid.py", - "Plotting/ScatterPlot.py", - "Plotting/SurfacePlot.py" - ], - "vtkFiltersModeling": [ - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "IO/ReadSLC.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/Spring.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/Outline.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Texture/AnimateVectors.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/AlphaFrequency.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CollisionDetection.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/NamedColors.py", - "Visualization/PointDataSubdivision.py", - "Visualization/QuadricVisualization.py" - ], - "vtkTransformPolyDataFilter": [ - "Filtering/IterativeClosestPoints.py", - "Filtering/TransformPolyData.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/RotationAroundLine.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py" - ], - "vtkProjectedTetrahedraMapper": [ - "Problems/Visualization/UnstructuredTransientVolumeRendering.py" - ], - "vtkExtractVOI": [ - "DataManipulation/MeshLabelImageColor.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadSlice.py", - "Visualization/QuadricVisualization.py" - ], - "vtkSphereSource": [ - "Arrays/GetValues.py", - "Arrays/RenameArray.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/GaussianSplat.py", - "Filtering/TransformPolyData.py", - "GeometricObjects/Axes.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/ImageWriter.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/TissueLens.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Modelling/DelaunayMesh.py", - "Modelling/MarchingCubes.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/TransformSphere.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/GlyphTable.py", - "Visualization/HardwareSelector.py", - "Visualization/LoopShrink.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/WindowTitle.py", - "Widgets/BalloonWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/TextWidget.py" - ], - "vtkDataSetTriangleFilter": [ - "Problems/Visualization/UnstructuredTransientVolumeRendering.py" - ], - "vtkTextProperty": [ - "Annotation/MultiLineText.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/SourceObjectsDemo.py", - "IO/ReadDICOMSeries.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Rendering/GradientBackground.py", - "Utilities/RescaleReverseLUT.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkStructuredGridGeometryFilter": [ - "IO/ReadPLOT3D.py", - "Rendering/Rainbow.py", - "StructuredGrid/BlankPoint.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/Kitchen.py" - ], - "vtkOverlayPass": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkQuadraticQuad": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkImageRFFT": [ - "ImageProcessing/IdealHighPass.py" - ], - "vtkImageEuclideanToPolar": [ - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkImageShiftScale": [ - "ImageProcessing/Attenuation.py", - "Texture/TexturePlane.py" - ], - "vtkImageMandelbrotSource": [ - "ImageData/ImageWeightedSum.py", - "Images/Cast.py" - ], - "vtkPlotPoints": [ - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py" - ], - "vtkInteractorStyleTrackballActor": [ - "Interaction/InteractorStyleTrackballActor.py" - ], - "vtkExodusIIReader": [ - "IO/ReadExodusData.py" - ], - "vtkRenderWindowInteractor": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "Graphs/SideBySideGraphs.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/HDRReader.py", - "IO/ImageWriter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/SpiderPlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKModulesForCxx.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkTextureMapToSphere": [ - "Rendering/PBR_Anisotropy.py", - "Visualization/SphereTexture.py" - ], - "vtkImageDataGeometryFilter": [ - "ImageData/ImageDataGeometryFilter.py", - "ImageData/WriteReadVtkImageData.py", - "Images/ImageWarp.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py" - ], - "vtkMultiBlockPLOT3DReader": [ - "IO/ReadPLOT3D.py", - "Rendering/Rainbow.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/StreamLines.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkParametricSpline": [ - "DataManipulation/LineOnMesh.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkFiltersFlowPaths": [ - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/Kitchen.py", - "Visualization/StreamLines.py" - ], - "vtkImageMathematics": [ - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py" - ], - "vtkPolyhedron": [ - "GeometricObjects/Dodecahedron.py" - ], - "vtkTextSource": [ - "GeometricObjects/SourceObjectsDemo.py", - "Visualization/TextSource.py" - ], - "vtkIOXML": [ - "Arrays/RenameArray.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "GeometricObjects/Polyhedron.py", - "Graphs/NOVCAGraph.py", - "ImageData/WriteReadVtkImageData.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ReadImageData.py", - "IO/ReadPolyData.py", - "IO/ReadVTP.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateModelsFromLabels.py", - "Meshes/Decimation.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/Curvatures.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/NormalsDemo.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py" - ], - "vtkExtractGeometry": [ - "VisualizationAlgorithms/ExtractData.py" - ], - "vtkMarchingContourFilter": [ - "Modelling/FinanceFieldData.py" - ], - "vtkGeoTransform": [ - "Deprecated/Geovis/GeoGraticle.py" - ], - "vtkImageCast": [ - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "Images/Cast.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkWidgetEvent": [ - "Widgets/ContourWidget.py" - ], - "vtkPointLoad": [ - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py" - ], - "vtkSpiderPlotActor": [ - "Plotting/SpiderPlot.py" - ], - "vtkCellArray": [ - "Annotation/MultiLineText.py", - "DataManipulation/LineOnMesh.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/IterativeClosestPoints.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cube.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/NOVCAGraph.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/WriteTriangleToFile.py", - "Meshes/DeformPointSet.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/Spring.py", - "PolyData/ColoredTriangle.py", - "PolyData/IterateOverLines.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/WarpVector.py", - "Rendering/GradientBackground.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/SingleSplat.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/KochSnowflake.py", - "Widgets/ContourWidget.py" - ], - "vtkUniformGrid": [ - "CompositeData/OverlappingAMR.py" - ], - "vtkDICOMImageReader": [ - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "Modelling/MarchingCubes.py" - ], - "vtkRuledSurfaceFilter": [ - "PolyData/RuledSurfaceFilter.py" - ], - "vtkBandedPolyDataContourFilter": [ - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/NamedColors.py" - ], - "vtkImageShrink3D": [ - "ImageProcessing/IsoSubsample.py", - "Visualization/FroggieSurface.py" - ], - "vtkPolyLine": [ - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/PolyLine.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py", - "Rendering/GradientBackground.py", - "Visualization/KochSnowflake.py" - ], - "vtkGeoGraticule": [ - "Deprecated/Geovis/GeoGraticle.py" - ], - "vtkHardwareSelector": [ - "Visualization/HardwareSelector.py" - ], - "vtkTextMapper": [ - "Annotation/MultiLineText.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/SourceObjectsDemo.py", - "IO/ReadDICOMSeries.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/GradientBackground.py", - "Utilities/RescaleReverseLUT.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkParametricRandomHills": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkImplicitModeller": [ - "VisualizationAlgorithms/Hello.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py" - ], - "vtkParametricEllipsoid": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkQuadraticHexahedron": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py" - ], - "vtkCubeSource": [ - "Filtering/Glyph3D.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Rendering/LayeredActors.py", - "Rendering/Model.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Shadows.py", - "Rendering/TransparentBackground.py", - "Utilities/ShareCamera.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/MarchingCases.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/GlyphTable.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ShadowsLightsDemo.py", - "Widgets/OrientationMarkerWidget.py" - ], - "vtkBMPReader": [ - "Images/ImageWarp.py" - ], - "vtkGlyph2D": [ - "Filtering/Glyph2D.py" - ], - "vtkShortArray": [ - "Visualization/Lorenz.py" - ], - "vtkRectilinearGridGeometryFilter": [ - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "RectilinearGrid/RGrid.py" - ], - "vtkAxes": [ - "Annotation/TextOrigin.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Rendering/Rotations.py", - "Rendering/WalkCow.py", - "VisualizationAlgorithms/TensorAxes.py" - ], - "vtkMaskPoints": [ - "GeometricObjects/ParametricObjectsDemo.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkcn": [ - "Visualization/NamedColorPatches.py" - ], - "vtkProp3D": [ - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "Medical/MedicalDemo4.py" - ], - "vtkBox": [ - "ImplicitFunctions/BooleanOperationImplicitFunctions.py" - ], - "vtkGeoAssignCoordinates": [ - "Deprecated/Geovis/GeoAssignCoordinates.py" - ], - "vtkThreshold": [ - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py" - ], - "vtkImageFFT": [ - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/VTKSpectrum.py" - ], - "vtkParametricPseudosphere": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkMarchingCubes": [ - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/MarchingCubes.py", - "VisualizationAlgorithms/HeadBone.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/IsosurfaceSampling.py" - ], - "vtkParametricEnneper": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py" - ], - "vtkParametricConicSpiral": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkCommonCore": [ - "Annotation/MultiLineText.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py", - "ImageData/WriteReadVtkImageData.py", - "Images/Actor2D.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/DeformPointSet.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/GradientBackground.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/StippledLine.py", - "Rendering/TransformSphere.py", - "SimpleOperations/DistanceBetweenPoints.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/TextureCutSphere.py", - "UnstructuredGrid/UGrid.py", - "Utilities/CheckVTKVersion.py", - "Utilities/LUTUtilities.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/Variant.py", - "Utilities/VTKImportsForPython.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/Hanoi.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/KochSnowflake.py", - "Visualization/Lorenz.py", - "Visualization/NamedColors.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphFilter.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SplineWidget.py" - ], - "vtkGraphLayout": [ - "Graphs/VisualizeDirectedGraph.py" - ], - "vtkMinimalStandardRandomSequence": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/TriangulateTerrainMap.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "Meshes/ColoredElevationMap.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/SpiderPlot.py", - "PolyData/SmoothMeshGrid.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/Hanoi.py", - "Visualization/Lorenz.py" - ], - "vtkMultiThreshold": [ - "PolyData/CellsInsideObject.py" - ], - "vtkParametricSuperToroid": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py" - ], - "vtkImageThreshold": [ - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py" - ], - "vtkPointInterpolator": [ - "Meshes/PointInterpolator.py" - ], - "vtkImageFourierCenter": [ - "ImageProcessing/VTKSpectrum.py" - ], - "vtkImageSinusoidSource": [ - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py" - ], - "vtkImageHSVToRGB": [ - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkStructuredGrid": [ - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py" - ], - "vtkSkybox": [ - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkNew": [ - "Utilities/JSONColorMapToLUT.py", - "Utilities/XMLColorMapToLUT.py" - ], - "vtkpoly_dataReader": [ - "Meshes/CapClip.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py" - ], - "vtkContextScene": [ - "Plotting/MultiplePlots.py" - ], - "vtkUnsignedCharArray": [ - "DataManipulation/LineOnMesh.py", - "GeometricObjects/ColoredLines.py", - "Meshes/ColoredElevationMap.py", - "PolyData/ColoredTriangle.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/ColoredAnnotatedCube.py" - ], - "vtkLineSource": [ - "Filtering/WarpTo.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/SourceObjectsDemo.py", - "PolyData/TubeFilter.py", - "Rendering/StippledLine.py", - "Texture/AnimateVectors.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "Visualization/Kitchen.py" - ], - "vtkResampleWithDataSet": [ - "Meshes/PointInterpolator.py" - ], - "vtkMultiBlockDataSet": [ - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "PolyData/CellsInsideObject.py" - ], - "vtkShrinkFilter": [ - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/TessellatedBoxSource.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "IO/ReadLegacyUnstructuredGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "VisualizationAlgorithms/ExtractData.py", - "Visualization/LoopShrink.py" - ], - "vtkQuadraticEdge": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkWindowLevelLookupTable": [ - "ImageProcessing/VTKSpectrum.py", - "Visualization/FrogSlice.py" - ], - "vtkCommonMath": [ - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/CollisionDetection.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py" - ], - "vtkTriangles": [ - "Visualization/KochSnowflake.py" - ], - "vtkSLCReader": [ - "IO/ReadSLC.py" - ], - "vtkVertexGlyphFilter": [ - "Filtering/Delaunay2D.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Images/Actor2D.py", - "PolyData/ImplicitPolyDataDistance.py" - ], - "vtkWarpScalar": [ - "Images/ImageWarp.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/WarpCombustor.py" - ], - "vtkInteractorStyleTrackballCamera": [ - "Annotation/TextOrigin.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/TransientHDFReader.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/XMLColorMapToLUT.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/GlyphTable.py", - "Visualization/HardwareSelector.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/StreamLines.py", - "Widgets/CompassWidget.py", - "Widgets/SplineWidget.py" - ], - "vtkMergeData": [ - "Images/ImageWarp.py" - ], - "vtkQuadraticTriangle": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkCommonColor": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SideBySideGraphs.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/LUTUtilities.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ColorSeriesPatches.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColorPatches.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkRenderPassCollection": [ - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Shadows.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkCellTypeSource": [ - "GeometricObjects/CellTypeSource.py" - ], - "vtkIterativeClosestPointTransform": [ - "Filtering/IterativeClosestPoints.py", - "PolyData/AlignTwoPolyDatas.py" - ], - "vtkInteractionWidgets": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "Interaction/CallBack.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/Curvatures.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Tutorial/Tutorial_Step6.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/PointDataSubdivision.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkFiltersTexture": [ - "Rendering/PBR_Anisotropy.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/Motor.py", - "Visualization/SphereTexture.py" - ], - "vtkColorTransferFunction": [ - "DataManipulation/MeshLabelImageColor.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "Medical/MedicalDemo4.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Utilities/VTKWithNumpy.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py", - "VolumeRendering/SimpleRayCast.py" - ], - "vtkFiltersGeneral": [ - "Annotation/TextOrigin.py", - "DataManipulation/MeshLabelImageColor.py", - "Filtering/Delaunay2D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/TessellatedBoxSource.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageProcessing/IsoSubsample.py", - "Images/Actor2D.py", - "Images/ImageWarp.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/TissueLens.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Modelling/ContourTriangulator.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/RotationAroundLine.py", - "PolyData/WarpVector.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rotations.py", - "Rendering/TransformSphere.py", - "Rendering/WalkCow.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/LoopShrink.py" - ], - "vtkPolyVertex": [ - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkSimple2DLayoutStrategy": [ - "Graphs/VisualizeDirectedGraph.py", - "InfoVis/SelectedGraphIDs.py" - ], - "vtkImageIdealHighPass": [ - "ImageProcessing/IdealHighPass.py" - ], - "vtkRegularPolygonSource": [ - "Filtering/Glyph2D.py", - "GeometricObjects/Circle.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/RegularPolygonSource.py", - "Widgets/BalloonWidget.py" - ], - "vtkGlyph3DMapper": [ - "Filtering/AppendFilter.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Interaction/InteractorStyleTrackballCamera.py", - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkCommonTransforms": [ - "Filtering/TransformPolyData.py", - "GeometricObjects/Axes.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "Medical/GenerateCubesFromLabels.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/RotationAroundLine.py", - "Rendering/LayeredActors.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/TransformSphere.py", - "Rendering/WalkCow.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CollisionDetection.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Widgets/BoxWidget.py" - ], - "vtkParametricDini": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkRenderWindow": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "Graphs/SideBySideGraphs.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/SpiderPlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKModulesForCxx.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkImagingMath": [ - "ImageData/ImageWeightedSum.py", - "ImageData/SumVTKImages.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/VTKSpectrum.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py" - ], - "vtkStringArray": [ - "Graphs/CreateTree.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/Variant.py" - ], - "vtkIOHDF": [ - "IO/TransientHDFReader.py" - ], - "vtkMergePoints": [ - "VisualizationAlgorithms/HeadBone.py" - ], - "vtkSTLWriter": [ - "IO/WriteSTL.py" - ], - "vtkSuperquadric": [ - "ImplicitFunctions/SampleFunction.py" - ], - "vtkDataSetSurfaceFilter": [ - "VisualizationAlgorithms/DataSetSurface.py" - ], - "vtkGeoProjection": [ - "Deprecated/Geovis/GeoGraticle.py" - ], - "vtkIdFilter": [ - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Visualization/CurvatureBandsWithGlyphs.py" - ], - "vtkFiltersExtraction": [ - "CompositeData/MultiBlockDataSet.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Modelling/DelaunayMesh.py", - "Picking/CellPicking.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/MarchingCases.py", - "VolumeRendering/PseudoVolumeRendering.py" - ], - "vtkInteractionStyle": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WriteLegacyLinearCells.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/LUTUtilities.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkFrustumSource": [ - "GeometricObjects/Frustum.py" - ], - "vtkTransform": [ - "Filtering/TransformPolyData.py", - "GeometricObjects/Axes.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "Medical/GenerateCubesFromLabels.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CellsInsideObject.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/RotationAroundLine.py", - "Rendering/LayeredActors.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/TransformSphere.py", - "Rendering/WalkCow.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CollisionDetection.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Widgets/BoxWidget.py" - ], - "vtkImageNormalize": [ - "ImageData/ImageNormalize.py" - ], - "vtkDataSetReader": [ - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "Visualization/Blow.py" - ], - "vtkImagingColor": [ - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/Pad.py", - "Images/ImageWarp.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkTriangleStrip": [ - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/TriangleStrip.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtkRenderingContext2D": [ - "IO/ReadLegacyUnstructuredGrid.py", - "Plotting/MultiplePlots.py", - "Plotting/SurfacePlot.py" - ], - "vtk_version_ok": [ - "DataManipulation/MeshLabelImageColor.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/MarchingCubes.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Utilities/CheckVTKVersion.py", - "Utilities/VTKImportsForPython.py", - "VisualizationAlgorithms/HeadBone.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/IsosurfaceSampling.py", - "Widgets/CompassWidget.py", - "Widgets/SplineWidget.py" - ], - "vtkVariantArray": [ - "IO/ReadLegacyUnstructuredGrid.py", - "Utilities/LUTUtilities.py", - "Utilities/Variant.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtkBoxWidget": [ - "Tutorial/Tutorial_Step6.py", - "Widgets/BoxWidget.py" - ], - "vtkImagingCore": [ - "DataManipulation/MeshLabelImageColor.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Cast.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo3.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/QuadricVisualization.py" - ], - "vtkRenderingOpenGL2": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/HDRReader.py", - "IO/ImageWriter.py", - "IO/ReadDICOM.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadVTP.py", - "IO/WriteLegacyLinearCells.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/LUTUtilities.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/VTKImportsForPython.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkImageFlip": [ - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkParametricBour": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py" - ], - "vtkJPEGWriter": [ - "IO/ImageWriter.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/Hanoi.py" - ], - "vtkLight": [ - "Rendering/AmbientSpheres.py", - "Rendering/DiffuseSpheres.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Visualization/ShadowsLightsDemo.py" - ], - "vtkRotationalExtrusionFilter": [ - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/Spring.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py" - ], - "vtkImplicitPlaneRepresentation": [ - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkInteractionImage": [ - "IO/HDRReader.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "PolyData/PolyDataToImageDataStencil.py", - "VisualizationAlgorithms/ImageGradient.py" - ], - "vtkVector2i": [ - "Plotting/SurfacePlot.py" - ], - "vtkParallelCoordinatesView": [ - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py" - ], - "vtkTriQuadraticHexahedron": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkTableToPolyData": [ - "IO/CSVReadEdit1.py", - "Meshes/PointInterpolator.py" - ], - "vtkImageMarchingCubes": [ - "ImageProcessing/IsoSubsample.py" - ], - "vtkParametricCatalanMinimal": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkCompassWidget": [ - "Widgets/CompassWidget.py" - ], - "vtkmodules": [ - "Annotation/MultiLineText.py", - "Annotation/TextOrigin.py", - "Arrays/GetValues.py", - "Arrays/RenameArray.py", - "CompositeData/CompositePolyDataMapper.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Deprecated/Geovis/GeoGraticle.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "Filtering/WarpTo.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/CellTypeSource.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/PlanesIntersection.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/Polyhedron.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Pyramid.py", - "GeometricObjects/Quad.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/ShrinkCube.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/TessellatedBoxSource.py", - "GeometricObjects/Tetrahedron.py", - "GeometricObjects/TextActor.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructGraph.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/GraphToPolyData.py", - "Graphs/LabelVerticesAndEdges.py", - "Graphs/NOVCAGraph.py", - "Graphs/RandomGraphSource.py", - "Graphs/ScaleVertices.py", - "Graphs/SelectedVerticesAndEdges.py", - "Graphs/SideBySideGraphs.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py", - "HyperTreeGrid/HyperTreeGridSource.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/ImageNormalize.py", - "ImageData/ImageWeightedSum.py", - "ImageData/SumVTKImages.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Images/Actor2D.py", - "Images/BackgroundImage.py", - "Images/Cast.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "InfoVis/SelectedGraphIDs.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/InteractorStyleTrackballCamera.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/3DSImporter.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/HDRReader.py", - "IO/ImageWriter.py", - "IO/PolyDataToImageDataConverter.py", - "IO/ReadDICOM.py", - "IO/ReadDICOMSeries.py", - "IO/ReadExodusData.py", - "IO/ReadImageData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadUnstructuredGrid.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WriteLegacyLinearCells.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "IO/WriteTriangleToFile.py", - "IO/WriteXMLLinearCells.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/MedicalDemo4.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "Plotting/MultiplePlots.py", - "Plotting/ScatterPlot.py", - "Plotting/SpiderPlot.py", - "Plotting/SurfacePlot.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/ExtractSelection.py", - "PolyData/ExtractSelectionUsingCells.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "RectilinearGrid/RectilinearGrid.py", - "RectilinearGrid/RGrid.py", - "RectilinearGrid/VisualizeRectilinearGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "SimpleOperations/DistanceBetweenPoints.py", - "StructuredGrid/BlankPoint.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py", - "UnstructuredGrid/UGrid.py", - "Utilities/Animation.py", - "Utilities/CheckVTKVersion.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/LUTUtilities.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/Variant.py", - "Utilities/VTKImportsForPython.py", - "Utilities/VTKWithNumpy.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/ImageGradient.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ColorSeriesPatches.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColorPatches.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "VolumeRendering/SimpleRayCast.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/CompassWidget.py", - "Widgets/ContourWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/ScalarBarWidget.py", - "Widgets/SphereWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtk_file": [ - "IO/ReadUnstructuredGrid.py" - ], - "vtkPlotSurface": [ - "Plotting/SurfacePlot.py" - ], - "vtkReverseSense": [ - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py" - ], - "vtkCylinderSource": [ - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/SourceObjectsDemo.py", - "Rendering/FlatVersusGouraud.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ShareCamera.py", - "Visualization/Hanoi.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Widgets/SplineWidget.py" - ], - "vtkDecimatePro": [ - "Meshes/Decimation.py", - "Rendering/StripFran.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "Visualization/FroggieSurface.py" - ], - "vtkCompassRepresentation": [ - "Widgets/CompassWidget.py" - ], - "vtkOutlineGlowPass": [ - "Rendering/OutlineGlowPass.py" - ], - "vtkGlyphSource2D": [ - "Graphs/VisualizeDirectedGraph.py" - ], - "vtkImageLogarithmicScale": [ - "ImageProcessing/VTKSpectrum.py" - ], - "vtkParametricTorus": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkImplicitTextureCoords": [ - "Texture/TextureCutQuadric.py", - "Texture/TextureCutSphere.py", - "VisualizationAlgorithms/Motor.py" - ], - "vtks": [ - "ImageProcessing/VTKSpectrum.py" - ], - "vtkFiltersGeometry": [ - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/WriteReadVtkImageData.py", - "Images/ImageWarp.py", - "IO/ReadExodusData.py", - "IO/ReadPLOT3D.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "RectilinearGrid/RGrid.py", - "Rendering/Rainbow.py", - "StructuredGrid/BlankPoint.py", - "Texture/TextureThreshold.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/Blow.py", - "Visualization/Kitchen.py" - ], - "vtkLoopSubdivisionFilter": [ - "DataManipulation/LineOnMesh.py", - "PolyData/SmoothMeshGrid.py" - ], - "vtkPolyDataMapper": [ - "Annotation/TextOrigin.py", - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "Deprecated/Geovis/GeoGraticle.py", - "Filtering/CombinePolyData.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TransformPolyData.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "GeometricObjects/Arrow.py", - "GeometricObjects/Axes.py", - "GeometricObjects/Circle.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/Cone.py", - "GeometricObjects/Cube1.py", - "GeometricObjects/Cube.py", - "GeometricObjects/CylinderExample.py", - "GeometricObjects/Cylinder.py", - "GeometricObjects/Disk.py", - "GeometricObjects/Dodecahedron.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/Frustum.py", - "GeometricObjects/GeometricObjectsDemo.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/Line.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/Plane.py", - "GeometricObjects/Planes.py", - "GeometricObjects/PlatonicSolids.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Quad.py", - "GeometricObjects/RegularPolygonSource.py", - "GeometricObjects/SourceObjectsDemo.py", - "GeometricObjects/Sphere.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/Vertex.py", - "Graphs/GraphToPolyData.py", - "Graphs/VisualizeDirectedGraph.py", - "ImageData/ImageDataGeometryFilter.py", - "ImageData/WriteReadVtkImageData.py", - "ImageProcessing/IsoSubsample.py", - "Images/BackgroundImage.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "Interaction/InteractorStyleTrackballActor.py", - "Interaction/MouseEventsObserver.py", - "Interaction/MouseEvents.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/ImageWriter.py", - "IO/ReadExodusData.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadPLOT3D.py", - "IO/ReadPolyData.py", - "IO/ReadSLC.py", - "IO/ReadSTL.py", - "IO/ReadVTP.py", - "IO/TransientHDFReader.py", - "IO/WritePLY.py", - "IO/WriteSTL.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/DelaunayMesh.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "Picking/HighlightPickedActor.py", - "Picking/HighlightWithSilhouette.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/Outline.py", - "PolyData/PointSource.py", - "PolyData/RotationAroundLine.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "PolyData/WarpVector.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py", - "RectilinearGrid/RGrid.py", - "Rendering/AmbientSpheres.py", - "Rendering/CameraBlur.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/DiffuseSpheres.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/GradientBackground.py", - "Rendering/LayeredActors.py", - "Rendering/Mace.py", - "Rendering/Model.py", - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Rendering/SpecularSpheres.py", - "Rendering/StippledLine.py", - "Rendering/StripFran.py", - "Rendering/TransparentBackground.py", - "Rendering/WalkCow.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureCutSphere.py", - "Texture/TexturePlane.py", - "Texture/TextureThreshold.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step2.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "Utilities/Animation.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/ResetCameraOrientation.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Utilities/Screenshot.py", - "Utilities/ShareCamera.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/AlphaFrequency.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/BillboardTextActor3D.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/Camera.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/CollisionDetection.py", - "Visualization/ColorAnActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CreateColorSeriesDemo.py", - "Visualization/CubeAxesActor.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hanoi.py", - "Visualization/HardwareSelector.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/KochSnowflake.py", - "Visualization/Lorenz.py", - "Visualization/MultipleRenderWindows.py", - "Visualization/MultipleViewports.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/PointSize.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/SphereTexture.py", - "Visualization/StreamLines.py", - "Visualization/TextSource.py", - "Visualization/VectorText.py", - "Visualization/WindowTitle.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/BalloonWidget.py", - "Widgets/BoxWidget.py", - "Widgets/CameraOrientationWidget.py", - "Widgets/EmbedInPyQt2.py", - "Widgets/EmbedInPyQt.py", - "Widgets/ImplicitPlaneWidget2.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py", - "Widgets/SplineWidget.py", - "Widgets/TextWidget.py" - ], - "vtkParametricSuperEllipsoid": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py" - ], - "vtk_modules": [ - "Utilities/VTKImportsForPython.py" - ], - "vtkQuadraticLinearWedge": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkImageMapToWindowLevelColors": [ - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/Pad.py" - ], - "vtk3DSImporter": [ - "IO/3DSImporter.py" - ], - "vtkDelaunay3D": [ - "Filtering/ConnectivityFilter.py", - "Problems/ImplicitFunctions/ImplicitDataSet.py" - ], - "vtkTimerCallback": [ - "Utilities/Animation.py" - ], - "vtkFiltersHyperTree": [ - "HyperTreeGrid/HyperTreeGridSource.py" - ], - "vtkImagingGeneral": [ - "ImageData/ImageNormalize.py", - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/GlyphTable.py" - ], - "vtkLabeledDataMapper": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/ReadLegacyUnstructuredGrid.py" - ], - "vtkMatrix4x4": [ - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "Visualization/CollisionDetection.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py" - ], - "vtkOrientationMarkerWidget": [ - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Interaction/CallBack.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/AlignTwoPolyDatas.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/DisplayCoordinateAxes.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/PointDataSubdivision.py", - "Widgets/OrientationMarkerWidget1.py", - "Widgets/OrientationMarkerWidget.py" - ], - "vtkGaussianSplatter": [ - "Filtering/GaussianSplat.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SplatFace.py" - ], - "vtkImageSeedConnectivity": [ - "ImageProcessing/MorphologyComparison.py" - ], - "vtkVariantLessThan": [ - "Utilities/Variant.py" - ], - "vtkFiltersCore": [ - "CompositeData/MultiBlockDataSet.py", - "CompositeData/OverlappingAMR.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "ExplicitStructuredGrid/CreateESGrid.py", - "ExplicitStructuredGrid/LoadESGrid.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConnectivityFilter.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/PerlinNoise.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/WarpTo.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/Planes.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticHexahedron.py", - "GeometricObjects/QuadraticTetraDemo.py", - "GeometricObjects/QuadraticTetra.py", - "Graphs/VisualizeDirectedGraph.py", - "Images/ImageWarp.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "InfoVis/ParallelCoordinatesView.py", - "IO/ReadLegacyUnstructuredGrid.py", - "IO/ReadSLC.py", - "Medical/GenerateCubesFromLabels.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "Meshes/ClipDataSetWithPolyData1.py", - "Meshes/ClipDataSetWithPolyData.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Meshes/PointInterpolator.py", - "Meshes/SolidClip.py", - "Modelling/Bottle.py", - "Modelling/ContourTriangulator.py", - "Modelling/DelaunayMesh.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/FinanceFieldData.py", - "Modelling/Finance.py", - "Modelling/MarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Modelling/Spring.py", - "Picking/CellPicking.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/ClosedSurface.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/PolyDataToImageDataStencil.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/TubeFilter.py", - "Rendering/CameraBlur.py", - "Rendering/ColoredSphere.py", - "Rendering/FlatVersusGouraud.py", - "Rendering/Mace.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/Rainbow.py", - "Rendering/StripFran.py", - "Rendering/TransformSphere.py", - "StructuredGrid/SGrid.py", - "StructuredPoints/Vol.py", - "Texture/AnimateVectors.py", - "Texture/TextureThreshold.py", - "Utilities/ColorMapToLUT.py", - "Utilities/JSONColorMapToLUT.py", - "Utilities/RescaleReverseLUT.py", - "Utilities/XMLColorMapToLUT.py", - "VisualizationAlgorithms/BluntStreamlines.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/CombustorIsosurface.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/CutStructuredGrid.py", - "VisualizationAlgorithms/Cutter.py", - "VisualizationAlgorithms/CutWithCutFunction.py", - "VisualizationAlgorithms/CutWithScalars.py", - "VisualizationAlgorithms/DataSetSurface.py", - "VisualizationAlgorithms/DecimateFran.py", - "VisualizationAlgorithms/DecimateHawaii.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/Hello.py", - "VisualizationAlgorithms/IceCream.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/LOxGrid.py", - "VisualizationAlgorithms/LOx.py", - "VisualizationAlgorithms/LOxSeeds.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Motor.py", - "VisualizationAlgorithms/Office.py", - "VisualizationAlgorithms/OfficeTube.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/SplatFace.py", - "VisualizationAlgorithms/Stocks.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "VisualizationAlgorithms/VelocityProfile.py", - "VisualizationAlgorithms/WarpCombustor.py", - "Visualization/BlobbyLogo.py", - "Visualization/Blow.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/ClampGlyphSizes.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/ComplexV.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Visualization/FrogSlice.py", - "Visualization/GlyphTable.py", - "Visualization/Hawaii.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/Kitchen.py", - "Visualization/LoopShrink.py", - "Visualization/Lorenz.py", - "Visualization/NamedColors.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/PointDataSubdivision.py", - "Visualization/ProgrammableGlyphs.py", - "Visualization/QuadricVisualization.py", - "Visualization/ShadowsLightsDemo.py", - "Visualization/StreamLines.py", - "VolumeRendering/PseudoVolumeRendering.py", - "Widgets/ImplicitPlaneWidget2.py" - ], - "vtkLookUp": [ - "PolyData/CurvaturesDemo.py" - ], - "vtkGraphToPolyData": [ - "Graphs/GraphToPolyData.py", - "Graphs/VisualizeDirectedGraph.py" - ], - "vtkCircularLayoutStrategy": [ - "Graphs/LabelVerticesAndEdges.py" - ], - "vtkAppendFilter": [ - "Filtering/AppendFilter.py", - "Filtering/ConnectivityFilter.py", - "Visualization/CameraModel1.py", - "Visualization/QuadricVisualization.py" - ], - "vtkIdList": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/Cube.py", - "GeometricObjects/Polyhedron.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/ExtractPolyLinesFromPolyData.py", - "PolyData/IterateOverLines.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "Visualization/CurvatureBandsWithGlyphs.py" - ], - "vtkSampleFunction": [ - "Filtering/PerlinNoise.py", - "ImageProcessing/Attenuation.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitQuadric.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "ImplicitFunctions/SampleFunction.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "Rendering/FlatVersusGouraud.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/IceCream.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/QuadricVisualization.py" - ], - "vtkContextMouseEvent": [ - "Plotting/SurfacePlot.py" - ], - "vtkParametricKlein": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo.py", - "Deprecated/GeometricObjects/ParametricObjects.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkTree": [ - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py" - ], - "vtkTimeSourceExample": [ - "Problems/Visualization/UnstructuredTransientVolumeRendering.py" - ], - "vtkProbeFilter": [ - "Medical/TissueLens.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "Visualization/IsosurfaceSampling.py" - ], - "vtkMath": [ - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/OrientedArrow.py", - "GeometricObjects/OrientedCylinder.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "SimpleOperations/DistanceBetweenPoints.py", - "StructuredGrid/SGrid.py", - "Widgets/CompassWidget.py" - ], - "vtkVariantStrictWeakOrder": [ - "Utilities/Variant.py" - ], - "vtkAnnotatedCubeActor": [ - "VisualizationAlgorithms/AnatomicalOrientation.py", - "Visualization/AnnotatedCubeActor.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py", - "Widgets/CompassWidget.py", - "Widgets/OrientationMarkerWidget.py" - ], - "vtkSphere": [ - "CompositeData/OverlappingAMR.py", - "ImageProcessing/Attenuation.py", - "ImplicitFunctions/BooleanOperationImplicitFunctions.py", - "ImplicitFunctions/ImplicitSphere1.py", - "ImplicitFunctions/ImplicitSphere.py", - "Medical/TissueLens.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/SmoothDiscreteMarchingCubes.py", - "VisualizationAlgorithms/ClipSphereCylinder.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/IceCream.py", - "Visualization/IsosurfaceSampling.py" - ], - "vtkCommonComputationalGeometry": [ - "DataManipulation/LineOnMesh.py", - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricObjectsDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkDataObjectReader": [ - "Modelling/FinanceFieldData.py" - ], - "vtkOutlineFilter": [ - "CompositeData/OverlappingAMR.py", - "ImplicitFunctions/SampleFunction.py", - "InfoVis/ParallelCoordinatesExtraction.py", - "Interaction/CallBack.py", - "IO/ReadSLC.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "PolyData/Outline.py", - "Texture/AnimateVectors.py", - "VisualizationAlgorithms/CarotidFlowGlyphs.py", - "VisualizationAlgorithms/CarotidFlow.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/ExtractData.py", - "VisualizationAlgorithms/FlyingHeadSlice.py", - "VisualizationAlgorithms/HeadBone.py", - "VisualizationAlgorithms/HeadSlice.py", - "VisualizationAlgorithms/HyperStreamline.py", - "VisualizationAlgorithms/IronIsoSurface.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/ProbeCombustor.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/TensorAxes.py", - "VisualizationAlgorithms/TensorEllipsoids.py", - "Visualization/ComplexV.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/QuadricVisualization.py" - ], - "vtkSelectEnclosedPoints": [ - "PolyData/CellsInsideObject.py" - ], - "vtkRenderingLOD": [ - "DataManipulation/MeshLabelImageColor.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py" - ], - "vtkQuadraticLinearQuad": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkCubicLine": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkXMLUnstructuredGridWriter": [ - "GeometricObjects/Polyhedron.py", - "Graphs/NOVCAGraph.py" - ], - "vtkCompositePolyDataMapper2": [ - "CompositeData/CompositePolyDataMapper.py" - ], - "vtkPNGWriter": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/EarthSource.py", - "GeometricObjects/ParametricObjectsDemo.py", - "Images/Actor2D.py", - "IO/ImageWriter.py", - "PolyData/PolyDataContourToImageData.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Rendering/WalkCow.py", - "Utilities/Screenshot.py", - "Visualization/Hanoi.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkcnStartTable": [ - "Visualization/NamedColorPatches.py" - ], - "vtkProgrammableGlyphFilter": [ - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/ProgrammableGlyphs.py" - ], - "vtkImageIslandRemoval2D": [ - "Visualization/FroggieSurface.py" - ], - "vtkXMLDataSetWriter": [ - "IO/WriteXMLLinearCells.py" - ], - "vtkHexahedron": [ - "GeometricObjects/Cell3DDemonstration.py", - "GeometricObjects/Hexahedron.py", - "GeometricObjects/LinearCellsDemo.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py", - "VisualizationAlgorithms/DataSetSurface.py" - ], - "vtkFlyingEdges3D": [ - "DataManipulation/MeshLabelImageColor.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/MarchingCubes.py", - "VisualizationAlgorithms/HeadBone.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py", - "Visualization/IsosurfaceSampling.py" - ], - "vtkFiltersHybrid": [ - "GeometricObjects/EarthSource.py", - "Picking/HighlightWithSilhouette.py", - "VisualizationAlgorithms/Hello.py", - "Visualization/BlobbyLogo.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/PointDataSubdivision.py" - ], - "vtkImageAccumulate": [ - "Medical/GenerateModelsFromLabels.py" - ], - "vtkDiscreteFlyingEdges3D": [ - "DataManipulation/MeshLabelImageColor.py", - "Medical/GenerateModelsFromLabels.py", - "Modelling/DiscreteMarchingCubes.py" - ], - "vtkUnstructuredGridVolumeRayCastMapper": [ - "Problems/Visualization/UnstructuredTransientVolumeRendering.py" - ], - "vtkCellTypes": [ - "GeometricObjects/CellTypeSource.py", - "IO/ReadLegacyUnstructuredGrid.py", - "Meshes/ClipDataSetWithPolyData.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane2.py", - "UnstructuredGrid/ClipUnstructuredGridWithPlane.py" - ], - "vtkImageConstantPad": [ - "ImageProcessing/Pad.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/FrogSlice.py" - ], - "vtkSliderRepresentation2D": [ - "GeometricObjects/ParametricKuenDemo.py", - "GeometricObjects/ParametricSuperEllipsoidDemo.py", - "GeometricObjects/ParametricSuperToroidDemo.py", - "GeometricObjects/QuadraticHexahedronDemo.py", - "GeometricObjects/QuadraticTetraDemo.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Visualization/FroggieView.py" - ], - "vtkMutableDirectedGraph": [ - "Deprecated/Geovis/GeoAssignCoordinates.py", - "Graphs/ColorEdges.py", - "Graphs/ColorVertexLabels.py", - "Graphs/ColorVerticesLookupTable.py", - "Graphs/ConstructTree.py", - "Graphs/CreateTree.py", - "Graphs/EdgeWeights.py", - "Graphs/VisualizeDirectedGraph.py", - "Graphs/VisualizeGraph.py" - ], - "vtkAxis": [ - "Plotting/MultiplePlots.py" - ], - "vtkVersion": [ - "DataManipulation/MeshLabelImageColor.py", - "GeometricObjects/IsoparametricCellsDemo.py", - "GeometricObjects/LinearCellsDemo.py", - "Medical/GenerateModelsFromLabels.py", - "Medical/MedicalDemo1.py", - "Medical/MedicalDemo2.py", - "Medical/MedicalDemo3.py", - "Medical/TissueLens.py", - "Modelling/DiscreteMarchingCubes.py", - "Modelling/ExtractLargestIsosurface.py", - "Modelling/MarchingCubes.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Rendering/OutlineGlowPass.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Utilities/CheckVTKVersion.py", - "Utilities/VTKImportsForPython.py", - "VisualizationAlgorithms/HeadBone.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/FrogBrain.py", - "Visualization/IsosurfaceSampling.py", - "Visualization/PointDataSubdivision.py", - "Widgets/CompassWidget.py", - "Widgets/SplineWidget.py" - ], - "vtkPropAssembly": [ - "VisualizationAlgorithms/AnatomicalOrientation.py", - "Visualization/ColoredAnnotatedCube.py", - "Visualization/FroggieSurface.py", - "Visualization/FroggieView.py" - ], - "vtkJPEGReader": [ - "Images/BackgroundImage.py", - "Visualization/SphereTexture.py" - ], - "vtkFeatureEdges": [ - "Meshes/BoundaryEdges.py", - "Meshes/CapClip.py", - "PolyData/ClosedSurface.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/FilledPolygon.py", - "Visualization/CurvatureBandsWithGlyphs.py" - ], - "vtkScalarBarActor": [ - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "Problems/Visualization/UnstructuredTransientVolumeRendering.py", - "Utilities/RescaleReverseLUT.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Widgets/ScalarBarWidget.py" - ], - "vtkXMLPolyDataWriter": [ - "Arrays/RenameArray.py", - "IO/CSVReadEdit1.py", - "IO/CSVReadEdit.py", - "IO/WriteTriangleToFile.py", - "Medical/GenerateModelsFromLabels.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/Curvatures.py", - "PolyData/PolyDataContourToImageData.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "Visualization/AssignCellColorsFromLUT.py" - ], - "vtk_vtk": [ - "Utilities/SelectExamples.py" - ], - "vtkPolydata": [ - "Medical/GenerateCubesFromLabels.py" - ], - "vtkImageGaussianSmooth": [ - "ImageProcessing/Attenuation.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "VisualizationAlgorithms/CreateBFont.py", - "VisualizationAlgorithms/ImageGradient.py", - "Visualization/FrogBrain.py", - "Visualization/FroggieSurface.py" - ], - "vtkImageImport": [ - "Utilities/VTKWithNumpy.py" - ], - "vtkProp": [ - "Medical/MedicalDemo3.py" - ], - "vtkImageReader2Factory": [ - "ImageProcessing/Attenuation.py", - "ImageProcessing/EnhanceEdges.py", - "ImageProcessing/GaussianSmooth.py", - "ImageProcessing/HybridMedianComparison.py", - "ImageProcessing/IdealHighPass.py", - "ImageProcessing/IsoSubsample.py", - "ImageProcessing/MedianComparison.py", - "ImageProcessing/MorphologyComparison.py", - "ImageProcessing/Pad.py", - "ImageProcessing/VTKSpectrum.py", - "Rendering/PBR_Anisotropy.py", - "Rendering/PBR_Clear_Coat.py", - "Rendering/PBR_Edge_Tint.py", - "Rendering/PBR_HDR_Environment.py", - "Rendering/PBR_Mapping.py", - "Rendering/PBR_Materials_Coat.py", - "Rendering/PBR_Materials.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py", - "Texture/TexturePlane.py" - ], - "vtkActorCollection": [ - "IO/3DSImporter.py" - ], - "vtkRenderStepsPass": [ - "Rendering/MotionBlur.py", - "Rendering/OutlineGlowPass.py" - ], - "vtkImageDilateErode3D": [ - "ImageProcessing/MorphologyComparison.py" - ], - "vtkQuadric": [ - "ImplicitFunctions/ImplicitQuadric.py", - "Rendering/FlatVersusGouraud.py", - "Texture/TextureCutQuadric.py", - "VisualizationAlgorithms/ContourQuadric.py", - "VisualizationAlgorithms/ExtractData.py", - "Visualization/DisplayQuadricSurfaces.py", - "Visualization/QuadricVisualization.py" - ], - "vtkWarpVector": [ - "PolyData/WarpVector.py", - "VisualizationAlgorithms/DisplacementPlot.py", - "VisualizationAlgorithms/PlateVibration.py", - "VisualizationAlgorithms/VelocityProfile.py", - "Visualization/Blow.py" - ], - "vtkQuadraticPolygon": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkImageWrapPad": [ - "Medical/GenerateCubesFromLabels.py" - ], - "vtkMetaImageWriter": [ - "IO/PolyDataToImageDataConverter.py", - "PolyData/PolyDataContourToImageData.py" - ], - "vtkVariantCast": [ - "Utilities/Variant.py" - ], - "vtkPolyData": [ - "Annotation/MultiLineText.py", - "Arrays/GetValues.py", - "Arrays/RenameArray.py", - "DataManipulation/LineOnMesh.py", - "DataManipulation/MeshLabelImageColor.py", - "Filtering/AppendFilter.py", - "Filtering/CombinePolyData.py", - "Filtering/ConstrainedDelaunay2D.py", - "Filtering/Delaunay2D.py", - "Filtering/GaussianSplat.py", - "Filtering/Glyph2D.py", - "Filtering/Glyph3D.py", - "Filtering/IterativeClosestPoints.py", - "Filtering/TriangulateTerrainMap.py", - "Filtering/VertexGlyphFilter.py", - "GeometricObjects/ColoredLines.py", - "GeometricObjects/ConvexPointSet.py", - "GeometricObjects/Cube.py", - "GeometricObjects/EllipticalCylinderDemo.py", - "GeometricObjects/EllipticalCylinder.py", - "GeometricObjects/LongLine.py", - "GeometricObjects/Planes.py", - "GeometricObjects/Point.py", - "GeometricObjects/Polygon.py", - "GeometricObjects/PolyLine1.py", - "GeometricObjects/PolyLine.py", - "GeometricObjects/Quad.py", - "GeometricObjects/Triangle.py", - "GeometricObjects/TriangleStrip.py", - "GeometricObjects/Vertex.py", - "Images/Actor2D.py", - "Interaction/InteractorStyleTrackballCamera.py", - "IO/CSVReadEdit.py", - "IO/WriteTriangleToFile.py", - "Medical/GenerateModelsFromLabels.py", - "Meshes/CapClip.py", - "Meshes/ColoredElevationMap.py", - "Meshes/Decimation.py", - "Meshes/DeformPointSet.py", - "Modelling/Bottle.py", - "Modelling/CappedSphere.py", - "Modelling/DelaunayMesh.py", - "Modelling/Spring.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/ColoredTriangle.py", - "PolyData/CurvaturesAdjustEdges.py", - "PolyData/CurvaturesDemo.py", - "PolyData/Curvatures.py", - "PolyData/FilledPolygon.py", - "PolyData/ImplicitPolyDataDistance.py", - "PolyData/IterateOverLines.py", - "PolyData/RuledSurfaceFilter.py", - "PolyData/SmoothMeshGrid.py", - "PolyData/SolidColoredTriangle.py", - "PolyData/TriangleColoredPoints.py", - "PolyData/TriangleCorners.py", - "PolyData/TriangleCornerVertices.py", - "PolyData/WarpVector.py", - "Rendering/Cone3.py", - "Rendering/Cone4.py", - "Rendering/GradientBackground.py", - "Tutorial/Tutorial_Step1.py", - "Tutorial/Tutorial_Step3.py", - "Tutorial/Tutorial_Step4.py", - "Tutorial/Tutorial_Step5.py", - "Tutorial/Tutorial_Step6.py", - "VisualizationAlgorithms/ExponentialCosine.py", - "VisualizationAlgorithms/PineRootConnectivity.py", - "VisualizationAlgorithms/PineRootDecimation.py", - "VisualizationAlgorithms/SingleSplat.py", - "VisualizationAlgorithms/SpikeFran.py", - "VisualizationAlgorithms/StreamlinesWithLineWidget.py", - "Visualization/AssignCellColorsFromLUT.py", - "Visualization/CameraModel1.py", - "Visualization/CameraModel2.py", - "Visualization/CurvatureBandsWithGlyphs.py", - "Visualization/ElevationBandsWithGlyphs.py", - "Visualization/KochSnowflake.py", - "Visualization/NormalsDemo.py", - "Visualization/OrientedGlyphs.py", - "Visualization/ProgrammableGlyphFilter.py", - "Visualization/SphereTexture.py", - "Widgets/ContourWidget.py" - ], - "vtkVectorText": [ - "Annotation/TextOrigin.py", - "Modelling/FinanceFieldData.py", - "VisualizationAlgorithms/AnatomicalOrientation.py", - "VisualizationAlgorithms/MarchingCases.py", - "VisualizationAlgorithms/Stocks.py", - "Visualization/AlphaFrequency.py", - "Visualization/VectorText.py" - ], - "vtkBiQuadraticQuadraticWedge": [ - "GeometricObjects/IsoparametricCellsDemo.py" - ], - "vtkSTLReader": [ - "IO/PolyDataToImageDataConverter.py", - "IO/ReadSTL.py", - "IO/WriteSTL.py", - "Meshes/CapClip.py", - "Meshes/Decimation.py", - "Meshes/PointInterpolator.py", - "PolyData/AlignTwoPolyDatas.py", - "PolyData/BooleanOperationPolyDataFilter.py", - "PolyData/CellsInsideObject.py", - "PolyData/ClosedSurface.py", - "Rendering/GradientBackground.py", - "Rendering/Rotations.py", - "Rendering/Shadows.py", - "Utilities/SaveSceneToFieldData.py", - "Utilities/SaveSceneToFile.py", - "Visualization/NormalsDemo.py" - ], - "vtkParametricPluckerConoid": [ - "Deprecated/GeometricObjects/ParametricObjectsDemo2.py", - "GeometricObjects/ParametricObjectsDemo.py" - ], - "vtkCompositeDataDisplayAttributes": [ - "CompositeData/CompositePolyDataMapper.py" - ], - "vtkViewport": [ - "Rendering/GradientBackground.py" - ], - "vtkTexturedSphereSource": [ - "PolyData/CurvaturesAdjustEdges.py", - "Rendering/PBR_Skybox_Anisotropy.py", - "Rendering/PBR_Skybox.py", - "Rendering/PBR_Skybox_Texturing.py" - ], - "vtkPolygon": [ - "Filtering/ConstrainedDelaunay2D.py", - "GeometricObjects/LinearCellsDemo.py", - "GeometricObjects/PolygonIntersection.py", - "GeometricObjects/Polygon.py", - "IO/WriteLegacyLinearCells.py", - "IO/WriteXMLLinearCells.py" - ], - "vtklib": [ - "Utilities/VTKImportsForPython.py" - ] -} diff --git a/data/examples/index.txt b/data/examples/index.txt deleted file mode 100644 index 8c9f3bc..0000000 --- a/data/examples/index.txt +++ /dev/null @@ -1,8235 +0,0 @@ -"vtk3DSImporter","IO/3DSImporter.py" -"vtkActor2D","Annotation/MultiLineText.py" -"vtkActor2D","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkActor2D","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkActor2D","GeometricObjects/Cell3DDemonstration.py" -"vtkActor2D","GeometricObjects/CellTypeSource.py" -"vtkActor2D","GeometricObjects/GeometricObjectsDemo.py" -"vtkActor2D","GeometricObjects/IsoparametricCellsDemo.py" -"vtkActor2D","GeometricObjects/LinearCellsDemo.py" -"vtkActor2D","GeometricObjects/ParametricObjectsDemo.py" -"vtkActor2D","GeometricObjects/Planes.py" -"vtkActor2D","GeometricObjects/PlatonicSolids.py" -"vtkActor2D","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkActor2D","GeometricObjects/QuadraticTetraDemo.py" -"vtkActor2D","GeometricObjects/SourceObjectsDemo.py" -"vtkActor2D","Images/Actor2D.py" -"vtkActor2D","IO/ReadDICOMSeries.py" -"vtkActor2D","IO/ReadLegacyUnstructuredGrid.py" -"vtkActor2D","PolyData/CurvaturesAdjustEdges.py" -"vtkActor2D","PolyData/CurvaturesDemo.py" -"vtkActor2D","Rendering/GradientBackground.py" -"vtkActor2D","Utilities/RescaleReverseLUT.py" -"vtkActor2D","VisualizationAlgorithms/ImageGradient.py" -"vtkActor2D","Visualization/PointDataSubdivision.py" -"vtkActor","Annotation/TextOrigin.py" -"vtkActorCollection","IO/3DSImporter.py" -"vtkActor","CompositeData/CompositePolyDataMapper.py" -"vtkActor","CompositeData/MultiBlockDataSet.py" -"vtkActor","CompositeData/OverlappingAMR.py" -"vtkActor","DataManipulation/LineOnMesh.py" -"vtkActor","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkActor","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkActor","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkActor","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkActor","Deprecated/Geovis/GeoGraticle.py" -"vtkActor","ExplicitStructuredGrid/CreateESGrid.py" -"vtkActor","ExplicitStructuredGrid/LoadESGrid.py" -"vtkActor","Filtering/AppendFilter.py" -"vtkActor","Filtering/CombinePolyData.py" -"vtkActor","Filtering/ConnectivityFilter.py" -"vtkActor","Filtering/ConstrainedDelaunay2D.py" -"vtkActor","Filtering/Delaunay2D.py" -"vtkActor","Filtering/GaussianSplat.py" -"vtkActor","Filtering/Glyph2D.py" -"vtkActor","Filtering/Glyph3D.py" -"vtkActor","Filtering/PerlinNoise.py" -"vtkActor","Filtering/TransformPolyData.py" -"vtkActor","Filtering/TriangulateTerrainMap.py" -"vtkActor","Filtering/VertexGlyphFilter.py" -"vtkActor","Filtering/WarpTo.py" -"vtkActor","GeometricObjects/Arrow.py" -"vtkActor","GeometricObjects/Axes.py" -"vtkActor","GeometricObjects/Cell3DDemonstration.py" -"vtkActor","GeometricObjects/CellTypeSource.py" -"vtkActor","GeometricObjects/Circle.py" -"vtkActor","GeometricObjects/ColoredLines.py" -"vtkActor","GeometricObjects/Cone.py" -"vtkActor","GeometricObjects/ConvexPointSet.py" -"vtkActor","GeometricObjects/Cube1.py" -"vtkActor","GeometricObjects/Cube.py" -"vtkActor","GeometricObjects/CylinderExample.py" -"vtkActor","GeometricObjects/Cylinder.py" -"vtkActor","GeometricObjects/Disk.py" -"vtkActor","GeometricObjects/Dodecahedron.py" -"vtkActor","GeometricObjects/EarthSource.py" -"vtkActor","GeometricObjects/EllipticalCylinderDemo.py" -"vtkActor","GeometricObjects/EllipticalCylinder.py" -"vtkActor","GeometricObjects/Frustum.py" -"vtkActor","GeometricObjects/GeometricObjectsDemo.py" -"vtkActor","GeometricObjects/Hexahedron.py" -"vtkActor","GeometricObjects/IsoparametricCellsDemo.py" -"vtkActor","GeometricObjects/LinearCellsDemo.py" -"vtkActor","GeometricObjects/Line.py" -"vtkActor","GeometricObjects/LongLine.py" -"vtkActor","GeometricObjects/OrientedArrow.py" -"vtkActor","GeometricObjects/OrientedCylinder.py" -"vtkActor","GeometricObjects/ParametricKuenDemo.py" -"vtkActor","GeometricObjects/ParametricObjectsDemo.py" -"vtkActor","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkActor","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkActor","GeometricObjects/Plane.py" -"vtkActor","GeometricObjects/Planes.py" -"vtkActor","GeometricObjects/PlatonicSolids.py" -"vtkActor","GeometricObjects/Point.py" -"vtkActor","GeometricObjects/Polygon.py" -"vtkActor","GeometricObjects/Polyhedron.py" -"vtkActor","GeometricObjects/PolyLine1.py" -"vtkActor","GeometricObjects/PolyLine.py" -"vtkActor","GeometricObjects/Pyramid.py" -"vtkActor","GeometricObjects/Quad.py" -"vtkActor","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkActor","GeometricObjects/QuadraticHexahedron.py" -"vtkActor","GeometricObjects/QuadraticTetraDemo.py" -"vtkActor","GeometricObjects/QuadraticTetra.py" -"vtkActor","GeometricObjects/RegularPolygonSource.py" -"vtkActor","GeometricObjects/ShrinkCube.py" -"vtkActor","GeometricObjects/SourceObjectsDemo.py" -"vtkActor","GeometricObjects/Sphere.py" -"vtkActor","GeometricObjects/TessellatedBoxSource.py" -"vtkActor","GeometricObjects/Tetrahedron.py" -"vtkActor","GeometricObjects/Triangle.py" -"vtkActor","GeometricObjects/TriangleStrip.py" -"vtkActor","GeometricObjects/Vertex.py" -"vtkActor","Graphs/GraphToPolyData.py" -"vtkActor","Graphs/VisualizeDirectedGraph.py" -"vtkActor","HyperTreeGrid/HyperTreeGridSource.py" -"vtkActor","ImageData/ImageDataGeometryFilter.py" -"vtkActor","ImageData/WriteReadVtkImageData.py" -"vtkActor","ImageProcessing/IsoSubsample.py" -"vtkActor","Images/BackgroundImage.py" -"vtkActor","Images/ImageWarp.py" -"vtkActor","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkActor","ImplicitFunctions/ImplicitQuadric.py" -"vtkActor","ImplicitFunctions/ImplicitSphere1.py" -"vtkActor","ImplicitFunctions/ImplicitSphere.py" -"vtkActor","ImplicitFunctions/SampleFunction.py" -"vtkActor","InfoVis/ParallelCoordinatesExtraction.py" -"vtkActor","Interaction/CallBack.py" -"vtkActor","Interaction/InteractorStyleTrackballActor.py" -"vtkActor","Interaction/InteractorStyleTrackballCamera.py" -"vtkActor","Interaction/MouseEventsObserver.py" -"vtkActor","Interaction/MouseEvents.py" -"vtkActor","IO/CSVReadEdit1.py" -"vtkActor","IO/CSVReadEdit.py" -"vtkActor","IO/ImageWriter.py" -"vtkActor","IO/ReadExodusData.py" -"vtkActor","IO/ReadImageData.py" -"vtkActor","IO/ReadLegacyUnstructuredGrid.py" -"vtkActor","IO/ReadPLOT3D.py" -"vtkActor","IO/ReadPolyData.py" -"vtkActor","IO/ReadSLC.py" -"vtkActor","IO/ReadSTL.py" -"vtkActor","IO/ReadUnstructuredGrid.py" -"vtkActor","IO/ReadVTP.py" -"vtkActor","IO/TransientHDFReader.py" -"vtkActor","IO/WritePLY.py" -"vtkActor","IO/WriteSTL.py" -"vtkActor","Medical/GenerateCubesFromLabels.py" -"vtkActor","Medical/MedicalDemo1.py" -"vtkActor","Medical/MedicalDemo2.py" -"vtkActor","Medical/MedicalDemo3.py" -"vtkActor","Medical/MedicalDemo4.py" -"vtkActor","Medical/TissueLens.py" -"vtkActor","Meshes/BoundaryEdges.py" -"vtkActor","Meshes/CapClip.py" -"vtkActor","Meshes/ClipDataSetWithPolyData1.py" -"vtkActor","Meshes/ClipDataSetWithPolyData.py" -"vtkActor","Meshes/ColoredElevationMap.py" -"vtkActor","Meshes/Decimation.py" -"vtkActor","Meshes/DeformPointSet.py" -"vtkActor","Meshes/PointInterpolator.py" -"vtkActor","Meshes/SolidClip.py" -"vtkActor","Modelling/Bottle.py" -"vtkActor","Modelling/CappedSphere.py" -"vtkActor","Modelling/ContourTriangulator.py" -"vtkActor","Modelling/DelaunayMesh.py" -"vtkActor","Modelling/DiscreteMarchingCubes.py" -"vtkActor","Modelling/ExtractLargestIsosurface.py" -"vtkActor","Modelling/FinanceFieldData.py" -"vtkActor","Modelling/Finance.py" -"vtkActor","Modelling/MarchingCubes.py" -"vtkActor","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkActor","Modelling/Spring.py" -"vtkActor","Picking/CellPicking.py" -"vtkActor","Picking/HighlightPickedActor.py" -"vtkActor","Picking/HighlightWithSilhouette.py" -"vtkActor","PolyData/AlignTwoPolyDatas.py" -"vtkActor","PolyData/BooleanOperationPolyDataFilter.py" -"vtkActor","PolyData/CellsInsideObject.py" -"vtkActor","PolyData/CurvaturesAdjustEdges.py" -"vtkActor","PolyData/CurvaturesDemo.py" -"vtkActor","PolyData/Curvatures.py" -"vtkActor","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkActor","PolyData/ExtractSelection.py" -"vtkActor","PolyData/ExtractSelectionUsingCells.py" -"vtkActor","PolyData/FilledPolygon.py" -"vtkActor","PolyData/ImplicitPolyDataDistance.py" -"vtkActor","PolyData/Outline.py" -"vtkActor","PolyData/PointSource.py" -"vtkActor","PolyData/RotationAroundLine.py" -"vtkActor","PolyData/RuledSurfaceFilter.py" -"vtkActor","PolyData/SmoothMeshGrid.py" -"vtkActor","PolyData/TubeFilter.py" -"vtkActor","PolyData/WarpVector.py" -"vtkActor","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkActor","RectilinearGrid/RectilinearGrid.py" -"vtkActor","RectilinearGrid/RGrid.py" -"vtkActor","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkActor","Rendering/AmbientSpheres.py" -"vtkActor","Rendering/CameraBlur.py" -"vtkActor","Rendering/ColoredSphere.py" -"vtkActor","Rendering/Cone3.py" -"vtkActor","Rendering/Cone4.py" -"vtkActor","Rendering/DiffuseSpheres.py" -"vtkActor","Rendering/FlatVersusGouraud.py" -"vtkActor","Rendering/GradientBackground.py" -"vtkActor","Rendering/LayeredActors.py" -"vtkActor","Rendering/Mace.py" -"vtkActor","Rendering/Model.py" -"vtkActor","Rendering/MotionBlur.py" -"vtkActor","Rendering/OutlineGlowPass.py" -"vtkActor","Rendering/PBR_Anisotropy.py" -"vtkActor","Rendering/PBR_Clear_Coat.py" -"vtkActor","Rendering/PBR_Edge_Tint.py" -"vtkActor","Rendering/PBR_HDR_Environment.py" -"vtkActor","Rendering/PBR_Mapping.py" -"vtkActor","Rendering/PBR_Materials_Coat.py" -"vtkActor","Rendering/PBR_Materials.py" -"vtkActor","Rendering/PBR_Skybox_Anisotropy.py" -"vtkActor","Rendering/PBR_Skybox.py" -"vtkActor","Rendering/PBR_Skybox_Texturing.py" -"vtkActor","Rendering/Rainbow.py" -"vtkActor","Rendering/Rotations.py" -"vtkActor","Rendering/Shadows.py" -"vtkActor","Rendering/SpecularSpheres.py" -"vtkActor","Rendering/StippledLine.py" -"vtkActor","Rendering/StripFran.py" -"vtkActor","Rendering/TransformSphere.py" -"vtkActor","Rendering/TransparentBackground.py" -"vtkActor","Rendering/WalkCow.py" -"vtkActor","StructuredGrid/BlankPoint.py" -"vtkActor","StructuredGrid/SGrid.py" -"vtkActor","StructuredPoints/Vol.py" -"vtkActor","Texture/AnimateVectors.py" -"vtkActor","Texture/TextureCutQuadric.py" -"vtkActor","Texture/TextureCutSphere.py" -"vtkActor","Texture/TexturePlane.py" -"vtkActor","Texture/TextureThreshold.py" -"vtkActor","Tutorial/Tutorial_Step1.py" -"vtkActor","Tutorial/Tutorial_Step2.py" -"vtkActor","Tutorial/Tutorial_Step3.py" -"vtkActor","Tutorial/Tutorial_Step4.py" -"vtkActor","Tutorial/Tutorial_Step5.py" -"vtkActor","Tutorial/Tutorial_Step6.py" -"vtkActor","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkActor","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkActor","UnstructuredGrid/UGrid.py" -"vtkActor","Utilities/Animation.py" -"vtkActor","Utilities/ColorMapToLUT.py" -"vtkActor","Utilities/JSONColorMapToLUT.py" -"vtkActor","Utilities/RescaleReverseLUT.py" -"vtkActor","Utilities/ResetCameraOrientation.py" -"vtkActor","Utilities/SaveSceneToFieldData.py" -"vtkActor","Utilities/SaveSceneToFile.py" -"vtkActor","Utilities/Screenshot.py" -"vtkActor","Utilities/SelectExamples.py" -"vtkActor","Utilities/ShareCamera.py" -"vtkActor","Utilities/XMLColorMapToLUT.py" -"vtkActor","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkActor","VisualizationAlgorithms/BluntStreamlines.py" -"vtkActor","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkActor","VisualizationAlgorithms/CarotidFlow.py" -"vtkActor","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkActor","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkActor","VisualizationAlgorithms/ContourQuadric.py" -"vtkActor","VisualizationAlgorithms/CreateBFont.py" -"vtkActor","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkActor","VisualizationAlgorithms/Cutter.py" -"vtkActor","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkActor","VisualizationAlgorithms/CutWithScalars.py" -"vtkActor","VisualizationAlgorithms/DataSetSurface.py" -"vtkActor","VisualizationAlgorithms/DecimateFran.py" -"vtkActor","VisualizationAlgorithms/DecimateHawaii.py" -"vtkActor","VisualizationAlgorithms/DisplacementPlot.py" -"vtkActor","VisualizationAlgorithms/ExponentialCosine.py" -"vtkActor","VisualizationAlgorithms/ExtractData.py" -"vtkActor","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkActor","VisualizationAlgorithms/HeadBone.py" -"vtkActor","VisualizationAlgorithms/HeadSlice.py" -"vtkActor","VisualizationAlgorithms/Hello.py" -"vtkActor","VisualizationAlgorithms/HyperStreamline.py" -"vtkActor","VisualizationAlgorithms/IceCream.py" -"vtkActor","VisualizationAlgorithms/IronIsoSurface.py" -"vtkActor","VisualizationAlgorithms/LOxGrid.py" -"vtkActor","VisualizationAlgorithms/LOx.py" -"vtkActor","VisualizationAlgorithms/LOxSeeds.py" -"vtkActor","VisualizationAlgorithms/MarchingCases.py" -"vtkActor","VisualizationAlgorithms/Motor.py" -"vtkActor","VisualizationAlgorithms/Office.py" -"vtkActor","VisualizationAlgorithms/OfficeTube.py" -"vtkActor","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkActor","VisualizationAlgorithms/PineRootDecimation.py" -"vtkActor","VisualizationAlgorithms/PlateVibration.py" -"vtkActor","VisualizationAlgorithms/ProbeCombustor.py" -"vtkActor","VisualizationAlgorithms/SingleSplat.py" -"vtkActor","VisualizationAlgorithms/SpikeFran.py" -"vtkActor","VisualizationAlgorithms/SplatFace.py" -"vtkActor","VisualizationAlgorithms/Stocks.py" -"vtkActor","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkActor","VisualizationAlgorithms/TensorAxes.py" -"vtkActor","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkActor","VisualizationAlgorithms/VelocityProfile.py" -"vtkActor","VisualizationAlgorithms/WarpCombustor.py" -"vtkActor","Visualization/AlphaFrequency.py" -"vtkActor","Visualization/AssignCellColorsFromLUT.py" -"vtkActor","Visualization/BillboardTextActor3D.py" -"vtkActor","Visualization/BlobbyLogo.py" -"vtkActor","Visualization/Blow.py" -"vtkActor","Visualization/Camera.py" -"vtkActor","Visualization/ClampGlyphSizes.py" -"vtkActor","Visualization/CollisionDetection.py" -"vtkActor","Visualization/ColorAnActor.py" -"vtkActor","Visualization/ColoredAnnotatedCube.py" -"vtkActor","Visualization/ComplexV.py" -"vtkActor","Visualization/CreateColorSeriesDemo.py" -"vtkActor","Visualization/CubeAxesActor.py" -"vtkActor","Visualization/CurvatureBandsWithGlyphs.py" -"vtkActor","Visualization/DisplayCoordinateAxes.py" -"vtkActor","Visualization/DisplayQuadricSurfaces.py" -"vtkActor","Visualization/ElevationBandsWithGlyphs.py" -"vtkActor","Visualization/FrogBrain.py" -"vtkActor","Visualization/FroggieSurface.py" -"vtkActor","Visualization/FroggieView.py" -"vtkActor","Visualization/FrogSlice.py" -"vtkActor","Visualization/GlyphTable.py" -"vtkActor","Visualization/Hanoi.py" -"vtkActor","Visualization/HardwareSelector.py" -"vtkActor","Visualization/Hawaii.py" -"vtkActor","Visualization/IsosurfaceSampling.py" -"vtkActor","Visualization/Kitchen.py" -"vtkActor","Visualization/KochSnowflake.py" -"vtkActor","Visualization/LoopShrink.py" -"vtkActor","Visualization/Lorenz.py" -"vtkActor","Visualization/MultipleRenderWindows.py" -"vtkActor","Visualization/MultipleViewports.py" -"vtkActor","Visualization/NamedColors.py" -"vtkActor","Visualization/NormalsDemo.py" -"vtkActor","Visualization/OrientedGlyphs.py" -"vtkActor","Visualization/PointDataSubdivision.py" -"vtkActor","Visualization/PointSize.py" -"vtkActor","Visualization/ProgrammableGlyphFilter.py" -"vtkActor","Visualization/ProgrammableGlyphs.py" -"vtkActor","Visualization/QuadricVisualization.py" -"vtkActor","Visualization/ShadowsLightsDemo.py" -"vtkActor","Visualization/SphereTexture.py" -"vtkActor","Visualization/StreamLines.py" -"vtkActor","Visualization/TextSource.py" -"vtkActor","Visualization/VectorText.py" -"vtkActor","Visualization/WindowTitle.py" -"vtkActor","VolumeRendering/PseudoVolumeRendering.py" -"vtkActor","Widgets/BalloonWidget.py" -"vtkActor","Widgets/BoxWidget.py" -"vtkActor","Widgets/CameraOrientationWidget.py" -"vtkActor","Widgets/EmbedInPyQt2.py" -"vtkActor","Widgets/EmbedInPyQt.py" -"vtkActor","Widgets/ImplicitPlaneWidget2.py" -"vtkActor","Widgets/OrientationMarkerWidget1.py" -"vtkActor","Widgets/OrientationMarkerWidget.py" -"vtkActor","Widgets/ScalarBarWidget.py" -"vtkActor","Widgets/SplineWidget.py" -"vtkActor","Widgets/TextWidget.py" -"vtkAlgorithm","GeometricObjects/TessellatedBoxSource.py" -"vtkAMRBox","CompositeData/OverlappingAMR.py" -"vtkAnnotatedCubeActor","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkAnnotatedCubeActor","Visualization/AnnotatedCubeActor.py" -"vtkAnnotatedCubeActor","Visualization/ColoredAnnotatedCube.py" -"vtkAnnotatedCubeActor","Visualization/FroggieSurface.py" -"vtkAnnotatedCubeActor","Visualization/FroggieView.py" -"vtkAnnotatedCubeActor","Widgets/CompassWidget.py" -"vtkAnnotatedCubeActor","Widgets/OrientationMarkerWidget.py" -"vtkAnnotationLink","Graphs/SelectedVerticesAndEdges.py" -"vtkAnnotationLink","InfoVis/ParallelCoordinatesExtraction.py" -"vtkAnnotationLink","InfoVis/SelectedGraphIDs.py" -"vtkAppendFilter","Filtering/AppendFilter.py" -"vtkAppendFilter","Filtering/ConnectivityFilter.py" -"vtkAppendFilter","Visualization/CameraModel1.py" -"vtkAppendFilter","Visualization/QuadricVisualization.py" -"vtkAppendPolyData","Filtering/CombinePolyData.py" -"vtkAppendPolyData","VisualizationAlgorithms/ProbeCombustor.py" -"vtkAppendPolyData","VisualizationAlgorithms/VelocityProfile.py" -"vtkAppendPolyData","VisualizationAlgorithms/WarpCombustor.py" -"vtkAppendPolyData","Visualization/BlobbyLogo.py" -"vtkAppendPolyData","Visualization/CameraModel2.py" -"vtkArrowSource","GeometricObjects/Arrow.py" -"vtkArrowSource","GeometricObjects/EllipticalCylinderDemo.py" -"vtkArrowSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkArrowSource","GeometricObjects/OrientedArrow.py" -"vtkArrowSource","GeometricObjects/ParametricObjectsDemo.py" -"vtkArrowSource","PolyData/RotationAroundLine.py" -"vtkArrowSource","Rendering/OutlineGlowPass.py" -"vtkArrowSource","Visualization/CurvatureBandsWithGlyphs.py" -"vtkArrowSource","Visualization/ElevationBandsWithGlyphs.py" -"vtkArrowSource","Visualization/OrientedGlyphs.py" -"vtkArrowSource","Visualization/PointDataSubdivision.py" -"vtkAxesActor","GeometricObjects/Axes.py" -"vtkAxesActor","GeometricObjects/IsoparametricCellsDemo.py" -"vtkAxesActor","GeometricObjects/LinearCellsDemo.py" -"vtkAxesActor","Interaction/CallBack.py" -"vtkAxesActor","IO/CSVReadEdit1.py" -"vtkAxesActor","IO/CSVReadEdit.py" -"vtkAxesActor","PolyData/AlignTwoPolyDatas.py" -"vtkAxesActor","Rendering/LayeredActors.py" -"vtkAxesActor","Rendering/PBR_Skybox_Anisotropy.py" -"vtkAxesActor","Rendering/PBR_Skybox.py" -"vtkAxesActor","Rendering/PBR_Skybox_Texturing.py" -"vtkAxesActor","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkAxesActor","Visualization/ColoredAnnotatedCube.py" -"vtkAxesActor","Visualization/DisplayCoordinateAxes.py" -"vtkAxesActor","Visualization/FroggieSurface.py" -"vtkAxesActor","Visualization/FroggieView.py" -"vtkAxesActor","Visualization/PointDataSubdivision.py" -"vtkAxes","Annotation/TextOrigin.py" -"vtkAxes","Modelling/FinanceFieldData.py" -"vtkAxes","Modelling/Finance.py" -"vtkAxes","Rendering/Rotations.py" -"vtkAxes","Rendering/WalkCow.py" -"vtkAxes","VisualizationAlgorithms/TensorAxes.py" -"vtkAxis","Plotting/MultiplePlots.py" -"vtkBalloonRepresentation","Widgets/BalloonWidget.py" -"vtkBalloonWidget","Widgets/BalloonWidget.py" -"vtkBandedPolyDataContourFilter","Visualization/ColoredAnnotatedCube.py" -"vtkBandedPolyDataContourFilter","Visualization/CurvatureBandsWithGlyphs.py" -"vtkBandedPolyDataContourFilter","Visualization/ElevationBandsWithGlyphs.py" -"vtkBandedPolyDataContourFilter","Visualization/NamedColors.py" -"vtkBillboardTextActor3D","Visualization/BillboardTextActor3D.py" -"vtkBiQuadraticQuad","GeometricObjects/IsoparametricCellsDemo.py" -"vtkBiQuadraticQuadraticHexahedron","GeometricObjects/IsoparametricCellsDemo.py" -"vtkBiQuadraticQuadraticWedge","GeometricObjects/IsoparametricCellsDemo.py" -"vtkBiQuadraticTriangle","GeometricObjects/IsoparametricCellsDemo.py" -"vtkBMPReader","Images/ImageWarp.py" -"vtkBMPWriter","IO/ImageWriter.py" -"vtkBMPWriter","Visualization/Hanoi.py" -"vtkBooleanOperationPolyDataFilter","PolyData/BooleanOperationPolyDataFilter.py" -"vtkBooleanTexture","Texture/TextureCutQuadric.py" -"vtkBox","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkBoxWidget","Tutorial/Tutorial_Step6.py" -"vtkBoxWidget","Widgets/BoxWidget.py" -"vtkBrownianPoints","InfoVis/ParallelCoordinatesExtraction.py" -"vtkBrownianPoints","InfoVis/ParallelCoordinatesView.py" -"vtkButterflySubdivisionFilter","PolyData/SmoothMeshGrid.py" -"vtkButterflySubdivisionFilter","Visualization/PointDataSubdivision.py" -"vtkBYUReader","Meshes/CapClip.py" -"vtkBYUReader","Meshes/Decimation.py" -"vtkBYUReader","PolyData/AlignTwoPolyDatas.py" -"vtkBYUReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkBYUReader","PolyData/CellsInsideObject.py" -"vtkBYUReader","PolyData/ClosedSurface.py" -"vtkBYUReader","Rendering/GradientBackground.py" -"vtkBYUReader","Rendering/Rotations.py" -"vtkBYUReader","Rendering/Shadows.py" -"vtkBYUReader","Rendering/WalkCow.py" -"vtkBYUReader","Utilities/SaveSceneToFieldData.py" -"vtkBYUReader","Utilities/SaveSceneToFile.py" -"vtkBYUReader","VisualizationAlgorithms/Motor.py" -"vtkBYUReader","Visualization/NormalsDemo.py" -"vtkCamera","GeometricObjects/Cube.py" -"vtkCamera","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCamera","GeometricObjects/EllipticalCylinder.py" -"vtkCamera","GeometricObjects/Frustum.py" -"vtkCamera","GeometricObjects/Planes.py" -"vtkCamera","Interaction/CallBack.py" -"vtkCamera","IO/3DSImporter.py" -"vtkCamera","IO/ReadLegacyUnstructuredGrid.py" -"vtkCamera","Medical/MedicalDemo1.py" -"vtkCamera","Medical/MedicalDemo2.py" -"vtkCamera","Medical/MedicalDemo3.py" -"vtkCamera","Medical/TissueLens.py" -"vtkCamera","Meshes/Decimation.py" -"vtkCamera","Modelling/FinanceFieldData.py" -"vtkCameraOrientationWidget","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCameraOrientationWidget","GeometricObjects/LinearCellsDemo.py" -"vtkCameraOrientationWidget","IO/CSVReadEdit1.py" -"vtkCameraOrientationWidget","IO/CSVReadEdit.py" -"vtkCameraOrientationWidget","PolyData/AlignTwoPolyDatas.py" -"vtkCameraOrientationWidget","PolyData/CurvaturesAdjustEdges.py" -"vtkCameraOrientationWidget","PolyData/Curvatures.py" -"vtkCameraOrientationWidget","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCameraOrientationWidget","Rendering/PBR_Skybox.py" -"vtkCameraOrientationWidget","Rendering/PBR_Skybox_Texturing.py" -"vtkCameraOrientationWidget","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCameraOrientationWidget","Visualization/ElevationBandsWithGlyphs.py" -"vtkCameraOrientationWidget","Visualization/FroggieSurface.py" -"vtkCameraOrientationWidget","Visualization/FroggieView.py" -"vtkCameraOrientationWidget","Widgets/CameraOrientationWidget.py" -"vtkCameraOrientationWidget","Widgets/SplineWidget.py" -"vtkCameraPass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCameraPass","Rendering/PBR_Skybox.py" -"vtkCameraPass","Rendering/PBR_Skybox_Texturing.py" -"vtkCameraPass","Rendering/Shadows.py" -"vtkCameraPass","Visualization/ShadowsLightsDemo.py" -"vtkCamera","PolyData/ExtractSelection.py" -"vtkCamera","PolyData/ExtractSelectionUsingCells.py" -"vtkCamera","Rendering/StripFran.py" -"vtkCamera","Texture/AnimateVectors.py" -"vtkCamera","Texture/TextureThreshold.py" -"vtkCamera","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkCamera","VisualizationAlgorithms/CarotidFlow.py" -"vtkCamera","VisualizationAlgorithms/DecimateFran.py" -"vtkCamera","VisualizationAlgorithms/DecimateHawaii.py" -"vtkCamera","VisualizationAlgorithms/Hello.py" -"vtkCamera","VisualizationAlgorithms/HyperStreamline.py" -"vtkCamera","VisualizationAlgorithms/LOxGrid.py" -"vtkCamera","VisualizationAlgorithms/LOx.py" -"vtkCamera","VisualizationAlgorithms/LOxSeeds.py" -"vtkCamera","VisualizationAlgorithms/Motor.py" -"vtkCamera","VisualizationAlgorithms/Office.py" -"vtkCamera","VisualizationAlgorithms/OfficeTube.py" -"vtkCamera","VisualizationAlgorithms/SplatFace.py" -"vtkCamera","VisualizationAlgorithms/TensorAxes.py" -"vtkCamera","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkCamera","Visualization/Camera.py" -"vtkCamera","Visualization/FrogSlice.py" -"vtkCamera","Visualization/Hanoi.py" -"vtkCamera","Visualization/Kitchen.py" -"vtkCamera","Visualization/NormalsDemo.py" -"vtkCategoryLegend","IO/ReadLegacyUnstructuredGrid.py" -"vtkCellArray","Annotation/MultiLineText.py" -"vtkCellArray","DataManipulation/LineOnMesh.py" -"vtkCellArray","ExplicitStructuredGrid/CreateESGrid.py" -"vtkCellArray","Filtering/ConstrainedDelaunay2D.py" -"vtkCellArray","Filtering/IterativeClosestPoints.py" -"vtkCellArray","GeometricObjects/Cell3DDemonstration.py" -"vtkCellArray","GeometricObjects/ColoredLines.py" -"vtkCellArray","GeometricObjects/Cube.py" -"vtkCellArray","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCellArray","GeometricObjects/EllipticalCylinder.py" -"vtkCellArray","GeometricObjects/Hexahedron.py" -"vtkCellArray","GeometricObjects/LinearCellsDemo.py" -"vtkCellArray","GeometricObjects/LongLine.py" -"vtkCellArray","GeometricObjects/Point.py" -"vtkCellArray","GeometricObjects/Polygon.py" -"vtkCellArray","GeometricObjects/PolyLine1.py" -"vtkCellArray","GeometricObjects/PolyLine.py" -"vtkCellArray","GeometricObjects/Pyramid.py" -"vtkCellArray","GeometricObjects/Quad.py" -"vtkCellArray","GeometricObjects/Tetrahedron.py" -"vtkCellArray","GeometricObjects/Triangle.py" -"vtkCellArray","GeometricObjects/TriangleStrip.py" -"vtkCellArray","GeometricObjects/Vertex.py" -"vtkCellArray","Graphs/NOVCAGraph.py" -"vtkCellArray","IO/CSVReadEdit1.py" -"vtkCellArray","IO/CSVReadEdit.py" -"vtkCellArray","IO/WriteTriangleToFile.py" -"vtkCellArray","Meshes/DeformPointSet.py" -"vtkCellArray","Modelling/Bottle.py" -"vtkCellArray","Modelling/CappedSphere.py" -"vtkCellArray","Modelling/Spring.py" -"vtkCellArray","PolyData/ColoredTriangle.py" -"vtkCellArray","PolyData/IterateOverLines.py" -"vtkCellArray","PolyData/RuledSurfaceFilter.py" -"vtkCellArray","PolyData/SmoothMeshGrid.py" -"vtkCellArray","PolyData/SolidColoredTriangle.py" -"vtkCellArray","PolyData/TriangleColoredPoints.py" -"vtkCellArray","PolyData/TriangleCornerVertices.py" -"vtkCellArray","PolyData/WarpVector.py" -"vtkCellArray","Rendering/GradientBackground.py" -"vtkCellArray","VisualizationAlgorithms/DataSetSurface.py" -"vtkCellArray","VisualizationAlgorithms/SingleSplat.py" -"vtkCellArray","Visualization/CameraModel1.py" -"vtkCellArray","Visualization/CameraModel2.py" -"vtkCellArray","Visualization/KochSnowflake.py" -"vtkCellArray","Widgets/ContourWidget.py" -"vtkCell","GeometricObjects/CellTypeSource.py" -"vtkCellLocator","DataManipulation/LineOnMesh.py" -"vtkCellPicker","Picking/CellPicking.py" -"vtkCellTypes","GeometricObjects/CellTypeSource.py" -"vtkCellTypes","IO/ReadLegacyUnstructuredGrid.py" -"vtkCellTypes","Meshes/ClipDataSetWithPolyData.py" -"vtkCellTypeSource","GeometricObjects/CellTypeSource.py" -"vtkCellTypes","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkCellTypes","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkChart","Plotting/MultiplePlots.py" -"vtkChart","Plotting/ScatterPlot.py" -"vtkChartsCore","IO/ReadLegacyUnstructuredGrid.py" -"vtkChartsCore","Plotting/MultiplePlots.py" -"vtkChartsCore","Plotting/ScatterPlot.py" -"vtkChartsCore","Plotting/SurfacePlot.py" -"vtkChartXY","Plotting/MultiplePlots.py" -"vtkChartXY","Plotting/ScatterPlot.py" -"vtkChartXYZ","Plotting/SurfacePlot.py" -"vtkCircularLayoutStrategy","Graphs/LabelVerticesAndEdges.py" -"vtk_class","Utilities/SelectExamples.py" -"vtk_class","Utilities/VTKImportsForPython.py" -"vtkClass","Utilities/VTKImportsForPython.py" -"vtkCleanPolyData","DataManipulation/LineOnMesh.py" -"vtkCleanPolyData","Filtering/CombinePolyData.py" -"vtkCleanPolyData","PolyData/BooleanOperationPolyDataFilter.py" -"vtkCleanPolyData","PolyData/CurvaturesDemo.py" -"vtkCleanPolyData","PolyData/SmoothMeshGrid.py" -"vtkCleanPolyData","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCleanPolyData","Rendering/PBR_Skybox.py" -"vtkCleanPolyData","Rendering/PBR_Skybox_Texturing.py" -"vtkCleanPolyData","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCleanPolyData","Visualization/ElevationBandsWithGlyphs.py" -"vtkCleanPolyData","Visualization/PointDataSubdivision.py" -"vtkClipDataSet","Medical/TissueLens.py" -"vtkClipDataSet","Meshes/ClipDataSetWithPolyData1.py" -"vtkClipDataSet","Meshes/ClipDataSetWithPolyData.py" -"vtkClipDataSet","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkClipPolyData","Meshes/CapClip.py" -"vtkClipPolyData","Meshes/SolidClip.py" -"vtkClipPolyData","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkClipPolyData","Rendering/PBR_Skybox_Anisotropy.py" -"vtkClipPolyData","Rendering/PBR_Skybox.py" -"vtkClipPolyData","Rendering/PBR_Skybox_Texturing.py" -"vtkClipPolyData","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkClipPolyData","VisualizationAlgorithms/CreateBFont.py" -"vtkClipPolyData","Widgets/ImplicitPlaneWidget2.py" -"vtkcnEndTable","Visualization/NamedColorPatches.py" -"vtkcnOrder","Visualization/NamedColorPatches.py" -"vtkcnStartTable","Visualization/NamedColorPatches.py" -"vtkcn","Visualization/NamedColorPatches.py" -"vtkCollisionDetectionFilter","Visualization/CollisionDetection.py" -"vtkColor3ub","Visualization/PointDataSubdivision.py" -"vtkColorSeries","GeometricObjects/CellTypeSource.py" -"vtkColorSeries","PolyData/Curvatures.py" -"vtkColorSeries","Utilities/LUTUtilities.py" -"vtkColorSeries","Utilities/ShareCamera.py" -"vtkColorSeries","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkColorSeries","Visualization/ColoredAnnotatedCube.py" -"vtkColorSeries","Visualization/ColorSeriesPatches.py" -"vtkColorSeries","Visualization/CreateColorSeriesDemo.py" -"vtkColorSeries","Visualization/CurvatureBandsWithGlyphs.py" -"vtkColorSeries","Visualization/ElevationBandsWithGlyphs.py" -"vtkColorSeries","Visualization/Hawaii.py" -"vtkColorSeries","Visualization/PointDataSubdivision.py" -"vtkColorTransferFunction","DataManipulation/MeshLabelImageColor.py" -"vtkColorTransferFunction","IO/CSVReadEdit1.py" -"vtkColorTransferFunction","IO/CSVReadEdit.py" -"vtkColorTransferFunction","Medical/MedicalDemo4.py" -"vtkColorTransferFunction","PolyData/CurvaturesAdjustEdges.py" -"vtkColorTransferFunction","PolyData/CurvaturesDemo.py" -"vtkColorTransferFunction","PolyData/Curvatures.py" -"vtkColorTransferFunction","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkColorTransferFunction","Utilities/VTKWithNumpy.py" -"vtkColorTransferFunction","VisualizationAlgorithms/DisplacementPlot.py" -"vtkColorTransferFunction","Visualization/AssignCellColorsFromLUT.py" -"vtkColorTransferFunction","Visualization/CurvatureBandsWithGlyphs.py" -"vtkColorTransferFunction","Visualization/ElevationBandsWithGlyphs.py" -"vtkColorTransferFunction","Visualization/PointDataSubdivision.py" -"vtkColorTransferFunction","VolumeRendering/SimpleRayCast.py" -"vtkCommand","GeometricObjects/ParametricKuenDemo.py" -"vtkCommand","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkCommand","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkCommand","GeometricObjects/PolyLine1.py" -"vtkCommand","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkCommand","GeometricObjects/QuadraticTetraDemo.py" -"vtkCommand","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommand","Rendering/PBR_Skybox.py" -"vtkCommand","Rendering/PBR_Skybox_Texturing.py" -"vtkCommand","Tutorial/Tutorial_Step5.py" -"vtkCommand","Tutorial/Tutorial_Step6.py" -"vtkCommand","Visualization/BillboardTextActor3D.py" -"vtkCommand","Visualization/FroggieView.py" -"vtkCommand","Widgets/CompassWidget.py" -"vtkCommand","Widgets/ContourWidget.py" -"vtkCommand","Widgets/ImplicitPlaneWidget2.py" -"vtkCommand","Widgets/SplineWidget.py" -"vtkCommonColor","Annotation/MultiLineText.py" -"vtkCommonColor","Annotation/TextOrigin.py" -"vtkCommonColor","CompositeData/CompositePolyDataMapper.py" -"vtkCommonColor","CompositeData/MultiBlockDataSet.py" -"vtkCommonColor","CompositeData/OverlappingAMR.py" -"vtkCommonColor","DataManipulation/LineOnMesh.py" -"vtkCommonColor","DataManipulation/MeshLabelImageColor.py" -"vtkCommonColor","ExplicitStructuredGrid/CreateESGrid.py" -"vtkCommonColor","ExplicitStructuredGrid/LoadESGrid.py" -"vtkCommonColor","Filtering/AppendFilter.py" -"vtkCommonColor","Filtering/CombinePolyData.py" -"vtkCommonColor","Filtering/ConnectivityFilter.py" -"vtkCommonColor","Filtering/ConstrainedDelaunay2D.py" -"vtkCommonColor","Filtering/Delaunay2D.py" -"vtkCommonColor","Filtering/GaussianSplat.py" -"vtkCommonColor","Filtering/Glyph2D.py" -"vtkCommonColor","Filtering/Glyph3D.py" -"vtkCommonColor","Filtering/PerlinNoise.py" -"vtkCommonColor","Filtering/TransformPolyData.py" -"vtkCommonColor","Filtering/TriangulateTerrainMap.py" -"vtkCommonColor","Filtering/VertexGlyphFilter.py" -"vtkCommonColor","Filtering/WarpTo.py" -"vtkCommonColor","GeometricObjects/Arrow.py" -"vtkCommonColor","GeometricObjects/Axes.py" -"vtkCommonColor","GeometricObjects/Cell3DDemonstration.py" -"vtkCommonColor","GeometricObjects/CellTypeSource.py" -"vtkCommonColor","GeometricObjects/Circle.py" -"vtkCommonColor","GeometricObjects/ColoredLines.py" -"vtkCommonColor","GeometricObjects/Cone.py" -"vtkCommonColor","GeometricObjects/ConvexPointSet.py" -"vtkCommonColor","GeometricObjects/Cube1.py" -"vtkCommonColor","GeometricObjects/Cube.py" -"vtkCommonColor","GeometricObjects/CylinderExample.py" -"vtkCommonColor","GeometricObjects/Cylinder.py" -"vtkCommonColor","GeometricObjects/Disk.py" -"vtkCommonColor","GeometricObjects/Dodecahedron.py" -"vtkCommonColor","GeometricObjects/EarthSource.py" -"vtkCommonColor","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCommonColor","GeometricObjects/EllipticalCylinder.py" -"vtkCommonColor","GeometricObjects/Frustum.py" -"vtkCommonColor","GeometricObjects/GeometricObjectsDemo.py" -"vtkCommonColor","GeometricObjects/Hexahedron.py" -"vtkCommonColor","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCommonColor","GeometricObjects/LinearCellsDemo.py" -"vtkCommonColor","GeometricObjects/Line.py" -"vtkCommonColor","GeometricObjects/LongLine.py" -"vtkCommonColor","GeometricObjects/OrientedArrow.py" -"vtkCommonColor","GeometricObjects/OrientedCylinder.py" -"vtkCommonColor","GeometricObjects/ParametricKuenDemo.py" -"vtkCommonColor","GeometricObjects/ParametricObjectsDemo.py" -"vtkCommonColor","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkCommonColor","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkCommonColor","GeometricObjects/Plane.py" -"vtkCommonColor","GeometricObjects/Planes.py" -"vtkCommonColor","GeometricObjects/PlatonicSolids.py" -"vtkCommonColor","GeometricObjects/Point.py" -"vtkCommonColor","GeometricObjects/Polygon.py" -"vtkCommonColor","GeometricObjects/Polyhedron.py" -"vtkCommonColor","GeometricObjects/PolyLine1.py" -"vtkCommonColor","GeometricObjects/PolyLine.py" -"vtkCommonColor","GeometricObjects/Pyramid.py" -"vtkCommonColor","GeometricObjects/Quad.py" -"vtkCommonColor","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkCommonColor","GeometricObjects/QuadraticHexahedron.py" -"vtkCommonColor","GeometricObjects/QuadraticTetraDemo.py" -"vtkCommonColor","GeometricObjects/QuadraticTetra.py" -"vtkCommonColor","GeometricObjects/RegularPolygonSource.py" -"vtkCommonColor","GeometricObjects/ShrinkCube.py" -"vtkCommonColor","GeometricObjects/SourceObjectsDemo.py" -"vtkCommonColor","GeometricObjects/Sphere.py" -"vtkCommonColor","GeometricObjects/TessellatedBoxSource.py" -"vtkCommonColor","GeometricObjects/Tetrahedron.py" -"vtkCommonColor","GeometricObjects/TextActor.py" -"vtkCommonColor","GeometricObjects/Triangle.py" -"vtkCommonColor","GeometricObjects/TriangleStrip.py" -"vtkCommonColor","GeometricObjects/Vertex.py" -"vtkCommonColor","Graphs/ColorEdges.py" -"vtkCommonColor","Graphs/ColorVertexLabels.py" -"vtkCommonColor","Graphs/ColorVerticesLookupTable.py" -"vtkCommonColor","Graphs/ConstructGraph.py" -"vtkCommonColor","Graphs/EdgeWeights.py" -"vtkCommonColor","Graphs/GraphToPolyData.py" -"vtkCommonColor","Graphs/LabelVerticesAndEdges.py" -"vtkCommonColor","Graphs/RandomGraphSource.py" -"vtkCommonColor","Graphs/ScaleVertices.py" -"vtkCommonColor","Graphs/SideBySideGraphs.py" -"vtkCommonColor","HyperTreeGrid/HyperTreeGridSource.py" -"vtkCommonColor","ImageData/ImageDataGeometryFilter.py" -"vtkCommonColor","ImageData/ImageNormalize.py" -"vtkCommonColor","ImageData/ImageWeightedSum.py" -"vtkCommonColor","ImageData/WriteReadVtkImageData.py" -"vtkCommonColor","ImageProcessing/Attenuation.py" -"vtkCommonColor","ImageProcessing/GaussianSmooth.py" -"vtkCommonColor","ImageProcessing/IdealHighPass.py" -"vtkCommonColor","ImageProcessing/IsoSubsample.py" -"vtkCommonColor","ImageProcessing/Pad.py" -"vtkCommonColor","ImageProcessing/VTKSpectrum.py" -"vtkCommonColor","Images/Actor2D.py" -"vtkCommonColor","Images/BackgroundImage.py" -"vtkCommonColor","Images/Cast.py" -"vtkCommonColor","Images/ImageWarp.py" -"vtkCommonColor","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkCommonColor","ImplicitFunctions/ImplicitQuadric.py" -"vtkCommonColor","ImplicitFunctions/ImplicitSphere1.py" -"vtkCommonColor","ImplicitFunctions/ImplicitSphere.py" -"vtkCommonColor","ImplicitFunctions/SampleFunction.py" -"vtkCommonColor","InfoVis/ParallelCoordinatesExtraction.py" -"vtkCommonColor","InfoVis/ParallelCoordinatesView.py" -"vtkCommonColor","InfoVis/SelectedGraphIDs.py" -"vtkCommonColor","Interaction/CallBack.py" -"vtkCommonColor","Interaction/InteractorStyleTrackballActor.py" -"vtkCommonColor","Interaction/InteractorStyleTrackballCamera.py" -"vtkCommonColor","Interaction/MouseEventsObserver.py" -"vtkCommonColor","Interaction/MouseEvents.py" -"vtkCommonColor","IO/3DSImporter.py" -"vtkCommonColor","IO/CSVReadEdit1.py" -"vtkCommonColor","IO/CSVReadEdit.py" -"vtkCommonColor","IO/ImageWriter.py" -"vtkCommonColor","IO/ReadDICOM.py" -"vtkCommonColor","IO/ReadDICOMSeries.py" -"vtkCommonColor","IO/ReadExodusData.py" -"vtkCommonColor","IO/ReadImageData.py" -"vtkCommonColor","IO/ReadLegacyUnstructuredGrid.py" -"vtkCommonColor","IO/ReadPLOT3D.py" -"vtkCommonColor","IO/ReadPolyData.py" -"vtkCommonColor","IO/ReadSLC.py" -"vtkCommonColor","IO/ReadSTL.py" -"vtkCommonColor","IO/ReadVTP.py" -"vtkCommonColor","IO/TransientHDFReader.py" -"vtkCommonColor","IO/WritePLY.py" -"vtkCommonColor","IO/WriteSTL.py" -"vtkCommonColor","Medical/GenerateCubesFromLabels.py" -"vtkCommonColor","Medical/MedicalDemo1.py" -"vtkCommonColor","Medical/MedicalDemo2.py" -"vtkCommonColor","Medical/MedicalDemo3.py" -"vtkCommonColor","Medical/MedicalDemo4.py" -"vtkCommonColor","Medical/TissueLens.py" -"vtkCommonColor","Meshes/BoundaryEdges.py" -"vtkCommonColor","Meshes/CapClip.py" -"vtkCommonColor","Meshes/ClipDataSetWithPolyData1.py" -"vtkCommonColor","Meshes/ClipDataSetWithPolyData.py" -"vtkCommonColor","Meshes/ColoredElevationMap.py" -"vtkCommonColor","Meshes/Decimation.py" -"vtkCommonColor","Meshes/DeformPointSet.py" -"vtkCommonColor","Meshes/PointInterpolator.py" -"vtkCommonColor","Meshes/SolidClip.py" -"vtkCommonColor","Modelling/Bottle.py" -"vtkCommonColor","Modelling/CappedSphere.py" -"vtkCommonColor","Modelling/ContourTriangulator.py" -"vtkCommonColor","Modelling/DelaunayMesh.py" -"vtkCommonColor","Modelling/DiscreteMarchingCubes.py" -"vtkCommonColor","Modelling/ExtractLargestIsosurface.py" -"vtkCommonColor","Modelling/FinanceFieldData.py" -"vtkCommonColor","Modelling/Finance.py" -"vtkCommonColor","Modelling/MarchingCubes.py" -"vtkCommonColor","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkCommonColor","Modelling/Spring.py" -"vtkCommonColor","Picking/CellPicking.py" -"vtkCommonColor","Picking/HighlightPickedActor.py" -"vtkCommonColor","Picking/HighlightWithSilhouette.py" -"vtkCommonColor","Plotting/MultiplePlots.py" -"vtkCommonColor","Plotting/ScatterPlot.py" -"vtkCommonColor","Plotting/SpiderPlot.py" -"vtkCommonColor","Plotting/SurfacePlot.py" -"vtkCommonColor","PolyData/AlignTwoPolyDatas.py" -"vtkCommonColor","PolyData/BooleanOperationPolyDataFilter.py" -"vtkCommonColor","PolyData/CellsInsideObject.py" -"vtkCommonColor","PolyData/ColoredTriangle.py" -"vtkCommonColor","PolyData/CurvaturesAdjustEdges.py" -"vtkCommonColor","PolyData/CurvaturesDemo.py" -"vtkCommonColor","PolyData/Curvatures.py" -"vtkCommonColor","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkCommonColor","PolyData/ExtractSelection.py" -"vtkCommonColor","PolyData/ExtractSelectionUsingCells.py" -"vtkCommonColor","PolyData/FilledPolygon.py" -"vtkCommonColor","PolyData/ImplicitPolyDataDistance.py" -"vtkCommonColor","PolyData/Outline.py" -"vtkCommonColor","PolyData/PointSource.py" -"vtkCommonColor","PolyData/RotationAroundLine.py" -"vtkCommonColor","PolyData/RuledSurfaceFilter.py" -"vtkCommonColor","PolyData/SmoothMeshGrid.py" -"vtkCommonColor","PolyData/SolidColoredTriangle.py" -"vtkCommonColor","PolyData/TriangleColoredPoints.py" -"vtkCommonColor","PolyData/TubeFilter.py" -"vtkCommonColor","PolyData/WarpVector.py" -"vtkCommonColor","RectilinearGrid/RectilinearGrid.py" -"vtkCommonColor","RectilinearGrid/RGrid.py" -"vtkCommonColor","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkCommonColor","Rendering/AmbientSpheres.py" -"vtkCommonColor","Rendering/CameraBlur.py" -"vtkCommonColor","Rendering/ColoredSphere.py" -"vtkCommonColor","Rendering/Cone3.py" -"vtkCommonColor","Rendering/Cone4.py" -"vtkCommonColor","Rendering/DiffuseSpheres.py" -"vtkCommonColor","Rendering/FlatVersusGouraud.py" -"vtkCommonColor","Rendering/GradientBackground.py" -"vtkCommonColor","Rendering/LayeredActors.py" -"vtkCommonColor","Rendering/Mace.py" -"vtkCommonColor","Rendering/Model.py" -"vtkCommonColor","Rendering/MotionBlur.py" -"vtkCommonColor","Rendering/OutlineGlowPass.py" -"vtkCommonColor","Rendering/PBR_Anisotropy.py" -"vtkCommonColor","Rendering/PBR_Clear_Coat.py" -"vtkCommonColor","Rendering/PBR_Edge_Tint.py" -"vtkCommonColor","Rendering/PBR_HDR_Environment.py" -"vtkCommonColor","Rendering/PBR_Mapping.py" -"vtkCommonColor","Rendering/PBR_Materials_Coat.py" -"vtkCommonColor","Rendering/PBR_Materials.py" -"vtkCommonColor","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommonColor","Rendering/PBR_Skybox.py" -"vtkCommonColor","Rendering/PBR_Skybox_Texturing.py" -"vtkCommonColor","Rendering/Rainbow.py" -"vtkCommonColor","Rendering/Rotations.py" -"vtkCommonColor","Rendering/Shadows.py" -"vtkCommonColor","Rendering/SpecularSpheres.py" -"vtkCommonColor","Rendering/StippledLine.py" -"vtkCommonColor","Rendering/StripFran.py" -"vtkCommonColor","Rendering/TransformSphere.py" -"vtkCommonColor","Rendering/TransparentBackground.py" -"vtkCommonColor","Rendering/WalkCow.py" -"vtkCommonColor","StructuredGrid/BlankPoint.py" -"vtkCommonColor","StructuredGrid/SGrid.py" -"vtkCommonColor","StructuredPoints/Vol.py" -"vtkCommonColor","Texture/AnimateVectors.py" -"vtkCommonColor","Texture/TextureCutQuadric.py" -"vtkCommonColor","Texture/TextureCutSphere.py" -"vtkCommonColor","Texture/TexturePlane.py" -"vtkCommonColor","Texture/TextureThreshold.py" -"vtkCommonColor","Tutorial/Tutorial_Step1.py" -"vtkCommonColor","Tutorial/Tutorial_Step2.py" -"vtkCommonColor","Tutorial/Tutorial_Step3.py" -"vtkCommonColor","Tutorial/Tutorial_Step4.py" -"vtkCommonColor","Tutorial/Tutorial_Step5.py" -"vtkCommonColor","Tutorial/Tutorial_Step6.py" -"vtkCommonColor","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkCommonColor","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkCommonColor","UnstructuredGrid/UGrid.py" -"vtkCommonColor","Utilities/Animation.py" -"vtkCommonColor","Utilities/ColorMapToLUT.py" -"vtkCommonColor","Utilities/JSONColorMapToLUT.py" -"vtkCommonColor","Utilities/LUTUtilities.py" -"vtkCommonColor","Utilities/RescaleReverseLUT.py" -"vtkCommonColor","Utilities/ResetCameraOrientation.py" -"vtkCommonColor","Utilities/SaveSceneToFieldData.py" -"vtkCommonColor","Utilities/SaveSceneToFile.py" -"vtkCommonColor","Utilities/Screenshot.py" -"vtkCommonColor","Utilities/ShareCamera.py" -"vtkCommonColor","Utilities/VTKWithNumpy.py" -"vtkCommonColor","Utilities/XMLColorMapToLUT.py" -"vtkCommonColor","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkCommonColor","VisualizationAlgorithms/BluntStreamlines.py" -"vtkCommonColor","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkCommonColor","VisualizationAlgorithms/CarotidFlow.py" -"vtkCommonColor","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkCommonColor","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkCommonColor","VisualizationAlgorithms/ContourQuadric.py" -"vtkCommonColor","VisualizationAlgorithms/CreateBFont.py" -"vtkCommonColor","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkCommonColor","VisualizationAlgorithms/Cutter.py" -"vtkCommonColor","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkCommonColor","VisualizationAlgorithms/CutWithScalars.py" -"vtkCommonColor","VisualizationAlgorithms/DataSetSurface.py" -"vtkCommonColor","VisualizationAlgorithms/DecimateFran.py" -"vtkCommonColor","VisualizationAlgorithms/DecimateHawaii.py" -"vtkCommonColor","VisualizationAlgorithms/DisplacementPlot.py" -"vtkCommonColor","VisualizationAlgorithms/ExponentialCosine.py" -"vtkCommonColor","VisualizationAlgorithms/ExtractData.py" -"vtkCommonColor","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkCommonColor","VisualizationAlgorithms/HeadBone.py" -"vtkCommonColor","VisualizationAlgorithms/HeadSlice.py" -"vtkCommonColor","VisualizationAlgorithms/Hello.py" -"vtkCommonColor","VisualizationAlgorithms/HyperStreamline.py" -"vtkCommonColor","VisualizationAlgorithms/IceCream.py" -"vtkCommonColor","VisualizationAlgorithms/ImageGradient.py" -"vtkCommonColor","VisualizationAlgorithms/IronIsoSurface.py" -"vtkCommonColor","VisualizationAlgorithms/LOxGrid.py" -"vtkCommonColor","VisualizationAlgorithms/LOx.py" -"vtkCommonColor","VisualizationAlgorithms/LOxSeeds.py" -"vtkCommonColor","VisualizationAlgorithms/MarchingCases.py" -"vtkCommonColor","VisualizationAlgorithms/Motor.py" -"vtkCommonColor","VisualizationAlgorithms/Office.py" -"vtkCommonColor","VisualizationAlgorithms/OfficeTube.py" -"vtkCommonColor","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkCommonColor","VisualizationAlgorithms/PineRootDecimation.py" -"vtkCommonColor","VisualizationAlgorithms/PlateVibration.py" -"vtkCommonColor","VisualizationAlgorithms/ProbeCombustor.py" -"vtkCommonColor","VisualizationAlgorithms/SingleSplat.py" -"vtkCommonColor","VisualizationAlgorithms/SpikeFran.py" -"vtkCommonColor","VisualizationAlgorithms/SplatFace.py" -"vtkCommonColor","VisualizationAlgorithms/Stocks.py" -"vtkCommonColor","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkCommonColor","VisualizationAlgorithms/TensorAxes.py" -"vtkCommonColor","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkCommonColor","VisualizationAlgorithms/VelocityProfile.py" -"vtkCommonColor","VisualizationAlgorithms/WarpCombustor.py" -"vtkCommonColor","Visualization/AlphaFrequency.py" -"vtkCommonColor","Visualization/AnnotatedCubeActor.py" -"vtkCommonColor","Visualization/AssignCellColorsFromLUT.py" -"vtkCommonColor","Visualization/BillboardTextActor3D.py" -"vtkCommonColor","Visualization/BlobbyLogo.py" -"vtkCommonColor","Visualization/Blow.py" -"vtkCommonColor","Visualization/CameraModel1.py" -"vtkCommonColor","Visualization/CameraModel2.py" -"vtkCommonColor","Visualization/Camera.py" -"vtkCommonColor","Visualization/ClampGlyphSizes.py" -"vtkCommonColor","Visualization/CollisionDetection.py" -"vtkCommonColor","Visualization/ColorAnActor.py" -"vtkCommonColor","Visualization/ColoredAnnotatedCube.py" -"vtkCommonColor","Visualization/ColorSeriesPatches.py" -"vtkCommonColor","Visualization/ComplexV.py" -"vtkCommonColor","Visualization/CreateColorSeriesDemo.py" -"vtkCommonColor","Visualization/CubeAxesActor.py" -"vtkCommonColor","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCommonColor","Visualization/DisplayCoordinateAxes.py" -"vtkCommonColor","Visualization/DisplayQuadricSurfaces.py" -"vtkCommonColor","Visualization/ElevationBandsWithGlyphs.py" -"vtkCommonColor","Visualization/FrogBrain.py" -"vtkCommonColor","Visualization/FroggieSurface.py" -"vtkCommonColor","Visualization/FroggieView.py" -"vtkCommonColor","Visualization/FrogSlice.py" -"vtkCommonColor","Visualization/GlyphTable.py" -"vtkCommonColor","Visualization/Hanoi.py" -"vtkCommonColor","Visualization/HardwareSelector.py" -"vtkCommonColor","Visualization/Hawaii.py" -"vtkCommonColor","Visualization/IsosurfaceSampling.py" -"vtkCommonColor","Visualization/Kitchen.py" -"vtkCommonColor","Visualization/KochSnowflake.py" -"vtkCommonColor","Visualization/LoopShrink.py" -"vtkCommonColor","Visualization/Lorenz.py" -"vtkCommonColor","Visualization/MultipleRenderWindows.py" -"vtkCommonColor","Visualization/MultipleViewports.py" -"vtkCommonColor","Visualization/NamedColorPatches.py" -"vtkCommonColor","Visualization/NamedColors.py" -"vtkCommonColor","Visualization/NormalsDemo.py" -"vtkCommonColor","Visualization/OrientedGlyphs.py" -"vtkCommonColor","Visualization/PointDataSubdivision.py" -"vtkCommonColor","Visualization/PointSize.py" -"vtkCommonColor","Visualization/ProgrammableGlyphFilter.py" -"vtkCommonColor","Visualization/ProgrammableGlyphs.py" -"vtkCommonColor","Visualization/QuadricVisualization.py" -"vtkCommonColor","Visualization/ShadowsLightsDemo.py" -"vtkCommonColor","Visualization/SphereTexture.py" -"vtkCommonColor","Visualization/StreamLines.py" -"vtkCommonColor","Visualization/TextSource.py" -"vtkCommonColor","Visualization/VectorText.py" -"vtkCommonColor","Visualization/WindowTitle.py" -"vtkCommonColor","VolumeRendering/PseudoVolumeRendering.py" -"vtkCommonColor","VolumeRendering/SimpleRayCast.py" -"vtkCommonColor","Widgets/BalloonWidget.py" -"vtkCommonColor","Widgets/BoxWidget.py" -"vtkCommonColor","Widgets/CameraOrientationWidget.py" -"vtkCommonColor","Widgets/CompassWidget.py" -"vtkCommonColor","Widgets/ContourWidget.py" -"vtkCommonColor","Widgets/ImplicitPlaneWidget2.py" -"vtkCommonColor","Widgets/OrientationMarkerWidget1.py" -"vtkCommonColor","Widgets/OrientationMarkerWidget.py" -"vtkCommonColor","Widgets/ScalarBarWidget.py" -"vtkCommonColor","Widgets/SphereWidget.py" -"vtkCommonColor","Widgets/SplineWidget.py" -"vtkCommonColor","Widgets/TextWidget.py" -"vtkCommonComputationalGeometry","DataManipulation/LineOnMesh.py" -"vtkCommonComputationalGeometry","GeometricObjects/ParametricKuenDemo.py" -"vtkCommonComputationalGeometry","GeometricObjects/ParametricObjectsDemo.py" -"vtkCommonComputationalGeometry","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkCommonComputationalGeometry","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkCommonComputationalGeometry","PolyData/CurvaturesAdjustEdges.py" -"vtkCommonComputationalGeometry","PolyData/CurvaturesDemo.py" -"vtkCommonComputationalGeometry","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommonComputationalGeometry","Rendering/PBR_Skybox.py" -"vtkCommonComputationalGeometry","Rendering/PBR_Skybox_Texturing.py" -"vtkCommonComputationalGeometry","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCommonComputationalGeometry","Visualization/ElevationBandsWithGlyphs.py" -"vtkCommonComputationalGeometry","Visualization/PointDataSubdivision.py" -"vtkCommonCore","Annotation/MultiLineText.py" -"vtkCommonCore","CompositeData/OverlappingAMR.py" -"vtkCommonCore","DataManipulation/LineOnMesh.py" -"vtkCommonCore","DataManipulation/MeshLabelImageColor.py" -"vtkCommonCore","ExplicitStructuredGrid/CreateESGrid.py" -"vtkCommonCore","Filtering/AppendFilter.py" -"vtkCommonCore","Filtering/ConstrainedDelaunay2D.py" -"vtkCommonCore","Filtering/Delaunay2D.py" -"vtkCommonCore","Filtering/Glyph2D.py" -"vtkCommonCore","Filtering/Glyph3D.py" -"vtkCommonCore","Filtering/IterativeClosestPoints.py" -"vtkCommonCore","Filtering/TriangulateTerrainMap.py" -"vtkCommonCore","Filtering/VertexGlyphFilter.py" -"vtkCommonCore","GeometricObjects/Cell3DDemonstration.py" -"vtkCommonCore","GeometricObjects/CellTypeSource.py" -"vtkCommonCore","GeometricObjects/ColoredLines.py" -"vtkCommonCore","GeometricObjects/ConvexPointSet.py" -"vtkCommonCore","GeometricObjects/Cube.py" -"vtkCommonCore","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCommonCore","GeometricObjects/EllipticalCylinder.py" -"vtkCommonCore","GeometricObjects/Hexahedron.py" -"vtkCommonCore","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCommonCore","GeometricObjects/LinearCellsDemo.py" -"vtkCommonCore","GeometricObjects/LongLine.py" -"vtkCommonCore","GeometricObjects/OrientedArrow.py" -"vtkCommonCore","GeometricObjects/OrientedCylinder.py" -"vtkCommonCore","GeometricObjects/ParametricKuenDemo.py" -"vtkCommonCore","GeometricObjects/ParametricObjectsDemo.py" -"vtkCommonCore","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkCommonCore","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkCommonCore","GeometricObjects/PlanesIntersection.py" -"vtkCommonCore","GeometricObjects/PlatonicSolids.py" -"vtkCommonCore","GeometricObjects/Point.py" -"vtkCommonCore","GeometricObjects/PolygonIntersection.py" -"vtkCommonCore","GeometricObjects/Polygon.py" -"vtkCommonCore","GeometricObjects/Polyhedron.py" -"vtkCommonCore","GeometricObjects/PolyLine1.py" -"vtkCommonCore","GeometricObjects/PolyLine.py" -"vtkCommonCore","GeometricObjects/Pyramid.py" -"vtkCommonCore","GeometricObjects/Quad.py" -"vtkCommonCore","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkCommonCore","GeometricObjects/QuadraticHexahedron.py" -"vtkCommonCore","GeometricObjects/QuadraticTetraDemo.py" -"vtkCommonCore","GeometricObjects/QuadraticTetra.py" -"vtkCommonCore","GeometricObjects/Tetrahedron.py" -"vtkCommonCore","GeometricObjects/Triangle.py" -"vtkCommonCore","GeometricObjects/TriangleStrip.py" -"vtkCommonCore","GeometricObjects/Vertex.py" -"vtkCommonCore","Graphs/ColorEdges.py" -"vtkCommonCore","Graphs/ColorVertexLabels.py" -"vtkCommonCore","Graphs/ColorVerticesLookupTable.py" -"vtkCommonCore","Graphs/CreateTree.py" -"vtkCommonCore","Graphs/EdgeWeights.py" -"vtkCommonCore","Graphs/GraphToPolyData.py" -"vtkCommonCore","Graphs/LabelVerticesAndEdges.py" -"vtkCommonCore","Graphs/NOVCAGraph.py" -"vtkCommonCore","Graphs/ScaleVertices.py" -"vtkCommonCore","Graphs/SideBySideGraphs.py" -"vtkCommonCore","ImageData/WriteReadVtkImageData.py" -"vtkCommonCore","Images/Actor2D.py" -"vtkCommonCore","InfoVis/ParallelCoordinatesExtraction.py" -"vtkCommonCore","IO/CSVReadEdit1.py" -"vtkCommonCore","IO/CSVReadEdit.py" -"vtkCommonCore","IO/ReadLegacyUnstructuredGrid.py" -"vtkCommonCore","IO/WriteLegacyLinearCells.py" -"vtkCommonCore","IO/WriteTriangleToFile.py" -"vtkCommonCore","IO/WriteXMLLinearCells.py" -"vtkCommonCore","Medical/GenerateModelsFromLabels.py" -"vtkCommonCore","Medical/MedicalDemo1.py" -"vtkCommonCore","Medical/MedicalDemo2.py" -"vtkCommonCore","Medical/MedicalDemo3.py" -"vtkCommonCore","Medical/TissueLens.py" -"vtkCommonCore","Meshes/ClipDataSetWithPolyData1.py" -"vtkCommonCore","Meshes/ClipDataSetWithPolyData.py" -"vtkCommonCore","Meshes/ColoredElevationMap.py" -"vtkCommonCore","Meshes/DeformPointSet.py" -"vtkCommonCore","Modelling/Bottle.py" -"vtkCommonCore","Modelling/CappedSphere.py" -"vtkCommonCore","Modelling/DelaunayMesh.py" -"vtkCommonCore","Modelling/DiscreteMarchingCubes.py" -"vtkCommonCore","Modelling/ExtractLargestIsosurface.py" -"vtkCommonCore","Modelling/Finance.py" -"vtkCommonCore","Modelling/MarchingCubes.py" -"vtkCommonCore","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkCommonCore","Modelling/Spring.py" -"vtkCommonCore","Picking/CellPicking.py" -"vtkCommonCore","Picking/HighlightPickedActor.py" -"vtkCommonCore","Picking/HighlightWithSilhouette.py" -"vtkCommonCore","Plotting/MultiplePlots.py" -"vtkCommonCore","Plotting/ScatterPlot.py" -"vtkCommonCore","Plotting/SpiderPlot.py" -"vtkCommonCore","Plotting/SurfacePlot.py" -"vtkCommonCore","PolyData/AlignTwoPolyDatas.py" -"vtkCommonCore","PolyData/ColoredTriangle.py" -"vtkCommonCore","PolyData/CurvaturesAdjustEdges.py" -"vtkCommonCore","PolyData/CurvaturesDemo.py" -"vtkCommonCore","PolyData/Curvatures.py" -"vtkCommonCore","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkCommonCore","PolyData/ExtractSelection.py" -"vtkCommonCore","PolyData/ExtractSelectionUsingCells.py" -"vtkCommonCore","PolyData/ImplicitPolyDataDistance.py" -"vtkCommonCore","PolyData/IterateOverLines.py" -"vtkCommonCore","PolyData/PolyDataContourToImageData.py" -"vtkCommonCore","PolyData/RuledSurfaceFilter.py" -"vtkCommonCore","PolyData/SmoothMeshGrid.py" -"vtkCommonCore","PolyData/SolidColoredTriangle.py" -"vtkCommonCore","PolyData/TriangleColoredPoints.py" -"vtkCommonCore","PolyData/TriangleCorners.py" -"vtkCommonCore","PolyData/TriangleCornerVertices.py" -"vtkCommonCore","PolyData/WarpVector.py" -"vtkCommonCore","RectilinearGrid/RectilinearGrid.py" -"vtkCommonCore","RectilinearGrid/RGrid.py" -"vtkCommonCore","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkCommonCore","Rendering/GradientBackground.py" -"vtkCommonCore","Rendering/OutlineGlowPass.py" -"vtkCommonCore","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommonCore","Rendering/PBR_Skybox.py" -"vtkCommonCore","Rendering/PBR_Skybox_Texturing.py" -"vtkCommonCore","Rendering/Rainbow.py" -"vtkCommonCore","Rendering/StippledLine.py" -"vtkCommonCore","Rendering/TransformSphere.py" -"vtkCommonCore","SimpleOperations/DistanceBetweenPoints.py" -"vtkCommonCore","StructuredGrid/BlankPoint.py" -"vtkCommonCore","StructuredGrid/SGrid.py" -"vtkCommonCore","StructuredPoints/Vol.py" -"vtkCommonCore","Texture/TextureCutSphere.py" -"vtkCommonCore","UnstructuredGrid/UGrid.py" -"vtkCommonCore","Utilities/CheckVTKVersion.py" -"vtkCommonCore","Utilities/LUTUtilities.py" -"vtkCommonCore","Utilities/SaveSceneToFieldData.py" -"vtkCommonCore","Utilities/Variant.py" -"vtkCommonCore","Utilities/VTKImportsForPython.py" -"vtkCommonCore","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkCommonCore","VisualizationAlgorithms/CarotidFlow.py" -"vtkCommonCore","VisualizationAlgorithms/CutWithScalars.py" -"vtkCommonCore","VisualizationAlgorithms/DataSetSurface.py" -"vtkCommonCore","VisualizationAlgorithms/DisplacementPlot.py" -"vtkCommonCore","VisualizationAlgorithms/ExponentialCosine.py" -"vtkCommonCore","VisualizationAlgorithms/HeadBone.py" -"vtkCommonCore","VisualizationAlgorithms/LOxGrid.py" -"vtkCommonCore","VisualizationAlgorithms/LOx.py" -"vtkCommonCore","VisualizationAlgorithms/LOxSeeds.py" -"vtkCommonCore","VisualizationAlgorithms/MarchingCases.py" -"vtkCommonCore","VisualizationAlgorithms/Motor.py" -"vtkCommonCore","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkCommonCore","VisualizationAlgorithms/PineRootDecimation.py" -"vtkCommonCore","VisualizationAlgorithms/SingleSplat.py" -"vtkCommonCore","VisualizationAlgorithms/TensorAxes.py" -"vtkCommonCore","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkCommonCore","Visualization/AssignCellColorsFromLUT.py" -"vtkCommonCore","Visualization/BillboardTextActor3D.py" -"vtkCommonCore","Visualization/Blow.py" -"vtkCommonCore","Visualization/CameraModel1.py" -"vtkCommonCore","Visualization/CameraModel2.py" -"vtkCommonCore","Visualization/ColoredAnnotatedCube.py" -"vtkCommonCore","Visualization/ComplexV.py" -"vtkCommonCore","Visualization/CreateColorSeriesDemo.py" -"vtkCommonCore","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCommonCore","Visualization/ElevationBandsWithGlyphs.py" -"vtkCommonCore","Visualization/FrogBrain.py" -"vtkCommonCore","Visualization/FroggieSurface.py" -"vtkCommonCore","Visualization/FroggieView.py" -"vtkCommonCore","Visualization/FrogSlice.py" -"vtkCommonCore","Visualization/Hanoi.py" -"vtkCommonCore","Visualization/Hawaii.py" -"vtkCommonCore","Visualization/IsosurfaceSampling.py" -"vtkCommonCore","Visualization/KochSnowflake.py" -"vtkCommonCore","Visualization/Lorenz.py" -"vtkCommonCore","Visualization/NamedColors.py" -"vtkCommonCore","Visualization/PointDataSubdivision.py" -"vtkCommonCore","Visualization/ProgrammableGlyphFilter.py" -"vtkCommonCore","VolumeRendering/PseudoVolumeRendering.py" -"vtkCommonCore","Widgets/CompassWidget.py" -"vtkCommonCore","Widgets/ContourWidget.py" -"vtkCommonCore","Widgets/ImplicitPlaneWidget2.py" -"vtkCommonCore","Widgets/ScalarBarWidget.py" -"vtkCommonCore","Widgets/SplineWidget.py" -"vtkCommonDataModel","Annotation/MultiLineText.py" -"vtkCommonDataModel","Arrays/GetValues.py" -"vtkCommonDataModel","Arrays/RenameArray.py" -"vtkCommonDataModel","CompositeData/CompositePolyDataMapper.py" -"vtkCommonDataModel","CompositeData/MultiBlockDataSet.py" -"vtkCommonDataModel","CompositeData/OverlappingAMR.py" -"vtkCommonDataModel","DataManipulation/LineOnMesh.py" -"vtkCommonDataModel","ExplicitStructuredGrid/CreateESGrid.py" -"vtkCommonDataModel","Filtering/AppendFilter.py" -"vtkCommonDataModel","Filtering/CombinePolyData.py" -"vtkCommonDataModel","Filtering/ConstrainedDelaunay2D.py" -"vtkCommonDataModel","Filtering/Delaunay2D.py" -"vtkCommonDataModel","Filtering/GaussianSplat.py" -"vtkCommonDataModel","Filtering/Glyph2D.py" -"vtkCommonDataModel","Filtering/Glyph3D.py" -"vtkCommonDataModel","Filtering/IterativeClosestPoints.py" -"vtkCommonDataModel","Filtering/PerlinNoise.py" -"vtkCommonDataModel","Filtering/TriangulateTerrainMap.py" -"vtkCommonDataModel","Filtering/VertexGlyphFilter.py" -"vtkCommonDataModel","GeometricObjects/Cell3DDemonstration.py" -"vtkCommonDataModel","GeometricObjects/CellTypeSource.py" -"vtkCommonDataModel","GeometricObjects/ColoredLines.py" -"vtkCommonDataModel","GeometricObjects/ConvexPointSet.py" -"vtkCommonDataModel","GeometricObjects/Cube.py" -"vtkCommonDataModel","GeometricObjects/Dodecahedron.py" -"vtkCommonDataModel","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCommonDataModel","GeometricObjects/EllipticalCylinder.py" -"vtkCommonDataModel","GeometricObjects/Frustum.py" -"vtkCommonDataModel","GeometricObjects/Hexahedron.py" -"vtkCommonDataModel","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCommonDataModel","GeometricObjects/LinearCellsDemo.py" -"vtkCommonDataModel","GeometricObjects/LongLine.py" -"vtkCommonDataModel","GeometricObjects/PlanesIntersection.py" -"vtkCommonDataModel","GeometricObjects/Planes.py" -"vtkCommonDataModel","GeometricObjects/Point.py" -"vtkCommonDataModel","GeometricObjects/PolygonIntersection.py" -"vtkCommonDataModel","GeometricObjects/Polygon.py" -"vtkCommonDataModel","GeometricObjects/Polyhedron.py" -"vtkCommonDataModel","GeometricObjects/PolyLine1.py" -"vtkCommonDataModel","GeometricObjects/PolyLine.py" -"vtkCommonDataModel","GeometricObjects/Pyramid.py" -"vtkCommonDataModel","GeometricObjects/Quad.py" -"vtkCommonDataModel","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkCommonDataModel","GeometricObjects/QuadraticHexahedron.py" -"vtkCommonDataModel","GeometricObjects/QuadraticTetraDemo.py" -"vtkCommonDataModel","GeometricObjects/QuadraticTetra.py" -"vtkCommonDataModel","GeometricObjects/Tetrahedron.py" -"vtkCommonDataModel","GeometricObjects/Triangle.py" -"vtkCommonDataModel","GeometricObjects/TriangleStrip.py" -"vtkCommonDataModel","GeometricObjects/Vertex.py" -"vtkCommonDataModel","Graphs/ColorEdges.py" -"vtkCommonDataModel","Graphs/ColorVertexLabels.py" -"vtkCommonDataModel","Graphs/ColorVerticesLookupTable.py" -"vtkCommonDataModel","Graphs/ConstructGraph.py" -"vtkCommonDataModel","Graphs/ConstructTree.py" -"vtkCommonDataModel","Graphs/CreateTree.py" -"vtkCommonDataModel","Graphs/EdgeWeights.py" -"vtkCommonDataModel","Graphs/GraphToPolyData.py" -"vtkCommonDataModel","Graphs/LabelVerticesAndEdges.py" -"vtkCommonDataModel","Graphs/NOVCAGraph.py" -"vtkCommonDataModel","Graphs/ScaleVertices.py" -"vtkCommonDataModel","Graphs/SideBySideGraphs.py" -"vtkCommonDataModel","Graphs/VisualizeDirectedGraph.py" -"vtkCommonDataModel","Graphs/VisualizeGraph.py" -"vtkCommonDataModel","ImageData/WriteReadVtkImageData.py" -"vtkCommonDataModel","ImageProcessing/Attenuation.py" -"vtkCommonDataModel","ImageProcessing/HybridMedianComparison.py" -"vtkCommonDataModel","ImageProcessing/MedianComparison.py" -"vtkCommonDataModel","Images/Actor2D.py" -"vtkCommonDataModel","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkCommonDataModel","ImplicitFunctions/ImplicitQuadric.py" -"vtkCommonDataModel","ImplicitFunctions/ImplicitSphere1.py" -"vtkCommonDataModel","ImplicitFunctions/ImplicitSphere.py" -"vtkCommonDataModel","ImplicitFunctions/SampleFunction.py" -"vtkCommonDataModel","Interaction/InteractorStyleTrackballCamera.py" -"vtkCommonDataModel","IO/CSVReadEdit1.py" -"vtkCommonDataModel","IO/CSVReadEdit.py" -"vtkCommonDataModel","IO/PolyDataToImageDataConverter.py" -"vtkCommonDataModel","IO/ReadLegacyUnstructuredGrid.py" -"vtkCommonDataModel","IO/WriteLegacyLinearCells.py" -"vtkCommonDataModel","IO/WriteTriangleToFile.py" -"vtkCommonDataModel","IO/WriteXMLLinearCells.py" -"vtkCommonDataModel","Medical/GenerateCubesFromLabels.py" -"vtkCommonDataModel","Medical/GenerateModelsFromLabels.py" -"vtkCommonDataModel","Medical/MedicalDemo4.py" -"vtkCommonDataModel","Medical/TissueLens.py" -"vtkCommonDataModel","Meshes/CapClip.py" -"vtkCommonDataModel","Meshes/ClipDataSetWithPolyData1.py" -"vtkCommonDataModel","Meshes/ClipDataSetWithPolyData.py" -"vtkCommonDataModel","Meshes/ColoredElevationMap.py" -"vtkCommonDataModel","Meshes/Decimation.py" -"vtkCommonDataModel","Meshes/DeformPointSet.py" -"vtkCommonDataModel","Meshes/PointInterpolator.py" -"vtkCommonDataModel","Meshes/SolidClip.py" -"vtkCommonDataModel","Modelling/Bottle.py" -"vtkCommonDataModel","Modelling/CappedSphere.py" -"vtkCommonDataModel","Modelling/DelaunayMesh.py" -"vtkCommonDataModel","Modelling/DiscreteMarchingCubes.py" -"vtkCommonDataModel","Modelling/Finance.py" -"vtkCommonDataModel","Modelling/MarchingCubes.py" -"vtkCommonDataModel","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkCommonDataModel","Modelling/Spring.py" -"vtkCommonDataModel","Picking/CellPicking.py" -"vtkCommonDataModel","Plotting/MultiplePlots.py" -"vtkCommonDataModel","Plotting/ScatterPlot.py" -"vtkCommonDataModel","Plotting/SpiderPlot.py" -"vtkCommonDataModel","Plotting/SurfacePlot.py" -"vtkCommonDataModel","PolyData/AlignTwoPolyDatas.py" -"vtkCommonDataModel","PolyData/CellsInsideObject.py" -"vtkCommonDataModel","PolyData/ColoredTriangle.py" -"vtkCommonDataModel","PolyData/CurvaturesAdjustEdges.py" -"vtkCommonDataModel","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkCommonDataModel","PolyData/ExtractSelection.py" -"vtkCommonDataModel","PolyData/ExtractSelectionUsingCells.py" -"vtkCommonDataModel","PolyData/FilledPolygon.py" -"vtkCommonDataModel","PolyData/ImplicitPolyDataDistance.py" -"vtkCommonDataModel","PolyData/IterateOverLines.py" -"vtkCommonDataModel","PolyData/PolyDataContourToImageData.py" -"vtkCommonDataModel","PolyData/PolyDataToImageDataStencil.py" -"vtkCommonDataModel","PolyData/RuledSurfaceFilter.py" -"vtkCommonDataModel","PolyData/SmoothMeshGrid.py" -"vtkCommonDataModel","PolyData/SolidColoredTriangle.py" -"vtkCommonDataModel","PolyData/TriangleColoredPoints.py" -"vtkCommonDataModel","PolyData/TriangleCorners.py" -"vtkCommonDataModel","PolyData/TriangleCornerVertices.py" -"vtkCommonDataModel","PolyData/WarpVector.py" -"vtkCommonDataModel","RectilinearGrid/RectilinearGrid.py" -"vtkCommonDataModel","RectilinearGrid/RGrid.py" -"vtkCommonDataModel","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkCommonDataModel","Rendering/FlatVersusGouraud.py" -"vtkCommonDataModel","Rendering/GradientBackground.py" -"vtkCommonDataModel","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommonDataModel","Rendering/PBR_Skybox.py" -"vtkCommonDataModel","Rendering/PBR_Skybox_Texturing.py" -"vtkCommonDataModel","Rendering/StippledLine.py" -"vtkCommonDataModel","StructuredGrid/BlankPoint.py" -"vtkCommonDataModel","StructuredGrid/SGrid.py" -"vtkCommonDataModel","StructuredPoints/Vol.py" -"vtkCommonDataModel","Texture/TextureCutQuadric.py" -"vtkCommonDataModel","Texture/TextureCutSphere.py" -"vtkCommonDataModel","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkCommonDataModel","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkCommonDataModel","UnstructuredGrid/UGrid.py" -"vtkCommonDataModel","Utilities/VTKWithNumpy.py" -"vtkCommonDataModel","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkCommonDataModel","VisualizationAlgorithms/ContourQuadric.py" -"vtkCommonDataModel","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkCommonDataModel","VisualizationAlgorithms/Cutter.py" -"vtkCommonDataModel","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkCommonDataModel","VisualizationAlgorithms/CutWithScalars.py" -"vtkCommonDataModel","VisualizationAlgorithms/DataSetSurface.py" -"vtkCommonDataModel","VisualizationAlgorithms/ExponentialCosine.py" -"vtkCommonDataModel","VisualizationAlgorithms/ExtractData.py" -"vtkCommonDataModel","VisualizationAlgorithms/HeadBone.py" -"vtkCommonDataModel","VisualizationAlgorithms/IceCream.py" -"vtkCommonDataModel","VisualizationAlgorithms/MarchingCases.py" -"vtkCommonDataModel","VisualizationAlgorithms/Motor.py" -"vtkCommonDataModel","VisualizationAlgorithms/OfficeTube.py" -"vtkCommonDataModel","VisualizationAlgorithms/SingleSplat.py" -"vtkCommonDataModel","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkCommonDataModel","Visualization/CameraModel1.py" -"vtkCommonDataModel","Visualization/CameraModel2.py" -"vtkCommonDataModel","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCommonDataModel","Visualization/DisplayQuadricSurfaces.py" -"vtkCommonDataModel","Visualization/ElevationBandsWithGlyphs.py" -"vtkCommonDataModel","Visualization/HardwareSelector.py" -"vtkCommonDataModel","Visualization/IsosurfaceSampling.py" -"vtkCommonDataModel","Visualization/KochSnowflake.py" -"vtkCommonDataModel","Visualization/Lorenz.py" -"vtkCommonDataModel","Visualization/NormalsDemo.py" -"vtkCommonDataModel","Visualization/OrientedGlyphs.py" -"vtkCommonDataModel","Visualization/PointDataSubdivision.py" -"vtkCommonDataModel","Visualization/ProgrammableGlyphFilter.py" -"vtkCommonDataModel","Visualization/QuadricVisualization.py" -"vtkCommonDataModel","VolumeRendering/PseudoVolumeRendering.py" -"vtkCommonDataModel","VolumeRendering/SimpleRayCast.py" -"vtkCommonDataModel","Widgets/ContourWidget.py" -"vtkCommonDataModel","Widgets/ImplicitPlaneWidget2.py" -"vtkCommonExecutionModel","GeometricObjects/TessellatedBoxSource.py" -"vtkCommonMath","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCommonMath","GeometricObjects/OrientedArrow.py" -"vtkCommonMath","GeometricObjects/OrientedCylinder.py" -"vtkCommonMath","VisualizationAlgorithms/OfficeTube.py" -"vtkCommonMath","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkCommonMath","Visualization/CollisionDetection.py" -"vtkCommonMath","Visualization/FroggieSurface.py" -"vtkCommonMath","Visualization/FroggieView.py" -"vtkCommonMath","Visualization/FrogSlice.py" -"vtkCommonTransforms","Filtering/TransformPolyData.py" -"vtkCommonTransforms","GeometricObjects/Axes.py" -"vtkCommonTransforms","GeometricObjects/EllipticalCylinderDemo.py" -"vtkCommonTransforms","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCommonTransforms","GeometricObjects/OrientedArrow.py" -"vtkCommonTransforms","GeometricObjects/OrientedCylinder.py" -"vtkCommonTransforms","IO/CSVReadEdit1.py" -"vtkCommonTransforms","IO/CSVReadEdit.py" -"vtkCommonTransforms","Medical/GenerateCubesFromLabels.py" -"vtkCommonTransforms","PolyData/AlignTwoPolyDatas.py" -"vtkCommonTransforms","PolyData/CellsInsideObject.py" -"vtkCommonTransforms","PolyData/CurvaturesAdjustEdges.py" -"vtkCommonTransforms","PolyData/CurvaturesDemo.py" -"vtkCommonTransforms","PolyData/RotationAroundLine.py" -"vtkCommonTransforms","Rendering/LayeredActors.py" -"vtkCommonTransforms","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCommonTransforms","Rendering/PBR_Skybox.py" -"vtkCommonTransforms","Rendering/PBR_Skybox_Texturing.py" -"vtkCommonTransforms","Rendering/TransformSphere.py" -"vtkCommonTransforms","Rendering/WalkCow.py" -"vtkCommonTransforms","Tutorial/Tutorial_Step6.py" -"vtkCommonTransforms","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkCommonTransforms","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkCommonTransforms","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkCommonTransforms","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkCommonTransforms","VisualizationAlgorithms/ExponentialCosine.py" -"vtkCommonTransforms","VisualizationAlgorithms/ExtractData.py" -"vtkCommonTransforms","VisualizationAlgorithms/MarchingCases.py" -"vtkCommonTransforms","VisualizationAlgorithms/ProbeCombustor.py" -"vtkCommonTransforms","VisualizationAlgorithms/SpikeFran.py" -"vtkCommonTransforms","VisualizationAlgorithms/Stocks.py" -"vtkCommonTransforms","Visualization/BlobbyLogo.py" -"vtkCommonTransforms","Visualization/CameraModel1.py" -"vtkCommonTransforms","Visualization/CameraModel2.py" -"vtkCommonTransforms","Visualization/CollisionDetection.py" -"vtkCommonTransforms","Visualization/ColoredAnnotatedCube.py" -"vtkCommonTransforms","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCommonTransforms","Visualization/ElevationBandsWithGlyphs.py" -"vtkCommonTransforms","Visualization/FroggieSurface.py" -"vtkCommonTransforms","Visualization/FroggieView.py" -"vtkCommonTransforms","Visualization/FrogSlice.py" -"vtkCommonTransforms","Widgets/BoxWidget.py" -"vtkCompassRepresentation","Widgets/CompassWidget.py" -"vtkCompassWidget","Widgets/CompassWidget.py" -"vtkCompositeDataDisplayAttributes","CompositeData/CompositePolyDataMapper.py" -"vtkCompositeDataGeometryFilter","CompositeData/MultiBlockDataSet.py" -"vtkCompositeDataGeometryFilter","CompositeData/OverlappingAMR.py" -"vtkCompositeDataGeometryFilter","IO/ReadExodusData.py" -"vtkCompositePolyDataMapper2","CompositeData/CompositePolyDataMapper.py" -"vtkCompositePolyDataMapper","CompositeData/CompositePolyDataMapper.py" -"vtkConeSource","Filtering/CombinePolyData.py" -"vtkConeSource","GeometricObjects/Cone.py" -"vtkConeSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkConeSource","GeometricObjects/SourceObjectsDemo.py" -"vtkConeSource","Interaction/CallBack.py" -"vtkConeSource","Meshes/ClipDataSetWithPolyData1.py" -"vtkConeSource","Meshes/ClipDataSetWithPolyData.py" -"vtkConeSource","PolyData/Outline.py" -"vtkConeSource","Rendering/CameraBlur.py" -"vtkConeSource","Rendering/Cone3.py" -"vtkConeSource","Rendering/Cone4.py" -"vtkConeSource","Rendering/GradientBackground.py" -"vtkConeSource","Rendering/Mace.py" -"vtkConeSource","Rendering/Model.py" -"vtkConeSource","Rendering/TransparentBackground.py" -"vtkConeSource","Tutorial/Tutorial_Step1.py" -"vtkConeSource","Tutorial/Tutorial_Step2.py" -"vtkConeSource","Tutorial/Tutorial_Step3.py" -"vtkConeSource","Tutorial/Tutorial_Step4.py" -"vtkConeSource","Tutorial/Tutorial_Step5.py" -"vtkConeSource","Tutorial/Tutorial_Step6.py" -"vtkConeSource","Utilities/ColorMapToLUT.py" -"vtkConeSource","Utilities/JSONColorMapToLUT.py" -"vtkConeSource","Utilities/ResetCameraOrientation.py" -"vtkConeSource","Utilities/ShareCamera.py" -"vtkConeSource","Utilities/XMLColorMapToLUT.py" -"vtkConeSource","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkConeSource","VisualizationAlgorithms/HyperStreamline.py" -"vtkConeSource","VisualizationAlgorithms/SingleSplat.py" -"vtkConeSource","VisualizationAlgorithms/SpikeFran.py" -"vtkConeSource","VisualizationAlgorithms/TensorAxes.py" -"vtkConeSource","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkConeSource","Visualization/CameraModel1.py" -"vtkConeSource","Visualization/CameraModel2.py" -"vtkConeSource","Visualization/ClampGlyphSizes.py" -"vtkConeSource","Visualization/ColoredAnnotatedCube.py" -"vtkConeSource","Visualization/GlyphTable.py" -"vtkConeSource","Visualization/MultipleRenderWindows.py" -"vtkConeSource","Visualization/MultipleViewports.py" -"vtkConeSource","Visualization/NamedColors.py" -"vtkConeSource","Visualization/PointDataSubdivision.py" -"vtkConeSource","Visualization/ProgrammableGlyphFilter.py" -"vtkConeSource","Visualization/ShadowsLightsDemo.py" -"vtkConeSource","Widgets/BoxWidget.py" -"vtkCone","VisualizationAlgorithms/IceCream.py" -"vtkConnectivityFilter","Filtering/ConnectivityFilter.py" -"vtkConnectivityFilter","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkConnectivityFilter","VisualizationAlgorithms/PineRootDecimation.py" -"vtkConnectivityFilter","Visualization/Blow.py" -"vtkContextActor","Plotting/MultiplePlots.py" -"vtkContextMouseEvent","Plotting/SurfacePlot.py" -"vtkContextScene","Plotting/MultiplePlots.py" -"vtkContextTransform","IO/ReadLegacyUnstructuredGrid.py" -"vtkContextView","IO/ReadLegacyUnstructuredGrid.py" -"vtkContextView","Plotting/ScatterPlot.py" -"vtkContextView","Plotting/SurfacePlot.py" -"vtkContourFilter","CompositeData/OverlappingAMR.py" -"vtkContourFilter","Filtering/GaussianSplat.py" -"vtkContourFilter","Filtering/PerlinNoise.py" -"vtkContourFilter","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkContourFilter","ImplicitFunctions/ImplicitQuadric.py" -"vtkContourFilter","ImplicitFunctions/ImplicitSphere1.py" -"vtkContourFilter","ImplicitFunctions/ImplicitSphere.py" -"vtkContourFilter","ImplicitFunctions/SampleFunction.py" -"vtkContourFilter","IO/ReadSLC.py" -"vtkContourFilter","Modelling/Finance.py" -"vtkContourFilter","Rendering/FlatVersusGouraud.py" -"vtkContourFilter","StructuredPoints/Vol.py" -"vtkContourFilter","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkContourFilter","VisualizationAlgorithms/CarotidFlow.py" -"vtkContourFilter","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkContourFilter","VisualizationAlgorithms/ContourQuadric.py" -"vtkContourFilter","VisualizationAlgorithms/CutWithScalars.py" -"vtkContourFilter","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkContourFilter","VisualizationAlgorithms/HeadSlice.py" -"vtkContourFilter","VisualizationAlgorithms/Hello.py" -"vtkContourFilter","VisualizationAlgorithms/IceCream.py" -"vtkContourFilter","VisualizationAlgorithms/IronIsoSurface.py" -"vtkContourFilter","VisualizationAlgorithms/MarchingCases.py" -"vtkContourFilter","VisualizationAlgorithms/ProbeCombustor.py" -"vtkContourFilter","VisualizationAlgorithms/SingleSplat.py" -"vtkContourFilter","VisualizationAlgorithms/SplatFace.py" -"vtkContourFilter","Visualization/BlobbyLogo.py" -"vtkContourFilter","Visualization/Blow.py" -"vtkContourFilter","Visualization/CameraModel1.py" -"vtkContourFilter","Visualization/CameraModel2.py" -"vtkContourFilter","Visualization/DisplayQuadricSurfaces.py" -"vtkContourFilter","Visualization/Lorenz.py" -"vtkContourFilter","Visualization/QuadricVisualization.py" -"vtkContourFilter","VolumeRendering/PseudoVolumeRendering.py" -"vtkContourTriangulator","Modelling/ContourTriangulator.py" -"vtkContourWidget","Widgets/ContourWidget.py" -"vtkConvexPointSet","GeometricObjects/ConvexPointSet.py" -"vtkCoordinate","Annotation/MultiLineText.py" -"vtkCoordinate","Rendering/GradientBackground.py" -"vtkCubeAxesActor","Visualization/CubeAxesActor.py" -"vtkCubeSource","Filtering/Glyph3D.py" -"vtkCubeSource","GeometricObjects/Cube1.py" -"vtkCubeSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkCubeSource","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCubeSource","GeometricObjects/LinearCellsDemo.py" -"vtkCubeSource","GeometricObjects/ShrinkCube.py" -"vtkCubeSource","GeometricObjects/SourceObjectsDemo.py" -"vtkCubeSource","PolyData/CurvaturesAdjustEdges.py" -"vtkCubeSource","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkCubeSource","Rendering/LayeredActors.py" -"vtkCubeSource","Rendering/Model.py" -"vtkCubeSource","Rendering/PBR_Clear_Coat.py" -"vtkCubeSource","Rendering/PBR_Mapping.py" -"vtkCubeSource","Rendering/PBR_Skybox_Anisotropy.py" -"vtkCubeSource","Rendering/PBR_Skybox.py" -"vtkCubeSource","Rendering/PBR_Skybox_Texturing.py" -"vtkCubeSource","Rendering/Shadows.py" -"vtkCubeSource","Rendering/TransparentBackground.py" -"vtkCubeSource","Utilities/ShareCamera.py" -"vtkCubeSource","VisualizationAlgorithms/Cutter.py" -"vtkCubeSource","VisualizationAlgorithms/MarchingCases.py" -"vtkCubeSource","Visualization/CameraModel1.py" -"vtkCubeSource","Visualization/CameraModel2.py" -"vtkCubeSource","Visualization/ColoredAnnotatedCube.py" -"vtkCubeSource","Visualization/GlyphTable.py" -"vtkCubeSource","Visualization/MultipleRenderWindows.py" -"vtkCubeSource","Visualization/MultipleViewports.py" -"vtkCubeSource","Visualization/ProgrammableGlyphFilter.py" -"vtkCubeSource","Visualization/ShadowsLightsDemo.py" -"vtkCubeSource","Widgets/OrientationMarkerWidget.py" -"vtkCubicLine","GeometricObjects/IsoparametricCellsDemo.py" -"vtkCurvatures","PolyData/CurvaturesAdjustEdges.py" -"vtkCurvatures","PolyData/CurvaturesDemo.py" -"vtkCurvatures","PolyData/Curvatures.py" -"vtkCurvatures","Visualization/CurvatureBandsWithGlyphs.py" -"vtkCutter","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkCutter","PolyData/FilledPolygon.py" -"vtkCutter","PolyData/PolyDataContourToImageData.py" -"vtkCutter","PolyData/PolyDataToImageDataStencil.py" -"vtkCutter","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkCutter","VisualizationAlgorithms/Cutter.py" -"vtkCutter","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkCutter","VisualizationAlgorithms/DataSetSurface.py" -"vtkCutter","VolumeRendering/PseudoVolumeRendering.py" -"vtkCylinderSource","GeometricObjects/CylinderExample.py" -"vtkCylinderSource","GeometricObjects/Cylinder.py" -"vtkCylinderSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkCylinderSource","GeometricObjects/OrientedCylinder.py" -"vtkCylinderSource","GeometricObjects/SourceObjectsDemo.py" -"vtkCylinderSource","Rendering/FlatVersusGouraud.py" -"vtkCylinderSource","Utilities/RescaleReverseLUT.py" -"vtkCylinderSource","Utilities/ShareCamera.py" -"vtkCylinderSource","Visualization/Hanoi.py" -"vtkCylinderSource","Visualization/MultipleRenderWindows.py" -"vtkCylinderSource","Visualization/MultipleViewports.py" -"vtkCylinderSource","Widgets/SplineWidget.py" -"vtkCylinder","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkCylinder","Visualization/IsosurfaceSampling.py" -"vtkDataObject","CompositeData/CompositePolyDataMapper.py" -"vtkDataObject","Medical/GenerateCubesFromLabels.py" -"vtkDataObject","Medical/GenerateModelsFromLabels.py" -"vtkDataObject","Plotting/SpiderPlot.py" -"vtkDataObject","PolyData/CellsInsideObject.py" -"vtkDataObjectReader","Modelling/FinanceFieldData.py" -"vtkDataObjectToDataSetFilter","Modelling/FinanceFieldData.py" -"vtkDataObject","VisualizationAlgorithms/OfficeTube.py" -"vtkDataObject","Visualization/HardwareSelector.py" -"vtkDataSetAttributes","Medical/GenerateCubesFromLabels.py" -"vtkDataSetAttributes","Medical/GenerateModelsFromLabels.py" -"vtkDataSet","GeometricObjects/PolyLine1.py" -"vtkDataSetMapper","ExplicitStructuredGrid/CreateESGrid.py" -"vtkDataSetMapper","ExplicitStructuredGrid/LoadESGrid.py" -"vtkDataSetMapper","Filtering/AppendFilter.py" -"vtkDataSetMapper","Filtering/ConnectivityFilter.py" -"vtkDataSetMapper","Filtering/WarpTo.py" -"vtkDataSetMapper","GeometricObjects/Cell3DDemonstration.py" -"vtkDataSetMapper","GeometricObjects/CellTypeSource.py" -"vtkDataSetMapper","GeometricObjects/ConvexPointSet.py" -"vtkDataSetMapper","GeometricObjects/Hexahedron.py" -"vtkDataSetMapper","GeometricObjects/IsoparametricCellsDemo.py" -"vtkDataSetMapper","GeometricObjects/LinearCellsDemo.py" -"vtkDataSetMapper","GeometricObjects/Polyhedron.py" -"vtkDataSetMapper","GeometricObjects/Pyramid.py" -"vtkDataSetMapper","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkDataSetMapper","GeometricObjects/QuadraticHexahedron.py" -"vtkDataSetMapper","GeometricObjects/QuadraticTetraDemo.py" -"vtkDataSetMapper","GeometricObjects/QuadraticTetra.py" -"vtkDataSetMapper","GeometricObjects/ShrinkCube.py" -"vtkDataSetMapper","GeometricObjects/TessellatedBoxSource.py" -"vtkDataSetMapper","GeometricObjects/Tetrahedron.py" -"vtkDataSetMapper","GeometricObjects/TriangleStrip.py" -"vtkDataSetMapper","HyperTreeGrid/HyperTreeGridSource.py" -"vtkDataSetMapper","Images/ImageWarp.py" -"vtkDataSetMapper","InfoVis/ParallelCoordinatesExtraction.py" -"vtkDataSetMapper","IO/ReadImageData.py" -"vtkDataSetMapper","IO/ReadLegacyUnstructuredGrid.py" -"vtkDataSetMapper","IO/ReadUnstructuredGrid.py" -"vtkDataSetMapper","Medical/TissueLens.py" -"vtkDataSetMapper","Meshes/CapClip.py" -"vtkDataSetMapper","Meshes/ClipDataSetWithPolyData1.py" -"vtkDataSetMapper","Meshes/ClipDataSetWithPolyData.py" -"vtkDataSetMapper","Modelling/ContourTriangulator.py" -"vtkDataSetMapper","Picking/CellPicking.py" -"vtkDataSetMapper","PolyData/AlignTwoPolyDatas.py" -"vtkDataSetMapper","PolyData/CellsInsideObject.py" -"vtkDataSetMapper","PolyData/ExtractSelection.py" -"vtkDataSetMapper","PolyData/ExtractSelectionUsingCells.py" -"vtkDataSetMapper","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkDataSetMapper","RectilinearGrid/RectilinearGrid.py" -"vtkDataSetMapper","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkDataSetMapper","Rendering/ColoredSphere.py" -"vtkDataSetMapper","Rendering/TransformSphere.py" -"vtkDataSetMapper","StructuredGrid/BlankPoint.py" -"vtkDataSetMapper","Texture/TextureCutQuadric.py" -"vtkDataSetMapper","Texture/TextureCutSphere.py" -"vtkDataSetMapper","Texture/TextureThreshold.py" -"vtkDataSetMapper","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkDataSetMapper","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkDataSetMapper","UnstructuredGrid/UGrid.py" -"vtkDataSetMapper","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkDataSetMapper","VisualizationAlgorithms/DataSetSurface.py" -"vtkDataSetMapper","VisualizationAlgorithms/DisplacementPlot.py" -"vtkDataSetMapper","VisualizationAlgorithms/ExponentialCosine.py" -"vtkDataSetMapper","VisualizationAlgorithms/ExtractData.py" -"vtkDataSetMapper","VisualizationAlgorithms/Motor.py" -"vtkDataSetMapper","VisualizationAlgorithms/PineRootDecimation.py" -"vtkDataSetMapper","VisualizationAlgorithms/PlateVibration.py" -"vtkDataSetMapper","Visualization/Blow.py" -"vtkDataSetMapper","Visualization/CameraModel1.py" -"vtkDataSetMapper","Visualization/CameraModel2.py" -"vtkDataSetMapper","Visualization/Hawaii.py" -"vtkDataSetMapper","Visualization/LoopShrink.py" -"vtkDataSetMapper","Visualization/PointDataSubdivision.py" -"vtkDataSetMapper","Visualization/QuadricVisualization.py" -"vtkDataSetMapper","Widgets/OrientationMarkerWidget1.py" -"vtkDataSetMapper","Widgets/ScalarBarWidget.py" -"vtkDataSetReader","VisualizationAlgorithms/Office.py" -"vtkDataSetReader","VisualizationAlgorithms/OfficeTube.py" -"vtkDataSetReader","Visualization/Blow.py" -"vtkDataSetSurfaceFilter","VisualizationAlgorithms/DataSetSurface.py" -"vtkDataSetTriangleFilter","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkDataSet","VisualizationAlgorithms/SpikeFran.py" -"vtkDecimatePro","Meshes/Decimation.py" -"vtkDecimatePro","Rendering/StripFran.py" -"vtkDecimatePro","VisualizationAlgorithms/DecimateFran.py" -"vtkDecimatePro","VisualizationAlgorithms/DecimateHawaii.py" -"vtkDecimatePro","VisualizationAlgorithms/PineRootDecimation.py" -"vtkDecimatePro","Visualization/FroggieSurface.py" -"vtkDecimate","VisualizationAlgorithms/PineRootDecimation.py" -"vtkDeformPointSet","Meshes/DeformPointSet.py" -"vtkDelaunay2D","Filtering/ConstrainedDelaunay2D.py" -"vtkDelaunay2D","Filtering/Delaunay2D.py" -"vtkDelaunay2D","Filtering/TriangulateTerrainMap.py" -"vtkDelaunay2D","Meshes/ColoredElevationMap.py" -"vtkDelaunay2D","Modelling/DelaunayMesh.py" -"vtkDelaunay2D","PolyData/CurvaturesAdjustEdges.py" -"vtkDelaunay2D","Visualization/CurvatureBandsWithGlyphs.py" -"vtkDelaunay2D","Visualization/ElevationBandsWithGlyphs.py" -"vtkDelaunay3D","Filtering/ConnectivityFilter.py" -"vtkDelaunay3D","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkDelimitedTextReader","IO/CSVReadEdit1.py" -"vtkDelimitedTextReader","Meshes/PointInterpolator.py" -"vtk","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtk","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtk","Deprecated/GeometricObjects/ParametricObjects.py" -"vtk","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtk","Deprecated/Geovis/GeoGraticle.py" -"vtkDICOMImageReader","IO/ReadDICOM.py" -"vtkDICOMImageReader","IO/ReadDICOMSeries.py" -"vtkDICOMImageReader","Modelling/MarchingCubes.py" -"vtkDiscreteFlyingEdges3D","DataManipulation/MeshLabelImageColor.py" -"vtkDiscreteFlyingEdges3D","Medical/GenerateModelsFromLabels.py" -"vtkDiscreteFlyingEdges3D","Modelling/DiscreteMarchingCubes.py" -"vtkDiscreteMarchingCubes","DataManipulation/MeshLabelImageColor.py" -"vtkDiscreteMarchingCubes","Medical/GenerateModelsFromLabels.py" -"vtkDiscreteMarchingCubes","Modelling/DiscreteMarchingCubes.py" -"vtkDiscreteMarchingCubes","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkDiscretizableColorTransferFunction","IO/TransientHDFReader.py" -"vtkDiscretizableColorTransferFunction","Utilities/ColorMapToLUT.py" -"vtkDiscretizableColorTransferFunction","Utilities/JSONColorMapToLUT.py" -"vtkDiscretizableColorTransferFunction","Utilities/RescaleReverseLUT.py" -"vtkDiscretizableColorTransferFunction","Utilities/XMLColorMapToLUT.py" -"vtkDiskSource","GeometricObjects/Disk.py" -"vtkDiskSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkDiskSource","GeometricObjects/SourceObjectsDemo.py" -"vtkDiskSource","Meshes/BoundaryEdges.py" -"vtkDoubleArray","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkDoubleArray","Graphs/EdgeWeights.py" -"vtkDoubleArray","Graphs/LabelVerticesAndEdges.py" -"vtkDoubleArray","PolyData/CurvaturesAdjustEdges.py" -"vtkDoubleArray","PolyData/WarpVector.py" -"vtkDoubleArray","RectilinearGrid/RectilinearGrid.py" -"vtkDoubleArray","RectilinearGrid/RGrid.py" -"vtkDoubleArray","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkDoubleArray","Rendering/StippledLine.py" -"vtkDoubleArray","StructuredGrid/SGrid.py" -"vtkDoubleArray","StructuredPoints/Vol.py" -"vtkDoubleArray","Texture/TextureCutSphere.py" -"vtkDoubleArray","VisualizationAlgorithms/CutWithScalars.py" -"vtkDoubleArray","VisualizationAlgorithms/ExponentialCosine.py" -"vtkDoubleArray","VisualizationAlgorithms/SingleSplat.py" -"vtkDoubleArray","Visualization/CurvatureBandsWithGlyphs.py" -"vtkDoubleArray","Visualization/ElevationBandsWithGlyphs.py" -"vtkEarthSource","GeometricObjects/EarthSource.py" -"vtkElevationFilter","InfoVis/ParallelCoordinatesExtraction.py" -"vtkElevationFilter","InfoVis/ParallelCoordinatesView.py" -"vtkElevationFilter","Meshes/DeformPointSet.py" -"vtkElevationFilter","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkElevationFilter","Rendering/ColoredSphere.py" -"vtkElevationFilter","Rendering/TransformSphere.py" -"vtkElevationFilter","Utilities/ColorMapToLUT.py" -"vtkElevationFilter","Utilities/JSONColorMapToLUT.py" -"vtkElevationFilter","Utilities/RescaleReverseLUT.py" -"vtkElevationFilter","Utilities/XMLColorMapToLUT.py" -"vtkElevationFilter","Visualization/ClampGlyphSizes.py" -"vtkElevationFilter","Visualization/ColoredAnnotatedCube.py" -"vtkElevationFilter","Visualization/CurvatureBandsWithGlyphs.py" -"vtkElevationFilter","Visualization/ElevationBandsWithGlyphs.py" -"vtkElevationFilter","Visualization/GlyphTable.py" -"vtkElevationFilter","Visualization/Hawaii.py" -"vtkElevationFilter","Visualization/LoopShrink.py" -"vtkElevationFilter","Visualization/NamedColors.py" -"vtkElevationFilter","Visualization/PointDataSubdivision.py" -"vtkElevationFilter","Visualization/ProgrammableGlyphs.py" -"vtkExodusIIReader","IO/ReadExodusData.py" -"vtkExplicitStructuredGrid","ExplicitStructuredGrid/CreateESGrid.py" -"vtkExplicitStructuredGridToUnstructuredGrid","ExplicitStructuredGrid/CreateESGrid.py" -"vtkExtractEdges","CompositeData/MultiBlockDataSet.py" -"vtkExtractEdges","IO/ReadLegacyUnstructuredGrid.py" -"vtkExtractEdges","Modelling/DelaunayMesh.py" -"vtkExtractEdges","VisualizationAlgorithms/MarchingCases.py" -"vtkExtractGeometry","VisualizationAlgorithms/ExtractData.py" -"vtkExtractGrid","VolumeRendering/PseudoVolumeRendering.py" -"vtkExtractSelection","InfoVis/ParallelCoordinatesExtraction.py" -"vtkExtractSelection","Picking/CellPicking.py" -"vtkExtractSelection","PolyData/ExtractSelection.py" -"vtkExtractSelection","PolyData/ExtractSelectionUsingCells.py" -"vtkExtractVOI","DataManipulation/MeshLabelImageColor.py" -"vtkExtractVOI","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkExtractVOI","VisualizationAlgorithms/HeadSlice.py" -"vtkExtractVOI","Visualization/QuadricVisualization.py" -"vtkFeatureEdges","Meshes/BoundaryEdges.py" -"vtkFeatureEdges","Meshes/CapClip.py" -"vtkFeatureEdges","PolyData/ClosedSurface.py" -"vtkFeatureEdges","PolyData/CurvaturesAdjustEdges.py" -"vtkFeatureEdges","PolyData/CurvaturesDemo.py" -"vtkFeatureEdges","PolyData/Curvatures.py" -"vtkFeatureEdges","PolyData/FilledPolygon.py" -"vtkFeatureEdges","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFieldDataToAttributeDataFilter","Modelling/FinanceFieldData.py" -"vtk_file","IO/ReadUnstructuredGrid.py" -"vtk_files","Visualization/FroggieView.py" -"vtkFiltersCore","CompositeData/MultiBlockDataSet.py" -"vtkFiltersCore","CompositeData/OverlappingAMR.py" -"vtkFiltersCore","DataManipulation/LineOnMesh.py" -"vtkFiltersCore","DataManipulation/MeshLabelImageColor.py" -"vtkFiltersCore","ExplicitStructuredGrid/CreateESGrid.py" -"vtkFiltersCore","ExplicitStructuredGrid/LoadESGrid.py" -"vtkFiltersCore","Filtering/AppendFilter.py" -"vtkFiltersCore","Filtering/CombinePolyData.py" -"vtkFiltersCore","Filtering/ConnectivityFilter.py" -"vtkFiltersCore","Filtering/ConstrainedDelaunay2D.py" -"vtkFiltersCore","Filtering/Delaunay2D.py" -"vtkFiltersCore","Filtering/GaussianSplat.py" -"vtkFiltersCore","Filtering/Glyph2D.py" -"vtkFiltersCore","Filtering/Glyph3D.py" -"vtkFiltersCore","Filtering/PerlinNoise.py" -"vtkFiltersCore","Filtering/TriangulateTerrainMap.py" -"vtkFiltersCore","Filtering/WarpTo.py" -"vtkFiltersCore","GeometricObjects/EllipticalCylinderDemo.py" -"vtkFiltersCore","GeometricObjects/ParametricObjectsDemo.py" -"vtkFiltersCore","GeometricObjects/Planes.py" -"vtkFiltersCore","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkFiltersCore","GeometricObjects/QuadraticHexahedron.py" -"vtkFiltersCore","GeometricObjects/QuadraticTetraDemo.py" -"vtkFiltersCore","GeometricObjects/QuadraticTetra.py" -"vtkFiltersCore","Graphs/VisualizeDirectedGraph.py" -"vtkFiltersCore","Images/ImageWarp.py" -"vtkFiltersCore","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkFiltersCore","ImplicitFunctions/ImplicitQuadric.py" -"vtkFiltersCore","ImplicitFunctions/ImplicitSphere1.py" -"vtkFiltersCore","ImplicitFunctions/ImplicitSphere.py" -"vtkFiltersCore","ImplicitFunctions/SampleFunction.py" -"vtkFiltersCore","InfoVis/ParallelCoordinatesExtraction.py" -"vtkFiltersCore","InfoVis/ParallelCoordinatesView.py" -"vtkFiltersCore","IO/ReadLegacyUnstructuredGrid.py" -"vtkFiltersCore","IO/ReadSLC.py" -"vtkFiltersCore","Medical/GenerateCubesFromLabels.py" -"vtkFiltersCore","Medical/GenerateModelsFromLabels.py" -"vtkFiltersCore","Medical/MedicalDemo1.py" -"vtkFiltersCore","Medical/MedicalDemo2.py" -"vtkFiltersCore","Medical/MedicalDemo3.py" -"vtkFiltersCore","Medical/TissueLens.py" -"vtkFiltersCore","Meshes/BoundaryEdges.py" -"vtkFiltersCore","Meshes/CapClip.py" -"vtkFiltersCore","Meshes/ClipDataSetWithPolyData1.py" -"vtkFiltersCore","Meshes/ClipDataSetWithPolyData.py" -"vtkFiltersCore","Meshes/ColoredElevationMap.py" -"vtkFiltersCore","Meshes/Decimation.py" -"vtkFiltersCore","Meshes/DeformPointSet.py" -"vtkFiltersCore","Meshes/PointInterpolator.py" -"vtkFiltersCore","Meshes/SolidClip.py" -"vtkFiltersCore","Modelling/Bottle.py" -"vtkFiltersCore","Modelling/ContourTriangulator.py" -"vtkFiltersCore","Modelling/DelaunayMesh.py" -"vtkFiltersCore","Modelling/ExtractLargestIsosurface.py" -"vtkFiltersCore","Modelling/FinanceFieldData.py" -"vtkFiltersCore","Modelling/Finance.py" -"vtkFiltersCore","Modelling/MarchingCubes.py" -"vtkFiltersCore","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkFiltersCore","Modelling/Spring.py" -"vtkFiltersCore","Picking/CellPicking.py" -"vtkFiltersCore","PolyData/BooleanOperationPolyDataFilter.py" -"vtkFiltersCore","PolyData/ClosedSurface.py" -"vtkFiltersCore","PolyData/CurvaturesAdjustEdges.py" -"vtkFiltersCore","PolyData/CurvaturesDemo.py" -"vtkFiltersCore","PolyData/Curvatures.py" -"vtkFiltersCore","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkFiltersCore","PolyData/FilledPolygon.py" -"vtkFiltersCore","PolyData/ImplicitPolyDataDistance.py" -"vtkFiltersCore","PolyData/PolyDataContourToImageData.py" -"vtkFiltersCore","PolyData/PolyDataToImageDataStencil.py" -"vtkFiltersCore","PolyData/SmoothMeshGrid.py" -"vtkFiltersCore","PolyData/TubeFilter.py" -"vtkFiltersCore","Rendering/CameraBlur.py" -"vtkFiltersCore","Rendering/ColoredSphere.py" -"vtkFiltersCore","Rendering/FlatVersusGouraud.py" -"vtkFiltersCore","Rendering/Mace.py" -"vtkFiltersCore","Rendering/PBR_Anisotropy.py" -"vtkFiltersCore","Rendering/PBR_Clear_Coat.py" -"vtkFiltersCore","Rendering/PBR_Mapping.py" -"vtkFiltersCore","Rendering/PBR_Skybox_Anisotropy.py" -"vtkFiltersCore","Rendering/PBR_Skybox.py" -"vtkFiltersCore","Rendering/PBR_Skybox_Texturing.py" -"vtkFiltersCore","Rendering/Rainbow.py" -"vtkFiltersCore","Rendering/StripFran.py" -"vtkFiltersCore","Rendering/TransformSphere.py" -"vtkFiltersCore","StructuredGrid/SGrid.py" -"vtkFiltersCore","StructuredPoints/Vol.py" -"vtkFiltersCore","Texture/AnimateVectors.py" -"vtkFiltersCore","Texture/TextureThreshold.py" -"vtkFiltersCore","Utilities/ColorMapToLUT.py" -"vtkFiltersCore","Utilities/JSONColorMapToLUT.py" -"vtkFiltersCore","Utilities/RescaleReverseLUT.py" -"vtkFiltersCore","Utilities/XMLColorMapToLUT.py" -"vtkFiltersCore","VisualizationAlgorithms/BluntStreamlines.py" -"vtkFiltersCore","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkFiltersCore","VisualizationAlgorithms/CarotidFlow.py" -"vtkFiltersCore","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkFiltersCore","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkFiltersCore","VisualizationAlgorithms/ContourQuadric.py" -"vtkFiltersCore","VisualizationAlgorithms/CreateBFont.py" -"vtkFiltersCore","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkFiltersCore","VisualizationAlgorithms/Cutter.py" -"vtkFiltersCore","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkFiltersCore","VisualizationAlgorithms/CutWithScalars.py" -"vtkFiltersCore","VisualizationAlgorithms/DataSetSurface.py" -"vtkFiltersCore","VisualizationAlgorithms/DecimateFran.py" -"vtkFiltersCore","VisualizationAlgorithms/DecimateHawaii.py" -"vtkFiltersCore","VisualizationAlgorithms/DisplacementPlot.py" -"vtkFiltersCore","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkFiltersCore","VisualizationAlgorithms/HeadBone.py" -"vtkFiltersCore","VisualizationAlgorithms/HeadSlice.py" -"vtkFiltersCore","VisualizationAlgorithms/Hello.py" -"vtkFiltersCore","VisualizationAlgorithms/IceCream.py" -"vtkFiltersCore","VisualizationAlgorithms/IronIsoSurface.py" -"vtkFiltersCore","VisualizationAlgorithms/LOxGrid.py" -"vtkFiltersCore","VisualizationAlgorithms/LOx.py" -"vtkFiltersCore","VisualizationAlgorithms/LOxSeeds.py" -"vtkFiltersCore","VisualizationAlgorithms/MarchingCases.py" -"vtkFiltersCore","VisualizationAlgorithms/Motor.py" -"vtkFiltersCore","VisualizationAlgorithms/Office.py" -"vtkFiltersCore","VisualizationAlgorithms/OfficeTube.py" -"vtkFiltersCore","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkFiltersCore","VisualizationAlgorithms/PineRootDecimation.py" -"vtkFiltersCore","VisualizationAlgorithms/PlateVibration.py" -"vtkFiltersCore","VisualizationAlgorithms/ProbeCombustor.py" -"vtkFiltersCore","VisualizationAlgorithms/SingleSplat.py" -"vtkFiltersCore","VisualizationAlgorithms/SpikeFran.py" -"vtkFiltersCore","VisualizationAlgorithms/SplatFace.py" -"vtkFiltersCore","VisualizationAlgorithms/Stocks.py" -"vtkFiltersCore","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkFiltersCore","VisualizationAlgorithms/TensorAxes.py" -"vtkFiltersCore","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkFiltersCore","VisualizationAlgorithms/VelocityProfile.py" -"vtkFiltersCore","VisualizationAlgorithms/WarpCombustor.py" -"vtkFiltersCore","Visualization/BlobbyLogo.py" -"vtkFiltersCore","Visualization/Blow.py" -"vtkFiltersCore","Visualization/CameraModel1.py" -"vtkFiltersCore","Visualization/CameraModel2.py" -"vtkFiltersCore","Visualization/ClampGlyphSizes.py" -"vtkFiltersCore","Visualization/ColoredAnnotatedCube.py" -"vtkFiltersCore","Visualization/ComplexV.py" -"vtkFiltersCore","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFiltersCore","Visualization/DisplayQuadricSurfaces.py" -"vtkFiltersCore","Visualization/ElevationBandsWithGlyphs.py" -"vtkFiltersCore","Visualization/FrogBrain.py" -"vtkFiltersCore","Visualization/FroggieSurface.py" -"vtkFiltersCore","Visualization/FroggieView.py" -"vtkFiltersCore","Visualization/FrogSlice.py" -"vtkFiltersCore","Visualization/GlyphTable.py" -"vtkFiltersCore","Visualization/Hawaii.py" -"vtkFiltersCore","Visualization/IsosurfaceSampling.py" -"vtkFiltersCore","Visualization/Kitchen.py" -"vtkFiltersCore","Visualization/LoopShrink.py" -"vtkFiltersCore","Visualization/Lorenz.py" -"vtkFiltersCore","Visualization/NamedColors.py" -"vtkFiltersCore","Visualization/NormalsDemo.py" -"vtkFiltersCore","Visualization/OrientedGlyphs.py" -"vtkFiltersCore","Visualization/PointDataSubdivision.py" -"vtkFiltersCore","Visualization/ProgrammableGlyphs.py" -"vtkFiltersCore","Visualization/QuadricVisualization.py" -"vtkFiltersCore","Visualization/ShadowsLightsDemo.py" -"vtkFiltersCore","Visualization/StreamLines.py" -"vtkFiltersCore","VolumeRendering/PseudoVolumeRendering.py" -"vtkFiltersCore","Widgets/ImplicitPlaneWidget2.py" -"vtkFiltersExtraction","CompositeData/MultiBlockDataSet.py" -"vtkFiltersExtraction","InfoVis/ParallelCoordinatesExtraction.py" -"vtkFiltersExtraction","IO/ReadLegacyUnstructuredGrid.py" -"vtkFiltersExtraction","Modelling/DelaunayMesh.py" -"vtkFiltersExtraction","Picking/CellPicking.py" -"vtkFiltersExtraction","PolyData/ExtractSelection.py" -"vtkFiltersExtraction","PolyData/ExtractSelectionUsingCells.py" -"vtkFiltersExtraction","VisualizationAlgorithms/ExtractData.py" -"vtkFiltersExtraction","VisualizationAlgorithms/MarchingCases.py" -"vtkFiltersExtraction","VolumeRendering/PseudoVolumeRendering.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/BluntStreamlines.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/CarotidFlow.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/LOxGrid.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/LOx.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/LOxSeeds.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/Office.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/OfficeTube.py" -"vtkFiltersFlowPaths","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkFiltersFlowPaths","Visualization/Kitchen.py" -"vtkFiltersFlowPaths","Visualization/StreamLines.py" -"vtkFiltersGeneral","Annotation/TextOrigin.py" -"vtkFiltersGeneral","DataManipulation/MeshLabelImageColor.py" -"vtkFiltersGeneral","Filtering/Delaunay2D.py" -"vtkFiltersGeneral","Filtering/IterativeClosestPoints.py" -"vtkFiltersGeneral","Filtering/TransformPolyData.py" -"vtkFiltersGeneral","Filtering/TriangulateTerrainMap.py" -"vtkFiltersGeneral","Filtering/VertexGlyphFilter.py" -"vtkFiltersGeneral","Filtering/WarpTo.py" -"vtkFiltersGeneral","GeometricObjects/CellTypeSource.py" -"vtkFiltersGeneral","GeometricObjects/EllipticalCylinderDemo.py" -"vtkFiltersGeneral","GeometricObjects/Frustum.py" -"vtkFiltersGeneral","GeometricObjects/IsoparametricCellsDemo.py" -"vtkFiltersGeneral","GeometricObjects/OrientedArrow.py" -"vtkFiltersGeneral","GeometricObjects/OrientedCylinder.py" -"vtkFiltersGeneral","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkFiltersGeneral","GeometricObjects/QuadraticHexahedron.py" -"vtkFiltersGeneral","GeometricObjects/QuadraticTetraDemo.py" -"vtkFiltersGeneral","GeometricObjects/QuadraticTetra.py" -"vtkFiltersGeneral","GeometricObjects/RegularPolygonSource.py" -"vtkFiltersGeneral","GeometricObjects/ShrinkCube.py" -"vtkFiltersGeneral","GeometricObjects/TessellatedBoxSource.py" -"vtkFiltersGeneral","HyperTreeGrid/HyperTreeGridSource.py" -"vtkFiltersGeneral","ImageProcessing/IsoSubsample.py" -"vtkFiltersGeneral","Images/Actor2D.py" -"vtkFiltersGeneral","Images/ImageWarp.py" -"vtkFiltersGeneral","InfoVis/ParallelCoordinatesExtraction.py" -"vtkFiltersGeneral","InfoVis/ParallelCoordinatesView.py" -"vtkFiltersGeneral","InfoVis/SelectedGraphIDs.py" -"vtkFiltersGeneral","IO/CSVReadEdit1.py" -"vtkFiltersGeneral","IO/CSVReadEdit.py" -"vtkFiltersGeneral","IO/ReadLegacyUnstructuredGrid.py" -"vtkFiltersGeneral","Medical/GenerateCubesFromLabels.py" -"vtkFiltersGeneral","Medical/GenerateModelsFromLabels.py" -"vtkFiltersGeneral","Medical/TissueLens.py" -"vtkFiltersGeneral","Meshes/ClipDataSetWithPolyData1.py" -"vtkFiltersGeneral","Meshes/ClipDataSetWithPolyData.py" -"vtkFiltersGeneral","Meshes/DeformPointSet.py" -"vtkFiltersGeneral","Meshes/PointInterpolator.py" -"vtkFiltersGeneral","Modelling/ContourTriangulator.py" -"vtkFiltersGeneral","Modelling/DiscreteMarchingCubes.py" -"vtkFiltersGeneral","Modelling/FinanceFieldData.py" -"vtkFiltersGeneral","Modelling/Finance.py" -"vtkFiltersGeneral","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkFiltersGeneral","PolyData/AlignTwoPolyDatas.py" -"vtkFiltersGeneral","PolyData/BooleanOperationPolyDataFilter.py" -"vtkFiltersGeneral","PolyData/CellsInsideObject.py" -"vtkFiltersGeneral","PolyData/CurvaturesAdjustEdges.py" -"vtkFiltersGeneral","PolyData/CurvaturesDemo.py" -"vtkFiltersGeneral","PolyData/Curvatures.py" -"vtkFiltersGeneral","PolyData/ImplicitPolyDataDistance.py" -"vtkFiltersGeneral","PolyData/RotationAroundLine.py" -"vtkFiltersGeneral","PolyData/WarpVector.py" -"vtkFiltersGeneral","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkFiltersGeneral","Rendering/PBR_Skybox_Anisotropy.py" -"vtkFiltersGeneral","Rendering/PBR_Skybox.py" -"vtkFiltersGeneral","Rendering/PBR_Skybox_Texturing.py" -"vtkFiltersGeneral","Rendering/Rotations.py" -"vtkFiltersGeneral","Rendering/TransformSphere.py" -"vtkFiltersGeneral","Rendering/WalkCow.py" -"vtkFiltersGeneral","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkFiltersGeneral","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkFiltersGeneral","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkFiltersGeneral","VisualizationAlgorithms/DisplacementPlot.py" -"vtkFiltersGeneral","VisualizationAlgorithms/ExponentialCosine.py" -"vtkFiltersGeneral","VisualizationAlgorithms/ExtractData.py" -"vtkFiltersGeneral","VisualizationAlgorithms/HyperStreamline.py" -"vtkFiltersGeneral","VisualizationAlgorithms/MarchingCases.py" -"vtkFiltersGeneral","VisualizationAlgorithms/PlateVibration.py" -"vtkFiltersGeneral","VisualizationAlgorithms/ProbeCombustor.py" -"vtkFiltersGeneral","VisualizationAlgorithms/SpikeFran.py" -"vtkFiltersGeneral","VisualizationAlgorithms/Stocks.py" -"vtkFiltersGeneral","VisualizationAlgorithms/TensorAxes.py" -"vtkFiltersGeneral","VisualizationAlgorithms/VelocityProfile.py" -"vtkFiltersGeneral","VisualizationAlgorithms/WarpCombustor.py" -"vtkFiltersGeneral","Visualization/BlobbyLogo.py" -"vtkFiltersGeneral","Visualization/Blow.py" -"vtkFiltersGeneral","Visualization/CameraModel1.py" -"vtkFiltersGeneral","Visualization/CameraModel2.py" -"vtkFiltersGeneral","Visualization/ColoredAnnotatedCube.py" -"vtkFiltersGeneral","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFiltersGeneral","Visualization/ElevationBandsWithGlyphs.py" -"vtkFiltersGeneral","Visualization/FroggieSurface.py" -"vtkFiltersGeneral","Visualization/FroggieView.py" -"vtkFiltersGeneral","Visualization/FrogSlice.py" -"vtkFiltersGeneral","Visualization/LoopShrink.py" -"vtkFiltersGeometry","CompositeData/MultiBlockDataSet.py" -"vtkFiltersGeometry","CompositeData/OverlappingAMR.py" -"vtkFiltersGeometry","ImageData/ImageDataGeometryFilter.py" -"vtkFiltersGeometry","ImageData/WriteReadVtkImageData.py" -"vtkFiltersGeometry","Images/ImageWarp.py" -"vtkFiltersGeometry","IO/ReadExodusData.py" -"vtkFiltersGeometry","IO/ReadPLOT3D.py" -"vtkFiltersGeometry","Medical/GenerateCubesFromLabels.py" -"vtkFiltersGeometry","Medical/GenerateModelsFromLabels.py" -"vtkFiltersGeometry","Meshes/ClipDataSetWithPolyData1.py" -"vtkFiltersGeometry","Meshes/ClipDataSetWithPolyData.py" -"vtkFiltersGeometry","RectilinearGrid/RGrid.py" -"vtkFiltersGeometry","Rendering/Rainbow.py" -"vtkFiltersGeometry","StructuredGrid/BlankPoint.py" -"vtkFiltersGeometry","Texture/TextureThreshold.py" -"vtkFiltersGeometry","VisualizationAlgorithms/BluntStreamlines.py" -"vtkFiltersGeometry","VisualizationAlgorithms/CreateBFont.py" -"vtkFiltersGeometry","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkFiltersGeometry","VisualizationAlgorithms/DataSetSurface.py" -"vtkFiltersGeometry","VisualizationAlgorithms/HyperStreamline.py" -"vtkFiltersGeometry","VisualizationAlgorithms/LOxGrid.py" -"vtkFiltersGeometry","VisualizationAlgorithms/LOx.py" -"vtkFiltersGeometry","VisualizationAlgorithms/LOxSeeds.py" -"vtkFiltersGeometry","VisualizationAlgorithms/Office.py" -"vtkFiltersGeometry","VisualizationAlgorithms/OfficeTube.py" -"vtkFiltersGeometry","VisualizationAlgorithms/TensorAxes.py" -"vtkFiltersGeometry","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkFiltersGeometry","VisualizationAlgorithms/VelocityProfile.py" -"vtkFiltersGeometry","VisualizationAlgorithms/WarpCombustor.py" -"vtkFiltersGeometry","Visualization/Blow.py" -"vtkFiltersGeometry","Visualization/Kitchen.py" -"vtkFiltersHybrid","GeometricObjects/EarthSource.py" -"vtkFiltersHybrid","Picking/HighlightWithSilhouette.py" -"vtkFiltersHybrid","VisualizationAlgorithms/Hello.py" -"vtkFiltersHybrid","Visualization/BlobbyLogo.py" -"vtkFiltersHybrid","Visualization/CameraModel1.py" -"vtkFiltersHybrid","Visualization/CameraModel2.py" -"vtkFiltersHybrid","Visualization/PointDataSubdivision.py" -"vtkFiltersHyperTree","HyperTreeGrid/HyperTreeGridSource.py" -"vtkFiltersModeling","CompositeData/OverlappingAMR.py" -"vtkFiltersModeling","DataManipulation/LineOnMesh.py" -"vtkFiltersModeling","GeometricObjects/EllipticalCylinderDemo.py" -"vtkFiltersModeling","GeometricObjects/EllipticalCylinder.py" -"vtkFiltersModeling","ImplicitFunctions/SampleFunction.py" -"vtkFiltersModeling","InfoVis/ParallelCoordinatesExtraction.py" -"vtkFiltersModeling","Interaction/CallBack.py" -"vtkFiltersModeling","IO/ReadSLC.py" -"vtkFiltersModeling","Medical/MedicalDemo1.py" -"vtkFiltersModeling","Medical/MedicalDemo2.py" -"vtkFiltersModeling","Medical/MedicalDemo3.py" -"vtkFiltersModeling","Modelling/Bottle.py" -"vtkFiltersModeling","Modelling/CappedSphere.py" -"vtkFiltersModeling","Modelling/Spring.py" -"vtkFiltersModeling","PolyData/AlignTwoPolyDatas.py" -"vtkFiltersModeling","PolyData/CellsInsideObject.py" -"vtkFiltersModeling","PolyData/CurvaturesAdjustEdges.py" -"vtkFiltersModeling","PolyData/Outline.py" -"vtkFiltersModeling","PolyData/PolyDataContourToImageData.py" -"vtkFiltersModeling","PolyData/RuledSurfaceFilter.py" -"vtkFiltersModeling","PolyData/SmoothMeshGrid.py" -"vtkFiltersModeling","Rendering/PBR_Skybox_Anisotropy.py" -"vtkFiltersModeling","Rendering/PBR_Skybox.py" -"vtkFiltersModeling","Rendering/PBR_Skybox_Texturing.py" -"vtkFiltersModeling","Texture/AnimateVectors.py" -"vtkFiltersModeling","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkFiltersModeling","VisualizationAlgorithms/CarotidFlow.py" -"vtkFiltersModeling","VisualizationAlgorithms/ContourQuadric.py" -"vtkFiltersModeling","VisualizationAlgorithms/ExtractData.py" -"vtkFiltersModeling","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkFiltersModeling","VisualizationAlgorithms/HeadBone.py" -"vtkFiltersModeling","VisualizationAlgorithms/HeadSlice.py" -"vtkFiltersModeling","VisualizationAlgorithms/HyperStreamline.py" -"vtkFiltersModeling","VisualizationAlgorithms/IronIsoSurface.py" -"vtkFiltersModeling","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkFiltersModeling","VisualizationAlgorithms/PineRootDecimation.py" -"vtkFiltersModeling","VisualizationAlgorithms/PlateVibration.py" -"vtkFiltersModeling","VisualizationAlgorithms/ProbeCombustor.py" -"vtkFiltersModeling","VisualizationAlgorithms/SingleSplat.py" -"vtkFiltersModeling","VisualizationAlgorithms/Stocks.py" -"vtkFiltersModeling","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkFiltersModeling","VisualizationAlgorithms/TensorAxes.py" -"vtkFiltersModeling","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkFiltersModeling","Visualization/AlphaFrequency.py" -"vtkFiltersModeling","Visualization/CameraModel1.py" -"vtkFiltersModeling","Visualization/CameraModel2.py" -"vtkFiltersModeling","Visualization/CollisionDetection.py" -"vtkFiltersModeling","Visualization/ColoredAnnotatedCube.py" -"vtkFiltersModeling","Visualization/ComplexV.py" -"vtkFiltersModeling","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFiltersModeling","Visualization/DisplayQuadricSurfaces.py" -"vtkFiltersModeling","Visualization/ElevationBandsWithGlyphs.py" -"vtkFiltersModeling","Visualization/NamedColors.py" -"vtkFiltersModeling","Visualization/PointDataSubdivision.py" -"vtkFiltersModeling","Visualization/QuadricVisualization.py" -"vtkFiltersPoints","Meshes/PointInterpolator.py" -"vtkFiltersProgrammable","Visualization/ProgrammableGlyphFilter.py" -"vtkFiltersProgrammable","Visualization/ProgrammableGlyphs.py" -"vtkFiltersSources","Arrays/GetValues.py" -"vtkFiltersSources","Arrays/RenameArray.py" -"vtkFiltersSources","CompositeData/CompositePolyDataMapper.py" -"vtkFiltersSources","CompositeData/MultiBlockDataSet.py" -"vtkFiltersSources","DataManipulation/LineOnMesh.py" -"vtkFiltersSources","Filtering/AppendFilter.py" -"vtkFiltersSources","Filtering/CombinePolyData.py" -"vtkFiltersSources","Filtering/ConnectivityFilter.py" -"vtkFiltersSources","Filtering/GaussianSplat.py" -"vtkFiltersSources","Filtering/Glyph2D.py" -"vtkFiltersSources","Filtering/Glyph3D.py" -"vtkFiltersSources","Filtering/TransformPolyData.py" -"vtkFiltersSources","Filtering/WarpTo.py" -"vtkFiltersSources","GeometricObjects/Arrow.py" -"vtkFiltersSources","GeometricObjects/Axes.py" -"vtkFiltersSources","GeometricObjects/CellTypeSource.py" -"vtkFiltersSources","GeometricObjects/Circle.py" -"vtkFiltersSources","GeometricObjects/Cone.py" -"vtkFiltersSources","GeometricObjects/ConvexPointSet.py" -"vtkFiltersSources","GeometricObjects/Cube1.py" -"vtkFiltersSources","GeometricObjects/CylinderExample.py" -"vtkFiltersSources","GeometricObjects/Cylinder.py" -"vtkFiltersSources","GeometricObjects/Disk.py" -"vtkFiltersSources","GeometricObjects/EarthSource.py" -"vtkFiltersSources","GeometricObjects/EllipticalCylinderDemo.py" -"vtkFiltersSources","GeometricObjects/Frustum.py" -"vtkFiltersSources","GeometricObjects/GeometricObjectsDemo.py" -"vtkFiltersSources","GeometricObjects/IsoparametricCellsDemo.py" -"vtkFiltersSources","GeometricObjects/LinearCellsDemo.py" -"vtkFiltersSources","GeometricObjects/Line.py" -"vtkFiltersSources","GeometricObjects/OrientedArrow.py" -"vtkFiltersSources","GeometricObjects/OrientedCylinder.py" -"vtkFiltersSources","GeometricObjects/ParametricKuenDemo.py" -"vtkFiltersSources","GeometricObjects/ParametricObjectsDemo.py" -"vtkFiltersSources","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkFiltersSources","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkFiltersSources","GeometricObjects/Plane.py" -"vtkFiltersSources","GeometricObjects/PlanesIntersection.py" -"vtkFiltersSources","GeometricObjects/Planes.py" -"vtkFiltersSources","GeometricObjects/PlatonicSolids.py" -"vtkFiltersSources","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkFiltersSources","GeometricObjects/QuadraticHexahedron.py" -"vtkFiltersSources","GeometricObjects/QuadraticTetraDemo.py" -"vtkFiltersSources","GeometricObjects/QuadraticTetra.py" -"vtkFiltersSources","GeometricObjects/RegularPolygonSource.py" -"vtkFiltersSources","GeometricObjects/ShrinkCube.py" -"vtkFiltersSources","GeometricObjects/SourceObjectsDemo.py" -"vtkFiltersSources","GeometricObjects/Sphere.py" -"vtkFiltersSources","GeometricObjects/TessellatedBoxSource.py" -"vtkFiltersSources","Graphs/GraphToPolyData.py" -"vtkFiltersSources","Graphs/NOVCAGraph.py" -"vtkFiltersSources","Graphs/VisualizeDirectedGraph.py" -"vtkFiltersSources","HyperTreeGrid/HyperTreeGridSource.py" -"vtkFiltersSources","Images/BackgroundImage.py" -"vtkFiltersSources","Interaction/CallBack.py" -"vtkFiltersSources","Interaction/InteractorStyleTrackballActor.py" -"vtkFiltersSources","Interaction/InteractorStyleTrackballCamera.py" -"vtkFiltersSources","Interaction/MouseEventsObserver.py" -"vtkFiltersSources","Interaction/MouseEvents.py" -"vtkFiltersSources","IO/ImageWriter.py" -"vtkFiltersSources","IO/ReadLegacyUnstructuredGrid.py" -"vtkFiltersSources","IO/WritePLY.py" -"vtkFiltersSources","IO/WriteSTL.py" -"vtkFiltersSources","Medical/TissueLens.py" -"vtkFiltersSources","Meshes/BoundaryEdges.py" -"vtkFiltersSources","Meshes/CapClip.py" -"vtkFiltersSources","Meshes/ClipDataSetWithPolyData1.py" -"vtkFiltersSources","Meshes/ClipDataSetWithPolyData.py" -"vtkFiltersSources","Meshes/Decimation.py" -"vtkFiltersSources","Meshes/DeformPointSet.py" -"vtkFiltersSources","Meshes/SolidClip.py" -"vtkFiltersSources","Modelling/DelaunayMesh.py" -"vtkFiltersSources","Modelling/MarchingCubes.py" -"vtkFiltersSources","Picking/CellPicking.py" -"vtkFiltersSources","Picking/HighlightPickedActor.py" -"vtkFiltersSources","Picking/HighlightWithSilhouette.py" -"vtkFiltersSources","PolyData/BooleanOperationPolyDataFilter.py" -"vtkFiltersSources","PolyData/CurvaturesAdjustEdges.py" -"vtkFiltersSources","PolyData/CurvaturesDemo.py" -"vtkFiltersSources","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkFiltersSources","PolyData/ExtractSelection.py" -"vtkFiltersSources","PolyData/ExtractSelectionUsingCells.py" -"vtkFiltersSources","PolyData/FilledPolygon.py" -"vtkFiltersSources","PolyData/ImplicitPolyDataDistance.py" -"vtkFiltersSources","PolyData/Outline.py" -"vtkFiltersSources","PolyData/PointSource.py" -"vtkFiltersSources","PolyData/PolyDataContourToImageData.py" -"vtkFiltersSources","PolyData/PolyDataToImageDataStencil.py" -"vtkFiltersSources","PolyData/RotationAroundLine.py" -"vtkFiltersSources","PolyData/TubeFilter.py" -"vtkFiltersSources","Rendering/AmbientSpheres.py" -"vtkFiltersSources","Rendering/CameraBlur.py" -"vtkFiltersSources","Rendering/ColoredSphere.py" -"vtkFiltersSources","Rendering/Cone3.py" -"vtkFiltersSources","Rendering/Cone4.py" -"vtkFiltersSources","Rendering/DiffuseSpheres.py" -"vtkFiltersSources","Rendering/FlatVersusGouraud.py" -"vtkFiltersSources","Rendering/GradientBackground.py" -"vtkFiltersSources","Rendering/LayeredActors.py" -"vtkFiltersSources","Rendering/Mace.py" -"vtkFiltersSources","Rendering/Model.py" -"vtkFiltersSources","Rendering/OutlineGlowPass.py" -"vtkFiltersSources","Rendering/PBR_Anisotropy.py" -"vtkFiltersSources","Rendering/PBR_Clear_Coat.py" -"vtkFiltersSources","Rendering/PBR_Edge_Tint.py" -"vtkFiltersSources","Rendering/PBR_HDR_Environment.py" -"vtkFiltersSources","Rendering/PBR_Mapping.py" -"vtkFiltersSources","Rendering/PBR_Materials_Coat.py" -"vtkFiltersSources","Rendering/PBR_Materials.py" -"vtkFiltersSources","Rendering/PBR_Skybox_Anisotropy.py" -"vtkFiltersSources","Rendering/PBR_Skybox.py" -"vtkFiltersSources","Rendering/PBR_Skybox_Texturing.py" -"vtkFiltersSources","Rendering/Rotations.py" -"vtkFiltersSources","Rendering/Shadows.py" -"vtkFiltersSources","Rendering/SpecularSpheres.py" -"vtkFiltersSources","Rendering/StippledLine.py" -"vtkFiltersSources","Rendering/TransformSphere.py" -"vtkFiltersSources","Rendering/TransparentBackground.py" -"vtkFiltersSources","Texture/AnimateVectors.py" -"vtkFiltersSources","Texture/TextureCutQuadric.py" -"vtkFiltersSources","Texture/TextureCutSphere.py" -"vtkFiltersSources","Texture/TexturePlane.py" -"vtkFiltersSources","Tutorial/Tutorial_Step1.py" -"vtkFiltersSources","Tutorial/Tutorial_Step2.py" -"vtkFiltersSources","Tutorial/Tutorial_Step3.py" -"vtkFiltersSources","Tutorial/Tutorial_Step4.py" -"vtkFiltersSources","Tutorial/Tutorial_Step5.py" -"vtkFiltersSources","Tutorial/Tutorial_Step6.py" -"vtkFiltersSources","Utilities/Animation.py" -"vtkFiltersSources","Utilities/ColorMapToLUT.py" -"vtkFiltersSources","Utilities/JSONColorMapToLUT.py" -"vtkFiltersSources","Utilities/RescaleReverseLUT.py" -"vtkFiltersSources","Utilities/ResetCameraOrientation.py" -"vtkFiltersSources","Utilities/Screenshot.py" -"vtkFiltersSources","Utilities/ShareCamera.py" -"vtkFiltersSources","Utilities/XMLColorMapToLUT.py" -"vtkFiltersSources","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkFiltersSources","VisualizationAlgorithms/BluntStreamlines.py" -"vtkFiltersSources","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkFiltersSources","VisualizationAlgorithms/CarotidFlow.py" -"vtkFiltersSources","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkFiltersSources","VisualizationAlgorithms/Cutter.py" -"vtkFiltersSources","VisualizationAlgorithms/ExponentialCosine.py" -"vtkFiltersSources","VisualizationAlgorithms/HyperStreamline.py" -"vtkFiltersSources","VisualizationAlgorithms/LOxGrid.py" -"vtkFiltersSources","VisualizationAlgorithms/LOx.py" -"vtkFiltersSources","VisualizationAlgorithms/LOxSeeds.py" -"vtkFiltersSources","VisualizationAlgorithms/MarchingCases.py" -"vtkFiltersSources","VisualizationAlgorithms/Office.py" -"vtkFiltersSources","VisualizationAlgorithms/ProbeCombustor.py" -"vtkFiltersSources","VisualizationAlgorithms/SingleSplat.py" -"vtkFiltersSources","VisualizationAlgorithms/SpikeFran.py" -"vtkFiltersSources","VisualizationAlgorithms/TensorAxes.py" -"vtkFiltersSources","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkFiltersSources","Visualization/AssignCellColorsFromLUT.py" -"vtkFiltersSources","Visualization/BillboardTextActor3D.py" -"vtkFiltersSources","Visualization/CameraModel1.py" -"vtkFiltersSources","Visualization/CameraModel2.py" -"vtkFiltersSources","Visualization/Camera.py" -"vtkFiltersSources","Visualization/ClampGlyphSizes.py" -"vtkFiltersSources","Visualization/CollisionDetection.py" -"vtkFiltersSources","Visualization/ColorAnActor.py" -"vtkFiltersSources","Visualization/ColoredAnnotatedCube.py" -"vtkFiltersSources","Visualization/CreateColorSeriesDemo.py" -"vtkFiltersSources","Visualization/CubeAxesActor.py" -"vtkFiltersSources","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFiltersSources","Visualization/DisplayCoordinateAxes.py" -"vtkFiltersSources","Visualization/ElevationBandsWithGlyphs.py" -"vtkFiltersSources","Visualization/FrogSlice.py" -"vtkFiltersSources","Visualization/GlyphTable.py" -"vtkFiltersSources","Visualization/Hanoi.py" -"vtkFiltersSources","Visualization/HardwareSelector.py" -"vtkFiltersSources","Visualization/Kitchen.py" -"vtkFiltersSources","Visualization/LoopShrink.py" -"vtkFiltersSources","Visualization/MultipleRenderWindows.py" -"vtkFiltersSources","Visualization/MultipleViewports.py" -"vtkFiltersSources","Visualization/NamedColors.py" -"vtkFiltersSources","Visualization/OrientedGlyphs.py" -"vtkFiltersSources","Visualization/PointDataSubdivision.py" -"vtkFiltersSources","Visualization/PointSize.py" -"vtkFiltersSources","Visualization/ProgrammableGlyphFilter.py" -"vtkFiltersSources","Visualization/ProgrammableGlyphs.py" -"vtkFiltersSources","Visualization/ShadowsLightsDemo.py" -"vtkFiltersSources","Visualization/SphereTexture.py" -"vtkFiltersSources","Visualization/StreamLines.py" -"vtkFiltersSources","Visualization/TextSource.py" -"vtkFiltersSources","Visualization/WindowTitle.py" -"vtkFiltersSources","Widgets/BalloonWidget.py" -"vtkFiltersSources","Widgets/BoxWidget.py" -"vtkFiltersSources","Widgets/EmbedInPyQt2.py" -"vtkFiltersSources","Widgets/EmbedInPyQt.py" -"vtkFiltersSources","Widgets/ImplicitPlaneWidget2.py" -"vtkFiltersSources","Widgets/OrientationMarkerWidget1.py" -"vtkFiltersSources","Widgets/OrientationMarkerWidget.py" -"vtkFiltersSources","Widgets/SplineWidget.py" -"vtkFiltersSources","Widgets/TextWidget.py" -"vtkFiltersTexture","Rendering/PBR_Anisotropy.py" -"vtkFiltersTexture","Texture/TextureCutQuadric.py" -"vtkFiltersTexture","Texture/TextureCutSphere.py" -"vtkFiltersTexture","Texture/TextureThreshold.py" -"vtkFiltersTexture","VisualizationAlgorithms/Motor.py" -"vtkFiltersTexture","Visualization/SphereTexture.py" -"vtkFixedPointVolumeRayCastMapper","Medical/MedicalDemo4.py" -"vtkFixedPointVolumeRayCastMapper","Utilities/VTKWithNumpy.py" -"vtkFixedPointVolumeRayCastMapper","VolumeRendering/SimpleRayCast.py" -"vtkFloatArray","CompositeData/OverlappingAMR.py" -"vtkFloatArray","GeometricObjects/Cube.py" -"vtkFloatArray","Graphs/ScaleVertices.py" -"vtkFloatArray","Meshes/ClipDataSetWithPolyData1.py" -"vtkFloatArray","Meshes/ClipDataSetWithPolyData.py" -"vtkFloatArray","Modelling/Finance.py" -"vtkFloatArray","Plotting/MultiplePlots.py" -"vtkFloatArray","Plotting/ScatterPlot.py" -"vtkFloatArray","Plotting/SpiderPlot.py" -"vtkFloatArray","Plotting/SurfacePlot.py" -"vtkFloatArray","PolyData/CurvaturesAdjustEdges.py" -"vtkFloatArray","PolyData/ImplicitPolyDataDistance.py" -"vtkFloatArray","Rendering/PBR_Skybox_Anisotropy.py" -"vtkFloatArray","Rendering/PBR_Skybox.py" -"vtkFloatArray","Rendering/PBR_Skybox_Texturing.py" -"vtkFloatArray","VisualizationAlgorithms/MarchingCases.py" -"vtkFloatArray","VisualizationAlgorithms/Motor.py" -"vtkFloatArray","Visualization/CreateColorSeriesDemo.py" -"vtkFloatArray","Visualization/CurvatureBandsWithGlyphs.py" -"vtkFloatArray","Visualization/ElevationBandsWithGlyphs.py" -"vtkFlyingEdges2D","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkFlyingEdges3D","DataManipulation/MeshLabelImageColor.py" -"vtkFlyingEdges3D","Medical/MedicalDemo1.py" -"vtkFlyingEdges3D","Medical/MedicalDemo2.py" -"vtkFlyingEdges3D","Medical/MedicalDemo3.py" -"vtkFlyingEdges3D","Medical/TissueLens.py" -"vtkFlyingEdges3D","Modelling/ExtractLargestIsosurface.py" -"vtkFlyingEdges3D","Modelling/MarchingCubes.py" -"vtkFlyingEdges3D","VisualizationAlgorithms/HeadBone.py" -"vtkFlyingEdges3D","Visualization/FrogBrain.py" -"vtkFlyingEdges3D","Visualization/FroggieSurface.py" -"vtkFlyingEdges3D","Visualization/IsosurfaceSampling.py" -"vtkFollower","Annotation/TextOrigin.py" -"vtkFollower","Modelling/FinanceFieldData.py" -"vtkFollower","VisualizationAlgorithms/Stocks.py" -"vtkForceDirectedLayoutStrategy","Graphs/ConstructGraph.py" -"vtkForceDirectedLayoutStrategy","Graphs/EdgeWeights.py" -"vtkForceDirectedLayoutStrategy","Graphs/RandomGraphSource.py" -"vtkForceDirectedLayoutStrategy","Graphs/ScaleVertices.py" -"vtkFrustumSource","GeometricObjects/Frustum.py" -"vtkGaussianKernel","Meshes/PointInterpolator.py" -"vtkGaussianSplatter","Filtering/GaussianSplat.py" -"vtkGaussianSplatter","Modelling/FinanceFieldData.py" -"vtkGaussianSplatter","Modelling/Finance.py" -"vtkGaussianSplatter","VisualizationAlgorithms/SingleSplat.py" -"vtkGaussianSplatter","VisualizationAlgorithms/SplatFace.py" -"vtkGenericCell","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkGenericCell","GeometricObjects/QuadraticTetraDemo.py" -"vtkGenericCell","IO/ReadLegacyUnstructuredGrid.py" -"vtkGeoAssignCoordinates","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkGeoGraticule","Deprecated/Geovis/GeoGraticle.py" -"vtkGeometryFilter","Medical/GenerateCubesFromLabels.py" -"vtkGeometryFilter","Medical/GenerateModelsFromLabels.py" -"vtkGeometryFilter","Visualization/Blow.py" -"vtkGeoProjection","Deprecated/Geovis/GeoGraticle.py" -"vtkGeoTransform","Deprecated/Geovis/GeoGraticle.py" -"vtkGeovisCore","Widgets/CompassWidget.py" -"vtkGlyph2D","Filtering/Glyph2D.py" -"vtkGlyph3D","Filtering/Glyph3D.py" -"vtkGlyph3D","GeometricObjects/ParametricObjectsDemo.py" -"vtkGlyph3D","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkGlyph3D","GeometricObjects/QuadraticHexahedron.py" -"vtkGlyph3D","GeometricObjects/QuadraticTetraDemo.py" -"vtkGlyph3D","GeometricObjects/QuadraticTetra.py" -"vtkGlyph3D","Graphs/VisualizeDirectedGraph.py" -"vtkGlyph3DMapper","Filtering/AppendFilter.py" -"vtkGlyph3DMapper","GeometricObjects/ConvexPointSet.py" -"vtkGlyph3DMapper","GeometricObjects/IsoparametricCellsDemo.py" -"vtkGlyph3DMapper","GeometricObjects/LinearCellsDemo.py" -"vtkGlyph3DMapper","Interaction/InteractorStyleTrackballCamera.py" -"vtkGlyph3DMapper","IO/ReadLegacyUnstructuredGrid.py" -"vtkGlyph3D","Modelling/DelaunayMesh.py" -"vtkGlyph3D","Rendering/CameraBlur.py" -"vtkGlyph3D","Rendering/Mace.py" -"vtkGlyph3D","Texture/AnimateVectors.py" -"vtkGlyph3D","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkGlyph3D","VisualizationAlgorithms/MarchingCases.py" -"vtkGlyph3D","VisualizationAlgorithms/SpikeFran.py" -"vtkGlyph3D","Visualization/ClampGlyphSizes.py" -"vtkGlyph3D","Visualization/CurvatureBandsWithGlyphs.py" -"vtkGlyph3D","Visualization/ElevationBandsWithGlyphs.py" -"vtkGlyph3D","Visualization/GlyphTable.py" -"vtkGlyph3D","Visualization/OrientedGlyphs.py" -"vtkGlyph3D","Visualization/PointDataSubdivision.py" -"vtkGlyphSource2D","Graphs/VisualizeDirectedGraph.py" -"vtkGraphLayout","Graphs/VisualizeDirectedGraph.py" -"vtkGraphLayoutView","Graphs/ColorEdges.py" -"vtkGraphLayoutView","Graphs/ColorVertexLabels.py" -"vtkGraphLayoutView","Graphs/ColorVerticesLookupTable.py" -"vtkGraphLayoutView","Graphs/ConstructGraph.py" -"vtkGraphLayoutView","Graphs/ConstructTree.py" -"vtkGraphLayoutView","Graphs/CreateTree.py" -"vtkGraphLayoutView","Graphs/EdgeWeights.py" -"vtkGraphLayoutView","Graphs/LabelVerticesAndEdges.py" -"vtkGraphLayoutView","Graphs/RandomGraphSource.py" -"vtkGraphLayoutView","Graphs/ScaleVertices.py" -"vtkGraphLayoutView","Graphs/SelectedVerticesAndEdges.py" -"vtkGraphLayoutView","Graphs/SideBySideGraphs.py" -"vtkGraphLayoutView","Graphs/VisualizeDirectedGraph.py" -"vtkGraphLayoutView","Graphs/VisualizeGraph.py" -"vtkGraphLayoutView","InfoVis/SelectedGraphIDs.py" -"vtkGraphMapper","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtk","Graphs/NOVCAGraph.py" -"vtkGraphToGlyphs","Graphs/ScaleVertices.py" -"vtkGraphToPolyData","Graphs/GraphToPolyData.py" -"vtkGraphToPolyData","Graphs/VisualizeDirectedGraph.py" -"vtkHardwareSelector","Visualization/HardwareSelector.py" -"vtkHausdorffDistancePointSetFilter","PolyData/AlignTwoPolyDatas.py" -"vtkhdf","IO/TransientHDFReader.py" -"vtkHDFReader","IO/TransientHDFReader.py" -"vtkHDRReader","IO/HDRReader.py" -"vtkHDRReader","Rendering/PBR_Anisotropy.py" -"vtkHDRReader","Rendering/PBR_Clear_Coat.py" -"vtkHDRReader","Rendering/PBR_Edge_Tint.py" -"vtkHDRReader","Rendering/PBR_HDR_Environment.py" -"vtkHDRReader","Rendering/PBR_Mapping.py" -"vtkHDRReader","Rendering/PBR_Materials_Coat.py" -"vtkHDRReader","Rendering/PBR_Materials.py" -"vtkHDRReader","Rendering/PBR_Skybox_Anisotropy.py" -"vtkHDRReader","Rendering/PBR_Skybox.py" -"vtkHDRReader","Rendering/PBR_Skybox_Texturing.py" -"vtk_headers_modules","Utilities/VTKModulesForCxx.py" -"vtkHedgeHog","StructuredGrid/SGrid.py" -"vtkHedgeHog","Visualization/ComplexV.py" -"vtkHexagonalPrism","GeometricObjects/Cell3DDemonstration.py" -"vtkHexagonalPrism","GeometricObjects/LinearCellsDemo.py" -"vtkHexagonalPrism","IO/WriteLegacyLinearCells.py" -"vtkHexagonalPrism","IO/WriteXMLLinearCells.py" -"vtkHexahedron","GeometricObjects/Cell3DDemonstration.py" -"vtkHexahedron","GeometricObjects/Hexahedron.py" -"vtkHexahedron","GeometricObjects/LinearCellsDemo.py" -"vtkHexahedron","IO/WriteLegacyLinearCells.py" -"vtkHexahedron","IO/WriteXMLLinearCells.py" -"vtkHexahedron","VisualizationAlgorithms/DataSetSurface.py" -"vtkHull","GeometricObjects/Planes.py" -"vtkHyperStreamline","VisualizationAlgorithms/HyperStreamline.py" -"vtkHyperTreeGridSource","HyperTreeGrid/HyperTreeGridSource.py" -"vtkHyperTreeGridToUnstructuredGrid","HyperTreeGrid/HyperTreeGridSource.py" -"vtkIdFilter","PolyData/CurvaturesAdjustEdges.py" -"vtkIdFilter","PolyData/CurvaturesDemo.py" -"vtkIdFilter","PolyData/Curvatures.py" -"vtkIdFilter","Visualization/CurvatureBandsWithGlyphs.py" -"vtkIdList","GeometricObjects/Cell3DDemonstration.py" -"vtkIdList","GeometricObjects/Cube.py" -"vtkIdList","GeometricObjects/Polyhedron.py" -"vtkIdList","PolyData/CurvaturesAdjustEdges.py" -"vtkIdList","PolyData/CurvaturesDemo.py" -"vtkIdList","PolyData/Curvatures.py" -"vtkIdList","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkIdList","PolyData/IterateOverLines.py" -"vtkIdList","VisualizationAlgorithms/MarchingCases.py" -"vtkIdList","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkIdList","VisualizationAlgorithms/PineRootDecimation.py" -"vtkIdList","Visualization/CurvatureBandsWithGlyphs.py" -"vtkIdTypeArray","Picking/CellPicking.py" -"vtkIdTypeArray","PolyData/ExtractSelection.py" -"vtkIdTypeArray","PolyData/ExtractSelectionUsingCells.py" -"vtkIdType","GeometricObjects/Cube.py" -"vtkIdType","PolyData/PolyDataContourToImageData.py" -"vtkImageAccumulate","Medical/GenerateModelsFromLabels.py" -"vtkImageActor","ImageData/ImageNormalize.py" -"vtkImageActor","ImageData/ImageWeightedSum.py" -"vtkImageActor","ImageProcessing/Attenuation.py" -"vtkImageActor","ImageProcessing/EnhanceEdges.py" -"vtkImageActor","ImageProcessing/GaussianSmooth.py" -"vtkImageActor","ImageProcessing/HybridMedianComparison.py" -"vtkImageActor","ImageProcessing/IdealHighPass.py" -"vtkImageActor","ImageProcessing/MedianComparison.py" -"vtkImageActor","ImageProcessing/MorphologyComparison.py" -"vtkImageActor","ImageProcessing/Pad.py" -"vtkImageActor","ImageProcessing/VTKSpectrum.py" -"vtkImageActor","Images/BackgroundImage.py" -"vtkImageActor","Images/Cast.py" -"vtkImageActor","Medical/MedicalDemo3.py" -"vtkImageAppend","PolyData/PolyDataToImageDataStencil.py" -"vtkImageButterworthHighPass","ImageProcessing/IdealHighPass.py" -"vtkImageCanvasSource2D","ImageData/ImageDataGeometryFilter.py" -"vtkImageCanvasSource2D","Images/BackgroundImage.py" -"vtkImageCast","ImageData/ImageNormalize.py" -"vtkImageCast","ImageData/ImageWeightedSum.py" -"vtkImageCast","ImageProcessing/Attenuation.py" -"vtkImageCast","ImageProcessing/EnhanceEdges.py" -"vtkImageCast","ImageProcessing/GaussianSmooth.py" -"vtkImageCast","ImageProcessing/HybridMedianComparison.py" -"vtkImageCast","ImageProcessing/MedianComparison.py" -"vtkImageCast","Images/Cast.py" -"vtkImageCast","VisualizationAlgorithms/ImageGradient.py" -"vtkImageConstantPad","ImageProcessing/Pad.py" -"vtkImageConstantPad","VisualizationAlgorithms/ImageGradient.py" -"vtkImageConstantPad","Visualization/FrogSlice.py" -"vtkImageDataGeometryFilter","ImageData/ImageDataGeometryFilter.py" -"vtkImageDataGeometryFilter","ImageData/WriteReadVtkImageData.py" -"vtkImageDataGeometryFilter","Images/ImageWarp.py" -"vtkImageDataGeometryFilter","VisualizationAlgorithms/CreateBFont.py" -"vtkImageDataGeometryFilter","VisualizationAlgorithms/HyperStreamline.py" -"vtkImageDataGeometryFilter","VisualizationAlgorithms/TensorAxes.py" -"vtkImageDataGeometryFilter","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkImageData","ImageData/SumVTKImages.py" -"vtkImageData","ImageData/WriteReadVtkImageData.py" -"vtkImageData","ImageProcessing/HybridMedianComparison.py" -"vtkImageData","ImageProcessing/MedianComparison.py" -"vtkImageData","IO/PolyDataToImageDataConverter.py" -"vtkImageData","Meshes/PointInterpolator.py" -"vtkImageData","Modelling/DiscreteMarchingCubes.py" -"vtkImageData","Modelling/MarchingCubes.py" -"vtkImageData","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImageData","PolyData/PolyDataContourToImageData.py" -"vtkImageData","Rendering/StippledLine.py" -"vtkImageData","Visualization/ClampGlyphSizes.py" -"vtkImageData","Visualization/GlyphTable.py" -"vtkImageData","Visualization/SphereTexture.py" -"vtkImageData","VolumeRendering/PseudoVolumeRendering.py" -"vtk","ImageData/WriteReadVtkImageData.py" -"vtkImageDilateErode3D","ImageProcessing/MorphologyComparison.py" -"vtkImageEuclideanToPolar","VisualizationAlgorithms/ImageGradient.py" -"vtkImageExtractComponents","ImageProcessing/IdealHighPass.py" -"vtkImageExtractComponents","VisualizationAlgorithms/ImageGradient.py" -"vtkImageFFT","ImageProcessing/IdealHighPass.py" -"vtkImageFFT","ImageProcessing/VTKSpectrum.py" -"vtkImageFlip","Rendering/PBR_Anisotropy.py" -"vtkImageFlip","Rendering/PBR_Clear_Coat.py" -"vtkImageFlip","Rendering/PBR_Edge_Tint.py" -"vtkImageFlip","Rendering/PBR_HDR_Environment.py" -"vtkImageFlip","Rendering/PBR_Mapping.py" -"vtkImageFlip","Rendering/PBR_Materials_Coat.py" -"vtkImageFlip","Rendering/PBR_Materials.py" -"vtkImageFlip","Rendering/PBR_Skybox_Anisotropy.py" -"vtkImageFlip","Rendering/PBR_Skybox.py" -"vtkImageFlip","Rendering/PBR_Skybox_Texturing.py" -"vtkImageFourierCenter","ImageProcessing/VTKSpectrum.py" -"vtkImageGaussianSmooth","ImageProcessing/Attenuation.py" -"vtkImageGaussianSmooth","ImageProcessing/GaussianSmooth.py" -"vtkImageGaussianSmooth","ImageProcessing/IsoSubsample.py" -"vtkImageGaussianSmooth","ImageProcessing/MedianComparison.py" -"vtkImageGaussianSmooth","VisualizationAlgorithms/CreateBFont.py" -"vtkImageGaussianSmooth","VisualizationAlgorithms/ImageGradient.py" -"vtkImageGaussianSmooth","Visualization/FrogBrain.py" -"vtkImageGaussianSmooth","Visualization/FroggieSurface.py" -"vtkImageGradient","InfoVis/ParallelCoordinatesExtraction.py" -"vtkImageGradient","InfoVis/ParallelCoordinatesView.py" -"vtkImageGradient","VisualizationAlgorithms/ImageGradient.py" -"vtkImageGradient","Visualization/ClampGlyphSizes.py" -"vtkImageGradient","Visualization/GlyphTable.py" -"vtkImageHSVToRGB","VisualizationAlgorithms/ImageGradient.py" -"vtkImageHybridMedian2D","ImageProcessing/HybridMedianComparison.py" -"vtkImageIdealHighPass","ImageProcessing/IdealHighPass.py" -"vtkImageImport","Utilities/VTKWithNumpy.py" -"vtkImageIslandRemoval2D","Visualization/FroggieSurface.py" -"vtkImageLaplacian","ImageProcessing/EnhanceEdges.py" -"vtkImageLogarithmicScale","ImageProcessing/VTKSpectrum.py" -"vtkImageLuminance","Images/ImageWarp.py" -"vtkImageMagnify","VisualizationAlgorithms/ImageGradient.py" -"vtkImageMagnitude","ImageProcessing/VTKSpectrum.py" -"vtkImageMandelbrotSource","ImageData/ImageWeightedSum.py" -"vtkImageMandelbrotSource","Images/Cast.py" -"vtkImageMapper","VisualizationAlgorithms/ImageGradient.py" -"vtkImageMapToColors","ImageProcessing/VTKSpectrum.py" -"vtkImageMapToColors","Medical/MedicalDemo3.py" -"vtkImageMapToWindowLevelColors","ImageProcessing/EnhanceEdges.py" -"vtkImageMapToWindowLevelColors","ImageProcessing/IdealHighPass.py" -"vtkImageMapToWindowLevelColors","ImageProcessing/Pad.py" -"vtkImageMarchingCubes","ImageProcessing/IsoSubsample.py" -"vtkImageMathematics","ImageProcessing/Attenuation.py" -"vtkImageMathematics","ImageProcessing/EnhanceEdges.py" -"vtkImageMathematics","ImageProcessing/HybridMedianComparison.py" -"vtkImageMathematics","ImageProcessing/MedianComparison.py" -"vtkImageMathematics","Modelling/DiscreteMarchingCubes.py" -"vtkImageMathematics","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImageMedian3D","ImageProcessing/HybridMedianComparison.py" -"vtkImageMedian3D","ImageProcessing/MedianComparison.py" -"vtkImageMirrorPad","ImageProcessing/Pad.py" -"vtkImageNoiseSource","ImageProcessing/HybridMedianComparison.py" -"vtkImageNoiseSource","ImageProcessing/MedianComparison.py" -"vtkImageNormalize","ImageData/ImageNormalize.py" -"vtkImageReader2Factory","ImageProcessing/Attenuation.py" -"vtkImageReader2Factory","ImageProcessing/EnhanceEdges.py" -"vtkImageReader2Factory","ImageProcessing/GaussianSmooth.py" -"vtkImageReader2Factory","ImageProcessing/HybridMedianComparison.py" -"vtkImageReader2Factory","ImageProcessing/IdealHighPass.py" -"vtkImageReader2Factory","ImageProcessing/IsoSubsample.py" -"vtkImageReader2Factory","ImageProcessing/MedianComparison.py" -"vtkImageReader2Factory","ImageProcessing/MorphologyComparison.py" -"vtkImageReader2Factory","ImageProcessing/Pad.py" -"vtkImageReader2Factory","ImageProcessing/VTKSpectrum.py" -"vtkImageReader2Factory","Rendering/PBR_Anisotropy.py" -"vtkImageReader2Factory","Rendering/PBR_Clear_Coat.py" -"vtkImageReader2Factory","Rendering/PBR_Edge_Tint.py" -"vtkImageReader2Factory","Rendering/PBR_HDR_Environment.py" -"vtkImageReader2Factory","Rendering/PBR_Mapping.py" -"vtkImageReader2Factory","Rendering/PBR_Materials_Coat.py" -"vtkImageReader2Factory","Rendering/PBR_Materials.py" -"vtkImageReader2Factory","Rendering/PBR_Skybox_Anisotropy.py" -"vtkImageReader2Factory","Rendering/PBR_Skybox.py" -"vtkImageReader2Factory","Rendering/PBR_Skybox_Texturing.py" -"vtkImageReader2Factory","Texture/TexturePlane.py" -"vtkImageRFFT","ImageProcessing/IdealHighPass.py" -"vtkImageSeedConnectivity","ImageProcessing/MorphologyComparison.py" -"vtkImageShiftScale","ImageProcessing/Attenuation.py" -"vtkImageShiftScale","Texture/TexturePlane.py" -"vtkImageShrink3D","ImageProcessing/IsoSubsample.py" -"vtkImageShrink3D","Visualization/FroggieSurface.py" -"vtkImageSinusoidSource","ImageData/ImageNormalize.py" -"vtkImageSinusoidSource","ImageData/ImageWeightedSum.py" -"vtkImageStencil","IO/PolyDataToImageDataConverter.py" -"vtkImageStencil","PolyData/PolyDataContourToImageData.py" -"vtkImageStencil","PolyData/PolyDataToImageDataStencil.py" -"vtkImageThreshold","ImageProcessing/HybridMedianComparison.py" -"vtkImageThreshold","ImageProcessing/MedianComparison.py" -"vtkImageThreshold","Modelling/DiscreteMarchingCubes.py" -"vtkImageThreshold","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImageThreshold","Visualization/FrogBrain.py" -"vtkImageThreshold","Visualization/FroggieSurface.py" -"vtkImageViewer2","IO/ReadDICOM.py" -"vtkImageViewer2","IO/ReadDICOMSeries.py" -"vtkImageViewer2","VisualizationAlgorithms/ImageGradient.py" -"vtkImageViewer","IO/HDRReader.py" -"vtkImageViewer","PolyData/PolyDataToImageDataStencil.py" -"vtkImageViewer","VisualizationAlgorithms/ImageGradient.py" -"vtkImageWeightedSum","ImageData/ImageWeightedSum.py" -"vtkImageWeightedSum","ImageData/SumVTKImages.py" -"vtkImageWrapPad","Medical/GenerateCubesFromLabels.py" -"vtkImagingColor","ImageProcessing/EnhanceEdges.py" -"vtkImagingColor","ImageProcessing/IdealHighPass.py" -"vtkImagingColor","ImageProcessing/Pad.py" -"vtkImagingColor","Images/ImageWarp.py" -"vtkImagingColor","VisualizationAlgorithms/ImageGradient.py" -"vtkImagingCore","DataManipulation/MeshLabelImageColor.py" -"vtkImagingCore","ImageData/ImageNormalize.py" -"vtkImagingCore","ImageData/ImageWeightedSum.py" -"vtkImagingCore","ImageProcessing/Attenuation.py" -"vtkImagingCore","ImageProcessing/EnhanceEdges.py" -"vtkImagingCore","ImageProcessing/GaussianSmooth.py" -"vtkImagingCore","ImageProcessing/HybridMedianComparison.py" -"vtkImagingCore","ImageProcessing/IdealHighPass.py" -"vtkImagingCore","ImageProcessing/IsoSubsample.py" -"vtkImagingCore","ImageProcessing/MedianComparison.py" -"vtkImagingCore","ImageProcessing/Pad.py" -"vtkImagingCore","ImageProcessing/VTKSpectrum.py" -"vtkImagingCore","Images/Cast.py" -"vtkImagingCore","InfoVis/ParallelCoordinatesExtraction.py" -"vtkImagingCore","InfoVis/ParallelCoordinatesView.py" -"vtkImagingCore","Medical/GenerateCubesFromLabels.py" -"vtkImagingCore","Medical/MedicalDemo3.py" -"vtkImagingCore","Modelling/DiscreteMarchingCubes.py" -"vtkImagingCore","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImagingCore","Rendering/PBR_Anisotropy.py" -"vtkImagingCore","Rendering/PBR_Clear_Coat.py" -"vtkImagingCore","Rendering/PBR_Edge_Tint.py" -"vtkImagingCore","Rendering/PBR_HDR_Environment.py" -"vtkImagingCore","Rendering/PBR_Mapping.py" -"vtkImagingCore","Rendering/PBR_Materials_Coat.py" -"vtkImagingCore","Rendering/PBR_Materials.py" -"vtkImagingCore","Rendering/PBR_Skybox_Anisotropy.py" -"vtkImagingCore","Rendering/PBR_Skybox.py" -"vtkImagingCore","Rendering/PBR_Skybox_Texturing.py" -"vtkImagingCore","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkImagingCore","VisualizationAlgorithms/HeadSlice.py" -"vtkImagingCore","VisualizationAlgorithms/ImageGradient.py" -"vtkImagingCore","Visualization/ClampGlyphSizes.py" -"vtkImagingCore","Visualization/FrogBrain.py" -"vtkImagingCore","Visualization/FroggieSurface.py" -"vtkImagingCore","Visualization/FrogSlice.py" -"vtkImagingCore","Visualization/GlyphTable.py" -"vtkImagingCore","Visualization/QuadricVisualization.py" -"vtkImagingFourier","ImageProcessing/IdealHighPass.py" -"vtkImagingFourier","ImageProcessing/VTKSpectrum.py" -"vtkImagingGeneral","ImageData/ImageNormalize.py" -"vtkImagingGeneral","ImageProcessing/Attenuation.py" -"vtkImagingGeneral","ImageProcessing/EnhanceEdges.py" -"vtkImagingGeneral","ImageProcessing/GaussianSmooth.py" -"vtkImagingGeneral","ImageProcessing/HybridMedianComparison.py" -"vtkImagingGeneral","ImageProcessing/IsoSubsample.py" -"vtkImagingGeneral","ImageProcessing/MedianComparison.py" -"vtkImagingGeneral","InfoVis/ParallelCoordinatesExtraction.py" -"vtkImagingGeneral","InfoVis/ParallelCoordinatesView.py" -"vtkImagingGeneral","VisualizationAlgorithms/CreateBFont.py" -"vtkImagingGeneral","VisualizationAlgorithms/ImageGradient.py" -"vtkImagingGeneral","Visualization/ClampGlyphSizes.py" -"vtkImagingGeneral","Visualization/FrogBrain.py" -"vtkImagingGeneral","Visualization/FroggieSurface.py" -"vtkImagingGeneral","Visualization/GlyphTable.py" -"vtkImagingHybrid","Filtering/GaussianSplat.py" -"vtkImagingHybrid","Filtering/PerlinNoise.py" -"vtkImagingHybrid","ImageProcessing/Attenuation.py" -"vtkImagingHybrid","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkImagingHybrid","ImplicitFunctions/ImplicitQuadric.py" -"vtkImagingHybrid","ImplicitFunctions/ImplicitSphere1.py" -"vtkImagingHybrid","ImplicitFunctions/ImplicitSphere.py" -"vtkImagingHybrid","ImplicitFunctions/SampleFunction.py" -"vtkImagingHybrid","Modelling/DiscreteMarchingCubes.py" -"vtkImagingHybrid","Modelling/FinanceFieldData.py" -"vtkImagingHybrid","Modelling/Finance.py" -"vtkImagingHybrid","Modelling/MarchingCubes.py" -"vtkImagingHybrid","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImagingHybrid","Rendering/FlatVersusGouraud.py" -"vtkImagingHybrid","Texture/TextureCutQuadric.py" -"vtkImagingHybrid","VisualizationAlgorithms/ContourQuadric.py" -"vtkImagingHybrid","VisualizationAlgorithms/ExtractData.py" -"vtkImagingHybrid","VisualizationAlgorithms/HyperStreamline.py" -"vtkImagingHybrid","VisualizationAlgorithms/IceCream.py" -"vtkImagingHybrid","VisualizationAlgorithms/SingleSplat.py" -"vtkImagingHybrid","VisualizationAlgorithms/SplatFace.py" -"vtkImagingHybrid","VisualizationAlgorithms/TensorAxes.py" -"vtkImagingHybrid","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkImagingHybrid","Visualization/DisplayQuadricSurfaces.py" -"vtkImagingHybrid","Visualization/IsosurfaceSampling.py" -"vtkImagingHybrid","Visualization/QuadricVisualization.py" -"vtkImagingMath","ImageData/ImageWeightedSum.py" -"vtkImagingMath","ImageData/SumVTKImages.py" -"vtkImagingMath","ImageProcessing/Attenuation.py" -"vtkImagingMath","ImageProcessing/EnhanceEdges.py" -"vtkImagingMath","ImageProcessing/HybridMedianComparison.py" -"vtkImagingMath","ImageProcessing/MedianComparison.py" -"vtkImagingMath","ImageProcessing/VTKSpectrum.py" -"vtkImagingMath","Modelling/DiscreteMarchingCubes.py" -"vtkImagingMath","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkImagingMorphological","ImageProcessing/MorphologyComparison.py" -"vtkImagingMorphological","Visualization/FroggieSurface.py" -"vtkImagingSources","ImageData/ImageDataGeometryFilter.py" -"vtkImagingSources","ImageData/ImageNormalize.py" -"vtkImagingSources","ImageData/ImageWeightedSum.py" -"vtkImagingSources","ImageProcessing/HybridMedianComparison.py" -"vtkImagingSources","ImageProcessing/MedianComparison.py" -"vtkImagingSources","Images/BackgroundImage.py" -"vtkImagingSources","Images/Cast.py" -"vtkImagingStatistics","Medical/GenerateModelsFromLabels.py" -"vtkImagingStencil","IO/PolyDataToImageDataConverter.py" -"vtkImagingStencil","PolyData/PolyDataContourToImageData.py" -"vtkImagingStencil","PolyData/PolyDataToImageDataStencil.py" -"vtkImplicitBoolean","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkImplicitBoolean","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkImplicitBoolean","VisualizationAlgorithms/ExtractData.py" -"vtkImplicitBoolean","VisualizationAlgorithms/IceCream.py" -"vtkImplicitDataSet","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkImplicitModeller","VisualizationAlgorithms/Hello.py" -"vtkImplicitModeller","Visualization/BlobbyLogo.py" -"vtkImplicitModeller","Visualization/CameraModel1.py" -"vtkImplicitModeller","Visualization/CameraModel2.py" -"vtkImplicitPlaneRepresentation","Widgets/ImplicitPlaneWidget2.py" -"vtkImplicitPlaneWidget2","Widgets/ImplicitPlaneWidget2.py" -"vtkImplicitPolyDataDistance","Meshes/ClipDataSetWithPolyData1.py" -"vtkImplicitPolyDataDistance","Meshes/ClipDataSetWithPolyData.py" -"vtkImplicitPolyDataDistance","PolyData/ImplicitPolyDataDistance.py" -"vtkImplicitTextureCoords","Texture/TextureCutQuadric.py" -"vtkImplicitTextureCoords","Texture/TextureCutSphere.py" -"vtkImplicitTextureCoords","VisualizationAlgorithms/Motor.py" -"vtk_include_pattern","Utilities/VTKModulesForCxx.py" -"vtkInfovisCore","Graphs/RandomGraphSource.py" -"vtkInfovisCore","Graphs/SelectedVerticesAndEdges.py" -"vtkInfovisCore","InfoVis/SelectedGraphIDs.py" -"vtkInfovisLayout","Graphs/ConstructGraph.py" -"vtkInfovisLayout","Graphs/EdgeWeights.py" -"vtkInfovisLayout","Graphs/LabelVerticesAndEdges.py" -"vtkInfovisLayout","Graphs/RandomGraphSource.py" -"vtkInfovisLayout","Graphs/ScaleVertices.py" -"vtkInfovisLayout","Graphs/VisualizeDirectedGraph.py" -"vtkInfovisLayout","InfoVis/SelectedGraphIDs.py" -"vtkIntArray","GeometricObjects/CellTypeSource.py" -"vtkIntArray","Graphs/ColorEdges.py" -"vtkIntArray","Graphs/ColorVertexLabels.py" -"vtkIntArray","Graphs/ColorVerticesLookupTable.py" -"vtkIntArray","Graphs/LabelVerticesAndEdges.py" -"vtkIntArray","Graphs/NOVCAGraph.py" -"vtkIntArray","Graphs/ScaleVertices.py" -"vtkIntArray","Visualization/KochSnowflake.py" -"vtkInteractionImage","IO/HDRReader.py" -"vtkInteractionImage","IO/ReadDICOM.py" -"vtkInteractionImage","IO/ReadDICOMSeries.py" -"vtkInteractionImage","PolyData/PolyDataToImageDataStencil.py" -"vtkInteractionImage","VisualizationAlgorithms/ImageGradient.py" -"vtkInteractionStyle","Annotation/MultiLineText.py" -"vtkInteractionStyle","Annotation/TextOrigin.py" -"vtkInteractionStyle","CompositeData/CompositePolyDataMapper.py" -"vtkInteractionStyle","CompositeData/MultiBlockDataSet.py" -"vtkInteractionStyle","CompositeData/OverlappingAMR.py" -"vtkInteractionStyle","DataManipulation/LineOnMesh.py" -"vtkInteractionStyle","DataManipulation/MeshLabelImageColor.py" -"vtkInteractionStyle","ExplicitStructuredGrid/CreateESGrid.py" -"vtkInteractionStyle","ExplicitStructuredGrid/LoadESGrid.py" -"vtkInteractionStyle","Filtering/AppendFilter.py" -"vtkInteractionStyle","Filtering/CombinePolyData.py" -"vtkInteractionStyle","Filtering/ConnectivityFilter.py" -"vtkInteractionStyle","Filtering/ConstrainedDelaunay2D.py" -"vtkInteractionStyle","Filtering/Delaunay2D.py" -"vtkInteractionStyle","Filtering/GaussianSplat.py" -"vtkInteractionStyle","Filtering/Glyph2D.py" -"vtkInteractionStyle","Filtering/Glyph3D.py" -"vtkInteractionStyle","Filtering/PerlinNoise.py" -"vtkInteractionStyle","Filtering/TransformPolyData.py" -"vtkInteractionStyle","Filtering/TriangulateTerrainMap.py" -"vtkInteractionStyle","Filtering/VertexGlyphFilter.py" -"vtkInteractionStyle","Filtering/WarpTo.py" -"vtkInteractionStyle","GeometricObjects/Arrow.py" -"vtkInteractionStyle","GeometricObjects/Axes.py" -"vtkInteractionStyle","GeometricObjects/Cell3DDemonstration.py" -"vtkInteractionStyle","GeometricObjects/CellTypeSource.py" -"vtkInteractionStyle","GeometricObjects/Circle.py" -"vtkInteractionStyle","GeometricObjects/ColoredLines.py" -"vtkInteractionStyle","GeometricObjects/Cone.py" -"vtkInteractionStyle","GeometricObjects/ConvexPointSet.py" -"vtkInteractionStyle","GeometricObjects/Cube1.py" -"vtkInteractionStyle","GeometricObjects/Cube.py" -"vtkInteractionStyle","GeometricObjects/CylinderExample.py" -"vtkInteractionStyle","GeometricObjects/Cylinder.py" -"vtkInteractionStyle","GeometricObjects/Disk.py" -"vtkInteractionStyle","GeometricObjects/Dodecahedron.py" -"vtkInteractionStyle","GeometricObjects/EarthSource.py" -"vtkInteractionStyle","GeometricObjects/EllipticalCylinderDemo.py" -"vtkInteractionStyle","GeometricObjects/EllipticalCylinder.py" -"vtkInteractionStyle","GeometricObjects/Frustum.py" -"vtkInteractionStyle","GeometricObjects/GeometricObjectsDemo.py" -"vtkInteractionStyle","GeometricObjects/Hexahedron.py" -"vtkInteractionStyle","GeometricObjects/IsoparametricCellsDemo.py" -"vtkInteractionStyle","GeometricObjects/LinearCellsDemo.py" -"vtkInteractionStyle","GeometricObjects/Line.py" -"vtkInteractionStyle","GeometricObjects/LongLine.py" -"vtkInteractionStyle","GeometricObjects/OrientedArrow.py" -"vtkInteractionStyle","GeometricObjects/OrientedCylinder.py" -"vtkInteractionStyle","GeometricObjects/ParametricKuenDemo.py" -"vtkInteractionStyle","GeometricObjects/ParametricObjectsDemo.py" -"vtkInteractionStyle","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkInteractionStyle","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkInteractionStyle","GeometricObjects/Plane.py" -"vtkInteractionStyle","GeometricObjects/PlanesIntersection.py" -"vtkInteractionStyle","GeometricObjects/Planes.py" -"vtkInteractionStyle","GeometricObjects/PlatonicSolids.py" -"vtkInteractionStyle","GeometricObjects/Point.py" -"vtkInteractionStyle","GeometricObjects/PolygonIntersection.py" -"vtkInteractionStyle","GeometricObjects/Polygon.py" -"vtkInteractionStyle","GeometricObjects/Polyhedron.py" -"vtkInteractionStyle","GeometricObjects/PolyLine1.py" -"vtkInteractionStyle","GeometricObjects/PolyLine.py" -"vtkInteractionStyle","GeometricObjects/Pyramid.py" -"vtkInteractionStyle","GeometricObjects/Quad.py" -"vtkInteractionStyle","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkInteractionStyle","GeometricObjects/QuadraticHexahedron.py" -"vtkInteractionStyle","GeometricObjects/QuadraticTetraDemo.py" -"vtkInteractionStyle","GeometricObjects/QuadraticTetra.py" -"vtkInteractionStyle","GeometricObjects/RegularPolygonSource.py" -"vtkInteractionStyle","GeometricObjects/ShrinkCube.py" -"vtkInteractionStyle","GeometricObjects/SourceObjectsDemo.py" -"vtkInteractionStyle","GeometricObjects/Sphere.py" -"vtkInteractionStyle","GeometricObjects/TessellatedBoxSource.py" -"vtkInteractionStyle","GeometricObjects/Tetrahedron.py" -"vtkInteractionStyle","GeometricObjects/TextActor.py" -"vtkInteractionStyle","GeometricObjects/Triangle.py" -"vtkInteractionStyle","GeometricObjects/TriangleStrip.py" -"vtkInteractionStyle","GeometricObjects/Vertex.py" -"vtkInteractionStyle","Graphs/ColorEdges.py" -"vtkInteractionStyle","Graphs/ColorVertexLabels.py" -"vtkInteractionStyle","Graphs/ColorVerticesLookupTable.py" -"vtkInteractionStyle","Graphs/ConstructGraph.py" -"vtkInteractionStyle","Graphs/ConstructTree.py" -"vtkInteractionStyle","Graphs/CreateTree.py" -"vtkInteractionStyle","Graphs/EdgeWeights.py" -"vtkInteractionStyle","Graphs/GraphToPolyData.py" -"vtkInteractionStyle","Graphs/LabelVerticesAndEdges.py" -"vtkInteractionStyle","Graphs/NOVCAGraph.py" -"vtkInteractionStyle","Graphs/RandomGraphSource.py" -"vtkInteractionStyle","Graphs/ScaleVertices.py" -"vtkInteractionStyle","Graphs/SelectedVerticesAndEdges.py" -"vtkInteractionStyle","Graphs/SideBySideGraphs.py" -"vtkInteractionStyle","Graphs/VisualizeDirectedGraph.py" -"vtkInteractionStyle","Graphs/VisualizeGraph.py" -"vtkInteractionStyle","HyperTreeGrid/HyperTreeGridSource.py" -"vtkInteractionStyle","ImageData/ImageDataGeometryFilter.py" -"vtkInteractionStyle","ImageData/ImageNormalize.py" -"vtkInteractionStyle","ImageData/ImageWeightedSum.py" -"vtkInteractionStyle","ImageData/WriteReadVtkImageData.py" -"vtkInteractionStyle","ImageProcessing/Attenuation.py" -"vtkInteractionStyle","ImageProcessing/EnhanceEdges.py" -"vtkInteractionStyle","ImageProcessing/GaussianSmooth.py" -"vtkInteractionStyle","ImageProcessing/HybridMedianComparison.py" -"vtkInteractionStyle","ImageProcessing/IdealHighPass.py" -"vtkInteractionStyle","ImageProcessing/IsoSubsample.py" -"vtkInteractionStyle","ImageProcessing/MedianComparison.py" -"vtkInteractionStyle","ImageProcessing/MorphologyComparison.py" -"vtkInteractionStyle","ImageProcessing/Pad.py" -"vtkInteractionStyle","ImageProcessing/VTKSpectrum.py" -"vtkInteractionStyle","Images/Actor2D.py" -"vtkInteractionStyle","Images/BackgroundImage.py" -"vtkInteractionStyle","Images/Cast.py" -"vtkInteractionStyle","Images/ImageWarp.py" -"vtkInteractionStyle","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkInteractionStyle","ImplicitFunctions/ImplicitQuadric.py" -"vtkInteractionStyle","ImplicitFunctions/ImplicitSphere1.py" -"vtkInteractionStyle","ImplicitFunctions/ImplicitSphere.py" -"vtkInteractionStyle","ImplicitFunctions/SampleFunction.py" -"vtkInteractionStyle","InfoVis/ParallelCoordinatesExtraction.py" -"vtkInteractionStyle","InfoVis/ParallelCoordinatesView.py" -"vtkInteractionStyle","InfoVis/SelectedGraphIDs.py" -"vtkInteractionStyle","Interaction/CallBack.py" -"vtkInteractionStyle","Interaction/InteractorStyleTrackballActor.py" -"vtkInteractionStyle","Interaction/InteractorStyleTrackballCamera.py" -"vtkInteractionStyle","Interaction/MouseEventsObserver.py" -"vtkInteractionStyle","Interaction/MouseEvents.py" -"vtkInteractionStyle","IO/3DSImporter.py" -"vtkInteractionStyle","IO/CSVReadEdit1.py" -"vtkInteractionStyle","IO/CSVReadEdit.py" -"vtkInteractionStyle","IO/ImageWriter.py" -"vtkInteractionStyle","IO/ReadDICOMSeries.py" -"vtkInteractionStyle","IO/ReadExodusData.py" -"vtkInteractionStyle","IO/ReadImageData.py" -"vtkInteractionStyle","IO/ReadLegacyUnstructuredGrid.py" -"vtkInteractionStyle","IO/ReadPLOT3D.py" -"vtkInteractionStyle","IO/ReadPolyData.py" -"vtkInteractionStyle","IO/ReadSLC.py" -"vtkInteractionStyle","IO/ReadSTL.py" -"vtkInteractionStyle","IO/ReadVTP.py" -"vtkInteractionStyle","IO/TransientHDFReader.py" -"vtkInteractionStyle","IO/WriteLegacyLinearCells.py" -"vtkInteractionStyle","IO/WritePLY.py" -"vtkInteractionStyle","IO/WriteSTL.py" -"vtkInteractionStyle","IO/WriteTriangleToFile.py" -"vtkInteractionStyle","IO/WriteXMLLinearCells.py" -"vtkInteractionStyle","Medical/GenerateCubesFromLabels.py" -"vtkInteractionStyle","Medical/GenerateModelsFromLabels.py" -"vtkInteractionStyle","Medical/MedicalDemo1.py" -"vtkInteractionStyle","Medical/MedicalDemo2.py" -"vtkInteractionStyle","Medical/MedicalDemo3.py" -"vtkInteractionStyle","Medical/MedicalDemo4.py" -"vtkInteractionStyle","Medical/TissueLens.py" -"vtkInteractionStyle","Meshes/BoundaryEdges.py" -"vtkInteractionStyle","Meshes/CapClip.py" -"vtkInteractionStyle","Meshes/ClipDataSetWithPolyData1.py" -"vtkInteractionStyle","Meshes/ClipDataSetWithPolyData.py" -"vtkInteractionStyle","Meshes/ColoredElevationMap.py" -"vtkInteractionStyle","Meshes/Decimation.py" -"vtkInteractionStyle","Meshes/DeformPointSet.py" -"vtkInteractionStyle","Meshes/PointInterpolator.py" -"vtkInteractionStyle","Meshes/SolidClip.py" -"vtkInteractionStyle","Modelling/Bottle.py" -"vtkInteractionStyle","Modelling/CappedSphere.py" -"vtkInteractionStyle","Modelling/ContourTriangulator.py" -"vtkInteractionStyle","Modelling/DelaunayMesh.py" -"vtkInteractionStyle","Modelling/DiscreteMarchingCubes.py" -"vtkInteractionStyle","Modelling/ExtractLargestIsosurface.py" -"vtkInteractionStyle","Modelling/FinanceFieldData.py" -"vtkInteractionStyle","Modelling/Finance.py" -"vtkInteractionStyle","Modelling/MarchingCubes.py" -"vtkInteractionStyle","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkInteractionStyle","Modelling/Spring.py" -"vtkInteractionStyle","Picking/CellPicking.py" -"vtkInteractionStyle","Picking/HighlightPickedActor.py" -"vtkInteractionStyle","Picking/HighlightWithSilhouette.py" -"vtkInteractionStyle","Plotting/MultiplePlots.py" -"vtkInteractionStyle","Plotting/ScatterPlot.py" -"vtkInteractionStyle","Plotting/SpiderPlot.py" -"vtkInteractionStyle","Plotting/SurfacePlot.py" -"vtkInteractionStyle","PolyData/AlignTwoPolyDatas.py" -"vtkInteractionStyle","PolyData/BooleanOperationPolyDataFilter.py" -"vtkInteractionStyle","PolyData/CellsInsideObject.py" -"vtkInteractionStyle","PolyData/ClosedSurface.py" -"vtkInteractionStyle","PolyData/CurvaturesAdjustEdges.py" -"vtkInteractionStyle","PolyData/CurvaturesDemo.py" -"vtkInteractionStyle","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkInteractionStyle","PolyData/ExtractSelection.py" -"vtkInteractionStyle","PolyData/ExtractSelectionUsingCells.py" -"vtkInteractionStyle","PolyData/FilledPolygon.py" -"vtkInteractionStyle","PolyData/ImplicitPolyDataDistance.py" -"vtkInteractionStyle","PolyData/IterateOverLines.py" -"vtkInteractionStyle","PolyData/Outline.py" -"vtkInteractionStyle","PolyData/PointSource.py" -"vtkInteractionStyle","PolyData/PolyDataContourToImageData.py" -"vtkInteractionStyle","PolyData/PolyDataToImageDataStencil.py" -"vtkInteractionStyle","PolyData/RotationAroundLine.py" -"vtkInteractionStyle","PolyData/RuledSurfaceFilter.py" -"vtkInteractionStyle","PolyData/SmoothMeshGrid.py" -"vtkInteractionStyle","PolyData/TriangleColoredPoints.py" -"vtkInteractionStyle","PolyData/TriangleCorners.py" -"vtkInteractionStyle","PolyData/TriangleCornerVertices.py" -"vtkInteractionStyle","PolyData/TubeFilter.py" -"vtkInteractionStyle","PolyData/WarpVector.py" -"vtkInteractionStyle","RectilinearGrid/RectilinearGrid.py" -"vtkInteractionStyle","RectilinearGrid/RGrid.py" -"vtkInteractionStyle","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkInteractionStyle","Rendering/AmbientSpheres.py" -"vtkInteractionStyle","Rendering/CameraBlur.py" -"vtkInteractionStyle","Rendering/ColoredSphere.py" -"vtkInteractionStyle","Rendering/Cone3.py" -"vtkInteractionStyle","Rendering/Cone4.py" -"vtkInteractionStyle","Rendering/DiffuseSpheres.py" -"vtkInteractionStyle","Rendering/FlatVersusGouraud.py" -"vtkInteractionStyle","Rendering/GradientBackground.py" -"vtkInteractionStyle","Rendering/LayeredActors.py" -"vtkInteractionStyle","Rendering/Mace.py" -"vtkInteractionStyle","Rendering/Model.py" -"vtkInteractionStyle","Rendering/MotionBlur.py" -"vtkInteractionStyle","Rendering/OutlineGlowPass.py" -"vtkInteractionStyle","Rendering/PBR_Anisotropy.py" -"vtkInteractionStyle","Rendering/PBR_Clear_Coat.py" -"vtkInteractionStyle","Rendering/PBR_Edge_Tint.py" -"vtkInteractionStyle","Rendering/PBR_HDR_Environment.py" -"vtkInteractionStyle","Rendering/PBR_Mapping.py" -"vtkInteractionStyle","Rendering/PBR_Materials_Coat.py" -"vtkInteractionStyle","Rendering/PBR_Materials.py" -"vtkInteractionStyle","Rendering/PBR_Skybox_Anisotropy.py" -"vtkInteractionStyle","Rendering/PBR_Skybox.py" -"vtkInteractionStyle","Rendering/PBR_Skybox_Texturing.py" -"vtkInteractionStyle","Rendering/Rainbow.py" -"vtkInteractionStyle","Rendering/Rotations.py" -"vtkInteractionStyle","Rendering/Shadows.py" -"vtkInteractionStyle","Rendering/SpecularSpheres.py" -"vtkInteractionStyle","Rendering/StippledLine.py" -"vtkInteractionStyle","Rendering/StripFran.py" -"vtkInteractionStyle","Rendering/TransformSphere.py" -"vtkInteractionStyle","Rendering/TransparentBackground.py" -"vtkInteractionStyle","Rendering/WalkCow.py" -"vtkInteractionStyle","StructuredGrid/BlankPoint.py" -"vtkInteractionStyle","StructuredGrid/SGrid.py" -"vtkInteractionStyle","StructuredPoints/Vol.py" -"vtkInteractionStyle","Texture/AnimateVectors.py" -"vtkInteractionStyle","Texture/TextureCutQuadric.py" -"vtkInteractionStyle","Texture/TextureCutSphere.py" -"vtkInteractionStyle","Texture/TexturePlane.py" -"vtkInteractionStyle","Texture/TextureThreshold.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step1.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step2.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step3.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step4.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step5.py" -"vtkInteractionStyle","Tutorial/Tutorial_Step6.py" -"vtkInteractionStyle","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkInteractionStyle","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkInteractionStyle","UnstructuredGrid/UGrid.py" -"vtkInteractionStyle","Utilities/Animation.py" -"vtkInteractionStyle","Utilities/ColorMapToLUT.py" -"vtkInteractionStyle","Utilities/JSONColorMapToLUT.py" -"vtkInteractionStyle","Utilities/LUTUtilities.py" -"vtkInteractionStyle","Utilities/RescaleReverseLUT.py" -"vtkInteractionStyle","Utilities/ResetCameraOrientation.py" -"vtkInteractionStyle","Utilities/SaveSceneToFieldData.py" -"vtkInteractionStyle","Utilities/SaveSceneToFile.py" -"vtkInteractionStyle","Utilities/Screenshot.py" -"vtkInteractionStyle","Utilities/ShareCamera.py" -"vtkInteractionStyle","Utilities/VTKImportsForPython.py" -"vtkInteractionStyle","Utilities/VTKWithNumpy.py" -"vtkInteractionStyle","Utilities/XMLColorMapToLUT.py" -"vtkInteractionStyle","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkInteractionStyle","VisualizationAlgorithms/BluntStreamlines.py" -"vtkInteractionStyle","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkInteractionStyle","VisualizationAlgorithms/CarotidFlow.py" -"vtkInteractionStyle","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkInteractionStyle","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkInteractionStyle","VisualizationAlgorithms/ContourQuadric.py" -"vtkInteractionStyle","VisualizationAlgorithms/CreateBFont.py" -"vtkInteractionStyle","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkInteractionStyle","VisualizationAlgorithms/Cutter.py" -"vtkInteractionStyle","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkInteractionStyle","VisualizationAlgorithms/CutWithScalars.py" -"vtkInteractionStyle","VisualizationAlgorithms/DataSetSurface.py" -"vtkInteractionStyle","VisualizationAlgorithms/DecimateFran.py" -"vtkInteractionStyle","VisualizationAlgorithms/DecimateHawaii.py" -"vtkInteractionStyle","VisualizationAlgorithms/DisplacementPlot.py" -"vtkInteractionStyle","VisualizationAlgorithms/ExponentialCosine.py" -"vtkInteractionStyle","VisualizationAlgorithms/ExtractData.py" -"vtkInteractionStyle","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkInteractionStyle","VisualizationAlgorithms/HeadBone.py" -"vtkInteractionStyle","VisualizationAlgorithms/HeadSlice.py" -"vtkInteractionStyle","VisualizationAlgorithms/Hello.py" -"vtkInteractionStyle","VisualizationAlgorithms/HyperStreamline.py" -"vtkInteractionStyle","VisualizationAlgorithms/IceCream.py" -"vtkInteractionStyle","VisualizationAlgorithms/ImageGradient.py" -"vtkInteractionStyle","VisualizationAlgorithms/IronIsoSurface.py" -"vtkInteractionStyle","VisualizationAlgorithms/LOxGrid.py" -"vtkInteractionStyle","VisualizationAlgorithms/LOx.py" -"vtkInteractionStyle","VisualizationAlgorithms/LOxSeeds.py" -"vtkInteractionStyle","VisualizationAlgorithms/MarchingCases.py" -"vtkInteractionStyle","VisualizationAlgorithms/Motor.py" -"vtkInteractionStyle","VisualizationAlgorithms/Office.py" -"vtkInteractionStyle","VisualizationAlgorithms/OfficeTube.py" -"vtkInteractionStyle","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkInteractionStyle","VisualizationAlgorithms/PineRootDecimation.py" -"vtkInteractionStyle","VisualizationAlgorithms/PlateVibration.py" -"vtkInteractionStyle","VisualizationAlgorithms/ProbeCombustor.py" -"vtkInteractionStyle","VisualizationAlgorithms/SingleSplat.py" -"vtkInteractionStyle","VisualizationAlgorithms/SpikeFran.py" -"vtkInteractionStyle","VisualizationAlgorithms/SplatFace.py" -"vtkInteractionStyle","VisualizationAlgorithms/Stocks.py" -"vtkInteractionStyle","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkInteractionStyle","VisualizationAlgorithms/TensorAxes.py" -"vtkInteractionStyle","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkInteractionStyle","VisualizationAlgorithms/VelocityProfile.py" -"vtkInteractionStyle","VisualizationAlgorithms/WarpCombustor.py" -"vtkInteractionStyle","Visualization/AlphaFrequency.py" -"vtkInteractionStyle","Visualization/AnnotatedCubeActor.py" -"vtkInteractionStyle","Visualization/AssignCellColorsFromLUT.py" -"vtkInteractionStyle","Visualization/BillboardTextActor3D.py" -"vtkInteractionStyle","Visualization/BlobbyLogo.py" -"vtkInteractionStyle","Visualization/Blow.py" -"vtkInteractionStyle","Visualization/CameraModel1.py" -"vtkInteractionStyle","Visualization/CameraModel2.py" -"vtkInteractionStyle","Visualization/Camera.py" -"vtkInteractionStyle","Visualization/ClampGlyphSizes.py" -"vtkInteractionStyle","Visualization/CollisionDetection.py" -"vtkInteractionStyle","Visualization/ColorAnActor.py" -"vtkInteractionStyle","Visualization/ColoredAnnotatedCube.py" -"vtkInteractionStyle","Visualization/ComplexV.py" -"vtkInteractionStyle","Visualization/CreateColorSeriesDemo.py" -"vtkInteractionStyle","Visualization/CubeAxesActor.py" -"vtkInteractionStyle","Visualization/CurvatureBandsWithGlyphs.py" -"vtkInteractionStyle","Visualization/DisplayCoordinateAxes.py" -"vtkInteractionStyle","Visualization/DisplayQuadricSurfaces.py" -"vtkInteractionStyle","Visualization/ElevationBandsWithGlyphs.py" -"vtkInteractionStyle","Visualization/FrogBrain.py" -"vtkInteractionStyle","Visualization/FroggieSurface.py" -"vtkInteractionStyle","Visualization/FroggieView.py" -"vtkInteractionStyle","Visualization/FrogSlice.py" -"vtkInteractionStyle","Visualization/GlyphTable.py" -"vtkInteractionStyle","Visualization/Hanoi.py" -"vtkInteractionStyle","Visualization/HardwareSelector.py" -"vtkInteractionStyle","Visualization/Hawaii.py" -"vtkInteractionStyle","Visualization/IsosurfaceSampling.py" -"vtkInteractionStyle","Visualization/Kitchen.py" -"vtkInteractionStyle","Visualization/KochSnowflake.py" -"vtkInteractionStyle","Visualization/LoopShrink.py" -"vtkInteractionStyle","Visualization/Lorenz.py" -"vtkInteractionStyle","Visualization/MultipleRenderWindows.py" -"vtkInteractionStyle","Visualization/MultipleViewports.py" -"vtkInteractionStyle","Visualization/NamedColors.py" -"vtkInteractionStyle","Visualization/NormalsDemo.py" -"vtkInteractionStyle","Visualization/OrientedGlyphs.py" -"vtkInteractionStyle","Visualization/PointDataSubdivision.py" -"vtkInteractionStyle","Visualization/PointSize.py" -"vtkInteractionStyle","Visualization/ProgrammableGlyphFilter.py" -"vtkInteractionStyle","Visualization/ProgrammableGlyphs.py" -"vtkInteractionStyle","Visualization/QuadricVisualization.py" -"vtkInteractionStyle","Visualization/ShadowsLightsDemo.py" -"vtkInteractionStyle","Visualization/SphereTexture.py" -"vtkInteractionStyle","Visualization/StreamLines.py" -"vtkInteractionStyle","Visualization/TextSource.py" -"vtkInteractionStyle","Visualization/VectorText.py" -"vtkInteractionStyle","Visualization/WindowTitle.py" -"vtkInteractionStyle","VolumeRendering/PseudoVolumeRendering.py" -"vtkInteractionStyle","VolumeRendering/SimpleRayCast.py" -"vtkInteractionStyle","Widgets/BalloonWidget.py" -"vtkInteractionStyle","Widgets/BoxWidget.py" -"vtkInteractionStyle","Widgets/CameraOrientationWidget.py" -"vtkInteractionStyle","Widgets/CompassWidget.py" -"vtkInteractionStyle","Widgets/ContourWidget.py" -"vtkInteractionStyle","Widgets/EmbedInPyQt2.py" -"vtkInteractionStyle","Widgets/EmbedInPyQt.py" -"vtkInteractionStyle","Widgets/ImplicitPlaneWidget2.py" -"vtkInteractionStyle","Widgets/OrientationMarkerWidget1.py" -"vtkInteractionStyle","Widgets/OrientationMarkerWidget.py" -"vtkInteractionStyle","Widgets/ScalarBarWidget.py" -"vtkInteractionStyle","Widgets/SphereWidget.py" -"vtkInteractionStyle","Widgets/SplineWidget.py" -"vtkInteractionStyle","Widgets/TextWidget.py" -"vtkInteractionWidgets","GeometricObjects/IsoparametricCellsDemo.py" -"vtkInteractionWidgets","GeometricObjects/LinearCellsDemo.py" -"vtkInteractionWidgets","GeometricObjects/ParametricKuenDemo.py" -"vtkInteractionWidgets","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkInteractionWidgets","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkInteractionWidgets","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkInteractionWidgets","GeometricObjects/QuadraticTetraDemo.py" -"vtkInteractionWidgets","Interaction/CallBack.py" -"vtkInteractionWidgets","IO/CSVReadEdit1.py" -"vtkInteractionWidgets","IO/CSVReadEdit.py" -"vtkInteractionWidgets","PolyData/AlignTwoPolyDatas.py" -"vtkInteractionWidgets","PolyData/CurvaturesAdjustEdges.py" -"vtkInteractionWidgets","PolyData/Curvatures.py" -"vtkInteractionWidgets","Rendering/PBR_Skybox_Anisotropy.py" -"vtkInteractionWidgets","Rendering/PBR_Skybox.py" -"vtkInteractionWidgets","Rendering/PBR_Skybox_Texturing.py" -"vtkInteractionWidgets","Tutorial/Tutorial_Step6.py" -"vtkInteractionWidgets","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkInteractionWidgets","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkInteractionWidgets","Visualization/ColoredAnnotatedCube.py" -"vtkInteractionWidgets","Visualization/CurvatureBandsWithGlyphs.py" -"vtkInteractionWidgets","Visualization/DisplayCoordinateAxes.py" -"vtkInteractionWidgets","Visualization/ElevationBandsWithGlyphs.py" -"vtkInteractionWidgets","Visualization/FroggieSurface.py" -"vtkInteractionWidgets","Visualization/FroggieView.py" -"vtkInteractionWidgets","Visualization/PointDataSubdivision.py" -"vtkInteractionWidgets","Widgets/BalloonWidget.py" -"vtkInteractionWidgets","Widgets/BoxWidget.py" -"vtkInteractionWidgets","Widgets/CameraOrientationWidget.py" -"vtkInteractionWidgets","Widgets/CompassWidget.py" -"vtkInteractionWidgets","Widgets/ContourWidget.py" -"vtkInteractionWidgets","Widgets/ImplicitPlaneWidget2.py" -"vtkInteractionWidgets","Widgets/OrientationMarkerWidget1.py" -"vtkInteractionWidgets","Widgets/OrientationMarkerWidget.py" -"vtkInteractionWidgets","Widgets/ScalarBarWidget.py" -"vtkInteractionWidgets","Widgets/SphereWidget.py" -"vtkInteractionWidgets","Widgets/SplineWidget.py" -"vtkInteractionWidgets","Widgets/TextWidget.py" -"vtkInteractorStyleImage","Filtering/Glyph2D.py" -"vtkInteractorStyleImage","ImageProcessing/Attenuation.py" -"vtkInteractorStyleImage","ImageProcessing/EnhanceEdges.py" -"vtkInteractorStyleImage","ImageProcessing/GaussianSmooth.py" -"vtkInteractorStyleImage","ImageProcessing/HybridMedianComparison.py" -"vtkInteractorStyleImage","ImageProcessing/IdealHighPass.py" -"vtkInteractorStyleImage","ImageProcessing/MedianComparison.py" -"vtkInteractorStyleImage","ImageProcessing/MorphologyComparison.py" -"vtkInteractorStyleImage","ImageProcessing/Pad.py" -"vtkInteractorStyleImage","ImageProcessing/VTKSpectrum.py" -"vtkInteractorStyleImage","Images/Cast.py" -"vtkInteractorStyleImage","IO/ReadDICOMSeries.py" -"vtkInteractorStyleRubberBandPick","ExplicitStructuredGrid/CreateESGrid.py" -"vtkInteractorStyleRubberBandPick","ExplicitStructuredGrid/LoadESGrid.py" -"vtkInteractorStyleSwitch","GeometricObjects/IsoparametricCellsDemo.py" -"vtkInteractorStyleSwitch","GeometricObjects/LinearCellsDemo.py" -"vtkInteractorStyleTrackballActor","Interaction/InteractorStyleTrackballActor.py" -"vtkInteractorStyleTrackballCamera","Annotation/TextOrigin.py" -"vtkInteractorStyleTrackballCamera","GeometricObjects/EllipticalCylinderDemo.py" -"vtkInteractorStyleTrackballCamera","GeometricObjects/EllipticalCylinder.py" -"vtkInteractorStyleTrackballCamera","Interaction/InteractorStyleTrackballCamera.py" -"vtkInteractorStyleTrackballCamera","Interaction/MouseEventsObserver.py" -"vtkInteractorStyleTrackballCamera","Interaction/MouseEvents.py" -"vtkInteractorStyleTrackballCamera","IO/CSVReadEdit1.py" -"vtkInteractorStyleTrackballCamera","IO/CSVReadEdit.py" -"vtkInteractorStyleTrackballCamera","IO/TransientHDFReader.py" -"vtkInteractorStyleTrackballCamera","Picking/CellPicking.py" -"vtkInteractorStyleTrackballCamera","Picking/HighlightPickedActor.py" -"vtkInteractorStyleTrackballCamera","Picking/HighlightWithSilhouette.py" -"vtkInteractorStyleTrackballCamera","PolyData/CurvaturesAdjustEdges.py" -"vtkInteractorStyleTrackballCamera","PolyData/CurvaturesDemo.py" -"vtkInteractorStyleTrackballCamera","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkInteractorStyleTrackballCamera","Rendering/GradientBackground.py" -"vtkInteractorStyleTrackballCamera","Rendering/LayeredActors.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Anisotropy.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Clear_Coat.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Edge_Tint.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_HDR_Environment.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Mapping.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Materials_Coat.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Materials.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Skybox_Anisotropy.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Skybox.py" -"vtkInteractorStyleTrackballCamera","Rendering/PBR_Skybox_Texturing.py" -"vtkInteractorStyleTrackballCamera","Tutorial/Tutorial_Step5.py" -"vtkInteractorStyleTrackballCamera","Tutorial/Tutorial_Step6.py" -"vtkInteractorStyleTrackballCamera","Utilities/ColorMapToLUT.py" -"vtkInteractorStyleTrackballCamera","Utilities/JSONColorMapToLUT.py" -"vtkInteractorStyleTrackballCamera","Utilities/RescaleReverseLUT.py" -"vtkInteractorStyleTrackballCamera","Utilities/ResetCameraOrientation.py" -"vtkInteractorStyleTrackballCamera","Utilities/XMLColorMapToLUT.py" -"vtkInteractorStyleTrackballCamera","Visualization/ClampGlyphSizes.py" -"vtkInteractorStyleTrackballCamera","Visualization/CurvatureBandsWithGlyphs.py" -"vtkInteractorStyleTrackballCamera","Visualization/ElevationBandsWithGlyphs.py" -"vtkInteractorStyleTrackballCamera","Visualization/FroggieSurface.py" -"vtkInteractorStyleTrackballCamera","Visualization/FroggieView.py" -"vtkInteractorStyleTrackballCamera","Visualization/GlyphTable.py" -"vtkInteractorStyleTrackballCamera","Visualization/HardwareSelector.py" -"vtkInteractorStyleTrackballCamera","Visualization/MultipleRenderWindows.py" -"vtkInteractorStyleTrackballCamera","Visualization/StreamLines.py" -"vtkInteractorStyleTrackballCamera","Widgets/CompassWidget.py" -"vtkInteractorStyleTrackballCamera","Widgets/SplineWidget.py" -"vtkInteractorStyle","Tutorial/Tutorial_Step5.py" -"vtkInteractorStyle","Tutorial/Tutorial_Step6.py" -"vtkInteract","VisualizationAlgorithms/PineRootConnectivity.py" -"vtk","IO/CSVReadEdit.py" -"vtkIOExodus","IO/ReadExodusData.py" -"vtkIOGeometry","IO/PolyDataToImageDataConverter.py" -"vtkIOGeometry","IO/ReadSTL.py" -"vtkIOGeometry","IO/WriteSTL.py" -"vtkIOGeometry","Meshes/CapClip.py" -"vtkIOGeometry","Meshes/Decimation.py" -"vtkIOGeometry","Meshes/PointInterpolator.py" -"vtkIOGeometry","PolyData/AlignTwoPolyDatas.py" -"vtkIOGeometry","PolyData/BooleanOperationPolyDataFilter.py" -"vtkIOGeometry","PolyData/CellsInsideObject.py" -"vtkIOGeometry","PolyData/ClosedSurface.py" -"vtkIOGeometry","Rendering/FlatVersusGouraud.py" -"vtkIOGeometry","Rendering/GradientBackground.py" -"vtkIOGeometry","Rendering/Rotations.py" -"vtkIOGeometry","Rendering/Shadows.py" -"vtkIOGeometry","Rendering/WalkCow.py" -"vtkIOGeometry","Utilities/SaveSceneToFieldData.py" -"vtkIOGeometry","Utilities/SaveSceneToFile.py" -"vtkIOGeometry","VisualizationAlgorithms/Motor.py" -"vtkIOGeometry","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkIOGeometry","VisualizationAlgorithms/PineRootDecimation.py" -"vtkIOGeometry","Visualization/NormalsDemo.py" -"vtkIOHDF","IO/TransientHDFReader.py" -"vtkIOImage","DataManipulation/MeshLabelImageColor.py" -"vtkIOImage","GeometricObjects/Cell3DDemonstration.py" -"vtkIOImage","GeometricObjects/ParametricObjectsDemo.py" -"vtkIOImage","ImageProcessing/Attenuation.py" -"vtkIOImage","ImageProcessing/EnhanceEdges.py" -"vtkIOImage","ImageProcessing/GaussianSmooth.py" -"vtkIOImage","ImageProcessing/HybridMedianComparison.py" -"vtkIOImage","ImageProcessing/IdealHighPass.py" -"vtkIOImage","ImageProcessing/IsoSubsample.py" -"vtkIOImage","ImageProcessing/MedianComparison.py" -"vtkIOImage","ImageProcessing/MorphologyComparison.py" -"vtkIOImage","ImageProcessing/Pad.py" -"vtkIOImage","ImageProcessing/VTKSpectrum.py" -"vtkIOImage","Images/BackgroundImage.py" -"vtkIOImage","Images/ImageWarp.py" -"vtkIOImage","IO/HDRReader.py" -"vtkIOImage","IO/ImageWriter.py" -"vtkIOImage","IO/PolyDataToImageDataConverter.py" -"vtkIOImage","IO/ReadDICOM.py" -"vtkIOImage","IO/ReadDICOMSeries.py" -"vtkIOImage","IO/ReadSLC.py" -"vtkIOImage","Medical/GenerateCubesFromLabels.py" -"vtkIOImage","Medical/GenerateModelsFromLabels.py" -"vtkIOImage","Medical/MedicalDemo1.py" -"vtkIOImage","Medical/MedicalDemo2.py" -"vtkIOImage","Medical/MedicalDemo3.py" -"vtkIOImage","Medical/MedicalDemo4.py" -"vtkIOImage","Medical/TissueLens.py" -"vtkIOImage","Modelling/ContourTriangulator.py" -"vtkIOImage","Modelling/MarchingCubes.py" -"vtkIOImage","PolyData/PolyDataContourToImageData.py" -"vtkIOImage","PolyData/PolyDataToImageDataStencil.py" -"vtkIOImage","Rendering/PBR_Anisotropy.py" -"vtkIOImage","Rendering/PBR_Clear_Coat.py" -"vtkIOImage","Rendering/PBR_Edge_Tint.py" -"vtkIOImage","Rendering/PBR_HDR_Environment.py" -"vtkIOImage","Rendering/PBR_Mapping.py" -"vtkIOImage","Rendering/PBR_Materials_Coat.py" -"vtkIOImage","Rendering/PBR_Materials.py" -"vtkIOImage","Rendering/PBR_Skybox_Anisotropy.py" -"vtkIOImage","Rendering/PBR_Skybox.py" -"vtkIOImage","Rendering/PBR_Skybox_Texturing.py" -"vtkIOImage","Rendering/WalkCow.py" -"vtkIOImage","Texture/TexturePlane.py" -"vtkIOImage","Utilities/Screenshot.py" -"vtkIOImage","Utilities/VTKWithNumpy.py" -"vtkIOImage","VisualizationAlgorithms/CreateBFont.py" -"vtkIOImage","VisualizationAlgorithms/DecimateFran.py" -"vtkIOImage","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkIOImage","VisualizationAlgorithms/HeadBone.py" -"vtkIOImage","VisualizationAlgorithms/HeadSlice.py" -"vtkIOImage","VisualizationAlgorithms/ImageGradient.py" -"vtkIOImage","Visualization/FrogBrain.py" -"vtkIOImage","Visualization/FroggieSurface.py" -"vtkIOImage","Visualization/FrogSlice.py" -"vtkIOImage","Visualization/Hanoi.py" -"vtkIOImage","Visualization/PointDataSubdivision.py" -"vtkIOImage","Visualization/SphereTexture.py" -"vtkIOImport","IO/3DSImporter.py" -"vtkIOInfovis","IO/CSVReadEdit1.py" -"vtkIOInfovis","Meshes/PointInterpolator.py" -"vtkIOLegacy","IO/ReadLegacyUnstructuredGrid.py" -"vtkIOLegacy","IO/WriteLegacyLinearCells.py" -"vtkIOLegacy","Meshes/Decimation.py" -"vtkIOLegacy","Modelling/ExtractLargestIsosurface.py" -"vtkIOLegacy","Modelling/FinanceFieldData.py" -"vtkIOLegacy","PolyData/AlignTwoPolyDatas.py" -"vtkIOLegacy","PolyData/BooleanOperationPolyDataFilter.py" -"vtkIOLegacy","PolyData/CellsInsideObject.py" -"vtkIOLegacy","PolyData/ClosedSurface.py" -"vtkIOLegacy","Rendering/GradientBackground.py" -"vtkIOLegacy","Rendering/StripFran.py" -"vtkIOLegacy","Texture/AnimateVectors.py" -"vtkIOLegacy","Texture/TextureCutSphere.py" -"vtkIOLegacy","Texture/TextureThreshold.py" -"vtkIOLegacy","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkIOLegacy","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkIOLegacy","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkIOLegacy","VisualizationAlgorithms/CarotidFlow.py" -"vtkIOLegacy","VisualizationAlgorithms/DecimateFran.py" -"vtkIOLegacy","VisualizationAlgorithms/DecimateHawaii.py" -"vtkIOLegacy","VisualizationAlgorithms/DisplacementPlot.py" -"vtkIOLegacy","VisualizationAlgorithms/Hello.py" -"vtkIOLegacy","VisualizationAlgorithms/IronIsoSurface.py" -"vtkIOLegacy","VisualizationAlgorithms/Motor.py" -"vtkIOLegacy","VisualizationAlgorithms/Office.py" -"vtkIOLegacy","VisualizationAlgorithms/OfficeTube.py" -"vtkIOLegacy","VisualizationAlgorithms/PlateVibration.py" -"vtkIOLegacy","VisualizationAlgorithms/SpikeFran.py" -"vtkIOLegacy","VisualizationAlgorithms/SplatFace.py" -"vtkIOLegacy","VisualizationAlgorithms/Stocks.py" -"vtkIOLegacy","Visualization/BlobbyLogo.py" -"vtkIOLegacy","Visualization/Blow.py" -"vtkIOLegacy","Visualization/ComplexV.py" -"vtkIOLegacy","Visualization/FroggieView.py" -"vtkIOLegacy","Visualization/Hawaii.py" -"vtkIOLegacy","Visualization/Kitchen.py" -"vtkIOLegacy","VolumeRendering/SimpleRayCast.py" -"vtkIOLegacy","Widgets/ScalarBarWidget.py" -"vtkIOParallel","IO/ReadPLOT3D.py" -"vtkIOParallel","Rendering/Rainbow.py" -"vtkIOParallel","Texture/TextureThreshold.py" -"vtkIOParallel","VisualizationAlgorithms/BluntStreamlines.py" -"vtkIOParallel","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkIOParallel","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkIOParallel","VisualizationAlgorithms/LOxGrid.py" -"vtkIOParallel","VisualizationAlgorithms/LOx.py" -"vtkIOParallel","VisualizationAlgorithms/LOxSeeds.py" -"vtkIOParallel","VisualizationAlgorithms/ProbeCombustor.py" -"vtkIOParallel","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkIOParallel","VisualizationAlgorithms/VelocityProfile.py" -"vtkIOParallel","VisualizationAlgorithms/WarpCombustor.py" -"vtkIOParallel","Visualization/StreamLines.py" -"vtkIOParallel","VolumeRendering/PseudoVolumeRendering.py" -"vtkIOPLY","IO/WritePLY.py" -"vtkIOPLY","Meshes/CapClip.py" -"vtkIOPLY","Meshes/Decimation.py" -"vtkIOPLY","PolyData/AlignTwoPolyDatas.py" -"vtkIOPLY","PolyData/BooleanOperationPolyDataFilter.py" -"vtkIOPLY","PolyData/CellsInsideObject.py" -"vtkIOPLY","PolyData/ClosedSurface.py" -"vtkIOPLY","Rendering/GradientBackground.py" -"vtkIOPLY","Rendering/MotionBlur.py" -"vtkIOPLY","Rendering/Rotations.py" -"vtkIOPLY","Rendering/Shadows.py" -"vtkIOPLY","Utilities/SaveSceneToFieldData.py" -"vtkIOPLY","Utilities/SaveSceneToFile.py" -"vtkIOPLY","Visualization/NormalsDemo.py" -"vtk","IO/ReadUnstructuredGrid.py" -"vtk","IO/WriteLegacyLinearCells.py" -"vtkIOXML","Arrays/RenameArray.py" -"vtkIOXML","ExplicitStructuredGrid/LoadESGrid.py" -"vtkIOXML","GeometricObjects/Polyhedron.py" -"vtkIOXML","Graphs/NOVCAGraph.py" -"vtkIOXML","ImageData/WriteReadVtkImageData.py" -"vtkIOXML","IO/CSVReadEdit1.py" -"vtkIOXML","IO/CSVReadEdit.py" -"vtkIOXML","IO/ReadImageData.py" -"vtkIOXML","IO/ReadPolyData.py" -"vtkIOXML","IO/ReadVTP.py" -"vtkIOXML","IO/WriteTriangleToFile.py" -"vtkIOXML","IO/WriteXMLLinearCells.py" -"vtkIOXML","Medical/GenerateModelsFromLabels.py" -"vtkIOXML","Meshes/Decimation.py" -"vtkIOXML","PolyData/AlignTwoPolyDatas.py" -"vtkIOXML","PolyData/BooleanOperationPolyDataFilter.py" -"vtkIOXML","PolyData/CellsInsideObject.py" -"vtkIOXML","PolyData/ClosedSurface.py" -"vtkIOXML","PolyData/ColoredTriangle.py" -"vtkIOXML","PolyData/CurvaturesAdjustEdges.py" -"vtkIOXML","PolyData/Curvatures.py" -"vtkIOXML","PolyData/PolyDataContourToImageData.py" -"vtkIOXML","PolyData/SolidColoredTriangle.py" -"vtkIOXML","PolyData/TriangleColoredPoints.py" -"vtkIOXML","PolyData/TriangleCorners.py" -"vtkIOXML","PolyData/TriangleCornerVertices.py" -"vtkIOXML","Rendering/GradientBackground.py" -"vtkIOXML","Rendering/Rotations.py" -"vtkIOXML","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkIOXML","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkIOXML","VisualizationAlgorithms/CutWithScalars.py" -"vtkIOXML","Visualization/AssignCellColorsFromLUT.py" -"vtkIOXML","Visualization/NormalsDemo.py" -"vtkIOXML","Widgets/CameraOrientationWidget.py" -"vtkIOXML","Widgets/ImplicitPlaneWidget2.py" -"vtkIOXML","Widgets/OrientationMarkerWidget1.py" -"vtkIterativeClosestPointTransform","Filtering/IterativeClosestPoints.py" -"vtkIterativeClosestPointTransform","PolyData/AlignTwoPolyDatas.py" -"vtkJPEGReader","Images/BackgroundImage.py" -"vtkJPEGReader","Visualization/SphereTexture.py" -"vtkJPEGWriter","IO/ImageWriter.py" -"vtkJPEGWriter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkJPEGWriter","Rendering/PBR_Skybox.py" -"vtkJPEGWriter","Rendering/PBR_Skybox_Texturing.py" -"vtkJPEGWriter","Visualization/Hanoi.py" -"vtkLabeledDataMapper","GeometricObjects/IsoparametricCellsDemo.py" -"vtkLabeledDataMapper","GeometricObjects/LinearCellsDemo.py" -"vtkLabeledDataMapper","IO/ReadLegacyUnstructuredGrid.py" -"vtkLandmarkTransform","PolyData/AlignTwoPolyDatas.py" -"vtklib","Utilities/VTKImportsForPython.py" -"vtkLightActor","Visualization/ShadowsLightsDemo.py" -"vtkLightKit","GeometricObjects/IsoparametricCellsDemo.py" -"vtkLightKit","GeometricObjects/LinearCellsDemo.py" -"vtkLight","Rendering/AmbientSpheres.py" -"vtkLight","Rendering/DiffuseSpheres.py" -"vtkLight","Rendering/PBR_Clear_Coat.py" -"vtkLight","Rendering/PBR_Mapping.py" -"vtkLight","Rendering/Shadows.py" -"vtkLight","Rendering/SpecularSpheres.py" -"vtkLightsPass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkLightsPass","Rendering/PBR_Skybox.py" -"vtkLightsPass","Rendering/PBR_Skybox_Texturing.py" -"vtkLight","Visualization/ShadowsLightsDemo.py" -"vtkLinearExtrusionFilter","GeometricObjects/EllipticalCylinderDemo.py" -"vtkLinearExtrusionFilter","GeometricObjects/EllipticalCylinder.py" -"vtkLinearExtrusionFilter","PolyData/PolyDataContourToImageData.py" -"vtkLinearExtrusionFilter","VisualizationAlgorithms/Stocks.py" -"vtkLinearExtrusionFilter","Visualization/AlphaFrequency.py" -"vtkLinearSubdivisionFilter","PolyData/CurvaturesAdjustEdges.py" -"vtkLinearSubdivisionFilter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkLinearSubdivisionFilter","Rendering/PBR_Skybox.py" -"vtkLinearSubdivisionFilter","Rendering/PBR_Skybox_Texturing.py" -"vtkLinearSubdivisionFilter","Visualization/PointDataSubdivision.py" -"vtkLine","GeometricObjects/ColoredLines.py" -"vtkLine","GeometricObjects/LinearCellsDemo.py" -"vtkLine","GeometricObjects/LongLine.py" -"vtkLine","IO/WriteLegacyLinearCells.py" -"vtkLine","IO/WriteXMLLinearCells.py" -"vtkLine","Modelling/CappedSphere.py" -"vtkLine","PolyData/IterateOverLines.py" -"vtkLine","PolyData/RuledSurfaceFilter.py" -"vtkLine","PolyData/WarpVector.py" -"vtkLineSource","Filtering/WarpTo.py" -"vtkLineSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkLineSource","GeometricObjects/Line.py" -"vtkLineSource","GeometricObjects/SourceObjectsDemo.py" -"vtkLineSource","PolyData/TubeFilter.py" -"vtkLineSource","Rendering/StippledLine.py" -"vtkLineSource","Texture/AnimateVectors.py" -"vtkLineSource","VisualizationAlgorithms/BluntStreamlines.py" -"vtkLineSource","Visualization/Kitchen.py" -"vtkLineWidget","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkLODActor","DataManipulation/MeshLabelImageColor.py" -"vtkLODActor","Visualization/CameraModel1.py" -"vtkLODActor","Visualization/CameraModel2.py" -"vtkLogLookupTable","VisualizationAlgorithms/HyperStreamline.py" -"vtkLookUp","PolyData/CurvaturesDemo.py" -"vtkLookupTable","DataManipulation/MeshLabelImageColor.py" -"vtkLookupTable","GeometricObjects/CellTypeSource.py" -"vtkLookupTable","GeometricObjects/PlatonicSolids.py" -"vtkLookupTable","Graphs/ColorEdges.py" -"vtkLookupTable","Graphs/ColorVerticesLookupTable.py" -"vtkLookupTable","Graphs/ScaleVertices.py" -"vtkLookupTable","InfoVis/ParallelCoordinatesExtraction.py" -"vtkLookupTable","IO/CSVReadEdit1.py" -"vtkLookupTable","IO/CSVReadEdit.py" -"vtkLookupTable","IO/ReadLegacyUnstructuredGrid.py" -"vtkLookupTable","Medical/MedicalDemo3.py" -"vtkLookupTable","Medical/TissueLens.py" -"vtkLookupTable","Meshes/ColoredElevationMap.py" -"vtkLookupTable","Modelling/DiscreteMarchingCubes.py" -"vtkLookupTable","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkLookupTable","PolyData/CurvaturesAdjustEdges.py" -"vtkLookupTable","PolyData/CurvaturesDemo.py" -"vtkLookupTable","Rendering/Rainbow.py" -"vtkLookupTable","Rendering/TransformSphere.py" -"vtkLookupTable","Utilities/LUTUtilities.py" -"vtkLookupTable","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkLookupTable","VisualizationAlgorithms/CarotidFlow.py" -"vtkLookupTable","VisualizationAlgorithms/DisplacementPlot.py" -"vtkLookupTable","VisualizationAlgorithms/LOxGrid.py" -"vtkLookupTable","VisualizationAlgorithms/LOx.py" -"vtkLookupTable","VisualizationAlgorithms/LOxSeeds.py" -"vtkLookupTable","VisualizationAlgorithms/TensorAxes.py" -"vtkLookupTable","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkLookupTable","Visualization/AssignCellColorsFromLUT.py" -"vtkLookupTable","Visualization/Blow.py" -"vtkLookupTable","Visualization/ColoredAnnotatedCube.py" -"vtkLookupTable","Visualization/ComplexV.py" -"vtkLookupTable","Visualization/CreateColorSeriesDemo.py" -"vtkLookupTable","Visualization/CurvatureBandsWithGlyphs.py" -"vtkLookupTable","Visualization/ElevationBandsWithGlyphs.py" -"vtkLookupTable","Visualization/FrogBrain.py" -"vtkLookupTable","Visualization/FroggieSurface.py" -"vtkLookupTable","Visualization/FroggieView.py" -"vtkLookupTable","Visualization/FrogSlice.py" -"vtkLookupTable","Visualization/Hawaii.py" -"vtkLookupTable","Visualization/KochSnowflake.py" -"vtkLookupTable","Visualization/NamedColors.py" -"vtkLookupTable","VolumeRendering/PseudoVolumeRendering.py" -"vtkLookupTable","Widgets/ScalarBarWidget.py" -"vtkLoopSubdivisionFilter","DataManipulation/LineOnMesh.py" -"vtkLoopSubdivisionFilter","PolyData/SmoothMeshGrid.py" -"vtkMarchingContourFilter","Modelling/FinanceFieldData.py" -"vtkMarchingCubes","Medical/MedicalDemo1.py" -"vtkMarchingCubes","Medical/MedicalDemo2.py" -"vtkMarchingCubes","Medical/MedicalDemo3.py" -"vtkMarchingCubes","Medical/TissueLens.py" -"vtkMarchingCubes","Modelling/ExtractLargestIsosurface.py" -"vtkMarchingCubes","Modelling/MarchingCubes.py" -"vtkMarchingCubes","VisualizationAlgorithms/HeadBone.py" -"vtkMarchingCubes","Visualization/FrogBrain.py" -"vtkMarchingCubes","Visualization/FroggieSurface.py" -"vtkMarchingCubes","Visualization/IsosurfaceSampling.py" -"vtkMarchingSquares","Modelling/ContourTriangulator.py" -"vtkMaskFields","Medical/GenerateModelsFromLabels.py" -"vtkMaskPoints","GeometricObjects/ParametricObjectsDemo.py" -"vtkMaskPoints","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkMaskPoints","VisualizationAlgorithms/SpikeFran.py" -"vtkMaskPoints","VisualizationAlgorithms/SplatFace.py" -"vtkMaskPoints","Visualization/CurvatureBandsWithGlyphs.py" -"vtkMaskPoints","Visualization/ElevationBandsWithGlyphs.py" -"vtkMaskPoints","Visualization/PointDataSubdivision.py" -"vtkMaskPolyData","Rendering/StripFran.py" -"vtkMath","GeometricObjects/EllipticalCylinderDemo.py" -"vtkMath","GeometricObjects/EllipticalCylinder.py" -"vtkMath","GeometricObjects/OrientedArrow.py" -"vtkMath","GeometricObjects/OrientedCylinder.py" -"vtkMath","GeometricObjects/ParametricKuenDemo.py" -"vtkMath","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkMath","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkMath","SimpleOperations/DistanceBetweenPoints.py" -"vtkMath","StructuredGrid/SGrid.py" -"vtkMath","Widgets/CompassWidget.py" -"vtkMatrix4x4","GeometricObjects/EllipticalCylinderDemo.py" -"vtkMatrix4x4","GeometricObjects/OrientedArrow.py" -"vtkMatrix4x4","GeometricObjects/OrientedCylinder.py" -"vtkMatrix4x4","Visualization/CollisionDetection.py" -"vtkMatrix4x4","Visualization/FroggieSurface.py" -"vtkMatrix4x4","Visualization/FroggieView.py" -"vtkMatrix4x4","Visualization/FrogSlice.py" -"vtkMCubesReader","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkMCubesReader","VisualizationAlgorithms/PineRootDecimation.py" -"vtkMergeData","Images/ImageWarp.py" -"vtkMergeFilter","Images/ImageWarp.py" -"vtkMergePoints","VisualizationAlgorithms/HeadBone.py" -"vtk","Meshes/CapClip.py" -"vtk","Meshes/Decimation.py" -"vtkMetaImageReader","DataManipulation/MeshLabelImageColor.py" -"vtkMetaImageReader","Medical/GenerateCubesFromLabels.py" -"vtkMetaImageReader","Medical/GenerateModelsFromLabels.py" -"vtkMetaImageReader","Medical/MedicalDemo1.py" -"vtkMetaImageReader","Medical/MedicalDemo2.py" -"vtkMetaImageReader","Medical/MedicalDemo3.py" -"vtkMetaImageReader","Medical/MedicalDemo4.py" -"vtkMetaImageReader","Medical/TissueLens.py" -"vtkMetaImageReader","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkMetaImageReader","VisualizationAlgorithms/HeadBone.py" -"vtkMetaImageReader","VisualizationAlgorithms/HeadSlice.py" -"vtkMetaImageReader","VisualizationAlgorithms/ImageGradient.py" -"vtkMetaImageReader","Visualization/FrogBrain.py" -"vtkMetaImageReader","Visualization/FroggieSurface.py" -"vtkMetaImageReader","Visualization/FrogSlice.py" -"vtkMetaImageWriter","IO/PolyDataToImageDataConverter.py" -"vtkMetaImageWriter","PolyData/PolyDataContourToImageData.py" -"vtkMinimalStandardRandomSequence","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkMinimalStandardRandomSequence","Filtering/ConstrainedDelaunay2D.py" -"vtkMinimalStandardRandomSequence","Filtering/TriangulateTerrainMap.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/CellTypeSource.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/EllipticalCylinderDemo.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/OrientedArrow.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/OrientedCylinder.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/ParametricObjectsDemo.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/QuadraticHexahedron.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/QuadraticTetraDemo.py" -"vtkMinimalStandardRandomSequence","GeometricObjects/QuadraticTetra.py" -"vtkMinimalStandardRandomSequence","Meshes/ColoredElevationMap.py" -"vtkMinimalStandardRandomSequence","Modelling/DelaunayMesh.py" -"vtkMinimalStandardRandomSequence","Modelling/DiscreteMarchingCubes.py" -"vtkMinimalStandardRandomSequence","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkMinimalStandardRandomSequence","Picking/HighlightPickedActor.py" -"vtkMinimalStandardRandomSequence","Picking/HighlightWithSilhouette.py" -"vtkMinimalStandardRandomSequence","Plotting/SpiderPlot.py" -"vtkMinimalStandardRandomSequence","PolyData/SmoothMeshGrid.py" -"vtkMinimalStandardRandomSequence","Visualization/BillboardTextActor3D.py" -"vtkMinimalStandardRandomSequence","Visualization/Hanoi.py" -"vtkMinimalStandardRandomSequence","Visualization/Lorenz.py" -"vtk","Modelling/ExtractLargestIsosurface.py" -"vtk","Modelling/FinanceFieldData.py" -"vtkmodules","Annotation/MultiLineText.py" -"vtkmodules","Annotation/TextOrigin.py" -"vtkmodules","Arrays/GetValues.py" -"vtkmodules","Arrays/RenameArray.py" -"vtkmodules","CompositeData/CompositePolyDataMapper.py" -"vtkmodules","CompositeData/MultiBlockDataSet.py" -"vtkmodules","CompositeData/OverlappingAMR.py" -"vtkmodules","DataManipulation/LineOnMesh.py" -"vtkmodules","DataManipulation/MeshLabelImageColor.py" -"vtkmodules","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkmodules","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkmodules","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkmodules","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkmodules","Deprecated/Geovis/GeoGraticle.py" -"vtkmodules","ExplicitStructuredGrid/CreateESGrid.py" -"vtkmodules","ExplicitStructuredGrid/LoadESGrid.py" -"vtkmodules","Filtering/AppendFilter.py" -"vtkmodules","Filtering/CombinePolyData.py" -"vtkmodules","Filtering/ConnectivityFilter.py" -"vtkmodules","Filtering/ConstrainedDelaunay2D.py" -"vtkmodules","Filtering/Delaunay2D.py" -"vtkmodules","Filtering/GaussianSplat.py" -"vtkmodules","Filtering/Glyph2D.py" -"vtkmodules","Filtering/Glyph3D.py" -"vtkmodules","Filtering/IterativeClosestPoints.py" -"vtkmodules","Filtering/PerlinNoise.py" -"vtkmodules","Filtering/TransformPolyData.py" -"vtkmodules","Filtering/TriangulateTerrainMap.py" -"vtkmodules","Filtering/VertexGlyphFilter.py" -"vtkmodules","Filtering/WarpTo.py" -"vtkmodules","GeometricObjects/Arrow.py" -"vtkmodules","GeometricObjects/Axes.py" -"vtkmodules","GeometricObjects/Cell3DDemonstration.py" -"vtkmodules","GeometricObjects/CellTypeSource.py" -"vtkmodules","GeometricObjects/Circle.py" -"vtkmodules","GeometricObjects/ColoredLines.py" -"vtkmodules","GeometricObjects/Cone.py" -"vtkmodules","GeometricObjects/ConvexPointSet.py" -"vtkmodules","GeometricObjects/Cube1.py" -"vtkmodules","GeometricObjects/Cube.py" -"vtkmodules","GeometricObjects/CylinderExample.py" -"vtkmodules","GeometricObjects/Cylinder.py" -"vtkmodules","GeometricObjects/Disk.py" -"vtkmodules","GeometricObjects/Dodecahedron.py" -"vtkmodules","GeometricObjects/EarthSource.py" -"vtkmodules","GeometricObjects/EllipticalCylinderDemo.py" -"vtkmodules","GeometricObjects/EllipticalCylinder.py" -"vtkmodules","GeometricObjects/Frustum.py" -"vtkmodules","GeometricObjects/GeometricObjectsDemo.py" -"vtkmodules","GeometricObjects/Hexahedron.py" -"vtkmodules","GeometricObjects/IsoparametricCellsDemo.py" -"vtkmodules","GeometricObjects/LinearCellsDemo.py" -"vtkmodules","GeometricObjects/Line.py" -"vtkmodules","GeometricObjects/LongLine.py" -"vtkmodules","GeometricObjects/OrientedArrow.py" -"vtkmodules","GeometricObjects/OrientedCylinder.py" -"vtkmodules","GeometricObjects/ParametricKuenDemo.py" -"vtkmodules","GeometricObjects/ParametricObjectsDemo.py" -"vtkmodules","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkmodules","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkmodules","GeometricObjects/Plane.py" -"vtkmodules","GeometricObjects/PlanesIntersection.py" -"vtkmodules","GeometricObjects/Planes.py" -"vtkmodules","GeometricObjects/PlatonicSolids.py" -"vtkmodules","GeometricObjects/Point.py" -"vtkmodules","GeometricObjects/PolygonIntersection.py" -"vtkmodules","GeometricObjects/Polygon.py" -"vtkmodules","GeometricObjects/Polyhedron.py" -"vtkmodules","GeometricObjects/PolyLine1.py" -"vtkmodules","GeometricObjects/PolyLine.py" -"vtkmodules","GeometricObjects/Pyramid.py" -"vtkmodules","GeometricObjects/Quad.py" -"vtkmodules","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkmodules","GeometricObjects/QuadraticHexahedron.py" -"vtkmodules","GeometricObjects/QuadraticTetraDemo.py" -"vtkmodules","GeometricObjects/QuadraticTetra.py" -"vtkmodules","GeometricObjects/RegularPolygonSource.py" -"vtkmodules","GeometricObjects/ShrinkCube.py" -"vtkmodules","GeometricObjects/SourceObjectsDemo.py" -"vtkmodules","GeometricObjects/Sphere.py" -"vtkmodules","GeometricObjects/TessellatedBoxSource.py" -"vtkmodules","GeometricObjects/Tetrahedron.py" -"vtkmodules","GeometricObjects/TextActor.py" -"vtkmodules","GeometricObjects/Triangle.py" -"vtkmodules","GeometricObjects/TriangleStrip.py" -"vtkmodules","GeometricObjects/Vertex.py" -"vtkmodules","Graphs/ColorEdges.py" -"vtkmodules","Graphs/ColorVertexLabels.py" -"vtkmodules","Graphs/ColorVerticesLookupTable.py" -"vtkmodules","Graphs/ConstructGraph.py" -"vtkmodules","Graphs/ConstructTree.py" -"vtkmodules","Graphs/CreateTree.py" -"vtkmodules","Graphs/EdgeWeights.py" -"vtkmodules","Graphs/GraphToPolyData.py" -"vtkmodules","Graphs/LabelVerticesAndEdges.py" -"vtkmodules","Graphs/NOVCAGraph.py" -"vtkmodules","Graphs/RandomGraphSource.py" -"vtkmodules","Graphs/ScaleVertices.py" -"vtkmodules","Graphs/SelectedVerticesAndEdges.py" -"vtkmodules","Graphs/SideBySideGraphs.py" -"vtkmodules","Graphs/VisualizeDirectedGraph.py" -"vtkmodules","Graphs/VisualizeGraph.py" -"vtkmodules","HyperTreeGrid/HyperTreeGridSource.py" -"vtkmodules","ImageData/ImageDataGeometryFilter.py" -"vtkmodules","ImageData/ImageNormalize.py" -"vtkmodules","ImageData/ImageWeightedSum.py" -"vtkmodules","ImageData/SumVTKImages.py" -"vtkmodules","ImageData/WriteReadVtkImageData.py" -"vtkmodules","ImageProcessing/Attenuation.py" -"vtkmodules","ImageProcessing/EnhanceEdges.py" -"vtkmodules","ImageProcessing/GaussianSmooth.py" -"vtkmodules","ImageProcessing/HybridMedianComparison.py" -"vtkmodules","ImageProcessing/IdealHighPass.py" -"vtkmodules","ImageProcessing/IsoSubsample.py" -"vtkmodules","ImageProcessing/MedianComparison.py" -"vtkmodules","ImageProcessing/MorphologyComparison.py" -"vtkmodules","ImageProcessing/Pad.py" -"vtkmodules","ImageProcessing/VTKSpectrum.py" -"vtkmodules","Images/Actor2D.py" -"vtkmodules","Images/BackgroundImage.py" -"vtkmodules","Images/Cast.py" -"vtkmodules","Images/ImageWarp.py" -"vtkmodules","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkmodules","ImplicitFunctions/ImplicitQuadric.py" -"vtkmodules","ImplicitFunctions/ImplicitSphere1.py" -"vtkmodules","ImplicitFunctions/ImplicitSphere.py" -"vtkmodules","ImplicitFunctions/SampleFunction.py" -"vtkmodules","InfoVis/ParallelCoordinatesExtraction.py" -"vtkmodules","InfoVis/ParallelCoordinatesView.py" -"vtkmodules","InfoVis/SelectedGraphIDs.py" -"vtkmodules","Interaction/CallBack.py" -"vtkmodules","Interaction/InteractorStyleTrackballActor.py" -"vtkmodules","Interaction/InteractorStyleTrackballCamera.py" -"vtkmodules","Interaction/MouseEventsObserver.py" -"vtkmodules","Interaction/MouseEvents.py" -"vtkmodules","IO/3DSImporter.py" -"vtkmodules","IO/CSVReadEdit1.py" -"vtkmodules","IO/CSVReadEdit.py" -"vtkmodules","IO/HDRReader.py" -"vtkmodules","IO/ImageWriter.py" -"vtkmodules","IO/PolyDataToImageDataConverter.py" -"vtkmodules","IO/ReadDICOM.py" -"vtkmodules","IO/ReadDICOMSeries.py" -"vtkmodules","IO/ReadExodusData.py" -"vtkmodules","IO/ReadImageData.py" -"vtkmodules","IO/ReadLegacyUnstructuredGrid.py" -"vtkmodules","IO/ReadPLOT3D.py" -"vtkmodules","IO/ReadPolyData.py" -"vtkmodules","IO/ReadSLC.py" -"vtkmodules","IO/ReadSTL.py" -"vtkmodules","IO/ReadUnstructuredGrid.py" -"vtkmodules","IO/ReadVTP.py" -"vtkmodules","IO/TransientHDFReader.py" -"vtkmodules","IO/WriteLegacyLinearCells.py" -"vtkmodules","IO/WritePLY.py" -"vtkmodules","IO/WriteSTL.py" -"vtkmodules","IO/WriteTriangleToFile.py" -"vtkmodules","IO/WriteXMLLinearCells.py" -"vtkmodules","Medical/GenerateCubesFromLabels.py" -"vtkmodules","Medical/GenerateModelsFromLabels.py" -"vtkmodules","Medical/MedicalDemo1.py" -"vtkmodules","Medical/MedicalDemo2.py" -"vtkmodules","Medical/MedicalDemo3.py" -"vtkmodules","Medical/MedicalDemo4.py" -"vtkmodules","Medical/TissueLens.py" -"vtkmodules","Meshes/BoundaryEdges.py" -"vtkmodules","Meshes/CapClip.py" -"vtkmodules","Meshes/ClipDataSetWithPolyData1.py" -"vtkmodules","Meshes/ClipDataSetWithPolyData.py" -"vtkmodules","Meshes/ColoredElevationMap.py" -"vtkmodules","Meshes/Decimation.py" -"vtkmodules","Meshes/DeformPointSet.py" -"vtkmodules","Meshes/PointInterpolator.py" -"vtkmodules","Meshes/SolidClip.py" -"vtkmodules","Modelling/Bottle.py" -"vtkmodules","Modelling/CappedSphere.py" -"vtkmodules","Modelling/ContourTriangulator.py" -"vtkmodules","Modelling/DelaunayMesh.py" -"vtkmodules","Modelling/DiscreteMarchingCubes.py" -"vtkmodules","Modelling/ExtractLargestIsosurface.py" -"vtkmodules","Modelling/FinanceFieldData.py" -"vtkmodules","Modelling/Finance.py" -"vtkmodules","Modelling/MarchingCubes.py" -"vtkmodules","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkmodules","Modelling/Spring.py" -"vtkmodules","Picking/CellPicking.py" -"vtkmodules","Picking/HighlightPickedActor.py" -"vtkmodules","Picking/HighlightWithSilhouette.py" -"vtkmodules","Plotting/MultiplePlots.py" -"vtkmodules","Plotting/ScatterPlot.py" -"vtkmodules","Plotting/SpiderPlot.py" -"vtkmodules","Plotting/SurfacePlot.py" -"vtkmodules","PolyData/AlignTwoPolyDatas.py" -"vtkmodules","PolyData/BooleanOperationPolyDataFilter.py" -"vtkmodules","PolyData/CellsInsideObject.py" -"vtkmodules","PolyData/ClosedSurface.py" -"vtkmodules","PolyData/ColoredTriangle.py" -"vtkmodules","PolyData/CurvaturesAdjustEdges.py" -"vtkmodules","PolyData/CurvaturesDemo.py" -"vtkmodules","PolyData/Curvatures.py" -"vtkmodules","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkmodules","PolyData/ExtractSelection.py" -"vtkmodules","PolyData/ExtractSelectionUsingCells.py" -"vtkmodules","PolyData/FilledPolygon.py" -"vtkmodules","PolyData/ImplicitPolyDataDistance.py" -"vtkmodules","PolyData/IterateOverLines.py" -"vtkmodules","PolyData/Outline.py" -"vtkmodules","PolyData/PointSource.py" -"vtkmodules","PolyData/PolyDataContourToImageData.py" -"vtkmodules","PolyData/PolyDataToImageDataStencil.py" -"vtkmodules","PolyData/RotationAroundLine.py" -"vtkmodules","PolyData/RuledSurfaceFilter.py" -"vtkmodules","PolyData/SmoothMeshGrid.py" -"vtkmodules","PolyData/SolidColoredTriangle.py" -"vtkmodules","PolyData/TriangleColoredPoints.py" -"vtkmodules","PolyData/TriangleCorners.py" -"vtkmodules","PolyData/TriangleCornerVertices.py" -"vtkmodules","PolyData/TubeFilter.py" -"vtkmodules","PolyData/WarpVector.py" -"vtkmodules","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkmodules","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkmodules","RectilinearGrid/RectilinearGrid.py" -"vtkmodules","RectilinearGrid/RGrid.py" -"vtkmodules","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkmodules","Rendering/AmbientSpheres.py" -"vtkmodules","Rendering/CameraBlur.py" -"vtkmodules","Rendering/ColoredSphere.py" -"vtkmodules","Rendering/Cone3.py" -"vtkmodules","Rendering/Cone4.py" -"vtkmodules","Rendering/DiffuseSpheres.py" -"vtkmodules","Rendering/FlatVersusGouraud.py" -"vtkmodules","Rendering/GradientBackground.py" -"vtkmodules","Rendering/LayeredActors.py" -"vtkmodules","Rendering/Mace.py" -"vtkmodules","Rendering/Model.py" -"vtkmodules","Rendering/MotionBlur.py" -"vtkmodules","Rendering/OutlineGlowPass.py" -"vtkmodules","Rendering/PBR_Anisotropy.py" -"vtkmodules","Rendering/PBR_Clear_Coat.py" -"vtkmodules","Rendering/PBR_Edge_Tint.py" -"vtkmodules","Rendering/PBR_HDR_Environment.py" -"vtkmodules","Rendering/PBR_Mapping.py" -"vtkmodules","Rendering/PBR_Materials_Coat.py" -"vtkmodules","Rendering/PBR_Materials.py" -"vtkmodules","Rendering/PBR_Skybox_Anisotropy.py" -"vtkmodules","Rendering/PBR_Skybox.py" -"vtkmodules","Rendering/PBR_Skybox_Texturing.py" -"vtkmodules","Rendering/Rainbow.py" -"vtkmodules","Rendering/Rotations.py" -"vtkmodules","Rendering/Shadows.py" -"vtkmodules","Rendering/SpecularSpheres.py" -"vtkmodules","Rendering/StippledLine.py" -"vtkmodules","Rendering/StripFran.py" -"vtkmodules","Rendering/TransformSphere.py" -"vtkmodules","Rendering/TransparentBackground.py" -"vtkmodules","Rendering/WalkCow.py" -"vtkmodules","SimpleOperations/DistanceBetweenPoints.py" -"vtkmodules","StructuredGrid/BlankPoint.py" -"vtkmodules","StructuredGrid/SGrid.py" -"vtkmodules","StructuredPoints/Vol.py" -"vtkmodules","Texture/AnimateVectors.py" -"vtkmodules","Texture/TextureCutQuadric.py" -"vtkmodules","Texture/TextureCutSphere.py" -"vtkmodules","Texture/TexturePlane.py" -"vtkmodules","Texture/TextureThreshold.py" -"vtkmodules","Tutorial/Tutorial_Step1.py" -"vtkmodules","Tutorial/Tutorial_Step2.py" -"vtkmodules","Tutorial/Tutorial_Step3.py" -"vtkmodules","Tutorial/Tutorial_Step4.py" -"vtkmodules","Tutorial/Tutorial_Step5.py" -"vtkmodules","Tutorial/Tutorial_Step6.py" -"vtkmodules","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkmodules","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkmodules","UnstructuredGrid/UGrid.py" -"vtkmodules","Utilities/Animation.py" -"vtkmodules","Utilities/CheckVTKVersion.py" -"vtkmodules","Utilities/ColorMapToLUT.py" -"vtkmodules","Utilities/JSONColorMapToLUT.py" -"vtkmodules","Utilities/LUTUtilities.py" -"vtkmodules","Utilities/RescaleReverseLUT.py" -"vtkmodules","Utilities/ResetCameraOrientation.py" -"vtkmodules","Utilities/SaveSceneToFieldData.py" -"vtkmodules","Utilities/SaveSceneToFile.py" -"vtkmodules","Utilities/Screenshot.py" -"vtkmodules","Utilities/ShareCamera.py" -"vtkmodules","Utilities/Variant.py" -"vtk_modules","Utilities/VTKImportsForPython.py" -"vtkmodules","Utilities/VTKImportsForPython.py" -"vtkmodules","Utilities/VTKWithNumpy.py" -"vtkmodules","Utilities/XMLColorMapToLUT.py" -"vtkmodules","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkmodules","VisualizationAlgorithms/BluntStreamlines.py" -"vtkmodules","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkmodules","VisualizationAlgorithms/CarotidFlow.py" -"vtkmodules","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkmodules","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkmodules","VisualizationAlgorithms/ContourQuadric.py" -"vtkmodules","VisualizationAlgorithms/CreateBFont.py" -"vtkmodules","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkmodules","VisualizationAlgorithms/Cutter.py" -"vtkmodules","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkmodules","VisualizationAlgorithms/CutWithScalars.py" -"vtkmodules","VisualizationAlgorithms/DataSetSurface.py" -"vtkmodules","VisualizationAlgorithms/DecimateFran.py" -"vtkmodules","VisualizationAlgorithms/DecimateHawaii.py" -"vtkmodules","VisualizationAlgorithms/DisplacementPlot.py" -"vtkmodules","VisualizationAlgorithms/ExponentialCosine.py" -"vtkmodules","VisualizationAlgorithms/ExtractData.py" -"vtkmodules","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkmodules","VisualizationAlgorithms/HeadBone.py" -"vtkmodules","VisualizationAlgorithms/HeadSlice.py" -"vtkmodules","VisualizationAlgorithms/Hello.py" -"vtkmodules","VisualizationAlgorithms/HyperStreamline.py" -"vtkmodules","VisualizationAlgorithms/IceCream.py" -"vtkmodules","VisualizationAlgorithms/ImageGradient.py" -"vtkmodules","VisualizationAlgorithms/IronIsoSurface.py" -"vtkmodules","VisualizationAlgorithms/LOxGrid.py" -"vtkmodules","VisualizationAlgorithms/LOx.py" -"vtkmodules","VisualizationAlgorithms/LOxSeeds.py" -"vtkmodules","VisualizationAlgorithms/MarchingCases.py" -"vtkmodules","VisualizationAlgorithms/Motor.py" -"vtkmodules","VisualizationAlgorithms/Office.py" -"vtkmodules","VisualizationAlgorithms/OfficeTube.py" -"vtkmodules","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkmodules","VisualizationAlgorithms/PineRootDecimation.py" -"vtkmodules","VisualizationAlgorithms/PlateVibration.py" -"vtkmodules","VisualizationAlgorithms/ProbeCombustor.py" -"vtkmodules","VisualizationAlgorithms/SingleSplat.py" -"vtkmodules","VisualizationAlgorithms/SpikeFran.py" -"vtkmodules","VisualizationAlgorithms/SplatFace.py" -"vtkmodules","VisualizationAlgorithms/Stocks.py" -"vtkmodules","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkmodules","VisualizationAlgorithms/TensorAxes.py" -"vtkmodules","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkmodules","VisualizationAlgorithms/VelocityProfile.py" -"vtkmodules","VisualizationAlgorithms/WarpCombustor.py" -"vtkmodules","Visualization/AlphaFrequency.py" -"vtkmodules","Visualization/AnnotatedCubeActor.py" -"vtkmodules","Visualization/AssignCellColorsFromLUT.py" -"vtkmodules","Visualization/BillboardTextActor3D.py" -"vtkmodules","Visualization/BlobbyLogo.py" -"vtkmodules","Visualization/Blow.py" -"vtkmodules","Visualization/CameraModel1.py" -"vtkmodules","Visualization/CameraModel2.py" -"vtkmodules","Visualization/Camera.py" -"vtkmodules","Visualization/ClampGlyphSizes.py" -"vtkmodules","Visualization/CollisionDetection.py" -"vtkmodules","Visualization/ColorAnActor.py" -"vtkmodules","Visualization/ColoredAnnotatedCube.py" -"vtkmodules","Visualization/ColorSeriesPatches.py" -"vtkmodules","Visualization/ComplexV.py" -"vtkmodules","Visualization/CreateColorSeriesDemo.py" -"vtkmodules","Visualization/CubeAxesActor.py" -"vtkmodules","Visualization/CurvatureBandsWithGlyphs.py" -"vtkmodules","Visualization/DisplayCoordinateAxes.py" -"vtkmodules","Visualization/DisplayQuadricSurfaces.py" -"vtkmodules","Visualization/ElevationBandsWithGlyphs.py" -"vtkmodules","Visualization/FrogBrain.py" -"vtkmodules","Visualization/FroggieSurface.py" -"vtkmodules","Visualization/FroggieView.py" -"vtkmodules","Visualization/FrogSlice.py" -"vtkmodules","Visualization/GlyphTable.py" -"vtkmodules","Visualization/Hanoi.py" -"vtkmodules","Visualization/HardwareSelector.py" -"vtkmodules","Visualization/Hawaii.py" -"vtkmodules","Visualization/IsosurfaceSampling.py" -"vtkmodules","Visualization/Kitchen.py" -"vtkmodules","Visualization/KochSnowflake.py" -"vtkmodules","Visualization/LoopShrink.py" -"vtkmodules","Visualization/Lorenz.py" -"vtkmodules","Visualization/MultipleRenderWindows.py" -"vtkmodules","Visualization/MultipleViewports.py" -"vtkmodules","Visualization/NamedColorPatches.py" -"vtkmodules","Visualization/NamedColors.py" -"vtkmodules","Visualization/NormalsDemo.py" -"vtkmodules","Visualization/OrientedGlyphs.py" -"vtkmodules","Visualization/PointDataSubdivision.py" -"vtkmodules","Visualization/PointSize.py" -"vtkmodules","Visualization/ProgrammableGlyphFilter.py" -"vtkmodules","Visualization/ProgrammableGlyphs.py" -"vtkmodules","Visualization/QuadricVisualization.py" -"vtkmodules","Visualization/ShadowsLightsDemo.py" -"vtkmodules","Visualization/SphereTexture.py" -"vtkmodules","Visualization/StreamLines.py" -"vtkmodules","Visualization/TextSource.py" -"vtkmodules","Visualization/VectorText.py" -"vtkmodules","Visualization/WindowTitle.py" -"vtkmodules","VolumeRendering/PseudoVolumeRendering.py" -"vtkmodules","VolumeRendering/SimpleRayCast.py" -"vtkmodules","Widgets/BalloonWidget.py" -"vtkmodules","Widgets/BoxWidget.py" -"vtkmodules","Widgets/CameraOrientationWidget.py" -"vtkmodules","Widgets/CompassWidget.py" -"vtkmodules","Widgets/ContourWidget.py" -"vtkmodules","Widgets/EmbedInPyQt2.py" -"vtkmodules","Widgets/EmbedInPyQt.py" -"vtkmodules","Widgets/ImplicitPlaneWidget2.py" -"vtkmodules","Widgets/OrientationMarkerWidget1.py" -"vtkmodules","Widgets/OrientationMarkerWidget.py" -"vtkmodules","Widgets/ScalarBarWidget.py" -"vtkmodules","Widgets/SphereWidget.py" -"vtkmodules","Widgets/SplineWidget.py" -"vtkmodules","Widgets/TextWidget.py" -"vtkMultiBlockDataSet","CompositeData/CompositePolyDataMapper.py" -"vtkMultiBlockDataSet","CompositeData/MultiBlockDataSet.py" -"vtkMultiBlockDataSet","PolyData/CellsInsideObject.py" -"vtkMultiBlockPLOT3DReader","IO/ReadPLOT3D.py" -"vtkMultiBlockPLOT3DReader","Rendering/Rainbow.py" -"vtkMultiBlockPLOT3DReader","Texture/TextureThreshold.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/BluntStreamlines.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/LOxGrid.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/LOx.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/LOxSeeds.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/ProbeCombustor.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/VelocityProfile.py" -"vtkMultiBlockPLOT3DReader","VisualizationAlgorithms/WarpCombustor.py" -"vtkMultiBlockPLOT3DReader","Visualization/StreamLines.py" -"vtkMultiBlockPLOT3DReader","VolumeRendering/PseudoVolumeRendering.py" -"vtkMultiThreshold","PolyData/CellsInsideObject.py" -"vtkMutableDirectedGraph","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkMutableDirectedGraph","Graphs/ColorEdges.py" -"vtkMutableDirectedGraph","Graphs/ColorVertexLabels.py" -"vtkMutableDirectedGraph","Graphs/ColorVerticesLookupTable.py" -"vtkMutableDirectedGraph","Graphs/ConstructTree.py" -"vtkMutableDirectedGraph","Graphs/CreateTree.py" -"vtkMutableDirectedGraph","Graphs/EdgeWeights.py" -"vtkMutableDirectedGraph","Graphs/VisualizeDirectedGraph.py" -"vtkMutableDirectedGraph","Graphs/VisualizeGraph.py" -"vtkMutableUndirectedGraph","Graphs/ConstructGraph.py" -"vtkMutableUndirectedGraph","Graphs/GraphToPolyData.py" -"vtkMutableUndirectedGraph","Graphs/LabelVerticesAndEdges.py" -"vtkMutableUndirectedGraph","Graphs/ScaleVertices.py" -"vtkMutableUndirectedGraph","Graphs/SideBySideGraphs.py" -"vtkMyCallback","Tutorial/Tutorial_Step2.py" -"vtkMyCallback","Tutorial/Tutorial_Step6.py" -"vtkNamedColors","Annotation/MultiLineText.py" -"vtkNamedColors","Annotation/TextOrigin.py" -"vtkNamedColors","CompositeData/CompositePolyDataMapper.py" -"vtkNamedColors","CompositeData/MultiBlockDataSet.py" -"vtkNamedColors","CompositeData/OverlappingAMR.py" -"vtkNamedColors","DataManipulation/LineOnMesh.py" -"vtkNamedColors","DataManipulation/MeshLabelImageColor.py" -"vtkNamedColors","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkNamedColors","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkNamedColors","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkNamedColors","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkNamedColors","Deprecated/Geovis/GeoGraticle.py" -"vtkNamedColors","ExplicitStructuredGrid/CreateESGrid.py" -"vtkNamedColors","ExplicitStructuredGrid/LoadESGrid.py" -"vtkNamedColors","Filtering/AppendFilter.py" -"vtkNamedColors","Filtering/CombinePolyData.py" -"vtkNamedColors","Filtering/ConnectivityFilter.py" -"vtkNamedColors","Filtering/ConstrainedDelaunay2D.py" -"vtkNamedColors","Filtering/Delaunay2D.py" -"vtkNamedColors","Filtering/GaussianSplat.py" -"vtkNamedColors","Filtering/Glyph2D.py" -"vtkNamedColors","Filtering/Glyph3D.py" -"vtkNamedColors","Filtering/PerlinNoise.py" -"vtkNamedColors","Filtering/TransformPolyData.py" -"vtkNamedColors","Filtering/TriangulateTerrainMap.py" -"vtkNamedColors","Filtering/VertexGlyphFilter.py" -"vtkNamedColors","Filtering/WarpTo.py" -"vtkNamedColors","GeometricObjects/Arrow.py" -"vtkNamedColors","GeometricObjects/Axes.py" -"vtkNamedColors","GeometricObjects/Cell3DDemonstration.py" -"vtkNamedColors","GeometricObjects/CellTypeSource.py" -"vtkNamedColors","GeometricObjects/Circle.py" -"vtkNamedColors","GeometricObjects/ColoredLines.py" -"vtkNamedColors","GeometricObjects/Cone.py" -"vtkNamedColors","GeometricObjects/ConvexPointSet.py" -"vtkNamedColors","GeometricObjects/Cube1.py" -"vtkNamedColors","GeometricObjects/Cube.py" -"vtkNamedColors","GeometricObjects/CylinderExample.py" -"vtkNamedColors","GeometricObjects/Cylinder.py" -"vtkNamedColors","GeometricObjects/Disk.py" -"vtkNamedColors","GeometricObjects/Dodecahedron.py" -"vtkNamedColors","GeometricObjects/EarthSource.py" -"vtkNamedColors","GeometricObjects/EllipticalCylinderDemo.py" -"vtkNamedColors","GeometricObjects/EllipticalCylinder.py" -"vtkNamedColors","GeometricObjects/Frustum.py" -"vtkNamedColors","GeometricObjects/GeometricObjectsDemo.py" -"vtkNamedColors","GeometricObjects/Hexahedron.py" -"vtkNamedColors","GeometricObjects/IsoparametricCellsDemo.py" -"vtkNamedColors","GeometricObjects/LinearCellsDemo.py" -"vtkNamedColors","GeometricObjects/Line.py" -"vtkNamedColors","GeometricObjects/LongLine.py" -"vtkNamedColors","GeometricObjects/OrientedArrow.py" -"vtkNamedColors","GeometricObjects/OrientedCylinder.py" -"vtkNamedColors","GeometricObjects/ParametricKuenDemo.py" -"vtkNamedColors","GeometricObjects/ParametricObjectsDemo.py" -"vtkNamedColors","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkNamedColors","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkNamedColors","GeometricObjects/Plane.py" -"vtkNamedColors","GeometricObjects/Planes.py" -"vtkNamedColors","GeometricObjects/PlatonicSolids.py" -"vtkNamedColors","GeometricObjects/Point.py" -"vtkNamedColors","GeometricObjects/Polygon.py" -"vtkNamedColors","GeometricObjects/Polyhedron.py" -"vtkNamedColors","GeometricObjects/PolyLine1.py" -"vtkNamedColors","GeometricObjects/PolyLine.py" -"vtkNamedColors","GeometricObjects/Pyramid.py" -"vtkNamedColors","GeometricObjects/Quad.py" -"vtkNamedColors","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkNamedColors","GeometricObjects/QuadraticHexahedron.py" -"vtkNamedColors","GeometricObjects/QuadraticTetraDemo.py" -"vtkNamedColors","GeometricObjects/QuadraticTetra.py" -"vtkNamedColors","GeometricObjects/RegularPolygonSource.py" -"vtkNamedColors","GeometricObjects/ShrinkCube.py" -"vtkNamedColors","GeometricObjects/SourceObjectsDemo.py" -"vtkNamedColors","GeometricObjects/Sphere.py" -"vtkNamedColors","GeometricObjects/TessellatedBoxSource.py" -"vtkNamedColors","GeometricObjects/Tetrahedron.py" -"vtkNamedColors","GeometricObjects/TextActor.py" -"vtkNamedColors","GeometricObjects/Triangle.py" -"vtkNamedColors","GeometricObjects/TriangleStrip.py" -"vtkNamedColors","GeometricObjects/Vertex.py" -"vtkNamedColors","Graphs/ColorEdges.py" -"vtkNamedColors","Graphs/ColorVertexLabels.py" -"vtkNamedColors","Graphs/ColorVerticesLookupTable.py" -"vtkNamedColors","Graphs/ConstructGraph.py" -"vtkNamedColors","Graphs/EdgeWeights.py" -"vtkNamedColors","Graphs/GraphToPolyData.py" -"vtkNamedColors","Graphs/LabelVerticesAndEdges.py" -"vtkNamedColors","Graphs/RandomGraphSource.py" -"vtkNamedColors","Graphs/ScaleVertices.py" -"vtkNamedColors","Graphs/SideBySideGraphs.py" -"vtkNamedColors","HyperTreeGrid/HyperTreeGridSource.py" -"vtkNamedColors","ImageData/ImageDataGeometryFilter.py" -"vtkNamedColors","ImageData/ImageNormalize.py" -"vtkNamedColors","ImageData/ImageWeightedSum.py" -"vtkNamedColors","ImageData/WriteReadVtkImageData.py" -"vtkNamedColors","ImageProcessing/Attenuation.py" -"vtkNamedColors","ImageProcessing/EnhanceEdges.py" -"vtkNamedColors","ImageProcessing/GaussianSmooth.py" -"vtkNamedColors","ImageProcessing/HybridMedianComparison.py" -"vtkNamedColors","ImageProcessing/IdealHighPass.py" -"vtkNamedColors","ImageProcessing/IsoSubsample.py" -"vtkNamedColors","ImageProcessing/MedianComparison.py" -"vtkNamedColors","ImageProcessing/MorphologyComparison.py" -"vtkNamedColors","ImageProcessing/Pad.py" -"vtkNamedColors","ImageProcessing/VTKSpectrum.py" -"vtkNamedColors","Images/Actor2D.py" -"vtkNamedColors","Images/BackgroundImage.py" -"vtkNamedColors","Images/Cast.py" -"vtkNamedColors","Images/ImageWarp.py" -"vtkNamedColors","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkNamedColors","ImplicitFunctions/ImplicitQuadric.py" -"vtkNamedColors","ImplicitFunctions/ImplicitSphere1.py" -"vtkNamedColors","ImplicitFunctions/ImplicitSphere.py" -"vtkNamedColors","ImplicitFunctions/SampleFunction.py" -"vtkNamedColors","InfoVis/ParallelCoordinatesExtraction.py" -"vtkNamedColors","InfoVis/ParallelCoordinatesView.py" -"vtkNamedColors","InfoVis/SelectedGraphIDs.py" -"vtkNamedColors","Interaction/CallBack.py" -"vtkNamedColors","Interaction/InteractorStyleTrackballActor.py" -"vtkNamedColors","Interaction/InteractorStyleTrackballCamera.py" -"vtkNamedColors","Interaction/MouseEventsObserver.py" -"vtkNamedColors","Interaction/MouseEvents.py" -"vtkNamedColors","IO/3DSImporter.py" -"vtkNamedColors","IO/CSVReadEdit1.py" -"vtkNamedColors","IO/CSVReadEdit.py" -"vtkNamedColors","IO/ImageWriter.py" -"vtkNamedColors","IO/ReadDICOM.py" -"vtkNamedColors","IO/ReadDICOMSeries.py" -"vtkNamedColors","IO/ReadExodusData.py" -"vtkNamedColors","IO/ReadImageData.py" -"vtkNamedColors","IO/ReadLegacyUnstructuredGrid.py" -"vtkNamedColors","IO/ReadPLOT3D.py" -"vtkNamedColors","IO/ReadPolyData.py" -"vtkNamedColors","IO/ReadSLC.py" -"vtkNamedColors","IO/ReadSTL.py" -"vtkNamedColors","IO/ReadUnstructuredGrid.py" -"vtkNamedColors","IO/ReadVTP.py" -"vtkNamedColors","IO/TransientHDFReader.py" -"vtkNamedColors","IO/WritePLY.py" -"vtkNamedColors","IO/WriteSTL.py" -"vtkNamedColors","Medical/GenerateCubesFromLabels.py" -"vtkNamedColors","Medical/MedicalDemo1.py" -"vtkNamedColors","Medical/MedicalDemo2.py" -"vtkNamedColors","Medical/MedicalDemo3.py" -"vtkNamedColors","Medical/MedicalDemo4.py" -"vtkNamedColors","Medical/TissueLens.py" -"vtkNamedColors","Meshes/BoundaryEdges.py" -"vtkNamedColors","Meshes/CapClip.py" -"vtkNamedColors","Meshes/ClipDataSetWithPolyData1.py" -"vtkNamedColors","Meshes/ClipDataSetWithPolyData.py" -"vtkNamedColors","Meshes/ColoredElevationMap.py" -"vtkNamedColors","Meshes/Decimation.py" -"vtkNamedColors","Meshes/DeformPointSet.py" -"vtkNamedColors","Meshes/PointInterpolator.py" -"vtkNamedColors","Meshes/SolidClip.py" -"vtkNamedColors","Modelling/Bottle.py" -"vtkNamedColors","Modelling/CappedSphere.py" -"vtkNamedColors","Modelling/ContourTriangulator.py" -"vtkNamedColors","Modelling/DelaunayMesh.py" -"vtkNamedColors","Modelling/DiscreteMarchingCubes.py" -"vtkNamedColors","Modelling/ExtractLargestIsosurface.py" -"vtkNamedColors","Modelling/FinanceFieldData.py" -"vtkNamedColors","Modelling/Finance.py" -"vtkNamedColors","Modelling/MarchingCubes.py" -"vtkNamedColors","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkNamedColors","Modelling/Spring.py" -"vtkNamedColors","Picking/CellPicking.py" -"vtkNamedColors","Picking/HighlightPickedActor.py" -"vtkNamedColors","Picking/HighlightWithSilhouette.py" -"vtkNamedColors","Plotting/MultiplePlots.py" -"vtkNamedColors","Plotting/ScatterPlot.py" -"vtkNamedColors","Plotting/SpiderPlot.py" -"vtkNamedColors","Plotting/SurfacePlot.py" -"vtkNamedColors","PolyData/AlignTwoPolyDatas.py" -"vtkNamedColors","PolyData/BooleanOperationPolyDataFilter.py" -"vtkNamedColors","PolyData/CellsInsideObject.py" -"vtkNamedColors","PolyData/ColoredTriangle.py" -"vtkNamedColors","PolyData/CurvaturesAdjustEdges.py" -"vtkNamedColors","PolyData/CurvaturesDemo.py" -"vtkNamedColors","PolyData/Curvatures.py" -"vtkNamedColors","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkNamedColors","PolyData/ExtractSelection.py" -"vtkNamedColors","PolyData/ExtractSelectionUsingCells.py" -"vtkNamedColors","PolyData/FilledPolygon.py" -"vtkNamedColors","PolyData/ImplicitPolyDataDistance.py" -"vtkNamedColors","PolyData/Outline.py" -"vtkNamedColors","PolyData/PointSource.py" -"vtkNamedColors","PolyData/RotationAroundLine.py" -"vtkNamedColors","PolyData/RuledSurfaceFilter.py" -"vtkNamedColors","PolyData/SmoothMeshGrid.py" -"vtkNamedColors","PolyData/SolidColoredTriangle.py" -"vtkNamedColors","PolyData/TriangleColoredPoints.py" -"vtkNamedColors","PolyData/TubeFilter.py" -"vtkNamedColors","PolyData/WarpVector.py" -"vtkNamedColors","RectilinearGrid/RectilinearGrid.py" -"vtkNamedColors","RectilinearGrid/RGrid.py" -"vtkNamedColors","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkNamedColors","Rendering/AmbientSpheres.py" -"vtkNamedColors","Rendering/CameraBlur.py" -"vtkNamedColors","Rendering/ColoredSphere.py" -"vtkNamedColors","Rendering/Cone3.py" -"vtkNamedColors","Rendering/Cone4.py" -"vtkNamedColors","Rendering/DiffuseSpheres.py" -"vtkNamedColors","Rendering/FlatVersusGouraud.py" -"vtkNamedColors","Rendering/GradientBackground.py" -"vtkNamedColors","Rendering/LayeredActors.py" -"vtkNamedColors","Rendering/Mace.py" -"vtkNamedColors","Rendering/Model.py" -"vtkNamedColors","Rendering/MotionBlur.py" -"vtkNamedColors","Rendering/OutlineGlowPass.py" -"vtkNamedColors","Rendering/PBR_Anisotropy.py" -"vtkNamedColors","Rendering/PBR_Clear_Coat.py" -"vtkNamedColors","Rendering/PBR_Edge_Tint.py" -"vtkNamedColors","Rendering/PBR_HDR_Environment.py" -"vtkNamedColors","Rendering/PBR_Mapping.py" -"vtkNamedColors","Rendering/PBR_Materials_Coat.py" -"vtkNamedColors","Rendering/PBR_Materials.py" -"vtkNamedColors","Rendering/PBR_Skybox_Anisotropy.py" -"vtkNamedColors","Rendering/PBR_Skybox.py" -"vtkNamedColors","Rendering/PBR_Skybox_Texturing.py" -"vtkNamedColors","Rendering/Rainbow.py" -"vtkNamedColors","Rendering/Rotations.py" -"vtkNamedColors","Rendering/Shadows.py" -"vtkNamedColors","Rendering/SpecularSpheres.py" -"vtkNamedColors","Rendering/StippledLine.py" -"vtkNamedColors","Rendering/StripFran.py" -"vtkNamedColors","Rendering/TransformSphere.py" -"vtkNamedColors","Rendering/TransparentBackground.py" -"vtkNamedColors","Rendering/WalkCow.py" -"vtkNamedColors","StructuredGrid/BlankPoint.py" -"vtkNamedColors","StructuredGrid/SGrid.py" -"vtkNamedColors","StructuredPoints/Vol.py" -"vtkNamedColors","Texture/AnimateVectors.py" -"vtkNamedColors","Texture/TextureCutQuadric.py" -"vtkNamedColors","Texture/TextureCutSphere.py" -"vtkNamedColors","Texture/TexturePlane.py" -"vtkNamedColors","Texture/TextureThreshold.py" -"vtkNamedColors","Tutorial/Tutorial_Step1.py" -"vtkNamedColors","Tutorial/Tutorial_Step2.py" -"vtkNamedColors","Tutorial/Tutorial_Step3.py" -"vtkNamedColors","Tutorial/Tutorial_Step4.py" -"vtkNamedColors","Tutorial/Tutorial_Step5.py" -"vtkNamedColors","Tutorial/Tutorial_Step6.py" -"vtkNamedColors","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkNamedColors","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkNamedColors","UnstructuredGrid/UGrid.py" -"vtkNamedColors","Utilities/Animation.py" -"vtkNamedColors","Utilities/ColorMapToLUT.py" -"vtkNamedColors","Utilities/JSONColorMapToLUT.py" -"vtkNamedColors","Utilities/RescaleReverseLUT.py" -"vtkNamedColors","Utilities/ResetCameraOrientation.py" -"vtkNamedColors","Utilities/SaveSceneToFieldData.py" -"vtkNamedColors","Utilities/SaveSceneToFile.py" -"vtkNamedColors","Utilities/Screenshot.py" -"vtkNamedColors","Utilities/ShareCamera.py" -"vtkNamedColors","Utilities/VTKWithNumpy.py" -"vtkNamedColors","Utilities/XMLColorMapToLUT.py" -"vtkNamedColors","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkNamedColors","VisualizationAlgorithms/BluntStreamlines.py" -"vtkNamedColors","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkNamedColors","VisualizationAlgorithms/CarotidFlow.py" -"vtkNamedColors","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkNamedColors","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkNamedColors","VisualizationAlgorithms/ContourQuadric.py" -"vtkNamedColors","VisualizationAlgorithms/CreateBFont.py" -"vtkNamedColors","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkNamedColors","VisualizationAlgorithms/Cutter.py" -"vtkNamedColors","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkNamedColors","VisualizationAlgorithms/CutWithScalars.py" -"vtkNamedColors","VisualizationAlgorithms/DataSetSurface.py" -"vtkNamedColors","VisualizationAlgorithms/DecimateFran.py" -"vtkNamedColors","VisualizationAlgorithms/DecimateHawaii.py" -"vtkNamedColors","VisualizationAlgorithms/DisplacementPlot.py" -"vtkNamedColors","VisualizationAlgorithms/ExponentialCosine.py" -"vtkNamedColors","VisualizationAlgorithms/ExtractData.py" -"vtkNamedColors","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkNamedColors","VisualizationAlgorithms/HeadBone.py" -"vtkNamedColors","VisualizationAlgorithms/HeadSlice.py" -"vtkNamedColors","VisualizationAlgorithms/Hello.py" -"vtkNamedColors","VisualizationAlgorithms/HyperStreamline.py" -"vtkNamedColors","VisualizationAlgorithms/IceCream.py" -"vtkNamedColors","VisualizationAlgorithms/ImageGradient.py" -"vtkNamedColors","VisualizationAlgorithms/IronIsoSurface.py" -"vtkNamedColors","VisualizationAlgorithms/LOxGrid.py" -"vtkNamedColors","VisualizationAlgorithms/LOx.py" -"vtkNamedColors","VisualizationAlgorithms/LOxSeeds.py" -"vtkNamedColors","VisualizationAlgorithms/MarchingCases.py" -"vtkNamedColors","VisualizationAlgorithms/Motor.py" -"vtkNamedColors","VisualizationAlgorithms/Office.py" -"vtkNamedColors","VisualizationAlgorithms/OfficeTube.py" -"vtkNamedColors","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkNamedColors","VisualizationAlgorithms/PineRootDecimation.py" -"vtkNamedColors","VisualizationAlgorithms/PlateVibration.py" -"vtkNamedColors","VisualizationAlgorithms/ProbeCombustor.py" -"vtkNamedColors","VisualizationAlgorithms/SingleSplat.py" -"vtkNamedColors","VisualizationAlgorithms/SpikeFran.py" -"vtkNamedColors","VisualizationAlgorithms/SplatFace.py" -"vtkNamedColors","VisualizationAlgorithms/Stocks.py" -"vtkNamedColors","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkNamedColors","VisualizationAlgorithms/TensorAxes.py" -"vtkNamedColors","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkNamedColors","VisualizationAlgorithms/VelocityProfile.py" -"vtkNamedColors","VisualizationAlgorithms/WarpCombustor.py" -"vtkNamedColors","Visualization/AlphaFrequency.py" -"vtkNamedColors","Visualization/AnnotatedCubeActor.py" -"vtkNamedColors","Visualization/AssignCellColorsFromLUT.py" -"vtkNamedColors","Visualization/BillboardTextActor3D.py" -"vtkNamedColors","Visualization/BlobbyLogo.py" -"vtkNamedColors","Visualization/Blow.py" -"vtkNamedColors","Visualization/CameraModel1.py" -"vtkNamedColors","Visualization/CameraModel2.py" -"vtkNamedColors","Visualization/Camera.py" -"vtkNamedColors","Visualization/ClampGlyphSizes.py" -"vtkNamedColors","Visualization/CollisionDetection.py" -"vtkNamedColors","Visualization/ColorAnActor.py" -"vtkNamedColors","Visualization/ColoredAnnotatedCube.py" -"vtkNamedColors","Visualization/ColorSeriesPatches.py" -"vtkNamedColors","Visualization/ComplexV.py" -"vtkNamedColors","Visualization/CreateColorSeriesDemo.py" -"vtkNamedColors","Visualization/CubeAxesActor.py" -"vtkNamedColors","Visualization/CurvatureBandsWithGlyphs.py" -"vtkNamedColors","Visualization/DisplayCoordinateAxes.py" -"vtkNamedColors","Visualization/DisplayQuadricSurfaces.py" -"vtkNamedColors","Visualization/ElevationBandsWithGlyphs.py" -"vtkNamedColors","Visualization/FrogBrain.py" -"vtkNamedColors","Visualization/FroggieSurface.py" -"vtkNamedColors","Visualization/FroggieView.py" -"vtkNamedColors","Visualization/FrogSlice.py" -"vtkNamedColors","Visualization/GlyphTable.py" -"vtkNamedColors","Visualization/Hanoi.py" -"vtkNamedColors","Visualization/HardwareSelector.py" -"vtkNamedColors","Visualization/Hawaii.py" -"vtkNamedColors","Visualization/IsosurfaceSampling.py" -"vtkNamedColors","Visualization/Kitchen.py" -"vtkNamedColors","Visualization/KochSnowflake.py" -"vtkNamedColors","Visualization/LoopShrink.py" -"vtkNamedColors","Visualization/Lorenz.py" -"vtkNamedColors","Visualization/MultipleRenderWindows.py" -"vtkNamedColors","Visualization/MultipleViewports.py" -"vtkNamedColors","Visualization/NamedColorPatches.py" -"vtkNamedColors","Visualization/NamedColors.py" -"vtkNamedColors","Visualization/NormalsDemo.py" -"vtkNamedColors","Visualization/OrientedGlyphs.py" -"vtkNamedColors","Visualization/PointDataSubdivision.py" -"vtkNamedColors","Visualization/PointSize.py" -"vtkNamedColors","Visualization/ProgrammableGlyphFilter.py" -"vtkNamedColors","Visualization/ProgrammableGlyphs.py" -"vtkNamedColors","Visualization/QuadricVisualization.py" -"vtkNamedColors","Visualization/ShadowsLightsDemo.py" -"vtkNamedColors","Visualization/SphereTexture.py" -"vtkNamedColors","Visualization/StreamLines.py" -"vtkNamedColors","Visualization/TextSource.py" -"vtkNamedColors","Visualization/VectorText.py" -"vtkNamedColors","Visualization/WindowTitle.py" -"vtkNamedColors","VolumeRendering/PseudoVolumeRendering.py" -"vtkNamedColors","VolumeRendering/SimpleRayCast.py" -"vtkNamedColors","Widgets/BalloonWidget.py" -"vtkNamedColors","Widgets/BoxWidget.py" -"vtkNamedColors","Widgets/CameraOrientationWidget.py" -"vtkNamedColors","Widgets/CompassWidget.py" -"vtkNamedColors","Widgets/ContourWidget.py" -"vtkNamedColors","Widgets/ImplicitPlaneWidget2.py" -"vtkNamedColors","Widgets/OrientationMarkerWidget1.py" -"vtkNamedColors","Widgets/OrientationMarkerWidget.py" -"vtkNamedColors","Widgets/ScalarBarWidget.py" -"vtkNamedColors","Widgets/SphereWidget.py" -"vtkNamedColors","Widgets/SplineWidget.py" -"vtkNamedColors","Widgets/TextWidget.py" -"vtkNamedColor","Visualization/NamedColors.py" -"vtkNew","Utilities/JSONColorMapToLUT.py" -"vtkNew","Utilities/XMLColorMapToLUT.py" -"vtkOBBTree","PolyData/AlignTwoPolyDatas.py" -"vtkOBJReader","Meshes/CapClip.py" -"vtkOBJReader","Meshes/Decimation.py" -"vtkOBJReader","PolyData/AlignTwoPolyDatas.py" -"vtkOBJReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkOBJReader","PolyData/CellsInsideObject.py" -"vtkOBJReader","PolyData/ClosedSurface.py" -"vtkOBJReader","Rendering/FlatVersusGouraud.py" -"vtkOBJReader","Rendering/GradientBackground.py" -"vtkOBJReader","Rendering/Rotations.py" -"vtkOBJReader","Rendering/Shadows.py" -"vtkOBJReader","Utilities/SaveSceneToFieldData.py" -"vtkOBJReader","Utilities/SaveSceneToFile.py" -"vtkOBJReader","Visualization/NormalsDemo.py" -"vtkOpaquePass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkOpaquePass","Rendering/PBR_Skybox.py" -"vtkOpaquePass","Rendering/PBR_Skybox_Texturing.py" -"vtkOpaquePass","Visualization/ShadowsLightsDemo.py" -"vtkOpenGLRayCastImageDisplayHelper","Utilities/VTKWithNumpy.py" -"vtkOpenGLRayCastImageDisplayHelper","VolumeRendering/SimpleRayCast.py" -"vtkOpenGLRenderer","Rendering/PBR_Anisotropy.py" -"vtkOpenGLRenderer","Rendering/PBR_Clear_Coat.py" -"vtkOpenGLRenderer","Rendering/PBR_Edge_Tint.py" -"vtkOpenGLRenderer","Rendering/PBR_HDR_Environment.py" -"vtkOpenGLRenderer","Rendering/PBR_Mapping.py" -"vtkOpenGLRenderer","Rendering/PBR_Materials_Coat.py" -"vtkOpenGLRenderer","Rendering/PBR_Materials.py" -"vtkOpenGLRenderer","Rendering/PBR_Skybox_Anisotropy.py" -"vtkOpenGLRenderer","Rendering/PBR_Skybox.py" -"vtkOpenGLRenderer","Rendering/PBR_Skybox_Texturing.py" -"vtkOpenGLRenderer","Visualization/ShadowsLightsDemo.py" -"vtkOpenGLSkybox","Rendering/PBR_Anisotropy.py" -"vtkOpenGLSkybox","Rendering/PBR_Materials_Coat.py" -"vtkOpenGLSkybox","Rendering/PBR_Materials.py" -"vtkOrientationMarkerWidget","GeometricObjects/IsoparametricCellsDemo.py" -"vtkOrientationMarkerWidget","GeometricObjects/LinearCellsDemo.py" -"vtkOrientationMarkerWidget","Interaction/CallBack.py" -"vtkOrientationMarkerWidget","IO/CSVReadEdit1.py" -"vtkOrientationMarkerWidget","IO/CSVReadEdit.py" -"vtkOrientationMarkerWidget","PolyData/AlignTwoPolyDatas.py" -"vtkOrientationMarkerWidget","Rendering/PBR_Skybox_Anisotropy.py" -"vtkOrientationMarkerWidget","Rendering/PBR_Skybox.py" -"vtkOrientationMarkerWidget","Rendering/PBR_Skybox_Texturing.py" -"vtkOrientationMarkerWidget","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkOrientationMarkerWidget","Visualization/ColoredAnnotatedCube.py" -"vtkOrientationMarkerWidget","Visualization/DisplayCoordinateAxes.py" -"vtkOrientationMarkerWidget","Visualization/FroggieSurface.py" -"vtkOrientationMarkerWidget","Visualization/FroggieView.py" -"vtkOrientationMarkerWidget","Visualization/PointDataSubdivision.py" -"vtkOrientationMarkerWidget","Widgets/OrientationMarkerWidget1.py" -"vtkOrientationMarkerWidget","Widgets/OrientationMarkerWidget.py" -"vtkOrientedGlyphContourRepresentation","Widgets/ContourWidget.py" -"vtkOutlineFilter","CompositeData/OverlappingAMR.py" -"vtkOutlineFilter","ImplicitFunctions/SampleFunction.py" -"vtkOutlineFilter","InfoVis/ParallelCoordinatesExtraction.py" -"vtkOutlineFilter","Interaction/CallBack.py" -"vtkOutlineFilter","IO/ReadSLC.py" -"vtkOutlineFilter","Medical/MedicalDemo1.py" -"vtkOutlineFilter","Medical/MedicalDemo2.py" -"vtkOutlineFilter","Medical/MedicalDemo3.py" -"vtkOutlineFilter","PolyData/Outline.py" -"vtkOutlineFilter","Texture/AnimateVectors.py" -"vtkOutlineFilter","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkOutlineFilter","VisualizationAlgorithms/CarotidFlow.py" -"vtkOutlineFilter","VisualizationAlgorithms/ContourQuadric.py" -"vtkOutlineFilter","VisualizationAlgorithms/ExtractData.py" -"vtkOutlineFilter","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkOutlineFilter","VisualizationAlgorithms/HeadBone.py" -"vtkOutlineFilter","VisualizationAlgorithms/HeadSlice.py" -"vtkOutlineFilter","VisualizationAlgorithms/HyperStreamline.py" -"vtkOutlineFilter","VisualizationAlgorithms/IronIsoSurface.py" -"vtkOutlineFilter","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkOutlineFilter","VisualizationAlgorithms/PineRootDecimation.py" -"vtkOutlineFilter","VisualizationAlgorithms/PlateVibration.py" -"vtkOutlineFilter","VisualizationAlgorithms/ProbeCombustor.py" -"vtkOutlineFilter","VisualizationAlgorithms/SingleSplat.py" -"vtkOutlineFilter","VisualizationAlgorithms/TensorAxes.py" -"vtkOutlineFilter","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkOutlineFilter","Visualization/ComplexV.py" -"vtkOutlineFilter","Visualization/DisplayQuadricSurfaces.py" -"vtkOutlineFilter","Visualization/QuadricVisualization.py" -"vtkOutlineGlowPass","Rendering/OutlineGlowPass.py" -"vtkOverlappingAMR","CompositeData/OverlappingAMR.py" -"vtkOverlayPass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkOverlayPass","Rendering/PBR_Skybox.py" -"vtkOverlayPass","Rendering/PBR_Skybox_Texturing.py" -"vtkParallelCoordinatesRepresentation","InfoVis/ParallelCoordinatesExtraction.py" -"vtkParallelCoordinatesRepresentation","InfoVis/ParallelCoordinatesView.py" -"vtkParallelCoordinatesView","InfoVis/ParallelCoordinatesExtraction.py" -"vtkParallelCoordinatesView","InfoVis/ParallelCoordinatesView.py" -"vtkParametricBohemianDome","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricBohemianDome","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricBour","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricBour","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricBour","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricBoy","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricBoy","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricBoy","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricBoy","Rendering/PBR_Skybox_Anisotropy.py" -"vtkParametricBoy","Rendering/PBR_Skybox.py" -"vtkParametricBoy","Rendering/PBR_Skybox_Texturing.py" -"vtkParametricBoy","Visualization/PointDataSubdivision.py" -"vtkParametricCatalanMinimal","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricCatalanMinimal","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricConicSpiral","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricConicSpiral","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricConicSpiral","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricCrossCap","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricCrossCap","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricCrossCap","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricDini","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricDini","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricDini","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricEllipsoid","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricEllipsoid","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricEllipsoid","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricEllipsoid","Visualization/PointDataSubdivision.py" -"vtkParametricEnneper","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricEnneper","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricEnneper","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricEnneper","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricFigure8Klein","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricFigure8Klein","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricFigure8Klein","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricFunctionSource","DataManipulation/LineOnMesh.py" -"vtkParametricFunctionSource","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricFunctionSource","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricFunctionSource","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricFunctionSource","GeometricObjects/ParametricKuenDemo.py" -"vtkParametricFunctionSource","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricFunctionSource","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkParametricFunctionSource","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkParametricFunctionSource","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricFunctionSource","PolyData/CurvaturesDemo.py" -"vtkParametricFunctionSource","Rendering/PBR_Skybox_Anisotropy.py" -"vtkParametricFunctionSource","Rendering/PBR_Skybox.py" -"vtkParametricFunctionSource","Rendering/PBR_Skybox_Texturing.py" -"vtkParametricFunctionSource","Visualization/CurvatureBandsWithGlyphs.py" -"vtkParametricFunctionSource","Visualization/ElevationBandsWithGlyphs.py" -"vtkParametricFunctionSource","Visualization/PointDataSubdivision.py" -"vtkParametricHenneberg","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricHenneberg","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricKlein","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricKlein","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricKlein","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricKuen","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricKuen","GeometricObjects/ParametricKuenDemo.py" -"vtkParametricKuen","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricMobius","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricMobius","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricMobius","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricMobius","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricMobius","Rendering/PBR_Skybox_Anisotropy.py" -"vtkParametricMobius","Rendering/PBR_Skybox.py" -"vtkParametricMobius","Rendering/PBR_Skybox_Texturing.py" -"vtkParametricMobius","Visualization/PointDataSubdivision.py" -"vtkParametricPluckerConoid","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricPluckerConoid","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricPseudosphere","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkParametricPseudosphere","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricRandomHills","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricRandomHills","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricRandomHills","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricRandomHills","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricRandomHills","PolyData/CurvaturesDemo.py" -"vtkParametricRandomHills","Rendering/PBR_Skybox_Anisotropy.py" -"vtkParametricRandomHills","Rendering/PBR_Skybox.py" -"vtkParametricRandomHills","Rendering/PBR_Skybox_Texturing.py" -"vtkParametricRandomHills","Visualization/CurvatureBandsWithGlyphs.py" -"vtkParametricRandomHills","Visualization/ElevationBandsWithGlyphs.py" -"vtkParametricRandomHills","Visualization/PointDataSubdivision.py" -"vtkParametricRoman","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricRoman","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricRoman","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSpline","DataManipulation/LineOnMesh.py" -"vtkParametricSpline","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSpline","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricSpline","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSuperEllipsoid","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSuperEllipsoid","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricSuperEllipsoid","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSuperEllipsoid","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkParametricSuperToroid","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSuperToroid","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricSuperToroid","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricSuperToroid","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkParametricTorus","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricTorus","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkParametricTorus","GeometricObjects/ParametricObjectsDemo.py" -"vtkParametricTorus","PolyData/CurvaturesAdjustEdges.py" -"vtkParametricTorus","Rendering/PBR_Skybox_Anisotropy.py" -"vtkParametricTorus","Rendering/PBR_Skybox.py" -"vtkParametricTorus","Rendering/PBR_Skybox_Texturing.py" -"vtkParametricTorus","Visualization/CurvatureBandsWithGlyphs.py" -"vtkParametricTorus","Visualization/ElevationBandsWithGlyphs.py" -"vtkParametricTorus","Visualization/PointDataSubdivision.py" -"vtk_patterns","Utilities/VTKImportsForPython.py" -"vtkPentagonalPrism","GeometricObjects/Cell3DDemonstration.py" -"vtkPentagonalPrism","GeometricObjects/LinearCellsDemo.py" -"vtkPentagonalPrism","IO/WriteLegacyLinearCells.py" -"vtkPentagonalPrism","IO/WriteXMLLinearCells.py" -"vtkPerlinNoise","Filtering/PerlinNoise.py" -"vtkPiecewiseFunction","Medical/MedicalDemo4.py" -"vtkPiecewiseFunction","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkPiecewiseFunction","Utilities/VTKWithNumpy.py" -"vtkPiecewiseFunction","VolumeRendering/SimpleRayCast.py" -"vtkPixel","GeometricObjects/LinearCellsDemo.py" -"vtkPixel","IO/WriteLegacyLinearCells.py" -"vtkPixel","IO/WriteXMLLinearCells.py" -"vtkPlane","Meshes/CapClip.py" -"vtkPlane","Meshes/SolidClip.py" -"vtkPlane","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkPlane","PolyData/FilledPolygon.py" -"vtkPlane","PolyData/PolyDataContourToImageData.py" -"vtkPlane","PolyData/PolyDataToImageDataStencil.py" -"vtkPlane","Rendering/PBR_Skybox_Anisotropy.py" -"vtkPlane","Rendering/PBR_Skybox.py" -"vtkPlane","Rendering/PBR_Skybox_Texturing.py" -"vtkPlanes","GeometricObjects/Frustum.py" -"vtkPlanes","GeometricObjects/Planes.py" -"vtkPlanesIntersection","GeometricObjects/PlanesIntersection.py" -"vtkPlaneSource","GeometricObjects/Plane.py" -"vtkPlaneSource","GeometricObjects/SourceObjectsDemo.py" -"vtkPlaneSource","Picking/CellPicking.py" -"vtkPlaneSource","Texture/TexturePlane.py" -"vtkPlaneSource","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkPlaneSource","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkPlaneSource","VisualizationAlgorithms/ExponentialCosine.py" -"vtkPlaneSource","VisualizationAlgorithms/ProbeCombustor.py" -"vtkPlaneSource","Visualization/AssignCellColorsFromLUT.py" -"vtkPlaneSource","Visualization/CreateColorSeriesDemo.py" -"vtkPlaneSource","Visualization/CurvatureBandsWithGlyphs.py" -"vtkPlaneSource","Visualization/ElevationBandsWithGlyphs.py" -"vtkPlaneSource","Visualization/FrogSlice.py" -"vtkPlaneSource","Visualization/Hanoi.py" -"vtkPlaneSource","Visualization/ProgrammableGlyphs.py" -"vtkPlaneSource","Visualization/ShadowsLightsDemo.py" -"vtkPlaneSource","Visualization/StreamLines.py" -"vtkPlanesSource","Texture/TexturePlane.py" -"vtkPlanes","Texture/TextureCutSphere.py" -"vtkPlanes","VisualizationAlgorithms/Motor.py" -"vtkPlane","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkPlane","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkPlane","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkPlane","VisualizationAlgorithms/Cutter.py" -"vtkPlane","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkPlane","VisualizationAlgorithms/CutWithScalars.py" -"vtkPlane","VisualizationAlgorithms/DataSetSurface.py" -"vtkPlane","VisualizationAlgorithms/IceCream.py" -"vtkPlane","VolumeRendering/PseudoVolumeRendering.py" -"vtkPlane","Widgets/ImplicitPlaneWidget2.py" -"vtkPlatonicSolidSource","GeometricObjects/PlatonicSolids.py" -"vtkPlotPoints","Plotting/MultiplePlots.py" -"vtkPlotPoints","Plotting/ScatterPlot.py" -"vtkPlotSurface","Plotting/SurfacePlot.py" -"vtkPLYReader","IO/WritePLY.py" -"vtkPLYReader","Meshes/CapClip.py" -"vtkPLYReader","Meshes/Decimation.py" -"vtkPLYReader","PolyData/AlignTwoPolyDatas.py" -"vtkPLYReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkPLYReader","PolyData/CellsInsideObject.py" -"vtkPLYReader","PolyData/ClosedSurface.py" -"vtkPLYReader","Rendering/GradientBackground.py" -"vtkPLYReader","Rendering/MotionBlur.py" -"vtkPLYReader","Rendering/Rotations.py" -"vtkPLYReader","Rendering/Shadows.py" -"vtkPLYReader","Utilities/SaveSceneToFieldData.py" -"vtkPLYReader","Utilities/SaveSceneToFile.py" -"vtkPLYReader","Visualization/NormalsDemo.py" -"vtkPLYWriter","IO/WritePLY.py" -"vtkPNGReader","Modelling/ContourTriangulator.py" -"vtkPNGReader","PolyData/PolyDataToImageDataStencil.py" -"vtkPNGReader","Rendering/PBR_Clear_Coat.py" -"vtkPNGReader","Rendering/PBR_Mapping.py" -"vtkPNGReader","VisualizationAlgorithms/DecimateFran.py" -"vtkPNGWriter","GeometricObjects/Cell3DDemonstration.py" -"vtkPNGWriter","GeometricObjects/EarthSource.py" -"vtkPNGWriter","GeometricObjects/ParametricObjectsDemo.py" -"vtkPNGWriter","Images/Actor2D.py" -"vtkPNGWriter","IO/ImageWriter.py" -"vtkPNGWriter","PolyData/PolyDataContourToImageData.py" -"vtkPNGWriter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkPNGWriter","Rendering/PBR_Skybox.py" -"vtkPNGWriter","Rendering/PBR_Skybox_Texturing.py" -"vtkPNGWriter","Rendering/WalkCow.py" -"vtkPNGWriter","Utilities/Screenshot.py" -"vtkPNGWriter","Visualization/Hanoi.py" -"vtkPNGWriter","Visualization/PointDataSubdivision.py" -"vtkPNMReader","VisualizationAlgorithms/CreateBFont.py" -"vtkPNMWriter","IO/ImageWriter.py" -"vtkPNMWriter","Visualization/Hanoi.py" -"vtkPointGaussianMapper","Meshes/PointInterpolator.py" -"vtkPointInterpolator","Meshes/PointInterpolator.py" -"vtkPointLoad","VisualizationAlgorithms/HyperStreamline.py" -"vtkPointLoad","VisualizationAlgorithms/TensorAxes.py" -"vtkPointLoad","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkPoints","Annotation/MultiLineText.py" -"vtkPoints","DataManipulation/LineOnMesh.py" -"vtkPoints","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkPoints","ExplicitStructuredGrid/CreateESGrid.py" -"vtkPoints","Filtering/AppendFilter.py" -"vtkPoints","Filtering/ConstrainedDelaunay2D.py" -"vtkPoints","Filtering/Delaunay2D.py" -"vtkPoints","Filtering/Glyph2D.py" -"vtkPoints","Filtering/Glyph3D.py" -"vtkPoints","Filtering/IterativeClosestPoints.py" -"vtkPoints","Filtering/TriangulateTerrainMap.py" -"vtkPoints","Filtering/VertexGlyphFilter.py" -"vtkPoints","GeometricObjects/Cell3DDemonstration.py" -"vtkPoints","GeometricObjects/CellTypeSource.py" -"vtkPoints","GeometricObjects/ColoredLines.py" -"vtkPoints","GeometricObjects/ConvexPointSet.py" -"vtkPoints","GeometricObjects/Cube.py" -"vtkPoints","GeometricObjects/EllipticalCylinderDemo.py" -"vtkPoints","GeometricObjects/EllipticalCylinder.py" -"vtkPoints","GeometricObjects/Hexahedron.py" -"vtkPoints","GeometricObjects/LinearCellsDemo.py" -"vtkPoints","GeometricObjects/LongLine.py" -"vtkPoints","GeometricObjects/ParametricObjectsDemo.py" -"vtkPoints","GeometricObjects/PlanesIntersection.py" -"vtkPoints","GeometricObjects/Point.py" -"vtkPoints","GeometricObjects/PolygonIntersection.py" -"vtkPoints","GeometricObjects/Polygon.py" -"vtkPoints","GeometricObjects/Polyhedron.py" -"vtkPoints","GeometricObjects/PolyLine1.py" -"vtkPoints","GeometricObjects/PolyLine.py" -"vtkPoints","GeometricObjects/Pyramid.py" -"vtkPoints","GeometricObjects/Quad.py" -"vtkPoints","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkPoints","GeometricObjects/QuadraticHexahedron.py" -"vtkPoints","GeometricObjects/QuadraticTetraDemo.py" -"vtkPoints","GeometricObjects/QuadraticTetra.py" -"vtkPoints","GeometricObjects/Tetrahedron.py" -"vtkPoints","GeometricObjects/Triangle.py" -"vtkPoints","GeometricObjects/TriangleStrip.py" -"vtkPoints","GeometricObjects/Vertex.py" -"vtkPoints","Graphs/ColorVerticesLookupTable.py" -"vtkPoints","Graphs/GraphToPolyData.py" -"vtkPoints","Graphs/NOVCAGraph.py" -"vtkPoints","Graphs/SideBySideGraphs.py" -"vtkPoints","Images/Actor2D.py" -"vtkPoints","IO/CSVReadEdit.py" -"vtkPoints","IO/WriteLegacyLinearCells.py" -"vtkPoints","IO/WriteTriangleToFile.py" -"vtkPoints","IO/WriteXMLLinearCells.py" -"vtkPoints","Meshes/ColoredElevationMap.py" -"vtkPoints","Meshes/DeformPointSet.py" -"vtkPoints","Modelling/Bottle.py" -"vtkPoints","Modelling/CappedSphere.py" -"vtkPoints","Modelling/DelaunayMesh.py" -"vtkPoints","Modelling/Finance.py" -"vtkPoints","Modelling/Spring.py" -"vtkPointSource","Filtering/AppendFilter.py" -"vtkPointSource","GeometricObjects/SourceObjectsDemo.py" -"vtkPointSource","Graphs/NOVCAGraph.py" -"vtkPointSource","Interaction/InteractorStyleTrackballCamera.py" -"vtkPointSource","PolyData/ExtractSelection.py" -"vtkPointSource","PolyData/PointSource.py" -"vtkPointSource","VisualizationAlgorithms/CarotidFlow.py" -"vtkPointSource","VisualizationAlgorithms/LOxGrid.py" -"vtkPointSource","VisualizationAlgorithms/LOx.py" -"vtkPointSource","VisualizationAlgorithms/LOxSeeds.py" -"vtkPointSource","VisualizationAlgorithms/Office.py" -"vtkPointSource","Visualization/PointSize.py" -"vtkPoints","PolyData/AlignTwoPolyDatas.py" -"vtkPoints","PolyData/ColoredTriangle.py" -"vtkPoints","PolyData/CurvaturesAdjustEdges.py" -"vtkPoints","PolyData/ImplicitPolyDataDistance.py" -"vtkPoints","PolyData/IterateOverLines.py" -"vtkPoints","PolyData/RuledSurfaceFilter.py" -"vtkPoints","PolyData/SmoothMeshGrid.py" -"vtkPoints","PolyData/SolidColoredTriangle.py" -"vtkPoints","PolyData/TriangleColoredPoints.py" -"vtkPoints","PolyData/TriangleCorners.py" -"vtkPoints","PolyData/TriangleCornerVertices.py" -"vtkPoints","PolyData/WarpVector.py" -"vtkPoints","Rendering/GradientBackground.py" -"vtkPoints","StructuredGrid/BlankPoint.py" -"vtkPoints","StructuredGrid/SGrid.py" -"vtkPoints","Texture/TextureCutSphere.py" -"vtkPoints","UnstructuredGrid/UGrid.py" -"vtkPoints","VisualizationAlgorithms/DataSetSurface.py" -"vtkPoints","VisualizationAlgorithms/ExponentialCosine.py" -"vtkPoints","VisualizationAlgorithms/MarchingCases.py" -"vtkPoints","VisualizationAlgorithms/Motor.py" -"vtkPoints","VisualizationAlgorithms/SingleSplat.py" -"vtkPoints","Visualization/CameraModel1.py" -"vtkPoints","Visualization/CameraModel2.py" -"vtkPoints","Visualization/CurvatureBandsWithGlyphs.py" -"vtkPoints","Visualization/ElevationBandsWithGlyphs.py" -"vtkPoints","Visualization/KochSnowflake.py" -"vtkPoints","Visualization/ProgrammableGlyphFilter.py" -"vtkPoints","Widgets/ContourWidget.py" -"vtk","PolyData/AlignTwoPolyDatas.py" -"vtkPolyData","Annotation/MultiLineText.py" -"vtkPolyData","Arrays/GetValues.py" -"vtkPolyData","Arrays/RenameArray.py" -"vtk","PolyData/BooleanOperationPolyDataFilter.py" -"vtk","PolyData/CellsInsideObject.py" -"vtk","PolyData/ClosedSurface.py" -"vtkPolyDataConnectivityFilter","Modelling/ExtractLargestIsosurface.py" -"vtkPolyDataConnectivityFilter","VisualizationAlgorithms/PineRootConnectivity.py" -"vtk","PolyData/CurvaturesAdjustEdges.py" -"vtk","PolyData/CurvaturesDemo.py" -"vtk","PolyData/Curvatures.py" -"vtkPolyData","DataManipulation/LineOnMesh.py" -"vtkPolyData","DataManipulation/MeshLabelImageColor.py" -"vtkPolyData","Filtering/AppendFilter.py" -"vtkPolyData","Filtering/CombinePolyData.py" -"vtkPolyData","Filtering/ConstrainedDelaunay2D.py" -"vtkPolyData","Filtering/Delaunay2D.py" -"vtkPolyData","Filtering/GaussianSplat.py" -"vtkPolyData","Filtering/Glyph2D.py" -"vtkPolyData","Filtering/Glyph3D.py" -"vtkPolyData","Filtering/IterativeClosestPoints.py" -"vtkPolyData","Filtering/TriangulateTerrainMap.py" -"vtkPolyData","Filtering/VertexGlyphFilter.py" -"vtkPolyData","GeometricObjects/ColoredLines.py" -"vtkPolyData","GeometricObjects/ConvexPointSet.py" -"vtkPolyData","GeometricObjects/Cube.py" -"vtkPolyData","GeometricObjects/EllipticalCylinderDemo.py" -"vtkPolyData","GeometricObjects/EllipticalCylinder.py" -"vtkPolyData","GeometricObjects/LongLine.py" -"vtkPolyData","GeometricObjects/Planes.py" -"vtkPolyData","GeometricObjects/Point.py" -"vtkPolyData","GeometricObjects/Polygon.py" -"vtkPolyData","GeometricObjects/PolyLine1.py" -"vtkPolyData","GeometricObjects/PolyLine.py" -"vtkPolyData","GeometricObjects/Quad.py" -"vtkPolyData","GeometricObjects/Triangle.py" -"vtkPolyData","GeometricObjects/TriangleStrip.py" -"vtkPolyData","GeometricObjects/Vertex.py" -"vtkPolyData","Images/Actor2D.py" -"vtkPolyData","Interaction/InteractorStyleTrackballCamera.py" -"vtkPolyData","IO/CSVReadEdit.py" -"vtkPolyData","IO/WriteTriangleToFile.py" -"vtkPolyDataMapper2D","Annotation/MultiLineText.py" -"vtkPolyDataMapper2D","Images/Actor2D.py" -"vtkPolyDataMapper2D","Rendering/GradientBackground.py" -"vtkPolyDataMapper","Annotation/TextOrigin.py" -"vtkPolyDataMapper","CompositeData/MultiBlockDataSet.py" -"vtkPolyDataMapper","CompositeData/OverlappingAMR.py" -"vtkPolyDataMapper","DataManipulation/LineOnMesh.py" -"vtkPolyDataMapper","DataManipulation/MeshLabelImageColor.py" -"vtkPolyDataMapper","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkPolyDataMapper","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkPolyDataMapper","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkPolyDataMapper","Deprecated/Geovis/GeoGraticle.py" -"vtkPolyDataMapper","Filtering/CombinePolyData.py" -"vtkPolyDataMapper","Filtering/ConstrainedDelaunay2D.py" -"vtkPolyDataMapper","Filtering/Delaunay2D.py" -"vtkPolyDataMapper","Filtering/GaussianSplat.py" -"vtkPolyDataMapper","Filtering/Glyph2D.py" -"vtkPolyDataMapper","Filtering/Glyph3D.py" -"vtkPolyDataMapper","Filtering/PerlinNoise.py" -"vtkPolyDataMapper","Filtering/TransformPolyData.py" -"vtkPolyDataMapper","Filtering/TriangulateTerrainMap.py" -"vtkPolyDataMapper","Filtering/VertexGlyphFilter.py" -"vtkPolyDataMapper","GeometricObjects/Arrow.py" -"vtkPolyDataMapper","GeometricObjects/Axes.py" -"vtkPolyDataMapper","GeometricObjects/Circle.py" -"vtkPolyDataMapper","GeometricObjects/ColoredLines.py" -"vtkPolyDataMapper","GeometricObjects/Cone.py" -"vtkPolyDataMapper","GeometricObjects/Cube1.py" -"vtkPolyDataMapper","GeometricObjects/Cube.py" -"vtkPolyDataMapper","GeometricObjects/CylinderExample.py" -"vtkPolyDataMapper","GeometricObjects/Cylinder.py" -"vtkPolyDataMapper","GeometricObjects/Disk.py" -"vtkPolyDataMapper","GeometricObjects/Dodecahedron.py" -"vtkPolyDataMapper","GeometricObjects/EarthSource.py" -"vtkPolyDataMapper","GeometricObjects/EllipticalCylinderDemo.py" -"vtkPolyDataMapper","GeometricObjects/EllipticalCylinder.py" -"vtkPolyDataMapper","GeometricObjects/Frustum.py" -"vtkPolyDataMapper","GeometricObjects/GeometricObjectsDemo.py" -"vtkPolyDataMapper","GeometricObjects/IsoparametricCellsDemo.py" -"vtkPolyDataMapper","GeometricObjects/LinearCellsDemo.py" -"vtkPolyDataMapper","GeometricObjects/Line.py" -"vtkPolyDataMapper","GeometricObjects/LongLine.py" -"vtkPolyDataMapper","GeometricObjects/OrientedArrow.py" -"vtkPolyDataMapper","GeometricObjects/OrientedCylinder.py" -"vtkPolyDataMapper","GeometricObjects/ParametricKuenDemo.py" -"vtkPolyDataMapper","GeometricObjects/ParametricObjectsDemo.py" -"vtkPolyDataMapper","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkPolyDataMapper","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkPolyDataMapper","GeometricObjects/Plane.py" -"vtkPolyDataMapper","GeometricObjects/Planes.py" -"vtkPolyDataMapper","GeometricObjects/PlatonicSolids.py" -"vtkPolyDataMapper","GeometricObjects/Point.py" -"vtkPolyDataMapper","GeometricObjects/Polygon.py" -"vtkPolyDataMapper","GeometricObjects/PolyLine1.py" -"vtkPolyDataMapper","GeometricObjects/PolyLine.py" -"vtkPolyDataMapper","GeometricObjects/Quad.py" -"vtkPolyDataMapper","GeometricObjects/RegularPolygonSource.py" -"vtkPolyDataMapper","GeometricObjects/SourceObjectsDemo.py" -"vtkPolyDataMapper","GeometricObjects/Sphere.py" -"vtkPolyDataMapper","GeometricObjects/Triangle.py" -"vtkPolyDataMapper","GeometricObjects/Vertex.py" -"vtkPolyDataMapper","Graphs/GraphToPolyData.py" -"vtkPolyDataMapper","Graphs/VisualizeDirectedGraph.py" -"vtkPolyDataMapper","ImageData/ImageDataGeometryFilter.py" -"vtkPolyDataMapper","ImageData/WriteReadVtkImageData.py" -"vtkPolyDataMapper","ImageProcessing/IsoSubsample.py" -"vtkPolyDataMapper","Images/BackgroundImage.py" -"vtkPolyDataMapper","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkPolyDataMapper","ImplicitFunctions/ImplicitQuadric.py" -"vtkPolyDataMapper","ImplicitFunctions/ImplicitSphere1.py" -"vtkPolyDataMapper","ImplicitFunctions/ImplicitSphere.py" -"vtkPolyDataMapper","ImplicitFunctions/SampleFunction.py" -"vtkPolyDataMapper","InfoVis/ParallelCoordinatesExtraction.py" -"vtkPolyDataMapper","Interaction/CallBack.py" -"vtkPolyDataMapper","Interaction/InteractorStyleTrackballActor.py" -"vtkPolyDataMapper","Interaction/MouseEventsObserver.py" -"vtkPolyDataMapper","Interaction/MouseEvents.py" -"vtkPolyDataMapper","IO/CSVReadEdit1.py" -"vtkPolyDataMapper","IO/CSVReadEdit.py" -"vtkPolyDataMapper","IO/ImageWriter.py" -"vtkPolyDataMapper","IO/ReadExodusData.py" -"vtkPolyDataMapper","IO/ReadLegacyUnstructuredGrid.py" -"vtkPolyDataMapper","IO/ReadPLOT3D.py" -"vtkPolyDataMapper","IO/ReadPolyData.py" -"vtkPolyDataMapper","IO/ReadSLC.py" -"vtkPolyDataMapper","IO/ReadSTL.py" -"vtkPolyDataMapper","IO/ReadVTP.py" -"vtkPolyDataMapper","IO/TransientHDFReader.py" -"vtkPolyDataMapper","IO/WritePLY.py" -"vtkPolyDataMapper","IO/WriteSTL.py" -"vtkPolyDataMapper","Medical/GenerateCubesFromLabels.py" -"vtkPolyDataMapper","Medical/MedicalDemo1.py" -"vtkPolyDataMapper","Medical/MedicalDemo2.py" -"vtkPolyDataMapper","Medical/MedicalDemo3.py" -"vtkPolyDataMapper","Meshes/BoundaryEdges.py" -"vtkPolyDataMapper","Meshes/CapClip.py" -"vtkPolyDataMapper","Meshes/ClipDataSetWithPolyData1.py" -"vtkPolyDataMapper","Meshes/ClipDataSetWithPolyData.py" -"vtkPolyDataMapper","Meshes/ColoredElevationMap.py" -"vtkPolyDataMapper","Meshes/Decimation.py" -"vtkPolyDataMapper","Meshes/DeformPointSet.py" -"vtkPolyDataMapper","Meshes/PointInterpolator.py" -"vtkPolyDataMapper","Meshes/SolidClip.py" -"vtkPolyDataMapper","Modelling/Bottle.py" -"vtkPolyDataMapper","Modelling/CappedSphere.py" -"vtkPolyDataMapper","Modelling/DelaunayMesh.py" -"vtkPolyDataMapper","Modelling/DiscreteMarchingCubes.py" -"vtkPolyDataMapper","Modelling/ExtractLargestIsosurface.py" -"vtkPolyDataMapper","Modelling/FinanceFieldData.py" -"vtkPolyDataMapper","Modelling/Finance.py" -"vtkPolyDataMapper","Modelling/MarchingCubes.py" -"vtkPolyDataMapper","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkPolyDataMapper","Modelling/Spring.py" -"vtkPolyDataMapper","Picking/CellPicking.py" -"vtkPolyDataMapper","Picking/HighlightPickedActor.py" -"vtkPolyDataMapper","Picking/HighlightWithSilhouette.py" -"vtkPolyDataMapper","PolyData/BooleanOperationPolyDataFilter.py" -"vtkPolyDataMapper","PolyData/CurvaturesAdjustEdges.py" -"vtkPolyDataMapper","PolyData/CurvaturesDemo.py" -"vtkPolyDataMapper","PolyData/Curvatures.py" -"vtkPolyDataMapper","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkPolyDataMapper","PolyData/FilledPolygon.py" -"vtkPolyDataMapper","PolyData/ImplicitPolyDataDistance.py" -"vtkPolyDataMapper","PolyData/Outline.py" -"vtkPolyDataMapper","PolyData/PointSource.py" -"vtkPolyDataMapper","PolyData/RotationAroundLine.py" -"vtkPolyDataMapper","PolyData/RuledSurfaceFilter.py" -"vtkPolyDataMapper","PolyData/SmoothMeshGrid.py" -"vtkPolyDataMapper","PolyData/TubeFilter.py" -"vtkPolyDataMapper","PolyData/WarpVector.py" -"vtkPolyDataMapper","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkPolyDataMapper","RectilinearGrid/RGrid.py" -"vtkPolyDataMapper","Rendering/AmbientSpheres.py" -"vtkPolyDataMapper","Rendering/CameraBlur.py" -"vtkPolyDataMapper","Rendering/Cone3.py" -"vtkPolyDataMapper","Rendering/Cone4.py" -"vtkPolyDataMapper","Rendering/DiffuseSpheres.py" -"vtkPolyDataMapper","Rendering/FlatVersusGouraud.py" -"vtkPolyDataMapper","Rendering/GradientBackground.py" -"vtkPolyDataMapper","Rendering/LayeredActors.py" -"vtkPolyDataMapper","Rendering/Mace.py" -"vtkPolyDataMapper","Rendering/Model.py" -"vtkPolyDataMapper","Rendering/MotionBlur.py" -"vtkPolyDataMapper","Rendering/OutlineGlowPass.py" -"vtkPolyDataMapper","Rendering/PBR_Anisotropy.py" -"vtkPolyDataMapper","Rendering/PBR_Clear_Coat.py" -"vtkPolyDataMapper","Rendering/PBR_Edge_Tint.py" -"vtkPolyDataMapper","Rendering/PBR_HDR_Environment.py" -"vtkPolyDataMapper","Rendering/PBR_Mapping.py" -"vtkPolyDataMapper","Rendering/PBR_Materials_Coat.py" -"vtkPolyDataMapper","Rendering/PBR_Materials.py" -"vtkPolyDataMapper","Rendering/PBR_Skybox_Anisotropy.py" -"vtkPolyDataMapper","Rendering/PBR_Skybox.py" -"vtkPolyDataMapper","Rendering/PBR_Skybox_Texturing.py" -"vtkPolyDataMapper","Rendering/Rainbow.py" -"vtkPolyDataMapper","Rendering/Rotations.py" -"vtkPolyDataMapper","Rendering/Shadows.py" -"vtkPolyDataMapper","Rendering/SpecularSpheres.py" -"vtkPolyDataMapper","Rendering/StippledLine.py" -"vtkPolyDataMapper","Rendering/StripFran.py" -"vtkPolyDataMapper","Rendering/TransparentBackground.py" -"vtkPolyDataMapper","Rendering/WalkCow.py" -"vtkPolyDataMapper","StructuredGrid/SGrid.py" -"vtkPolyDataMapper","StructuredPoints/Vol.py" -"vtkPolyDataMapper","Texture/AnimateVectors.py" -"vtkPolyDataMapper","Texture/TextureCutSphere.py" -"vtkPolyDataMapper","Texture/TexturePlane.py" -"vtkPolyDataMapper","Texture/TextureThreshold.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step1.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step2.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step3.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step4.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step5.py" -"vtkPolyDataMapper","Tutorial/Tutorial_Step6.py" -"vtkPolyDataMapper","Utilities/Animation.py" -"vtkPolyDataMapper","Utilities/ColorMapToLUT.py" -"vtkPolyDataMapper","Utilities/JSONColorMapToLUT.py" -"vtkPolyDataMapper","Utilities/RescaleReverseLUT.py" -"vtkPolyDataMapper","Utilities/ResetCameraOrientation.py" -"vtkPolyDataMapper","Utilities/SaveSceneToFieldData.py" -"vtkPolyDataMapper","Utilities/SaveSceneToFile.py" -"vtkPolyDataMapper","Utilities/Screenshot.py" -"vtkPolyDataMapper","Utilities/ShareCamera.py" -"vtkPolyDataMapper","Utilities/XMLColorMapToLUT.py" -"vtkPolyDataMapper","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkPolyDataMapper","VisualizationAlgorithms/BluntStreamlines.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CarotidFlow.py" -"vtkPolyDataMapper","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkPolyDataMapper","VisualizationAlgorithms/ContourQuadric.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CreateBFont.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkPolyDataMapper","VisualizationAlgorithms/Cutter.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkPolyDataMapper","VisualizationAlgorithms/CutWithScalars.py" -"vtkPolyDataMapper","VisualizationAlgorithms/DataSetSurface.py" -"vtkPolyDataMapper","VisualizationAlgorithms/DecimateFran.py" -"vtkPolyDataMapper","VisualizationAlgorithms/DecimateHawaii.py" -"vtkPolyDataMapper","VisualizationAlgorithms/ExtractData.py" -"vtkPolyDataMapper","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkPolyDataMapper","VisualizationAlgorithms/HeadBone.py" -"vtkPolyDataMapper","VisualizationAlgorithms/HeadSlice.py" -"vtkPolyDataMapper","VisualizationAlgorithms/Hello.py" -"vtkPolyDataMapper","VisualizationAlgorithms/HyperStreamline.py" -"vtkPolyDataMapper","VisualizationAlgorithms/IceCream.py" -"vtkPolyDataMapper","VisualizationAlgorithms/IronIsoSurface.py" -"vtkPolyDataMapper","VisualizationAlgorithms/LOxGrid.py" -"vtkPolyDataMapper","VisualizationAlgorithms/LOx.py" -"vtkPolyDataMapper","VisualizationAlgorithms/LOxSeeds.py" -"vtkPolyDataMapper","VisualizationAlgorithms/MarchingCases.py" -"vtkPolyDataMapper","VisualizationAlgorithms/Office.py" -"vtkPolyDataMapper","VisualizationAlgorithms/OfficeTube.py" -"vtkPolyDataMapper","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkPolyDataMapper","VisualizationAlgorithms/PineRootDecimation.py" -"vtkPolyDataMapper","VisualizationAlgorithms/PlateVibration.py" -"vtkPolyDataMapper","VisualizationAlgorithms/ProbeCombustor.py" -"vtkPolyDataMapper","VisualizationAlgorithms/SingleSplat.py" -"vtkPolyDataMapper","VisualizationAlgorithms/SpikeFran.py" -"vtkPolyDataMapper","VisualizationAlgorithms/SplatFace.py" -"vtkPolyDataMapper","VisualizationAlgorithms/Stocks.py" -"vtkPolyDataMapper","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkPolyDataMapper","VisualizationAlgorithms/TensorAxes.py" -"vtkPolyDataMapper","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkPolyDataMapper","VisualizationAlgorithms/VelocityProfile.py" -"vtkPolyDataMapper","VisualizationAlgorithms/WarpCombustor.py" -"vtkPolyDataMapper","Visualization/AlphaFrequency.py" -"vtkPolyDataMapper","Visualization/AssignCellColorsFromLUT.py" -"vtkPolyDataMapper","Visualization/BillboardTextActor3D.py" -"vtkPolyDataMapper","Visualization/BlobbyLogo.py" -"vtkPolyDataMapper","Visualization/Blow.py" -"vtkPolyDataMapper","Visualization/CameraModel1.py" -"vtkPolyDataMapper","Visualization/CameraModel2.py" -"vtkPolyDataMapper","Visualization/Camera.py" -"vtkPolyDataMapper","Visualization/ClampGlyphSizes.py" -"vtkPolyDataMapper","Visualization/CollisionDetection.py" -"vtkPolyDataMapper","Visualization/ColorAnActor.py" -"vtkPolyDataMapper","Visualization/ColoredAnnotatedCube.py" -"vtkPolyDataMapper","Visualization/ComplexV.py" -"vtkPolyDataMapper","Visualization/CreateColorSeriesDemo.py" -"vtkPolyDataMapper","Visualization/CubeAxesActor.py" -"vtkPolyDataMapper","Visualization/CurvatureBandsWithGlyphs.py" -"vtkPolyDataMapper","Visualization/DisplayCoordinateAxes.py" -"vtkPolyDataMapper","Visualization/DisplayQuadricSurfaces.py" -"vtkPolyDataMapper","Visualization/ElevationBandsWithGlyphs.py" -"vtkPolyDataMapper","Visualization/FrogBrain.py" -"vtkPolyDataMapper","Visualization/FroggieSurface.py" -"vtkPolyDataMapper","Visualization/FroggieView.py" -"vtkPolyDataMapper","Visualization/FrogSlice.py" -"vtkPolyDataMapper","Visualization/GlyphTable.py" -"vtkPolyDataMapper","Visualization/Hanoi.py" -"vtkPolyDataMapper","Visualization/HardwareSelector.py" -"vtkPolyDataMapper","Visualization/IsosurfaceSampling.py" -"vtkPolyDataMapper","Visualization/Kitchen.py" -"vtkPolyDataMapper","Visualization/KochSnowflake.py" -"vtkPolyDataMapper","Visualization/Lorenz.py" -"vtkPolyDataMapper","Visualization/MultipleRenderWindows.py" -"vtkPolyDataMapper","Visualization/MultipleViewports.py" -"vtkPolyDataMapper","Visualization/NamedColors.py" -"vtkPolyDataMapper","Visualization/NormalsDemo.py" -"vtkPolyDataMapper","Visualization/OrientedGlyphs.py" -"vtkPolyDataMapper","Visualization/PointDataSubdivision.py" -"vtkPolyDataMapper","Visualization/PointSize.py" -"vtkPolyDataMapper","Visualization/ProgrammableGlyphFilter.py" -"vtkPolyDataMapper","Visualization/ProgrammableGlyphs.py" -"vtkPolyDataMapper","Visualization/QuadricVisualization.py" -"vtkPolyDataMapper","Visualization/ShadowsLightsDemo.py" -"vtkPolyDataMapper","Visualization/SphereTexture.py" -"vtkPolyDataMapper","Visualization/StreamLines.py" -"vtkPolyDataMapper","Visualization/TextSource.py" -"vtkPolyDataMapper","Visualization/VectorText.py" -"vtkPolyDataMapper","Visualization/WindowTitle.py" -"vtkPolyDataMapper","VolumeRendering/PseudoVolumeRendering.py" -"vtkPolyDataMapper","Widgets/BalloonWidget.py" -"vtkPolyDataMapper","Widgets/BoxWidget.py" -"vtkPolyDataMapper","Widgets/CameraOrientationWidget.py" -"vtkPolyDataMapper","Widgets/EmbedInPyQt2.py" -"vtkPolyDataMapper","Widgets/EmbedInPyQt.py" -"vtkPolyDataMapper","Widgets/ImplicitPlaneWidget2.py" -"vtkPolyDataMapper","Widgets/OrientationMarkerWidget1.py" -"vtkPolyDataMapper","Widgets/OrientationMarkerWidget.py" -"vtkPolyDataMapper","Widgets/SplineWidget.py" -"vtkPolyDataMapper","Widgets/TextWidget.py" -"vtkPolydata","Medical/GenerateCubesFromLabels.py" -"vtkPolyData","Medical/GenerateModelsFromLabels.py" -"vtkPolyData","Meshes/CapClip.py" -"vtkPolyData","Meshes/ColoredElevationMap.py" -"vtkPolyData","Meshes/Decimation.py" -"vtkPolyData","Meshes/DeformPointSet.py" -"vtkPolyData","Modelling/Bottle.py" -"vtkPolyData","Modelling/CappedSphere.py" -"vtkPolyData","Modelling/DelaunayMesh.py" -"vtkPolyData","Modelling/Spring.py" -"vtkPolyDataNormals","DataManipulation/MeshLabelImageColor.py" -"vtkPolyDataNormals","Modelling/Spring.py" -"vtkPolyDataNormals","PolyData/CurvaturesAdjustEdges.py" -"vtkPolyDataNormals","Rendering/PBR_Skybox_Anisotropy.py" -"vtkPolyDataNormals","Rendering/PBR_Skybox.py" -"vtkPolyDataNormals","Rendering/PBR_Skybox_Texturing.py" -"vtkPolyDataNormals","Rendering/StripFran.py" -"vtkPolyDataNormals","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkPolyDataNormals","VisualizationAlgorithms/DecimateFran.py" -"vtkPolyDataNormals","VisualizationAlgorithms/DecimateHawaii.py" -"vtkPolyDataNormals","VisualizationAlgorithms/DisplacementPlot.py" -"vtkPolyDataNormals","VisualizationAlgorithms/Motor.py" -"vtkPolyDataNormals","VisualizationAlgorithms/PlateVibration.py" -"vtkPolyDataNormals","VisualizationAlgorithms/SpikeFran.py" -"vtkPolyDataNormals","VisualizationAlgorithms/SplatFace.py" -"vtkPolyDataNormals","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkPolyDataNormals","VisualizationAlgorithms/VelocityProfile.py" -"vtkPolyDataNormals","VisualizationAlgorithms/WarpCombustor.py" -"vtkPolyDataNormals","Visualization/BlobbyLogo.py" -"vtkPolyDataNormals","Visualization/Blow.py" -"vtkPolyDataNormals","Visualization/CurvatureBandsWithGlyphs.py" -"vtkPolyDataNormals","Visualization/ElevationBandsWithGlyphs.py" -"vtkPolyDataNormals","Visualization/FrogBrain.py" -"vtkPolyDataNormals","Visualization/FroggieSurface.py" -"vtkPolyDataNormals","Visualization/FroggieView.py" -"vtkPolyDataNormals","Visualization/FrogSlice.py" -"vtkPolyDataNormals","Visualization/NormalsDemo.py" -"vtkPolyDataNormals","Visualization/PointDataSubdivision.py" -"vtkPolyDataNormals","Visualization/ShadowsLightsDemo.py" -"vtkPolyDataNormals","VolumeRendering/PseudoVolumeRendering.py" -"vtkPolyData","PolyData/AlignTwoPolyDatas.py" -"vtkPolyData","PolyData/BooleanOperationPolyDataFilter.py" -"vtkPolyData","PolyData/ColoredTriangle.py" -"vtkPolyData","PolyData/CurvaturesAdjustEdges.py" -"vtkPolyData","PolyData/CurvaturesDemo.py" -"vtkPolyData","PolyData/Curvatures.py" -"vtkPolyData","PolyData/FilledPolygon.py" -"vtkPolyData","PolyData/ImplicitPolyDataDistance.py" -"vtkPolyData","PolyData/IterateOverLines.py" -"vtkPolyData","PolyData/RuledSurfaceFilter.py" -"vtkPolyData","PolyData/SmoothMeshGrid.py" -"vtkPolyData","PolyData/SolidColoredTriangle.py" -"vtkPolyData","PolyData/TriangleColoredPoints.py" -"vtkPolyData","PolyData/TriangleCorners.py" -"vtkPolyData","PolyData/TriangleCornerVertices.py" -"vtkPolyData","PolyData/WarpVector.py" -"vtkpoly_dataReader","Meshes/CapClip.py" -"vtkPolyDataReader","Meshes/Decimation.py" -"vtkPolyDataReader","PolyData/AlignTwoPolyDatas.py" -"vtkPolyDataReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkPolyDataReader","PolyData/CellsInsideObject.py" -"vtkPolyDataReader","PolyData/ClosedSurface.py" -"vtkPolyDataReader","Rendering/GradientBackground.py" -"vtkpoly_dataReader","Rendering/Shadows.py" -"vtkPolyDataReader","Rendering/StripFran.py" -"vtkpoly_dataReader","Utilities/SaveSceneToFieldData.py" -"vtkpoly_dataReader","Utilities/SaveSceneToFile.py" -"vtkPolyDataReader","VisualizationAlgorithms/DecimateFran.py" -"vtkPolyDataReader","VisualizationAlgorithms/DecimateHawaii.py" -"vtkPolyDataReader","VisualizationAlgorithms/DisplacementPlot.py" -"vtkPolyDataReader","VisualizationAlgorithms/Hello.py" -"vtkPolyDataReader","VisualizationAlgorithms/PlateVibration.py" -"vtkPolyDataReader","VisualizationAlgorithms/SpikeFran.py" -"vtkPolyDataReader","VisualizationAlgorithms/SplatFace.py" -"vtkPolyDataReader","VisualizationAlgorithms/Stocks.py" -"vtkPolyDataReader","Visualization/BlobbyLogo.py" -"vtkPolyDataReader","Visualization/FroggieView.py" -"vtkPolyDataReader","Visualization/Hawaii.py" -"vtkPolyData","Rendering/Cone3.py" -"vtkPolyData","Rendering/Cone4.py" -"vtkPolyData","Rendering/GradientBackground.py" -"vtkPolyDataSilhouette","Picking/HighlightWithSilhouette.py" -"vtkPolyDataTangents","PolyData/CurvaturesAdjustEdges.py" -"vtkPolyDataTangents","Rendering/PBR_Anisotropy.py" -"vtkPolyDataTangents","Rendering/PBR_Clear_Coat.py" -"vtkPolyDataTangents","Rendering/PBR_Mapping.py" -"vtkPolyDataTangents","Rendering/PBR_Skybox_Anisotropy.py" -"vtkPolyDataTangents","Rendering/PBR_Skybox.py" -"vtkPolyDataTangents","Rendering/PBR_Skybox_Texturing.py" -"vtkPolyDataToImageStencil","IO/PolyDataToImageDataConverter.py" -"vtkPolyDataToImageStencil","PolyData/PolyDataContourToImageData.py" -"vtkPolyDataToImageStencil","PolyData/PolyDataToImageDataStencil.py" -"vtkPolyData","Tutorial/Tutorial_Step1.py" -"vtkPolyData","Tutorial/Tutorial_Step3.py" -"vtkPolyData","Tutorial/Tutorial_Step4.py" -"vtkPolyData","Tutorial/Tutorial_Step5.py" -"vtkPolyData","Tutorial/Tutorial_Step6.py" -"vtkPolyData","VisualizationAlgorithms/ExponentialCosine.py" -"vtkPolyData","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkPolyData","VisualizationAlgorithms/PineRootDecimation.py" -"vtkPolyData","VisualizationAlgorithms/SingleSplat.py" -"vtkPolyData","VisualizationAlgorithms/SpikeFran.py" -"vtkPolyData","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkPolyData","Visualization/AssignCellColorsFromLUT.py" -"vtkPolyData","Visualization/CameraModel1.py" -"vtkPolyData","Visualization/CameraModel2.py" -"vtkPolyData","Visualization/CurvatureBandsWithGlyphs.py" -"vtkPolyData","Visualization/ElevationBandsWithGlyphs.py" -"vtkPolyData","Visualization/KochSnowflake.py" -"vtkPolyData","Visualization/NormalsDemo.py" -"vtkPolyData","Visualization/OrientedGlyphs.py" -"vtkPolyData","Visualization/ProgrammableGlyphFilter.py" -"vtkPolyData","Visualization/SphereTexture.py" -"vtkPolyData","Widgets/ContourWidget.py" -"vtkPolyDataWriter","PolyData/AlignTwoPolyDatas.py" -"vtkPolygon","Filtering/ConstrainedDelaunay2D.py" -"vtkPolygon","GeometricObjects/LinearCellsDemo.py" -"vtkPolygon","GeometricObjects/PolygonIntersection.py" -"vtkPolygon","GeometricObjects/Polygon.py" -"vtkPolygon","IO/WriteLegacyLinearCells.py" -"vtkPolygon","IO/WriteXMLLinearCells.py" -"vtkPolyhedron","GeometricObjects/Dodecahedron.py" -"vtkPolyLine","GeometricObjects/EllipticalCylinderDemo.py" -"vtkPolyLine","GeometricObjects/EllipticalCylinder.py" -"vtkPolyLine","GeometricObjects/LinearCellsDemo.py" -"vtkPolyLine","GeometricObjects/PolyLine.py" -"vtkPolyLine","IO/CSVReadEdit1.py" -"vtkPolyLine","IO/CSVReadEdit.py" -"vtkPolyLine","IO/WriteLegacyLinearCells.py" -"vtkPolyLine","IO/WriteXMLLinearCells.py" -"vtkPolyLine","Rendering/GradientBackground.py" -"vtkPolyLine","Visualization/KochSnowflake.py" -"vtkPolyVertex","GeometricObjects/LinearCellsDemo.py" -"vtkPolyVertex","IO/WriteLegacyLinearCells.py" -"vtkPolyVertex","IO/WriteXMLLinearCells.py" -"vtkPostScriptWriter","IO/ImageWriter.py" -"vtkPostScriptWriter","Visualization/Hanoi.py" -"vtkProbeFilter","Medical/TissueLens.py" -"vtkProbeFilter","VisualizationAlgorithms/ProbeCombustor.py" -"vtkProbeFilter","Visualization/IsosurfaceSampling.py" -"vtk","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtk","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkProgrammableGlyphFilter","Visualization/ProgrammableGlyphFilter.py" -"vtkProgrammableGlyphFilter","Visualization/ProgrammableGlyphs.py" -"vtkProjectedTetrahedraMapper","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkProp3D","GeometricObjects/OrientedArrow.py" -"vtkProp3D","GeometricObjects/OrientedCylinder.py" -"vtkProp3D","Medical/MedicalDemo4.py" -"vtkPropAssembly","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkPropAssembly","Visualization/ColoredAnnotatedCube.py" -"vtkPropAssembly","Visualization/FroggieSurface.py" -"vtkPropAssembly","Visualization/FroggieView.py" -"vtkProperty","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkProperty","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkProperty","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkProperty","GeometricObjects/EllipticalCylinder.py" -"vtkProperty","GeometricObjects/Frustum.py" -"vtkProperty","GeometricObjects/IsoparametricCellsDemo.py" -"vtkProperty","GeometricObjects/LinearCellsDemo.py" -"vtkProperty","GeometricObjects/ParametricKuenDemo.py" -"vtkProperty","GeometricObjects/ParametricObjectsDemo.py" -"vtkProperty","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkProperty","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkProperty","GeometricObjects/PolyLine1.py" -"vtkProperty","GeometricObjects/RegularPolygonSource.py" -"vtkProperty","GeometricObjects/ShrinkCube.py" -"vtkProperty","GeometricObjects/SourceObjectsDemo.py" -"vtkProperty","GeometricObjects/TessellatedBoxSource.py" -"vtkProperty","IO/ReadUnstructuredGrid.py" -"vtkProperty","Medical/MedicalDemo1.py" -"vtkProperty","Medical/MedicalDemo2.py" -"vtkProperty","Medical/TissueLens.py" -"vtkProperty","Meshes/Decimation.py" -"vtkProperty","Meshes/SolidClip.py" -"vtkProperty","Modelling/ExtractLargestIsosurface.py" -"vtkProperty","Picking/HighlightPickedActor.py" -"vtkProperty","PolyData/ExtractSelectionUsingCells.py" -"vtkProperty","PolyData/FilledPolygon.py" -"vtkProperty","Rendering/Cone3.py" -"vtkProperty","Rendering/Cone4.py" -"vtkProperty","Rendering/LayeredActors.py" -"vtkProperty","Tutorial/Tutorial_Step1.py" -"vtkProperty","Tutorial/Tutorial_Step3.py" -"vtkProperty","Tutorial/Tutorial_Step4.py" -"vtkProperty","Tutorial/Tutorial_Step5.py" -"vtkProperty","Tutorial/Tutorial_Step6.py" -"vtkProperty","Visualization/BlobbyLogo.py" -"vtkProperty","Widgets/ImplicitPlaneWidget2.py" -"vtkProp","Medical/MedicalDemo3.py" -"vtkPropPicker","Picking/HighlightPickedActor.py" -"vtkPropPicker","Picking/HighlightWithSilhouette.py" -"vtkp","Widgets/ScalarBarWidget.py" -"vtkPyramid","GeometricObjects/Cell3DDemonstration.py" -"vtkPyramid","GeometricObjects/LinearCellsDemo.py" -"vtkPyramid","GeometricObjects/Pyramid.py" -"vtkPyramid","IO/WriteLegacyLinearCells.py" -"vtkPyramid","IO/WriteXMLLinearCells.py" -"vtk_qt_include_pattern","Utilities/VTKModulesForCxx.py" -"vtkQuad","GeometricObjects/LinearCellsDemo.py" -"vtkQuad","GeometricObjects/Quad.py" -"vtkQuad","IO/WriteLegacyLinearCells.py" -"vtkQuad","IO/WriteXMLLinearCells.py" -"vtkQuadraticEdge","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticHexahedron","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticHexahedron","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkQuadraticHexahedron","GeometricObjects/QuadraticHexahedron.py" -"vtkQuadraticLinearQuad","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticLinearWedge","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticPolygon","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticPyramid","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticQuad","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticTetra","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticTetra","GeometricObjects/QuadraticTetraDemo.py" -"vtkQuadraticTetra","GeometricObjects/QuadraticTetra.py" -"vtkQuadraticTriangle","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadraticWedge","GeometricObjects/IsoparametricCellsDemo.py" -"vtkQuadric","ImplicitFunctions/ImplicitQuadric.py" -"vtkQuadric","Rendering/FlatVersusGouraud.py" -"vtkQuadric","Texture/TextureCutQuadric.py" -"vtkQuadric","VisualizationAlgorithms/ContourQuadric.py" -"vtkQuadric","VisualizationAlgorithms/ExtractData.py" -"vtkQuadric","Visualization/DisplayQuadricSurfaces.py" -"vtkQuadric","Visualization/QuadricVisualization.py" -"vtkRandomGraphSource","Graphs/RandomGraphSource.py" -"vtkRandomGraphSource","Graphs/SelectedVerticesAndEdges.py" -"vtkRandomGraphSource","InfoVis/SelectedGraphIDs.py" -"vtkRectf","Plotting/SurfacePlot.py" -"vtkRectilinearGridGeometryFilter","Meshes/ClipDataSetWithPolyData1.py" -"vtkRectilinearGridGeometryFilter","Meshes/ClipDataSetWithPolyData.py" -"vtkRectilinearGridGeometryFilter","RectilinearGrid/RGrid.py" -"vtkRectilinearGrid","Meshes/ClipDataSetWithPolyData1.py" -"vtkRectilinearGrid","Meshes/ClipDataSetWithPolyData.py" -"vtkRectilinearGrid","RectilinearGrid/RectilinearGrid.py" -"vtkRectilinearGrid","RectilinearGrid/RGrid.py" -"vtkRectilinearGrid","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRegularPolygonSource","Filtering/Glyph2D.py" -"vtkRegularPolygonSource","GeometricObjects/Circle.py" -"vtkRegularPolygonSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkRegularPolygonSource","GeometricObjects/RegularPolygonSource.py" -"vtkRegularPolygonSource","Widgets/BalloonWidget.py" -"vtkRenderedGraphRepresentation","Graphs/ColorVertexLabels.py" -"vtkRenderedGraphRepresentation","Graphs/ScaleVertices.py" -"vtkRenderedGraphRepresentation","Graphs/SelectedVerticesAndEdges.py" -"vtkRenderer","Annotation/MultiLineText.py" -"vtkRenderer","Annotation/TextOrigin.py" -"vtkRenderer","CompositeData/CompositePolyDataMapper.py" -"vtkRenderer","CompositeData/MultiBlockDataSet.py" -"vtkRenderer","CompositeData/OverlappingAMR.py" -"vtkRenderer","DataManipulation/LineOnMesh.py" -"vtkRenderer","DataManipulation/MeshLabelImageColor.py" -"vtkRenderer","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkRenderer","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderer","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkRenderer","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkRenderer","Deprecated/Geovis/GeoGraticle.py" -"vtkRenderer","ExplicitStructuredGrid/CreateESGrid.py" -"vtkRenderer","ExplicitStructuredGrid/LoadESGrid.py" -"vtkRenderer","Filtering/AppendFilter.py" -"vtkRenderer","Filtering/CombinePolyData.py" -"vtkRenderer","Filtering/ConnectivityFilter.py" -"vtkRenderer","Filtering/ConstrainedDelaunay2D.py" -"vtkRenderer","Filtering/Delaunay2D.py" -"vtkRenderer","Filtering/GaussianSplat.py" -"vtkRenderer","Filtering/Glyph2D.py" -"vtkRenderer","Filtering/Glyph3D.py" -"vtkRenderer","Filtering/PerlinNoise.py" -"vtkRenderer","Filtering/TransformPolyData.py" -"vtkRenderer","Filtering/TriangulateTerrainMap.py" -"vtkRenderer","Filtering/VertexGlyphFilter.py" -"vtkRenderer","Filtering/WarpTo.py" -"vtkRenderer","GeometricObjects/Arrow.py" -"vtkRenderer","GeometricObjects/Axes.py" -"vtkRenderer","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderer","GeometricObjects/CellTypeSource.py" -"vtkRenderer","GeometricObjects/Circle.py" -"vtkRenderer","GeometricObjects/ColoredLines.py" -"vtkRenderer","GeometricObjects/Cone.py" -"vtkRenderer","GeometricObjects/ConvexPointSet.py" -"vtkRenderer","GeometricObjects/Cube1.py" -"vtkRenderer","GeometricObjects/Cube.py" -"vtkRenderer","GeometricObjects/CylinderExample.py" -"vtkRenderer","GeometricObjects/Cylinder.py" -"vtkRenderer","GeometricObjects/Disk.py" -"vtkRenderer","GeometricObjects/Dodecahedron.py" -"vtkRenderer","GeometricObjects/EarthSource.py" -"vtkRenderer","GeometricObjects/EllipticalCylinderDemo.py" -"vtkRenderer","GeometricObjects/EllipticalCylinder.py" -"vtkRenderer","GeometricObjects/Frustum.py" -"vtkRenderer","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderer","GeometricObjects/Hexahedron.py" -"vtkRenderer","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderer","GeometricObjects/LinearCellsDemo.py" -"vtkRenderer","GeometricObjects/Line.py" -"vtkRenderer","GeometricObjects/LongLine.py" -"vtkRenderer","GeometricObjects/OrientedArrow.py" -"vtkRenderer","GeometricObjects/OrientedCylinder.py" -"vtkRenderer","GeometricObjects/ParametricKuenDemo.py" -"vtkRenderer","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderer","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkRenderer","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkRenderer","GeometricObjects/Plane.py" -"vtkRenderer","GeometricObjects/Planes.py" -"vtkRenderer","GeometricObjects/PlatonicSolids.py" -"vtkRenderer","GeometricObjects/Point.py" -"vtkRenderer","GeometricObjects/Polygon.py" -"vtkRenderer","GeometricObjects/Polyhedron.py" -"vtkRenderer","GeometricObjects/PolyLine1.py" -"vtkRenderer","GeometricObjects/PolyLine.py" -"vtkRenderer","GeometricObjects/Pyramid.py" -"vtkRenderer","GeometricObjects/Quad.py" -"vtkRenderer","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkRenderer","GeometricObjects/QuadraticHexahedron.py" -"vtkRenderer","GeometricObjects/QuadraticTetraDemo.py" -"vtkRenderer","GeometricObjects/QuadraticTetra.py" -"vtkRenderer","GeometricObjects/RegularPolygonSource.py" -"vtkRenderer","GeometricObjects/ShrinkCube.py" -"vtkRenderer","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderer","GeometricObjects/Sphere.py" -"vtkRenderer","GeometricObjects/TessellatedBoxSource.py" -"vtkRenderer","GeometricObjects/Tetrahedron.py" -"vtkRenderer","GeometricObjects/TextActor.py" -"vtkRenderer","GeometricObjects/Triangle.py" -"vtkRenderer","GeometricObjects/TriangleStrip.py" -"vtkRenderer","GeometricObjects/Vertex.py" -"vtkRenderer","Graphs/GraphToPolyData.py" -"vtkRenderer","HyperTreeGrid/HyperTreeGridSource.py" -"vtkRenderer","ImageData/ImageDataGeometryFilter.py" -"vtkRenderer","ImageData/ImageNormalize.py" -"vtkRenderer","ImageData/ImageWeightedSum.py" -"vtkRenderer","ImageData/WriteReadVtkImageData.py" -"vtkRenderer","ImageProcessing/Attenuation.py" -"vtkRenderer","ImageProcessing/EnhanceEdges.py" -"vtkRenderer","ImageProcessing/GaussianSmooth.py" -"vtkRenderer","ImageProcessing/HybridMedianComparison.py" -"vtkRenderer","ImageProcessing/IdealHighPass.py" -"vtkRenderer","ImageProcessing/IsoSubsample.py" -"vtkRenderer","ImageProcessing/MedianComparison.py" -"vtkRenderer","ImageProcessing/MorphologyComparison.py" -"vtkRenderer","ImageProcessing/Pad.py" -"vtkRenderer","ImageProcessing/VTKSpectrum.py" -"vtkRenderer","Images/Actor2D.py" -"vtkRenderer","Images/BackgroundImage.py" -"vtkRenderer","Images/Cast.py" -"vtkRenderer","Images/ImageWarp.py" -"vtkRenderer","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkRenderer","ImplicitFunctions/ImplicitQuadric.py" -"vtkRenderer","ImplicitFunctions/ImplicitSphere1.py" -"vtkRenderer","ImplicitFunctions/ImplicitSphere.py" -"vtkRenderer","ImplicitFunctions/SampleFunction.py" -"vtkRenderer","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRenderer","Interaction/CallBack.py" -"vtkRenderer","Interaction/InteractorStyleTrackballActor.py" -"vtkRenderer","Interaction/InteractorStyleTrackballCamera.py" -"vtkRenderer","Interaction/MouseEventsObserver.py" -"vtkRenderer","Interaction/MouseEvents.py" -"vtkRenderer","IO/3DSImporter.py" -"vtkRenderer","IO/CSVReadEdit1.py" -"vtkRenderer","IO/CSVReadEdit.py" -"vtkRenderer","IO/ImageWriter.py" -"vtkRenderer","IO/ReadExodusData.py" -"vtkRenderer","IO/ReadImageData.py" -"vtkRenderer","IO/ReadPLOT3D.py" -"vtkRenderer","IO/ReadPolyData.py" -"vtkRenderer","IO/ReadSLC.py" -"vtkRenderer","IO/ReadSTL.py" -"vtkRenderer","IO/ReadUnstructuredGrid.py" -"vtkRenderer","IO/ReadVTP.py" -"vtkRenderer","IO/TransientHDFReader.py" -"vtkRenderer","IO/WritePLY.py" -"vtkRenderer","IO/WriteSTL.py" -"vtkRenderer","Medical/GenerateCubesFromLabels.py" -"vtkRenderer","Medical/MedicalDemo1.py" -"vtkRenderer","Medical/MedicalDemo2.py" -"vtkRenderer","Medical/MedicalDemo3.py" -"vtkRenderer","Medical/MedicalDemo4.py" -"vtkRenderer","Medical/TissueLens.py" -"vtkRenderer","Meshes/BoundaryEdges.py" -"vtkRenderer","Meshes/CapClip.py" -"vtkRenderer","Meshes/ClipDataSetWithPolyData1.py" -"vtkRenderer","Meshes/ClipDataSetWithPolyData.py" -"vtkRenderer","Meshes/ColoredElevationMap.py" -"vtkRenderer","Meshes/Decimation.py" -"vtkRenderer","Meshes/DeformPointSet.py" -"vtkRenderer","Meshes/PointInterpolator.py" -"vtkRenderer","Meshes/SolidClip.py" -"vtkRenderer","Modelling/Bottle.py" -"vtkRenderer","Modelling/CappedSphere.py" -"vtkRenderer","Modelling/ContourTriangulator.py" -"vtkRenderer","Modelling/DelaunayMesh.py" -"vtkRenderer","Modelling/DiscreteMarchingCubes.py" -"vtkRenderer","Modelling/ExtractLargestIsosurface.py" -"vtkRenderer","Modelling/FinanceFieldData.py" -"vtkRenderer","Modelling/Finance.py" -"vtkRenderer","Modelling/MarchingCubes.py" -"vtkRenderer","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkRenderer","Modelling/Spring.py" -"vtkRenderer","Picking/CellPicking.py" -"vtkRenderer","Picking/HighlightPickedActor.py" -"vtkRenderer","Picking/HighlightWithSilhouette.py" -"vtkRenderer","Plotting/MultiplePlots.py" -"vtkRenderer","Plotting/SpiderPlot.py" -"vtkRenderer","PolyData/AlignTwoPolyDatas.py" -"vtkRenderer","PolyData/BooleanOperationPolyDataFilter.py" -"vtkRenderer","PolyData/CellsInsideObject.py" -"vtkRenderer","PolyData/CurvaturesAdjustEdges.py" -"vtkRenderer","PolyData/CurvaturesDemo.py" -"vtkRenderer","PolyData/Curvatures.py" -"vtkRenderer","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkRenderer","PolyData/ExtractSelection.py" -"vtkRenderer","PolyData/ExtractSelectionUsingCells.py" -"vtkRenderer","PolyData/FilledPolygon.py" -"vtkRenderer","PolyData/ImplicitPolyDataDistance.py" -"vtkRenderer","PolyData/Outline.py" -"vtkRenderer","PolyData/PointSource.py" -"vtkRenderer","PolyData/RotationAroundLine.py" -"vtkRenderer","PolyData/RuledSurfaceFilter.py" -"vtkRenderer","PolyData/SmoothMeshGrid.py" -"vtkRenderer","PolyData/TubeFilter.py" -"vtkRenderer","PolyData/WarpVector.py" -"vtkRenderer","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkRenderer","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkRenderer","RectilinearGrid/RectilinearGrid.py" -"vtkRenderer","RectilinearGrid/RGrid.py" -"vtkRenderer","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRenderer","Rendering/AmbientSpheres.py" -"vtkRenderer","Rendering/CameraBlur.py" -"vtkRenderer","Rendering/ColoredSphere.py" -"vtkRenderer","Rendering/Cone3.py" -"vtkRenderer","Rendering/Cone4.py" -"vtkRenderer","Rendering/DiffuseSpheres.py" -"vtkRenderer","Rendering/FlatVersusGouraud.py" -"vtkRenderer","Rendering/GradientBackground.py" -"vtkRenderer","Rendering/LayeredActors.py" -"vtkRenderer","Rendering/Mace.py" -"vtkRenderer","Rendering/Model.py" -"vtkRenderer","Rendering/MotionBlur.py" -"vtkRenderer","Rendering/OutlineGlowPass.py" -"vtkRenderer","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderer","Rendering/PBR_Skybox.py" -"vtkRenderer","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderer","Rendering/Rainbow.py" -"vtkRenderer","Rendering/Rotations.py" -"vtkRenderer","Rendering/Shadows.py" -"vtkRenderer","Rendering/SpecularSpheres.py" -"vtkRenderer","Rendering/StippledLine.py" -"vtkRenderer","Rendering/StripFran.py" -"vtkRenderer","Rendering/TransformSphere.py" -"vtkRenderer","Rendering/TransparentBackground.py" -"vtkRenderer","Rendering/WalkCow.py" -"vtkRenderer","StructuredGrid/BlankPoint.py" -"vtkRenderer","StructuredGrid/SGrid.py" -"vtkRenderer","StructuredPoints/Vol.py" -"vtkRenderer","Texture/AnimateVectors.py" -"vtkRenderer","Texture/TextureCutQuadric.py" -"vtkRenderer","Texture/TextureCutSphere.py" -"vtkRenderer","Texture/TexturePlane.py" -"vtkRenderer","Texture/TextureThreshold.py" -"vtkRenderer","Tutorial/Tutorial_Step1.py" -"vtkRenderer","Tutorial/Tutorial_Step2.py" -"vtkRenderer","Tutorial/Tutorial_Step3.py" -"vtkRenderer","Tutorial/Tutorial_Step4.py" -"vtkRenderer","Tutorial/Tutorial_Step5.py" -"vtkRenderer","Tutorial/Tutorial_Step6.py" -"vtkRenderer","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkRenderer","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkRenderer","UnstructuredGrid/UGrid.py" -"vtkRenderer","Utilities/Animation.py" -"vtkRenderer","Utilities/ColorMapToLUT.py" -"vtkRenderer","Utilities/JSONColorMapToLUT.py" -"vtkRenderer","Utilities/RescaleReverseLUT.py" -"vtkRenderer","Utilities/ResetCameraOrientation.py" -"vtkRenderer","Utilities/SaveSceneToFieldData.py" -"vtkRenderer","Utilities/SaveSceneToFile.py" -"vtkRenderer","Utilities/Screenshot.py" -"vtkRenderer","Utilities/ShareCamera.py" -"vtkRenderer","Utilities/VTKWithNumpy.py" -"vtkRenderer","Utilities/XMLColorMapToLUT.py" -"vtkRenderer","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderer","VisualizationAlgorithms/BluntStreamlines.py" -"vtkRenderer","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkRenderer","VisualizationAlgorithms/CarotidFlow.py" -"vtkRenderer","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkRenderer","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkRenderer","VisualizationAlgorithms/ContourQuadric.py" -"vtkRenderer","VisualizationAlgorithms/CreateBFont.py" -"vtkRenderer","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkRenderer","VisualizationAlgorithms/Cutter.py" -"vtkRenderer","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkRenderer","VisualizationAlgorithms/CutWithScalars.py" -"vtkRenderer","VisualizationAlgorithms/DataSetSurface.py" -"vtkRenderer","VisualizationAlgorithms/DecimateFran.py" -"vtkRenderer","VisualizationAlgorithms/DecimateHawaii.py" -"vtkRenderer","VisualizationAlgorithms/DisplacementPlot.py" -"vtkRenderer","VisualizationAlgorithms/ExponentialCosine.py" -"vtkRenderer","VisualizationAlgorithms/ExtractData.py" -"vtkRenderer","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkRenderer","VisualizationAlgorithms/HeadBone.py" -"vtkRenderer","VisualizationAlgorithms/HeadSlice.py" -"vtkRenderer","VisualizationAlgorithms/Hello.py" -"vtkRenderer","VisualizationAlgorithms/HyperStreamline.py" -"vtkRenderer","VisualizationAlgorithms/IceCream.py" -"vtkRenderer","VisualizationAlgorithms/ImageGradient.py" -"vtkRenderer","VisualizationAlgorithms/IronIsoSurface.py" -"vtkRenderer","VisualizationAlgorithms/LOxGrid.py" -"vtkRenderer","VisualizationAlgorithms/LOx.py" -"vtkRenderer","VisualizationAlgorithms/LOxSeeds.py" -"vtkRenderer","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderer","VisualizationAlgorithms/Motor.py" -"vtkRenderer","VisualizationAlgorithms/Office.py" -"vtkRenderer","VisualizationAlgorithms/OfficeTube.py" -"vtkRenderer","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkRenderer","VisualizationAlgorithms/PineRootDecimation.py" -"vtkRenderer","VisualizationAlgorithms/PlateVibration.py" -"vtkRenderer","VisualizationAlgorithms/ProbeCombustor.py" -"vtkRenderer","VisualizationAlgorithms/SingleSplat.py" -"vtkRenderer","VisualizationAlgorithms/SpikeFran.py" -"vtkRenderer","VisualizationAlgorithms/SplatFace.py" -"vtkRenderer","VisualizationAlgorithms/Stocks.py" -"vtkRenderer","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRenderer","VisualizationAlgorithms/TensorAxes.py" -"vtkRenderer","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkRenderer","VisualizationAlgorithms/VelocityProfile.py" -"vtkRenderer","VisualizationAlgorithms/WarpCombustor.py" -"vtkRenderer","Visualization/AlphaFrequency.py" -"vtkRenderer","Visualization/AnnotatedCubeActor.py" -"vtkRenderer","Visualization/AssignCellColorsFromLUT.py" -"vtkRenderer","Visualization/BillboardTextActor3D.py" -"vtkRenderer","Visualization/BlobbyLogo.py" -"vtkRenderer","Visualization/Blow.py" -"vtkRenderer","Visualization/CameraModel1.py" -"vtkRenderer","Visualization/CameraModel2.py" -"vtkRenderer","Visualization/Camera.py" -"vtkRenderer","Visualization/ClampGlyphSizes.py" -"vtkRenderer","Visualization/CollisionDetection.py" -"vtkRenderer","Visualization/ColorAnActor.py" -"vtkRenderer","Visualization/ColoredAnnotatedCube.py" -"vtkRenderer","Visualization/ComplexV.py" -"vtkRenderer","Visualization/CreateColorSeriesDemo.py" -"vtkRenderer","Visualization/CubeAxesActor.py" -"vtkRenderer","Visualization/CurvatureBandsWithGlyphs.py" -"vtkRenderer","Visualization/DisplayCoordinateAxes.py" -"vtkRenderer","Visualization/DisplayQuadricSurfaces.py" -"vtkRenderer","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderer","Visualization/FrogBrain.py" -"vtkRenderer","Visualization/FroggieSurface.py" -"vtkRenderer","Visualization/FroggieView.py" -"vtkRenderer","Visualization/FrogSlice.py" -"vtkRenderer","Visualization/GlyphTable.py" -"vtkRenderer","Visualization/Hanoi.py" -"vtkRenderer","Visualization/HardwareSelector.py" -"vtkRenderer","Visualization/Hawaii.py" -"vtkRenderer","Visualization/IsosurfaceSampling.py" -"vtkRenderer","Visualization/Kitchen.py" -"vtkRenderer","Visualization/KochSnowflake.py" -"vtkRenderer","Visualization/LoopShrink.py" -"vtkRenderer","Visualization/Lorenz.py" -"vtkRenderer","Visualization/MultipleRenderWindows.py" -"vtkRenderer","Visualization/MultipleViewports.py" -"vtkRenderer","Visualization/NamedColors.py" -"vtkRenderer","Visualization/NormalsDemo.py" -"vtkRenderer","Visualization/OrientedGlyphs.py" -"vtkRenderer","Visualization/PointDataSubdivision.py" -"vtkRenderer","Visualization/PointSize.py" -"vtkRenderer","Visualization/ProgrammableGlyphFilter.py" -"vtkRenderer","Visualization/ProgrammableGlyphs.py" -"vtkRenderer","Visualization/QuadricVisualization.py" -"vtkRenderer","Visualization/SphereTexture.py" -"vtkRenderer","Visualization/StreamLines.py" -"vtkRenderer","Visualization/TextSource.py" -"vtkRenderer","Visualization/VectorText.py" -"vtkRenderer","Visualization/WindowTitle.py" -"vtkRenderer","VolumeRendering/PseudoVolumeRendering.py" -"vtkRenderer","VolumeRendering/SimpleRayCast.py" -"vtkRenderer","Widgets/BalloonWidget.py" -"vtkRenderer","Widgets/BoxWidget.py" -"vtkRenderer","Widgets/CameraOrientationWidget.py" -"vtkRenderer","Widgets/CompassWidget.py" -"vtkRenderer","Widgets/ContourWidget.py" -"vtkRenderer","Widgets/EmbedInPyQt2.py" -"vtkRenderer","Widgets/EmbedInPyQt.py" -"vtkRenderer","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderer","Widgets/OrientationMarkerWidget1.py" -"vtkRenderer","Widgets/OrientationMarkerWidget.py" -"vtkRenderer","Widgets/ScalarBarWidget.py" -"vtkRenderer","Widgets/SphereWidget.py" -"vtkRenderer","Widgets/SplineWidget.py" -"vtkRenderer","Widgets/TextWidget.py" -"vtkRenderingAnnotation","GeometricObjects/Axes.py" -"vtkRenderingAnnotation","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderingAnnotation","GeometricObjects/LinearCellsDemo.py" -"vtkRenderingAnnotation","Interaction/CallBack.py" -"vtkRenderingAnnotation","IO/CSVReadEdit1.py" -"vtkRenderingAnnotation","IO/CSVReadEdit.py" -"vtkRenderingAnnotation","Plotting/SpiderPlot.py" -"vtkRenderingAnnotation","PolyData/AlignTwoPolyDatas.py" -"vtkRenderingAnnotation","PolyData/CurvaturesAdjustEdges.py" -"vtkRenderingAnnotation","PolyData/CurvaturesDemo.py" -"vtkRenderingAnnotation","PolyData/Curvatures.py" -"vtkRenderingAnnotation","Rendering/LayeredActors.py" -"vtkRenderingAnnotation","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderingAnnotation","Rendering/PBR_Skybox.py" -"vtkRenderingAnnotation","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderingAnnotation","Utilities/RescaleReverseLUT.py" -"vtkRenderingAnnotation","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderingAnnotation","Visualization/AnnotatedCubeActor.py" -"vtkRenderingAnnotation","Visualization/ColoredAnnotatedCube.py" -"vtkRenderingAnnotation","Visualization/CubeAxesActor.py" -"vtkRenderingAnnotation","Visualization/CurvatureBandsWithGlyphs.py" -"vtkRenderingAnnotation","Visualization/DisplayCoordinateAxes.py" -"vtkRenderingAnnotation","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderingAnnotation","Visualization/FroggieSurface.py" -"vtkRenderingAnnotation","Visualization/FroggieView.py" -"vtkRenderingAnnotation","Visualization/PointDataSubdivision.py" -"vtkRenderingAnnotation","Widgets/CompassWidget.py" -"vtkRenderingAnnotation","Widgets/OrientationMarkerWidget.py" -"vtkRenderingAnnotation","Widgets/ScalarBarWidget.py" -"vtkRenderingContext2D","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderingContext2D","Plotting/MultiplePlots.py" -"vtkRenderingContext2D","Plotting/SurfacePlot.py" -"vtkRenderingContextOpenGL2","IO/ReadDICOMSeries.py" -"vtkRenderingContextOpenGL2","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderingContextOpenGL2","IO/TransientHDFReader.py" -"vtkRenderingContextOpenGL2","Plotting/MultiplePlots.py" -"vtkRenderingContextOpenGL2","Plotting/ScatterPlot.py" -"vtkRenderingContextOpenGL2","Plotting/SurfacePlot.py" -"vtkRenderingContextOpenGL2","Utilities/VTKImportsForPython.py" -"vtkRenderingContextOpenGL2","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderingCore","Annotation/MultiLineText.py" -"vtkRenderingCore","Annotation/TextOrigin.py" -"vtkRenderingCore","CompositeData/CompositePolyDataMapper.py" -"vtkRenderingCore","CompositeData/MultiBlockDataSet.py" -"vtkRenderingCore","CompositeData/OverlappingAMR.py" -"vtkRenderingCore","DataManipulation/LineOnMesh.py" -"vtkRenderingCore","DataManipulation/MeshLabelImageColor.py" -"vtkRenderingCore","ExplicitStructuredGrid/CreateESGrid.py" -"vtkRenderingCore","ExplicitStructuredGrid/LoadESGrid.py" -"vtkRenderingCore","Filtering/AppendFilter.py" -"vtkRenderingCore","Filtering/CombinePolyData.py" -"vtkRenderingCore","Filtering/ConnectivityFilter.py" -"vtkRenderingCore","Filtering/ConstrainedDelaunay2D.py" -"vtkRenderingCore","Filtering/Delaunay2D.py" -"vtkRenderingCore","Filtering/GaussianSplat.py" -"vtkRenderingCore","Filtering/Glyph2D.py" -"vtkRenderingCore","Filtering/Glyph3D.py" -"vtkRenderingCore","Filtering/PerlinNoise.py" -"vtkRenderingCore","Filtering/TransformPolyData.py" -"vtkRenderingCore","Filtering/TriangulateTerrainMap.py" -"vtkRenderingCore","Filtering/VertexGlyphFilter.py" -"vtkRenderingCore","Filtering/WarpTo.py" -"vtkRenderingCore","GeometricObjects/Arrow.py" -"vtkRenderingCore","GeometricObjects/Axes.py" -"vtkRenderingCore","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderingCore","GeometricObjects/CellTypeSource.py" -"vtkRenderingCore","GeometricObjects/Circle.py" -"vtkRenderingCore","GeometricObjects/ColoredLines.py" -"vtkRenderingCore","GeometricObjects/Cone.py" -"vtkRenderingCore","GeometricObjects/ConvexPointSet.py" -"vtkRenderingCore","GeometricObjects/Cube1.py" -"vtkRenderingCore","GeometricObjects/Cube.py" -"vtkRenderingCore","GeometricObjects/CylinderExample.py" -"vtkRenderingCore","GeometricObjects/Cylinder.py" -"vtkRenderingCore","GeometricObjects/Disk.py" -"vtkRenderingCore","GeometricObjects/Dodecahedron.py" -"vtkRenderingCore","GeometricObjects/EarthSource.py" -"vtkRenderingCore","GeometricObjects/EllipticalCylinderDemo.py" -"vtkRenderingCore","GeometricObjects/EllipticalCylinder.py" -"vtkRenderingCore","GeometricObjects/Frustum.py" -"vtkRenderingCore","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderingCore","GeometricObjects/Hexahedron.py" -"vtkRenderingCore","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderingCore","GeometricObjects/LinearCellsDemo.py" -"vtkRenderingCore","GeometricObjects/Line.py" -"vtkRenderingCore","GeometricObjects/LongLine.py" -"vtkRenderingCore","GeometricObjects/OrientedArrow.py" -"vtkRenderingCore","GeometricObjects/OrientedCylinder.py" -"vtkRenderingCore","GeometricObjects/ParametricKuenDemo.py" -"vtkRenderingCore","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderingCore","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkRenderingCore","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkRenderingCore","GeometricObjects/Plane.py" -"vtkRenderingCore","GeometricObjects/Planes.py" -"vtkRenderingCore","GeometricObjects/PlatonicSolids.py" -"vtkRenderingCore","GeometricObjects/Point.py" -"vtkRenderingCore","GeometricObjects/Polygon.py" -"vtkRenderingCore","GeometricObjects/Polyhedron.py" -"vtkRenderingCore","GeometricObjects/PolyLine1.py" -"vtkRenderingCore","GeometricObjects/PolyLine.py" -"vtkRenderingCore","GeometricObjects/Pyramid.py" -"vtkRenderingCore","GeometricObjects/Quad.py" -"vtkRenderingCore","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkRenderingCore","GeometricObjects/QuadraticHexahedron.py" -"vtkRenderingCore","GeometricObjects/QuadraticTetraDemo.py" -"vtkRenderingCore","GeometricObjects/QuadraticTetra.py" -"vtkRenderingCore","GeometricObjects/RegularPolygonSource.py" -"vtkRenderingCore","GeometricObjects/ShrinkCube.py" -"vtkRenderingCore","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderingCore","GeometricObjects/Sphere.py" -"vtkRenderingCore","GeometricObjects/TessellatedBoxSource.py" -"vtkRenderingCore","GeometricObjects/Tetrahedron.py" -"vtkRenderingCore","GeometricObjects/TextActor.py" -"vtkRenderingCore","GeometricObjects/Triangle.py" -"vtkRenderingCore","GeometricObjects/TriangleStrip.py" -"vtkRenderingCore","GeometricObjects/Vertex.py" -"vtkRenderingCore","Graphs/GraphToPolyData.py" -"vtkRenderingCore","Graphs/ScaleVertices.py" -"vtkRenderingCore","Graphs/SideBySideGraphs.py" -"vtkRenderingCore","Graphs/VisualizeDirectedGraph.py" -"vtkRenderingCore","HyperTreeGrid/HyperTreeGridSource.py" -"vtkRenderingCore","ImageData/ImageDataGeometryFilter.py" -"vtkRenderingCore","ImageData/ImageNormalize.py" -"vtkRenderingCore","ImageData/ImageWeightedSum.py" -"vtkRenderingCore","ImageData/WriteReadVtkImageData.py" -"vtkRenderingCore","ImageProcessing/Attenuation.py" -"vtkRenderingCore","ImageProcessing/EnhanceEdges.py" -"vtkRenderingCore","ImageProcessing/GaussianSmooth.py" -"vtkRenderingCore","ImageProcessing/HybridMedianComparison.py" -"vtkRenderingCore","ImageProcessing/IdealHighPass.py" -"vtkRenderingCore","ImageProcessing/IsoSubsample.py" -"vtkRenderingCore","ImageProcessing/MedianComparison.py" -"vtkRenderingCore","ImageProcessing/MorphologyComparison.py" -"vtkRenderingCore","ImageProcessing/Pad.py" -"vtkRenderingCore","ImageProcessing/VTKSpectrum.py" -"vtkRenderingCore","Images/Actor2D.py" -"vtkRenderingCore","Images/BackgroundImage.py" -"vtkRenderingCore","Images/Cast.py" -"vtkRenderingCore","Images/ImageWarp.py" -"vtkRenderingCore","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkRenderingCore","ImplicitFunctions/ImplicitQuadric.py" -"vtkRenderingCore","ImplicitFunctions/ImplicitSphere1.py" -"vtkRenderingCore","ImplicitFunctions/ImplicitSphere.py" -"vtkRenderingCore","ImplicitFunctions/SampleFunction.py" -"vtkRenderingCore","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRenderingCore","Interaction/CallBack.py" -"vtkRenderingCore","Interaction/InteractorStyleTrackballActor.py" -"vtkRenderingCore","Interaction/InteractorStyleTrackballCamera.py" -"vtkRenderingCore","Interaction/MouseEventsObserver.py" -"vtkRenderingCore","Interaction/MouseEvents.py" -"vtkRenderingCore","IO/3DSImporter.py" -"vtkRenderingCore","IO/CSVReadEdit1.py" -"vtkRenderingCore","IO/CSVReadEdit.py" -"vtkRenderingCore","IO/HDRReader.py" -"vtkRenderingCore","IO/ImageWriter.py" -"vtkRenderingCore","IO/ReadDICOM.py" -"vtkRenderingCore","IO/ReadDICOMSeries.py" -"vtkRenderingCore","IO/ReadExodusData.py" -"vtkRenderingCore","IO/ReadImageData.py" -"vtkRenderingCore","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderingCore","IO/ReadPLOT3D.py" -"vtkRenderingCore","IO/ReadPolyData.py" -"vtkRenderingCore","IO/ReadSLC.py" -"vtkRenderingCore","IO/ReadSTL.py" -"vtkRenderingCore","IO/ReadVTP.py" -"vtkRenderingCore","IO/TransientHDFReader.py" -"vtkRenderingCore","IO/WritePLY.py" -"vtkRenderingCore","IO/WriteSTL.py" -"vtkRenderingCore","Medical/GenerateCubesFromLabels.py" -"vtkRenderingCore","Medical/MedicalDemo1.py" -"vtkRenderingCore","Medical/MedicalDemo2.py" -"vtkRenderingCore","Medical/MedicalDemo3.py" -"vtkRenderingCore","Medical/MedicalDemo4.py" -"vtkRenderingCore","Medical/TissueLens.py" -"vtkRenderingCore","Meshes/BoundaryEdges.py" -"vtkRenderingCore","Meshes/CapClip.py" -"vtkRenderingCore","Meshes/ClipDataSetWithPolyData1.py" -"vtkRenderingCore","Meshes/ClipDataSetWithPolyData.py" -"vtkRenderingCore","Meshes/ColoredElevationMap.py" -"vtkRenderingCore","Meshes/Decimation.py" -"vtkRenderingCore","Meshes/DeformPointSet.py" -"vtkRenderingCore","Meshes/PointInterpolator.py" -"vtkRenderingCore","Meshes/SolidClip.py" -"vtkRenderingCore","Modelling/Bottle.py" -"vtkRenderingCore","Modelling/CappedSphere.py" -"vtkRenderingCore","Modelling/ContourTriangulator.py" -"vtkRenderingCore","Modelling/DelaunayMesh.py" -"vtkRenderingCore","Modelling/DiscreteMarchingCubes.py" -"vtkRenderingCore","Modelling/ExtractLargestIsosurface.py" -"vtkRenderingCore","Modelling/FinanceFieldData.py" -"vtkRenderingCore","Modelling/Finance.py" -"vtkRenderingCore","Modelling/MarchingCubes.py" -"vtkRenderingCore","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkRenderingCore","Modelling/Spring.py" -"vtkRenderingCore","Picking/CellPicking.py" -"vtkRenderingCore","Picking/HighlightPickedActor.py" -"vtkRenderingCore","Picking/HighlightWithSilhouette.py" -"vtkRenderingCore","Plotting/MultiplePlots.py" -"vtkRenderingCore","Plotting/SpiderPlot.py" -"vtkRenderingCore","PolyData/AlignTwoPolyDatas.py" -"vtkRenderingCore","PolyData/BooleanOperationPolyDataFilter.py" -"vtkRenderingCore","PolyData/CellsInsideObject.py" -"vtkRenderingCore","PolyData/CurvaturesAdjustEdges.py" -"vtkRenderingCore","PolyData/CurvaturesDemo.py" -"vtkRenderingCore","PolyData/Curvatures.py" -"vtkRenderingCore","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkRenderingCore","PolyData/ExtractSelection.py" -"vtkRenderingCore","PolyData/ExtractSelectionUsingCells.py" -"vtkRenderingCore","PolyData/FilledPolygon.py" -"vtkRenderingCore","PolyData/ImplicitPolyDataDistance.py" -"vtkRenderingCore","PolyData/Outline.py" -"vtkRenderingCore","PolyData/PointSource.py" -"vtkRenderingCore","PolyData/PolyDataToImageDataStencil.py" -"vtkRenderingCore","PolyData/RotationAroundLine.py" -"vtkRenderingCore","PolyData/RuledSurfaceFilter.py" -"vtkRenderingCore","PolyData/SmoothMeshGrid.py" -"vtkRenderingCore","PolyData/TubeFilter.py" -"vtkRenderingCore","PolyData/WarpVector.py" -"vtkRenderingCore","RectilinearGrid/RectilinearGrid.py" -"vtkRenderingCore","RectilinearGrid/RGrid.py" -"vtkRenderingCore","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRenderingCore","Rendering/AmbientSpheres.py" -"vtkRenderingCore","Rendering/CameraBlur.py" -"vtkRenderingCore","Rendering/ColoredSphere.py" -"vtkRenderingCore","Rendering/Cone3.py" -"vtkRenderingCore","Rendering/Cone4.py" -"vtkRenderingCore","Rendering/DiffuseSpheres.py" -"vtkRenderingCore","Rendering/FlatVersusGouraud.py" -"vtkRenderingCore","Rendering/GradientBackground.py" -"vtkRenderingCore","Rendering/LayeredActors.py" -"vtkRenderingCore","Rendering/Mace.py" -"vtkRenderingCore","Rendering/Model.py" -"vtkRenderingCore","Rendering/MotionBlur.py" -"vtkRenderingCore","Rendering/OutlineGlowPass.py" -"vtkRenderingCore","Rendering/PBR_Anisotropy.py" -"vtkRenderingCore","Rendering/PBR_Clear_Coat.py" -"vtkRenderingCore","Rendering/PBR_Edge_Tint.py" -"vtkRenderingCore","Rendering/PBR_HDR_Environment.py" -"vtkRenderingCore","Rendering/PBR_Mapping.py" -"vtkRenderingCore","Rendering/PBR_Materials_Coat.py" -"vtkRenderingCore","Rendering/PBR_Materials.py" -"vtkRenderingCore","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderingCore","Rendering/PBR_Skybox.py" -"vtkRenderingCore","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderingCore","Rendering/Rainbow.py" -"vtkRenderingCore","Rendering/Rotations.py" -"vtkRenderingCore","Rendering/Shadows.py" -"vtkRenderingCore","Rendering/SpecularSpheres.py" -"vtkRenderingCore","Rendering/StippledLine.py" -"vtkRenderingCore","Rendering/StripFran.py" -"vtkRenderingCore","Rendering/TransformSphere.py" -"vtkRenderingCore","Rendering/TransparentBackground.py" -"vtkRenderingCore","Rendering/WalkCow.py" -"vtkRenderingCore","StructuredGrid/BlankPoint.py" -"vtkRenderingCore","StructuredGrid/SGrid.py" -"vtkRenderingCore","StructuredPoints/Vol.py" -"vtkRenderingCore","Texture/AnimateVectors.py" -"vtkRenderingCore","Texture/TextureCutQuadric.py" -"vtkRenderingCore","Texture/TextureCutSphere.py" -"vtkRenderingCore","Texture/TexturePlane.py" -"vtkRenderingCore","Texture/TextureThreshold.py" -"vtkRenderingCore","Tutorial/Tutorial_Step1.py" -"vtkRenderingCore","Tutorial/Tutorial_Step2.py" -"vtkRenderingCore","Tutorial/Tutorial_Step3.py" -"vtkRenderingCore","Tutorial/Tutorial_Step4.py" -"vtkRenderingCore","Tutorial/Tutorial_Step5.py" -"vtkRenderingCore","Tutorial/Tutorial_Step6.py" -"vtkRenderingCore","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkRenderingCore","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkRenderingCore","UnstructuredGrid/UGrid.py" -"vtkRenderingCore","Utilities/Animation.py" -"vtkRenderingCore","Utilities/ColorMapToLUT.py" -"vtkRenderingCore","Utilities/JSONColorMapToLUT.py" -"vtkRenderingCore","Utilities/RescaleReverseLUT.py" -"vtkRenderingCore","Utilities/ResetCameraOrientation.py" -"vtkRenderingCore","Utilities/SaveSceneToFieldData.py" -"vtkRenderingCore","Utilities/SaveSceneToFile.py" -"vtkRenderingCore","Utilities/Screenshot.py" -"vtkRenderingCore","Utilities/ShareCamera.py" -"vtkRenderingCore","Utilities/VTKWithNumpy.py" -"vtkRenderingCore","Utilities/XMLColorMapToLUT.py" -"vtkRenderingCore","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderingCore","VisualizationAlgorithms/BluntStreamlines.py" -"vtkRenderingCore","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkRenderingCore","VisualizationAlgorithms/CarotidFlow.py" -"vtkRenderingCore","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkRenderingCore","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkRenderingCore","VisualizationAlgorithms/ContourQuadric.py" -"vtkRenderingCore","VisualizationAlgorithms/CreateBFont.py" -"vtkRenderingCore","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkRenderingCore","VisualizationAlgorithms/Cutter.py" -"vtkRenderingCore","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkRenderingCore","VisualizationAlgorithms/CutWithScalars.py" -"vtkRenderingCore","VisualizationAlgorithms/DataSetSurface.py" -"vtkRenderingCore","VisualizationAlgorithms/DecimateFran.py" -"vtkRenderingCore","VisualizationAlgorithms/DecimateHawaii.py" -"vtkRenderingCore","VisualizationAlgorithms/DisplacementPlot.py" -"vtkRenderingCore","VisualizationAlgorithms/ExponentialCosine.py" -"vtkRenderingCore","VisualizationAlgorithms/ExtractData.py" -"vtkRenderingCore","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkRenderingCore","VisualizationAlgorithms/HeadBone.py" -"vtkRenderingCore","VisualizationAlgorithms/HeadSlice.py" -"vtkRenderingCore","VisualizationAlgorithms/Hello.py" -"vtkRenderingCore","VisualizationAlgorithms/HyperStreamline.py" -"vtkRenderingCore","VisualizationAlgorithms/IceCream.py" -"vtkRenderingCore","VisualizationAlgorithms/ImageGradient.py" -"vtkRenderingCore","VisualizationAlgorithms/IronIsoSurface.py" -"vtkRenderingCore","VisualizationAlgorithms/LOxGrid.py" -"vtkRenderingCore","VisualizationAlgorithms/LOx.py" -"vtkRenderingCore","VisualizationAlgorithms/LOxSeeds.py" -"vtkRenderingCore","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderingCore","VisualizationAlgorithms/Motor.py" -"vtkRenderingCore","VisualizationAlgorithms/Office.py" -"vtkRenderingCore","VisualizationAlgorithms/OfficeTube.py" -"vtkRenderingCore","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkRenderingCore","VisualizationAlgorithms/PineRootDecimation.py" -"vtkRenderingCore","VisualizationAlgorithms/PlateVibration.py" -"vtkRenderingCore","VisualizationAlgorithms/ProbeCombustor.py" -"vtkRenderingCore","VisualizationAlgorithms/SingleSplat.py" -"vtkRenderingCore","VisualizationAlgorithms/SpikeFran.py" -"vtkRenderingCore","VisualizationAlgorithms/SplatFace.py" -"vtkRenderingCore","VisualizationAlgorithms/Stocks.py" -"vtkRenderingCore","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRenderingCore","VisualizationAlgorithms/TensorAxes.py" -"vtkRenderingCore","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkRenderingCore","VisualizationAlgorithms/VelocityProfile.py" -"vtkRenderingCore","VisualizationAlgorithms/WarpCombustor.py" -"vtkRenderingCore","Visualization/AlphaFrequency.py" -"vtkRenderingCore","Visualization/AnnotatedCubeActor.py" -"vtkRenderingCore","Visualization/AssignCellColorsFromLUT.py" -"vtkRenderingCore","Visualization/BillboardTextActor3D.py" -"vtkRenderingCore","Visualization/BlobbyLogo.py" -"vtkRenderingCore","Visualization/Blow.py" -"vtkRenderingCore","Visualization/CameraModel1.py" -"vtkRenderingCore","Visualization/CameraModel2.py" -"vtkRenderingCore","Visualization/Camera.py" -"vtkRenderingCore","Visualization/ClampGlyphSizes.py" -"vtkRenderingCore","Visualization/CollisionDetection.py" -"vtkRenderingCore","Visualization/ColorAnActor.py" -"vtkRenderingCore","Visualization/ColoredAnnotatedCube.py" -"vtkRenderingCore","Visualization/ComplexV.py" -"vtkRenderingCore","Visualization/CreateColorSeriesDemo.py" -"vtkRenderingCore","Visualization/CubeAxesActor.py" -"vtkRenderingCore","Visualization/CurvatureBandsWithGlyphs.py" -"vtkRenderingCore","Visualization/DisplayCoordinateAxes.py" -"vtkRenderingCore","Visualization/DisplayQuadricSurfaces.py" -"vtkRenderingCore","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderingCore","Visualization/FrogBrain.py" -"vtkRenderingCore","Visualization/FroggieSurface.py" -"vtkRenderingCore","Visualization/FroggieView.py" -"vtkRenderingCore","Visualization/FrogSlice.py" -"vtkRenderingCore","Visualization/GlyphTable.py" -"vtkRenderingCore","Visualization/Hanoi.py" -"vtkRenderingCore","Visualization/HardwareSelector.py" -"vtkRenderingCore","Visualization/Hawaii.py" -"vtkRenderingCore","Visualization/IsosurfaceSampling.py" -"vtkRenderingCore","Visualization/Kitchen.py" -"vtkRenderingCore","Visualization/KochSnowflake.py" -"vtkRenderingCore","Visualization/LoopShrink.py" -"vtkRenderingCore","Visualization/Lorenz.py" -"vtkRenderingCore","Visualization/MultipleRenderWindows.py" -"vtkRenderingCore","Visualization/MultipleViewports.py" -"vtkRenderingCore","Visualization/NamedColors.py" -"vtkRenderingCore","Visualization/NormalsDemo.py" -"vtkRenderingCore","Visualization/OrientedGlyphs.py" -"vtkRenderingCore","Visualization/PointDataSubdivision.py" -"vtkRenderingCore","Visualization/PointSize.py" -"vtkRenderingCore","Visualization/ProgrammableGlyphFilter.py" -"vtkRenderingCore","Visualization/ProgrammableGlyphs.py" -"vtkRenderingCore","Visualization/QuadricVisualization.py" -"vtkRenderingCore","Visualization/ShadowsLightsDemo.py" -"vtkRenderingCore","Visualization/SphereTexture.py" -"vtkRenderingCore","Visualization/StreamLines.py" -"vtkRenderingCore","Visualization/TextSource.py" -"vtkRenderingCore","Visualization/VectorText.py" -"vtkRenderingCore","Visualization/WindowTitle.py" -"vtkRenderingCore","VolumeRendering/PseudoVolumeRendering.py" -"vtkRenderingCore","VolumeRendering/SimpleRayCast.py" -"vtkRenderingCore","Widgets/BalloonWidget.py" -"vtkRenderingCore","Widgets/BoxWidget.py" -"vtkRenderingCore","Widgets/CameraOrientationWidget.py" -"vtkRenderingCore","Widgets/CompassWidget.py" -"vtkRenderingCore","Widgets/ContourWidget.py" -"vtkRenderingCore","Widgets/EmbedInPyQt2.py" -"vtkRenderingCore","Widgets/EmbedInPyQt.py" -"vtkRenderingCore","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderingCore","Widgets/OrientationMarkerWidget1.py" -"vtkRenderingCore","Widgets/OrientationMarkerWidget.py" -"vtkRenderingCore","Widgets/ScalarBarWidget.py" -"vtkRenderingCore","Widgets/SphereWidget.py" -"vtkRenderingCore","Widgets/SplineWidget.py" -"vtkRenderingCore","Widgets/TextWidget.py" -"vtkRenderingFreeType","Annotation/MultiLineText.py" -"vtkRenderingFreeType","Annotation/TextOrigin.py" -"vtkRenderingFreeType","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderingFreeType","GeometricObjects/CellTypeSource.py" -"vtkRenderingFreeType","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderingFreeType","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderingFreeType","GeometricObjects/Planes.py" -"vtkRenderingFreeType","GeometricObjects/PlatonicSolids.py" -"vtkRenderingFreeType","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderingFreeType","GeometricObjects/TextActor.py" -"vtkRenderingFreeType","Modelling/FinanceFieldData.py" -"vtkRenderingFreeType","Rendering/GradientBackground.py" -"vtkRenderingFreeType","Utilities/RescaleReverseLUT.py" -"vtkRenderingFreeType","Utilities/VTKImportsForPython.py" -"vtkRenderingFreeType","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderingFreeType","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderingFreeType","VisualizationAlgorithms/Stocks.py" -"vtkRenderingFreeType","Visualization/AlphaFrequency.py" -"vtkRenderingFreeType","Visualization/BillboardTextActor3D.py" -"vtkRenderingFreeType","Visualization/CameraModel1.py" -"vtkRenderingFreeType","Visualization/CameraModel2.py" -"vtkRenderingFreeType","Visualization/CollisionDetection.py" -"vtkRenderingFreeType","Visualization/VectorText.py" -"vtkRenderingFreeType","Widgets/ImplicitPlaneWidget2.py" -"vtk","Rendering/GradientBackground.py" -"vtkRenderingLabel","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderingLabel","GeometricObjects/LinearCellsDemo.py" -"vtkRenderingLabel","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderingLOD","DataManipulation/MeshLabelImageColor.py" -"vtkRenderingLOD","Visualization/CameraModel1.py" -"vtkRenderingLOD","Visualization/CameraModel2.py" -"vtkRenderingOpenGL2","Annotation/MultiLineText.py" -"vtkRenderingOpenGL2","Annotation/TextOrigin.py" -"vtkRenderingOpenGL2","CompositeData/CompositePolyDataMapper.py" -"vtkRenderingOpenGL2","CompositeData/MultiBlockDataSet.py" -"vtkRenderingOpenGL2","CompositeData/OverlappingAMR.py" -"vtkRenderingOpenGL2","DataManipulation/LineOnMesh.py" -"vtkRenderingOpenGL2","DataManipulation/MeshLabelImageColor.py" -"vtkRenderingOpenGL2","ExplicitStructuredGrid/CreateESGrid.py" -"vtkRenderingOpenGL2","ExplicitStructuredGrid/LoadESGrid.py" -"vtkRenderingOpenGL2","Filtering/AppendFilter.py" -"vtkRenderingOpenGL2","Filtering/CombinePolyData.py" -"vtkRenderingOpenGL2","Filtering/ConnectivityFilter.py" -"vtkRenderingOpenGL2","Filtering/ConstrainedDelaunay2D.py" -"vtkRenderingOpenGL2","Filtering/Delaunay2D.py" -"vtkRenderingOpenGL2","Filtering/GaussianSplat.py" -"vtkRenderingOpenGL2","Filtering/Glyph2D.py" -"vtkRenderingOpenGL2","Filtering/Glyph3D.py" -"vtkRenderingOpenGL2","Filtering/PerlinNoise.py" -"vtkRenderingOpenGL2","Filtering/TransformPolyData.py" -"vtkRenderingOpenGL2","Filtering/TriangulateTerrainMap.py" -"vtkRenderingOpenGL2","Filtering/VertexGlyphFilter.py" -"vtkRenderingOpenGL2","Filtering/WarpTo.py" -"vtkRenderingOpenGL2","GeometricObjects/Arrow.py" -"vtkRenderingOpenGL2","GeometricObjects/Axes.py" -"vtkRenderingOpenGL2","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderingOpenGL2","GeometricObjects/CellTypeSource.py" -"vtkRenderingOpenGL2","GeometricObjects/Circle.py" -"vtkRenderingOpenGL2","GeometricObjects/ColoredLines.py" -"vtkRenderingOpenGL2","GeometricObjects/Cone.py" -"vtkRenderingOpenGL2","GeometricObjects/ConvexPointSet.py" -"vtkRenderingOpenGL2","GeometricObjects/Cube1.py" -"vtkRenderingOpenGL2","GeometricObjects/Cube.py" -"vtkRenderingOpenGL2","GeometricObjects/CylinderExample.py" -"vtkRenderingOpenGL2","GeometricObjects/Cylinder.py" -"vtkRenderingOpenGL2","GeometricObjects/Disk.py" -"vtkRenderingOpenGL2","GeometricObjects/Dodecahedron.py" -"vtkRenderingOpenGL2","GeometricObjects/EarthSource.py" -"vtkRenderingOpenGL2","GeometricObjects/EllipticalCylinderDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/EllipticalCylinder.py" -"vtkRenderingOpenGL2","GeometricObjects/Frustum.py" -"vtkRenderingOpenGL2","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/Hexahedron.py" -"vtkRenderingOpenGL2","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/LinearCellsDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/Line.py" -"vtkRenderingOpenGL2","GeometricObjects/LongLine.py" -"vtkRenderingOpenGL2","GeometricObjects/OrientedArrow.py" -"vtkRenderingOpenGL2","GeometricObjects/OrientedCylinder.py" -"vtkRenderingOpenGL2","GeometricObjects/ParametricKuenDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/Plane.py" -"vtkRenderingOpenGL2","GeometricObjects/PlanesIntersection.py" -"vtkRenderingOpenGL2","GeometricObjects/Planes.py" -"vtkRenderingOpenGL2","GeometricObjects/PlatonicSolids.py" -"vtkRenderingOpenGL2","GeometricObjects/Point.py" -"vtkRenderingOpenGL2","GeometricObjects/PolygonIntersection.py" -"vtkRenderingOpenGL2","GeometricObjects/Polygon.py" -"vtkRenderingOpenGL2","GeometricObjects/Polyhedron.py" -"vtkRenderingOpenGL2","GeometricObjects/PolyLine1.py" -"vtkRenderingOpenGL2","GeometricObjects/PolyLine.py" -"vtkRenderingOpenGL2","GeometricObjects/Pyramid.py" -"vtkRenderingOpenGL2","GeometricObjects/Quad.py" -"vtkRenderingOpenGL2","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/QuadraticHexahedron.py" -"vtkRenderingOpenGL2","GeometricObjects/QuadraticTetraDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/QuadraticTetra.py" -"vtkRenderingOpenGL2","GeometricObjects/RegularPolygonSource.py" -"vtkRenderingOpenGL2","GeometricObjects/ShrinkCube.py" -"vtkRenderingOpenGL2","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderingOpenGL2","GeometricObjects/Sphere.py" -"vtkRenderingOpenGL2","GeometricObjects/TessellatedBoxSource.py" -"vtkRenderingOpenGL2","GeometricObjects/Tetrahedron.py" -"vtkRenderingOpenGL2","GeometricObjects/TextActor.py" -"vtkRenderingOpenGL2","GeometricObjects/Triangle.py" -"vtkRenderingOpenGL2","GeometricObjects/TriangleStrip.py" -"vtkRenderingOpenGL2","GeometricObjects/Vertex.py" -"vtkRenderingOpenGL2","Graphs/ColorEdges.py" -"vtkRenderingOpenGL2","Graphs/ColorVertexLabels.py" -"vtkRenderingOpenGL2","Graphs/ColorVerticesLookupTable.py" -"vtkRenderingOpenGL2","Graphs/ConstructGraph.py" -"vtkRenderingOpenGL2","Graphs/ConstructTree.py" -"vtkRenderingOpenGL2","Graphs/CreateTree.py" -"vtkRenderingOpenGL2","Graphs/EdgeWeights.py" -"vtkRenderingOpenGL2","Graphs/GraphToPolyData.py" -"vtkRenderingOpenGL2","Graphs/LabelVerticesAndEdges.py" -"vtkRenderingOpenGL2","Graphs/NOVCAGraph.py" -"vtkRenderingOpenGL2","Graphs/RandomGraphSource.py" -"vtkRenderingOpenGL2","Graphs/ScaleVertices.py" -"vtkRenderingOpenGL2","Graphs/SelectedVerticesAndEdges.py" -"vtkRenderingOpenGL2","Graphs/SideBySideGraphs.py" -"vtkRenderingOpenGL2","Graphs/VisualizeDirectedGraph.py" -"vtkRenderingOpenGL2","Graphs/VisualizeGraph.py" -"vtkRenderingOpenGL2","HyperTreeGrid/HyperTreeGridSource.py" -"vtkRenderingOpenGL2","ImageData/ImageDataGeometryFilter.py" -"vtkRenderingOpenGL2","ImageData/ImageNormalize.py" -"vtkRenderingOpenGL2","ImageData/ImageWeightedSum.py" -"vtkRenderingOpenGL2","ImageData/WriteReadVtkImageData.py" -"vtkRenderingOpenGL2","ImageProcessing/Attenuation.py" -"vtkRenderingOpenGL2","ImageProcessing/EnhanceEdges.py" -"vtkRenderingOpenGL2","ImageProcessing/GaussianSmooth.py" -"vtkRenderingOpenGL2","ImageProcessing/HybridMedianComparison.py" -"vtkRenderingOpenGL2","ImageProcessing/IdealHighPass.py" -"vtkRenderingOpenGL2","ImageProcessing/IsoSubsample.py" -"vtkRenderingOpenGL2","ImageProcessing/MedianComparison.py" -"vtkRenderingOpenGL2","ImageProcessing/MorphologyComparison.py" -"vtkRenderingOpenGL2","ImageProcessing/Pad.py" -"vtkRenderingOpenGL2","ImageProcessing/VTKSpectrum.py" -"vtkRenderingOpenGL2","Images/Actor2D.py" -"vtkRenderingOpenGL2","Images/BackgroundImage.py" -"vtkRenderingOpenGL2","Images/Cast.py" -"vtkRenderingOpenGL2","Images/ImageWarp.py" -"vtkRenderingOpenGL2","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkRenderingOpenGL2","ImplicitFunctions/ImplicitQuadric.py" -"vtkRenderingOpenGL2","ImplicitFunctions/ImplicitSphere1.py" -"vtkRenderingOpenGL2","ImplicitFunctions/ImplicitSphere.py" -"vtkRenderingOpenGL2","ImplicitFunctions/SampleFunction.py" -"vtkRenderingOpenGL2","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRenderingOpenGL2","InfoVis/ParallelCoordinatesView.py" -"vtkRenderingOpenGL2","InfoVis/SelectedGraphIDs.py" -"vtkRenderingOpenGL2","Interaction/CallBack.py" -"vtkRenderingOpenGL2","Interaction/InteractorStyleTrackballActor.py" -"vtkRenderingOpenGL2","Interaction/InteractorStyleTrackballCamera.py" -"vtkRenderingOpenGL2","Interaction/MouseEventsObserver.py" -"vtkRenderingOpenGL2","Interaction/MouseEvents.py" -"vtkRenderingOpenGL2","IO/3DSImporter.py" -"vtkRenderingOpenGL2","IO/CSVReadEdit1.py" -"vtkRenderingOpenGL2","IO/CSVReadEdit.py" -"vtkRenderingOpenGL2","IO/HDRReader.py" -"vtkRenderingOpenGL2","IO/ImageWriter.py" -"vtkRenderingOpenGL2","IO/ReadDICOM.py" -"vtkRenderingOpenGL2","IO/ReadExodusData.py" -"vtkRenderingOpenGL2","IO/ReadImageData.py" -"vtkRenderingOpenGL2","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderingOpenGL2","IO/ReadPLOT3D.py" -"vtkRenderingOpenGL2","IO/ReadPolyData.py" -"vtkRenderingOpenGL2","IO/ReadSLC.py" -"vtkRenderingOpenGL2","IO/ReadSTL.py" -"vtkRenderingOpenGL2","IO/ReadVTP.py" -"vtkRenderingOpenGL2","IO/WriteLegacyLinearCells.py" -"vtkRenderingOpenGL2","IO/WritePLY.py" -"vtkRenderingOpenGL2","IO/WriteSTL.py" -"vtkRenderingOpenGL2","IO/WriteTriangleToFile.py" -"vtkRenderingOpenGL2","IO/WriteXMLLinearCells.py" -"vtkRenderingOpenGL2","Medical/GenerateCubesFromLabels.py" -"vtkRenderingOpenGL2","Medical/GenerateModelsFromLabels.py" -"vtkRenderingOpenGL2","Medical/MedicalDemo1.py" -"vtkRenderingOpenGL2","Medical/MedicalDemo2.py" -"vtkRenderingOpenGL2","Medical/MedicalDemo3.py" -"vtkRenderingOpenGL2","Medical/MedicalDemo4.py" -"vtkRenderingOpenGL2","Medical/TissueLens.py" -"vtkRenderingOpenGL2","Meshes/BoundaryEdges.py" -"vtkRenderingOpenGL2","Meshes/CapClip.py" -"vtkRenderingOpenGL2","Meshes/ClipDataSetWithPolyData1.py" -"vtkRenderingOpenGL2","Meshes/ClipDataSetWithPolyData.py" -"vtkRenderingOpenGL2","Meshes/ColoredElevationMap.py" -"vtkRenderingOpenGL2","Meshes/Decimation.py" -"vtkRenderingOpenGL2","Meshes/DeformPointSet.py" -"vtkRenderingOpenGL2","Meshes/PointInterpolator.py" -"vtkRenderingOpenGL2","Meshes/SolidClip.py" -"vtkRenderingOpenGL2","Modelling/Bottle.py" -"vtkRenderingOpenGL2","Modelling/CappedSphere.py" -"vtkRenderingOpenGL2","Modelling/ContourTriangulator.py" -"vtkRenderingOpenGL2","Modelling/DelaunayMesh.py" -"vtkRenderingOpenGL2","Modelling/DiscreteMarchingCubes.py" -"vtkRenderingOpenGL2","Modelling/ExtractLargestIsosurface.py" -"vtkRenderingOpenGL2","Modelling/FinanceFieldData.py" -"vtkRenderingOpenGL2","Modelling/Finance.py" -"vtkRenderingOpenGL2","Modelling/MarchingCubes.py" -"vtkRenderingOpenGL2","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkRenderingOpenGL2","Modelling/Spring.py" -"vtkRenderingOpenGL2","Picking/CellPicking.py" -"vtkRenderingOpenGL2","Picking/HighlightPickedActor.py" -"vtkRenderingOpenGL2","Picking/HighlightWithSilhouette.py" -"vtkRenderingOpenGL2","Plotting/MultiplePlots.py" -"vtkRenderingOpenGL2","Plotting/ScatterPlot.py" -"vtkRenderingOpenGL2","Plotting/SpiderPlot.py" -"vtkRenderingOpenGL2","Plotting/SurfacePlot.py" -"vtkRenderingOpenGL2","PolyData/AlignTwoPolyDatas.py" -"vtkRenderingOpenGL2","PolyData/BooleanOperationPolyDataFilter.py" -"vtkRenderingOpenGL2","PolyData/CellsInsideObject.py" -"vtkRenderingOpenGL2","PolyData/ClosedSurface.py" -"vtkRenderingOpenGL2","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkRenderingOpenGL2","PolyData/ExtractSelection.py" -"vtkRenderingOpenGL2","PolyData/ExtractSelectionUsingCells.py" -"vtkRenderingOpenGL2","PolyData/FilledPolygon.py" -"vtkRenderingOpenGL2","PolyData/ImplicitPolyDataDistance.py" -"vtkRenderingOpenGL2","PolyData/IterateOverLines.py" -"vtkRenderingOpenGL2","PolyData/Outline.py" -"vtkRenderingOpenGL2","PolyData/PointSource.py" -"vtkRenderingOpenGL2","PolyData/PolyDataContourToImageData.py" -"vtkRenderingOpenGL2","PolyData/PolyDataToImageDataStencil.py" -"vtkRenderingOpenGL2","PolyData/RotationAroundLine.py" -"vtkRenderingOpenGL2","PolyData/RuledSurfaceFilter.py" -"vtkRenderingOpenGL2","PolyData/SmoothMeshGrid.py" -"vtkRenderingOpenGL2","PolyData/TriangleColoredPoints.py" -"vtkRenderingOpenGL2","PolyData/TriangleCorners.py" -"vtkRenderingOpenGL2","PolyData/TriangleCornerVertices.py" -"vtkRenderingOpenGL2","PolyData/TubeFilter.py" -"vtkRenderingOpenGL2","PolyData/WarpVector.py" -"vtkRenderingOpenGL2","RectilinearGrid/RectilinearGrid.py" -"vtkRenderingOpenGL2","RectilinearGrid/RGrid.py" -"vtkRenderingOpenGL2","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRenderingOpenGL2","Rendering/AmbientSpheres.py" -"vtkRenderingOpenGL2","Rendering/CameraBlur.py" -"vtkRenderingOpenGL2","Rendering/ColoredSphere.py" -"vtkRenderingOpenGL2","Rendering/Cone3.py" -"vtkRenderingOpenGL2","Rendering/Cone4.py" -"vtkRenderingOpenGL2","Rendering/DiffuseSpheres.py" -"vtkRenderingOpenGL2","Rendering/FlatVersusGouraud.py" -"vtkRenderingOpenGL2","Rendering/GradientBackground.py" -"vtkRenderingOpenGL2","Rendering/LayeredActors.py" -"vtkRenderingOpenGL2","Rendering/Mace.py" -"vtkRenderingOpenGL2","Rendering/Model.py" -"vtkRenderingOpenGL2","Rendering/MotionBlur.py" -"vtkRenderingOpenGL2","Rendering/OutlineGlowPass.py" -"vtkRenderingOpenGL2","Rendering/PBR_Anisotropy.py" -"vtkRenderingOpenGL2","Rendering/PBR_Clear_Coat.py" -"vtkRenderingOpenGL2","Rendering/PBR_Edge_Tint.py" -"vtkRenderingOpenGL2","Rendering/PBR_HDR_Environment.py" -"vtkRenderingOpenGL2","Rendering/PBR_Mapping.py" -"vtkRenderingOpenGL2","Rendering/PBR_Materials_Coat.py" -"vtkRenderingOpenGL2","Rendering/PBR_Materials.py" -"vtkRenderingOpenGL2","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderingOpenGL2","Rendering/PBR_Skybox.py" -"vtkRenderingOpenGL2","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderingOpenGL2","Rendering/Rainbow.py" -"vtkRenderingOpenGL2","Rendering/Rotations.py" -"vtkRenderingOpenGL2","Rendering/Shadows.py" -"vtkRenderingOpenGL2","Rendering/SpecularSpheres.py" -"vtkRenderingOpenGL2","Rendering/StippledLine.py" -"vtkRenderingOpenGL2","Rendering/StripFran.py" -"vtkRenderingOpenGL2","Rendering/TransformSphere.py" -"vtkRenderingOpenGL2","Rendering/TransparentBackground.py" -"vtkRenderingOpenGL2","Rendering/WalkCow.py" -"vtkRenderingOpenGL2","StructuredGrid/BlankPoint.py" -"vtkRenderingOpenGL2","StructuredGrid/SGrid.py" -"vtkRenderingOpenGL2","StructuredPoints/Vol.py" -"vtkRenderingOpenGL2","Texture/AnimateVectors.py" -"vtkRenderingOpenGL2","Texture/TextureCutQuadric.py" -"vtkRenderingOpenGL2","Texture/TextureCutSphere.py" -"vtkRenderingOpenGL2","Texture/TexturePlane.py" -"vtkRenderingOpenGL2","Texture/TextureThreshold.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step1.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step2.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step3.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step4.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step5.py" -"vtkRenderingOpenGL2","Tutorial/Tutorial_Step6.py" -"vtkRenderingOpenGL2","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkRenderingOpenGL2","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkRenderingOpenGL2","UnstructuredGrid/UGrid.py" -"vtkRenderingOpenGL2","Utilities/Animation.py" -"vtkRenderingOpenGL2","Utilities/ColorMapToLUT.py" -"vtkRenderingOpenGL2","Utilities/JSONColorMapToLUT.py" -"vtkRenderingOpenGL2","Utilities/LUTUtilities.py" -"vtkRenderingOpenGL2","Utilities/RescaleReverseLUT.py" -"vtkRenderingOpenGL2","Utilities/ResetCameraOrientation.py" -"vtkRenderingOpenGL2","Utilities/SaveSceneToFieldData.py" -"vtkRenderingOpenGL2","Utilities/SaveSceneToFile.py" -"vtkRenderingOpenGL2","Utilities/Screenshot.py" -"vtkRenderingOpenGL2","Utilities/ShareCamera.py" -"vtkRenderingOpenGL2","Utilities/VTKImportsForPython.py" -"vtkRenderingOpenGL2","Utilities/XMLColorMapToLUT.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/BluntStreamlines.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CarotidFlow.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ContourQuadric.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CreateBFont.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/Cutter.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/CutWithScalars.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/DataSetSurface.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/DecimateFran.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/DecimateHawaii.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/DisplacementPlot.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ExponentialCosine.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ExtractData.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/HeadBone.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/HeadSlice.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/Hello.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/HyperStreamline.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/IceCream.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ImageGradient.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/IronIsoSurface.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/LOxGrid.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/LOx.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/LOxSeeds.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/Motor.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/Office.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/OfficeTube.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/PineRootDecimation.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/PlateVibration.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/ProbeCombustor.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/SingleSplat.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/SpikeFran.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/SplatFace.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/Stocks.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/TensorAxes.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/VelocityProfile.py" -"vtkRenderingOpenGL2","VisualizationAlgorithms/WarpCombustor.py" -"vtkRenderingOpenGL2","Visualization/AlphaFrequency.py" -"vtkRenderingOpenGL2","Visualization/AnnotatedCubeActor.py" -"vtkRenderingOpenGL2","Visualization/AssignCellColorsFromLUT.py" -"vtkRenderingOpenGL2","Visualization/BillboardTextActor3D.py" -"vtkRenderingOpenGL2","Visualization/BlobbyLogo.py" -"vtkRenderingOpenGL2","Visualization/Blow.py" -"vtkRenderingOpenGL2","Visualization/CameraModel1.py" -"vtkRenderingOpenGL2","Visualization/CameraModel2.py" -"vtkRenderingOpenGL2","Visualization/Camera.py" -"vtkRenderingOpenGL2","Visualization/ClampGlyphSizes.py" -"vtkRenderingOpenGL2","Visualization/CollisionDetection.py" -"vtkRenderingOpenGL2","Visualization/ColorAnActor.py" -"vtkRenderingOpenGL2","Visualization/ColoredAnnotatedCube.py" -"vtkRenderingOpenGL2","Visualization/ComplexV.py" -"vtkRenderingOpenGL2","Visualization/CreateColorSeriesDemo.py" -"vtkRenderingOpenGL2","Visualization/CubeAxesActor.py" -"vtkRenderingOpenGL2","Visualization/DisplayCoordinateAxes.py" -"vtkRenderingOpenGL2","Visualization/DisplayQuadricSurfaces.py" -"vtkRenderingOpenGL2","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderingOpenGL2","Visualization/FrogBrain.py" -"vtkRenderingOpenGL2","Visualization/FroggieSurface.py" -"vtkRenderingOpenGL2","Visualization/FroggieView.py" -"vtkRenderingOpenGL2","Visualization/FrogSlice.py" -"vtkRenderingOpenGL2","Visualization/GlyphTable.py" -"vtkRenderingOpenGL2","Visualization/Hanoi.py" -"vtkRenderingOpenGL2","Visualization/HardwareSelector.py" -"vtkRenderingOpenGL2","Visualization/Hawaii.py" -"vtkRenderingOpenGL2","Visualization/IsosurfaceSampling.py" -"vtkRenderingOpenGL2","Visualization/Kitchen.py" -"vtkRenderingOpenGL2","Visualization/KochSnowflake.py" -"vtkRenderingOpenGL2","Visualization/LoopShrink.py" -"vtkRenderingOpenGL2","Visualization/Lorenz.py" -"vtkRenderingOpenGL2","Visualization/MultipleRenderWindows.py" -"vtkRenderingOpenGL2","Visualization/MultipleViewports.py" -"vtkRenderingOpenGL2","Visualization/NamedColors.py" -"vtkRenderingOpenGL2","Visualization/NormalsDemo.py" -"vtkRenderingOpenGL2","Visualization/OrientedGlyphs.py" -"vtkRenderingOpenGL2","Visualization/PointDataSubdivision.py" -"vtkRenderingOpenGL2","Visualization/PointSize.py" -"vtkRenderingOpenGL2","Visualization/ProgrammableGlyphFilter.py" -"vtkRenderingOpenGL2","Visualization/ProgrammableGlyphs.py" -"vtkRenderingOpenGL2","Visualization/QuadricVisualization.py" -"vtkRenderingOpenGL2","Visualization/ShadowsLightsDemo.py" -"vtkRenderingOpenGL2","Visualization/SphereTexture.py" -"vtkRenderingOpenGL2","Visualization/StreamLines.py" -"vtkRenderingOpenGL2","Visualization/TextSource.py" -"vtkRenderingOpenGL2","Visualization/VectorText.py" -"vtkRenderingOpenGL2","Visualization/WindowTitle.py" -"vtkRenderingOpenGL2","VolumeRendering/PseudoVolumeRendering.py" -"vtkRenderingOpenGL2","Widgets/BalloonWidget.py" -"vtkRenderingOpenGL2","Widgets/BoxWidget.py" -"vtkRenderingOpenGL2","Widgets/CameraOrientationWidget.py" -"vtkRenderingOpenGL2","Widgets/CompassWidget.py" -"vtkRenderingOpenGL2","Widgets/ContourWidget.py" -"vtkRenderingOpenGL2","Widgets/EmbedInPyQt2.py" -"vtkRenderingOpenGL2","Widgets/EmbedInPyQt.py" -"vtkRenderingOpenGL2","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderingOpenGL2","Widgets/OrientationMarkerWidget1.py" -"vtkRenderingOpenGL2","Widgets/OrientationMarkerWidget.py" -"vtkRenderingOpenGL2","Widgets/ScalarBarWidget.py" -"vtkRenderingOpenGL2","Widgets/SphereWidget.py" -"vtkRenderingOpenGL2","Widgets/SplineWidget.py" -"vtkRenderingOpenGL2","Widgets/TextWidget.py" -"vtk","Rendering/PBR_Anisotropy.py" -"vtk","Rendering/PBR_Clear_Coat.py" -"vtk","Rendering/PBR_Edge_Tint.py" -"vtk","Rendering/PBR_HDR_Environment.py" -"vtk","Rendering/PBR_Mapping.py" -"vtk","Rendering/PBR_Materials_Coat.py" -"vtk","Rendering/PBR_Materials.py" -"vtk","Rendering/PBR_Skybox_Anisotropy.py" -"vtk","Rendering/PBR_Skybox.py" -"vtk","Rendering/PBR_Skybox_Texturing.py" -"vtk","Rendering/Rotations.py" -"vtk","Rendering/Shadows.py" -"vtk","Rendering/StripFran.py" -"vtkRenderingUI","Utilities/VTKImportsForPython.py" -"vtkRenderingUI","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderingVolume","Medical/MedicalDemo4.py" -"vtkRenderingVolumeOpenGL2","Medical/MedicalDemo4.py" -"vtkRenderingVolumeOpenGL2","Utilities/VTKImportsForPython.py" -"vtkRenderingVolumeOpenGL2","Utilities/VTKWithNumpy.py" -"vtkRenderingVolumeOpenGL2","VolumeRendering/SimpleRayCast.py" -"vtkRenderingVolume","Utilities/VTKWithNumpy.py" -"vtkRenderingVolume","VolumeRendering/SimpleRayCast.py" -"vtkRenderLargeImage","Visualization/PointDataSubdivision.py" -"vtkRenderPassCollection","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderPassCollection","Rendering/PBR_Skybox.py" -"vtkRenderPassCollection","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderPassCollection","Rendering/Shadows.py" -"vtkRenderPassCollection","Visualization/ShadowsLightsDemo.py" -"vtkRenderStepsPass","Rendering/MotionBlur.py" -"vtkRenderStepsPass","Rendering/OutlineGlowPass.py" -"vtkRenderWindow","Annotation/MultiLineText.py" -"vtkRenderWindow","Annotation/TextOrigin.py" -"vtkRenderWindow","CompositeData/CompositePolyDataMapper.py" -"vtkRenderWindow","CompositeData/MultiBlockDataSet.py" -"vtkRenderWindow","CompositeData/OverlappingAMR.py" -"vtkRenderWindow","DataManipulation/LineOnMesh.py" -"vtkRenderWindow","DataManipulation/MeshLabelImageColor.py" -"vtkRenderWindow","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkRenderWindow","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderWindow","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkRenderWindow","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkRenderWindow","Deprecated/Geovis/GeoGraticle.py" -"vtkRenderWindow","ExplicitStructuredGrid/CreateESGrid.py" -"vtkRenderWindow","ExplicitStructuredGrid/LoadESGrid.py" -"vtkRenderWindow","Filtering/AppendFilter.py" -"vtkRenderWindow","Filtering/CombinePolyData.py" -"vtkRenderWindow","Filtering/ConnectivityFilter.py" -"vtkRenderWindow","Filtering/ConstrainedDelaunay2D.py" -"vtkRenderWindow","Filtering/Delaunay2D.py" -"vtkRenderWindow","Filtering/GaussianSplat.py" -"vtkRenderWindow","Filtering/Glyph2D.py" -"vtkRenderWindow","Filtering/Glyph3D.py" -"vtkRenderWindow","Filtering/PerlinNoise.py" -"vtkRenderWindow","Filtering/TransformPolyData.py" -"vtkRenderWindow","Filtering/TriangulateTerrainMap.py" -"vtkRenderWindow","Filtering/VertexGlyphFilter.py" -"vtkRenderWindow","Filtering/WarpTo.py" -"vtkRenderWindow","GeometricObjects/Arrow.py" -"vtkRenderWindow","GeometricObjects/Axes.py" -"vtkRenderWindow","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderWindow","GeometricObjects/CellTypeSource.py" -"vtkRenderWindow","GeometricObjects/Circle.py" -"vtkRenderWindow","GeometricObjects/ColoredLines.py" -"vtkRenderWindow","GeometricObjects/Cone.py" -"vtkRenderWindow","GeometricObjects/ConvexPointSet.py" -"vtkRenderWindow","GeometricObjects/Cube1.py" -"vtkRenderWindow","GeometricObjects/Cube.py" -"vtkRenderWindow","GeometricObjects/CylinderExample.py" -"vtkRenderWindow","GeometricObjects/Cylinder.py" -"vtkRenderWindow","GeometricObjects/Disk.py" -"vtkRenderWindow","GeometricObjects/Dodecahedron.py" -"vtkRenderWindow","GeometricObjects/EarthSource.py" -"vtkRenderWindow","GeometricObjects/EllipticalCylinderDemo.py" -"vtkRenderWindow","GeometricObjects/EllipticalCylinder.py" -"vtkRenderWindow","GeometricObjects/Frustum.py" -"vtkRenderWindow","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderWindow","GeometricObjects/Hexahedron.py" -"vtkRenderWindow","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderWindow","GeometricObjects/LinearCellsDemo.py" -"vtkRenderWindow","GeometricObjects/Line.py" -"vtkRenderWindow","GeometricObjects/LongLine.py" -"vtkRenderWindow","GeometricObjects/OrientedArrow.py" -"vtkRenderWindow","GeometricObjects/OrientedCylinder.py" -"vtkRenderWindow","GeometricObjects/ParametricKuenDemo.py" -"vtkRenderWindow","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderWindow","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkRenderWindow","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkRenderWindow","GeometricObjects/Plane.py" -"vtkRenderWindow","GeometricObjects/Planes.py" -"vtkRenderWindow","GeometricObjects/PlatonicSolids.py" -"vtkRenderWindow","GeometricObjects/Point.py" -"vtkRenderWindow","GeometricObjects/Polygon.py" -"vtkRenderWindow","GeometricObjects/Polyhedron.py" -"vtkRenderWindow","GeometricObjects/PolyLine1.py" -"vtkRenderWindow","GeometricObjects/PolyLine.py" -"vtkRenderWindow","GeometricObjects/Pyramid.py" -"vtkRenderWindow","GeometricObjects/Quad.py" -"vtkRenderWindow","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkRenderWindow","GeometricObjects/QuadraticHexahedron.py" -"vtkRenderWindow","GeometricObjects/QuadraticTetraDemo.py" -"vtkRenderWindow","GeometricObjects/QuadraticTetra.py" -"vtkRenderWindow","GeometricObjects/RegularPolygonSource.py" -"vtkRenderWindow","GeometricObjects/ShrinkCube.py" -"vtkRenderWindow","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderWindow","GeometricObjects/Sphere.py" -"vtkRenderWindow","GeometricObjects/TessellatedBoxSource.py" -"vtkRenderWindow","GeometricObjects/Tetrahedron.py" -"vtkRenderWindow","GeometricObjects/TextActor.py" -"vtkRenderWindow","GeometricObjects/Triangle.py" -"vtkRenderWindow","GeometricObjects/TriangleStrip.py" -"vtkRenderWindow","GeometricObjects/Vertex.py" -"vtkRenderWindow","Graphs/GraphToPolyData.py" -"vtkRenderWindow","Graphs/SideBySideGraphs.py" -"vtkRenderWindow","HyperTreeGrid/HyperTreeGridSource.py" -"vtkRenderWindow","ImageData/ImageDataGeometryFilter.py" -"vtkRenderWindow","ImageData/ImageNormalize.py" -"vtkRenderWindow","ImageData/ImageWeightedSum.py" -"vtkRenderWindow","ImageData/WriteReadVtkImageData.py" -"vtkRenderWindow","ImageProcessing/Attenuation.py" -"vtkRenderWindow","ImageProcessing/EnhanceEdges.py" -"vtkRenderWindow","ImageProcessing/GaussianSmooth.py" -"vtkRenderWindow","ImageProcessing/HybridMedianComparison.py" -"vtkRenderWindow","ImageProcessing/IdealHighPass.py" -"vtkRenderWindow","ImageProcessing/IsoSubsample.py" -"vtkRenderWindow","ImageProcessing/MedianComparison.py" -"vtkRenderWindow","ImageProcessing/MorphologyComparison.py" -"vtkRenderWindow","ImageProcessing/Pad.py" -"vtkRenderWindow","ImageProcessing/VTKSpectrum.py" -"vtkRenderWindow","Images/Actor2D.py" -"vtkRenderWindow","Images/BackgroundImage.py" -"vtkRenderWindow","Images/Cast.py" -"vtkRenderWindow","Images/ImageWarp.py" -"vtkRenderWindow","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkRenderWindow","ImplicitFunctions/ImplicitQuadric.py" -"vtkRenderWindow","ImplicitFunctions/ImplicitSphere1.py" -"vtkRenderWindow","ImplicitFunctions/ImplicitSphere.py" -"vtkRenderWindow","ImplicitFunctions/SampleFunction.py" -"vtkRenderWindow","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRenderWindow","Interaction/CallBack.py" -"vtkRenderWindow","Interaction/InteractorStyleTrackballActor.py" -"vtkRenderWindow","Interaction/InteractorStyleTrackballCamera.py" -"vtkRenderWindow","Interaction/MouseEventsObserver.py" -"vtkRenderWindow","Interaction/MouseEvents.py" -"vtkRenderWindowInteractor","Annotation/MultiLineText.py" -"vtkRenderWindowInteractor","Annotation/TextOrigin.py" -"vtkRenderWindowInteractor","CompositeData/CompositePolyDataMapper.py" -"vtkRenderWindowInteractor","CompositeData/MultiBlockDataSet.py" -"vtkRenderWindowInteractor","CompositeData/OverlappingAMR.py" -"vtkRenderWindowInteractor","DataManipulation/LineOnMesh.py" -"vtkRenderWindowInteractor","DataManipulation/MeshLabelImageColor.py" -"vtkRenderWindowInteractor","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkRenderWindowInteractor","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderWindowInteractor","Deprecated/GeometricObjects/ParametricObjects.py" -"vtkRenderWindowInteractor","Deprecated/Geovis/GeoAssignCoordinates.py" -"vtkRenderWindowInteractor","Deprecated/Geovis/GeoGraticle.py" -"vtkRenderWindowInteractor","ExplicitStructuredGrid/CreateESGrid.py" -"vtkRenderWindowInteractor","ExplicitStructuredGrid/LoadESGrid.py" -"vtkRenderWindowInteractor","Filtering/AppendFilter.py" -"vtkRenderWindowInteractor","Filtering/CombinePolyData.py" -"vtkRenderWindowInteractor","Filtering/ConnectivityFilter.py" -"vtkRenderWindowInteractor","Filtering/ConstrainedDelaunay2D.py" -"vtkRenderWindowInteractor","Filtering/Delaunay2D.py" -"vtkRenderWindowInteractor","Filtering/GaussianSplat.py" -"vtkRenderWindowInteractor","Filtering/Glyph2D.py" -"vtkRenderWindowInteractor","Filtering/Glyph3D.py" -"vtkRenderWindowInteractor","Filtering/PerlinNoise.py" -"vtkRenderWindowInteractor","Filtering/TransformPolyData.py" -"vtkRenderWindowInteractor","Filtering/TriangulateTerrainMap.py" -"vtkRenderWindowInteractor","Filtering/VertexGlyphFilter.py" -"vtkRenderWindowInteractor","Filtering/WarpTo.py" -"vtkRenderWindowInteractor","GeometricObjects/Arrow.py" -"vtkRenderWindowInteractor","GeometricObjects/Axes.py" -"vtkRenderWindowInteractor","GeometricObjects/Cell3DDemonstration.py" -"vtkRenderWindowInteractor","GeometricObjects/CellTypeSource.py" -"vtkRenderWindowInteractor","GeometricObjects/Circle.py" -"vtkRenderWindowInteractor","GeometricObjects/ColoredLines.py" -"vtkRenderWindowInteractor","GeometricObjects/Cone.py" -"vtkRenderWindowInteractor","GeometricObjects/ConvexPointSet.py" -"vtkRenderWindowInteractor","GeometricObjects/Cube1.py" -"vtkRenderWindowInteractor","GeometricObjects/Cube.py" -"vtkRenderWindowInteractor","GeometricObjects/CylinderExample.py" -"vtkRenderWindowInteractor","GeometricObjects/Cylinder.py" -"vtkRenderWindowInteractor","GeometricObjects/Disk.py" -"vtkRenderWindowInteractor","GeometricObjects/Dodecahedron.py" -"vtkRenderWindowInteractor","GeometricObjects/EarthSource.py" -"vtkRenderWindowInteractor","GeometricObjects/EllipticalCylinderDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/EllipticalCylinder.py" -"vtkRenderWindowInteractor","GeometricObjects/Frustum.py" -"vtkRenderWindowInteractor","GeometricObjects/GeometricObjectsDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/Hexahedron.py" -"vtkRenderWindowInteractor","GeometricObjects/IsoparametricCellsDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/LinearCellsDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/Line.py" -"vtkRenderWindowInteractor","GeometricObjects/LongLine.py" -"vtkRenderWindowInteractor","GeometricObjects/OrientedArrow.py" -"vtkRenderWindowInteractor","GeometricObjects/OrientedCylinder.py" -"vtkRenderWindowInteractor","GeometricObjects/ParametricKuenDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/ParametricObjectsDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/Plane.py" -"vtkRenderWindowInteractor","GeometricObjects/Planes.py" -"vtkRenderWindowInteractor","GeometricObjects/PlatonicSolids.py" -"vtkRenderWindowInteractor","GeometricObjects/Point.py" -"vtkRenderWindowInteractor","GeometricObjects/Polygon.py" -"vtkRenderWindowInteractor","GeometricObjects/Polyhedron.py" -"vtkRenderWindowInteractor","GeometricObjects/PolyLine1.py" -"vtkRenderWindowInteractor","GeometricObjects/PolyLine.py" -"vtkRenderWindowInteractor","GeometricObjects/Pyramid.py" -"vtkRenderWindowInteractor","GeometricObjects/Quad.py" -"vtkRenderWindowInteractor","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/QuadraticHexahedron.py" -"vtkRenderWindowInteractor","GeometricObjects/QuadraticTetraDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/QuadraticTetra.py" -"vtkRenderWindowInteractor","GeometricObjects/RegularPolygonSource.py" -"vtkRenderWindowInteractor","GeometricObjects/ShrinkCube.py" -"vtkRenderWindowInteractor","GeometricObjects/SourceObjectsDemo.py" -"vtkRenderWindowInteractor","GeometricObjects/Sphere.py" -"vtkRenderWindowInteractor","GeometricObjects/TessellatedBoxSource.py" -"vtkRenderWindowInteractor","GeometricObjects/Tetrahedron.py" -"vtkRenderWindowInteractor","GeometricObjects/TextActor.py" -"vtkRenderWindowInteractor","GeometricObjects/Triangle.py" -"vtkRenderWindowInteractor","GeometricObjects/TriangleStrip.py" -"vtkRenderWindowInteractor","GeometricObjects/Vertex.py" -"vtkRenderWindowInteractor","Graphs/GraphToPolyData.py" -"vtkRenderWindowInteractor","Graphs/SideBySideGraphs.py" -"vtkRenderWindowInteractor","HyperTreeGrid/HyperTreeGridSource.py" -"vtkRenderWindowInteractor","ImageData/ImageDataGeometryFilter.py" -"vtkRenderWindowInteractor","ImageData/ImageNormalize.py" -"vtkRenderWindowInteractor","ImageData/ImageWeightedSum.py" -"vtkRenderWindowInteractor","ImageData/WriteReadVtkImageData.py" -"vtkRenderWindowInteractor","ImageProcessing/Attenuation.py" -"vtkRenderWindowInteractor","ImageProcessing/EnhanceEdges.py" -"vtkRenderWindowInteractor","ImageProcessing/GaussianSmooth.py" -"vtkRenderWindowInteractor","ImageProcessing/HybridMedianComparison.py" -"vtkRenderWindowInteractor","ImageProcessing/IdealHighPass.py" -"vtkRenderWindowInteractor","ImageProcessing/IsoSubsample.py" -"vtkRenderWindowInteractor","ImageProcessing/MedianComparison.py" -"vtkRenderWindowInteractor","ImageProcessing/MorphologyComparison.py" -"vtkRenderWindowInteractor","ImageProcessing/Pad.py" -"vtkRenderWindowInteractor","ImageProcessing/VTKSpectrum.py" -"vtkRenderWindowInteractor","Images/Actor2D.py" -"vtkRenderWindowInteractor","Images/BackgroundImage.py" -"vtkRenderWindowInteractor","Images/Cast.py" -"vtkRenderWindowInteractor","Images/ImageWarp.py" -"vtkRenderWindowInteractor","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkRenderWindowInteractor","ImplicitFunctions/ImplicitQuadric.py" -"vtkRenderWindowInteractor","ImplicitFunctions/ImplicitSphere1.py" -"vtkRenderWindowInteractor","ImplicitFunctions/ImplicitSphere.py" -"vtkRenderWindowInteractor","ImplicitFunctions/SampleFunction.py" -"vtkRenderWindowInteractor","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRenderWindowInteractor","Interaction/CallBack.py" -"vtkRenderWindowInteractor","Interaction/InteractorStyleTrackballActor.py" -"vtkRenderWindowInteractor","Interaction/InteractorStyleTrackballCamera.py" -"vtkRenderWindowInteractor","Interaction/MouseEventsObserver.py" -"vtkRenderWindowInteractor","Interaction/MouseEvents.py" -"vtkRenderWindowInteractor","IO/3DSImporter.py" -"vtkRenderWindowInteractor","IO/CSVReadEdit1.py" -"vtkRenderWindowInteractor","IO/CSVReadEdit.py" -"vtkRenderWindowInteractor","IO/HDRReader.py" -"vtkRenderWindowInteractor","IO/ImageWriter.py" -"vtkRenderWindowInteractor","IO/ReadDICOM.py" -"vtkRenderWindowInteractor","IO/ReadDICOMSeries.py" -"vtkRenderWindowInteractor","IO/ReadExodusData.py" -"vtkRenderWindowInteractor","IO/ReadImageData.py" -"vtkRenderWindowInteractor","IO/ReadLegacyUnstructuredGrid.py" -"vtkRenderWindowInteractor","IO/ReadPLOT3D.py" -"vtkRenderWindowInteractor","IO/ReadPolyData.py" -"vtkRenderWindowInteractor","IO/ReadSLC.py" -"vtkRenderWindowInteractor","IO/ReadSTL.py" -"vtkRenderWindowInteractor","IO/ReadUnstructuredGrid.py" -"vtkRenderWindowInteractor","IO/ReadVTP.py" -"vtkRenderWindowInteractor","IO/TransientHDFReader.py" -"vtkRenderWindowInteractor","IO/WritePLY.py" -"vtkRenderWindowInteractor","IO/WriteSTL.py" -"vtkRenderWindowInteractor","Medical/GenerateCubesFromLabels.py" -"vtkRenderWindowInteractor","Medical/MedicalDemo1.py" -"vtkRenderWindowInteractor","Medical/MedicalDemo2.py" -"vtkRenderWindowInteractor","Medical/MedicalDemo3.py" -"vtkRenderWindowInteractor","Medical/MedicalDemo4.py" -"vtkRenderWindowInteractor","Medical/TissueLens.py" -"vtkRenderWindowInteractor","Meshes/BoundaryEdges.py" -"vtkRenderWindowInteractor","Meshes/CapClip.py" -"vtkRenderWindowInteractor","Meshes/ClipDataSetWithPolyData1.py" -"vtkRenderWindowInteractor","Meshes/ClipDataSetWithPolyData.py" -"vtkRenderWindowInteractor","Meshes/ColoredElevationMap.py" -"vtkRenderWindowInteractor","Meshes/Decimation.py" -"vtkRenderWindowInteractor","Meshes/DeformPointSet.py" -"vtkRenderWindowInteractor","Meshes/PointInterpolator.py" -"vtkRenderWindowInteractor","Meshes/SolidClip.py" -"vtkRenderWindowInteractor","Modelling/Bottle.py" -"vtkRenderWindowInteractor","Modelling/CappedSphere.py" -"vtkRenderWindowInteractor","Modelling/ContourTriangulator.py" -"vtkRenderWindowInteractor","Modelling/DelaunayMesh.py" -"vtkRenderWindowInteractor","Modelling/DiscreteMarchingCubes.py" -"vtkRenderWindowInteractor","Modelling/ExtractLargestIsosurface.py" -"vtkRenderWindowInteractor","Modelling/FinanceFieldData.py" -"vtkRenderWindowInteractor","Modelling/Finance.py" -"vtkRenderWindowInteractor","Modelling/MarchingCubes.py" -"vtkRenderWindowInteractor","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkRenderWindowInteractor","Modelling/Spring.py" -"vtkRenderWindowInteractor","Picking/CellPicking.py" -"vtkRenderWindowInteractor","Picking/HighlightPickedActor.py" -"vtkRenderWindowInteractor","Picking/HighlightWithSilhouette.py" -"vtkRenderWindowInteractor","Plotting/MultiplePlots.py" -"vtkRenderWindowInteractor","Plotting/SpiderPlot.py" -"vtkRenderWindowInteractor","PolyData/AlignTwoPolyDatas.py" -"vtkRenderWindowInteractor","PolyData/BooleanOperationPolyDataFilter.py" -"vtkRenderWindowInteractor","PolyData/CellsInsideObject.py" -"vtkRenderWindowInteractor","PolyData/CurvaturesAdjustEdges.py" -"vtkRenderWindowInteractor","PolyData/CurvaturesDemo.py" -"vtkRenderWindowInteractor","PolyData/Curvatures.py" -"vtkRenderWindowInteractor","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkRenderWindowInteractor","PolyData/ExtractSelection.py" -"vtkRenderWindowInteractor","PolyData/ExtractSelectionUsingCells.py" -"vtkRenderWindowInteractor","PolyData/FilledPolygon.py" -"vtkRenderWindowInteractor","PolyData/ImplicitPolyDataDistance.py" -"vtkRenderWindowInteractor","PolyData/Outline.py" -"vtkRenderWindowInteractor","PolyData/PointSource.py" -"vtkRenderWindowInteractor","PolyData/PolyDataToImageDataStencil.py" -"vtkRenderWindowInteractor","PolyData/RotationAroundLine.py" -"vtkRenderWindowInteractor","PolyData/RuledSurfaceFilter.py" -"vtkRenderWindowInteractor","PolyData/SmoothMeshGrid.py" -"vtkRenderWindowInteractor","PolyData/TubeFilter.py" -"vtkRenderWindowInteractor","PolyData/WarpVector.py" -"vtkRenderWindowInteractor","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkRenderWindowInteractor","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkRenderWindowInteractor","RectilinearGrid/RectilinearGrid.py" -"vtkRenderWindowInteractor","RectilinearGrid/RGrid.py" -"vtkRenderWindowInteractor","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRenderWindowInteractor","Rendering/AmbientSpheres.py" -"vtkRenderWindowInteractor","Rendering/CameraBlur.py" -"vtkRenderWindowInteractor","Rendering/ColoredSphere.py" -"vtkRenderWindowInteractor","Rendering/Cone3.py" -"vtkRenderWindowInteractor","Rendering/Cone4.py" -"vtkRenderWindowInteractor","Rendering/DiffuseSpheres.py" -"vtkRenderWindowInteractor","Rendering/FlatVersusGouraud.py" -"vtkRenderWindowInteractor","Rendering/GradientBackground.py" -"vtkRenderWindowInteractor","Rendering/LayeredActors.py" -"vtkRenderWindowInteractor","Rendering/Mace.py" -"vtkRenderWindowInteractor","Rendering/Model.py" -"vtkRenderWindowInteractor","Rendering/MotionBlur.py" -"vtkRenderWindowInteractor","Rendering/OutlineGlowPass.py" -"vtkRenderWindowInteractor","Rendering/PBR_Anisotropy.py" -"vtkRenderWindowInteractor","Rendering/PBR_Clear_Coat.py" -"vtkRenderWindowInteractor","Rendering/PBR_Edge_Tint.py" -"vtkRenderWindowInteractor","Rendering/PBR_HDR_Environment.py" -"vtkRenderWindowInteractor","Rendering/PBR_Mapping.py" -"vtkRenderWindowInteractor","Rendering/PBR_Materials_Coat.py" -"vtkRenderWindowInteractor","Rendering/PBR_Materials.py" -"vtkRenderWindowInteractor","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderWindowInteractor","Rendering/PBR_Skybox.py" -"vtkRenderWindowInteractor","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderWindowInteractor","Rendering/Rainbow.py" -"vtkRenderWindowInteractor","Rendering/Rotations.py" -"vtkRenderWindowInteractor","Rendering/Shadows.py" -"vtkRenderWindowInteractor","Rendering/SpecularSpheres.py" -"vtkRenderWindowInteractor","Rendering/StippledLine.py" -"vtkRenderWindowInteractor","Rendering/StripFran.py" -"vtkRenderWindowInteractor","Rendering/TransformSphere.py" -"vtkRenderWindowInteractor","Rendering/TransparentBackground.py" -"vtkRenderWindowInteractor","Rendering/WalkCow.py" -"vtkRenderWindowInteractor","StructuredGrid/BlankPoint.py" -"vtkRenderWindowInteractor","StructuredGrid/SGrid.py" -"vtkRenderWindowInteractor","StructuredPoints/Vol.py" -"vtkRenderWindowInteractor","Texture/AnimateVectors.py" -"vtkRenderWindowInteractor","Texture/TextureCutQuadric.py" -"vtkRenderWindowInteractor","Texture/TextureCutSphere.py" -"vtkRenderWindowInteractor","Texture/TexturePlane.py" -"vtkRenderWindowInteractor","Texture/TextureThreshold.py" -"vtkRenderWindowInteractor","Tutorial/Tutorial_Step5.py" -"vtkRenderWindowInteractor","Tutorial/Tutorial_Step6.py" -"vtkRenderWindowInteractor","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkRenderWindowInteractor","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkRenderWindowInteractor","UnstructuredGrid/UGrid.py" -"vtkRenderWindowInteractor","Utilities/Animation.py" -"vtkRenderWindowInteractor","Utilities/ColorMapToLUT.py" -"vtkRenderWindowInteractor","Utilities/JSONColorMapToLUT.py" -"vtkRenderWindowInteractor","Utilities/RescaleReverseLUT.py" -"vtkRenderWindowInteractor","Utilities/ResetCameraOrientation.py" -"vtkRenderWindowInteractor","Utilities/SaveSceneToFieldData.py" -"vtkRenderWindowInteractor","Utilities/SaveSceneToFile.py" -"vtkRenderWindowInteractor","Utilities/Screenshot.py" -"vtkRenderWindowInteractor","Utilities/ShareCamera.py" -"vtkRenderWindowInteractor","Utilities/VTKImportsForPython.py" -"vtkRenderWindowInteractor","Utilities/VTKModulesForCxx.py" -"vtkRenderWindowInteractor","Utilities/VTKWithNumpy.py" -"vtkRenderWindowInteractor","Utilities/XMLColorMapToLUT.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/BluntStreamlines.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CarotidFlow.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ContourQuadric.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CreateBFont.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/Cutter.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/CutWithScalars.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/DataSetSurface.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/DecimateFran.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/DecimateHawaii.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/DisplacementPlot.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ExponentialCosine.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ExtractData.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/HeadBone.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/HeadSlice.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/Hello.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/HyperStreamline.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/IceCream.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ImageGradient.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/IronIsoSurface.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/LOxGrid.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/LOx.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/LOxSeeds.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/Motor.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/Office.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/OfficeTube.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/PineRootDecimation.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/PlateVibration.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/ProbeCombustor.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/SingleSplat.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/SpikeFran.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/SplatFace.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/Stocks.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/TensorAxes.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/VelocityProfile.py" -"vtkRenderWindowInteractor","VisualizationAlgorithms/WarpCombustor.py" -"vtkRenderWindowInteractor","Visualization/AlphaFrequency.py" -"vtkRenderWindowInteractor","Visualization/AnnotatedCubeActor.py" -"vtkRenderWindowInteractor","Visualization/AssignCellColorsFromLUT.py" -"vtkRenderWindowInteractor","Visualization/BillboardTextActor3D.py" -"vtkRenderWindowInteractor","Visualization/BlobbyLogo.py" -"vtkRenderWindowInteractor","Visualization/Blow.py" -"vtkRenderWindowInteractor","Visualization/CameraModel1.py" -"vtkRenderWindowInteractor","Visualization/CameraModel2.py" -"vtkRenderWindowInteractor","Visualization/Camera.py" -"vtkRenderWindowInteractor","Visualization/ClampGlyphSizes.py" -"vtkRenderWindowInteractor","Visualization/CollisionDetection.py" -"vtkRenderWindowInteractor","Visualization/ColorAnActor.py" -"vtkRenderWindowInteractor","Visualization/ColoredAnnotatedCube.py" -"vtkRenderWindowInteractor","Visualization/ComplexV.py" -"vtkRenderWindowInteractor","Visualization/CreateColorSeriesDemo.py" -"vtkRenderWindowInteractor","Visualization/CubeAxesActor.py" -"vtkRenderWindowInteractor","Visualization/CurvatureBandsWithGlyphs.py" -"vtkRenderWindowInteractor","Visualization/DisplayCoordinateAxes.py" -"vtkRenderWindowInteractor","Visualization/DisplayQuadricSurfaces.py" -"vtkRenderWindowInteractor","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderWindowInteractor","Visualization/FrogBrain.py" -"vtkRenderWindowInteractor","Visualization/FroggieSurface.py" -"vtkRenderWindowInteractor","Visualization/FroggieView.py" -"vtkRenderWindowInteractor","Visualization/FrogSlice.py" -"vtkRenderWindowInteractor","Visualization/GlyphTable.py" -"vtkRenderWindowInteractor","Visualization/Hanoi.py" -"vtkRenderWindowInteractor","Visualization/HardwareSelector.py" -"vtkRenderWindowInteractor","Visualization/Hawaii.py" -"vtkRenderWindowInteractor","Visualization/IsosurfaceSampling.py" -"vtkRenderWindowInteractor","Visualization/Kitchen.py" -"vtkRenderWindowInteractor","Visualization/KochSnowflake.py" -"vtkRenderWindowInteractor","Visualization/LoopShrink.py" -"vtkRenderWindowInteractor","Visualization/Lorenz.py" -"vtkRenderWindowInteractor","Visualization/MultipleRenderWindows.py" -"vtkRenderWindowInteractor","Visualization/MultipleViewports.py" -"vtkRenderWindowInteractor","Visualization/NamedColors.py" -"vtkRenderWindowInteractor","Visualization/NormalsDemo.py" -"vtkRenderWindowInteractor","Visualization/OrientedGlyphs.py" -"vtkRenderWindowInteractor","Visualization/PointDataSubdivision.py" -"vtkRenderWindowInteractor","Visualization/PointSize.py" -"vtkRenderWindowInteractor","Visualization/ProgrammableGlyphFilter.py" -"vtkRenderWindowInteractor","Visualization/ProgrammableGlyphs.py" -"vtkRenderWindowInteractor","Visualization/QuadricVisualization.py" -"vtkRenderWindowInteractor","Visualization/ShadowsLightsDemo.py" -"vtkRenderWindowInteractor","Visualization/SphereTexture.py" -"vtkRenderWindowInteractor","Visualization/StreamLines.py" -"vtkRenderWindowInteractor","Visualization/TextSource.py" -"vtkRenderWindowInteractor","Visualization/VectorText.py" -"vtkRenderWindowInteractor","Visualization/WindowTitle.py" -"vtkRenderWindowInteractor","VolumeRendering/PseudoVolumeRendering.py" -"vtkRenderWindowInteractor","VolumeRendering/SimpleRayCast.py" -"vtkRenderWindowInteractor","Widgets/BalloonWidget.py" -"vtkRenderWindowInteractor","Widgets/BoxWidget.py" -"vtkRenderWindowInteractor","Widgets/CameraOrientationWidget.py" -"vtkRenderWindowInteractor","Widgets/CompassWidget.py" -"vtkRenderWindowInteractor","Widgets/ContourWidget.py" -"vtkRenderWindowInteractor","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderWindowInteractor","Widgets/OrientationMarkerWidget1.py" -"vtkRenderWindowInteractor","Widgets/OrientationMarkerWidget.py" -"vtkRenderWindowInteractor","Widgets/ScalarBarWidget.py" -"vtkRenderWindowInteractor","Widgets/SphereWidget.py" -"vtkRenderWindowInteractor","Widgets/SplineWidget.py" -"vtkRenderWindowInteractor","Widgets/TextWidget.py" -"vtkRenderWindow","IO/3DSImporter.py" -"vtkRenderWindow","IO/CSVReadEdit1.py" -"vtkRenderWindow","IO/CSVReadEdit.py" -"vtkRenderWindow","IO/ImageWriter.py" -"vtkRenderWindow","IO/ReadExodusData.py" -"vtkRenderWindow","IO/ReadImageData.py" -"vtkRenderWindow","IO/ReadPLOT3D.py" -"vtkRenderWindow","IO/ReadPolyData.py" -"vtkRenderWindow","IO/ReadSLC.py" -"vtkRenderWindow","IO/ReadSTL.py" -"vtkRenderWindow","IO/ReadUnstructuredGrid.py" -"vtkRenderWindow","IO/ReadVTP.py" -"vtkRenderWindow","IO/TransientHDFReader.py" -"vtkRenderWindow","IO/WritePLY.py" -"vtkRenderWindow","IO/WriteSTL.py" -"vtkRenderWindow","Medical/GenerateCubesFromLabels.py" -"vtkRenderWindow","Medical/MedicalDemo1.py" -"vtkRenderWindow","Medical/MedicalDemo2.py" -"vtkRenderWindow","Medical/MedicalDemo3.py" -"vtkRenderWindow","Medical/MedicalDemo4.py" -"vtkRenderWindow","Medical/TissueLens.py" -"vtkRenderWindow","Meshes/BoundaryEdges.py" -"vtkRenderWindow","Meshes/CapClip.py" -"vtkRenderWindow","Meshes/ClipDataSetWithPolyData1.py" -"vtkRenderWindow","Meshes/ClipDataSetWithPolyData.py" -"vtkRenderWindow","Meshes/ColoredElevationMap.py" -"vtkRenderWindow","Meshes/Decimation.py" -"vtkRenderWindow","Meshes/DeformPointSet.py" -"vtkRenderWindow","Meshes/PointInterpolator.py" -"vtkRenderWindow","Meshes/SolidClip.py" -"vtkRenderWindow","Modelling/Bottle.py" -"vtkRenderWindow","Modelling/CappedSphere.py" -"vtkRenderWindow","Modelling/ContourTriangulator.py" -"vtkRenderWindow","Modelling/DelaunayMesh.py" -"vtkRenderWindow","Modelling/DiscreteMarchingCubes.py" -"vtkRenderWindow","Modelling/ExtractLargestIsosurface.py" -"vtkRenderWindow","Modelling/FinanceFieldData.py" -"vtkRenderWindow","Modelling/Finance.py" -"vtkRenderWindow","Modelling/MarchingCubes.py" -"vtkRenderWindow","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkRenderWindow","Modelling/Spring.py" -"vtkRenderWindow","Picking/CellPicking.py" -"vtkRenderWindow","Picking/HighlightPickedActor.py" -"vtkRenderWindow","Picking/HighlightWithSilhouette.py" -"vtkRenderWindow","Plotting/MultiplePlots.py" -"vtkRenderWindow","Plotting/SpiderPlot.py" -"vtkRenderWindow","PolyData/AlignTwoPolyDatas.py" -"vtkRenderWindow","PolyData/BooleanOperationPolyDataFilter.py" -"vtkRenderWindow","PolyData/CellsInsideObject.py" -"vtkRenderWindow","PolyData/CurvaturesAdjustEdges.py" -"vtkRenderWindow","PolyData/CurvaturesDemo.py" -"vtkRenderWindow","PolyData/Curvatures.py" -"vtkRenderWindow","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkRenderWindow","PolyData/ExtractSelection.py" -"vtkRenderWindow","PolyData/ExtractSelectionUsingCells.py" -"vtkRenderWindow","PolyData/FilledPolygon.py" -"vtkRenderWindow","PolyData/ImplicitPolyDataDistance.py" -"vtkRenderWindow","PolyData/Outline.py" -"vtkRenderWindow","PolyData/PointSource.py" -"vtkRenderWindow","PolyData/RotationAroundLine.py" -"vtkRenderWindow","PolyData/RuledSurfaceFilter.py" -"vtkRenderWindow","PolyData/SmoothMeshGrid.py" -"vtkRenderWindow","PolyData/TubeFilter.py" -"vtkRenderWindow","PolyData/WarpVector.py" -"vtkRenderWindow","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkRenderWindow","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkRenderWindow","RectilinearGrid/RectilinearGrid.py" -"vtkRenderWindow","RectilinearGrid/RGrid.py" -"vtkRenderWindow","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkRenderWindow","Rendering/AmbientSpheres.py" -"vtkRenderWindow","Rendering/CameraBlur.py" -"vtkRenderWindow","Rendering/ColoredSphere.py" -"vtkRenderWindow","Rendering/Cone3.py" -"vtkRenderWindow","Rendering/Cone4.py" -"vtkRenderWindow","Rendering/DiffuseSpheres.py" -"vtkRenderWindow","Rendering/FlatVersusGouraud.py" -"vtkRenderWindow","Rendering/GradientBackground.py" -"vtkRenderWindow","Rendering/LayeredActors.py" -"vtkRenderWindow","Rendering/Mace.py" -"vtkRenderWindow","Rendering/Model.py" -"vtkRenderWindow","Rendering/MotionBlur.py" -"vtkRenderWindow","Rendering/OutlineGlowPass.py" -"vtkRenderWindow","Rendering/PBR_Anisotropy.py" -"vtkRenderWindow","Rendering/PBR_Clear_Coat.py" -"vtkRenderWindow","Rendering/PBR_Edge_Tint.py" -"vtkRenderWindow","Rendering/PBR_HDR_Environment.py" -"vtkRenderWindow","Rendering/PBR_Mapping.py" -"vtkRenderWindow","Rendering/PBR_Materials_Coat.py" -"vtkRenderWindow","Rendering/PBR_Materials.py" -"vtkRenderWindow","Rendering/PBR_Skybox_Anisotropy.py" -"vtkRenderWindow","Rendering/PBR_Skybox.py" -"vtkRenderWindow","Rendering/PBR_Skybox_Texturing.py" -"vtkRenderWindow","Rendering/Rainbow.py" -"vtkRenderWindow","Rendering/Rotations.py" -"vtkRenderWindow","Rendering/Shadows.py" -"vtkRenderWindow","Rendering/SpecularSpheres.py" -"vtkRenderWindow","Rendering/StippledLine.py" -"vtkRenderWindow","Rendering/StripFran.py" -"vtkRenderWindow","Rendering/TransformSphere.py" -"vtkRenderWindow","Rendering/TransparentBackground.py" -"vtkRenderWindow","Rendering/WalkCow.py" -"vtkRenderWindow","StructuredGrid/BlankPoint.py" -"vtkRenderWindow","StructuredGrid/SGrid.py" -"vtkRenderWindow","StructuredPoints/Vol.py" -"vtkRenderWindow","Texture/AnimateVectors.py" -"vtkRenderWindow","Texture/TextureCutQuadric.py" -"vtkRenderWindow","Texture/TextureCutSphere.py" -"vtkRenderWindow","Texture/TexturePlane.py" -"vtkRenderWindow","Texture/TextureThreshold.py" -"vtkRenderWindow","Tutorial/Tutorial_Step1.py" -"vtkRenderWindow","Tutorial/Tutorial_Step2.py" -"vtkRenderWindow","Tutorial/Tutorial_Step3.py" -"vtkRenderWindow","Tutorial/Tutorial_Step4.py" -"vtkRenderWindow","Tutorial/Tutorial_Step5.py" -"vtkRenderWindow","Tutorial/Tutorial_Step6.py" -"vtkRenderWindow","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkRenderWindow","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkRenderWindow","UnstructuredGrid/UGrid.py" -"vtkRenderWindow","Utilities/Animation.py" -"vtkRenderWindow","Utilities/ColorMapToLUT.py" -"vtkRenderWindow","Utilities/JSONColorMapToLUT.py" -"vtkRenderWindow","Utilities/RescaleReverseLUT.py" -"vtkRenderWindow","Utilities/ResetCameraOrientation.py" -"vtkRenderWindow","Utilities/SaveSceneToFieldData.py" -"vtkRenderWindow","Utilities/SaveSceneToFile.py" -"vtkRenderWindow","Utilities/Screenshot.py" -"vtkRenderWindow","Utilities/ShareCamera.py" -"vtkRenderWindow","Utilities/VTKImportsForPython.py" -"vtkRenderWindow","Utilities/VTKModulesForCxx.py" -"vtkRenderWindow","Utilities/VTKWithNumpy.py" -"vtkRenderWindow","Utilities/XMLColorMapToLUT.py" -"vtkRenderWindow","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkRenderWindow","VisualizationAlgorithms/BluntStreamlines.py" -"vtkRenderWindow","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkRenderWindow","VisualizationAlgorithms/CarotidFlow.py" -"vtkRenderWindow","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkRenderWindow","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkRenderWindow","VisualizationAlgorithms/ContourQuadric.py" -"vtkRenderWindow","VisualizationAlgorithms/CreateBFont.py" -"vtkRenderWindow","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkRenderWindow","VisualizationAlgorithms/Cutter.py" -"vtkRenderWindow","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkRenderWindow","VisualizationAlgorithms/CutWithScalars.py" -"vtkRenderWindow","VisualizationAlgorithms/DataSetSurface.py" -"vtkRenderWindow","VisualizationAlgorithms/DecimateFran.py" -"vtkRenderWindow","VisualizationAlgorithms/DecimateHawaii.py" -"vtkRenderWindow","VisualizationAlgorithms/DisplacementPlot.py" -"vtkRenderWindow","VisualizationAlgorithms/ExponentialCosine.py" -"vtkRenderWindow","VisualizationAlgorithms/ExtractData.py" -"vtkRenderWindow","VisualizationAlgorithms/FlyingHeadSlice.py" -"vtkRenderWindow","VisualizationAlgorithms/HeadBone.py" -"vtkRenderWindow","VisualizationAlgorithms/HeadSlice.py" -"vtkRenderWindow","VisualizationAlgorithms/Hello.py" -"vtkRenderWindow","VisualizationAlgorithms/HyperStreamline.py" -"vtkRenderWindow","VisualizationAlgorithms/IceCream.py" -"vtkRenderWindow","VisualizationAlgorithms/ImageGradient.py" -"vtkRenderWindow","VisualizationAlgorithms/IronIsoSurface.py" -"vtkRenderWindow","VisualizationAlgorithms/LOxGrid.py" -"vtkRenderWindow","VisualizationAlgorithms/LOx.py" -"vtkRenderWindow","VisualizationAlgorithms/LOxSeeds.py" -"vtkRenderWindow","VisualizationAlgorithms/MarchingCases.py" -"vtkRenderWindow","VisualizationAlgorithms/Motor.py" -"vtkRenderWindow","VisualizationAlgorithms/Office.py" -"vtkRenderWindow","VisualizationAlgorithms/OfficeTube.py" -"vtkRenderWindow","VisualizationAlgorithms/PineRootConnectivity.py" -"vtkRenderWindow","VisualizationAlgorithms/PineRootDecimation.py" -"vtkRenderWindow","VisualizationAlgorithms/PlateVibration.py" -"vtkRenderWindow","VisualizationAlgorithms/ProbeCombustor.py" -"vtkRenderWindow","VisualizationAlgorithms/SingleSplat.py" -"vtkRenderWindow","VisualizationAlgorithms/SpikeFran.py" -"vtkRenderWindow","VisualizationAlgorithms/SplatFace.py" -"vtkRenderWindow","VisualizationAlgorithms/Stocks.py" -"vtkRenderWindow","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRenderWindow","VisualizationAlgorithms/TensorAxes.py" -"vtkRenderWindow","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkRenderWindow","VisualizationAlgorithms/VelocityProfile.py" -"vtkRenderWindow","VisualizationAlgorithms/WarpCombustor.py" -"vtkRenderWindow","Visualization/AlphaFrequency.py" -"vtkRenderWindow","Visualization/AnnotatedCubeActor.py" -"vtkRenderWindow","Visualization/AssignCellColorsFromLUT.py" -"vtkRenderWindow","Visualization/BillboardTextActor3D.py" -"vtkRenderWindow","Visualization/BlobbyLogo.py" -"vtkRenderWindow","Visualization/Blow.py" -"vtkRenderWindow","Visualization/CameraModel1.py" -"vtkRenderWindow","Visualization/CameraModel2.py" -"vtkRenderWindow","Visualization/Camera.py" -"vtkRenderWindow","Visualization/ClampGlyphSizes.py" -"vtkRenderWindow","Visualization/CollisionDetection.py" -"vtkRenderWindow","Visualization/ColorAnActor.py" -"vtkRenderWindow","Visualization/ColoredAnnotatedCube.py" -"vtkRenderWindow","Visualization/ComplexV.py" -"vtkRenderWindow","Visualization/CreateColorSeriesDemo.py" -"vtkRenderWindow","Visualization/CubeAxesActor.py" -"vtkRenderWindow","Visualization/CurvatureBandsWithGlyphs.py" -"vtkRenderWindow","Visualization/DisplayCoordinateAxes.py" -"vtkRenderWindow","Visualization/DisplayQuadricSurfaces.py" -"vtkRenderWindow","Visualization/ElevationBandsWithGlyphs.py" -"vtkRenderWindow","Visualization/FrogBrain.py" -"vtkRenderWindow","Visualization/FroggieSurface.py" -"vtkRenderWindow","Visualization/FroggieView.py" -"vtkRenderWindow","Visualization/FrogSlice.py" -"vtkRenderWindow","Visualization/GlyphTable.py" -"vtkRenderWindow","Visualization/Hanoi.py" -"vtkRenderWindow","Visualization/HardwareSelector.py" -"vtkRenderWindow","Visualization/Hawaii.py" -"vtkRenderWindow","Visualization/IsosurfaceSampling.py" -"vtkRenderWindow","Visualization/Kitchen.py" -"vtkRenderWindow","Visualization/KochSnowflake.py" -"vtkRenderWindow","Visualization/LoopShrink.py" -"vtkRenderWindow","Visualization/Lorenz.py" -"vtkRenderWindow","Visualization/MultipleRenderWindows.py" -"vtkRenderWindow","Visualization/MultipleViewports.py" -"vtkRenderWindow","Visualization/NamedColors.py" -"vtkRenderWindow","Visualization/NormalsDemo.py" -"vtkRenderWindow","Visualization/OrientedGlyphs.py" -"vtkRenderWindow","Visualization/PointDataSubdivision.py" -"vtkRenderWindow","Visualization/PointSize.py" -"vtkRenderWindow","Visualization/ProgrammableGlyphFilter.py" -"vtkRenderWindow","Visualization/ProgrammableGlyphs.py" -"vtkRenderWindow","Visualization/QuadricVisualization.py" -"vtkRenderWindow","Visualization/ShadowsLightsDemo.py" -"vtkRenderWindow","Visualization/SphereTexture.py" -"vtkRenderWindow","Visualization/StreamLines.py" -"vtkRenderWindow","Visualization/TextSource.py" -"vtkRenderWindow","Visualization/VectorText.py" -"vtkRenderWindow","Visualization/WindowTitle.py" -"vtkRenderWindow","VolumeRendering/PseudoVolumeRendering.py" -"vtkRenderWindow","VolumeRendering/SimpleRayCast.py" -"vtkRenderWindow","Widgets/BalloonWidget.py" -"vtkRenderWindow","Widgets/BoxWidget.py" -"vtkRenderWindow","Widgets/CameraOrientationWidget.py" -"vtkRenderWindow","Widgets/CompassWidget.py" -"vtkRenderWindow","Widgets/ContourWidget.py" -"vtkRenderWindow","Widgets/ImplicitPlaneWidget2.py" -"vtkRenderWindow","Widgets/OrientationMarkerWidget1.py" -"vtkRenderWindow","Widgets/OrientationMarkerWidget.py" -"vtkRenderWindow","Widgets/ScalarBarWidget.py" -"vtkRenderWindow","Widgets/SphereWidget.py" -"vtkRenderWindow","Widgets/SplineWidget.py" -"vtkRenderWindow","Widgets/TextWidget.py" -"vtkRenderWinodwInteractor","Tutorial/Tutorial_Step5.py" -"vtkRenderWinodwInteractor","Tutorial/Tutorial_Step6.py" -"vtkResampleWithDataSet","Meshes/PointInterpolator.py" -"vtkReverseSense","Visualization/CurvatureBandsWithGlyphs.py" -"vtkReverseSense","Visualization/ElevationBandsWithGlyphs.py" -"vtkRibbonFilter","VisualizationAlgorithms/Stocks.py" -"vtkRibbonFilter","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkRotationalExtrusionFilter","Modelling/Bottle.py" -"vtkRotationalExtrusionFilter","Modelling/CappedSphere.py" -"vtkRotationalExtrusionFilter","Modelling/Spring.py" -"vtkRotationalExtrusionFilter","Visualization/CameraModel1.py" -"vtkRotationalExtrusionFilter","Visualization/CameraModel2.py" -"vtkRTAnalyticSource","InfoVis/ParallelCoordinatesExtraction.py" -"vtkRTAnalyticSource","InfoVis/ParallelCoordinatesView.py" -"vtkRTAnalyticSource","Visualization/ClampGlyphSizes.py" -"vtkRTAnalyticSource","Visualization/GlyphTable.py" -"vtkRuledSurfaceFilter","PolyData/RuledSurfaceFilter.py" -"vtkRungeKutta4","VisualizationAlgorithms/OfficeTube.py" -"vtkRungeKutta4","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkSampleFunction","Filtering/PerlinNoise.py" -"vtkSampleFunction","ImageProcessing/Attenuation.py" -"vtkSampleFunction","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkSampleFunction","ImplicitFunctions/ImplicitQuadric.py" -"vtkSampleFunction","ImplicitFunctions/ImplicitSphere1.py" -"vtkSampleFunction","ImplicitFunctions/ImplicitSphere.py" -"vtkSampleFunction","ImplicitFunctions/SampleFunction.py" -"vtkSampleFunction","Modelling/DiscreteMarchingCubes.py" -"vtkSampleFunction","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkSampleFunction","Rendering/FlatVersusGouraud.py" -"vtkSampleFunction","VisualizationAlgorithms/ContourQuadric.py" -"vtkSampleFunction","VisualizationAlgorithms/ExtractData.py" -"vtkSampleFunction","VisualizationAlgorithms/IceCream.py" -"vtkSampleFunction","Visualization/DisplayQuadricSurfaces.py" -"vtkSampleFunction","Visualization/IsosurfaceSampling.py" -"vtkSampleFunction","Visualization/QuadricVisualization.py" -"vtkScalarBarActor","IO/CSVReadEdit1.py" -"vtkScalarBarActor","IO/CSVReadEdit.py" -"vtkScalarBarActor","PolyData/CurvaturesAdjustEdges.py" -"vtkScalarBarActor","PolyData/CurvaturesDemo.py" -"vtkScalarBarActor","PolyData/Curvatures.py" -"vtkScalarBarActor","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkScalarBarActor","Utilities/RescaleReverseLUT.py" -"vtkScalarBarActor","Visualization/CurvatureBandsWithGlyphs.py" -"vtkScalarBarActor","Visualization/ElevationBandsWithGlyphs.py" -"vtkScalarBarActor","Widgets/ScalarBarWidget.py" -"vtkScalarBarWidget","Widgets/ScalarBarWidget.py" -"vtkSelectEnclosedPoints","PolyData/CellsInsideObject.py" -"vtkSelectionNode","InfoVis/ParallelCoordinatesExtraction.py" -"vtkSelectionNode","Picking/CellPicking.py" -"vtkSelectionNode","PolyData/ExtractSelection.py" -"vtkSelectionNode","PolyData/ExtractSelectionUsingCells.py" -"vtkSelection","Picking/CellPicking.py" -"vtkSelection","PolyData/ExtractSelection.py" -"vtkSelection","PolyData/ExtractSelectionUsingCells.py" -"vtkSequencePass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkSequencePass","Rendering/PBR_Skybox.py" -"vtkSequencePass","Rendering/PBR_Skybox_Texturing.py" -"vtkSequencePass","Rendering/Shadows.py" -"vtkSequencePass","Visualization/ShadowsLightsDemo.py" -"vtkShadowMapPass","Rendering/Shadows.py" -"vtkShadowMapPass","Visualization/ShadowsLightsDemo.py" -"vtkShortArray","Visualization/Lorenz.py" -"vtkShrinkFilter","GeometricObjects/CellTypeSource.py" -"vtkShrinkFilter","GeometricObjects/ShrinkCube.py" -"vtkShrinkFilter","GeometricObjects/TessellatedBoxSource.py" -"vtkShrinkFilter","HyperTreeGrid/HyperTreeGridSource.py" -"vtkShrinkFilter","IO/ReadLegacyUnstructuredGrid.py" -"vtkShrinkFilter","RectilinearGrid/VisualizeRectilinearGrid.py" -"vtkShrinkFilter","VisualizationAlgorithms/ExtractData.py" -"vtkShrinkFilter","Visualization/LoopShrink.py" -"vtkShrinkPolyData","GeometricObjects/Frustum.py" -"vtkShrinkPolyData","GeometricObjects/RegularPolygonSource.py" -"vtkShrinkPolyData","Rendering/Cone3.py" -"vtkShrinkPolyData","Rendering/Cone4.py" -"vtkShrinkPolyData","Tutorial/Tutorial_Step1.py" -"vtkShrinkPolyData","Tutorial/Tutorial_Step3.py" -"vtkShrinkPolyData","Tutorial/Tutorial_Step4.py" -"vtkShrinkPolyData","Tutorial/Tutorial_Step5.py" -"vtkShrinkPolyData","Tutorial/Tutorial_Step6.py" -"vtkShrinkPolyData","VisualizationAlgorithms/MarchingCases.py" -"vtks","ImageProcessing/VTKSpectrum.py" -"vtkSimple2DLayoutStrategy","Graphs/VisualizeDirectedGraph.py" -"vtkSimple2DLayoutStrategy","InfoVis/SelectedGraphIDs.py" -"vtkSimpleMotionBlurPass","Rendering/MotionBlur.py" -"vtkSkybox","Rendering/PBR_Anisotropy.py" -"vtkSkybox","Rendering/PBR_Clear_Coat.py" -"vtkSkybox","Rendering/PBR_Edge_Tint.py" -"vtkSkybox","Rendering/PBR_HDR_Environment.py" -"vtkSkybox","Rendering/PBR_Mapping.py" -"vtkSkybox","Rendering/PBR_Materials_Coat.py" -"vtkSkybox","Rendering/PBR_Materials.py" -"vtkSkybox","Rendering/PBR_Skybox_Anisotropy.py" -"vtkSkybox","Rendering/PBR_Skybox.py" -"vtkSkybox","Rendering/PBR_Skybox_Texturing.py" -"vtkSLCReader","IO/ReadSLC.py" -"vtkSliderRepresentation2D","GeometricObjects/ParametricKuenDemo.py" -"vtkSliderRepresentation2D","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkSliderRepresentation2D","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkSliderRepresentation2D","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkSliderRepresentation2D","GeometricObjects/QuadraticTetraDemo.py" -"vtkSliderRepresentation2D","Rendering/PBR_Skybox_Anisotropy.py" -"vtkSliderRepresentation2D","Rendering/PBR_Skybox.py" -"vtkSliderRepresentation2D","Rendering/PBR_Skybox_Texturing.py" -"vtkSliderRepresentation2D","Visualization/FroggieView.py" -"vtkSliderWidget","GeometricObjects/ParametricKuenDemo.py" -"vtkSliderWidget","GeometricObjects/ParametricSuperEllipsoidDemo.py" -"vtkSliderWidget","GeometricObjects/ParametricSuperToroidDemo.py" -"vtkSliderWidget","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkSliderWidget","GeometricObjects/QuadraticTetraDemo.py" -"vtkSliderWidget","Rendering/PBR_Skybox_Anisotropy.py" -"vtkSliderWidget","Rendering/PBR_Skybox.py" -"vtkSliderWidget","Rendering/PBR_Skybox_Texturing.py" -"vtkSliderWidget","Visualization/FroggieView.py" -"vtk_source","Visualization/ProgrammableGlyphs.py" -"vtkSphere","CompositeData/OverlappingAMR.py" -"vtkSphere","ImageProcessing/Attenuation.py" -"vtkSphere","ImplicitFunctions/BooleanOperationImplicitFunctions.py" -"vtkSphere","ImplicitFunctions/ImplicitSphere1.py" -"vtkSphere","ImplicitFunctions/ImplicitSphere.py" -"vtkSphere","Medical/TissueLens.py" -"vtkSphere","Modelling/DiscreteMarchingCubes.py" -"vtkSphere","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkSphereSource","Arrays/GetValues.py" -"vtkSphereSource","Arrays/RenameArray.py" -"vtkSphereSource","CompositeData/CompositePolyDataMapper.py" -"vtkSphereSource","CompositeData/MultiBlockDataSet.py" -"vtkSphereSource","Filtering/AppendFilter.py" -"vtkSphereSource","Filtering/CombinePolyData.py" -"vtkSphereSource","Filtering/ConnectivityFilter.py" -"vtkSphereSource","Filtering/GaussianSplat.py" -"vtkSphereSource","Filtering/TransformPolyData.py" -"vtkSphereSource","GeometricObjects/Axes.py" -"vtkSphereSource","GeometricObjects/ConvexPointSet.py" -"vtkSphereSource","GeometricObjects/EarthSource.py" -"vtkSphereSource","GeometricObjects/GeometricObjectsDemo.py" -"vtkSphereSource","GeometricObjects/IsoparametricCellsDemo.py" -"vtkSphereSource","GeometricObjects/LinearCellsDemo.py" -"vtkSphereSource","GeometricObjects/OrientedArrow.py" -"vtkSphereSource","GeometricObjects/OrientedCylinder.py" -"vtkSphereSource","GeometricObjects/PlanesIntersection.py" -"vtkSphereSource","GeometricObjects/Planes.py" -"vtkSphereSource","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkSphereSource","GeometricObjects/QuadraticHexahedron.py" -"vtkSphereSource","GeometricObjects/QuadraticTetraDemo.py" -"vtkSphereSource","GeometricObjects/QuadraticTetra.py" -"vtkSphereSource","GeometricObjects/SourceObjectsDemo.py" -"vtkSphereSource","GeometricObjects/Sphere.py" -"vtkSphereSource","Interaction/InteractorStyleTrackballActor.py" -"vtkSphereSource","Interaction/InteractorStyleTrackballCamera.py" -"vtkSphereSource","Interaction/MouseEventsObserver.py" -"vtkSphereSource","Interaction/MouseEvents.py" -"vtkSphereSource","IO/ImageWriter.py" -"vtkSphereSource","IO/ReadLegacyUnstructuredGrid.py" -"vtkSphereSource","IO/WritePLY.py" -"vtkSphereSource","IO/WriteSTL.py" -"vtkSphereSource","Medical/TissueLens.py" -"vtkSphereSource","Meshes/CapClip.py" -"vtkSphereSource","Meshes/Decimation.py" -"vtkSphereSource","Meshes/DeformPointSet.py" -"vtkSphereSource","Modelling/DelaunayMesh.py" -"vtkSphereSource","Modelling/MarchingCubes.py" -"vtkSphereSource","Picking/HighlightPickedActor.py" -"vtkSphereSource","Picking/HighlightWithSilhouette.py" -"vtkSphereSource","PolyData/BooleanOperationPolyDataFilter.py" -"vtkSphereSource","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkSphereSource","PolyData/ExtractSelectionUsingCells.py" -"vtkSphereSource","PolyData/FilledPolygon.py" -"vtkSphereSource","PolyData/ImplicitPolyDataDistance.py" -"vtkSphereSource","PolyData/PolyDataContourToImageData.py" -"vtkSphereSource","PolyData/PolyDataToImageDataStencil.py" -"vtkSphereSource","Problems/ImplicitFunctions/ImplicitDataSet.py" -"vtkSphereSource","Rendering/AmbientSpheres.py" -"vtkSphereSource","Rendering/CameraBlur.py" -"vtkSphereSource","Rendering/ColoredSphere.py" -"vtkSphereSource","Rendering/DiffuseSpheres.py" -"vtkSphereSource","Rendering/FlatVersusGouraud.py" -"vtkSphereSource","Rendering/GradientBackground.py" -"vtkSphereSource","Rendering/Mace.py" -"vtkSphereSource","Rendering/Model.py" -"vtkSphereSource","Rendering/PBR_Anisotropy.py" -"vtkSphereSource","Rendering/PBR_Edge_Tint.py" -"vtkSphereSource","Rendering/PBR_HDR_Environment.py" -"vtkSphereSource","Rendering/PBR_Materials_Coat.py" -"vtkSphereSource","Rendering/PBR_Materials.py" -"vtkSphereSource","Rendering/Rotations.py" -"vtkSphereSource","Rendering/Shadows.py" -"vtkSphereSource","Rendering/SpecularSpheres.py" -"vtkSphereSource","Rendering/TransformSphere.py" -"vtkSphereSource","Texture/TextureCutQuadric.py" -"vtkSphereSource","Texture/TextureCutSphere.py" -"vtkSphereSource","Utilities/Animation.py" -"vtkSphereSource","Utilities/ColorMapToLUT.py" -"vtkSphereSource","Utilities/JSONColorMapToLUT.py" -"vtkSphereSource","Utilities/Screenshot.py" -"vtkSphereSource","Utilities/ShareCamera.py" -"vtkSphereSource","Utilities/XMLColorMapToLUT.py" -"vtkSphereSource","VisualizationAlgorithms/MarchingCases.py" -"vtkSphereSource","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkSphereSource","Visualization/BillboardTextActor3D.py" -"vtkSphereSource","Visualization/CameraModel1.py" -"vtkSphereSource","Visualization/CameraModel2.py" -"vtkSphereSource","Visualization/Camera.py" -"vtkSphereSource","Visualization/CollisionDetection.py" -"vtkSphereSource","Visualization/ColorAnActor.py" -"vtkSphereSource","Visualization/CurvatureBandsWithGlyphs.py" -"vtkSphereSource","Visualization/DisplayCoordinateAxes.py" -"vtkSphereSource","Visualization/ElevationBandsWithGlyphs.py" -"vtkSphereSource","Visualization/GlyphTable.py" -"vtkSphereSource","Visualization/HardwareSelector.py" -"vtkSphereSource","Visualization/LoopShrink.py" -"vtkSphereSource","Visualization/MultipleRenderWindows.py" -"vtkSphereSource","Visualization/MultipleViewports.py" -"vtkSphereSource","Visualization/OrientedGlyphs.py" -"vtkSphereSource","Visualization/PointDataSubdivision.py" -"vtkSphereSource","Visualization/ProgrammableGlyphFilter.py" -"vtkSphereSource","Visualization/ShadowsLightsDemo.py" -"vtkSphereSource","Visualization/SphereTexture.py" -"vtkSphereSource","Visualization/WindowTitle.py" -"vtkSphereSource","Widgets/BalloonWidget.py" -"vtkSphereSource","Widgets/EmbedInPyQt2.py" -"vtkSphereSource","Widgets/EmbedInPyQt.py" -"vtkSphereSource","Widgets/ImplicitPlaneWidget2.py" -"vtkSphereSource","Widgets/TextWidget.py" -"vtkSphere","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkSphere","VisualizationAlgorithms/ExtractData.py" -"vtkSphere","VisualizationAlgorithms/IceCream.py" -"vtkSphere","Visualization/IsosurfaceSampling.py" -"vtkSphereWidget","Widgets/SphereWidget.py" -"vtkSpiderPlotActor","Plotting/SpiderPlot.py" -"vtkSplineWidget","Widgets/SplineWidget.py" -"vtkSTLReader","IO/PolyDataToImageDataConverter.py" -"vtkSTLReader","IO/ReadSTL.py" -"vtkSTLReader","IO/WriteSTL.py" -"vtkSTLReader","Meshes/CapClip.py" -"vtkSTLReader","Meshes/Decimation.py" -"vtkSTLReader","Meshes/PointInterpolator.py" -"vtkSTLReader","PolyData/AlignTwoPolyDatas.py" -"vtkSTLReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkSTLReader","PolyData/CellsInsideObject.py" -"vtkSTLReader","PolyData/ClosedSurface.py" -"vtkSTLReader","Rendering/GradientBackground.py" -"vtkSTLReader","Rendering/Rotations.py" -"vtkSTLReader","Rendering/Shadows.py" -"vtkSTLReader","Utilities/SaveSceneToFieldData.py" -"vtkSTLReader","Utilities/SaveSceneToFile.py" -"vtkSTLReader","Visualization/NormalsDemo.py" -"vtkSTLWriter","IO/WriteSTL.py" -"vtkStreamTracer","VisualizationAlgorithms/BluntStreamlines.py" -"vtkStreamTracer","VisualizationAlgorithms/CarotidFlow.py" -"vtkStreamTracer","VisualizationAlgorithms/LOxGrid.py" -"vtkStreamTracer","VisualizationAlgorithms/LOx.py" -"vtkStreamTracer","VisualizationAlgorithms/LOxSeeds.py" -"vtkStreamTracer","VisualizationAlgorithms/Office.py" -"vtkStreamTracer","VisualizationAlgorithms/OfficeTube.py" -"vtkStreamTracer","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkStreamTracer","Visualization/Kitchen.py" -"vtkStreamTracer","Visualization/StreamLines.py" -"vtkStringArray","Graphs/CreateTree.py" -"vtkStringArray","Utilities/SaveSceneToFieldData.py" -"vtkStringArray","Utilities/Variant.py" -"vtkStripper","Medical/MedicalDemo2.py" -"vtkStripper","Medical/MedicalDemo3.py" -"vtkStripper","Meshes/CapClip.py" -"vtkStripper","Modelling/Bottle.py" -"vtkStripper","PolyData/ExtractPolyLinesFromPolyData.py" -"vtkStripper","PolyData/FilledPolygon.py" -"vtkStripper","PolyData/PolyDataContourToImageData.py" -"vtkStripper","PolyData/PolyDataToImageDataStencil.py" -"vtkStripper","Rendering/StripFran.py" -"vtkStripper","Visualization/FrogBrain.py" -"vtkStripper","Visualization/FroggieSurface.py" -"vtkStripper","VolumeRendering/PseudoVolumeRendering.py" -"vtkStructuredGridGeometryFilter","IO/ReadPLOT3D.py" -"vtkStructuredGridGeometryFilter","Rendering/Rainbow.py" -"vtkStructuredGridGeometryFilter","StructuredGrid/BlankPoint.py" -"vtkStructuredGridGeometryFilter","Texture/TextureThreshold.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/BluntStreamlines.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/LOxGrid.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/LOx.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/LOxSeeds.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/Office.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/OfficeTube.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/VelocityProfile.py" -"vtkStructuredGridGeometryFilter","VisualizationAlgorithms/WarpCombustor.py" -"vtkStructuredGridGeometryFilter","Visualization/Kitchen.py" -"vtkStructuredGridOutlineFilter","Rendering/Rainbow.py" -"vtkStructuredGridOutlineFilter","Texture/TextureThreshold.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/BluntStreamlines.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/CombustorIsosurface.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/CutStructuredGrid.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/LOxGrid.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/LOx.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/Office.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/OfficeTube.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/ProbeCombustor.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/StreamlinesWithLineWidget.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/VelocityProfile.py" -"vtkStructuredGridOutlineFilter","VisualizationAlgorithms/WarpCombustor.py" -"vtkStructuredGridOutlineFilter","Visualization/Kitchen.py" -"vtkStructuredGridOutlineFilter","Visualization/StreamLines.py" -"vtkStructuredGridOutlineFilter","VolumeRendering/PseudoVolumeRendering.py" -"vtkStructuredGridReader","Visualization/Kitchen.py" -"vtkStructuredGrid","StructuredGrid/BlankPoint.py" -"vtkStructuredGrid","StructuredGrid/SGrid.py" -"vtkStructuredPointsReader","Modelling/ExtractLargestIsosurface.py" -"vtkStructuredPointsReader","Texture/AnimateVectors.py" -"vtkStructuredPointsReader","Texture/TextureCutSphere.py" -"vtkStructuredPointsReader","Texture/TextureThreshold.py" -"vtkStructuredPointsReader","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkStructuredPointsReader","VisualizationAlgorithms/CarotidFlow.py" -"vtkStructuredPointsReader","VisualizationAlgorithms/IronIsoSurface.py" -"vtkStructuredPointsReader","VisualizationAlgorithms/Motor.py" -"vtkStructuredPointsReader","Visualization/ComplexV.py" -"vtkStructuredPointsReader","VolumeRendering/SimpleRayCast.py" -"vtkStructuredPoints","StructuredPoints/Vol.py" -"vtkStructuredPoints","Visualization/Lorenz.py" -"vtkSuperquadric","ImplicitFunctions/SampleFunction.py" -"vtkSuperquadricSource","Images/BackgroundImage.py" -"vtkSuperquadricSource","Meshes/SolidClip.py" -"vtkSuperquadricSource","PolyData/CurvaturesDemo.py" -"vtkSuperquadricSource","Visualization/CubeAxesActor.py" -"vtkSuperquadricSource","Visualization/CurvatureBandsWithGlyphs.py" -"vtkSuperquadricSource","Visualization/ElevationBandsWithGlyphs.py" -"vtkSuperquadricSource","Visualization/PointDataSubdivision.py" -"vtkSuperquadricSource","Visualization/ProgrammableGlyphs.py" -"vtkSuperquadricSource","Widgets/OrientationMarkerWidget1.py" -"vtkTableBasedClipDataSet","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkTable","Plotting/MultiplePlots.py" -"vtkTable","Plotting/ScatterPlot.py" -"vtkTable","Plotting/SurfacePlot.py" -"vtkTableToPolyData","IO/CSVReadEdit1.py" -"vtkTableToPolyData","Meshes/PointInterpolator.py" -"vtkTensorGlyph","VisualizationAlgorithms/TensorAxes.py" -"vtkTensorGlyph","VisualizationAlgorithms/TensorEllipsoids.py" -"vtkTessellatedBoxSource","GeometricObjects/TessellatedBoxSource.py" -"vtkTessellatorFilter","GeometricObjects/CellTypeSource.py" -"vtkTessellatorFilter","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkTessellatorFilter","GeometricObjects/QuadraticHexahedron.py" -"vtkTessellatorFilter","GeometricObjects/QuadraticTetraDemo.py" -"vtkTessellatorFilter","GeometricObjects/QuadraticTetra.py" -"vtkTetra","GeometricObjects/Cell3DDemonstration.py" -"vtkTetra","GeometricObjects/CellTypeSource.py" -"vtkTetra","GeometricObjects/LinearCellsDemo.py" -"vtkTetra","GeometricObjects/Tetrahedron.py" -"vtkTetra","IO/WriteLegacyLinearCells.py" -"vtkTetra","IO/WriteXMLLinearCells.py" -"vtkTextActor","GeometricObjects/TextActor.py" -"vtkTextActor","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkTextActor","Visualization/CameraModel1.py" -"vtkTextActor","Visualization/CameraModel2.py" -"vtkTextActor","Visualization/CollisionDetection.py" -"vtkTextActor","Widgets/TextWidget.py" -"vtkTextMapper","Annotation/MultiLineText.py" -"vtkTextMapper","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkTextMapper","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkTextMapper","GeometricObjects/Cell3DDemonstration.py" -"vtkTextMapper","GeometricObjects/CellTypeSource.py" -"vtkTextMapper","GeometricObjects/GeometricObjectsDemo.py" -"vtkTextMapper","GeometricObjects/IsoparametricCellsDemo.py" -"vtkTextMapper","GeometricObjects/LinearCellsDemo.py" -"vtkTextMapper","GeometricObjects/ParametricObjectsDemo.py" -"vtkTextMapper","GeometricObjects/Planes.py" -"vtkTextMapper","GeometricObjects/PlatonicSolids.py" -"vtkTextMapper","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkTextMapper","GeometricObjects/QuadraticTetraDemo.py" -"vtkTextMapper","GeometricObjects/SourceObjectsDemo.py" -"vtkTextMapper","IO/ReadDICOMSeries.py" -"vtkTextMapper","PolyData/CurvaturesAdjustEdges.py" -"vtkTextMapper","PolyData/CurvaturesDemo.py" -"vtkTextMapper","Rendering/GradientBackground.py" -"vtkTextMapper","Utilities/RescaleReverseLUT.py" -"vtkTextMapper","Visualization/PointDataSubdivision.py" -"vtkTextProperty","Annotation/MultiLineText.py" -"vtkTextProperty","Deprecated/GeometricObjects/ParametricObjectsDemo2.py" -"vtkTextProperty","Deprecated/GeometricObjects/ParametricObjectsDemo.py" -"vtkTextProperty","GeometricObjects/Cell3DDemonstration.py" -"vtkTextProperty","GeometricObjects/CellTypeSource.py" -"vtkTextProperty","GeometricObjects/GeometricObjectsDemo.py" -"vtkTextProperty","GeometricObjects/IsoparametricCellsDemo.py" -"vtkTextProperty","GeometricObjects/LinearCellsDemo.py" -"vtkTextProperty","GeometricObjects/ParametricObjectsDemo.py" -"vtkTextProperty","GeometricObjects/Planes.py" -"vtkTextProperty","GeometricObjects/PlatonicSolids.py" -"vtkTextProperty","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkTextProperty","GeometricObjects/QuadraticTetraDemo.py" -"vtkTextProperty","GeometricObjects/SourceObjectsDemo.py" -"vtkTextProperty","IO/ReadDICOMSeries.py" -"vtkTextProperty","PolyData/CurvaturesAdjustEdges.py" -"vtkTextProperty","PolyData/CurvaturesDemo.py" -"vtkTextProperty","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkTextProperty","Rendering/GradientBackground.py" -"vtkTextProperty","Utilities/RescaleReverseLUT.py" -"vtkTextProperty","Visualization/PointDataSubdivision.py" -"vtkTextRepresentation","Widgets/TextWidget.py" -"vtkTextSource","GeometricObjects/SourceObjectsDemo.py" -"vtkTextSource","Visualization/TextSource.py" -"vtk","Texture/AnimateVectors.py" -"vtkTexturedSphereSource","PolyData/CurvaturesAdjustEdges.py" -"vtkTexturedSphereSource","Rendering/PBR_Skybox_Anisotropy.py" -"vtkTexturedSphereSource","Rendering/PBR_Skybox.py" -"vtkTexturedSphereSource","Rendering/PBR_Skybox_Texturing.py" -"vtkTextureMapToSphere","Rendering/PBR_Anisotropy.py" -"vtkTextureMapToSphere","Visualization/SphereTexture.py" -"vtkTexture","Rendering/PBR_Anisotropy.py" -"vtkTexture","Rendering/PBR_Clear_Coat.py" -"vtkTexture","Rendering/PBR_Edge_Tint.py" -"vtkTexture","Rendering/PBR_HDR_Environment.py" -"vtkTexture","Rendering/PBR_Mapping.py" -"vtkTexture","Rendering/PBR_Materials_Coat.py" -"vtkTexture","Rendering/PBR_Materials.py" -"vtkTexture","Rendering/PBR_Skybox_Anisotropy.py" -"vtkTexture","Rendering/PBR_Skybox.py" -"vtkTexture","Rendering/PBR_Skybox_Texturing.py" -"vtkTexture","Rendering/StippledLine.py" -"vtkTexture","Texture/AnimateVectors.py" -"vtk","Texture/TextureCutSphere.py" -"vtkTexture","Texture/TextureCutQuadric.py" -"vtkTexture","Texture/TextureCutSphere.py" -"vtkTexture","Texture/TexturePlane.py" -"vtkTexture","Texture/TextureThreshold.py" -"vtkTexture","VisualizationAlgorithms/DecimateFran.py" -"vtkTexture","VisualizationAlgorithms/Motor.py" -"vtkTexture","Visualization/FrogSlice.py" -"vtkTexture","Visualization/SphereTexture.py" -"vtkTextWidget","Widgets/TextWidget.py" -"vtkThreshold","Medical/GenerateCubesFromLabels.py" -"vtkThreshold","Medical/GenerateModelsFromLabels.py" -"vtkThresholdPoints","Texture/AnimateVectors.py" -"vtkThresholdPoints","VisualizationAlgorithms/CarotidFlowGlyphs.py" -"vtkThresholdPoints","VisualizationAlgorithms/CarotidFlow.py" -"vtkThresholdPoints","VisualizationAlgorithms/MarchingCases.py" -"vtkThresholdTextureCoords","Texture/TextureThreshold.py" -"vtkTIFFWriter","IO/ImageWriter.py" -"vtkTIFFWriter","Visualization/Hanoi.py" -"vtkTimerCallback","Utilities/Animation.py" -"vtkTimeSourceExample","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkToneMappingPass","Rendering/PBR_Skybox_Anisotropy.py" -"vtkToneMappingPass","Rendering/PBR_Skybox.py" -"vtkToneMappingPass","Rendering/PBR_Skybox_Texturing.py" -"vtk_to_numpy","Visualization/HardwareSelector.py" -"vtkTransformFilter","Deprecated/Geovis/GeoGraticle.py" -"vtkTransformFilter","GeometricObjects/IsoparametricCellsDemo.py" -"vtkTransform","Filtering/TransformPolyData.py" -"vtkTransformFilter","Medical/GenerateCubesFromLabels.py" -"vtkTransformFilter","PolyData/CurvaturesDemo.py" -"vtkTransformFilter","Rendering/TransformSphere.py" -"vtkTransformFilter","Visualization/CameraModel1.py" -"vtkTransformFilter","Visualization/CameraModel2.py" -"vtkTransformFilter","Visualization/FroggieSurface.py" -"vtkTransformFilter","Visualization/FroggieView.py" -"vtkTransformFilter","Visualization/FrogSlice.py" -"vtkTransform","GeometricObjects/Axes.py" -"vtkTransform","GeometricObjects/EllipticalCylinderDemo.py" -"vtkTransform","GeometricObjects/IsoparametricCellsDemo.py" -"vtkTransform","GeometricObjects/OrientedArrow.py" -"vtkTransform","GeometricObjects/OrientedCylinder.py" -"vtkTransform","IO/CSVReadEdit1.py" -"vtkTransform","IO/CSVReadEdit.py" -"vtkTransform","Medical/GenerateCubesFromLabels.py" -"vtkTransform","PolyData/AlignTwoPolyDatas.py" -"vtkTransform","PolyData/CellsInsideObject.py" -"vtkTransform","PolyData/CurvaturesAdjustEdges.py" -"vtkTransform","PolyData/CurvaturesDemo.py" -"vtkTransformPolyDataFilter","Filtering/IterativeClosestPoints.py" -"vtkTransformPolyDataFilter","Filtering/TransformPolyData.py" -"vtkTransformPolyDataFilter","GeometricObjects/EllipticalCylinderDemo.py" -"vtkTransformPolyDataFilter","GeometricObjects/OrientedArrow.py" -"vtkTransformPolyDataFilter","GeometricObjects/OrientedCylinder.py" -"vtkTransformPolyDataFilter","IO/CSVReadEdit1.py" -"vtkTransformPolyDataFilter","IO/CSVReadEdit.py" -"vtkTransformPolyDataFilter","PolyData/AlignTwoPolyDatas.py" -"vtkTransformPolyDataFilter","PolyData/CellsInsideObject.py" -"vtkTransformPolyDataFilter","PolyData/CurvaturesAdjustEdges.py" -"vtkTransformPolyDataFilter","PolyData/RotationAroundLine.py" -"vtkTransformPolyDataFilter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkTransformPolyDataFilter","Rendering/PBR_Skybox.py" -"vtkTransformPolyDataFilter","Rendering/PBR_Skybox_Texturing.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/ExponentialCosine.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/MarchingCases.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/ProbeCombustor.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/SpikeFran.py" -"vtkTransformPolyDataFilter","VisualizationAlgorithms/Stocks.py" -"vtkTransformPolyDataFilter","Visualization/BlobbyLogo.py" -"vtkTransformPolyDataFilter","Visualization/CameraModel1.py" -"vtkTransformPolyDataFilter","Visualization/CameraModel2.py" -"vtkTransformPolyDataFilter","Visualization/ColoredAnnotatedCube.py" -"vtkTransformPolyDataFilter","Visualization/CurvatureBandsWithGlyphs.py" -"vtkTransformPolyDataFilter","Visualization/ElevationBandsWithGlyphs.py" -"vtkTransformPolyDataFilter","Visualization/FroggieSurface.py" -"vtkTransformPolyDataFilter","Visualization/FroggieView.py" -"vtkTransformPolyDataFilter","Visualization/FrogSlice.py" -"vtkTransform","PolyData/RotationAroundLine.py" -"vtkTransform","Rendering/LayeredActors.py" -"vtkTransform","Rendering/PBR_Skybox_Anisotropy.py" -"vtkTransform","Rendering/PBR_Skybox.py" -"vtkTransform","Rendering/PBR_Skybox_Texturing.py" -"vtkTransform","Rendering/TransformSphere.py" -"vtkTransform","Rendering/WalkCow.py" -"vtkTransform","Tutorial/Tutorial_Step6.py" -"vtkTransform","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkTransform","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkTransform","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkTransform","VisualizationAlgorithms/ClipSphereCylinder.py" -"vtkTransform","VisualizationAlgorithms/ExponentialCosine.py" -"vtkTransform","VisualizationAlgorithms/ExtractData.py" -"vtkTransform","VisualizationAlgorithms/MarchingCases.py" -"vtkTransform","VisualizationAlgorithms/ProbeCombustor.py" -"vtkTransform","VisualizationAlgorithms/SpikeFran.py" -"vtkTransform","VisualizationAlgorithms/Stocks.py" -"vtkTransform","Visualization/BlobbyLogo.py" -"vtkTransform","Visualization/CameraModel1.py" -"vtkTransform","Visualization/CameraModel2.py" -"vtkTransform","Visualization/CollisionDetection.py" -"vtkTransform","Visualization/ColoredAnnotatedCube.py" -"vtkTransform","Visualization/CurvatureBandsWithGlyphs.py" -"vtkTransform","Visualization/ElevationBandsWithGlyphs.py" -"vtkTransform","Visualization/FroggieSurface.py" -"vtkTransform","Visualization/FroggieView.py" -"vtkTransform","Visualization/FrogSlice.py" -"vtkTransform","Widgets/BoxWidget.py" -"vtkTree","Graphs/ConstructTree.py" -"vtkTree","Graphs/CreateTree.py" -"vtkTriangle","DataManipulation/LineOnMesh.py" -"vtkTriangleFilter","Meshes/Decimation.py" -"vtkTriangleFilter","Picking/CellPicking.py" -"vtkTriangleFilter","PolyData/BooleanOperationPolyDataFilter.py" -"vtkTriangleFilter","PolyData/CurvaturesAdjustEdges.py" -"vtkTriangleFilter","PolyData/CurvaturesDemo.py" -"vtkTriangleFilter","PolyData/PolyDataToImageDataStencil.py" -"vtkTriangleFilter","Rendering/PBR_Clear_Coat.py" -"vtkTriangleFilter","Rendering/PBR_Mapping.py" -"vtkTriangleFilter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkTriangleFilter","Rendering/PBR_Skybox.py" -"vtkTriangleFilter","Rendering/PBR_Skybox_Texturing.py" -"vtkTriangleFilter","Visualization/CurvatureBandsWithGlyphs.py" -"vtkTriangleFilter","Visualization/ElevationBandsWithGlyphs.py" -"vtkTriangleFilter","Visualization/PointDataSubdivision.py" -"vtkTriangle","GeometricObjects/CellTypeSource.py" -"vtkTriangle","GeometricObjects/LinearCellsDemo.py" -"vtkTriangle","GeometricObjects/Triangle.py" -"vtkTriangle","IO/WriteLegacyLinearCells.py" -"vtkTriangle","IO/WriteTriangleToFile.py" -"vtkTriangle","IO/WriteXMLLinearCells.py" -"vtkTriangle","PolyData/ColoredTriangle.py" -"vtkTriangle","PolyData/SmoothMeshGrid.py" -"vtkTriangle","PolyData/SolidColoredTriangle.py" -"vtkTriangleStrip","GeometricObjects/LinearCellsDemo.py" -"vtkTriangleStrip","GeometricObjects/TriangleStrip.py" -"vtkTriangleStrip","IO/WriteLegacyLinearCells.py" -"vtkTriangleStrip","IO/WriteXMLLinearCells.py" -"vtkTriangles","Visualization/KochSnowflake.py" -"vtkTriangle","Visualization/KochSnowflake.py" -"vtkTriQuadraticHexahedron","GeometricObjects/IsoparametricCellsDemo.py" -"vtkTubeFilter","Filtering/WarpTo.py" -"vtkTubeFilter","GeometricObjects/EllipticalCylinderDemo.py" -"vtkTubeFilter","IO/ReadLegacyUnstructuredGrid.py" -"vtkTubeFilter","Modelling/Bottle.py" -"vtkTubeFilter","Modelling/DelaunayMesh.py" -"vtkTubeFilter","Modelling/FinanceFieldData.py" -"vtkTubeFilter","Modelling/Finance.py" -"vtkTubeFilter","PolyData/TubeFilter.py" -"vtkTubeFilter","VisualizationAlgorithms/CarotidFlow.py" -"vtkTubeFilter","VisualizationAlgorithms/LOxGrid.py" -"vtkTubeFilter","VisualizationAlgorithms/LOx.py" -"vtkTubeFilter","VisualizationAlgorithms/LOxSeeds.py" -"vtkTubeFilter","VisualizationAlgorithms/MarchingCases.py" -"vtkTubeFilter","VisualizationAlgorithms/OfficeTube.py" -"vtkTubeFilter","VisualizationAlgorithms/Stocks.py" -"vtkTubeFilter","VisualizationAlgorithms/TensorAxes.py" -"vtkTubeFilter","VolumeRendering/PseudoVolumeRendering.py" -"vtkUniformGrid","CompositeData/OverlappingAMR.py" -"vtkUnsignedCharArray","DataManipulation/LineOnMesh.py" -"vtkUnsignedCharArray","GeometricObjects/ColoredLines.py" -"vtkUnsignedCharArray","Meshes/ColoredElevationMap.py" -"vtkUnsignedCharArray","PolyData/ColoredTriangle.py" -"vtkUnsignedCharArray","PolyData/SmoothMeshGrid.py" -"vtkUnsignedCharArray","PolyData/SolidColoredTriangle.py" -"vtkUnsignedCharArray","PolyData/TriangleColoredPoints.py" -"vtkUnsignedCharArray","Visualization/AssignCellColorsFromLUT.py" -"vtkUnsignedCharArray","Visualization/ColoredAnnotatedCube.py" -"vtkUnstructured","GeometricObjects/IsoparametricCellsDemo.py" -"vtkUnstructured","GeometricObjects/LinearCellsDemo.py" -"vtk","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtk","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkUnstructuredGrid","ExplicitStructuredGrid/CreateESGrid.py" -"vtkUnstructuredGrid","Filtering/AppendFilter.py" -"vtkUnstructuredGrid","GeometricObjects/Cell3DDemonstration.py" -"vtkUnstructuredGrid","GeometricObjects/ConvexPointSet.py" -"vtkUnstructuredGrid","GeometricObjects/Hexahedron.py" -"vtkUnstructuredGrid","GeometricObjects/IsoparametricCellsDemo.py" -"vtkUnstructuredGrid","GeometricObjects/LinearCellsDemo.py" -"vtkUnstructuredGrid","GeometricObjects/Polyhedron.py" -"vtkUnstructuredGrid","GeometricObjects/Pyramid.py" -"vtkUnstructuredGrid","GeometricObjects/QuadraticHexahedronDemo.py" -"vtkUnstructuredGrid","GeometricObjects/QuadraticHexahedron.py" -"vtkUnstructuredGrid","GeometricObjects/QuadraticTetraDemo.py" -"vtkUnstructuredGrid","GeometricObjects/QuadraticTetra.py" -"vtkUnstructuredGrid","GeometricObjects/Tetrahedron.py" -"vtkUnstructuredGrid","Graphs/NOVCAGraph.py" -"vtkUnstructuredGrid","IO/ReadLegacyUnstructuredGrid.py" -"vtkUnstructuredGrid","IO/WriteLegacyLinearCells.py" -"vtkUnstructuredGrid","IO/WriteXMLLinearCells.py" -"vtkUnstructuredGrid","Modelling/Finance.py" -"vtkUnstructuredGrid","Picking/CellPicking.py" -"vtkUnstructuredGrid","PolyData/ExtractSelection.py" -"vtkUnstructuredGrid","PolyData/ExtractSelectionUsingCells.py" -"vtkUnstructuredGridReader","IO/ReadLegacyUnstructuredGrid.py" -"vtkUnstructuredGridReader","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkUnstructuredGridReader","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkUnstructuredGridReader","Widgets/ScalarBarWidget.py" -"vtkUnstructuredGridToExplicitStructuredGrid","ExplicitStructuredGrid/CreateESGrid.py" -"vtkUnstructuredGridToExplicitStructuredGrid","ExplicitStructuredGrid/LoadESGrid.py" -"vtkUnstructuredGrid","UnstructuredGrid/ClipUnstructuredGridWithPlane2.py" -"vtkUnstructuredGrid","UnstructuredGrid/ClipUnstructuredGridWithPlane.py" -"vtkUnstructuredGrid","UnstructuredGrid/UGrid.py" -"vtkUnstructuredGrid","VisualizationAlgorithms/DataSetSurface.py" -"vtkUnstructuredGrid","VisualizationAlgorithms/MarchingCases.py" -"vtkUnstructuredGridVolumeRayCastMapper","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkUnstructuredGridVolumeZSweepMapper","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkUnstructuredGridWriter","IO/WriteLegacyLinearCells.py" -"vtk","Utilities/SaveSceneToFieldData.py" -"vtk","Utilities/SaveSceneToFile.py" -"vtk","Utilities/SelectExamples.py" -"vtk","Utilities/Variant.py" -"vtk","Utilities/VTKImportsForPython.py" -"vtk","Utilities/VTKModulesForCxx.py" -"vtk","Utilities/VTKWithNumpy.py" -"vtkVariantArray","IO/ReadLegacyUnstructuredGrid.py" -"vtkVariantArray","Utilities/LUTUtilities.py" -"vtkVariantArray","Utilities/Variant.py" -"vtkVariantArray","Visualization/CurvatureBandsWithGlyphs.py" -"vtkVariantArray","Visualization/ElevationBandsWithGlyphs.py" -"vtkVariantCast","Utilities/Variant.py" -"vtkVariantCreate","Utilities/Variant.py" -"vtkVariantEqual","Utilities/Variant.py" -"vtkVariantExtract","Utilities/Variant.py" -"vtkVariantLessThan","Utilities/Variant.py" -"vtkVariantStrictEquality","Utilities/Variant.py" -"vtkVariantStrictWeakOrderKey","Utilities/Variant.py" -"vtkVariantStrictWeakOrder","Utilities/Variant.py" -"vtkVariant","Utilities/LUTUtilities.py" -"vtkVariant","Utilities/Variant.py" -"vtkVariant","Visualization/CurvatureBandsWithGlyphs.py" -"vtkVariant","Visualization/ElevationBandsWithGlyphs.py" -"vtkVector2i","Plotting/SurfacePlot.py" -"vtkVectorDot","VisualizationAlgorithms/DisplacementPlot.py" -"vtkVectorDot","VisualizationAlgorithms/PlateVibration.py" -"vtkVectorText","Annotation/TextOrigin.py" -"vtkVectorText","Modelling/FinanceFieldData.py" -"vtkVectorText","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkVectorText","VisualizationAlgorithms/MarchingCases.py" -"vtkVectorText","VisualizationAlgorithms/Stocks.py" -"vtkVectorText","Visualization/AlphaFrequency.py" -"vtkVectorText","Visualization/VectorText.py" -"vtkVersion","DataManipulation/MeshLabelImageColor.py" -"vtkVersion","GeometricObjects/IsoparametricCellsDemo.py" -"vtkVersion","GeometricObjects/LinearCellsDemo.py" -"vtkVersion","Medical/GenerateModelsFromLabels.py" -"vtkVersion","Medical/MedicalDemo1.py" -"vtkVersion","Medical/MedicalDemo2.py" -"vtkVersion","Medical/MedicalDemo3.py" -"vtkVersion","Medical/TissueLens.py" -"vtkVersion","Modelling/DiscreteMarchingCubes.py" -"vtkVersion","Modelling/ExtractLargestIsosurface.py" -"vtkVersion","Modelling/MarchingCubes.py" -"vtk_version_number","GeometricObjects/IsoparametricCellsDemo.py" -"vtk_version_number","GeometricObjects/LinearCellsDemo.py" -"vtk_version_number","Medical/GenerateModelsFromLabels.py" -"vtk_version_number","Medical/MedicalDemo1.py" -"vtk_version_number","Medical/MedicalDemo2.py" -"vtk_version_number","Medical/MedicalDemo3.py" -"vtk_version_number","Medical/TissueLens.py" -"vtk_version_number","Modelling/DiscreteMarchingCubes.py" -"vtk_version_number","Modelling/ExtractLargestIsosurface.py" -"vtk_version_number","Modelling/MarchingCubes.py" -"vtk_version_number","PolyData/AlignTwoPolyDatas.py" -"vtk_version_number","Rendering/OutlineGlowPass.py" -"vtk_version_number","Rendering/PBR_Skybox_Anisotropy.py" -"vtk_version_number","Rendering/PBR_Skybox.py" -"vtk_version_number","Rendering/PBR_Skybox_Texturing.py" -"vtk_version_number","Utilities/CheckVTKVersion.py" -"vtk_version_number","VisualizationAlgorithms/HeadBone.py" -"vtk_version_number","Visualization/FrogBrain.py" -"vtk_version_number","Visualization/IsosurfaceSampling.py" -"vtk_version_number","Widgets/CompassWidget.py" -"vtk_version_ok","DataManipulation/MeshLabelImageColor.py" -"vtk_version_ok","GeometricObjects/IsoparametricCellsDemo.py" -"vtk_version_ok","GeometricObjects/LinearCellsDemo.py" -"vtk_version_ok","Medical/GenerateModelsFromLabels.py" -"vtk_version_ok","Medical/MedicalDemo1.py" -"vtk_version_ok","Medical/MedicalDemo2.py" -"vtk_version_ok","Medical/MedicalDemo3.py" -"vtk_version_ok","Medical/TissueLens.py" -"vtk_version_ok","Modelling/DiscreteMarchingCubes.py" -"vtk_version_ok","Modelling/ExtractLargestIsosurface.py" -"vtk_version_ok","Modelling/MarchingCubes.py" -"vtk_version_ok","PolyData/AlignTwoPolyDatas.py" -"vtk_version_ok","PolyData/CurvaturesAdjustEdges.py" -"vtk_version_ok","PolyData/CurvaturesDemo.py" -"vtk_version_ok","PolyData/Curvatures.py" -"vtk_version_ok","Rendering/OutlineGlowPass.py" -"vtk_version_ok","Rendering/PBR_Skybox_Anisotropy.py" -"vtk_version_ok","Rendering/PBR_Skybox.py" -"vtk_version_ok","Rendering/PBR_Skybox_Texturing.py" -"vtk_version_ok","Utilities/CheckVTKVersion.py" -"vtk_version_ok","Utilities/VTKImportsForPython.py" -"vtk_version_ok","VisualizationAlgorithms/HeadBone.py" -"vtk_version_ok","Visualization/CurvatureBandsWithGlyphs.py" -"vtk_version_ok","Visualization/ElevationBandsWithGlyphs.py" -"vtk_version_ok","Visualization/FrogBrain.py" -"vtk_version_ok","Visualization/IsosurfaceSampling.py" -"vtk_version_ok","Widgets/CompassWidget.py" -"vtk_version_ok","Widgets/SplineWidget.py" -"vtkVersion","PolyData/AlignTwoPolyDatas.py" -"vtkVersion","PolyData/CurvaturesAdjustEdges.py" -"vtkVersion","PolyData/CurvaturesDemo.py" -"vtkVersion","PolyData/Curvatures.py" -"vtkVersion","Rendering/OutlineGlowPass.py" -"vtkVersion","Rendering/PBR_Skybox_Anisotropy.py" -"vtkVersion","Rendering/PBR_Skybox.py" -"vtkVersion","Rendering/PBR_Skybox_Texturing.py" -"vtkVersion","Utilities/CheckVTKVersion.py" -"vtkVersion","Utilities/VTKImportsForPython.py" -"vtkVersion","VisualizationAlgorithms/HeadBone.py" -"vtkVersion","Visualization/AssignCellColorsFromLUT.py" -"vtkVersion","Visualization/CurvatureBandsWithGlyphs.py" -"vtkVersion","Visualization/ElevationBandsWithGlyphs.py" -"vtkVersion","Visualization/FrogBrain.py" -"vtkVersion","Visualization/IsosurfaceSampling.py" -"vtkVersion","Visualization/PointDataSubdivision.py" -"vtkVersion","Widgets/CompassWidget.py" -"vtkVersion","Widgets/SplineWidget.py" -"vtkVertex","GeometricObjects/LinearCellsDemo.py" -"vtkVertex","GeometricObjects/Vertex.py" -"vtkVertexGlyphFilter","Filtering/Delaunay2D.py" -"vtkVertexGlyphFilter","Filtering/TriangulateTerrainMap.py" -"vtkVertexGlyphFilter","Filtering/VertexGlyphFilter.py" -"vtkVertexGlyphFilter","Images/Actor2D.py" -"vtkVertexGlyphFilter","PolyData/ImplicitPolyDataDistance.py" -"vtkVertex","IO/WriteLegacyLinearCells.py" -"vtkVertex","IO/WriteXMLLinearCells.py" -"vtkViewport","Rendering/GradientBackground.py" -"vtkViewsContext2D","IO/ReadLegacyUnstructuredGrid.py" -"vtkViewsContext2D","Plotting/ScatterPlot.py" -"vtkViewsContext2D","Plotting/SurfacePlot.py" -"vtkViewsCore","Graphs/ColorEdges.py" -"vtkViewsCore","Graphs/ColorVerticesLookupTable.py" -"vtkViewsCore","Graphs/CreateTree.py" -"vtkViewsCore","Graphs/ScaleVertices.py" -"vtkViewsCore","InfoVis/SelectedGraphIDs.py" -"vtkViewsInfovis","Graphs/ColorEdges.py" -"vtkViewsInfovis","Graphs/ColorVertexLabels.py" -"vtkViewsInfovis","Graphs/ColorVerticesLookupTable.py" -"vtkViewsInfovis","Graphs/ConstructGraph.py" -"vtkViewsInfovis","Graphs/ConstructTree.py" -"vtkViewsInfovis","Graphs/CreateTree.py" -"vtkViewsInfovis","Graphs/EdgeWeights.py" -"vtkViewsInfovis","Graphs/LabelVerticesAndEdges.py" -"vtkViewsInfovis","Graphs/RandomGraphSource.py" -"vtkViewsInfovis","Graphs/ScaleVertices.py" -"vtkViewsInfovis","Graphs/SelectedVerticesAndEdges.py" -"vtkViewsInfovis","Graphs/SideBySideGraphs.py" -"vtkViewsInfovis","Graphs/VisualizeDirectedGraph.py" -"vtkViewsInfovis","Graphs/VisualizeGraph.py" -"vtkViewsInfovis","InfoVis/ParallelCoordinatesExtraction.py" -"vtkViewsInfovis","InfoVis/ParallelCoordinatesView.py" -"vtkViewsInfovis","InfoVis/SelectedGraphIDs.py" -"vtkViewTheme","Graphs/ColorEdges.py" -"vtkViewTheme","Graphs/ColorVerticesLookupTable.py" -"vtkViewTheme","Graphs/CreateTree.py" -"vtkViewTheme","Graphs/ScaleVertices.py" -"vtkViewTheme","InfoVis/SelectedGraphIDs.py" -"vtkViewUpdater","InfoVis/ParallelCoordinatesExtraction.py" -"vtk","VisualizationAlgorithms/CarotidFlow.py" -"vtk","VisualizationAlgorithms/DecimateFran.py" -"vtk","VisualizationAlgorithms/DecimateHawaii.py" -"vtk","VisualizationAlgorithms/DisplacementPlot.py" -"vtk","VisualizationAlgorithms/Hello.py" -"vtk","VisualizationAlgorithms/IronIsoSurface.py" -"vtk","VisualizationAlgorithms/Motor.py" -"vtk","VisualizationAlgorithms/Office.py" -"vtk","VisualizationAlgorithms/OfficeTube.py" -"vtk","VisualizationAlgorithms/PlateVibration.py" -"vtk","VisualizationAlgorithms/SpikeFran.py" -"vtk","VisualizationAlgorithms/SplatFace.py" -"vtk","VisualizationAlgorithms/Stocks.py" -"vtk","VisualizationAlgorithms/TensorAxes.py" -"vtk","VisualizationAlgorithms/VelocityProfile.py" -"vtk","Visualization/BlobbyLogo.py" -"vtk","Visualization/Blow.py" -"vtk","Visualization/ComplexV.py" -"vtk","Visualization/CurvatureBandsWithGlyphs.py" -"vtk","Visualization/FroggieView.py" -"vtk","Visualization/Hawaii.py" -"vtk","Visualization/Kitchen.py" -"vtk","Visualization/NormalsDemo.py" -"vtkVolume","Medical/MedicalDemo4.py" -"vtkVolume","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkVolumeProperty","Medical/MedicalDemo4.py" -"vtkVolumeProperty","Problems/Visualization/UnstructuredTransientVolumeRendering.py" -"vtkVolumeProperty","Utilities/VTKWithNumpy.py" -"vtkVolumeProperty","VolumeRendering/SimpleRayCast.py" -"vtk","VolumeRendering/SimpleRayCast.py" -"vtkVolume","Utilities/VTKWithNumpy.py" -"vtkVolume","VolumeRendering/SimpleRayCast.py" -"vtkVoxel","GeometricObjects/Cell3DDemonstration.py" -"vtkVoxel","GeometricObjects/LinearCellsDemo.py" -"vtkVoxel","IO/WriteLegacyLinearCells.py" -"vtkVoxel","IO/WriteXMLLinearCells.py" -"vtkVoxelModeller","Modelling/MarchingCubes.py" -"vtk_vtk","Utilities/SelectExamples.py" -"vtkWarpScalar","Images/ImageWarp.py" -"vtkWarpScalar","VisualizationAlgorithms/ExponentialCosine.py" -"vtkWarpScalar","VisualizationAlgorithms/WarpCombustor.py" -"vtkWarpTo","Filtering/WarpTo.py" -"vtkWarpTo","Visualization/CameraModel1.py" -"vtkWarpTo","Visualization/CameraModel2.py" -"vtkWarpVector","PolyData/WarpVector.py" -"vtkWarpVector","VisualizationAlgorithms/DisplacementPlot.py" -"vtkWarpVector","VisualizationAlgorithms/PlateVibration.py" -"vtkWarpVector","VisualizationAlgorithms/VelocityProfile.py" -"vtkWarpVector","Visualization/Blow.py" -"vtkWedge","GeometricObjects/Cell3DDemonstration.py" -"vtkWedge","GeometricObjects/LinearCellsDemo.py" -"vtkWedge","IO/WriteLegacyLinearCells.py" -"vtkWedge","IO/WriteXMLLinearCells.py" -"vtkWidgetEvent","Widgets/ContourWidget.py" -"vtkWidget","Widgets/EmbedInPyQt2.py" -"vtkWidget","Widgets/EmbedInPyQt.py" -"vtkWindowedSincPolyDataFilter","DataManipulation/MeshLabelImageColor.py" -"vtkWindowedSincPolyDataFilter","Medical/GenerateModelsFromLabels.py" -"vtkWindowedSincPolyDataFilter","Modelling/SmoothDiscreteMarchingCubes.py" -"vtkWindowedSincPolyDataFilter","Visualization/FrogBrain.py" -"vtkWindowedSincPolyDataFilter","Visualization/FroggieSurface.py" -"vtkWindowLevelLookupTable","ImageProcessing/VTKSpectrum.py" -"vtkWindowLevelLookupTable","Visualization/FrogSlice.py" -"vtkWindowToImageFilter","GeometricObjects/Cell3DDemonstration.py" -"vtkWindowToImageFilter","GeometricObjects/EarthSource.py" -"vtkWindowToImageFilter","GeometricObjects/ParametricObjectsDemo.py" -"vtkWindowToImageFilter","Images/Actor2D.py" -"vtkWindowToImageFilter","IO/ImageWriter.py" -"vtkWindowToImageFilter","Rendering/PBR_Skybox_Anisotropy.py" -"vtkWindowToImageFilter","Rendering/PBR_Skybox.py" -"vtkWindowToImageFilter","Rendering/PBR_Skybox_Texturing.py" -"vtkWindowToImageFilter","Rendering/WalkCow.py" -"vtkWindowToImageFilter","Utilities/Screenshot.py" -"vtkWindowToImageFilter","Visualization/Hanoi.py" -"vtkXMLDataSetWriter","IO/WriteXMLLinearCells.py" -"vtkXMLImageDataReader","ImageData/WriteReadVtkImageData.py" -"vtkXMLImageDataReader","IO/ReadImageData.py" -"vtkXMLImageDataWriter","ImageData/WriteReadVtkImageData.py" -"vtkXMLPolyDataReader","Deprecated/Geovis/GeoGraticle.py" -"vtkXMLPolyDataReader","IO/ReadPolyData.py" -"vtkXMLPolyDataReader","IO/ReadVTP.py" -"vtkXMLpoly_dataReader","Meshes/CapClip.py" -"vtkXMLPolyDataReader","Meshes/Decimation.py" -"vtkXMLPolyDataReader","PolyData/AlignTwoPolyDatas.py" -"vtkXMLPolyDataReader","PolyData/BooleanOperationPolyDataFilter.py" -"vtkXMLPolyDataReader","PolyData/CellsInsideObject.py" -"vtkXMLPolyDataReader","PolyData/ClosedSurface.py" -"vtkXMLPolyDataReader","PolyData/Curvatures.py" -"vtkXMLPolyDataReader","Rendering/GradientBackground.py" -"vtkXMLPolyDataReader","Rendering/Rotations.py" -"vtkXMLpoly_dataReader","Rendering/Shadows.py" -"vtkXMLpoly_dataReader","Utilities/SaveSceneToFieldData.py" -"vtkXMLpoly_dataReader","Utilities/SaveSceneToFile.py" -"vtkXMLPolyDataReader","VisualizationAlgorithms/AnatomicalOrientation.py" -"vtkXMLPolyDataReader","VisualizationAlgorithms/CutWithCutFunction.py" -"vtkXMLPolyDataReader","VisualizationAlgorithms/CutWithScalars.py" -"vtkXMLPolyDataReader","Visualization/AssignCellColorsFromLUT.py" -"vtkXMLPolyDataReader","Visualization/NormalsDemo.py" -"vtkXMLPolyDataReader","Widgets/CameraOrientationWidget.py" -"vtkXMLPolyDataReader","Widgets/ImplicitPlaneWidget2.py" -"vtkXMLPolyDataReader","Widgets/OrientationMarkerWidget1.py" -"vtkXMLPolyDataWriter","Arrays/RenameArray.py" -"vtkXMLPolyDataWriter","IO/CSVReadEdit1.py" -"vtkXMLPolyDataWriter","IO/CSVReadEdit.py" -"vtkXMLPolyDataWriter","IO/WriteTriangleToFile.py" -"vtkXMLPolyDataWriter","Medical/GenerateModelsFromLabels.py" -"vtkXMLPolyDataWriter","PolyData/ColoredTriangle.py" -"vtkXMLPolyDataWriter","PolyData/CurvaturesAdjustEdges.py" -"vtkXMLPolyDataWriter","PolyData/Curvatures.py" -"vtkXMLPolyDataWriter","PolyData/PolyDataContourToImageData.py" -"vtkXMLPolyDataWriter","PolyData/SolidColoredTriangle.py" -"vtkXMLPolyDataWriter","PolyData/TriangleColoredPoints.py" -"vtkXMLPolyDataWriter","PolyData/TriangleCorners.py" -"vtkXMLPolyDataWriter","PolyData/TriangleCornerVertices.py" -"vtkXMLPolyDataWriter","Visualization/AssignCellColorsFromLUT.py" -"vtkXMLUnstructuredGridReader","ExplicitStructuredGrid/LoadESGrid.py" -"vtkXMLUnstructuredGridReader","IO/ReadUnstructuredGrid.py" -"vtkXMLUnstructuredGridWriter","GeometricObjects/Polyhedron.py" -"vtkXMLUnstructuredGridWriter","Graphs/NOVCAGraph.py" diff --git a/data/examples/pp/vtk b/data/examples/pp/vtk deleted file mode 100644 index 0819602..0000000 --- a/data/examples/pp/vtk +++ /dev/null @@ -1,7798 +0,0 @@ - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBohemianDome()) --- - textProperty = vtk.vtkTextProperty() - textProperty.SetFontSize(12) - textProperty.SetJustificationToCentered() - - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - # Create a parametric function source, renderer, mapper, and actor - # for each object - for i in range(0, len(parametricObjects)): --- - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects Demonstration2") - renderWindow.SetSize(rendererSize * xGridDimensions, - rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): --- - ren = vtk.vtkRenderer() - ren.SetBackground(colors.GetColor3d("BkgColor")) - ren.SetViewport(viewport) - renderWindow.AddRenderer(ren) - continue - --- - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - --- - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBoy()) --- - inputPoints = vtk.vtkPoints() - rng = vtk.vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - for i in range(0, 10): - rng.Next() - x = rng.GetRangeValue(0.0, 1.0) - rng.Next() --- - textProperty = vtk.vtkTextProperty() - textProperty.SetFontSize(12) - textProperty.SetJustificationToCentered() - - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - # Create a parametric function source, renderer, mapper, and actor - # for each object - for i in range(0, len(parametricObjects)): --- - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects Demonstration") - renderWindow.SetSize(rendererSize * xGridDimensions, rendererSize * yGridDimensions) - for row in range(0, yGridDimensions): - for col in range(0, xGridDimensions): - index = row * xGridDimensions + col --- - ren = vtk.vtkRenderer() - ren.SetBackground(colors.GetColor3d("BkgColor")) - ren.SetViewport(viewport) - renderWindow.AddRenderer(ren) - continue - --- - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderWindow.Render() - interactor.Start() - --- - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - # Uncomment one of the following. - # parametricObject = vtk.vtkParametricBoy() - # parametricObject = vtk.vtkParametricConicSpiral() - # parametricObject = vtk.vtkParametricCrossCap() - # parametricObject = vtk.vtkParametricDini() - # parametricObject = vtk.vtkParametricEllipsoid() - # parametricObject = vtk.vtkParametricEnneper() - parametricObject = vtk.vtkParametricFigure8Klein() - # parametricObject = vtk.vtkParametricKlein() - # parametricObject = vtk.vtkParametricMobius() - # parametricObject = vtk.vtkParametricRandomHills() - # parametricObject = vtk.vtkParametricRoman() - # parametricObject = vtk.vtkParametricSpline() - # parametricObject = vtk.vtkParametricSuperEllipsoid() - # parametricObject = vtk.vtkParametricSuperToroid() - # parametricObject = vtk.vtkParametricTorus() - - parametricFunctionSource = vtk.vtkParametricFunctionSource() - parametricFunctionSource.SetParametricFunction(parametricObject) - parametricFunctionSource.Update() - - # Visualize - backProperty = vtk.vtkProperty() - backProperty.SetColor(colors.GetColor3d("Tomato")) - - mapper = vtk.vtkPolyDataMapper() - mapper.SetInputConnection(parametricFunctionSource.GetOutputPort()) - - # Create an actor for the contours - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - actor.SetBackfaceProperty(backProperty) - renderer = vtk.vtkRenderer() - renderWindow = vtk.vtkRenderWindow() - renderWindow.SetWindowName("Parametric Objects") - renderWindow.AddRenderer(renderer) - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("BkgColor")) - --- - colors = vtk.vtkNamedColors() - - g = vtk.vtkMutableDirectedGraph() - latitude = vtk.vtkDoubleArray() - latitude.SetName('latitude') - longitude = vtk.vtkDoubleArray() - longitude.SetName('longitude') - for i in range(-90, 90, 10): - for j in range(-180, 180, 20): - g.AddVertex() - latitude.InsertNextValue(i) --- - assign = vtk.vtkGeoAssignCoordinates() - assign.SetInputData(g) - - assign.SetLatitudeArrayName('latitude') - assign.SetLongitudeArrayName('longitude') - assign.SetGlobeRadius(1.0) --- - mapper = vtk.vtkGraphMapper() - mapper.SetInputConnection(assign.GetOutputPort()) - actor = vtk.vtkActor() - actor.SetMapper(mapper) - ren = vtk.vtkRenderer() - ren.AddActor(actor) - iren = vtk.vtkRenderWindowInteractor() - renWin = vtk.vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetInteractor(iren) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) - ren.ResetCamera() - ren.GetActiveCamera().SetPosition(-1.02, -4.6, 3.45) --- - colors = vtk.vtkNamedColors() - - geoGraticle = vtk.vtkGeoGraticule() - transformProjection = vtk.vtkGeoTransform() - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() - transformGraticle = vtk.vtkTransformFilter() - - reader = vtk.vtkXMLPolyDataReader() - transformReader = vtk.vtkTransformFilter() - graticleMapper = vtk.vtkPolyDataMapper() - readerMapper = vtk.vtkPolyDataMapper() - graticleActor = vtk.vtkActor() - readerActor = vtk.vtkActor() - - geoGraticle.SetGeometryType(geoGraticle.POLYLINES) - geoGraticle.SetLatitudeLevel(2) - geoGraticle.SetLongitudeLevel(2) - geoGraticle.SetLongitudeBounds(-180, 180) --- - renderWindow = vtk.vtkRenderWindow() - renderer = vtk.vtkRenderer() - interactor = vtk.vtkRenderWindowInteractor() - renderWindow.SetInteractor(interactor) - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderer.SetBackground(colors.GetColor3d('BurlyWood')) - --- - description = 'Building a graph using Unstructured Grid & dumping it into a vtk file.' - epilogue = ''' - Building a graph using Unstructured Grid & dumping it into a vtk file, to be visualized using ParaView. - - The generated file can then be used in ParaView/VisIt. - ''' --- - parser.add_argument('filename', help='A required vtk filename, e.g. vertex.vtu.', nargs='?', const='vertex.vtu', - type=str, default='testVertex.vtu') - args = parser.parse_args() - return args.filename - - --- - pointSource = vtkPointSource() - pointSource.Update() - - # Create an integer array to store vertex id data & link it with its degree value as a scalar. - degree = vtkIntArray() - degree.SetNumberOfComponents(1) - degree.SetName('degree') - degree.SetNumberOfTuples(7) - degree.SetValue(0, 2) - degree.SetValue(1, 1) --- - Points = vtkPoints() - Points.InsertNextPoint(0, 1, 0) - Points.InsertNextPoint(0, 0, 0) - Points.InsertNextPoint(1, 1, 0) - Points.InsertNextPoint(1, 0, 0) - Points.InsertNextPoint(2, 1, 0) --- - line = vtkCellArray() - line.Allocate(8) - line.InsertNextCell(2) - line.InsertCellPoint(0) - line.InsertCellPoint(1) - line.InsertNextCell(2) --- - G = vtkUnstructuredGrid() - G.GetPointData().SetScalars(degree) - G.SetPoints(Points) - G.SetCells(VTK_LINE, line) - - # Dump the graph in VTK unstructured format (.vtu) - gw = vtkXMLUnstructuredGridWriter() - gw.SetFileName(fn) - gw.SetInputData(G) - gw.Write() - print('---> ') - --- - parser.add_argument('filename', help='A required vtk filename, e.g. writeImageData.vti.', nargs='?', - const='writeImageData.vti', - type=str, default='writeImageData.vti') - args = parser.parse_args() - return args.filename - --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - imageData = vtkImageData() - imageData.SetDimensions(3, 4, 5) - imageData.AllocateScalars(VTK_DOUBLE, 1) - - dims = imageData.GetDimensions() - --- - writer = vtkXMLImageDataWriter() - writer.SetFileName(filename) - writer.SetInputData(imageData) - writer.Write() - - # Read the file (to test that it was written correctly) - reader = vtkXMLImageDataReader() - reader.SetFileName(filename) - reader.Update() - - # Convert the image to a polydata - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort()) - imageDataGeometryFilter.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(3) - - # Setup rendering - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('White')) - renderer.ResetCamera() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - - renderWindowInteractor = vtkRenderWindowInteractor() - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() - renderWindowInteractor.Start() - --- - poly_data = vtkPolyData() - points = vtkPoints() - points.SetData(numpy_support.numpy_to_vtk(xyz)) - poly_data.SetPoints(points) - - # Set an index - idx = numpy_support.numpy_to_vtk(elev) - idx.SetName('Index') - poly_data.GetPointData().AddArray(idx) - - # We use the elevation as the active scalars. - scal = numpy_support.numpy_to_vtk(elev) - scal.SetName('Elevation(m)') - poly_data.GetPointData().SetScalars(scal) - poly_data.GetPointData().SetActiveScalars('Elevation(m)') - elev_range = poly_data.GetPointData().GetScalars().GetRange() - --- - poly_line = vtkPolyLine() - poly_line.GetPointIds().SetNumberOfIds(num_pts) - for i in range(0, num_pts): - poly_line.GetPointIds().SetId(i, i) - - # Create a cell array to store the lines in and add the lines to it. - cells = vtkCellArray() - cells.InsertNextCell(poly_line) - - # Add the lines to the dataset - poly_data.SetLines(cells) - --- - transform = vtkTransform() - if utm: - # Scale the elevation. - transform.Scale(1, 1, 1) - if ecef: - # Rotate the ECEF coordinates --- - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputDataObject(poly_data) - transform_filter.SetTransform(transform) - transform_filter.Update() - - if vtp: - writer = vtkXMLPolyDataWriter() - writer.SetFileName(vtp_fn) - writer.SetInputConnection(transform_filter.GetOutputPort()) - writer.SetDataModeToBinary() - writer.Write() - - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - lut = get_diverging_lut('cool_warm') - # lut = get_diverging_lut1('DarkRed', 'Gainsboro', 'Green') - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(transform_filter.GetOutputPort()) - mapper.SetScalarRange(elev_range) - mapper.SetLookupTable(lut) - mapper.ScalarVisibilityOn() - - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 1024 - window_height = 1024 - --- - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle('Elevation') - scalar_bar.UnconstrainedFontSizeOff() - scalar_bar.SetNumberOfLabels(6) - scalar_bar.SetVerticalTitleSeparation(50) --- - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(window_width, window_height) - if ecef: - ren_win.SetWindowName('ECEF') - elif utm: --- - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer.AddActor(actor) - renderer.AddActor(scalar_bar) - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - cam_orient_manipulator.On() - - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') - axes.SetYAxisLabelText('North') - # Zenith - axes.SetZAxisLabelText('Zenith') - - widget = vtkOrientationMarkerWidget() - rgba = [0] * 4 - colors.GetColor('Carrot', rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(iren) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - cm = color_maps[color_map] - - ctf.AddRGBPoint(0.0, *cm['start']) - ctf.AddRGBPoint(0.5, *cm['mid']) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) - p3 = [1.0] + list(colors.GetColor3d(end)) - ctf.AddRGBPoint(*p1) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - colors = vtk.vtkNamedColors() - - file_name = get_program_parameters() - - # Read the source file. - reader = vtk.vtkXMLUnstructuredGridReader() - reader.SetFileName(file_name) - reader.Update() # Needed because of GetScalarRange - output = reader.GetOutput() - # scalar_range = output.GetScalarRange() - --- - mapper = vtk.vtkDataSetMapper() - mapper.SetInputData(output) - # mapper.SetScalarRange(scalar_range) - mapper.ScalarVisibilityOff() - - # Create the Actor - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetLineWidth(2.0) - actor.GetProperty().SetColor(colors.GetColor3d("MistyRose")) - - backface = vtk.vtkProperty() - backface.SetColor(colors.GetColor3d('Tomato')) - actor.SetBackfaceProperty(backface) - - # Create the Renderer - renderer = vtk.vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Wheat')) - - # Create the RendererWindow - renderer_window = vtk.vtkRenderWindow() - renderer_window.SetSize(640, 480) - renderer_window.AddRenderer(renderer) - renderer_window.SetWindowName('ReadUnstructuredGrid') - - # Create the RendererWindowInteractor and display the vtk_file - interactor = vtk.vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderer_window) - interactor.Initialize() - interactor.Start() - - --- - writer = vtkUnstructuredGridWriter() - writer.SetFileName(filenames[i]) - writer.SetInputData(uGrids[i]) - writer.Write() - - --- - ug = vtkUnstructuredGrid() - ug.SetPoints(aCell.GetPoints()) - ug.InsertNextCell(aCell.GetCellType(), aCell.GetPointIds()) - return ug - - --- - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(0, 0, 1) - points.InsertNextPoint(1, 0, .4) --- - polyVertex = vtkPolyVertex() - polyVertex.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyVertex.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyVertex.GetCellType(), polyVertex.GetPointIds()) - - return ug - --- - points = vtkPoints() - points.InsertNextPoint(0, .5, 0) - points.InsertNextPoint(.5, 0, 0) - points.InsertNextPoint(1, .3, 0) - points.InsertNextPoint(1.5, .4, 0) - points.InsertNextPoint(2.0, .4, 0) --- - polyline = vtkPolyLine() - polyline.GetPointIds().SetNumberOfIds(numberOfVertices) - - for i in range(0, numberOfVertices): - polyline.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polyline.GetCellType(), polyline.GetPointIds()) - - return ug - --- - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(.5, 1, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(1.5, .8, 0) - points.InsertNextPoint(2.0, -.1, 0) --- - trianglestrip = vtkTriangleStrip() - trianglestrip.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - trianglestrip.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(trianglestrip.GetCellType(), trianglestrip.GetPointIds()) - - return ug - --- - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, -.1, 0) - points.InsertNextPoint(.8, .5, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(.6, 1.2, 0) --- - polygon = vtkPolygon() - polygon.GetPointIds().SetNumberOfIds(numberOfVertices) - for i in range(0, numberOfVertices): - polygon.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(polygon.GetCellType(), polygon.GetPointIds()) - - return ug - --- - colors = vtkNamedColors() - backgroundColor = colors.GetColor3d('steel_blue') - boundaryColor = colors.GetColor3d('Banana') - clipColor = colors.GetColor3d('Tomato') - - if filePath and os.path.isfile(filePath): --- - plane = vtkPlane() - plane.SetOrigin(polyData.GetCenter()) - plane.SetNormal(1.0, -1.0, -1.0) - - clipper = vtkClipPolyData() - clipper.SetInputData(polyData) - clipper.SetClipFunction(plane) - clipper.SetValue(0) - clipper.Update() - --- - clipMapper = vtkDataSetMapper() - clipMapper.SetInputData(polyData) - - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(clipColor) - clipActor.GetProperty().SetInterpolationToFlat() - clipActor.GetProperty().EdgeVisibilityOn() - --- - boundaryEdges = vtkFeatureEdges() - boundaryEdges.SetInputData(polyData) - boundaryEdges.BoundaryEdgesOn() - boundaryEdges.FeatureEdgesOff() - boundaryEdges.NonManifoldEdgesOff() - boundaryEdges.ManifoldEdgesOff() --- - boundaryStrips = vtkStripper() - boundaryStrips.SetInputConnection(boundaryEdges.GetOutputPort()) - boundaryStrips.Update() - - # Change the polylines into polygons - boundaryPoly = vtkPolyData() - boundaryPoly.SetPoints(boundaryStrips.GetOutput().GetPoints()) - boundaryPoly.SetPolys(boundaryStrips.GetOutput().GetLines()) - - boundaryMapper = vtkPolyDataMapper() - boundaryMapper.SetInputData(boundaryPoly) - - boundaryActor = vtkActor() - boundaryActor.SetMapper(boundaryMapper) - boundaryActor.GetProperty().SetDiffuseColor(boundaryColor) - - # create renderer render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # set background color and size - renderer.SetBackground(backgroundColor) - renderWindow.SetSize(640, 480) --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - source = vtkSphereSource() - source.SetThetaResolution(20) - source.SetPhiResolution(11) - source.Update() - return source.GetOutput() - --- - colors = vtkNamedColors() - backFaceColor = colors.GetColor3d('Gold') - inputActorColor = colors.GetColor3d('NavajoWhite') - decimatedActorColor = colors.GetColor3d('NavajoWhite') - # colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) - # colors.SetColor('rightBkg', [0.4, 0.5, 0.6, 1.0]) --- - triangles = vtkTriangleFilter() - triangles.SetInputData(readerPD) - triangles.Update() - inputPolyData = triangles.GetOutput() - else: - inputPolyData = GetSpherePD() --- - decimate = vtkDecimatePro() - decimate.SetInputData(inputPolyData) - decimate.SetTargetReduction(reduction) - decimate.PreserveTopologyOn() - decimate.Update() - - decimated = vtkPolyData() - decimated.ShallowCopy(decimate.GetOutput()) - - print('After decimation') - print(f'There are {decimated.GetNumberOfPoints()} points.') - print(f'There are {decimated.GetNumberOfPolys()} polygons.') --- - inputMapper = vtkPolyDataMapper() - inputMapper.SetInputData(inputPolyData) - - backFace = vtkProperty() - backFace.SetColor(backFaceColor) - - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.GetProperty().SetInterpolationToFlat() - inputActor.GetProperty().SetColor(inputActorColor) - inputActor.SetBackfaceProperty(backFace) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputData(decimated) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(decimatedActorColor) - decimatedActor.GetProperty().SetInterpolationToFlat() - decimatedActor.SetBackfaceProperty(backFace) - --- - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) - renderWindow.SetWindowName('Decimation'); - - # And one interactor - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Define viewport ranges - # (xmin, ymin, xmax, ymax) - leftViewport = [0.0, 0.0, 0.5, 1.0] --- - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) - # leftRenderer.SetBackground((colors.GetColor3d('leftBkg'))) - leftRenderer.SetBackground((colors.GetColor3d('Peru'))) - - rightRenderer = vtkRenderer() - renderWindow.AddRenderer(rightRenderer) - rightRenderer.SetViewport(rightViewport) - # rightRenderer.SetBackground((colors.GetColor3d('rightBkg'))) - rightRenderer.SetBackground((colors.GetColor3d('CornflowerBlue'))) - --- - camera = vtkCamera() - camera.SetPosition(0, -1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Elevation(30) - camera.Azimuth(30) --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - source = vtkSphereSource() - source.SetThetaResolution(30) - source.SetPhiResolution(15) - source.Update() - return source.GetOutput() - --- - use_flying_edges = vtk_version_ok(8, 2, 0) - - colors = vtkNamedColors() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - --- - reader = vtkStructuredPointsReader() - reader.SetFileName(file_name) - - # Create a 3D model using flying edges or marching cubes - if use_flying_edges: - try: - mc = vtkFlyingEdges3D() - except AttributeError: - mc = vtkMarchingCubes() - else: - mc = vtkMarchingCubes() - - mc.SetInputConnection(reader.GetOutputPort()) - mc.ComputeNormalsOn() - mc.ComputeGradientsOn() - mc.SetValue(0, threshold) # second value acts as threshold --- - confilter = vtkPolyDataConnectivityFilter() - confilter.SetInputConnection(mc.GetOutputPort()) - confilter.SetExtractionModeToLargestRegion() - - # Create a mapper - mapper = vtkPolyDataMapper() - if largest_surface: - mapper.SetInputConnection(confilter.GetOutputPort()) - else: - mapper.SetInputConnection(mc.GetOutputPort()) - mapper.ScalarVisibilityOff() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('SkinColor')) - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - actor.SetBackfaceProperty(back_prop) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renderer.GetActiveCamera().SetViewUp(0.0, 0.0, 1.0) - renderer.GetActiveCamera().SetPosition(0.0, 1.0, 0.0) - renderer.GetActiveCamera().SetFocalPoint(0.0, 0.0, 0.0) --- - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(640, 480) - ren_win.SetWindowName('ExtractLargestIsosurface') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - ren_win.Render() - iren.Initialize() - iren.Start() - --- - description = 'Reads a structured points dataset stored in a .vtk file and constructs a 3D model.' - epilogue = ''' - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('filename', help='E.g. brain.vtk.') - parser.add_argument('threshold', type=int, help='The threshold, e.g. 50.') - parser.add_argument('-a', action='store_false', default=True, help='Extract all surfaces.') - args = parser.parse_args() - return args.filename, args.threshold, args.a - --- - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: --- - colors = vtkNamedColors() - - reader = vtkDataObjectReader() - reader.SetFileName(ifn) - - size = 3187 # maximum number possible - - xAxis = 'INTEREST_RATE' --- - do2ds = vtkDataObjectToDataSetFilter() - do2ds.SetInputConnection(reader.GetOutputPort()) - do2ds.SetDataSetTypeToPolyData() - # format: component#, arrayname, arraycomp, minArrayId, maxArrayId, normalize - do2ds.DefaultNormalizeOn() - do2ds.SetPointComponent(0, xAxis, 0) --- - fd2ad = vtkFieldDataToAttributeDataFilter() - fd2ad.SetInputConnection(do2ds.GetOutputPort()) - fd2ad.SetInputFieldToDataObjectField() - fd2ad.SetOutputAttributeDataToPointData() - fd2ad.DefaultNormalizeOn() - fd2ad.SetScalarComponent(0, scalar, 0) --- - popSplatter = vtkGaussianSplatter() - popSplatter.SetInputConnection(fd2ad.GetOutputPort()) - popSplatter.SetSampleDimensions(150, 150, 150) - popSplatter.SetRadius(0.05) - popSplatter.ScalarWarpingOff() - - popSurface = vtkMarchingContourFilter() - popSurface.SetInputConnection(popSplatter.GetOutputPort()) - popSurface.SetValue(0, 0.01) - popMapper = vtkPolyDataMapper() - popMapper.SetInputConnection(popSurface.GetOutputPort()) - popMapper.ScalarVisibilityOff() - popActor = vtkActor() - popActor.SetMapper(popMapper) - popActor.GetProperty().SetOpacity(0.3) - popActor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Construct the pipeline for the delinquent population. - lateSplatter = vtkGaussianSplatter() - lateSplatter.SetInputConnection(fd2ad.GetOutputPort()) - lateSplatter.SetSampleDimensions(150, 150, 150) - lateSplatter.SetRadius(0.05) - lateSplatter.SetScaleFactor(0.05) - - lateSurface = vtkMarchingContourFilter() - lateSurface.SetInputConnection(lateSplatter.GetOutputPort()) - lateSurface.SetValue(0, 0.01) - lateMapper = vtkPolyDataMapper() - lateMapper.SetInputConnection(lateSurface.GetOutputPort()) - lateMapper.ScalarVisibilityOff() - lateActor = vtkActor() - lateActor.SetMapper(lateMapper) - lateActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Create the axes. - popSplatter.Update() --- - axes = vtkAxes() - axes.SetOrigin(bounds[0], bounds[2], bounds[4]) - axes.SetScaleFactor(popSplatter.GetOutput().GetLength() / 5.0) - axesTubes = vtkTubeFilter() - axesTubes.SetInputConnection(axes.GetOutputPort()) - axesTubes.SetRadius(axes.GetScaleFactor() / 25.0) - axesTubes.SetNumberOfSides(6) - axesMapper = vtkPolyDataMapper() - axesMapper.SetInputConnection(axesTubes.GetOutputPort()) - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Label the axes. - XText = vtkVectorText() - XText.SetText(xAxis) - XTextMapper = vtkPolyDataMapper() - XTextMapper.SetInputConnection(XText.GetOutputPort()) - - XActor = vtkFollower() - XActor.SetMapper(XTextMapper) - XActor.SetScale(0.02, .02, .02) - XActor.SetPosition(0.35, -0.05, -0.05) - XActor.GetProperty().SetColor(0, 0, 0) - - YText = vtkVectorText() - YText.SetText(yAxis) - - YTextMapper = vtkPolyDataMapper() - YTextMapper.SetInputConnection(YText.GetOutputPort()) - YActor = vtkFollower() - YActor.SetMapper(YTextMapper) - YActor.SetScale(0.02, .02, .02) - YActor.SetPosition(-0.05, 0.35, -0.05) - YActor.GetProperty().SetColor(0, 0, 0) - - ZText = vtkVectorText() - ZText.SetText(zAxis) - ZTextMapper = vtkPolyDataMapper() - ZTextMapper.SetInputConnection(ZText.GetOutputPort()) - ZActor = vtkFollower() - ZActor.SetMapper(ZTextMapper) - ZActor.SetScale(0.02, .02, .02) - ZActor.SetPosition(-0.05, -0.05, 0.35) - ZActor.GetProperty().SetColor(0, 0, 0) - --- - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('FinanceFieldData') - - # Add the actors to the renderer, set the background and size. - renderer.AddActor(axesActor) --- - camera = vtkCamera() - camera.SetClippingRange(.274, 13.72) - camera.SetFocalPoint(0.433816, 0.333131, 0.449) - camera.SetPosition(-1.96987, 1.15145, 1.49053) - camera.SetViewUp(0.378927, 0.911821, 0.158107) - renderer.SetActiveCamera(camera) --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - renderWindow.Render() - interactor.Start() - - --- - description = 'How to align two vtkPolyData\'s.' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) --- - colors = vtkNamedColors() - - src_fn, tgt_fn = get_program_parameters() - print('Loading source:', src_fn) - source_polydata = read_poly_data(src_fn) - # Save the source polydata in case the alignment process does not improve --- - original_source_polydata = vtkPolyData() - original_source_polydata.DeepCopy(source_polydata) - - print('Loading target:', tgt_fn) - target_polydata = read_poly_data(tgt_fn) - --- - trnf = vtkTransform() - if Path(src_fn).name == 'Grey_Nurse_Shark.stl' and Path(tgt_fn).name == 'greatWhite.stl': - trnf.RotateY(90) - - tpd = vtkTransformPolyDataFilter() - tpd.SetTransform(trnf) - tpd.SetInputData(target_polydata) - tpd.Update() - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - - distance = vtkHausdorffDistancePointSetFilter() - distance.SetInputData(0, tpd.GetOutput()) - distance.SetInputData(1, source_polydata) - distance.Update() - - distance_before_align = distance.GetOutput(0).GetFieldData().GetArray('HausdorffDistance').GetComponent(0, 0) --- - icp = vtkIterativeClosestPointTransform() - icp.SetSource(source_polydata) - icp.SetTarget(tpd.GetOutput()) - icp.GetLandmarkTransform().SetModeToRigidBody() - icp.SetMaximumNumberOfLandmarks(100) - icp.SetMaximumMeanDistance(.00001) --- - transform = vtkTransformPolyDataFilter() - transform.SetInputData(source_polydata) - transform.SetTransform(lm_transform) - transform.SetTransform(icp) - transform.Update() - --- - source_mapper = vtkDataSetMapper() - if best_distance == distance_before_align: - source_mapper.SetInputData(original_source_polydata) - print('Using original alignment') - elif best_distance == distance_after_align: - source_mapper.SetInputData(source_polydata) --- - writer = vtkPolyDataWriter() - if best_distance == distance_before_align: - writer.SetInputData(original_source_polydata) - elif best_distance == distance_after_align: - writer.SetInputData(source_polydata) - else: --- - source_actor = vtkActor() - source_actor.SetMapper(source_mapper) - source_actor.GetProperty().SetOpacity(0.6) - source_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('White')) - renderer.AddActor(source_actor) --- - target_mapper = vtkDataSetMapper() - target_mapper.SetInputData(tpd.GetOutput()) - target_mapper.ScalarVisibilityOff() - - target_actor = vtkActor() - target_actor.SetMapper(target_mapper) - target_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('Tomato')) - renderer.AddActor(target_actor) - --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) --- - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtp": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".obj": - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".stl": - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtk": - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".g": - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - source_obb_tree = vtkOBBTree() - source_obb_tree.SetDataSet(source) - source_obb_tree.SetMaxLevel(1) - source_obb_tree.BuildLocator() - - target_obb_tree = vtkOBBTree() - target_obb_tree.SetDataSet(target) - target_obb_tree.SetMaxLevel(1) - target_obb_tree.BuildLocator() - - source_landmarks = vtkPolyData() - source_obb_tree.GenerateRepresentation(0, source_landmarks) - - target_landmarks = vtkPolyData() - target_obb_tree.GenerateRepresentation(0, target_landmarks) - - lm_transform = vtkLandmarkTransform() - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - best_distance = VTK_DOUBLE_MAX - best_points = vtkPoints() - best_distance = best_bounding_box( - "X", - target, - source, - target_landmarks, --- - lm_transform_pd = vtkTransformPolyDataFilter() - lm_transform_pd.SetInputData(source) - lm_transform_pd.SetTransform(lm_transform) - lm_transform_pd.Update() - - source.DeepCopy(lm_transform_pd.GetOutput()) --- - distance = vtkHausdorffDistancePointSetFilter() - test_transform = vtkTransform() - test_transform_pd = vtkTransformPolyDataFilter() - lm_transform = vtkLandmarkTransform() - lm_transform_pd = vtkTransformPolyDataFilter() - - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - - source_center = source_landmarks.GetCenter() --- - description = 'How to align two vtkPolyData\'s.' - epilogue = ''' - - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, - formatter_class=argparse.RawTextHelpFormatter) --- - colors = vtkNamedColors() - - operation, fn1, fn2 = get_program_parameters() - if fn1 and fn2: - poly1 = ReadPolyData(fn1) - tri1 = vtkTriangleFilter() - tri1.SetInputData(poly1) - clean1 = vtkCleanPolyData() - clean1.SetInputConnection(tri1.GetOutputPort()) - clean1.Update() - input1 = clean1.GetOutput() - - poly2 = ReadPolyData(fn2) - tri2 = vtkTriangleFilter() - tri2.SetInputData(poly2) - tri2.Update() - clean2 = vtkCleanPolyData() - clean2.SetInputConnection(tri2.GetOutputPort()) - clean2.Update() - input2 = clean2.GetOutput() - else: - sphereSource1 = vtkSphereSource() - sphereSource1.SetCenter(0.25, 0, 0) - sphereSource1.SetPhiResolution(21) - sphereSource1.SetThetaResolution(21) - sphereSource1.Update() - input1 = sphereSource1.GetOutput() --- - sphereSource2 = vtkSphereSource() - sphereSource2.Update() - input2 = sphereSource2.GetOutput() - - input1Mapper = vtkPolyDataMapper() - input1Mapper.SetInputData(input1) - input1Mapper.ScalarVisibilityOff() - input1Actor = vtkActor() - input1Actor.SetMapper(input1Mapper) - input1Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - input1Actor.GetProperty().SetSpecular(0.6) - input1Actor.GetProperty().SetSpecularPower(20) - input1Actor.SetPosition(input1.GetBounds()[1] - input1.GetBounds()[0], 0, 0) --- - input2Mapper = vtkPolyDataMapper() - input2Mapper.SetInputData(input2) - input2Mapper.ScalarVisibilityOff() - input2Actor = vtkActor() - input2Actor.SetMapper(input2Mapper) - input2Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Mint')) - input2Actor.GetProperty().SetSpecular(0.6) - input2Actor.GetProperty().SetSpecularPower(20) - input2Actor.SetPosition(-(input1.GetBounds()[1] - input1.GetBounds()[0]), 0, 0) --- - booleanOperation = vtkBooleanOperationPolyDataFilter() - if operation.lower() == 'union': - booleanOperation.SetOperationToUnion() - elif operation.lower() == 'intersection': - booleanOperation.SetOperationToIntersection() - elif operation.lower() == 'difference': --- - booleanOperationMapper = vtkPolyDataMapper() - booleanOperationMapper.SetInputConnection(booleanOperation.GetOutputPort()) - booleanOperationMapper.ScalarVisibilityOff() - - booleanOperationActor = vtkActor() - booleanOperationActor.SetMapper(booleanOperationMapper) - booleanOperationActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - booleanOperationActor.GetProperty().SetSpecular(0.6) - booleanOperationActor.GetProperty().SetSpecularPower(20) - - renderer = vtkRenderer() - renderer.AddViewProp(input1Actor) - renderer.AddViewProp(input2Actor) - renderer.AddViewProp(booleanOperationActor) - renderer.SetBackground(colors.GetColor3d('Silver')) - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - renderWindow.SetWindowName('BooleanOperationPolyDataFilter') - - viewUp = [0.0, 0.0, 1.0] --- - renWinInteractor = vtkRenderWindowInteractor() - renWinInteractor.SetRenderWindow(renderWindow) - - renderWindow.Render() - renWinInteractor.Start() - --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - transform = vtkTransform() - transform.Translate(center[0], center[1], center[2]) - transform.RotateY(90.0) - transform.Translate(-center[0], -center[1], -center[2]) - transformPD = vtkTransformPolyDataFilter() - transformPD.SetTransform(transform) - transformPD.SetInputData(polyData1) - transformPD.Update() - polyData2 = transformPD.GetOutput() - --- - select = vtkSelectEnclosedPoints() - select.SetInputData(polyData1) - select.SetSurfaceData(polyData2) - - # Extract three meshes, one completely inside, one completely - # outside and on the border between the inside and outside. --- - threshold = vtkMultiThreshold() - # Outside points have a 0 value in ALL points of a cell - outsideId = threshold.AddBandpassIntervalSet( - 0, 0, - vtkDataObject.FIELD_ASSOCIATION_POINTS, 'SelectedPoints', - 0, 1) --- - colors = vtkNamedColors() - outsideColor = colors.GetColor3d('Crimson') - insideColor = colors.GetColor3d('Banana') - borderColor = colors.GetColor3d('Mint') - surfaceColor = colors.GetColor3d('Peacock') - backgroundColor = colors.GetColor3d('Silver') --- - outsideMapper = vtkDataSetMapper() - outsideMapper.SetInputData(threshold.GetOutput().GetBlock(outsideId).GetBlock(0)) - outsideMapper.ScalarVisibilityOff() - - outsideActor = vtkActor() - outsideActor.SetMapper(outsideMapper) - outsideActor.GetProperty().SetDiffuseColor(outsideColor) - outsideActor.GetProperty().SetSpecular(.6) - outsideActor.GetProperty().SetSpecularPower(30) - --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(threshold.GetOutput().GetBlock(insideId).GetBlock(0)) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(insideColor) - insideActor.GetProperty().SetSpecular(.6) - insideActor.GetProperty().SetSpecularPower(30) - insideActor.GetProperty().EdgeVisibilityOn() --- - borderMapper = vtkDataSetMapper() - borderMapper.SetInputData(threshold.GetOutput().GetBlock(borderId).GetBlock(0)) - borderMapper.ScalarVisibilityOff() - - borderActor = vtkActor() - borderActor.SetMapper(borderMapper) - borderActor.GetProperty().SetDiffuseColor(borderColor) - borderActor.GetProperty().SetSpecular(.6) - borderActor.GetProperty().SetSpecularPower(30) - borderActor.GetProperty().EdgeVisibilityOn() --- - surfaceMapper = vtkDataSetMapper() - surfaceMapper.SetInputData(polyData2) - surfaceMapper.ScalarVisibilityOff() - - # Surface of object containing cell - surfaceActor = vtkActor() - surfaceActor.SetMapper(surfaceMapper) - surfaceActor.GetProperty().SetDiffuseColor(surfaceColor) - surfaceActor.GetProperty().SetOpacity(.1) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.SetBackground(backgroundColor) - renderer.UseHiddenLineRemovalOn() - --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - featureEdges = vtkFeatureEdges() - featureEdges.FeatureEdgesOff() - featureEdges.BoundaryEdgesOn() - featureEdges.NonManifoldEdgesOn() - featureEdges.SetInputData(polyData) - featureEdges.Update() --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - gc = vtkCurvatures() - gc.SetInputData(source) - gc.SetCurvatureTypeToGaussian() - gc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(gc.GetOutput(), 'Gauss_Curvature') --- - mc = vtkCurvatures() - mc.SetInputData(source) - mc.SetCurvatureTypeToMean() - mc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(mc.GetOutput(), 'Mean_Curvature') --- - # writer = vtkXMLPolyDataWriter() - # writer.SetFileName('Source.vtp') - # writer.SetInputData(source) - # writer.SetDataModeToBinary() - # writer.Write() - --- - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - window_width = 1024 - window_height = 512 - - ren_win = vtkRenderWindow() - ren_win.SetSize(window_width, window_height) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(24) - text_property.SetJustificationToCentered() - - lut = get_diverging_lut() - # lut = get_diverging_lut1() --- - cam_orient_manipulator = vtkCameraOrientationWidget() - has_cow = True - - curvature_types = ['Gauss_Curvature', 'Mean_Curvature'] - for idx, curvature_name in enumerate(curvature_types): - --- - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - mapper.SetScalarModeToUsePointFieldData() - mapper.SelectColorArray(curvature_name) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle(curvature_title) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetNumberOfLabels(min(5, len(freq))) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) --- - text_mapper = vtkTextMapper() - text_mapper.SetInput(curvature_title) - text_mapper.SetTextProperty(text_property) - - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(250, 16) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - - renderer.AddActor(actor) - renderer.AddActor(text_actor) - renderer.AddActor(scalar_bar) --- - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - surface = vtkParametricBour() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(0.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - points = vtkPoints() - for i in range(0, x_res): - x = x_min + i * dx - for j in range(0, y_res): - y = y_min + j * dy - points.InsertNextPoint(x, y, 0) --- - plane = vtkPolyData() - plane.SetPoints(points) - - # Triangulate the grid. - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], --- - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): --- - normals = vtkPolyDataNormals() - normals.SetInputData(polydata) - normals.SetInputData(polydata) - normals.SetFeatureAngle(30) - normals.SplittingOff() - - tr1 = vtkTransform() - tr1.RotateX(-90) - - tf1 = vtkTransformPolyDataFilter() - tf1.SetInputConnection(normals.GetOutputPort()) - tf1.SetTransform(tr1) - tf1.Update() - - return tf1.GetOutput() --- - surface = vtkParametricEnneper() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(0.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - - return tangents.GetOutput() - --- - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - colors = vtkNamedColors() - - # We are going to handle two different sources. - # The first source is a superquadric source. - torus = vtkSuperquadricSource() - torus.SetCenter(0.0, 0.0, 0.0) - torus.SetScale(1.0, 1.0, 1.0) - torus.SetPhiResolution(64) - torus.SetThetaResolution(64) - torus.SetThetaRoundness(1) --- - toroid_transform = vtkTransform() - toroid_transform.RotateX(55) - - toroid_transform_filter = vtkTransformFilter() - toroid_transform_filter.SetInputConnection(torus.GetOutputPort()) - toroid_transform_filter.SetTransform(toroid_transform) - - # The quadric is made of strips, so pass it through a triangle filter as - # the curvature filter only operates on polys - tri = vtkTriangleFilter() - tri.SetInputConnection(toroid_transform_filter.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - # The next source will be a parametric function - rh = vtkParametricRandomHills() - rh_fn_src = vtkParametricFunctionSource() - rh_fn_src.SetParametricFunction(rh) - rh_fn_src.Update() - - sources = list() - for i in range(0, 4): - cc = vtkCurvatures() - if i < 2: - cc.SetInputConnection(cleaner.GetOutputPort()) - else: - cc.SetInputConnection(rh_fn_src.GetOutputPort()) - if i % 2 == 0: --- - text_property = vtkTextProperty() - text_property.SetFontSize(24) - text_property.SetJustificationToCentered() - - # RenderWindow Dimensions - # --- - render_window = vtkRenderWindow() - render_window.SetSize(renderer_size * grid_dimensions, renderer_size * grid_dimensions) - render_window.SetWindowName('CurvaturesDemo') - - # Add and position the renders to the render window. - viewport = list() --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - render_window.Render() - - interactor.Start() --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - - source = reader.GetOutput() - - cc = vtkCurvatures() - cc.SetInputData(source) - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() - else: --- - # writer = vtkXMLPolyDataWriter() - # writer.SetFileName('Source.vtp') - # writer.SetInputData(source) - # writer.SetDataModeToAscii() - # writer.Write() - --- - color_series = vtkColorSeries() - color_series.SetColorScheme(color_map_idx) - print(f'Using color scheme #: {color_series.GetColorScheme()}, {color_series.GetColorSchemeName()}') - - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() - - # Use a color series to create a transfer function - for i in range(0, color_series.GetNumberOfColors()): - color = color_series.GetColor(i) --- - colors = vtkNamedColors() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - mapper.SetScalarModeToUsePointFieldData() - mapper.SelectColorArray(curvature) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) --- - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 800 - window_height = 800 - --- - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) - scalar_bar.SetTitle(curvature.replace('_', '\n')) - scalar_bar.UnconstrainedFontSizeOn() - scalar_bar.SetNumberOfLabels(5) - scalar_bar.SetMaximumWidthInPixels(window_width // 8) --- - renderer = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(renderer) - ren_win.SetSize(window_width, window_height) - ren_win.SetWindowName('Curvatures') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) - - if vtk_version_ok(9, 0, 20210718): - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - # Add the actors to the scene --- - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- -sphere = vtk.vtkSphereSource() -sphere.SetCenter(1, 1, 1) -sphere.SetRadius(1) -sphere.Update() - -cube = vtk.vtkCubeSource() -cube.SetBounds(-1, 1, -1, 1, -1, 1) -cube.Update() - -# Create 3D cells so vtkImplicitDataSet evaluates inside vs outside correctly -tri = vtk.vtkDelaunay3D() -tri.SetInputConnection(cube.GetOutputPort()) -tri.BoundingTriangulationOff() - -# vtkImplicitDataSet needs some scalars to interpolate to find inside/outside -elev = vtk.vtkElevationFilter() -elev.SetInputConnection(tri.GetOutputPort()) - -implicit = vtk.vtkImplicitDataSet() -implicit.SetDataSet(elev.GetOutput()) - -clipper = vtk.vtkClipPolyData() -clipper.SetClipFunction(implicit) -clipper.SetInputConnection(sphere.GetOutputPort()) -clipper.InsideOutOn() -clipper.Update() - --- -mapper = vtk.vtkPolyDataMapper() -mapper.SetInputConnection(clipper.GetOutputPort()) -actor = vtk.vtkActor() -actor.SetMapper(mapper) - -# Vis for cube so can see it in relation to clipped sphere -mapper2 = vtk.vtkDataSetMapper() -mapper2.SetInputConnection(elev.GetOutputPort()) -actor2 = vtk.vtkActor() -actor2.SetMapper(mapper2) -actor2.GetProperty().SetRepresentationToWireframe() - -ren1 = vtk.vtkRenderer() -ren1.AddActor(actor) -ren1.AddActor(actor2) -ren1.SetBackground(0.1, 0.2, 0.4) - -renWin = vtk.vtkRenderWindow() -renWin.AddRenderer(ren1) - -iren = vtk.vtkRenderWindowInteractor() -iren.SetRenderWindow(renWin) - -renWin.Render() -iren.Start() --- -tse = vtk.vtkTimeSourceExample() -ex = tse.GetExecutive() -tse.UpdateInformation() - -# inspect available time range and time steps -print(ex.GetOutputInformation()) --- -tri = vtk.vtkDataSetTriangleFilter() -tri.SetInputData(grid) -tri.SetTetrahedraOnly(1) -tri.Update() -output = tri.GetOutput() - --- -opacityFunction = vtk.vtkPiecewiseFunction() -opacityFunction.AddPoint(drange[0], 0.0) -opacityFunction.AddPoint(drange[1], 1.0) - -# Create transfer mapping scalar value to color. -colorFunction = vtk.vtkColorTransferFunction() -colorFunction.SetColorSpaceToHSV() -colorFunction.HSVWrapOff() -colorFunction.AddRGBPoint(drange[0], 0.0, 0.0, 1.0) -colorFunction.AddRGBPoint(drange[1], 1.0, 0.0, 0.0) - -volumeProperty = vtk.vtkVolumeProperty() -volumeProperty.SetScalarOpacity(opacityFunction) -volumeProperty.SetColor(colorFunction) -volumeProperty.ShadeOff() -volumeProperty.SetInterpolationTypeToLinear() -# volumeProperty.SetScalarOpacityUnitDistance(options.unit) --- -volumeMapper = vtk.vtkUnstructuredGridVolumeRayCastMapper() -# volumeMapper = vtk.vtkUnstructuredGridVolumeZSweepMapper() -# volumeMapper = vtk.vtkProjectedTetrahedraMapper() -# volumeMapper.SetBlendModeToMaximumIntensity() -volumeMapper.SetInputData(output) - -volume = vtk.vtkVolume() -volume.SetMapper(volumeMapper) -volume.SetProperty(volumeProperty) - -# create a rendering window and renderer -renderer = vtk.vtkRenderer() -renderer.SetBackground(0, 0, 0) - -window = vtk.vtkRenderWindow() -window.SetSize(512, 512) -window.AddRenderer(renderer) - -interactor = vtk.vtkRenderWindowInteractor() -interactor.SetRenderWindow(window) - -style = vtk.vtkInteractorStyleTrackballCamera() -interactor.SetInteractorStyle(style) - -renderer.AddVolume(volume) - -scalarBar = vtk.vtkScalarBarActor() -scalarBar.SetLookupTable(colorFunction) -scalarBar.SetOrientationToVertical() -scalarBar.SetPosition(0.85, 0.7) -scalarBar.SetPosition2(0.1, 0.3) -propT = vtk.vtkTextProperty() -propL = vtk.vtkTextProperty() -propT.SetFontFamilyToArial() -propT.ItalicOff() -propT.BoldOn() -propL.BoldOff() -scalarBar.SetTitleTextProperty(propT) --- -textActor = vtk.vtkTextActor() -textActor.GetTextProperty().SetFontSize(12) -textActor.SetPosition2(10, 40) -renderer.AddActor2D(textActor) -textActor.SetInput("time = ") -textActor.GetTextProperty().SetColor(1.0, 1.0, 1.0) --- - volume = vtk.vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - renderer.AddVolume(volume) - - counter = counter + 1 --- - ren_win = vtkRenderWindow() - ren_win.SetWindowName('GradientBackground') - - iren = vtkRenderWindowInteractor() - renderers = [] - - # For each gradient specify the mode. - modes = [ - vtkViewport.GradientModes.VTK_GRADIENT_VERTICAL, --- - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(pd) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Honeydew')) - actor.GetProperty().SetSpecular(0.3) - actor.GetProperty().SetSpecularPower(60.0) - --- - text_property = vtkTextProperty() - text_property.SetJustificationToCentered() - text_property.SetFontSize(ren_height // 12) - text_property.SetColor(colors.GetColor3d('MidnightBlue')) - - text_mappers = [] --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - iren.Initialize() - iren.UpdateSize(ren_width * 2, ren_height * 2) - --- - poly_data = vtkPolyData() - - if path is None: - # Default to a cone if the path is empty. - source = vtkConeSource() - source.SetResolution(25) - source.SetDirection(0, 1, 0) - source.SetHeight(1) - source.Update() - poly_data.DeepCopy(source.GetOutput()) --- - valid_suffixes = ['.g', '.obj', '.stl', '.ply', '.vtk', '.vtp'] - ext = path.suffix.lower() - if path.suffix not in valid_suffixes: - print('Warning:', path, 'unknown extension, using a sphere instead.') - source = vtkSphereSource() - source.SetPhiResolution(50) - source.SetThetaResolution(50) - source.Update() - poly_data.DeepCopy(source.GetOutput()) - else: --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.vtk': - reader = vtkPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - elif ext == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - - return poly_data --- - colors = vtkNamedColors() - - # Points start at upper right and proceed anti-clockwise. - points = vtkPoints() - points.SetNumberOfPoints(4) - points.InsertPoint(0, 1, 1, 0) - points.InsertPoint(1, 0, 1, 0) - points.InsertPoint(2, 0, 0, 0) - points.InsertPoint(3, 1, 0, 0) --- - cells = vtkCellArray() - cells.Initialize() - - if sides[0]: - # Top - top = vtkPolyLine() - top.GetPointIds().SetNumberOfIds(2) - top.GetPointIds().SetId(0, 0) - top.GetPointIds().SetId(1, 1) - cells.InsertNextCell(top) - if sides[1]: --- - left = vtkPolyLine() - left.GetPointIds().SetNumberOfIds(2) - left.GetPointIds().SetId(0, 1) - left.GetPointIds().SetId(1, 2) - cells.InsertNextCell(left) - if sides[2]: --- - bottom = vtkPolyLine() - bottom.GetPointIds().SetNumberOfIds(2) - bottom.GetPointIds().SetId(0, 2) - bottom.GetPointIds().SetId(1, 3) - cells.InsertNextCell(bottom) - if sides[3]: --- - right = vtkPolyLine() - right.GetPointIds().SetNumberOfIds(2) - right.GetPointIds().SetId(0, 3) - right.GetPointIds().SetId(1, 0) - cells.InsertNextCell(right) - --- - poly = vtkPolyData() - poly.Initialize() - poly.SetPoints(points) - poly.SetLines(cells) - - # Use normalized viewport coordinates since --- - coordinate = vtkCoordinate() - coordinate.SetCoordinateSystemToNormalizedViewport() - - mapper = vtkPolyDataMapper2D() - mapper.SetInputData(poly) - mapper.SetTransformCoordinate(coordinate) - - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(border_color)) - - # Line width should be at least 2 to be visible at extremes. - actor.GetProperty().SetLineWidth(border_width) --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - texture_map = vtkTextureMapToSphere() - texture_map.SetInputConnection(sphere.GetOutputPort()) - texture_map.PreventSeamOff() - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(texture_map.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(triangulation.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - material_reader = vtkPNGReader() - material_reader.SetFileName(parameters['material']) - - material = vtkTexture() - material.InterpolateOn() - material.SetInputConnection(material_reader.GetOutputPort()) - - albedo_reader = vtkPNGReader() - albedo_reader.SetFileName(parameters['albedo']) - - albedo = vtkTexture() - albedo.UseSRGBColorSpaceOn() - albedo.InterpolateOn() - albedo.SetInputConnection(albedo_reader.GetOutputPort()) - - normal_reader = vtkPNGReader() - normal_reader.SetFileName(parameters['normal']) - - # Uncomment this if you want a similar image to the VTK test image. - # flip = vtkImageFlip() - # flip.SetInputConnection(normal_reader.GetOutputPort()) - # flip.SetFilteredAxes(0) - - normal = vtkTexture() - normal.InterpolateOn() - normal.SetInputConnection(normal_reader.GetOutputPort()) - - coat_normal = vtkTexture() - coat_normal.InterpolateOn() - coat_normal.SetInputConnection(normal_reader.GetOutputPort()) - # Uncomment this if you want a similar image to the VTK test image. - # coat_normal.SetInputConnection(flip.GetOutputPort()) - - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness and coat strength to 1.0 as they act as multipliers --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Blue')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(triangulation.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(tangents.GetOutputPort()) - - material_reader = vtkPNGReader() - material_reader.SetFileName(parameters['material']) - - material = vtkTexture() - material.InterpolateOn() - material.SetInputConnection(material_reader.GetOutputPort()) - - albedo_reader = vtkPNGReader() - albedo_reader.SetFileName(parameters['albedo']) - - albedo = vtkTexture() - albedo.UseSRGBColorSpaceOn() - albedo.InterpolateOn() - albedo.SetInputConnection(albedo_reader.GetOutputPort()) - - normal_reader = vtkPNGReader() - normal_reader.SetFileName(parameters['normal']) - - normal = vtkTexture() - normal.InterpolateOn() - normal.SetInputConnection(normal_reader.GetOutputPort()) - - anisotropy_reader = vtkPNGReader() - anisotropy_reader.SetFileName(parameters['anisotropy']) - - anisotropy = vtkTexture() - anisotropy.InterpolateOn() - anisotropy.SetInputConnection(anisotropy_reader.GetOutputPort()) - - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness, anisotropy and anisotropyRotation --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - colors.SetColor('DarkTeal', [0, 128, 77, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - sphere = vtkSphereSource() - sphere.SetThetaResolution(75) - sphere.SetPhiResolution(75) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetRoughness(0.1) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('DarkTeal')) - actor_sphere.GetProperty().SetBaseIOR(1.0 + i / 3.0) --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() - ren_win.SetSize(600, 600) - ren_win.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - sphere = vtkSphereSource() - sphere.SetThetaResolution(100) - sphere.SetPhiResolution(100) - - pd_sphere = vtkPolyDataMapper() - pd_sphere.SetInputConnection(sphere.GetOutputPort()) - - for i in range(0, 6): - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Cyan')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # Default background color. --- - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) --- - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - # Set the model colour. --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) --- - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(img_reader.GetOutputPort()) - texture.Update() - - return texture --- - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOn() - tangents.Update() - return tangents.GetOutput() --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) --- - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - --- - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - fn, surface_name, use_cubemap, use_tonemapping = get_program_parameters() --- - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) --- - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) --- - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOn() - tangents.Update() - return tangents.GetOutput() --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) --- - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - --- - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - colors.SetColor('VTKBlue', [6, 79, 141, 255]) - # Let's make a complementary colour to VTKBlue. --- - ren1 = vtkRenderer() - # ren2 = vtkOpenGLRenderer() - ren2 = vtkRenderer() - ren1.SetBackground(colors.GetColor3d('Snow')) - ren2.SetBackground(colors.GetColor3d(parameters['bkgcolor'])) - - render_window = vtkRenderWindow() - # The order here is important. - # This ensures that the sliders will be in ren1. - render_window.AddRenderer(ren2) - render_window.AddRenderer(ren1) - ren1.SetViewport(0.0, 0.0, 0.2, 1.0) --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(render_window) - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) - passes.AddItem(overlay) - seq.SetPasses(passes) - camera_p.SetDelegatePass(seq) --- - tone_mapping_p = vtkToneMappingPass() - tone_mapping_p.SetDelegatePass(camera_p) - - if use_tonemapping: - ren2.SetPass(tone_mapping_p) - - skybox = vtkSkybox() - - irradiance = ren2.GetEnvMapIrradiance() - irradiance.SetIrradianceStep(0.3) - - # Choose how to generate the skybox. --- - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) - widget.SetInteractor(interactor) --- - ver = vtkVersion() - vtk_version_number = 10000000000 * ver.GetVTKMajorVersion() + 100000000 * ver.GetVTKMinorVersion() \ - + ver.GetVTKBuildVersion() - if vtk_version_number >= needed_version: - return True - else: --- - cube_map = vtkTexture() - cube_map.CubeMapOn() - - i = 0 - for fn in cubemap: - # Read the images. - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - texture = vtkTexture() - - suffix = fn_path.suffix.lower() - if suffix in ['.jpeg', '.jpg', '.png']: - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(img_reader.GetOutputPort(0)) - texture.Update() - - return texture --- - surface = vtkParametricBoy() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkParametricMobius() - surface.SetMinimumV(-0.25) - surface.SetMaximumV(0.25) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricRandomHills() - surface.SetRandomSeed(1) - surface.SetNumberOfHills(30) - # If you want a plane - # surface.SetHillAmplitude(0) - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkParametricTorus() - - source = vtkParametricFunctionSource() - source.SetUResolution(u_resolution) - source.SetVResolution(v_resolution) - source.GenerateTextureCoordinatesOn() - source.SetParametricFunction(surface) - source.Update() --- - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(source.GetOutputPort()) - tangents.Update() - - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(tangents.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(surface.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkTexturedSphereSource() - surface.SetThetaResolution(theta_resolution) - surface.SetPhiResolution(phi_resolution) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, 0) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(clipper.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) - tangents.Update() - return tangents.GetOutput() - - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - - # Subdivide the triangles - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) - clip_plane.SetNormal(0, -1, -1) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cleaner.GetOutputPort()) - normals.FlipNormalsOn() - normals.SetFeatureAngle(60) - - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(normals.GetOutputPort()) - tangents.ComputeCellTangentsOn() - tangents.ComputePointTangentsOff() - tangents.Update() - return tangents.GetOutput() --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) - slider.SetValue(properties.initial_value) - slider.SetTitleText(properties.title) --- - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - --- - w2if = vtkWindowToImageFilter() - w2if.SetInput(caller.GetRenderWindow()) - w2if.SetScale(self.image_quality, self.image_quality) - if self.rgba: - w2if.SetInputBufferTypeToRGBA() - else: --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() - print('Screenshot saved to:', self.path) - --- - colors = vtkNamedColors() - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - # colors.SetColor('BkgColor', [60, 93, 144, 255]) - - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - polyData = ReadPolyData(file_name) --- - modelMapper = vtkPolyDataMapper() - modelMapper.SetInputData(polyData) - - modelActor = vtkActor() - modelActor.SetMapper(modelMapper) - modelActor.GetProperty().SetDiffuseColor(colors.GetColor3d(actor_color)) - if actor_color != 'Wheat': - modelActor.GetProperty().SetSpecular(0.6) - modelActor.GetProperty().SetSpecularPower(30) --- - modelAxesSource = vtkAxes() - modelAxesSource.SetScaleFactor(10) - modelAxesSource.SetOrigin(0, 0, 0) - - modelAxesMapper = vtkPolyDataMapper() - modelAxesMapper.SetInputConnection(modelAxesSource.GetOutputPort()) - - modelAxes = vtkActor() - modelAxes.SetMapper(modelAxesMapper) - - ren1.AddActor(modelAxes) - modelAxes.VisibilityOff() - --- - help='If the color is Wheat then the vtk textbook colors are used.') - args = parser.parse_args() - return args.filename, args.figure, args.actor_color - - -def RotateX(renWin, actor): --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a sphere if the extension is unknown. - source = vtkSphereSource() - source.Update() - poly_data = source.GetOutput() - return poly_data - - --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - source = vtkSphereSource() - source.SetThetaResolution(100) - source.SetPhiResolution(100) - source.Update() - polyData = source.GetOutput() - - colors = vtkNamedColors() - colors.SetColor('HighNoonSun', [255, 255, 251, 255]) # Color temp. 5400°K - colors.SetColor('100W Tungsten', [255, 214, 170, 255]) # Color temp. 2850°K - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) - - renderWindow = vtkRenderWindow() - renderWindow.SetSize(640, 480) - renderWindow.AddRenderer(renderer) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - light1 = vtkLight() - light1.SetFocalPoint(0, 0, 0) - light1.SetPosition(0, 1, 0.2) - light1.SetColor(colors.GetColor3d('HighNoonSun')) - light1.SetIntensity(0.3) - renderer.AddLight(light1) --- - light2 = vtkLight() - light2.SetFocalPoint(0, 0, 0) - light2.SetPosition(1.0, 1.0, 1.0) - light2.SetColor(colors.GetColor3d('100W Tungsten')) - light2.SetIntensity(0.8) - renderer.AddLight(light2) --- - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('SaddleBrown')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Sienna')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecular(0.51) --- - plane = vtkCubeSource() - plane.SetCenter((bounds[1] + bounds[0]) / 2.0, - bounds[2] - thickness / 2.0, - (bounds[5] + bounds[4]) / 2.0) - plane.SetXLength(bounds[1] - bounds[0] + (rnge[0] * expand)) - plane.SetYLength(thickness) --- - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(plane.GetOutputPort()) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - renderer.AddActor(planeActor) - - renderWindow.SetMultiSamples(0) - - shadows = vtkShadowMapPass() - - seq = vtkSequencePass() - - passes = vtkRenderPassCollection() - passes.AddItem(shadows.GetShadowMapBakerPass()) - passes.AddItem(shadows) - seq.SetPasses(passes) - - cameraP = vtkCameraPass() - cameraP.SetDelegatePass(seq) - - # Tell the renderer to use our render pass pipeline - glrenderer = renderer - glrenderer.SetPass(cameraP) --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - renderWindow.SetWindowName('StripFran') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Create a cyberware source. - # - cyber = vtkPolyDataReader() - cyber.SetFileName(fileName) - - deci = vtkDecimatePro() - deci.SetInputConnection(cyber.GetOutputPort()) - deci.SetTargetReduction(0.7) - deci.PreserveTopologyOn() - - normals = vtkPolyDataNormals() - normals.SetInputConnection(deci.GetOutputPort()) - - mask = vtkMaskPolyData() - mask.SetInputConnection(deci.GetOutputPort()) - mask.SetOnRatio(2) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(mask.GetOutputPort()) - - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - stripper = vtkStripper() - stripper.SetInputConnection(cyber.GetOutputPort()) - - stripperMask = vtkMaskPolyData() - stripperMask.SetInputConnection(stripper.GetOutputPort()) - stripperMask.SetOnRatio(2) - - stripperMapper = vtkPolyDataMapper() - stripperMapper.SetInputConnection(stripperMask.GetOutputPort()) - - stripperActor = vtkActor() - stripperActor.SetMapper(stripperMapper) - stripperActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # Add the actors to the renderer, set the background and size. - # --- - cam1 = vtkCamera() - cam1.SetFocalPoint(0, 0, 0) - cam1.SetPosition(1, 0, 0) - cam1.SetViewUp(0, 1, 0) - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) --- - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - # Setup the render window, renderer, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Read the data. - - # Create the pipeline. --- - reader = vtkStructuredPointsReader() - reader.SetFileName(vec_anim_paths[0]) - - threshold = vtkThresholdPoints() - threshold.SetInputConnection(reader.GetOutputPort()) - threshold.ThresholdByUpper(200) - - line = vtkLineSource() - line.SetResolution(1) - - lines = vtkGlyph3D() - lines.SetInputConnection(threshold.GetOutputPort()) - lines.SetSourceConnection(line.GetOutputPort()) - lines.SetScaleFactor(0.005) - lines.SetScaleModeToScaleByScalar() - lines.Update() --- - vectorMapper = vtkPolyDataMapper() - vectorMapper.SetInputConnection(lines.GetOutputPort()) - vectorMapper.SetScalarRange(lines.GetOutput().GetScalarRange()) - - vectorActor = vtkActor() - vectorActor.SetMapper(vectorMapper) - vectorActor.GetProperty().SetOpacity(0.99) - vectorActor.GetProperty().SetLineWidth(1.5) - - # Outline - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Texture maps. - textureMaps = list() --- - tmap = vtkStructuredPointsReader() - tmap.SetFileName(vec_anim_paths[i]) - - texture = vtkTexture() - texture.SetInputConnection(tmap.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - textureMaps.append(texture) - --- - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) --- - parser.add_argument('filename2', help='VectorAnimation/vecAnim1.vtk.') - args = parser.parse_args() - return args.filename1, args.filename2 - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # hidden sphere - sphere1 = vtkSphereSource() - sphere1.SetRadius(0.5) - - innerMapper = vtkPolyDataMapper() - innerMapper.SetInputConnection(sphere1.GetOutputPort()) - - innerSphere = vtkActor() - innerSphere.SetMapper(innerMapper) - innerSphere.GetProperty().SetColor(colors.GetColor3d('BlanchedAlmond')) - - # sphere to texture - sphere2 = vtkSphereSource() - sphere2.SetRadius(1.0) - sphere2.SetPhiResolution(21) - sphere2.SetThetaResolution(21) - - pts = [0.0] * 6 - points = vtkPoints() - points.SetNumberOfPoints(2) - points.SetPoint(0, pts[:3]) - points.SetPoint(1, pts[3:]) - - nrms = [0.0] * 6 --- - normals = vtkDoubleArray() - normals.SetNumberOfComponents(3) - normals.SetNumberOfTuples(2) - normals.SetTuple(0, nrms[:3]) - normals.SetTuple(1, nrms[3:]) - - planes = vtkPlanes() - planes.SetPoints(points) - planes.SetNormals(normals) - - tcoords = vtkImplicitTextureCoords() - tcoords.SetInputConnection(sphere2.GetOutputPort()) - tcoords.SetRFunction(planes) - - outerMapper = vtkDataSetMapper() - outerMapper.SetInputConnection(tcoords.GetOutputPort()) - - tmap = vtkStructuredPointsReader() - tmap.SetFileName(fileName) - - texture = vtkTexture() - texture.SetInputConnection(tmap.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - - outerSphere = vtkActor() - outerSphere.SetMapper(outerMapper) - outerSphere.SetTexture(texture) - outerSphere.GetProperty().SetColor(colors.GetColor3d('LightSalmon')) - - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - aren = vtkRenderer() - iren.SetRenderWindow(renWin) - renWin.AddRenderer(aren) - - aren.AddActor(innerSphere) - aren.AddActor(outerSphere) --- - parser.add_argument('filename', help='texThres.vtk.') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - description = 'Use a vtkClipDataSet to clip a vtkUnstructuredGrid..' - epilogue = ''' - Use a vtkClipDataSet to clip a vtkUnstructuredGrid.. - The resulting output and clipped output are presented in yellow and red respectively. - To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each - output about their centers. --- - parser.add_argument('filename', help='treemesh.vtk') - parser.add_argument('-o', action='store_false', - help='Output using the original code.') - args = parser.parse_args() - return args.filename, args.o - --- - reader = vtkUnstructuredGridReader() - reader.SetFileName(filename) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - center = reader.GetOutput().GetCenter() --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - xnorm = [-1.0, -1.0, 1.0] - - clipPlane = vtkPlane() - clipPlane.SetOrigin(reader.GetOutput().GetCenter()) - clipPlane.SetNormal(xnorm) - - if correct_output: - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOff() - clipper.Update() --- - clipper1 = vtkClipDataSet() - clipper1.SetClipFunction(clipPlane) - clipper1.SetInputData(reader.GetOutput()) - clipper1.SetValue(0.0) - clipper1.InsideOutOn() - clipper1.GenerateClippedOutputOn() --- - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - - clippedMapper = vtkDataSetMapper() - if correct_output: - clippedMapper.SetInputData(clipper1.GetClippedOutput()) - else: - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() --- - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - --- - insideTransform = vtkTransform() - insideTransform.Translate(-(bounds[1] - bounds[0]) * 0.75, 0, 0) - insideTransform.Translate(center[0], center[1], center[2]) - insideTransform.RotateY(-120.0) - insideTransform.Translate(-center[0], -center[1], -center[2]) - insideActor.SetUserTransform(insideTransform) --- - clippedTransform = vtkTransform() - clippedTransform.Translate((bounds[1] - bounds[0]) * 0.75, 0, 0) - clippedTransform.Translate(center[0], center[1], center[2]) - if correct_output: - clippedTransform.RotateY(60.0) - else: --- - description = 'Use a vtkTableBasedClipDataSet to clip a vtkUnstructuredGrid.' - epilogue = ''' - Use a vtkTableBasedClipDataSet to clip a vtkUnstructuredGrid. - The resulting output and clipped output are presented in yellow and red respectively. - To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each - output about their centers. --- - parser.add_argument('filename', help='treemesh.vtk') - args = parser.parse_args() - return args.filename - - -def main(): --- - reader = vtkUnstructuredGridReader() - reader.SetFileName(filename) - reader.Update() - - bounds = reader.GetOutput().GetBounds() - center = reader.GetOutput().GetCenter() --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetSize(640, 480) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - xnorm = [-1.0, -1.0, 1.0] - - clipPlane = vtkPlane() - clipPlane.SetOrigin(reader.GetOutput().GetCenter()) - clipPlane.SetNormal(xnorm) - - clipper = vtkTableBasedClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - - clippedMapper = vtkDataSetMapper() - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() - - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - --- - insideTransform = vtkTransform() - insideTransform.Translate(-(bounds[1] - bounds[0]) * 0.75, 0, 0) - insideTransform.Translate(center[0], center[1], center[2]) - insideTransform.RotateY(-120.0) - insideTransform.Translate(-center[0], -center[1], -center[2]) - insideActor.SetUserTransform(insideTransform) --- - clippedTransform = vtkTransform() - clippedTransform.Translate((bounds[1] - bounds[0]) * 0.75, 0, 0) - clippedTransform.Translate(center[0], center[1], center[2]) - clippedTransform.RotateY(60.0) - clippedTransform.Translate(-center[0], -center[1], -center[2]) - clippedActor.SetUserTransform(clippedTransform) --- - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('SaveSceneToFieldData') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - cameraArray = vtkStringArray() - cameraArray.SetNumberOfValues(1) - cameraArray.SetValue(0, buffer) - cameraArray.SetName('Camera') - data.GetFieldData().AddArray(cameraArray) - --- - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindow.SetWindowName('SaveSceneToFile') - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('Silver')) - --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtp': - reader = vtkXMLpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.obj': - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.stl': - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.vtk': - reader = vtkpoly_dataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == '.g': - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - default='https://raw.githubusercontent.com/Kitware/vtk-examples/gh-pages/src/Coverage/vtk_vtk-examples_xref.json', - help='The URL for the JSON cross-reference file.') - parser.add_argument('-o', '--overwrite', action="store_true", - help='Force an initial download of the JSON cross-reference file.') - - args = parser.parse_args() --- - kv = d[vtk_class][lang].items() - except KeyError: - return None, None - if len(kv) > number: - if all_values: - samples = list(kv) --- - total_number, examples = get_examples(xref_dict, vtk_class, language, all_values=all_values, number=number, - md_fmt=md) - if examples: - if total_number <= number or all_values: - print(f'VTK Class: {vtk_class}, language: {language}\n' - f'Number of example(s): {total_number}.') --- -v = vtkVariant() -print(f"Invalid variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Copy constructor -v = vtkVariant(vtkVariant("variant")) -print(f"Copied variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Conversion constructors -v = vtkVariant(1) -print(f"Integer variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(1.0) -print(f"Float variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant("hello") -print(f"String variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(unicodeEtre) -print(f"Unicode variant: {repr(v)}, '{v.GetTypeAsString()}'") -v = vtkVariant(vtkStringArray()) -print(f"Object variant: {repr(v)}, '{v.GetTypeAsString()}'") - -# Explicit type constructor -v1 = vtkVariant(1, VTK_UNSIGNED_SHORT) -v2 = vtkVariant(2, v1.GetType()) -print(f"UShort variant: {repr(v1)}, '{v1.GetTypeAsString()}'") - -# Type checking -if v2.IsUnsignedShort(): - print("v2 is UnsignedShort") --- -a = vtkVariantArray() -a.InsertNextValue(vtkVariant()) -a.InsertNextValue(1) -a.InsertNextValue(2.0) -a.InsertNextValue("hello") -a.InsertNextValue(unicodeEtre) --- -if v2 == vtkVariant(2): - print("v2 is equal to 2") -if v2 > vtkVariant(1): - print("v2 is greater than 1") -if v2 < vtkVariant(3): - print("v2 is less than 3") -if v2 == vtkVariant("2"): - print("v2 is equal to '2'") - -# Use as a dict key (hashed as a string) -d = {vtkVariant(1): 0, vtkVariant('1'): 1, vtkVariant(): 3} -print("Index is %i" % d[vtkVariant(1.0)]) - -# -# Extra functionality from vtk.util.vtkVariant -# --- -v = vtkVariantCreate(1, 'unsigned int') - -# Value extraction -v = vtkVariant(6.0) -f = vtkVariantExtract(v) - -# Value extraction with type specified -f = vtkVariantExtract(v, 'double') - -# Casting a variant -v = vtkVariant("10") -i = vtkVariantCast(v, 'int') -print(f"Valid cast result: {repr(i)}") - -# A failed cast returns None -v = vtkVariant("hello") -i = vtkVariantCast(v, 'int') -print(f"Invalid cast result: {repr(i)}") - -# -# Comparisons and sorting: See VTK docs for more info -# --- -v1 = vtkVariant(10) -v2 = vtkVariant("10") -r = vtkVariantStrictWeakOrder(v1, v2) -print("Strict weak order (10, '10') ->", r) - -# Sorting by strict weak order, using a key function: -unsorted = [1, 2.5, vtkVariant(), "0", unicodeEtre] -l = [vtkVariant(x) for x in unsorted] -l.sort(key=vtkVariantStrictWeakOrderKey) -print("Sort by weak order ->", l) - -# Check two variants for strict equality of type and value. -b = vtkVariantStrictEquality(v1, v2) -print(f"Strict equality (10, '10') -> {b}") - -# Two special-purpose methods. -# First is identical to (v1 < v2) -b = vtkVariantLessThan(v1, v2) -# Second is identical to (v1 == v2) -b = vtkVariantEqual(v1, v2) --- - additional_modules = ['vtkInteractionStyle', 'vtkRenderingFreeType', - 'vtkRenderingContextOpenGL2', 'vtkRenderingOpenGL2', 'vtkRenderingVolumeOpenGL2', - 'vtkRenderingUI'] - comments = [ - '', - '# You may need to uncomment one or more of the following imports.', --- - use_json = not vtk_version_ok(9, 0, 20210918) - if use_json: - if not json_path: - print('modules.json (from your VTK build directory) is needed.') - return - jpath = Path(json_path) --- - vtklib = importlib.__import__('vtkmodules') - vtk_modules = sorted(vtklib.__all__) - - name_to_module = dict() - for module in vtk_modules: - try: - module_dict = importlib.import_module('vtkmodules.' + module).__dict__ - for name in module_dict: - name_to_module[name] = module - except ModuleNotFoundError: - # print(module, ' not found.') - continue --- - module = name_to_module[vtk_class] - imports[name][module].add(vtk_class) - - res = format_imports(imports) - if ofn: - path = Path(ofn) --- - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: --- - vtk_include_pattern = re.compile(r'^(vtk\S+)') - vtk_qt_include_pattern = re.compile(r'^(QVTK\S+)') - - -def get_headers_modules(json_data): - """ --- - m = Patterns.vtk_include_pattern.match(header_parts[1]) - if m: - headers[m.group(1)].add(path) - continue - m = Patterns.vtk_qt_include_pattern.match(header_parts[1]) - if m: - headers[m.group(1)].add(path) - for incl in headers: - if incl in vtk_headers_modules: - m = vtk_headers_modules[incl] - for v in m: - modules.add(v) - else: - inc_no_mod.add(incl) - inc_no_mod_headers[incl] = headers[incl] --- - modules, mod_implements, inc_no_mod, inc_no_mod_headers = get_vtk_components(jpath, paths) - - res = '\n'.join(disp_components(modules, mod_implements)) - if inc_no_mod: - res += '\n'.join(disp_missing_components(inc_no_mod, inc_no_mod_headers)) - --- - colors = vtkNamedColors() - - # We begin by creating the data we want to render. - # For this tutorial, we create a 3D-image containing three overlaping cubes. - # This data can of course easily be replaced by data from a medical CT-scan or anything else three dimensional. - # The only limit is that the data must be reduced to unsigned 8 bit or 16 bit integers. --- - dataImporter = vtkImageImport() - # The previously created array is converted to a string of chars and imported. - data_string = data_matrix.tobytes() - dataImporter.CopyImportVoidPointer(data_string, len(data_string)) - # The type of the newly imported data is set to unsigned char (uint8) - dataImporter.SetDataScalarTypeToUnsignedChar() --- - alphaChannelFunc = vtkPiecewiseFunction() - alphaChannelFunc.AddPoint(0, 0.0) - alphaChannelFunc.AddPoint(50, 0.05) - alphaChannelFunc.AddPoint(100, 0.1) - alphaChannelFunc.AddPoint(150, 0.2) - --- - colorFunc = vtkColorTransferFunction() - colorFunc.AddRGBPoint(50, 1.0, 0.0, 0.0) - colorFunc.AddRGBPoint(100, 0.0, 1.0, 0.0) - colorFunc.AddRGBPoint(150, 0.0, 0.0, 1.0) - - # The previous two classes stored properties. --- - volumeProperty = vtkVolumeProperty() - volumeProperty.SetColor(colorFunc) - volumeProperty.SetScalarOpacity(alphaChannelFunc) - - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(dataImporter.GetOutputPort()) - - # The class vtkVolume is used to pair the previously declared volume as well as the properties - # to be used when rendering that volume. - volume = vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - - # With almost everything else ready, its time to initialize the renderer and window, as well as - # creating a method for exiting the application - renderer = vtkRenderer() - renderWin = vtkRenderWindow() - renderWin.AddRenderer(renderer) - renderInteractor = vtkRenderWindowInteractor() - renderInteractor.SetRenderWindow(renderWin) - - # We add the volume to the renderer ... - renderer.AddVolume(volume) - renderer.SetBackground(colors.GetColor3d("MistyRose")) --- - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - # - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - psource = vtkPointSource() - psource.SetNumberOfPoints(25) - psource.SetCenter(133.1, 116.3, 5.0) - psource.SetRadius(2.0) - - threshold = vtkThresholdPoints() - threshold.SetInputConnection(reader.GetOutputPort()) - threshold.ThresholdByUpper(275) - - streamers = vtkStreamTracer() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(psource.GetOutputPort()) - # streamers.SetMaximumPropagationUnitToTimeUnit() - streamers.SetMaximumPropagation(100.0) - # streamers.SetInitialIntegrationStepUnitToCellLengthUnit() --- - tubes = vtkTubeFilter() - tubes.SetInputConnection(streamers.GetOutputPort()) - tubes.SetRadius(0.3) - tubes.SetNumberOfSides(6) - tubes.SetVaryRadius(0) - - lut = vtkLookupTable() - lut.SetHueRange(.667, 0.0) - lut.Build() - - streamerMapper = vtkPolyDataMapper() - streamerMapper.SetInputConnection(tubes.GetOutputPort()) - streamerMapper.SetScalarRange(scalarRange[0], scalarRange[1]) - streamerMapper.SetLookupTable(lut) - - streamerActor = vtkActor() - streamerActor.SetMapper(streamerMapper) - - # Speed contours. - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 175) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetRepresentationToWireframe() - isoActor.GetProperty().SetOpacity(0.25) - - # Outline - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Add the actors to the renderer, set the background and size. - # --- - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) --- - parser.add_argument('filename', help='carotid.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. --- - fran = vtkPolyDataReader() - fran.SetFileName(fileName1) - - # Read the corresponding texture. - textureReader = vtkPNGReader() - textureReader.SetFileName(fileName2) - - texture = vtkTexture() - texture.InterpolateOn() - texture.SetInputConnection(textureReader.GetOutputPort()) - - # We want to preserve topology (not let any cracks form). This may limit - # the total reduction possible, which we have specified at 90%. --- - deci = vtkDecimatePro() - deci.SetInputConnection(fran.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() - decimatedNormals.SetInputConnection(deci.GetOutputPort()) - decimatedNormals.FlipNormalsOn() - decimatedNormals.SetFeatureAngle(60) - - originalNormals = vtkPolyDataNormals() - originalNormals.SetInputConnection(fran.GetOutputPort()) - originalNormals.FlipNormalsOn() - originalNormals.SetFeatureAngle(60) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetAmbient(.5) - decimatedActor.GetProperty().SetDiffuse(.5) - decimatedActor.SetTexture(texture) - - originalMapper = vtkPolyDataMapper() - originalMapper.SetInputConnection(originalNormals.GetOutputPort()) - - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetAmbient(.5) - originalActor.GetProperty().SetDiffuse(.5) - originalActor.SetTexture(texture) - --- - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - renderWindow.SetWindowName('DecimateFran') - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer, set the background and size. - # - renderer1.AddActor(originalActor) --- - cam1 = vtkCamera() - cam1.SetClippingRange(0.0475572, 2.37786) - cam1.SetFocalPoint(0.052665, -0.129454, -0.0573973) - cam1.SetPosition(0.327637, -0.116299, -0.256418) - cam1.SetViewUp(-0.0225386, 0.999137, 0.034901) - renderer1.SetActiveCamera(cam1) --- - parser.add_argument('filename1', help='fran_cut.vtk') - parser.add_argument('filename2', help='fran_cut.png.') - args = parser.parse_args() - return args.filename1, args.filename2 - - --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. --- - hawaii = vtkPolyDataReader() - hawaii.SetFileName(fileName) - - # We want to preserve topology (not let any cracks form). This may limit - # the total reduction possible, which we have specified at 90%. - # - deci = vtkDecimatePro() - deci.SetInputConnection(hawaii.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() - decimatedNormals.SetInputConnection(deci.GetOutputPort()) - decimatedNormals.FlipNormalsOn() - decimatedNormals.SetFeatureAngle(60) - - decimatedMapper = vtkPolyDataMapper() - decimatedMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - decimatedActor.GetProperty().SetRepresentationToWireframe() - - originalMapper = vtkPolyDataMapper() - originalMapper.SetInputConnection(decimatedNormals.GetOutputPort()) - - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - - # Create the RenderWindow, Renderer and Interactor. - # - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) - - renderer2 = vtkRenderer() - renderer2.SetViewport(0.5, 0.0, 1.0, 1.0) - - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer1) - renderWindow.AddRenderer(renderer2) - - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renderWindow) - - # Add the actors to the renderer, set the background and size. - # - renderer1.AddActor(originalActor) --- - cam1 = vtkCamera() - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) - renderer1.ResetCamera() - cam1.Elevation(-30) - cam1.Dolly(1.2) --- - parser.add_argument('filename1', help='honolulu.vtk') - args = parser.parse_args() - return args.filename1 - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - # Read a vtk file - # - plate = vtkPolyDataReader() - plate.SetFileName(file_name) - plate.SetVectorsName("mode8") - plate.Update() - - warp = vtkWarpVector() - warp.SetInputConnection(plate.GetOutputPort()) - warp.SetScaleFactor(0.5) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(warp.GetOutputPort()) - - color = vtkVectorDot() - color.SetInputConnection(normals.GetOutputPort()) - - lut = vtkLookupTable() - MakeLUT(color_scheme, lut) - - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(color.GetOutputPort()) - plateMapper.SetLookupTable(lut) - plateMapper.SetScalarRange(-1, 1) - - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(plateActor) --- - parser.add_argument('filename', help='plate.vtk') - parser.add_argument('color_scheme', default=0, type=int, nargs='?', help='The particular color scheme to use.') - args = parser.parse_args() - return args.filename, args.color_scheme - - --- - ctf = vtkColorTransferFunction() - - if colorScheme == 1: - # Green to purple diverging. - ctf.SetColorSpaceToDiverging() - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) --- - colors = vtkNamedColors() - - # Create lines which serve as the 'seed' geometry. The lines spell the - # word 'hello'. - # - reader = vtkPolyDataReader() - reader.SetFileName(fileName) - - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputConnection(reader.GetOutputPort()) - - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - lineActor.GetProperty().SetLineWidth(3.0) - - # Create implicit model with vtkImplicitModeller. This computes a scalar --- - imp = vtkImplicitModeller() - imp.SetInputConnection(reader.GetOutputPort()) - imp.SetSampleDimensions(110, 40, 20) - imp.SetMaximumDistance(0.25) - imp.SetModelBounds(-1.0, 10.0, -1.0, 3.0, -1.0, 1.0) - - contour = vtkContourFilter() - contour.SetInputConnection(imp.GetOutputPort()) - contour.SetValue(0, 0.25) - - impMapper = vtkPolyDataMapper() - impMapper.SetInputConnection(contour.GetOutputPort()) - impMapper.ScalarVisibilityOff() - - impActor = vtkActor() - impActor.SetMapper(impMapper) - impActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - impActor.GetProperty().SetOpacity(0.5) - - # Create the usual graphics stuff. --- - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - renWin.SetWindowName('Hello') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren1.AddActor(lineActor) --- - camera = vtkCamera() - camera.SetFocalPoint(4.5, 1, 0) - camera.SetPosition(4.5, 1.0, 6.73257) - camera.SetViewUp(0, 1, 0) - - ren1.SetActiveCamera(camera) --- - parser.add_argument('filename', help='hello.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the pipeline. - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 128) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d("Banana")) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) --- - parser.add_argument('filename', help='ironProt.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - textureFile, motorFile = get_program_parameters() - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the cutting planes. - planes = vtkPlanes() - points = vtkPoints() - norms = vtkFloatArray() - - norms.SetNumberOfComponents(3) - points.InsertPoint(0, 0.0, 0.0, 0.0) - norms.InsertTuple3(0, 0.0, 0.0, 1.0) - points.InsertPoint(1, 0.0, 0.0, 0.0) --- - texReader = vtkStructuredPointsReader() - texReader.SetFileName(textureFile) - texture = vtkTexture() - texture.SetInputConnection(texReader.GetOutputPort()) - texture.InterpolateOff() - texture.RepeatOff() - - # Set up the pipelines for the parts of the motor. --- - camera = vtkCamera() - camera.SetFocalPoint(0.0286334, 0.0362996, 0.0379685) - camera.SetPosition(1.37067, 1.08629, -1.30349) - camera.SetViewAngle(17.673) - camera.SetClippingRange(1, 10) - camera.SetViewUp(-0.376306, -0.5085, -0.774482) --- - parser.add_argument('textureFile', help='The texture file: texThres2.vtk') - parser.add_argument('motorFile', help='The motor file: motor.g.') - args = parser.parse_args() - return args.textureFile, args.motorFile - - --- - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] --- - reader = vtkDataSetReader() - reader.SetFileName(fileName) - - # Create the scene. - # We generate a whole bunch of planes which correspond to - # the geometry in the analysis; tables, bookshelves and so on. - table1 = vtkStructuredGridGeometryFilter() - table1.SetInputData(reader.GetStructuredGridOutput()) - table1.SetExtent(11, 15, 7, 9, 8, 8) - mapTable1 = vtkPolyDataMapper() - mapTable1.SetInputConnection(table1.GetOutputPort()) - mapTable1.ScalarVisibilityOff() - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) - table2.SetExtent(11, 15, 10, 12, 8, 8) - mapTable2 = vtkPolyDataMapper() - mapTable2.SetInputConnection(table2.GetOutputPort()) - mapTable2.ScalarVisibilityOff() - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet1.SetExtent(15, 15, 7, 9, 0, 8) - mapFilingCabinet1 = vtkPolyDataMapper() - mapFilingCabinet1.SetInputConnection(FilingCabinet1.GetOutputPort()) - mapFilingCabinet1.ScalarVisibilityOff() - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet2.SetExtent(15, 15, 10, 12, 0, 8) - mapFilingCabinet2 = vtkPolyDataMapper() - mapFilingCabinet2.SetInputConnection(FilingCabinet2.GetOutputPort()) - mapFilingCabinet2.ScalarVisibilityOff() - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Top.SetExtent(13, 13, 0, 4, 0, 11) - mapBookshelf1Top = vtkPolyDataMapper() - mapBookshelf1Top.SetInputConnection(bookshelf1Top.GetOutputPort()) - mapBookshelf1Top.ScalarVisibilityOff() - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Bottom.SetExtent(20, 20, 0, 4, 0, 11) - mapBookshelf1Bottom = vtkPolyDataMapper() - mapBookshelf1Bottom.SetInputConnection(bookshelf1Bottom.GetOutputPort()) - mapBookshelf1Bottom.ScalarVisibilityOff() - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Front.SetExtent(13, 20, 0, 0, 0, 11) - mapBookshelf1Front = vtkPolyDataMapper() - mapBookshelf1Front.SetInputConnection(bookshelf1Front.GetOutputPort()) - mapBookshelf1Front.ScalarVisibilityOff() - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Back.SetExtent(13, 20, 4, 4, 0, 11) - mapBookshelf1Back = vtkPolyDataMapper() - mapBookshelf1Back.SetInputConnection(bookshelf1Back.GetOutputPort()) - mapBookshelf1Back.ScalarVisibilityOff() - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1LHS.SetExtent(13, 20, 0, 4, 0, 0) - mapBookshelf1LHS = vtkPolyDataMapper() - mapBookshelf1LHS.SetInputConnection(bookshelf1LHS.GetOutputPort()) - mapBookshelf1LHS.ScalarVisibilityOff() - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1RHS.SetExtent(13, 20, 0, 4, 11, 11) - mapBookshelf1RHS = vtkPolyDataMapper() - mapBookshelf1RHS.SetInputConnection(bookshelf1RHS.GetOutputPort()) - mapBookshelf1RHS.ScalarVisibilityOff() - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Top.SetExtent(13, 13, 15, 19, 0, 11) - mapBookshelf2Top = vtkPolyDataMapper() - mapBookshelf2Top.SetInputConnection(bookshelf2Top.GetOutputPort()) - mapBookshelf2Top.ScalarVisibilityOff() - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Bottom.SetExtent(20, 20, 15, 19, 0, 11) - mapBookshelf2Bottom = vtkPolyDataMapper() - mapBookshelf2Bottom.SetInputConnection(bookshelf2Bottom.GetOutputPort()) - mapBookshelf2Bottom.ScalarVisibilityOff() - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Front.SetExtent(13, 20, 15, 15, 0, 11) - mapBookshelf2Front = vtkPolyDataMapper() - mapBookshelf2Front.SetInputConnection(bookshelf2Front.GetOutputPort()) - mapBookshelf2Front.ScalarVisibilityOff() - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Back.SetExtent(13, 20, 19, 19, 0, 11) - mapBookshelf2Back = vtkPolyDataMapper() - mapBookshelf2Back.SetInputConnection(bookshelf2Back.GetOutputPort()) - mapBookshelf2Back.ScalarVisibilityOff() - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2LHS.SetExtent(13, 20, 15, 19, 0, 0) - mapBookshelf2LHS = vtkPolyDataMapper() - mapBookshelf2LHS.SetInputConnection(bookshelf2LHS.GetOutputPort()) - mapBookshelf2LHS.ScalarVisibilityOff() - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2RHS.SetExtent(13, 20, 15, 19, 11, 11) - mapBookshelf2RHS = vtkPolyDataMapper() - mapBookshelf2RHS.SetInputConnection(bookshelf2RHS.GetOutputPort()) - mapBookshelf2RHS.ScalarVisibilityOff() - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) - window.SetExtent(20, 20, 6, 13, 10, 13) - mapWindow = vtkPolyDataMapper() - mapWindow.SetInputConnection(window.GetOutputPort()) - mapWindow.ScalarVisibilityOff() - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) - outlet.SetExtent(0, 0, 9, 10, 14, 16) - mapOutlet = vtkPolyDataMapper() - mapOutlet.SetInputConnection(outlet.GetOutputPort()) - mapOutlet.ScalarVisibilityOff() - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) - inlet.SetExtent(0, 0, 9, 10, 0, 6) - mapInlet = vtkPolyDataMapper() - mapInlet.SetInputConnection(inlet.GetOutputPort()) - mapInlet.ScalarVisibilityOff() - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) - mapOutline = vtkPolyDataMapper() - mapOutline.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the source for the streamtubes. - seeds = vtkPointSource() - seeds.SetRadius(0.075) - seeds.SetCenter(seedCenters[center]) - seeds.SetNumberOfPoints(25) - streamers = vtkStreamTracer() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(seeds.GetOutputPort()) - streamers.SetMaximumPropagation(500) - streamers.SetMinimumIntegrationStep(0.1) - streamers.SetMaximumIntegrationStep(1.0) --- - mapStreamers = vtkPolyDataMapper() - mapStreamers.SetInputConnection(streamers.GetOutputPort()) - mapStreamers.SetScalarRange(reader.GetOutput().GetPointData().GetScalars().GetRange()) - streamersActor = vtkActor() - streamersActor.SetMapper(mapStreamers) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetWindowName('Office') - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the remaining actors to the renderer, set the background and size. - ren.AddActor(table1Actor) - ren.AddActor(table2Actor) --- - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) --- - description = 'Demonstrate the use of vtkPointSource to generate streamlines.' - epilogue = ''' - center: An optional parameter choosing the center for the seeds. - 0 - Corresponds to Fig 9-47(a) in the VTK textbook. - 1 - A slight shift to the left. - 2 - A slight shift to the upper left (from the original code). --- - parser.add_argument('fileName', help='office.binary.vtk') - parser.add_argument('center', default=3, type=int, nargs='?', help='seed center.') - args = parser.parse_args() - return args.fileName, args.center - - --- - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] --- - reader = vtkDataSetReader() - reader.SetFileName(fileName) - reader.Update() - - # Now we will generate a single streamline in the data. We select the - # integration order to use (RungeKutta order 4) and associate it with --- - integ = vtkRungeKutta4() - - streamer = vtkStreamTracer() - streamer.SetInputConnection(reader.GetOutputPort()) - streamer.SetStartPosition(0.1, 2.1, 0.5) - streamer.SetMaximumPropagation(500) - streamer.SetInitialIntegrationStep(0.05) - streamer.SetIntegrationDirectionToBoth() --- - streamTube = vtkTubeFilter() - streamTube.SetInputConnection(streamer.GetOutputPort()) - streamTube.SetInputArrayToProcess(1, 0, 0, vtkDataObject.FIELD_ASSOCIATION_POINTS, 'vectors') - streamTube.SetRadius(0.02) - streamTube.SetNumberOfSides(12) - streamTube.SetVaryRadiusToVaryRadiusByVector() --- - mapStreamTube = vtkPolyDataMapper() - mapStreamTube.SetInputConnection(streamTube.GetOutputPort()) - mapStreamTube.SetScalarRange(reader.GetOutput().GetPointData().GetScalars().GetRange()) - - streamTubeActor = vtkActor() - streamTubeActor.SetMapper(mapStreamTube) - streamTubeActor.GetProperty().BackfaceCullingOn() - - # Create the scene. - # We generate a whole bunch of planes which correspond to --- - table1 = vtkStructuredGridGeometryFilter() - table1.SetInputData(reader.GetStructuredGridOutput()) - table1.SetExtent(11, 15, 7, 9, 8, 8) - mapTable1 = vtkPolyDataMapper() - mapTable1.SetInputConnection(table1.GetOutputPort()) - mapTable1.ScalarVisibilityOff() - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) - table2.SetExtent(11, 15, 10, 12, 8, 8) - mapTable2 = vtkPolyDataMapper() - mapTable2.SetInputConnection(table2.GetOutputPort()) - mapTable2.ScalarVisibilityOff() - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet1.SetExtent(15, 15, 7, 9, 0, 8) - mapFilingCabinet1 = vtkPolyDataMapper() - mapFilingCabinet1.SetInputConnection(FilingCabinet1.GetOutputPort()) - mapFilingCabinet1.ScalarVisibilityOff() - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) - FilingCabinet2.SetExtent(15, 15, 10, 12, 0, 8) - mapFilingCabinet2 = vtkPolyDataMapper() - mapFilingCabinet2.SetInputConnection(FilingCabinet2.GetOutputPort()) - mapFilingCabinet2.ScalarVisibilityOff() - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Top.SetExtent(13, 13, 0, 4, 0, 11) - mapBookshelf1Top = vtkPolyDataMapper() - mapBookshelf1Top.SetInputConnection(bookshelf1Top.GetOutputPort()) - mapBookshelf1Top.ScalarVisibilityOff() - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Bottom.SetExtent(20, 20, 0, 4, 0, 11) - mapBookshelf1Bottom = vtkPolyDataMapper() - mapBookshelf1Bottom.SetInputConnection(bookshelf1Bottom.GetOutputPort()) - mapBookshelf1Bottom.ScalarVisibilityOff() - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Front.SetExtent(13, 20, 0, 0, 0, 11) - mapBookshelf1Front = vtkPolyDataMapper() - mapBookshelf1Front.SetInputConnection(bookshelf1Front.GetOutputPort()) - mapBookshelf1Front.ScalarVisibilityOff() - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1Back.SetExtent(13, 20, 4, 4, 0, 11) - mapBookshelf1Back = vtkPolyDataMapper() - mapBookshelf1Back.SetInputConnection(bookshelf1Back.GetOutputPort()) - mapBookshelf1Back.ScalarVisibilityOff() - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1LHS.SetExtent(13, 20, 0, 4, 0, 0) - mapBookshelf1LHS = vtkPolyDataMapper() - mapBookshelf1LHS.SetInputConnection(bookshelf1LHS.GetOutputPort()) - mapBookshelf1LHS.ScalarVisibilityOff() - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf1RHS.SetExtent(13, 20, 0, 4, 11, 11) - mapBookshelf1RHS = vtkPolyDataMapper() - mapBookshelf1RHS.SetInputConnection(bookshelf1RHS.GetOutputPort()) - mapBookshelf1RHS.ScalarVisibilityOff() - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Top.SetExtent(13, 13, 15, 19, 0, 11) - mapBookshelf2Top = vtkPolyDataMapper() - mapBookshelf2Top.SetInputConnection(bookshelf2Top.GetOutputPort()) - mapBookshelf2Top.ScalarVisibilityOff() - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Bottom.SetExtent(20, 20, 15, 19, 0, 11) - mapBookshelf2Bottom = vtkPolyDataMapper() - mapBookshelf2Bottom.SetInputConnection(bookshelf2Bottom.GetOutputPort()) - mapBookshelf2Bottom.ScalarVisibilityOff() - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Front.SetExtent(13, 20, 15, 15, 0, 11) - mapBookshelf2Front = vtkPolyDataMapper() - mapBookshelf2Front.SetInputConnection(bookshelf2Front.GetOutputPort()) - mapBookshelf2Front.ScalarVisibilityOff() - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2Back.SetExtent(13, 20, 19, 19, 0, 11) - mapBookshelf2Back = vtkPolyDataMapper() - mapBookshelf2Back.SetInputConnection(bookshelf2Back.GetOutputPort()) - mapBookshelf2Back.ScalarVisibilityOff() - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2LHS.SetExtent(13, 20, 15, 19, 0, 0) - mapBookshelf2LHS = vtkPolyDataMapper() - mapBookshelf2LHS.SetInputConnection(bookshelf2LHS.GetOutputPort()) - mapBookshelf2LHS.ScalarVisibilityOff() - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) - bookshelf2RHS.SetExtent(13, 20, 15, 19, 11, 11) - mapBookshelf2RHS = vtkPolyDataMapper() - mapBookshelf2RHS.SetInputConnection(bookshelf2RHS.GetOutputPort()) - mapBookshelf2RHS.ScalarVisibilityOff() - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) - window.SetExtent(20, 20, 6, 13, 10, 13) - mapWindow = vtkPolyDataMapper() - mapWindow.SetInputConnection(window.GetOutputPort()) - mapWindow.ScalarVisibilityOff() - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) - outlet.SetExtent(0, 0, 9, 10, 14, 16) - mapOutlet = vtkPolyDataMapper() - mapOutlet.SetInputConnection(outlet.GetOutputPort()) - mapOutlet.ScalarVisibilityOff() - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) - inlet.SetExtent(0, 0, 9, 10, 0, 6) - mapInlet = vtkPolyDataMapper() - mapInlet.SetInputConnection(inlet.GetOutputPort()) - mapInlet.ScalarVisibilityOff() - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) - mapOutline = vtkPolyDataMapper() - mapOutline.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the remaining actors to the renderer, set the background and size. - ren.AddActor(table1Actor) - ren.AddActor(table2Actor) --- - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) --- - parser.add_argument('fileName', help='office.binary.vtk') - args = parser.parse_args() - return args.fileName - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('PlateColor', [255, 160, 140, 255]) - colors.SetColor('BkgColor', [65, 99, 149, 255]) - --- - plate = vtkPolyDataReader() - plate.SetFileName(file_name) - plate.Update() - bounds = [0] * 6 - plate.GetOutput().GetBounds(bounds) - plate.SetVectorsName('mode2') --- - normals = vtkPolyDataNormals() - normals.SetInputConnection(plate.GetOutputPort()) - warp = vtkWarpVector() - warp.SetInputConnection(normals.GetOutputPort()) - warp.SetScaleFactor(0.5) - color = vtkVectorDot() - color.SetInputConnection(warp.GetOutputPort()) - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(warp.GetOutputPort()) - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - plateActor.GetProperty().SetColor( - colors.GetColor3d('PlateColor')) - plateActor.RotateX(-90) - --- - outline = vtkOutlineFilter() - outline.SetInputConnection(plate.GetOutputPort()) - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(outline.GetOutputPort()) - outlineActor = vtkActor() - outlineActor.SetMapper(spikeMapper) - outlineActor.RotateX(-90) - outlineActor.GetProperty().SetColor(colors.GetColor3d('White')) - - # Create the RenderWindow, Renderer and both Actors --- - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(plateActor) --- - parser.add_argument('filename', help='plate.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fran = vtkPolyDataReader() - fran.SetFileName(fileName) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(fran.GetOutputPort()) - normals.FlipNormalsOn() - - franMapper = vtkPolyDataMapper() - franMapper.SetInputConnection(normals.GetOutputPort()) - - franActor = vtkActor() - franActor.SetMapper(franMapper) - franActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # We subsample the dataset because we want to glyph just a subset of - # the points. Otherwise the display is cluttered and cannot be easily --- - ptMask = vtkMaskPoints() - ptMask.SetInputConnection(normals.GetOutputPort()) - ptMask.SetOnRatio(10) - ptMask.RandomModeOn() - - # In this case we are using a cone as a glyph. We transform the cone so --- - cone = vtkConeSource() - cone.SetResolution(6) - - transform = vtkTransform() - transform.Translate(0.5, 0.0, 0.0) - - transformF = vtkTransformPolyDataFilter() - transformF.SetInputConnection(cone.GetOutputPort()) - transformF.SetTransform(transform) - - # vtkGlyph3D takes two inputs: the input point set (SetInputConnection) - # which can be any vtkDataSet and the glyph (SetSourceConnection) which --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(ptMask.GetOutputPort()) - glyph.SetSourceConnection(transformF.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.004) --- - spikeMapper = vtkPolyDataMapper() - spikeMapper.SetInputConnection(glyph.GetOutputPort()) - - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor.GetProperty().SetColor(colors.GetColor3d('Emerald_Green')) - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(franActor) --- - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Read cyberware file. - # - cyber = vtkPolyDataReader() - cyber.SetFileName(fileName) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(cyber.GetOutputPort()) - - mask = vtkMaskPoints() - mask.SetInputConnection(normals.GetOutputPort()) - mask.SetOnRatio(8) - # mask.RandomModeOn() - - splatter = vtkGaussianSplatter() - splatter.SetInputConnection(mask.GetOutputPort()) - splatter.SetSampleDimensions(100, 100, 100) - splatter.SetEccentricity(2.5) - splatter.NormalWarpingOn() - splatter.SetScaleFactor(1.0) --- - contour = vtkContourFilter() - contour.SetInputConnection(splatter.GetOutputPort()) - contour.SetValue(0, 0.25) - - splatMapper = vtkPolyDataMapper() - splatMapper.SetInputConnection(contour.GetOutputPort()) - splatMapper.ScalarVisibilityOff() - - splatActor = vtkActor() - splatActor.SetMapper(splatMapper) - splatActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(cyber.GetOutputPort()) - cyberMapper.ScalarVisibilityOff() - - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetRepresentationToWireframe() - cyberActor.GetProperty().SetColor(colors.GetColor3d('Turquoise')) - - # Add the actors to the renderer, set the background and size. --- - camera = vtkCamera() - camera.SetClippingRange(0.0332682, 1.66341) - camera.SetFocalPoint(0.0511519, -0.127555, -0.0554379) - camera.SetPosition(0.516567, -0.124763, -0.349538) - camera.SetViewAngle(18.1279) - camera.SetViewUp(-0.013125, 0.99985, -0.0112779) --- - parser.add_argument('filename', help='fran_cut.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fileNames, useRibbons = get_program_parameters() - useTubes = not useRibbons - - # Set up the stocks --- - topRenderer = vtkRenderer() - bottomRenderer = vtkRenderer() - renderers.append(topRenderer) - renderers.append(bottomRenderer) - - zPosition = 0.0 - for fn in fileNames: --- - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderers[0]) - renderWindow.AddRenderer(renderers[1]) - - renderWindowInteractor = vtkRenderWindowInteractor() - renderWindowInteractor.SetRenderWindow(renderWindow) - - renderers[0].SetViewport(0.0, 0.4, 1.0, 1.0) - renderers[1].SetViewport(0.0, 0.0, 1.0, 0.4) - --- - help='List of one or more filenames corresponding to stocks. e.g. GE.vtk GM.vtk IBM.vtk DEC.vtk') - parser.add_argument('-r', dest='useRibbons', action='store_true', help='Use ribbons instead of tubes.') - - args = parser.parse_args() - return args.filenames, args.useRibbons - --- - PolyDataRead = vtkPolyDataReader() - PolyDataRead.SetFileName(filename) - PolyDataRead.Update() - - # Create the labels. - TextSrc = vtkVectorText() - TextSrc.SetText(name) - - numberOfPoints = PolyDataRead.GetOutput().GetNumberOfPoints() - - nameIndex = int((numberOfPoints - 1) * 0.8) --- - TubeFilter = vtkTubeFilter() - TubeFilter.SetInputConnection(PolyDataRead.GetOutputPort()) - TubeFilter.SetNumberOfSides(8) - TubeFilter.SetRadius(0.5) - TubeFilter.SetRadiusFactor(10000) - - RibbonFilter = vtkRibbonFilter() - RibbonFilter.SetInputConnection(PolyDataRead.GetOutputPort()) - RibbonFilter.VaryWidthOn() - RibbonFilter.SetWidthFactor(5) - RibbonFilter.SetDefaultNormal(0, 1, 0) - RibbonFilter.UseDefaultNormalOn() --- - Extrude = vtkLinearExtrusionFilter() - Extrude.SetInputConnection(RibbonFilter.GetOutputPort()) - Extrude.SetVector(0, 1, 0) - Extrude.SetExtrusionType(1) - Extrude.SetScaleFactor(0.7) - - Transform = vtkTransform() - Transform.Translate(0, 0, zPosition) - Transform.Scale(0.15, 1, 1) - - TransformFilter = vtkTransformPolyDataFilter() - TransformFilter.SetInputConnection(Extrude.GetOutputPort()) - TransformFilter.SetTransform(Transform) - - # Select tubes or ribbons - if useTubes: --- - LabelMapper = vtkPolyDataMapper() - LabelMapper.SetInputConnection(TextSrc.GetOutputPort()) - - LabelActor = vtkFollower() - LabelActor.SetMapper(LabelMapper) - LabelActor.SetPosition(x, y, z) - LabelActor.SetScale(2, 2, 2) - LabelActor.SetOrigin(TextSrc.GetOutput().GetCenter()) - --- - StockMapper = vtkPolyDataMapper() - StockMapper.SetInputConnection(TransformFilter.GetOutputPort()) - StockMapper.SetScalarRange(0, 8000) - StockActor = vtkActor() - StockActor.SetMapper(StockMapper) - - renderers[r].AddActor(StockActor) - renderers[r].AddActor(LabelActor) - LabelActor.SetCamera(renderers[r].GetActiveCamera()) --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and interactive renderer. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Generate the tensors. - ptLoad = vtkPointLoad() - ptLoad.SetLoadValue(100.0) - ptLoad.SetSampleDimensions(6, 6, 6) - ptLoad.ComputeEffectiveStressOn() - ptLoad.SetModelBounds(-10, 10, -10, 10, -10, 10) - --- - plane = vtkImageDataGeometryFilter() - plane.SetInputConnection(ptLoad.GetOutputPort()) - plane.SetExtent(2, 2, 0, 99, 0, 99) - - # Generate the tensor axes. - axes = vtkAxes() - axes.SetScaleFactor(0.5) - - tubeAxes = vtkTubeFilter() - tubeAxes.SetInputConnection(axes.GetOutputPort()) - tubeAxes.SetRadius(0.1) - tubeAxes.SetNumberOfSides(6) - - tensorAxes = vtkTensorGlyph() - tensorAxes.SetInputConnection(ptLoad.GetOutputPort()) - tensorAxes.SetSourceConnection(axes.GetOutputPort()) - tensorAxes.SetScaleFactor(10) - tensorAxes.ClampScalingOn() - --- - lut = vtkLookupTable() - MakeLogLUT(lut) - # lut.SetHueRange(.6667, 0.0) - tensorAxesMapper = vtkPolyDataMapper() - tensorAxesMapper.SetInputConnection(tensorAxes.GetOutputPort()) - tensorAxesMapper.SetLookupTable(lut) - plane.Update() # force update for scalar range - # This is deprecated from vtk 8.1 onwards. - # tensorAxesMapper.ImmediateModeRenderingOn() --- - tensorActor = vtkActor() - tensorActor.SetMapper(tensorAxesMapper) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() - outline.SetInputConnection(ptLoad.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # - # Create a cone whose apex indicates the application of load. --- - coneSrc = vtkConeSource() - coneSrc.SetRadius(.5) - coneSrc.SetHeight(2) - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('BurlyWood')) - - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [65, 99, 149, 255]) - - # Read a vtk file --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) # Density - pl3d.SetVectorFunctionNumber(202) # Momentum - pl3d.Update() --- - plane = vtkStructuredGridGeometryFilter() - plane.SetInputData(pl3dOutput) - plane.SetExtent(10, 10, 1, extent[3], 1, extent[5]) - - plane2 = vtkStructuredGridGeometryFilter() - plane2.SetInputData(pl3dOutput) - plane2.SetExtent(30, 30, 1, extent[3], 1, extent[5]) - - plane3 = vtkStructuredGridGeometryFilter() - plane3.SetInputData(pl3dOutput) - plane3.SetExtent(45, 45, 1, extent[3], 1, extent[5]) - - # We use an append filter because that way we can do the warping, etc. just - # using a single pipeline and actor. --- - appendF = vtkAppendPolyData() - appendF.AddInputConnection(plane.GetOutputPort()) - appendF.AddInputConnection(plane2.GetOutputPort()) - appendF.AddInputConnection(plane3.GetOutputPort()) - - # Warp - warp = vtkWarpVector() - warp.SetInputConnection(appendF.GetOutputPort()) - warp.SetScaleFactor(0.005) - warp.Update() - - normals = vtkPolyDataNormals() - normals.SetInputData(warp.GetPolyDataOutput()) - normals.SetFeatureAngle(45) - - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputConnection(normals.GetOutputPort()) - planeMapper.SetScalarRange(scalarRange) - - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # The outline provides context for the data and the planes. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(planeActor) --- - colors = vtkNamedColors() - - fileName1, fileName2, fileName3 = get_program_parameters() - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() - aRenderWindow.AddRenderer(aRenderer) - anInteractor = vtkRenderWindowInteractor() - anInteractor.SetRenderWindow(aRenderWindow) - aRenderWindow.SetSize(300, 300) - aRenderWindow.SetWindowName('BlobbyLogo') - - # Read the geometry file containing the letter v. - letterV = vtkPolyDataReader() - letterV.SetFileName(fileName1) - - # Read the geometry file containing the letter t. - letterT = vtkPolyDataReader() - letterT.SetFileName(fileName2) - - # Read the geometry file containing the letter k. - letterK = vtkPolyDataReader() - letterK.SetFileName(fileName3) - - # Create a transform and transform filter for each letter. - VTransform = vtkTransform() - VTransformFilter = vtkTransformPolyDataFilter() - VTransformFilter.SetInputConnection(letterV.GetOutputPort()) - VTransformFilter.SetTransform(VTransform) - - TTransform = vtkTransform() - TTransformFilter = vtkTransformPolyDataFilter() - TTransformFilter.SetInputConnection(letterT.GetOutputPort()) - TTransformFilter.SetTransform(TTransform) - - KTransform = vtkTransform() - KTransformFilter = vtkTransformPolyDataFilter() - KTransformFilter.SetInputConnection(letterK.GetOutputPort()) - KTransformFilter.SetTransform(KTransform) - - # Now append them all. - appendAll = vtkAppendPolyData() - appendAll.AddInputConnection(VTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(TTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(KTransformFilter.GetOutputPort()) - - # Create normals. - logoNormals = vtkPolyDataNormals() - logoNormals.SetInputConnection(appendAll.GetOutputPort()) - logoNormals.SetFeatureAngle(60) - - # Map to rendering primitives. - logoMapper = vtkPolyDataMapper() - logoMapper.SetInputConnection(logoNormals.GetOutputPort()) - - # Now an actor. - logo = vtkActor() - logo.SetMapper(logoMapper) - - # Now create an implicit model of the same letter. - blobbyLogoImp = vtkImplicitModeller() - blobbyLogoImp.SetInputConnection(appendAll.GetOutputPort()) - blobbyLogoImp.SetMaximumDistance(.075) - blobbyLogoImp.SetSampleDimensions(64, 64, 64) - blobbyLogoImp.SetAdjustDistance(0.05) - --- - blobbyLogoIso = vtkContourFilter() - blobbyLogoIso.SetInputConnection(blobbyLogoImp.GetOutputPort()) - blobbyLogoIso.SetValue(1, 1.5) - - # Map to rendering primitives. - blobbyLogoMapper = vtkPolyDataMapper() - blobbyLogoMapper.SetInputConnection(blobbyLogoIso.GetOutputPort()) - blobbyLogoMapper.ScalarVisibilityOff() - - tomato = vtkProperty() - tomato.SetDiffuseColor(colors.GetColor3d('tomato')) - tomato.SetSpecular(.3) - tomato.SetSpecularPower(20) - - banana = vtkProperty() - banana.SetDiffuseColor(colors.GetColor3d('banana')) - banana.SetDiffuse(.7) - banana.SetSpecular(.4) - banana.SetSpecularPower(20) - --- - blobbyLogo = vtkActor() - blobbyLogo.SetMapper(blobbyLogoMapper) - blobbyLogo.SetProperty(banana) - - # Position the letters. - --- - parser.add_argument('filename1', help='v.vtk') - parser.add_argument('filename2', help='t.vtk') - parser.add_argument('filename3', help='k.vtk') - args = parser.parse_args() - return args.filename1, args.filename2, args.filename3 - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - thickness = list() - displacement = list() - for i in range(0, 10): - thickness.append('thickness' + str(i)) --- - lut = vtkLookupTable() - lut.SetHueRange(0.0, 0.66667) - - for i in range(0, 10): - # Create the reader and warp the data vith vectors. - reader.append(vtkDataSetReader()) --- - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - rendererSizeX = 750 - rendererSizeY = 400 - renWinScale = 0.5 - renWin.SetWindowName("Blow") --- - parser.add_argument('filename', help='blow.vtk') - parser.add_argument('-d', '--data_point', default=-1, type=int, nargs='?', - help='The frame to display (0...9).') - args = parser.parse_args() - return args.filename, args.data_point - --- - colors = vtkNamedColors() - - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - hhog = vtkHedgeHog() - hhog.SetInputConnection(reader.GetOutputPort()) - hhog.SetScaleFactor(0.3) - - lut = vtkLookupTable() - # lut.SetHueRange(.667, 0.0) - lut.Build() - - hhogMapper = vtkPolyDataMapper() - hhogMapper.SetInputConnection(hhog.GetOutputPort()) - hhogMapper.SetScalarRange(50, 550) - hhogMapper.SetLookupTable(lut) - - hhogActor = vtkActor() - hhogActor.SetMapper(hhogMapper) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outline.GetOutputPort()) - - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() - aRenderWindow.AddRenderer(aRenderer) - anInteractor = vtkRenderWindowInteractor() - anInteractor.SetRenderWindow(aRenderWindow) - aRenderWindow.SetSize(640, 480) - aRenderWindow.SetWindowName('ComplexV') - - aRenderer.AddActor(outlineActor) --- - parser.add_argument('filename', help='carotid.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - cc = vtkCurvatures() - cc.SetInputData(source) - needs_adjusting = ['Hills', 'ParametricTorus', 'Plane', 'RandomHills', 'Torus'] - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() --- - values = vtkVariantArray() - for i in range(len(labels)): - values.InsertNextValue(vtkVariant(labels[i])) - for i in range(values.GetNumberOfTuples()): - lut.SetAnnotation(i, values.GetValue(i).ToString()) - --- - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputData(cc.GetOutput()) - # Use either the minimum or maximum value for each band. - for k in bands: - bcf.SetValue(k, bands[k][2]) - # We will use an indexed lookup table. --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [179, 204, 255, 255]) - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - src_mapper = vtkPolyDataMapper() - src_mapper.SetInputConnection(bcf.GetOutputPort()) - src_mapper.SetScalarRange(scalar_range_curvatures) - src_mapper.SetLookupTable(lut) - src_mapper.SetScalarModeToUseCellData() - - src_actor = vtkActor() - src_actor.SetMapper(src_mapper) - - # Create contour edges - edge_mapper = vtkPolyDataMapper() - edge_mapper.SetInputData(bcf.GetContourEdgesOutput()) - edge_mapper.SetResolveCoincidentTopologyToPolygonOffset() - - edge_actor = vtkActor() - edge_actor.SetMapper(edge_mapper) - edge_actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - glyph_mapper = vtkPolyDataMapper() - glyph_mapper.SetInputConnection(glyph.GetOutputPort()) - glyph_mapper.SetScalarModeToUsePointFieldData() - glyph_mapper.SetColorModeToMapScalars() - glyph_mapper.ScalarVisibilityOn() - glyph_mapper.SelectColorArray('Elevation') --- - glyph_actor = vtkActor() - glyph_actor.SetMapper(glyph_mapper) - - window_width = 800 - window_height = 800 - --- - scalar_bar = vtkScalarBarActor() - # This LUT puts the lowest value at the top of the scalar bar. - # scalar_bar->SetLookupTable(lut); - # Use this LUT if you want the highest value at the top. - scalar_bar.SetLookupTable(lutr) - scalar_bar.SetTitle(curvature.replace('_', '\n')) --- - scalar_bar_elev = vtkScalarBarActor() - # This LUT puts the lowest value at the top of the scalar bar. - # scalar_bar_elev->SetLookupTable(lut); - # Use this LUT if you want the highest value at the top. - scalar_bar_elev.SetLookupTable(lut1) - scalar_bar_elev.SetTitle('Elevation') --- - ren = vtkRenderer() - ren_win = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren_win.AddRenderer(ren) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren) - # Enable the widget. - cam_orient_manipulator.On() - - # add actors --- - ver = vtkVersion() - actual_version = (100 * ver.GetVTKMajorVersion() + ver.GetVTKMinorVersion()) \ - * 100000000 + ver.GetVTKBuildVersion() - if actual_version >= requested_version: - return True - else: --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- - curv = numpy_support.numpy_to_vtk(num_array=curvatures.ravel(), - deep=True, - array_type=VTK_DOUBLE) - curv.SetName(curvature_name) - source.GetPointData().RemoveArray(curvature_name) - source.GetPointData().AddArray(curv) --- - elev_filter = vtkElevationFilter() - elev_filter.SetInputData(src) - elev_filter.SetLowPoint(0, bounds[2], 0) - elev_filter.SetHighPoint(0, bounds[3], 0) - elev_filter.SetScalarRange(bounds[2], bounds[3]) - elev_filter.Update() --- - points = vtkPoints() - for i in range(0, x_res): - x = x_min + i * dx - for j in range(0, y_res): - y = y_min + j * dy - points.InsertNextPoint(x, y, 0) --- - plane = vtkPolyData() - plane.SetPoints(points) - - # Triangulate the grid. - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], --- - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): --- - normals = vtkPolyDataNormals() - normals.SetInputData(polydata) - normals.SetInputData(polydata) - normals.SetFeatureAngle(30) - normals.SplittingOff() - - tr1 = vtkTransform() - tr1.RotateX(-90) - - tf1 = vtkTransformPolyDataFilter() - tf1.SetInputConnection(normals.GetOutputPort()) - tf1.SetTransform(tr1) - tf1.Update() - - return tf1.GetOutput() --- - fn = vtkParametricRandomHills() - fn.AllowRandomGenerationOn() - fn.SetRandomSeed(1) - fn.SetNumberOfHills(30) - # Make the normals face out of the surface. - # Not needed with VTK 8.0 or later. - # if fn.GetClassName() == 'vtkParametricRandomHills': - # fn.ClockwiseOrderingOff() - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() --- - transform = vtkTransform() - transform.Translate(0.0, 5.0, 15.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - fn = vtkParametricTorus() - fn.SetRingRadius(5) - fn.SetCrossSectionRadius(2) - - source = vtkParametricFunctionSource() - source.SetParametricFunction(fn) - source.SetUResolution(50) - source.SetVResolution(50) - source.SetScalarModeToZ() - source.Update() --- - transform = vtkTransform() - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - return transform_filter.GetOutput() --- - source = vtkPlaneSource() - source.SetOrigin(-10.0, -10.0, 0.0) - source.SetPoint2(-10.0, 10.0, 0.0) - source.SetPoint1(10.0, -10.0, 0.0) - source.SetXResolution(20) - source.SetYResolution(20) --- - transform = vtkTransform() - transform.Translate(0.0, 0.0, 0.0) - transform.RotateX(-90.0) - transform_filter = vtkTransformPolyDataFilter() - transform_filter.SetInputConnection(source.GetOutputPort()) - transform_filter.SetTransform(transform) - transform_filter.Update() - - # We have a m x n array of quadrilaterals arranged as a regular tiling in a --- - tri = vtkTriangleFilter() - tri.SetInputConnection(transform_filter.GetOutputPort()) - - # Pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - source = vtkSphereSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetRadius(10.0) - source.SetThetaResolution(32) - source.SetPhiResolution(32) - source.Update() --- - source = vtkSuperquadricSource() - source.SetCenter(0.0, 0.0, 0.0) - source.SetScale(1.0, 1.0, 1.0) - source.SetPhiResolution(64) - source.SetThetaResolution(64) - source.SetThetaRoundness(1) --- - tri = vtkTriangleFilter() - tri.SetInputConnection(source.GetOutputPort()) - - # The quadric has nasty discontinuities from the way the edges are generated - # so let's pass it though a CleanPolyDataFilter and merge any points which - # are coincident, or very close - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - color_series = vtkColorSeries() - # Select a color scheme. - # color_series_enum = color_series.BREWER_DIVERGING_BROWN_BLUE_GREEN_9 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_10 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_3 - # color_series_enum = color_series.BREWER_DIVERGING_PURPLE_ORANGE_9 --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.CATEGORICAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.ORDINAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.758, 0.214, 0.233) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lutr = vtkLookupTable() - lutr.DeepCopy(lut) - t = lut.GetNumberOfTableValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - rgba = [0.0] * 3 --- - reverse = vtkReverseSense() - - # Choose a random subset of points. - mask_pts = vtkMaskPoints() - mask_pts.SetOnRatio(5) - mask_pts.RandomModeOn() - if reverse_normals: - reverse.SetInputData(src) - reverse.ReverseCellsOn() --- - arrow = vtkArrowSource() - arrow.SetTipResolution(16) - arrow.SetTipLength(0.3) - arrow.SetTipRadius(0.1) - - glyph = vtkGlyph3D() - glyph.SetSourceConnection(arrow.GetOutputPort()) - glyph.SetInputConnection(mask_pts.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleFactor(scale_factor) - glyph.SetColorModeToColorByVector() --- - parser.add_argument('file_name', help='The path to the JSON file e.g. Frog_vtk.json.') - parser.add_argument('-n', action='store_true', dest='omit_sliders', help='No sliders.') - parser.add_argument('-t', nargs='+', dest='tissues', action='append', help='Select one or more tissues.') - args = parser.parse_args() - return args.file_name, args.view, args.omit_sliders, args.tissues - --- - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - # Setup render window, renderers, and interactor. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(ren_win) - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - sliders = dict() - left_step_size = 1.0 / 9 - left_pos_y = 0.275 --- - reader = vtkPolyDataReader() - reader.SetFileName(parameters['vtk_files'][tissue]) - reader.Update() - - trans = SliceOrder().get(parameters['orientation'][tissue]) - trans.Scale(1, -1, -1) --- - tf = vtkTransformPolyDataFilter() - tf.SetInputConnection(reader.GetOutputPort()) - tf.SetTransform(trans) - tf.SetInputConnection(reader.GetOutputPort()) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(tf.GetOutputPort()) - normals.SetFeatureAngle(60.0) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(normals.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - - actor.GetProperty().SetOpacity(parameters['opacity'][tissue]) - actor.GetProperty().SetDiffuseColor(color_lut.GetTableValue(parameters['indices'][tissue])[:3]) - actor.GetProperty().SetSpecular(0.2) --- - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() --- - transform = vtkTransform() - transform.SetMatrix(camera.GetModelTransformMatrix()) - transform.RotateY(-90) - transform.RotateZ(90) - camera.SetModelTransformMatrix(transform.GetMatrix()) - ren.ResetCamera() --- - cow = vtkCameraOrientationWidget() - cow.SetParentRenderer(ren) - if no_sliders: - # Turn off if you do not want it. - cow.On() - cow.EnabledOn() --- - om = vtkOrientationMarkerWidget() - om.SetOrientationMarker(axes) - # Position upper left in the viewport. - # om.SetViewport(0.0, 0.8, 0.2, 1.0) - # Position lower left in the viewport. - om.SetViewport(0, 0, 0.2, 0.2) --- - if kk == 'vtk_files': - if len(v[kk]) != 17: - print(f'Expected seventeen file names.') - paths_ok = False - # The stem of the file path becomes the key. - path_map = dict() --- - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) --- - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) --- - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) --- - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) --- - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) --- - si_trans = vtkTransform() - si_trans.SetMatrix(self.si_mat) - self.transform['si'] = si_trans - - is_trans = vtkTransform() - is_trans.SetMatrix(self.is_mat) - self.transform['is'] = is_trans - - ap_trans = vtkTransform() - ap_trans.Scale(1, -1, 1) - self.transform['ap'] = ap_trans - - pa_trans = vtkTransform() - pa_trans.Scale(1, -1, -1) - self.transform['pa'] = pa_trans - - lr_trans = vtkTransform() - lr_trans.SetMatrix(self.lr_mat) - self.transform['lr'] = lr_trans - - rl_trans = vtkTransform() - rl_trans.SetMatrix(self.rl_mat) - self.transform['rl'] = rl_trans - - hf_trans = vtkTransform() - hf_trans.SetMatrix(self.hf_mat) - self.transform['hf'] = hf_trans - - hf_si_trans = vtkTransform() - hf_si_trans.SetMatrix(self.hf_mat) - hf_si_trans.Concatenate(self.si_mat) - self.transform['hfsi'] = hf_si_trans - - hf_is_trans = vtkTransform() - hf_is_trans.SetMatrix(self.hf_mat) - hf_is_trans.Concatenate(self.is_mat) - self.transform['hfis'] = hf_is_trans - - hf_ap_trans = vtkTransform() - hf_ap_trans.SetMatrix(self.hf_mat) - hf_ap_trans.Scale(1, -1, 1) - self.transform['hfap'] = hf_ap_trans - - hf_pa_trans = vtkTransform() - hf_pa_trans.SetMatrix(self.hf_mat) - hf_pa_trans.Scale(1, -1, -1) - self.transform['hfpa'] = hf_pa_trans - - hf_lr_trans = vtkTransform() - hf_lr_trans.SetMatrix(self.hf_mat) - hf_lr_trans.Concatenate(self.lr_mat) - self.transform['hflr'] = hf_lr_trans - - hf_rl_trans = vtkTransform() - hf_rl_trans.SetMatrix(self.hf_mat) - hf_rl_trans.Concatenate(self.rl_mat) - self.transform['hfrl'] = hf_rl_trans - - # Identity - self.transform['I'] = vtkTransform() - - # Zero - z_trans = vtkTransform() - z_trans.Scale(0, 0, 0) - self.transform['Z'] = z_trans - - def print_transform(self, order): - """ --- - lut = vtkLookupTable() - lut.SetNumberOfColors(len(colors)) - lut.SetTableRange(0, len(colors) - 1) - lut.Build() - - nc = vtkNamedColors() - - for k in indices.keys(): - lut.SetTableValue(indices[k], nc.GetColor4d(colors[k])) - - return lut --- - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyz_labels[0]) - axes.SetYAxisLabelText(xyz_labels[1]) - axes.SetZAxisLabelText(xyz_labels[2]) --- - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText(cube_labels[0]) - cube.SetXMinusFaceText(cube_labels[1]) - cube.SetYPlusFaceText(cube_labels[2]) - cube.SetYMinusFaceText(cube_labels[3]) - cube.SetZPlusFaceText(cube_labels[4]) --- - assembly = vtkPropAssembly() - assembly.AddPart(axes) - assembly.AddPart(cube) - return assembly - - --- - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.value_minimum) - slider.SetMaximumValue(properties.value_maximum) - slider.SetValue(properties.value_initial) - slider.SetTitleText(properties.title) --- - colors = vtkNamedColors() - # Set the colors of the slider components. - # Change the color of the bar. - slider.GetTubeProperty().SetColor(colors.GetColor3d(properties.bar_color)) - # Change the color of the ends of the bar. - slider.GetCapProperty().SetColor(colors.GetColor3d(properties.bar_ends_color)) --- - slider_widget = vtkSliderWidget() - slider_widget.SetRepresentation(slider) - - return slider_widget - - --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - # Read a vtk file --- - hawaii = vtkPolyDataReader() - hawaii.SetFileName(file_name) - hawaii.Update() - bounds = [0.0] * 6 - hawaii.GetOutput().GetBounds(bounds) - - elevation = vtkElevationFilter() - elevation.SetInputConnection(hawaii.GetOutputPort()) - elevation.SetLowPoint(0, 0, 0) - elevation.SetHighPoint(0, 0, 1000) - elevation.SetScalarRange(0, 1000) - --- - hawaiiMapper = vtkDataSetMapper() - hawaiiMapper.SetInputConnection(elevation.GetOutputPort()) - hawaiiMapper.SetScalarRange(0, 1000) - hawaiiMapper.ScalarVisibilityOn() - hawaiiMapper.SetLookupTable(lut) - - hawaiiActor = vtkActor() - hawaiiActor.SetMapper(hawaiiMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Add the actors to the renderer, set the background and size - # - ren.AddActor(hawaiiActor) --- - parser.add_argument('filename', help='honolulu.vtk') - parser.add_argument('color_scheme', default=0, type=int, nargs='?', help='The particular color scheme to use.') - args = parser.parse_args() - return args.filename, args.color_scheme - - --- - colors = vtkNamedColors() - if color_scheme == 1: - # A lookup table of 256 colours ranging from - # deep blue (water) to yellow-white (mountain top) - # is used to color map this figure. - lut = vtkLookupTable() - lut.SetHueRange(0.7, 0) - lut.SetSaturationRange(1.0, 0) - lut.SetValueRange(0.5, 1.0) - elif color_scheme == 2: - # Make the lookup table with a preset number of colours. - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeries.SetColorSchemeName('Hawaii') - colorSeries.SetColor(0, colors.GetColor3ub("turquoise_blue")) - colorSeries.SetColor(1, colors.GetColor3ub("sea_green_medium")) - colorSeries.SetColor(2, colors.GetColor3ub("sap_green")) --- - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - else: - # Make the lookup using a Brewer palette. - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeriesEnum = colorSeries.BREWER_DIVERGING_BROWN_BLUE_GREEN_8 - colorSeries.SetColorScheme(colorSeriesEnum) - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - return lut - - --- - colors = vtkNamedColors() - - # Set the furniture colors. - colors.SetColor('Furniture', [204, 204, 153, 255]) - - scalarRange = [0.0, 0.0] --- - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # - # Read the data. - # - reader = vtkStructuredGridReader() - reader.SetFileName(fileName) - reader.Update() # Force a read to occur. - reader.GetOutput().GetLength() - - if reader.GetOutput().GetPointData().GetScalars(): --- - outlineF = vtkStructuredGridOutlineFilter() - outlineF.SetInputConnection(reader.GetOutputPort()) - outlineMapper = vtkPolyDataMapper() - outlineMapper.SetInputConnection(outlineF.GetOutputPort()) - outline = vtkActor() - outline.SetMapper(outlineMapper) - outline.GetProperty().SetColor(colors.GetColor3d('LampBlack')) - - # - # Set up shaded surfaces (i.e., supporting geometry). --- - doorGeom = vtkStructuredGridGeometryFilter() - doorGeom.SetInputConnection(reader.GetOutputPort()) - doorGeom.SetExtent(27, 27, 14, 18, 0, 11) - mapDoor = vtkPolyDataMapper() - mapDoor.SetInputConnection(doorGeom.GetOutputPort()) - mapDoor.ScalarVisibilityOff() - door = vtkActor() - door.SetMapper(mapDoor) - door.GetProperty().SetColor(colors.GetColor3d('Burlywood')) - - window1Geom = vtkStructuredGridGeometryFilter() - window1Geom.SetInputConnection(reader.GetOutputPort()) - window1Geom.SetExtent(0, 0, 9, 18, 6, 12) - mapWindow1 = vtkPolyDataMapper() - mapWindow1.SetInputConnection(window1Geom.GetOutputPort()) - mapWindow1.ScalarVisibilityOff() - window1 = vtkActor() - window1.SetMapper(mapWindow1) - window1.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window1.GetProperty().SetOpacity(.6) - - window2Geom = vtkStructuredGridGeometryFilter() - window2Geom.SetInputConnection(reader.GetOutputPort()) - window2Geom.SetExtent(5, 12, 23, 23, 6, 12) - mapWindow2 = vtkPolyDataMapper() - mapWindow2.SetInputConnection(window2Geom.GetOutputPort()) - mapWindow2.ScalarVisibilityOff() - window2 = vtkActor() - window2.SetMapper(mapWindow2) - window2.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window2.GetProperty().SetOpacity(.6) - - klower1Geom = vtkStructuredGridGeometryFilter() - klower1Geom.SetInputConnection(reader.GetOutputPort()) - klower1Geom.SetExtent(17, 17, 0, 11, 0, 6) - mapKlower1 = vtkPolyDataMapper() - mapKlower1.SetInputConnection(klower1Geom.GetOutputPort()) - mapKlower1.ScalarVisibilityOff() - klower1 = vtkActor() - klower1.SetMapper(mapKlower1) - klower1.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower2Geom = vtkStructuredGridGeometryFilter() - klower2Geom.SetInputConnection(reader.GetOutputPort()) - klower2Geom.SetExtent(19, 19, 0, 11, 0, 6) - mapKlower2 = vtkPolyDataMapper() - mapKlower2.SetInputConnection(klower2Geom.GetOutputPort()) - mapKlower2.ScalarVisibilityOff() - klower2 = vtkActor() - klower2.SetMapper(mapKlower2) - klower2.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower3Geom = vtkStructuredGridGeometryFilter() - klower3Geom.SetInputConnection(reader.GetOutputPort()) - klower3Geom.SetExtent(17, 19, 0, 0, 0, 6) - mapKlower3 = vtkPolyDataMapper() - mapKlower3.SetInputConnection(klower3Geom.GetOutputPort()) - mapKlower3.ScalarVisibilityOff() - klower3 = vtkActor() - klower3.SetMapper(mapKlower3) - klower3.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower4Geom = vtkStructuredGridGeometryFilter() - klower4Geom.SetInputConnection(reader.GetOutputPort()) - klower4Geom.SetExtent(17, 19, 11, 11, 0, 6) - mapKlower4 = vtkPolyDataMapper() - mapKlower4.SetInputConnection(klower4Geom.GetOutputPort()) - mapKlower4.ScalarVisibilityOff() - klower4 = vtkActor() - klower4.SetMapper(mapKlower4) - klower4.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower5Geom = vtkStructuredGridGeometryFilter() - klower5Geom.SetInputConnection(reader.GetOutputPort()) - klower5Geom.SetExtent(17, 19, 0, 11, 0, 0) - mapKlower5 = vtkPolyDataMapper() - mapKlower5.SetInputConnection(klower5Geom.GetOutputPort()) - mapKlower5.ScalarVisibilityOff() - klower5 = vtkActor() - klower5.SetMapper(mapKlower5) - klower5.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower6Geom = vtkStructuredGridGeometryFilter() - klower6Geom.SetInputConnection(reader.GetOutputPort()) - klower6Geom.SetExtent(17, 19, 0, 7, 6, 6) - mapKlower6 = vtkPolyDataMapper() - mapKlower6.SetInputConnection(klower6Geom.GetOutputPort()) - mapKlower6.ScalarVisibilityOff() - klower6 = vtkActor() - klower6.SetMapper(mapKlower6) - klower6.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower7Geom = vtkStructuredGridGeometryFilter() - klower7Geom.SetInputConnection(reader.GetOutputPort()) - klower7Geom.SetExtent(17, 19, 9, 11, 6, 6) - mapKlower7 = vtkPolyDataMapper() - mapKlower7.SetInputConnection(klower7Geom.GetOutputPort()) - mapKlower7.ScalarVisibilityOff() - klower7 = vtkActor() - klower7.SetMapper(mapKlower7) - klower7.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - hood1Geom = vtkStructuredGridGeometryFilter() - hood1Geom.SetInputConnection(reader.GetOutputPort()) - hood1Geom.SetExtent(17, 17, 0, 11, 11, 16) - mapHood1 = vtkPolyDataMapper() - mapHood1.SetInputConnection(hood1Geom.GetOutputPort()) - mapHood1.ScalarVisibilityOff() - hood1 = vtkActor() - hood1.SetMapper(mapHood1) - hood1.GetProperty().SetColor(colors.GetColor3d('Silver')) - - hood2Geom = vtkStructuredGridGeometryFilter() - hood2Geom.SetInputConnection(reader.GetOutputPort()) - hood2Geom.SetExtent(19, 19, 0, 11, 11, 16) - mapHood2 = vtkPolyDataMapper() - mapHood2.SetInputConnection(hood2Geom.GetOutputPort()) - mapHood2.ScalarVisibilityOff() - hood2 = vtkActor() - hood2.SetMapper(mapHood2) - hood2.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood3Geom = vtkStructuredGridGeometryFilter() - hood3Geom.SetInputConnection(reader.GetOutputPort()) - hood3Geom.SetExtent(17, 19, 0, 0, 11, 16) - mapHood3 = vtkPolyDataMapper() - mapHood3.SetInputConnection(hood3Geom.GetOutputPort()) - mapHood3.ScalarVisibilityOff() - hood3 = vtkActor() - hood3.SetMapper(mapHood3) - hood3.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood4Geom = vtkStructuredGridGeometryFilter() - hood4Geom.SetInputConnection(reader.GetOutputPort()) - hood4Geom.SetExtent(17, 19, 11, 11, 11, 16) - mapHood4 = vtkPolyDataMapper() - mapHood4.SetInputConnection(hood4Geom.GetOutputPort()) - mapHood4.ScalarVisibilityOff() - hood4 = vtkActor() - hood4.SetMapper(mapHood4) - hood4.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood6Geom = vtkStructuredGridGeometryFilter() - hood6Geom.SetInputConnection(reader.GetOutputPort()) - hood6Geom.SetExtent(17, 19, 0, 11, 16, 16) - mapHood6 = vtkPolyDataMapper() - mapHood6.SetInputConnection(hood6Geom.GetOutputPort()) - mapHood6.ScalarVisibilityOff() - hood6 = vtkActor() - hood6.SetMapper(mapHood6) - hood6.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - cookingPlateGeom = vtkStructuredGridGeometryFilter() - cookingPlateGeom.SetInputConnection(reader.GetOutputPort()) - cookingPlateGeom.SetExtent(17, 19, 7, 9, 6, 6) - mapCookingPlate = vtkPolyDataMapper() - mapCookingPlate.SetInputConnection(cookingPlateGeom.GetOutputPort()) - mapCookingPlate.ScalarVisibilityOff() - cookingPlate = vtkActor() - cookingPlate.SetMapper(mapCookingPlate) - cookingPlate.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - filterGeom = vtkStructuredGridGeometryFilter() - filterGeom.SetInputConnection(reader.GetOutputPort()) - filterGeom.SetExtent(17, 19, 7, 9, 11, 11) - mapFilter = vtkPolyDataMapper() - mapFilter.SetInputConnection(filterGeom.GetOutputPort()) - mapFilter.ScalarVisibilityOff() - sgfilter = vtkActor() - sgfilter.SetMapper(mapFilter) - sgfilter.GetProperty().SetColor(colors.GetColor3d('Furniture')) - # - # regular streamlines - # - line = vtkLineSource() - line.SetResolution(39) - line.SetPoint1(0.08, 2.50, 0.71) - line.SetPoint2(0.08, 4.50, 0.71) - rakeMapper = vtkPolyDataMapper() - rakeMapper.SetInputConnection(line.GetOutputPort()) - rake = vtkActor() - rake.SetMapper(rakeMapper) - - streamers = vtkStreamTracer() - # streamers.DebugOn() - streamers.SetInputConnection(reader.GetOutputPort()) - streamers.SetSourceConnection(line.GetOutputPort()) - streamers.SetMaximumPropagation(maxTime) - streamers.SetInitialIntegrationStep(.5) --- - streamersMapper = vtkPolyDataMapper() - streamersMapper.SetInputConnection(streamers.GetOutputPort()) - streamersMapper.SetScalarRange(scalarRange) - - lines = vtkActor() - lines.SetMapper(streamersMapper) - lines.GetProperty().SetColor(colors.GetColor3d('Black')) - - aren.TwoSidedLightingOn() - --- - aCamera = vtkCamera() - aren.SetActiveCamera(aCamera) - aren.ResetCamera() - - aCamera.SetFocalPoint(3.505, 2.505, 1.255) - aCamera.SetPosition(3.505, 24.6196, 1.255) --- - parser.add_argument('filename', help='kitchen.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - polyData = ReadPolyData(fileName) - --- - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d("White")) - - # Create background colors for each viewport. - backgroundColors = list() - backgroundColors.append(colors.GetColor3d("Cornsilk")) --- - camera = vtkCamera() - - normals = vtkPolyDataNormals() - normals.SetInputData(polyData) - normals.SetFeatureAngle(30.0) - for i in range(0, 3): - if i == 0: - normals.ComputePointNormalsOff() --- - normalsPolyData = vtkPolyData() - normalsPolyData.DeepCopy(normals.GetOutput()) - - # mapper - mapper = vtkPolyDataMapper() - mapper.SetInputData(normalsPolyData) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d("Peacock")) - actor.GetProperty().SetDiffuse(.7) - actor.GetProperty().SetSpecularPower(20) - actor.GetProperty().SetSpecular(.5) --- - renwin = vtkRenderWindow() - renwin.AddRenderer(ren[0]) - renwin.AddRenderer(ren[1]) - renwin.AddRenderer(ren[2]) - renwin.SetWindowName('NormalsDemo') - --- - interactor = vtkRenderWindowInteractor() - interactor.SetRenderWindow(renwin) - - renwin.SetSize(900, 300) - ren[0].GetActiveCamera().SetFocalPoint(0, 0, 0) - ren[0].GetActiveCamera().SetPosition(1, 0, 0) --- - reader = vtkPLYReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtp": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".obj": - reader = vtkOBJReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".stl": - reader = vtkSTLReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".vtk": - reader = vtkXMLPolyDataReader() - reader.SetFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - elif extension == ".g": - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - colors = vtkNamedColors() - - # This is a simple volume rendering example that - # uses a vtkFixedPointVolumeRayCastMapper - - # Create the standard renderer, render window --- - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) - - # Create the reader for the data. - reader = vtkStructuredPointsReader() - reader.SetFileName(fileName) - - # Create transfer mapping scalar value to opacity. - opacityTransferFunction = vtkPiecewiseFunction() - opacityTransferFunction.AddPoint(20, 0.0) - opacityTransferFunction.AddPoint(255, 0.2) - - # Create transfer mapping scalar value to color. - colorTransferFunction = vtkColorTransferFunction() - colorTransferFunction.AddRGBPoint(0.0, 0.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(64.0, 1.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(128.0, 0.0, 0.0, 1.0) - colorTransferFunction.AddRGBPoint(192.0, 0.0, 1.0, 0.0) - colorTransferFunction.AddRGBPoint(255.0, 0.0, 0.2, 0.0) --- - volumeProperty = vtkVolumeProperty() - volumeProperty.SetColor(colorTransferFunction) - volumeProperty.SetScalarOpacity(opacityTransferFunction) - volumeProperty.ShadeOn() - volumeProperty.SetInterpolationTypeToLinear() - --- - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(reader.GetOutputPort()) - - # The volume holds the mapper and the property and - # can be used to position/orient the volume. - volume = vtkVolume() - volume.SetMapper(volumeMapper) - volume.SetProperty(volumeProperty) - - ren1.AddVolume(volume) - ren1.SetBackground(colors.GetColor3d('Wheat')) --- - parser.add_argument('filename', help='ironProt.vtk') - args = parser.parse_args() - return args.filename - - -if __name__ == '__main__': diff --git a/data/examples/pp/vtk3DSImporter b/data/examples/pp/vtk3DSImporter deleted file mode 100644 index 3381bb7..0000000 --- a/data/examples/pp/vtk3DSImporter +++ /dev/null @@ -1,6 +0,0 @@ - importer = vtk3DSImporter() - importer.SetFileName(fileName) - importer.ComputeNormalsOn() - - colors = vtkNamedColors() - diff --git a/data/examples/pp/vtkAMRBox b/data/examples/pp/vtkAMRBox deleted file mode 100644 index b549126..0000000 --- a/data/examples/pp/vtkAMRBox +++ /dev/null @@ -1,20 +0,0 @@ - box1 = vtkAMRBox() - amr.SetAMRBox(0, 0, box1) - amr.SetDataSet(0, 0, ug1) - - spacing2 = [0.5, 0.5, 0.5] - ug2 = vtkUniformGrid() --- - box2 = vtkAMRBox() - amr.SetAMRBox(1, 0, box2) - amr.SetDataSet(1, 0, ug2) - - origin3 = [5, 5, 5] - ug3 = vtkUniformGrid() --- - box3 = vtkAMRBox() - amr.SetAMRBox(1, 1, box3) - amr.SetDataSet(1, 1, ug3) - amr.SetRefinementRatio(0, 2) - - # Render the amr data here. diff --git a/data/examples/pp/vtkActor b/data/examples/pp/vtkActor deleted file mode 100644 index c1cb12c..0000000 --- a/data/examples/pp/vtkActor +++ /dev/null @@ -1,4192 +0,0 @@ - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Create the 3D text and the associated mapper and follower (a type of actor). Position the text so it is displayed over the origin of the axes. - atext = vtkVectorText() - atext.SetText('Origin') --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - actor.GetProperty().SetLineWidth(2) - actor.SetMapper(mapper) - - # Enable user interface interactor. --- - actor1 = vtkActor() - actor1.GetProperty().SetColor(colors.GetColor3d('Yellow')) - actor1.SetMapper(mapper) - - # Associate the geometry with a mapper and the mapper to an actor. - mapper2 = vtkPolyDataMapper() --- - actor2 = vtkActor() - actor2.SetMapper(mapper2) - - # Add the actor to the renderer and start handling events. - aren.AddActor(actor1) - aren.AddActor(actor2) --- - actor_loop = vtkActor() - actor_loop.SetMapper(mapper) - actor_loop.GetProperty().SetInterpolationToFlat() - - # Update the pipeline so that vtkCellLocator finds cells! - smooth_loop.Update() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(named_colors.GetColor3d('Red')) - actor.GetProperty().SetLineWidth(3) - - # Visualize --- - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetSpecular(.5) - actor.GetProperty().SetSpecularPower(20) - actor.SetBackfaceProperty(backProperty) --- - actor = vtk.vtkActor() - actor.SetMapper(mapper) - ren = vtk.vtkRenderer() - ren.AddActor(actor) - iren = vtk.vtkRenderWindowInteractor() - renWin = vtk.vtkRenderWindow() --- - graticleActor = vtk.vtkActor() - readerActor = vtk.vtkActor() - - geoGraticle.SetGeometryType(geoGraticle.POLYLINES) - geoGraticle.SetLatitudeLevel(2) - geoGraticle.SetLongitudeLevel(2) - geoGraticle.SetLongitudeBounds(-180, 180) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().LightingOff() - actor.GetProperty().SetColor(colors.GetColor3d('Seashell')) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - - colors = vtkNamedColors() - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(5) - - # Map the points to spheres - sphereActor = point_to_glyph(appendFilter.GetOutput().GetPoints(), 0.05) --- - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - --- - meshActor = vtkActor() - meshActor.SetMapper(meshMapper) - meshActor.GetProperty().EdgeVisibilityOn() - meshActor.GetProperty().SetEdgeColor(colors.GetColor3d('Peacock')) - meshActor.GetProperty().SetInterpolationToFlat() - --- - boundaryActor = vtkActor() - boundaryActor.SetMapper(boundaryMapper) - boundaryActor.GetProperty().SetColor(colors.GetColor3d('Raspberry')) - boundaryActor.GetProperty().SetLineWidth(3) - boundaryActor.GetProperty().EdgeVisibilityOn() - boundaryActor.GetProperty().SetEdgeColor(colors.GetColor3d('Red')) --- - mesh_actor = vtkActor() - mesh_actor.SetMapper(mesh_mapper) - mesh_actor.GetProperty().SetColor(colors.GetColor3d('LightGoldenrodYellow')) - mesh_actor.GetProperty().EdgeVisibilityOn() - mesh_actor.GetProperty().SetEdgeColor(colors.GetColor3d('CornflowerBlue')) - mesh_actor.GetProperty().SetLineWidth(3) --- - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.GetProperty().SetColor(colors.GetColor3d('DeepPink')) - point_actor.GetProperty().SetPointSize(10) - point_actor.GetProperty().RenderPointsAsSpheresOn() - --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('SteelBlue')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetColor(colors.GetColor3d('Blue')) - - # Set up the transform filter - translation = vtkTransform() --- - transformedActor = vtkActor() - transformedActor.SetMapper(transformedMapper) - transformedActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Set up the rest of the visualization pipeline - renderer = vtkRenderer() --- - pointsActor = vtkActor() - pointsActor.SetMapper(pointsMapper) - pointsActor.GetProperty().SetPointSize(3) - pointsActor.GetProperty().SetColor(colors.GetColor3d("Red")) - - # Triangulate the grid points --- - triangulatedActor = vtkActor() - triangulatedActor.SetMapper(triangulatedMapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(10) - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - # Create a renderer, render window, and interactor --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - renderer.SetBackground(colors.GetColor3d('Green')) - renderer.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - - # a renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - # actor.GetProperty().SetLineWidth(3) - - textProperty = vtkTextProperty() --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(320, 20) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - - renderer = vtkRenderer() - renderer.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('bisque')) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - actor.GetProperty().SetLineWidth(3) - actor.GetProperty().EdgeVisibilityOn() - --- - pointActor = vtkActor() - pointActor.SetMapper(pointMapper) - pointActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - cubeActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - # Assign actor to the renderer. - ren.AddActor(cubeActor) --- - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - - # The usual rendering stuff. - camera = vtkCamera() - camera.SetPosition(1, 1, 1) --- - cylinderActor = vtkActor() - cylinderActor.SetMapper(cylinderMapper) - cylinderActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - cylinderActor.RotateX(30.0) - cylinderActor.RotateY(-45.0) - --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("Cornsilk")) - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor( - colors.GetColor3d('PapayaWhip')) - - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - sphereMapper = vtkPolyDataMapper() - sphereMapper.SetInputConnection(sphere.GetOutputPort()) --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - arrowActor = vtkActor() - arrowActor.SetMapper(arrowMapper) - arrowActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - - tubes = vtkTubeFilter() - tubes.SetInputData(polyData) --- - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(extrude.GetOutputPort()) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetOpacity(.7) - - ren = vtkRenderer() --- - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(extrude.GetOutputPort()) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.SetBackfaceProperty(back) - - ren = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.SetBackfaceProperty(back) - --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("PeachPuff")) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - - if wireframe_on or key in lines: - actor.GetProperty().SetRepresentationToWireframe() --- - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) --- - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.SetProperty(get_point_actor_property()) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('LightSteelBlue')) --- - tile_actor = vtkActor() - tile_actor.SetMapper(plane_mapper) - - return tile_actor - - --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - - if wireframe_on or key in lines: - actor.GetProperty().SetRepresentationToWireframe() --- - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) --- - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - point_actor.SetProperty(get_point_actor_property()) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('LightSteelBlue')) --- - tile_actor = vtkActor() - tile_actor.SetMapper(plane_mapper) - - return tile_actor - - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - actor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(4) - actor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - # Setup render window, renderer, and interactor --- - actor = vtkActor() - if USER_MATRIX: - mapper.SetInputConnection(arrowSource.GetOutputPort()) - actor.SetUserMatrix(transform.GetMatrix()) - else: - mapper.SetInputConnection(transformPD.GetOutputPort()) --- - sphereStart = vtkActor() - sphereStart.SetMapper(sphereStartMapper) - sphereStart.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - sphereEndSource = vtkSphereSource() - sphereEndSource.SetCenter(endPoint) --- - sphereEnd = vtkActor() - sphereEnd.SetMapper(sphereEndMapper) - sphereEnd.GetProperty().SetColor(colors.GetColor3d('Magenta')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - if USER_MATRIX: - mapper.SetInputConnection(cylinderSource.GetOutputPort()) - actor.SetUserMatrix(transform.GetMatrix()) - else: - mapper.SetInputConnection(transformPD.GetOutputPort()) --- - sphereStart = vtkActor() - sphereStart.SetMapper(sphereStartMapper) - sphereStart.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - sphereEndSource = vtkSphereSource() - sphereEndSource.SetCenter(endPoint) --- - sphereEnd = vtkActor() - sphereEnd.SetMapper(sphereEndMapper) - sphereEnd.GetProperty().SetColor(colors.GetColor3d('Magenta')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor --- - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor --- - actor = vtkActor() - - backProperty = vtkProperty() - backProperty.SetColor(colors.GetColor3d('Tomato')) - - # Create a parametric function source, renderer, mapper, and actor --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - # Create a renderer, render window and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - actor.GetProperty().SetPointSize(20) - - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor( - colors.GetColor3d('Silver')) - - # Visualize --- - polygonActor = vtkActor() - polygonActor.SetMapper(polygonMapper) - polygonActor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - - # Create the Renderer and assign actors to it. A renderer is like a - # viewport. It is part or all of a window on the screen and it is --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Setup render window, renderer, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) --- - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - textProperty = vtkTextProperty() --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) --- - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - # Visualize --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) --- - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - textProperty = vtkTextProperty() --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor( - namedColors.GetColor3d('Tomato')) - actor.GetProperty().SetEdgeColor( - namedColors.GetColor3d('IvoryBlack')) --- - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) - glyph3DActor.GetProperty().SetColor( - namedColors.GetColor3d('Banana')) - - # Visualize --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetLineWidth(5) - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Cornsilk")) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('Banana')) - actor.SetBackfaceProperty(back) - --- - actor1 = vtkActor() - actor1.SetMapper(mapper1) - actor1.GetProperty().SetColor(colors.GetColor3d("Cyan")) - - # Create a mapper and actor - mapper2 = vtkDataSetMapper() --- - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().SetColor(colors.GetColor3d("Yellow")) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actor.SetMapper(mapper) - - # Create a renderer, render window, and an interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actor.GetProperty().SetRepresentationToWireframe() - - # Create a renderer, render window, and interactor --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(30) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Setup render window, renderer, and interactor --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - arrowActor = vtkActor() - arrowActor.SetMapper(arrowMapper) - graphLayoutView.GetRenderer().AddActor(arrowActor) - - graphLayoutView.ResetCamera() - graphLayoutView.Render() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Burlywood')) - - # Create the RenderWindow, Renderer and Interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualization - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(3) - - # Setup rendering - renderer = vtkRenderer() --- - iso_smoothed_actor = vtkActor() - iso_smoothed_actor.SetMapper(iso_smoothed_mapper) - iso_smoothed_actor.GetProperty().SetColor(colors.GetColor3d("Ivory")) - - # Unsmoothed pipeline. - # Sub sample the data. --- - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor(colors.GetColor3d("Ivory")) - - # The rendering Pipeline. - --- - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - superquadric_actor.GetProperty().SetColor(colors.GetColor3d('NavajoWhite')) - - scene_renderer = vtkRenderer() - render_window = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetColor(colors.GetColor3d('AliceBlue')) - actor.GetProperty().SetEdgeColor(colors.GetColor3d('SteelBlue')) - --- - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Visualize - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Create a box around the function to indicate the sampling volume. - - # Create outline. --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Visualize. - renderer = vtkRenderer() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Build the lookup table for the 3d data scalar colors (brown to white) - lut = vtkLookupTable() - lut.SetTableRange(0, 256) --- - dataActor = vtkActor() - dataActor.SetMapper(dataMapper) - dataActor.GetProperty().SetRepresentationToPoints() - dataActor.GetProperty().SetPointSize(10) - - # Set up the 3d render window and add both actors --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('peacock')) - # Lighting - actor.GetProperty().SetAmbient(0.3) - actor.GetProperty().SetDiffuse(0.0) --- - outlineActor = vtkActor() - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Chartreuse')) - - # assign actor to the renderer - ren.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SlateGray')) --- - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 1024 - window_height = 1024 - --- - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 1024 - window_height = 1024 - --- - actor = vtkActor() - actor.SetMapper(mapper) - - # color the actor - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Renderer - renderer = vtkRenderer() - renderer.AddViewProp(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - # show the edges of the image grid - actor.GetProperty().SetRepresentationToWireframe() - - # Create the Renderer --- - edgeActor = vtkActor() - edgeActor.SetMapper(edgeMapper) - edgeActor.GetProperty().SetSpecular(0.6) - edgeActor.GetProperty().SetSpecularPower(30) - - # Glyph the points --- - pointActor = vtkActor() - pointActor.SetMapper(pointMapper) - pointActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - pointActor.GetProperty().SetSpecular(0.6) - pointActor.GetProperty().SetSpecularColor(1.0, 1.0, 1.0) - pointActor.GetProperty().SetSpecularPower(100) --- - labelActor = vtkActor2D() - labelActor.SetMapper(labelMapper) - - # The geometry - geometryShrink = vtkShrinkFilter() - geometryShrink.SetInputConnection(reader.GetOutputPort()) --- - geometryActor = vtkActor() - geometryActor.SetMapper(geometryMapper) - geometryActor.GetProperty().SetLineWidth(3) - geometryActor.GetProperty().EdgeVisibilityOn() - geometryActor.GetProperty().SetEdgeColor(0, 0, 0) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - render = vtkRenderer() - render.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('NavajoWhite')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuse(0.8) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - actor.GetProperty().SetSpecular(0.8) - actor.GetProperty().SetSpecularPower(120.0) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuse(0.8) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - actor.GetProperty().SetSpecular(0.3) - actor.GetProperty().SetSpecularPower(60.0) --- - actor = vtk.vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().SetLineWidth(2.0) - actor.GetProperty().SetColor(colors.GetColor3d("MistyRose")) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tan')) - - # Create a rendering window and renderer - ren = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Create a rendering window and renderer - ren = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() - render_window.AddRenderer(renderer) --- - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) --- - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) --- - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - skin.GetProperty().SetSpecular(0.3) - skin.GetProperty().SetSpecularPower(20) - skin.GetProperty().SetOpacity(0.5) --- - bone = vtkActor() - bone.SetMapper(bone_mapper) - bone.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - - # An outline provides context around the data. - # --- - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) --- - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - skin.GetProperty().SetSpecular(0.3) - skin.GetProperty().SetSpecularPower(20) - --- - bone = vtkActor() - bone.SetMapper(bone_mapper) - bone.GetProperty().SetDiffuseColor(colors.GetColor3d('Ivory')) - - # An outline provides context around the data. - # --- - outline = vtkActor() - outline.SetMapper(map_outline) - outline.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Now we are creating three orthogonal planes passing through the - # volume. Each plane uses a different texture map and therefore has --- - skin = vtkActor() - skin.SetMapper(skin_mapper) - skin.GetProperty().SetDiffuseColor(colors.GetColor3d('SkinColor')) - - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) --- - lens = vtkActor() - lens.SetMapper(lens_mapper) - - # It is convenient to create an initial view of the data. The FocalPoint - # and Position form a vector direction. Later on (ResetCamera() method) - # this vector is used to position the camera to look at the data in --- - edgeActor = vtkActor() - edgeActor.SetMapper(edgeMapper) - - diskMapper = vtkPolyDataMapper() - diskMapper.SetInputConnection(diskSource.GetOutputPort()) - diskActor = vtkActor() - diskActor.SetMapper(diskMapper) - diskActor.GetProperty().SetColor(colors.GetColor3d('Gray')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(clipColor) - clipActor.GetProperty().SetInterpolationToFlat() - clipActor.GetProperty().EdgeVisibilityOn() - --- - boundaryActor = vtkActor() - boundaryActor.SetMapper(boundaryMapper) - boundaryActor.GetProperty().SetDiffuseColor(boundaryColor) - - # create renderer render window, and interactor - renderer = vtkRenderer() --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # geometry filter to view the background grid - geometryFilter = vtkRectilinearGridGeometryFilter() - geometryFilter.SetInputData(rgrid) --- - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetRepresentationToWireframe() - wireActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # mapper and actor to view the clipped mesh --- - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) - clipperActor.GetProperty().SetRepresentationToWireframe() - clipperActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # A renderer and render window --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # geometry filter to view the background grid - geometryFilter = vtkRectilinearGridGeometryFilter() - geometryFilter.SetInputData(rgrid) --- - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetRepresentationToWireframe() - - # mapper and actor to view the clipped mesh - clipperMapper = vtkDataSetMapper() --- - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) - clipperActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - - clipperOutsideActor = vtkActor() - clipperOutsideActor.SetMapper(clipperOutsideMapper) - clipperOutsideActor.GetProperty().SetColor( - colors.GetColor3d('Banana')) - - # A renderer and render window --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.GetProperty().SetInterpolationToFlat() - inputActor.GetProperty().SetColor(inputActorColor) - inputActor.SetBackfaceProperty(backFace) - --- - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(decimatedActorColor) - decimatedActor.GetProperty().SetInterpolationToFlat() - decimatedActor.SetBackfaceProperty(backFace) - --- - meshActor = vtkActor() - meshActor.SetMapper(meshMapper) - meshActor.GetProperty().SetRepresentationToWireframe() - meshActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - deform = vtkDeformPointSet() --- - polyActor = vtkActor() - polyActor.SetMapper(polyMapper) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) --- - actor = vtkActor() - actor.SetMapper(mapper) - - point_mapper = vtkPointGaussianMapper() - point_mapper.SetInputData(points) - point_mapper.SetScalarRange(range) --- - point_actor = vtkActor() - point_actor.SetMapper(point_mapper) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) --- - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - - colors = vtkNamedColors() - - # Create a property to be used for the back faces. Turn off all --- - clipped_away_actor = vtkActor() - clipped_away_actor.SetMapper(clipped_away_mapper) - clipped_away_actor.GetProperty().SetDiffuseColor(colors.GetColor3d("Silver")) - clipped_away_actor.GetProperty().SetOpacity(0.1) - - # Create a renderer --- - bottle = vtkActor() - bottle.SetMapper(mapper) - bottle.GetProperty().SetColor(colors.GetColor3d('Mint')) - - # Sisplay the profile. - stripper = vtkStripper() --- - profileActor = vtkActor() - profileActor.SetMapper(profileMapper) - profileActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Add the actors to the renderer, set the background and size. - # --- - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetLineWidth(4) - lineActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # To see the surface --- - surfaceActor = vtkActor() - surfaceActor.SetMapper(surfaceMapper) - surfaceActor.GetProperty().SetColor(colors.GetColor3d('Khaki')) - - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor( - colors.GetColor3d('MediumOrchid')) - - poly = vtkContourTriangulator() --- - poly_actor = vtkActor() - poly_actor.SetMapper(poly_mapper) - poly_actor.GetProperty().SetColor(colors.GetColor3d('Gray')) - - # Standard rendering classes. - renderer = vtkRenderer() --- - meshActor = vtkActor() - meshActor.SetMapper(mapMesh) - meshActor.GetProperty().SetColor(colors.GetColor3d('MidnightBlue')) - - # We will now create a nice looking mesh by wrapping the edges in tubes, - # and putting fat spheres at the points. --- - edgeActor = vtkActor() - edgeActor.SetMapper(mapEdges) - edgeActor.GetProperty().SetColor(colors.GetColor3d('peacock')) - edgeActor.GetProperty().SetSpecularColor(1, 1, 1) - edgeActor.GetProperty().SetSpecular(0.3) - edgeActor.GetProperty().SetSpecularPower(20) --- - ballActor = vtkActor() - ballActor.SetMapper(mapBalls) - ballActor.GetProperty().SetColor(colors.GetColor3d('hot_pink')) - ballActor.GetProperty().SetSpecularColor(1, 1, 1) - ballActor.GetProperty().SetSpecular(0.3) - ballActor.GetProperty().SetSpecularPower(20) --- - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - colors = vtkNamedColors() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('SkinColor')) - back_prop = vtkProperty() - back_prop.SetDiffuseColor(colors.GetColor3d('BackfaceColor')) - actor.SetBackfaceProperty(back_prop) - actor.SetMapper(mapper) --- - popActor = vtkActor() - popActor.SetMapper(popMapper) - popActor.GetProperty().SetOpacity(0.3) - popActor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Construct the pipeline for the delinquent population. --- - lateActor = vtkActor() - lateActor.SetMapper(lateMapper) - lateActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - # Create the axes. - popSplatter.Update() --- - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Label the axes. - XText = vtkVectorText() - XText.SetText(xAxis) --- - popActor = vtkActor() - popActor.SetMapper(popMapper) - popActor.GetProperty().SetOpacity(0.3) - popActor.GetProperty().SetColor(colors.GetColor3d('PopColor')) - - # Construct the pipeline for the delinquent population. --- - lateActor = vtkActor() - lateActor.SetMapper(lateMapper) - lateActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Create axes. - popSplatter.Update() --- - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) - - # Graphics stuff. - renderer = vtkRenderer() - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer.AddActor(actor) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - colors = vtkNamedColors() --- - spring = vtkActor() - spring.SetMapper(mapper) - spring.GetProperty().SetColor(colors.GetColor3d("PowderBlue")) - spring.GetProperty().SetDiffuse(0.7) - spring.GetProperty().SetSpecular(0.4) - spring.GetProperty().SetSpecularPower(20) --- - self.selected_actor = vtkActor() - - def left_button_press_event(self, obj, event): - colors = vtkNamedColors() - - # Get the location of the click (in window coordinates) --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('SeaGreen')) - actor.SetMapper(mapper) - - renderer = vtkRenderer() - ren_win = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - - r = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - g = randomSequence.GetRangeValue(0.4, 1.0) --- - actor = vtkActor() - actor.SetMapper(mapper) - - r = randomSequence.GetRangeValue(0.4, 1.0) - randomSequence.Next() - g = randomSequence.GetRangeValue(0.4, 1.0) --- - silhouetteActor = vtkActor() - silhouetteActor.SetMapper(silhouetteMapper) - silhouetteActor.GetProperty().SetColor(colors.GetColor3d("Tomato")) - silhouetteActor.GetProperty().SetLineWidth(5) - - # Set the custom type to use for interaction. --- - source_actor = vtkActor() - source_actor.SetMapper(source_mapper) - source_actor.GetProperty().SetOpacity(0.6) - source_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('White')) - renderer.AddActor(source_actor) --- - target_actor = vtkActor() - target_actor.SetMapper(target_mapper) - target_actor.GetProperty().SetDiffuseColor( - colors.GetColor3d('Tomato')) - renderer.AddActor(target_actor) - --- - input1Actor = vtkActor() - input1Actor.SetMapper(input1Mapper) - input1Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - input1Actor.GetProperty().SetSpecular(0.6) - input1Actor.GetProperty().SetSpecularPower(20) - input1Actor.SetPosition(input1.GetBounds()[1] - input1.GetBounds()[0], 0, 0) --- - input2Actor = vtkActor() - input2Actor.SetMapper(input2Mapper) - input2Actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Mint')) - input2Actor.GetProperty().SetSpecular(0.6) - input2Actor.GetProperty().SetSpecularPower(20) - input2Actor.SetPosition(-(input1.GetBounds()[1] - input1.GetBounds()[0]), 0, 0) --- - booleanOperationActor = vtkActor() - booleanOperationActor.SetMapper(booleanOperationMapper) - booleanOperationActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - booleanOperationActor.GetProperty().SetSpecular(0.6) - booleanOperationActor.GetProperty().SetSpecularPower(20) - --- - outsideActor = vtkActor() - outsideActor.SetMapper(outsideMapper) - outsideActor.GetProperty().SetDiffuseColor(outsideColor) - outsideActor.GetProperty().SetSpecular(.6) - outsideActor.GetProperty().SetSpecularPower(30) - --- - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(insideColor) - insideActor.GetProperty().SetSpecular(.6) - insideActor.GetProperty().SetSpecularPower(30) - insideActor.GetProperty().EdgeVisibilityOn() --- - borderActor = vtkActor() - borderActor.SetMapper(borderMapper) - borderActor.GetProperty().SetDiffuseColor(borderColor) - borderActor.GetProperty().SetSpecular(.6) - borderActor.GetProperty().SetSpecularPower(30) - borderActor.GetProperty().EdgeVisibilityOn() --- - surfaceActor = vtkActor() - surfaceActor.SetMapper(surfaceMapper) - surfaceActor.GetProperty().SetDiffuseColor(surfaceColor) - surfaceActor.GetProperty().SetOpacity(.1) - - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a scalar bar - scalar_bar = vtkScalarBarActor() - scalar_bar.SetLookupTable(mapper.GetLookupTable()) --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(250, 16) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) --- - actor = vtkActor() - actor.SetMapper(mapper) - - window_width = 800 - window_height = 800 - --- - model = vtkActor() - model.SetMapper(modelMapper) - model.GetProperty().SetDiffuseColor(modelColor) - model.GetProperty().SetInterpolationToFlat() - - stripper = vtkStripper() --- - lines = vtkActor() - lines.SetMapper(linesMapper) - lines.GetProperty().SetDiffuseColor(lineColor) - lines.GetProperty().SetLineWidth(3.) - - renderer = vtkRenderer() --- - input_actor = vtkActor() - input_actor.SetMapper(input_mapper) - input_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - input_actor.GetProperty().SetPointSize(5) - - selected_mapper = vtkDataSetMapper() --- - selected_actor = vtkActor() - selected_actor.SetMapper(selected_mapper) - selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - selected_actor.GetProperty().SetPointSize(5) - - not_selected_mapper = vtkDataSetMapper() --- - not_selected_actor = vtkActor() - not_selected_actor.SetMapper(not_selected_mapper) - not_selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - not_selected_actor.GetProperty().SetPointSize(5) - - # There will be one render window. --- - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.SetBackfaceProperty(backfaces) - inputActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - selectedMapper = vtkDataSetMapper() --- - selectedActor = vtkActor() - selectedActor.SetMapper(selectedMapper) - selectedActor.SetBackfaceProperty(backfaces) - selectedActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - notSelectedMapper = vtkDataSetMapper() --- - notSelectedActor = vtkActor() - notSelectedActor.SetMapper(notSelectedMapper) - notSelectedActor.SetBackfaceProperty(backfaces) - notSelectedActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # There will be one render window --- - cutActor = vtkActor() - cutActor.SetMapper(cutMapper) - cutActor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - cutActor.GetProperty().SetEdgeColor(colors.GetColor3d('Red')) - cutActor.GetProperty().SetLineWidth(2) - cutActor.GetProperty().EdgeVisibilityOn() --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetOpacity(0.3) - sphereActor.GetProperty().SetColor(1, 0, 0) - - implicitPolyDataDistance = vtkImplicitPolyDataDistance() --- - signedDistanceActor = vtkActor() - signedDistanceActor.SetMapper(signedDistanceMapper) - - renderer = vtkRenderer() - renderer.AddViewProp(sphereActor) - renderer.AddViewProp(signedDistanceActor) --- - actor1 = vtkActor() - actor1.SetMapper(mapper) - actor1.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # outline - outline = vtkOutlineFilter() --- - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # assign actor to the renderer - ren.AddActor(actor1) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - actor.GetProperty().SetPointSize(4) - - # assign actor to the renderer --- - actor1 = vtkActor() - actor1.SetMapper(coneMapper1) - - # Actor for rotated arrow - actor2 = vtkActor() - actor2.SetMapper(coneMapper2) - - # Color the original arrow - actor1.GetProperty().SetColor(colors.GetColor3d('LightCoral')) - # Color rotated arrow --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a mapper and actor for smoothed dataset (vtkLoopSubdivisionFilter) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(smooth_loop.GetOutputPort()) - actor_loop = vtkActor() - actor_loop.SetMapper(mapper) - actor_loop.SetPosition(32, 0, 0) - - # Create a mapper and actor for smoothed dataset (vtkButterflySubdivisionFilter) - mapper = vtkPolyDataMapper() --- - actor_butterfly = vtkActor() - actor_butterfly.SetMapper(mapper) - actor_butterfly.SetPosition(64, 0, 0) - - # Visualise - renderer = vtkRenderer() --- - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d('Red')) - - # Create tube filter - tubeFilter = vtkTubeFilter() --- - tubeActor = vtkActor() - tubeActor.SetMapper(tubeMapper) - # Make the tube have some transparency. - tubeActor.GetProperty().SetOpacity(0.5) - - # Setup render window, renderer, and interactor --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('cobalt_green')) --- -actor = vtk.vtkActor() -actor.SetMapper(mapper) - -# Vis for cube so can see it in relation to clipped sphere -mapper2 = vtk.vtkDataSetMapper() -mapper2.SetInputConnection(elev.GetOutputPort()) -actor2 = vtk.vtkActor() -actor2.SetMapper(mapper2) -actor2.GetProperty().SetRepresentationToWireframe() - -ren1 = vtk.vtkRenderer() -ren1.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Visualize - renderer = vtkRenderer() --- - wireActor = vtkActor() - wireActor.SetMapper(rgridMapper) - wireActor.GetProperty().SetColor(colors.GetColor3d("Banana")) - wireActor.GetProperty().EdgeVisibilityOn() - - # Create the usual rendering stuff. --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Visualize - renderer = vtkRenderer() --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor2 = vtkActor() - sphereActor2.SetMapper(sphereMapper) - - cone = vtkConeSource() - cone.SetResolution(5) - glyph = vtkGlyph3D() --- - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor2 = vtkActor() - spikeActor2.SetMapper(spikeMapper) - - spikeActor.SetPosition(0, 0.7, 0) - sphereActor.SetPosition(0, 0.7, 0) - spikeActor2.SetPosition(0, -1.0, -10) --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) - renWin.SetSize(640, 480) --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # - # Create two renderers and assign actors to them. A renderer renders into a - # viewport within the vtkRenderWindow. It is part or all of a window on the --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - coneActor.GetProperty().SetDiffuse(0.7) - coneActor.GetProperty().SetSpecular(0.4) - coneActor.GetProperty().SetSpecularPower(20) --- - coneActor2 = vtkActor() - coneActor2.SetMapper(coneMapper) - # coneActor2.GetProperty().SetColor(colors.GetColor3d('Peacock')) - coneActor2.SetProperty(property) - coneActor2.SetPosition(0, 2, 0) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: --- - actor = vtkActor() - actor.SetMapper(contourMapper) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: - actor.GetProperty().SetInterpolationToGouraud() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tan')) - if flat: - actor.GetProperty().SetInterpolationToFlat() - else: --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Honeydew')) - actor.GetProperty().SetSpecular(0.3) - actor.GetProperty().SetSpecularPower(60.0) - --- - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(border_color)) - - # Line width should be at least 2 to be visible at extremes. - actor.GetProperty().SetLineWidth(border_width) --- - cube_actor = vtkActor() - cube_actor.GetProperty().SetDiffuseColor(colors.GetColor3d('BurlyWood')) - cube_actor.SetMapper(cube_mapper) - cube_actor.GetProperty().EdgeVisibilityOn() - cube_actor.GetProperty().SetLineWidth(2.0) - cube_actor.GetProperty().SetEdgeColor(colors.GetColor3d('PapayaWhip')) --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - cone = vtkConeSource() - cone.SetResolution(6) --- - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - renderer.AddActor(sphereActor) - renderer.AddActor(spikeActor) --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - # Create an actor and give it cube geometry. - cube = vtkCubeSource() --- - cubeActor = vtkActor() - cubeActor.SetMapper(cubeMapper) - cubeActor.GetProperty().SetColor(colors.GetColor3d('CubeColor')) - - # Create an actor and give it sphere geometry. - sphere = vtkSphereSource() --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Melon')) - - # Assign our actors to both renderers. - ren1.AddActor(coneActor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('Red')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A1Diff')) - actor.GetProperty().SetSpecular(0.0) - actor.GetProperty().SetDiffuse(0.5) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('A2Amb')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A2Diff')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('Black')) - actor.GetProperty().SetSpecular(0.2) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('A3Amb')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecular(0.7) - actor.GetProperty().SetDiffuse(0.4) --- - coneActorMain = vtkActor() - coneActorMain.SetMapper(coneMapperMain) - coneActorMain.GetProperty().SetDiffuseColor(colors.GetColor3d("LimeGreen")) - - renderer.AddActor(coneActorMain) - --- - coneActorOutline = vtkActor() - coneActorOutline.SetMapper(coneMapperOutline) - coneActorOutline.GetProperty().SetColor(colors.GetColor3d("Magenta")) - coneActorOutline.GetProperty().LightingOff() - - rendererOutline.AddActor(coneActorOutline) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.RotateX(20) - actor_sphere.RotateY(20) - actor_sphere.SetMapper(mapper) - actor_sphere.GetProperty().SetInterpolationToPBR() --- - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness and coat strength to 1.0 as they act as multipliers --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Blue')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor = vtkActor() - actor.SetOrientation(0.0, 25.0, 0.0) - actor.SetMapper(mapper) - actor.GetProperty().SetInterpolationToPBR() - - # Set metallic, roughness, anisotropy and anisotropyRotation --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetRoughness(0.1) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('DarkTeal')) - actor_sphere.GetProperty().SetBaseIOR(1.0 + i / 3.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 0.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('White')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 1.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Brass')) - actor_sphere.GetProperty().SetMetallic(1.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 2.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Black')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 3.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Cyan')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - actor_sphere = vtkActor() - actor_sphere.SetPosition(i, 4.0, 0.0) - actor_sphere.SetMapper(pd_sphere) - actor_sphere.GetProperty().SetInterpolationToPBR() - actor_sphere.GetProperty().SetColor(colors.GetColor3d('Red')) - actor_sphere.GetProperty().SetRoughness(i / 5.0) --- - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - # Set the model colour. --- - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) --- - actor = vtkActor() - actor.SetMapper(mapper) - # Enable PBR on the model. - actor.GetProperty().SetInterpolationToPBR() - # Configure the basic properties. - actor.GetProperty().SetColor(colors.GetColor3d(parameters['objcolor'])) --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # This creates an outline around the data. - - outline = vtkStructuredGridOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Much of the following is commented out. To try different lookup tables, - # uncomment the appropriate portions. - # --- - modelActor = vtkActor() - modelActor.SetMapper(modelMapper) - modelActor.GetProperty().SetDiffuseColor(colors.GetColor3d(actor_color)) - if actor_color != 'Wheat': - modelActor.GetProperty().SetSpecular(0.6) - modelActor.GetProperty().SetSpecularPower(30) --- - modelAxes = vtkActor() - modelAxes.SetMapper(modelAxesMapper) - - ren1.AddActor(modelAxes) - modelAxes.VisibilityOff() - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetAmbientColor(colors.GetColor3d('SaddleBrown')) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Sienna')) - actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - actor.GetProperty().SetSpecular(0.51) --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - renderer.AddActor(planeActor) - - renderWindow.SetMultiSamples(0) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetLineWidth(5) - actor.GetProperty().SetColor(colors.GetColor3d("Banana")) - - StippledLine(actor, 0xA1A1, 2) --- - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - stripper = vtkStripper() - stripper.SetInputConnection(cyber.GetOutputPort()) --- - stripperActor = vtkActor() - stripperActor.SetMapper(stripperMapper) - stripperActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # Add the actors to the renderer, set the background and size. - # --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d("SlateGray")) - renderer.ResetCamera() --- - cubeActor = vtkActor() - cubeActor.GetProperty().SetDiffuseColor(colors.GetColor3d("DarkGreen")) - cubeActor.SetMapper(cubeMapper) - - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) --- - coneActor = vtkActor() - coneActor.GetProperty().SetDiffuseColor(colors.GetColor3d("DarkTurquoise")) - # Make the cone slightly transparent for fun - coneActor.GetProperty().SetOpacity(0.75) - coneActor.SetMapper(coneMapper) - --- - cowActor = vtkActor() - cowActor.SetMapper(cowMapper) - cowActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - ren.AddActor(cowActor) - --- - cowAxes = vtkActor() - cowAxes.SetMapper(cowAxesMapper) - cowAxes.VisibilityOff() - - ren.AddActor(cowAxes) - --- - grid_actor = vtkActor() - grid_actor.SetMapper(grid_mapper) - grid_actor.GetProperty().EdgeVisibilityOn() - grid_actor.GetProperty().SetEdgeColor(colors.GetColor3d('Blue')) - - # Visualize --- - sgridActor = vtkActor() - sgridActor.SetMapper(sgridMapper) - sgridActor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Create the usual rendering stuff - renderer = vtkRenderer() --- - volActor = vtkActor() - volActor.SetMapper(volMapper) - volActor.GetProperty().EdgeVisibilityOn() - volActor.GetProperty().SetColor(colors.GetColor3d('Salmon')) - renderer.AddActor(volActor) - renderer.SetBackground(colors.GetColor3d('SlateGray')) --- - vectorActor = vtkActor() - vectorActor.SetMapper(vectorMapper) - vectorActor.GetProperty().SetOpacity(0.99) - vectorActor.GetProperty().SetLineWidth(1.5) - - # Outline --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Texture maps. - textureMaps = list() --- - anActor2 = vtkActor() - - anActor2.SetMapper(aMapper) - anActor2.SetTexture(aTexture2) - anActor2.SetPosition(positions[i]) - anActor2.SetScale(2.0, 2.0, 2.0) --- - innerSphere = vtkActor() - innerSphere.SetMapper(innerMapper) - innerSphere.GetProperty().SetColor(colors.GetColor3d('BlanchedAlmond')) - - # sphere to texture - sphere2 = vtkSphereSource() --- - outerSphere = vtkActor() - outerSphere.SetMapper(outerMapper) - outerSphere.SetTexture(texture) - outerSphere.GetProperty().SetColor(colors.GetColor3d('LightSalmon')) - - renWin = vtkRenderWindow() --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.SetTexture(atext) - - # Create the RenderWindow, Renderer and Interactor. - renderer = vtkRenderer() --- - wallActor = vtkActor() - wallActor.SetMapper(wallMap) - wallActor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # Make the fin (rear wall) - fin = vtkStructuredGridGeometryFilter() --- - finActor = vtkActor() - finActor.SetMapper(finMap) - finActor.GetProperty().SetColor(colors.GetColor3d('DarkSlateGray')) - - # Get the texture. - tmap = vtkStructuredPointsReader() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineProp = outlineActor.GetProperty() - outlineProp.SetColor(colors.GetColor3d('Black')) - - # Add the remaining actors to the renderer, set the background and size. --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # - # Create the Renderer and assign actors to it. A renderer is like a --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - ren1 = vtkRenderer() - ren1.AddActor(coneActor) --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # - # Create two renderers and assign actors to them. A renderer renders into --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(0.2, 0.63, 0.79) - coneActor.GetProperty().SetDiffuse(0.7) - coneActor.GetProperty().SetSpecular(0.4) - coneActor.GetProperty().SetSpecularPower(20) --- - coneActor2 = vtkActor() - coneActor2.SetMapper(coneMapper) - coneActor2.GetProperty().SetColor(colors.GetColor3d("LightSeaGreen")) - coneActor2.SetProperty(property) - coneActor2.SetPosition(0, 2, 0) - --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # - # Create the Renderer and assign actors to it. A renderer is like a --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # - # Create the Renderer and assign actors to it. A renderer is like a --- - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - --- - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - --- - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) - insideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Banana')) - insideActor.GetProperty().SetAmbient(0.3) - insideActor.GetProperty().EdgeVisibilityOn() - --- - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) - clippedActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - insideActor.GetProperty().SetAmbient(0.3) - clippedActor.GetProperty().EdgeVisibilityOn() - --- - ugridActor = vtkActor() - ugridActor.SetMapper(ugridMapper) - ugridActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - ugridActor.GetProperty().EdgeVisibilityOn() - - renderer.AddActor(ugridActor) --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("Peacock")) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.SetMapper(mapper) - # actor.SetPosition(-5, -5, 0) --- - actor = vtkActor() - actor.SetMapper(mapper) - - ren.AddActor(actor) - - ren_win.Render() --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - ren = vtkRenderer() - ren_win = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mappers[i]) - actors.append(actor) - - # Add a scalar bar. - scalar_bar = vtkScalarBarActor() --- - cone_actor = vtkActor() - cone_actor.SetMapper(cone_mapper) - cone_actor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - ren = vtkRenderer() - ren.AddActor(cone_actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Crimson')) - actor.GetProperty().SetSpecular(.6) - actor.GetProperty().SetSpecularPower(30) - --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('IndianRed')) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.SetMapper(mapper) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - renderer = vtkRenderer() - renderer.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Visualize - ren = vtkRenderer() - ren_win = vtkRenderWindow() --- - humanActor = vtkActor() - humanActor.SetMapper(humanMapper) - bounds = humanActor.GetBounds() - # Scale the actor - humanActor.SetScale(1.0 / max(bounds)) - ren.AddActor(humanActor) --- - actor = vtkActor() - actor.SetMapper(mapper) - mappers.append(mapper) - actors.append(actor) - actors[0].GetProperty().SetColor(colors.GetColor3d('SeaGreen')) # Transverse plane - actors[1].GetProperty().SetColor(colors.GetColor3d('DeepSkyBlue')) # Coronal plane --- - textActor1 = vtkActor() - textActor1.SetMapper(textMapper1) - textActor1.SetScale(scale) - textActor1.AddPosition(0.4, 0.49, 0.01) - textActors.append(textActor1) - --- - textActor2 = vtkActor() - textActor2.SetMapper(textMapper2) - textActor2.SetScale(scale) - textActor2.AddPosition(0.4, -0.49, -0.01) - textActors.append(textActor2) - --- - textActor3 = vtkActor() - textActor3.SetMapper(textMapper3) - textActor3.SetScale(scale) - textActor3.AddPosition(-0.01, 0.49, 0.4) - textActors.append(textActor3) - --- - textActor4 = vtkActor() - textActor4.SetMapper(textMapper4) - textActor4.SetScale(scale) - textActor4.AddPosition(0.01, -0.49, 0.4) - textActors.append(textActor4) - --- - textActor5 = vtkActor() - textActor5.SetMapper(textMapper5) - textActor5.SetScale(scale) - textActor5.AddPosition(0.49, 0.01, 0.20) - textActors.append(textActor5) - --- - textActor6 = vtkActor() - textActor6.SetMapper(textMapper6) - textActor6.SetScale(scale) - textActor6.AddPosition(-0.49, -0.01, 0.3) - textActors.append(textActor6) - return textActors --- - outline = vtkActor() - outline.SetMapper(outlineMapper) - outline.GetProperty().SetColor(colors.GetColor3d('Moccasin')) - outline.GetProperty().SetLineWidth(2.0) - - # --- - wallActor = vtkActor() - wallActor.SetMapper(wallMap) - wallActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - fin = vtkStructuredGridGeometryFilter() - fin.SetInputData(pd) --- - finActor = vtkActor() - finActor.SetMapper(finMap) - finActor.GetProperty().SetColor(colors.GetColor3d('Silver')) - # - # regular streamlines - # --- - rake1 = vtkActor() - rake1.SetMapper(rakeMapper) - rake1.GetProperty().SetColor(colors.GetColor3d('Black')) - rake1.GetProperty().SetLineWidth(5) - - streamers = vtkStreamTracer() --- - lines = vtkActor() - lines.SetMapper(streamersMapper) - - aren.AddActor(outline) - aren.AddActor(wallActor) - aren.AddActor(finActor) --- - vectorActor = vtkActor() - vectorActor.SetMapper(vectorMapper) - - # Speed contours. - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetRepresentationToWireframe() - isoActor.GetProperty().SetOpacity(0.25) - - # Outline --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Add the actors to the renderer, set the background and size. - # --- - streamerActor = vtkActor() - streamerActor.SetMapper(streamerMapper) - - # Speed contours. - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetRepresentationToWireframe() - isoActor.GetProperty().SetOpacity(0.25) - - # Outline --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - - # Add the actors to the renderer, set the background and size. - # --- - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(colors.GetColor3d('MidnightBlue')) - clipActor.GetProperty().SetRepresentationToWireframe() - - clipInsideMapper = vtkPolyDataMapper() --- - clipInsideActor = vtkActor() - clipInsideActor.SetMapper(clipInsideMapper) - clipInsideActor.GetProperty().SetDiffuseColor(colors.GetColor3d('LightBlue')) - - # Create graphics stuff - # --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('WhiteSmoke')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputConnection(pl3d.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) --- - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # Create outline - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d("Brown")) - outlineActor.GetProperty().SetLineWidth(3.0) - - # --- - letter = vtkActor() - letter.SetMapper(mapper) - - ren1.AddActor(letter) - letter.GetProperty().SetDiffuseColor(colors.GetColor3d("LampBlack")) - letter.GetProperty().SetRepresentationToWireframe() --- - cutActor = vtkActor() - cutActor.SetMapper(cutMapper) - - # Extract the plane. - compPlane = vtkStructuredGridGeometryFilter() - compPlane.SetInputData(sg) --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.GetProperty().SetRepresentationToWireframe() - planeActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - # Outline. --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - # Add the actors to the renderer, set the background and size. - # --- - planeActor = vtkActor() - planeActor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - planeActor.GetProperty().SetLineWidth(2) - planeActor.GetProperty().SetAmbient(1.0) - planeActor.GetProperty().SetDiffuse(0.0) - planeActor.SetMapper(cutterMapper) --- - cubeActor = vtkActor() - cubeActor.GetProperty().SetColor(colors.GetColor3d('Aquamarine')) - cubeActor.GetProperty().SetOpacity(0.5) - cubeActor.SetMapper(cubeMapper) - - # create renderers and add actors of plane and cube --- - cutterActor = vtkActor() - cutterActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - cutterActor.GetProperty().SetLineWidth(2) - cutterActor.SetMapper(cutterMapper) - - # Create model actor --- - modelActor = vtkActor() - modelActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - modelActor.SetMapper(modelMapper) - - # Create renderers and add actors of plane and model - renderer = vtkRenderer() --- - cutterActor = vtkActor() - cutterActor.GetProperty().SetColor(colors.GetColor3d('Banana')) - cutterActor.GetProperty().SetLineWidth(2) - cutterActor.SetMapper(cutterMapper) - - # Create the model actor --- - modelActor = vtkActor() - modelActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - modelActor.SetMapper(modelMapper) - - # Create renderers and add the plane and model actors. - renderer = vtkRenderer() --- - aBeamActor = vtkActor() - aBeamActor.SetMapper(aBeamMapper) - aBeamActor.AddPosition(0, 0, 0) - aBeamActor.GetProperty().SetColor( - colors.GetColor3d('Yellow')) - aBeamActor.GetProperty().SetOpacity(0.60) --- - planeActor = vtkActor() - planeActor.GetProperty().SetColor( - colors.GetColor3d('Red')) - planeActor.GetProperty().SetLineWidth(2) - planeActor.SetMapper(cutterMapper) - --- - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetAmbient(.5) - decimatedActor.GetProperty().SetDiffuse(.5) - decimatedActor.SetTexture(texture) - --- - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetAmbient(.5) - originalActor.GetProperty().SetDiffuse(.5) - originalActor.SetTexture(texture) - --- - decimatedActor = vtkActor() - decimatedActor.SetMapper(decimatedMapper) - decimatedActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - decimatedActor.GetProperty().SetRepresentationToWireframe() - - originalMapper = vtkPolyDataMapper() --- - originalActor = vtkActor() - originalActor.SetMapper(originalMapper) - originalActor.GetProperty().SetColor(colors.GetColor3d('Sienna')) - - # Create the RenderWindow, Renderer and Interactor. - # --- - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() --- - carpet = vtkActor() - carpet.SetMapper(mapper) - - # Assign our actor to the renderer. - ren.AddActor(carpet) - ren.SetBackground(colors.GetColor3d('Beige')) --- - dataActor = vtkActor() - dataActor.SetMapper(dataMapper) - - # outline - outline = vtkOutlineFilter() - outline.SetInputConnection(sample.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(0, 0, 0) - - # Add the actors to the renderer, set the background and size - # --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(extractVOI.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren1.AddActor(outlineActor) - ren1.AddActor(isoActor) --- - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) - iso_actor.GetProperty().SetColor(colors.GetColor3d('Ivory')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) --- - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - - # Add the actors to the renderer, set the background and size. - # - ren.AddActor(outline_actor) --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('Wheat')) - - outline = vtkOutlineFilter() - outline.SetInputConnection(extractVOI.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) --- - lineActor = vtkActor() - lineActor.SetMapper(lineMapper) - lineActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - lineActor.GetProperty().SetLineWidth(3.0) - - # Create implicit model with vtkImplicitModeller. This computes a scalar --- - impActor = vtkActor() - impActor.SetMapper(impMapper) - impActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - impActor.GetProperty().SetOpacity(0.5) - - # Create the usual graphics stuff. --- - s1Actor = vtkActor() - s1Actor.SetMapper(s1Mapper) - - s2 = vtkHyperStreamline() - s2.SetInputData(ptLoad.GetOutput()) - s2.SetStartPosition(-9, -9, -9) --- - s2Actor = vtkActor() - s2Actor.SetMapper(s2Mapper) - - s3 = vtkHyperStreamline() - s3.SetInputData(ptLoad.GetOutput()) - s3.SetStartPosition(9, -9, -9) --- - s3Actor = vtkActor() - s3Actor.SetMapper(s3Mapper) - - s4 = vtkHyperStreamline() - s4.SetInputData(ptLoad.GetOutput()) - s4.SetStartPosition(-9, 9, -9) --- - s4Actor = vtkActor() - s4Actor.SetMapper(s4Mapper) - - # A plane for context. - # - g = vtkImageDataGeometryFilter() --- - ga = vtkActor() - ga.SetMapper(gm) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create a cone indicating the application of the load. - # --- - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('Tomato')) - --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('Chocolate')) - - # The same here for the ice cream. - # --- - creamActor = vtkActor() - creamActor.SetMapper(creamMapper) - creamActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Mint')) - creamActor.GetProperty().SetSpecular(.6) - creamActor.GetProperty().SetSpecularPower(50) - --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d("Banana")) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - # - ren1.AddActor(outlineActor) --- - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - floorActor.GetProperty().SetLineWidth(2) - --- - subFloorActor = vtkActor() - - subFloorActor.SetMapper(subFloorMapper) - - subFloor2Comp = vtkStructuredGridGeometryFilter() - subFloor2Comp.SetExtent(0, 37, 60, 75, 22, 22) --- - subFloor2Actor = vtkActor() - - subFloor2Actor.SetMapper(subFloor2Mapper) - - postComp = vtkStructuredGridGeometryFilter() - --- - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - fanComp = vtkStructuredGridGeometryFilter() - fanComp.SetExtent(0, 37, 38, 38, 0, 37) --- - fanActor = vtkActor() - - fanActor.SetMapper(fanMapper) - fanActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # streamers --- - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - # outline - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # Create graphics stuff. - ren1 = vtkRenderer() --- - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - floorActor.GetProperty().SetLineWidth(2) - --- - subFloorActor = vtkActor() - - subFloorActor.SetMapper(subFloorMapper) - - subFloor2Comp = vtkStructuredGridGeometryFilter() - subFloor2Comp.SetExtent(0, 37, 60, 75, 22, 22) --- - subFloor2Actor = vtkActor() - - subFloor2Actor.SetMapper(subFloor2Mapper) - - postComp = vtkStructuredGridGeometryFilter() - postComp.SetExtent(10, 10, 0, 75, 0, 37) --- - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - fanComp = vtkStructuredGridGeometryFilter() - fanComp.SetExtent(0, 37, 38, 38, 0, 37) --- - fanActor = vtkActor() - - fanActor.SetMapper(fanMapper) - fanActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # streamers --- - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - # outline - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Beige')) - - # Create graphics stuff. - ren1 = vtkRenderer() --- - floorActor = vtkActor() - floorActor.SetMapper(floorMapper) - floorActor.GetProperty().SetRepresentationToWireframe() - floorActor.GetProperty().SetColor(colors.GetColor3d('Black')) - floorActor.GetProperty().SetLineWidth(2) - --- - postActor = vtkActor() - postActor.SetMapper(postMapper) - postActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # streamers - # --- - tubesActor = vtkActor() - tubesActor.SetMapper(mapTubes) - - renderer = vtkRenderer() - - renderer.AddActor(floorActor) --- - triangleEdgeActor = vtkActor() - triangleEdgeActor.SetMapper(triangleEdgeMapper) - triangleEdgeActor.GetProperty().SetDiffuseColor( - color.GetColor3d('lamp_black')) - triangleEdgeActor.GetProperty().SetSpecular(.4) - triangleEdgeActor.GetProperty().SetSpecularPower(10) --- - Triangles = vtkActor() - Triangles.SetMapper(aMapper) - Triangles.GetProperty().SetDiffuseColor( - color.GetColor3d('banana')) - Triangles.GetProperty().SetOpacity(.6) - --- - CubeEdges = vtkActor() - CubeEdges.SetMapper(TubeMapper) - CubeEdges.GetProperty().SetDiffuseColor( - color.GetColor3d('khaki')) - CubeEdges.GetProperty().SetSpecular(.4) - CubeEdges.GetProperty().SetSpecularPower(10) --- - CubeVertices = vtkActor() - CubeVertices.SetMapper(SphereMapper) - CubeVertices.GetProperty().SetDiffuseColor( - color.GetColor3d('tomato')) - - # Define the text for the label --- - labelActor = vtkActor() - labelActor.SetMapper(labelMapper) - - # Define the base that the cube sits on. Create its associated mapper - # and actor. Set the position of the actor. - baseModel = vtkCubeSource() --- - base = vtkActor() - base.SetMapper(baseMapper) - base.SetPosition(.5, -0.09, .5) - - # Set the scalar values for this case of marching cubes. - # A negative case number will generate a complementary case --- - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) --- - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) --- - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) --- - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) --- - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) --- - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) --- - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the source for the streamtubes. - seeds = vtkPointSource() --- - streamersActor = vtkActor() - streamersActor.SetMapper(mapStreamers) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - streamTubeActor = vtkActor() - streamTubeActor.SetMapper(mapStreamTube) - streamTubeActor.GetProperty().BackfaceCullingOn() - - # Create the scene. - # We generate a whole bunch of planes which correspond to --- - table1Actor = vtkActor() - table1Actor.SetMapper(mapTable1) - table1Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - table2 = vtkStructuredGridGeometryFilter() - table2.SetInputData(reader.GetStructuredGridOutput()) --- - table2Actor = vtkActor() - table2Actor.SetMapper(mapTable2) - table2Actor.GetProperty().SetColor(colors.GetColor3d('TableTop')) - - FilingCabinet1 = vtkStructuredGridGeometryFilter() - FilingCabinet1.SetInputData(reader.GetStructuredGridOutput()) --- - FilingCabinet1Actor = vtkActor() - FilingCabinet1Actor.SetMapper(mapFilingCabinet1) - FilingCabinet1Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - FilingCabinet2 = vtkStructuredGridGeometryFilter() - FilingCabinet2.SetInputData(reader.GetStructuredGridOutput()) --- - FilingCabinet2Actor = vtkActor() - FilingCabinet2Actor.SetMapper(mapFilingCabinet2) - FilingCabinet2Actor.GetProperty().SetColor(colors.GetColor3d('FilingCabinet')) - - bookshelf1Top = vtkStructuredGridGeometryFilter() - bookshelf1Top.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1TopActor = vtkActor() - bookshelf1TopActor.SetMapper(mapBookshelf1Top) - bookshelf1TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Bottom = vtkStructuredGridGeometryFilter() - bookshelf1Bottom.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1BottomActor = vtkActor() - bookshelf1BottomActor.SetMapper(mapBookshelf1Bottom) - bookshelf1BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Front = vtkStructuredGridGeometryFilter() - bookshelf1Front.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1FrontActor = vtkActor() - bookshelf1FrontActor.SetMapper(mapBookshelf1Front) - bookshelf1FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1Back = vtkStructuredGridGeometryFilter() - bookshelf1Back.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1BackActor = vtkActor() - bookshelf1BackActor.SetMapper(mapBookshelf1Back) - bookshelf1BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1LHS = vtkStructuredGridGeometryFilter() - bookshelf1LHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1LHSActor = vtkActor() - bookshelf1LHSActor.SetMapper(mapBookshelf1LHS) - bookshelf1LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf1RHS = vtkStructuredGridGeometryFilter() - bookshelf1RHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf1RHSActor = vtkActor() - bookshelf1RHSActor.SetMapper(mapBookshelf1RHS) - bookshelf1RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Top = vtkStructuredGridGeometryFilter() - bookshelf2Top.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2TopActor = vtkActor() - bookshelf2TopActor.SetMapper(mapBookshelf2Top) - bookshelf2TopActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Bottom = vtkStructuredGridGeometryFilter() - bookshelf2Bottom.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2BottomActor = vtkActor() - bookshelf2BottomActor.SetMapper(mapBookshelf2Bottom) - bookshelf2BottomActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Front = vtkStructuredGridGeometryFilter() - bookshelf2Front.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2FrontActor = vtkActor() - bookshelf2FrontActor.SetMapper(mapBookshelf2Front) - bookshelf2FrontActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2Back = vtkStructuredGridGeometryFilter() - bookshelf2Back.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2BackActor = vtkActor() - bookshelf2BackActor.SetMapper(mapBookshelf2Back) - bookshelf2BackActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2LHS = vtkStructuredGridGeometryFilter() - bookshelf2LHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2LHSActor = vtkActor() - bookshelf2LHSActor.SetMapper(mapBookshelf2LHS) - bookshelf2LHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - bookshelf2RHS = vtkStructuredGridGeometryFilter() - bookshelf2RHS.SetInputData(reader.GetStructuredGridOutput()) --- - bookshelf2RHSActor = vtkActor() - bookshelf2RHSActor.SetMapper(mapBookshelf2RHS) - bookshelf2RHSActor.GetProperty().SetColor(colors.GetColor3d('BookShelf')) - - window = vtkStructuredGridGeometryFilter() - window.SetInputData(reader.GetStructuredGridOutput()) --- - windowActor = vtkActor() - windowActor.SetMapper(mapWindow) - windowActor.GetProperty().SetColor(colors.GetColor3d('WindowColor')) - - outlet = vtkStructuredGridGeometryFilter() - outlet.SetInputData(reader.GetStructuredGridOutput()) --- - outletActor = vtkActor() - outletActor.SetMapper(mapOutlet) - outletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - inlet = vtkStructuredGridGeometryFilter() - inlet.SetInputData(reader.GetStructuredGridOutput()) --- - inletActor = vtkActor() - inletActor.SetMapper(mapInlet) - inletActor.GetProperty().SetColor(colors.GetColor3d('lamp_black')) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(reader.GetStructuredGridOutput()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(mapOutline) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the rendering window, renderer, and interactive renderer. - ren = vtkRenderer() --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('raw_sienna')) - - # Get an outline of the data set for context. - outline = vtkOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('raw_sienna')) - - # Get an outline of the data set for context. - outline = vtkOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() --- - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - plateActor.GetProperty().SetColor( - colors.GetColor3d('PlateColor')) - plateActor.RotateX(-90) - --- - outlineActor = vtkActor() - outlineActor.SetMapper(spikeMapper) - outlineActor.RotateX(-90) - outlineActor.GetProperty().SetColor(colors.GetColor3d('White')) - - # Create the RenderWindow, Renderer and both Actors --- - tpd1Actor = vtkActor() - tpd1Actor.SetMapper(mapTpd1) - tpd1Actor.GetProperty().SetColor(0, 0, 0) - tpd1Actor.GetProperty().SetLineWidth(2.0) - - transP2 = vtkTransform() --- - tpd2Actor = vtkActor() - tpd2Actor.SetMapper(mapTpd2) - tpd2Actor.GetProperty().SetColor(0, 0, 0) - tpd2Actor.GetProperty().SetLineWidth(2.0) - - transP3 = vtkTransform() --- - tpd3Actor = vtkActor() - tpd3Actor.SetMapper(mapTpd3) - tpd3Actor.GetProperty().SetColor(0, 0, 0) - tpd3Actor.GetProperty().SetLineWidth(2.0) - - appendF = vtkAppendPolyData() --- - planeActor = vtkActor() - planeActor.SetMapper(contourMapper) - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(sg) - --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(0, 0, 0) - outlineActor.GetProperty().SetLineWidth(2.0) - - # Create the RenderWindow, Renderer and both Actors --- - splatActor = vtkActor() - splatActor.SetMapper(splatMapper) - - # Create outline. - outline = vtkOutlineFilter() - outline.SetInputConnection(splat.GetOutputPort()) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Brown')) - - # Create cone to indicate direction. - cone = vtkConeSource() --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.SetScale(0.75, 0.75, 0.75) - coneActor.RotateZ(45.0) - coneActor.AddPosition(0.50, 0.50, 0.0) - coneActor.GetProperty().SetColor(colors.GetColor3d('DeepPink')) --- - franActor = vtkActor() - franActor.SetMapper(franMapper) - franActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - # We subsample the dataset because we want to glyph just a subset of - # the points. Otherwise the display is cluttered and cannot be easily --- - spikeActor = vtkActor() - spikeActor.SetMapper(spikeMapper) - spikeActor.GetProperty().SetColor(colors.GetColor3d('Emerald_Green')) - - # Create the RenderWindow, Renderer and Interactor. - # --- - splatActor = vtkActor() - splatActor.SetMapper(splatMapper) - splatActor.GetProperty().SetColor(colors.GetColor3d('Flesh')) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(cyber.GetOutputPort()) --- - cyberActor = vtkActor() - cyberActor.SetMapper(cyberMapper) - cyberActor.GetProperty().SetRepresentationToWireframe() - cyberActor.GetProperty().SetColor(colors.GetColor3d('Turquoise')) - - # Add the actors to the renderer, set the background and size. --- - StockActor = vtkActor() - StockActor.SetMapper(StockMapper) - - renderers[r].AddActor(StockActor) - renderers[r].AddActor(LabelActor) - LabelActor.SetCamera(renderers[r].GetActiveCamera()) --- - streamline = vtkActor() - seeds2 = vtkPolyData() - streamline2 = vtkActor() - - # The line widget is used seed the streamlines. - lineWidget = vtkLineWidget() - lineWidget.SetResolution(numOfStreamLines) - lineWidget.SetInputData(pl3d_output) --- - outlineActor = vtkActor() - outlineActor.GetProperty().SetColor(colors.GetColor3d("Black")) - outlineActor.SetMapper(outlineMapper) - - # Add the actors to the renderer, set the background and size. - ren.AddActor(outlineActor) --- - tensorActor = vtkActor() - tensorActor.SetMapper(tensorAxesMapper) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # - # Create a cone whose apex indicates the application of load. --- - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('BurlyWood')) - --- - tensorActor = vtkActor() - tensorActor.SetMapper(tensorEllipsoidsMapper) - - # Create an outline around the data. - # - outline = vtkOutlineFilter() --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create a cone whose apex indicates the application of load. - # --- - coneActor = vtkActor() - coneActor.SetMapper(coneMap) - coneActor.SetPosition(0, 0, 11) - coneActor.RotateY(90) - coneActor.GetProperty().SetColor(colors.GetColor3d('Red')) - --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # The outline provides context for the data and the planes. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the RenderWindow, Renderer and both Actors - # --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - - # The outline provides context for the data and the planes. - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3dOutput) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # Create the usual graphics stuff. - # --- - actor11 = vtkActor() - actor11.SetMapper(mapper11) - actor12 = vtkActor() - actor12.SetMapper(mapper12) - - # Let's read in the data we wrote out. - reader1 = vtkXMLPolyDataReader() - reader1.SetFileName("pdlut.vtp") --- - actor21 = vtkActor() - actor21.SetMapper(mapper11) - - mapper22 = vtkPolyDataMapper() - mapper22.SetInputConnection(reader2.GetOutputPort()) - mapper22.SetScalarModeToUseCellData() --- - actor22 = vtkActor() - actor22.SetMapper(mapper22) - - # Define viewport ranges. - # (xmin, ymin, xmax, ymax) - viewport11 = [0.0, 0.0, 0.5, 0.5] --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetPosition(0, 0, 0) - actor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - - renderer.AddActor(actor) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetPosition(0, 0, 0) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Set up the text and add it to the renderer --- - logo = vtkActor() - logo.SetMapper(logoMapper) - - # Now create an implicit model of the same letter. - blobbyLogoImp = vtkImplicitModeller() - blobbyLogoImp.SetInputConnection(appendAll.GetOutputPort()) --- - blobbyLogo = vtkActor() - blobbyLogo.SetMapper(blobbyLogoMapper) - blobbyLogo.SetProperty(banana) - - # Position the letters. - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetSpecular(0.6) - actor.GetProperty().SetSpecularPower(30) - actor.GetProperty().SetColor(colors.GetColor3d('LightSkyBlue')) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - ren = vtkRenderer() - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('MidnightBlue')) --- - actor1 = vtkActor() - actor1.SetMapper(mapper1) - actor1.GetProperty().BackfaceCullingOn() - actor1.SetUserTransform(transform0) - actor1.GetProperty().SetDiffuseColor(colors.GetColor3d("Tomato")) - actor1.GetProperty().SetRepresentationToWireframe() --- - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().BackfaceCullingOn() - actor2.SetUserMatrix(matrix1) - - mapper3 = vtkPolyDataMapper() --- - actor3 = vtkActor() - actor3.SetMapper(mapper3) - actor3.GetProperty().SetColor(colors.GetColor3d("Black")) - actor3.GetProperty().SetLineWidth(3.0) - - txt = vtkTextActor() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - # assign actor to the renderer - ren.AddActor(actor) --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - - # Contouring - contourLineMapper = vtkPolyDataMapper() - contourLineMapper.SetInputData(bandedContours.GetContourEdgesOutput()) --- - contourLineActor = vtkActor() - contourLineActor.SetMapper(contourLineMapper) - contourLineActor.GetProperty().SetColor( - colors.GetColor3d('DimGray')) - - # Set up the Orientation Marker Widget. --- - cube_actor = vtkActor() - cube_actor.SetMapper(cube_mapper) - - # Assemble the colored cube and annotated cube texts into a composite prop. - prop_assembly = vtkPropAssembly() - prop_assembly.AddPart(annotated_cube) --- - hhogActor = vtkActor() - hhogActor.SetMapper(hhogMapper) - - outline = vtkOutlineFilter() - outline.SetInputConnection(reader.GetOutputPort()) - --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - - # Setup render window, renderer, and interactor. - renderer = vtkRenderer() --- - superquadricActor = vtkActor() - superquadricActor.SetMapper(mapper) - superquadricActor.GetProperty().SetDiffuseColor(actorColor) - superquadricActor.GetProperty().SetDiffuse(.7) - superquadricActor.GetProperty().SetSpecular(.7) - superquadricActor.GetProperty().SetSpecularPower(50.0) --- - src_actor = vtkActor() - src_actor.SetMapper(src_mapper) - - # Create contour edges - edge_mapper = vtkPolyDataMapper() - edge_mapper.SetInputData(bcf.GetContourEdgesOutput()) --- - edge_actor = vtkActor() - edge_actor.SetMapper(edge_mapper) - edge_actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - glyph_mapper = vtkPolyDataMapper() - glyph_mapper.SetInputConnection(glyph.GetOutputPort()) --- - glyph_actor = vtkActor() - glyph_actor.SetMapper(glyph_mapper) - - window_width = 800 - window_height = 800 - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # A renderer and render window - renderer = vtkRenderer() --- - contourActor = vtkActor() - contourActor.SetMapper(contourMapper) - - # -- create a box around the function to indicate the sampling volume -- - - # create outline --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - outlineActor.GetProperty().SetColor(colors.GetColor3d('Black')) - - # setup the window - ren1 = vtkRenderer() --- - src_actor = vtkActor() - src_actor.SetMapper(src_mapper) - - # Create contour edges - edge_mapper = vtkPolyDataMapper() - edge_mapper.SetInputData(bcf.GetContourEdgesOutput()) --- - edge_actor = vtkActor() - edge_actor.SetMapper(edge_mapper) - edge_actor.GetProperty().SetColor(colors.GetColor3d('Black')) - - glyph_mapper = vtkPolyDataMapper() - glyph_mapper.SetInputConnection(glyph.GetOutputPort()) --- - glyph_actor = vtkActor() - glyph_actor.SetMapper(glyph_mapper) - - window_width = 800 - window_height = 800 - --- - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - --- - actor = vtkActor() - actor.SetMapper(mapper) - - return actor - - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetOpacity(tissue['opacity']) - actor.GetProperty().SetDiffuseColor(lut.GetTableValue(tissue['tissue'])[:3]) - actor.GetProperty().SetSpecular(0.5) - actor.GetProperty().SetSpecularPower(10) --- - actor = vtkActor() - actor.SetMapper(mapper) - - actor.GetProperty().SetOpacity(parameters['opacity'][tissue]) - actor.GetProperty().SetDiffuseColor(color_lut.GetTableValue(parameters['indices'][tissue])[:3]) - actor.GetProperty().SetSpecular(0.2) --- - grey_actor = vtkActor() - grey_actor.SetMapper(grey_mapper) - grey_actor.SetTexture(grey_texture) - - segment_reader = vtkMetaImageReader() - segment_reader.SetFileName(str(fn_2)) --- - segment_actor = vtkActor() - segment_actor.SetMapper(segment_mapper) - segment_actor.SetTexture(segment_texture) - - segment_overlay_actor = vtkActor() - segment_overlay_actor.SetMapper(segment_mapper) - segment_overlay_actor.SetTexture(segment_texture) - - segment_overlay_actor.GetProperty().SetOpacity(.5) - ren1.SetBackground(0, 0, 0) --- - actor = vtkActor() - actor.SetMapper(mapper) - - ren = vtkRenderer() - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d("DarkGray")) --- - table = vtkActor() - ren.AddActor(table) - table.SetMapper(tableMapper) - # table.GetProperty().SetColor(0.9569, 0.6431, 0.3765) - table.GetProperty().SetColor(colors.GetColor3d('SaddleBrown')) - table.AddPosition(gv.D, 0, 0) --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphereMapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('Bisque')) - - ren1.AddActor(sphereActor) - ren1.GetActiveCamera().ParallelProjectionOn() --- - hawaiiActor = vtkActor() - hawaiiActor.SetMapper(hawaiiMapper) - - # Create the RenderWindow, Renderer and both Actors - # - ren = vtkRenderer() --- - sphere = vtkActor() - sphere.SetMapper(map_sphere) - - # Visualize - renderer = vtkRenderer() - render_window = vtkRenderWindow() --- - outline = vtkActor() - outline.SetMapper(outlineMapper) - outline.GetProperty().SetColor(colors.GetColor3d('LampBlack')) - - # - # Set up shaded surfaces (i.e., supporting geometry). --- - door = vtkActor() - door.SetMapper(mapDoor) - door.GetProperty().SetColor(colors.GetColor3d('Burlywood')) - - window1Geom = vtkStructuredGridGeometryFilter() - window1Geom.SetInputConnection(reader.GetOutputPort()) --- - window1 = vtkActor() - window1.SetMapper(mapWindow1) - window1.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window1.GetProperty().SetOpacity(.6) - - window2Geom = vtkStructuredGridGeometryFilter() --- - window2 = vtkActor() - window2.SetMapper(mapWindow2) - window2.GetProperty().SetColor(colors.GetColor3d('SkyBlue')) - window2.GetProperty().SetOpacity(.6) - - klower1Geom = vtkStructuredGridGeometryFilter() --- - klower1 = vtkActor() - klower1.SetMapper(mapKlower1) - klower1.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower2Geom = vtkStructuredGridGeometryFilter() - klower2Geom.SetInputConnection(reader.GetOutputPort()) --- - klower2 = vtkActor() - klower2.SetMapper(mapKlower2) - klower2.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower3Geom = vtkStructuredGridGeometryFilter() - klower3Geom.SetInputConnection(reader.GetOutputPort()) --- - klower3 = vtkActor() - klower3.SetMapper(mapKlower3) - klower3.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower4Geom = vtkStructuredGridGeometryFilter() - klower4Geom.SetInputConnection(reader.GetOutputPort()) --- - klower4 = vtkActor() - klower4.SetMapper(mapKlower4) - klower4.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower5Geom = vtkStructuredGridGeometryFilter() - klower5Geom.SetInputConnection(reader.GetOutputPort()) --- - klower5 = vtkActor() - klower5.SetMapper(mapKlower5) - klower5.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower6Geom = vtkStructuredGridGeometryFilter() - klower6Geom.SetInputConnection(reader.GetOutputPort()) --- - klower6 = vtkActor() - klower6.SetMapper(mapKlower6) - klower6.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - klower7Geom = vtkStructuredGridGeometryFilter() - klower7Geom.SetInputConnection(reader.GetOutputPort()) --- - klower7 = vtkActor() - klower7.SetMapper(mapKlower7) - klower7.GetProperty().SetColor(colors.GetColor3d('EggShell')) - - hood1Geom = vtkStructuredGridGeometryFilter() - hood1Geom.SetInputConnection(reader.GetOutputPort()) --- - hood1 = vtkActor() - hood1.SetMapper(mapHood1) - hood1.GetProperty().SetColor(colors.GetColor3d('Silver')) - - hood2Geom = vtkStructuredGridGeometryFilter() - hood2Geom.SetInputConnection(reader.GetOutputPort()) --- - hood2 = vtkActor() - hood2.SetMapper(mapHood2) - hood2.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood3Geom = vtkStructuredGridGeometryFilter() - hood3Geom.SetInputConnection(reader.GetOutputPort()) --- - hood3 = vtkActor() - hood3.SetMapper(mapHood3) - hood3.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood4Geom = vtkStructuredGridGeometryFilter() - hood4Geom.SetInputConnection(reader.GetOutputPort()) --- - hood4 = vtkActor() - hood4.SetMapper(mapHood4) - hood4.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - hood6Geom = vtkStructuredGridGeometryFilter() - hood6Geom.SetInputConnection(reader.GetOutputPort()) --- - hood6 = vtkActor() - hood6.SetMapper(mapHood6) - hood6.GetProperty().SetColor(colors.GetColor3d('Furniture')) - - cookingPlateGeom = vtkStructuredGridGeometryFilter() - cookingPlateGeom.SetInputConnection(reader.GetOutputPort()) --- - cookingPlate = vtkActor() - cookingPlate.SetMapper(mapCookingPlate) - cookingPlate.GetProperty().SetColor(colors.GetColor3d('Tomato')) - - filterGeom = vtkStructuredGridGeometryFilter() - filterGeom.SetInputConnection(reader.GetOutputPort()) --- - sgfilter = vtkActor() - sgfilter.SetMapper(mapFilter) - sgfilter.GetProperty().SetColor(colors.GetColor3d('Furniture')) - # - # regular streamlines - # --- - rake = vtkActor() - rake.SetMapper(rakeMapper) - - streamers = vtkStreamTracer() - # streamers.DebugOn() - streamers.SetInputConnection(reader.GetOutputPort()) --- - lines = vtkActor() - lines.SetMapper(streamersMapper) - lines.GetProperty().SetColor(colors.GetColor3d('Black')) - - aren.TwoSidedLightingOn() - --- - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - - triangle_actor = vtkActor() - triangle_actor.SetMapper(triangle_mapper) - - outline_ren = vtkRenderer() - outline_ren.AddActor(outline_actor) - outline_ren.SetViewport(0.0, 0.0, 0.5, 1.0) --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('LavenderBlush')) - renWin.SetSize(600, 600) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('DodgerBlue')) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('PaleGoldenrod')) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(actor_color[i])) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d(ren_bkg[i])) --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d(actor_color[i])) - actor.SetMapper(mapper) - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d(ren_bkg[i])) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - contourLineActor = vtkActor() - actor.SetMapper(mapper) - contourLineActor.SetMapper(contourLineMapper) - contourLineActor.GetProperty().SetColor( - nc.GetColor3d("black")) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetDiffuseColor(colors.GetColor3d("Peacock")) - actor.GetProperty().SetDiffuse(.7) - actor.GetProperty().SetSpecularPower(20) - actor.GetProperty().SetSpecular(.5) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - glyphActor = vtkActor() - glyphActor.SetMapper(arrowGlyphMapper) - return glyphActor - - -def MakeSurfaceActor(surface, scalarRange, lut): --- - actor = vtkActor() - actor.SetMapper(mapper) - return actor - - -def MakeLabel(textLabel, renWinSize): --- - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.SetPosition(renWinSize / 2.0, 16) - actor.GetProperty().SetColor(nc.GetColor3d("Gold")) - return actor - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Yellow')) - - actor.GetProperty().SetPointSize(5) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() --- - planeActor = vtkActor() - planeActor.SetMapper(planeMapper) - planeActor.GetProperty().SetRepresentationToWireframe() - - # create simple poly data so we can apply glyph - squad = vtkSuperquadricSource() --- - glyphActor = vtkActor() - glyphActor.SetMapper(glyphMapper) - - colors = vtkNamedColors() - - # Create the rendering stuff --- - isoActor = vtkActor() - CreateIsosurface(sample, isoActor) - outlineIsoActor = vtkActor() - CreateOutline(sample, outlineIsoActor) - - planesActor = vtkActor() - CreatePlanes(sample, planesActor, 3) - outlinePlanesActor = vtkActor() - CreateOutline(sample, outlinePlanesActor) - planesActor.AddPosition(isoActor.GetBounds()[0] * 2.0, 0, 0) - outlinePlanesActor.AddPosition(isoActor.GetBounds()[0] * 2.0, 0, 0) - - contourActor = vtkActor() - CreateContours(sample, contourActor, 3, 15) - outlineContourActor = vtkActor() - CreateOutline(sample, outlineContourActor) - contourActor.AddPosition(isoActor.GetBounds()[0] * 4.0, 0, 0) - outlineContourActor.AddPosition(isoActor.GetBounds()[0] * 4.0, 0, 0) - - renderer.AddActor(planesActor) --- - rectangle_actor = vtkActor() - rectangle_actor.SetMapper(rectangle_mapper) - rectangle_actor.VisibilityOn() - rectangle_actor.GetProperty().SetColor(rectangle_color) - - box_source = vtkCubeSource() --- - box_actor = vtkActor() - box_actor.SetMapper(box_mapper) - box_actor.VisibilityOn() - box_actor.SetPosition(-2.0, 2.0, 0.0) - box_actor.GetProperty().SetColor(box_color) - --- - cone_actor = vtkActor() - cone_actor.SetMapper(cone_mapper) - cone_actor.VisibilityOn() - cone_actor.SetPosition(0.0, 1.0, 1.0) - cone_actor.GetProperty().SetColor(cone_color) - --- - sphere_actor = vtkActor() - sphere_actor.SetMapper(sphere_mapper) - - sphere_actor.VisibilityOn() - sphere_actor.SetPosition(2.0, 2.0, -1.0) - sphere_actor.GetProperty().SetColor(sphere_color) --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetTexture(texture) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('RosyBrown')) --- - streamline_actor = vtkActor() - streamline_actor.SetMapper(streamline_mapper) - streamline_actor.VisibilityOn() - - outline = vtkStructuredGridOutlineFilter() - outline.SetInputData(pl3d.GetOutput().GetBlock(0)) --- - outline_actor = vtkActor() - outline_actor.SetMapper(outline_mapper) - outline_actor.GetProperty().SetColor(colors.GetColor3d('White')) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('DarkSlateGray')) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Setup a renderer, render window, and interactor - renderer = vtkRenderer() --- - cut = vtkActor() - cut.SetMapper(cutterMapper) - - # Add in some surface geometry for interest. - iso = vtkContourFilter() - iso.SetInputData(pl3dOutput) --- - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetDiffuseColor(colors.GetColor3d('Tomato')) - isoActor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - isoActor.GetProperty().SetDiffuse(0.8) - isoActor.GetProperty().SetSpecular(0.5) --- - outlineActor = vtkActor() - outlineActor.SetMapper(outlineMapper) - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() --- - sphereActor = vtkActor() - sphereActor.SetMapper(sphere_mapper) - sphereActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - # Regular Polygon. - regular_polygon_source = vtkRegularPolygonSource() --- - regularPolygonActor = vtkActor() - regularPolygonActor.SetMapper(regular_polygon_mapper) - regularPolygonActor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - - # A renderer and render window. - ren = vtkRenderer() --- - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) - coneActor.GetProperty().SetColor(colors.GetColor3d('BurlyWood')) - - # A renderer and render window - renderer = vtkRenderer() --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Beige')) - actor.SetMapper(mapper) - - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DimGray')) --- - actor = vtkActor() - actor.SetMapper(mapper) - - self.ren.AddActor(actor) - - --- - actor = vtkActor() - actor.SetMapper(mapper) - - self.ren.AddActor(actor) - - self.ren.ResetCamera() --- - actor = vtkActor() - actor.SetMapper(mapper) - - back_faces = vtkProperty() - back_faces.SetDiffuseColor(colors.GetColor3d('Gold')) - --- - icon_actor = vtkActor() - icon_actor.SetMapper(icon_mapper) - icon_actor.GetProperty().SetColor(colors.GetColor3d('Silver')) - - # Set up the renderer, window, and interactor - renderer = vtkRenderer() --- - superquadric_actor = vtkActor() - superquadric_actor.SetMapper(superquadric_mapper) - superquadric_actor.GetProperty().SetInterpolationToFlat() - superquadric_actor.GetProperty().SetDiffuseColor(colors.GetColor3d('Carrot')) - superquadric_actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - superquadric_actor.GetProperty().SetDiffuse(0.6) --- - ca = vtkActor() - ca.SetMapper(cm) - ca.GetProperty().SetColor(colors.GetColor3d("BurlyWood")) - ca.GetProperty().EdgeVisibilityOn() - ca.GetProperty().SetEdgeColor(colors.GetColor3d("Red")) - --- - actor = vtkActor() - actor.SetMapper(mapper) - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('MidnightBLue')) --- - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d('Cornsilk')) - actor.SetMapper(mapper) - # Add the actor to the scene - renderer.AddActor(actor) - --- - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) - - renderer = vtkRenderer() - render_window = vtkRenderWindow() diff --git a/data/examples/pp/vtkActor2D b/data/examples/pp/vtkActor2D deleted file mode 100644 index 0bc3b53..0000000 --- a/data/examples/pp/vtkActor2D +++ /dev/null @@ -1,146 +0,0 @@ - singleLineTextActorB = vtkActor2D() - singleLineTextActorB.SetMapper(singleLineTextB) - singleLineTextActorB.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorB.GetPositionCoordinate().SetValue(0.05, 0.85) - - # The text is on a single line and center-justified (vertical justification). --- - singleLineTextActorC = vtkActor2D() - - singleLineTextActorC.SetMapper(singleLineTextC) - singleLineTextActorC.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorC.GetPositionCoordinate().SetValue(0.05, 0.75) - --- - singleLineTextActorT = vtkActor2D() - singleLineTextActorT.SetMapper(singleLineTextT) - singleLineTextActorT.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - singleLineTextActorT.GetPositionCoordinate().SetValue(0.05, 0.65) - - # The text is on multiple lines and left- and top-justified. --- - textActorL = vtkActor2D() - textActorL.SetMapper(textMapperL) - textActorL.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorL.GetPositionCoordinate().SetValue(0.05, 0.5) - - # The text is on multiple lines and center-justified (both horizontal and vertical). --- - textActorC = vtkActor2D() - textActorC.SetMapper(textMapperC) - textActorC.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorC.GetPositionCoordinate().SetValue(0.5, 0.5) - - # The text is on multiple lines and right- and bottom-justified. --- - textActorR = vtkActor2D() - textActorR.SetMapper(textMapperR) - textActorR.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - textActorR.GetPositionCoordinate().SetValue(0.95, 0.5) - - # Draw the grid to demonstrate the placement of the text. --- - gridActor = vtkActor2D() - gridActor.SetMapper(mapper) - gridActor.GetProperty().SetColor(colors.GetColor3d('DimGray')) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor - renderer = vtkRenderer() --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(320, 20) - - # Create a renderer, render window, and interactor. - renderer = vtkRenderer() --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) --- - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(renderer_size / 2.0, 8) - - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) --- - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) - - # Glyph the points. - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() --- - textActor = vtkActor2D() - textActor.SetMapper(textMapper) - textActor.SetPosition(10, 400) - - # Visualize - renderer = vtkRenderer() --- - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('Gold')) - actor.GetProperty().SetPointSize(8) - - # Create a renderer, render window, and interactor --- - slice_text_actor = vtkActor2D() - slice_text_actor.SetMapper(slice_text_mapper) - slice_text_actor.SetPosition(15, 10) - - # Usage hint message - usage_text_prop = vtkTextProperty() --- - usage_text_actor = vtkActor2D() - usage_text_actor.SetMapper(usage_text_mapper) - usage_text_actor.GetPositionCoordinate().SetCoordinateSystemToNormalizedDisplay() - usage_text_actor.GetPositionCoordinate().SetValue(0.05, 0.95) - - # Create an interactor with our own style (inherit from --- - labelActor = vtkActor2D() - labelActor.SetMapper(labelMapper) - - # The geometry - geometryShrink = vtkShrinkFilter() - geometryShrink.SetInputConnection(reader.GetOutputPort()) --- - text_actor = vtkActor2D() - text_actor.SetMapper(text_mapper) - text_actor.SetPosition(250, 16) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) --- - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d(border_color)) - - # Line width should be at least 2 to be visible at extremes. - actor.GetProperty().SetLineWidth(border_width) --- - actor = vtkActor2D() - actor.SetMapper(mapper) - actor.SetPosition(renWinSize / 2.0, 16) - actor.GetProperty().SetColor(nc.GetColor3d("Gold")) - return actor - diff --git a/data/examples/pp/vtkActorCollection b/data/examples/pp/vtkActorCollection deleted file mode 100644 index 1a673d3..0000000 --- a/data/examples/pp/vtkActorCollection +++ /dev/null @@ -1,6 +0,0 @@ - # actors = vtkActorCollection() - actors = renderer.GetActors() - print('There are', actors.GetNumberOfItems(), 'actors.') - - renWin.SetWindowName('3DSImporter') - renWin.Render() diff --git a/data/examples/pp/vtkAlgorithm b/data/examples/pp/vtkAlgorithm deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkAnnotatedCubeActor b/data/examples/pp/vtkAnnotatedCubeActor deleted file mode 100644 index 50031a8..0000000 --- a/data/examples/pp/vtkAnnotatedCubeActor +++ /dev/null @@ -1,48 +0,0 @@ - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText('R') # Right - cube.SetXMinusFaceText('L') # Left - cube.SetYPlusFaceText('A') # Anterior - cube.SetYMinusFaceText('P') # Posterior - cube.SetZPlusFaceText('S') # Superior/Cranial --- - cube = vtkAnnotatedCubeActor() - cube.SetFaceTextScale(2.0 / 3.0) - - # Anatomic labelling. - # - cube.SetXPlusFaceText('A') --- - annotated_cube = vtkAnnotatedCubeActor() - annotated_cube.SetFaceTextScale(0.366667) - - # Anatomic labeling - annotated_cube.SetXPlusFaceText('X+') - annotated_cube.SetXMinusFaceText('X-') --- - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText(cube_labels[0]) - cube.SetXMinusFaceText(cube_labels[1]) - cube.SetYPlusFaceText(cube_labels[2]) - cube.SetYMinusFaceText(cube_labels[3]) - cube.SetZPlusFaceText(cube_labels[4]) --- - cube = vtkAnnotatedCubeActor() - cube.SetXPlusFaceText(cube_labels[0]) - cube.SetXMinusFaceText(cube_labels[1]) - cube.SetYPlusFaceText(cube_labels[2]) - cube.SetYMinusFaceText(cube_labels[3]) - cube.SetZPlusFaceText(cube_labels[4]) --- - actor = vtkAnnotatedCubeActor() - actor.GetCubeProperty().SetColor(colors.GetColor3d('PeachPuff')) - - # a renderer and render window - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - axes_actor = vtkAnnotatedCubeActor() - axes_actor.SetXPlusFaceText('L') - axes_actor.SetXMinusFaceText('R') - axes_actor.SetYMinusFaceText('I') - axes_actor.SetYPlusFaceText('S') - axes_actor.SetZMinusFaceText('P') diff --git a/data/examples/pp/vtkAnnotationLink b/data/examples/pp/vtkAnnotationLink deleted file mode 100644 index 6963af7..0000000 --- a/data/examples/pp/vtkAnnotationLink +++ /dev/null @@ -1,13 +0,0 @@ - annotationLink = vtkAnnotationLink() - # If you don't set the FieldType explicitly it ends up as UNKNOWN - # (as of 21 Feb 2010) - # See vtkSelectionNode doc for field and content type enum values - annotationLink.GetCurrentSelection().GetNode(0).SetFieldType(1) # Point - annotationLink.GetCurrentSelection().GetNode(0).SetContentType(4) # Indices --- - annotationLink = vtkAnnotationLink() - view.GetRepresentation(0).SetAnnotationLink(annotationLink) - - def select_callback(caller, event): - ''' - In this particular data representation the current selection in the diff --git a/data/examples/pp/vtkAppendFilter b/data/examples/pp/vtkAppendFilter deleted file mode 100644 index ddbf22a..0000000 --- a/data/examples/pp/vtkAppendFilter +++ /dev/null @@ -1,34 +0,0 @@ - appendFilter = vtkAppendFilter() - appendFilter.AddInputData(polydata) - appendFilter.AddInputData(ug) - appendFilter.Update() - - combined = vtkUnstructuredGrid() --- - appendFilter = vtkAppendFilter() - appendFilter.AddInputConnection(delaunay1.GetOutputPort()) - appendFilter.AddInputConnection(delaunay2.GetOutputPort()) - appendFilter.Update() - - connectivityFilter = vtkConnectivityFilter() --- - camAPD = vtkAppendFilter() - camAPD.AddInputConnection(camCBS.GetOutputPort()) - camAPD.AddInputConnection(camCS.GetOutputPort()) - - camMapper = vtkPolyDataMapper() - camMapper.SetInputConnection(camAPD.GetOutputPort()) --- - append = vtkAppendFilter() - - dims = func.GetSampleDimensions() - sliceIncr = (dims[2] - 1) // (numberOfPlanes + 1) - sliceNum = -4 - for i in range(0, numberOfPlanes): --- - append = vtkAppendFilter() - - dims = func.GetSampleDimensions() - sliceIncr = (dims[2] - 1) // (numberOfPlanes + 1) - - sliceNum = -4 diff --git a/data/examples/pp/vtkAppendPolyData b/data/examples/pp/vtkAppendPolyData deleted file mode 100644 index d085481..0000000 --- a/data/examples/pp/vtkAppendPolyData +++ /dev/null @@ -1,41 +0,0 @@ - appendFilter = vtkAppendPolyData() - appendFilter.AddInputData(input1) - appendFilter.AddInputData(input2) - - appendFilter.Update() - --- - appendF = vtkAppendPolyData() - appendF.AddInputConnection(tpd1.GetOutputPort()) - appendF.AddInputConnection(tpd2.GetOutputPort()) - appendF.AddInputConnection(tpd3.GetOutputPort()) - - # The vtkProbeFilter takes two inputs. One is a dataset to use as the probe --- - appendF = vtkAppendPolyData() - appendF.AddInputConnection(plane.GetOutputPort()) - appendF.AddInputConnection(plane2.GetOutputPort()) - appendF.AddInputConnection(plane3.GetOutputPort()) - - # Warp --- - appendF = vtkAppendPolyData() - appendF.AddInputConnection(plane.GetOutputPort()) - appendF.AddInputConnection(plane2.GetOutputPort()) - appendF.AddInputConnection(plane3.GetOutputPort()) - - warp = vtkWarpScalar() --- - appendAll = vtkAppendPolyData() - appendAll.AddInputConnection(VTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(TTransformFilter.GetOutputPort()) - appendAll.AddInputConnection(KTransformFilter.GetOutputPort()) - - # Create normals. --- - camAPD = vtkAppendPolyData() - camAPD.AddInputConnection(camCBS.GetOutputPort()) - camAPD.AddInputConnection(camCS.GetOutputPort()) - - camMapper = vtkPolyDataMapper() - camMapper.SetInputConnection(camAPD.GetOutputPort()) diff --git a/data/examples/pp/vtkArrowSource b/data/examples/pp/vtkArrowSource deleted file mode 100644 index db41486..0000000 --- a/data/examples/pp/vtkArrowSource +++ /dev/null @@ -1,62 +0,0 @@ - arrowSource = vtkArrowSource() - # arrowSource.SetShaftRadius(0.01) - # arrowSource.SetTipLength(.9) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - arrowSource = vtkArrowSource() - arrowSource.SetTipResolution(31) - arrowSource.SetShaftResolution(21) - - # Transform the polydata - transformPD = vtkTransformPolyDataFilter() --- - arrowSource = vtkArrowSource() - - # Generate a random start and end point - startPoint = [0] * 3 - endPoint = [0] * 3 - rng = vtkMinimalStandardRandomSequence() --- - source = vtkArrowSource() - - # Create a transform that rotates the arrow 45° around the z-axis - transform = vtkTransform() - transform.RotateWXYZ(45, 0, 0, 1) - transformFilter = vtkTransformPolyDataFilter() --- - arrowSource = vtkArrowSource() - # arrowSource.SetShaftRadius(1.0) - # arrowSource.SetTipLength(1.0) - arrowSource.Update() - - # Create mapper and actor for the main renderer --- - arrow = vtkArrowSource() - arrow.SetTipResolution(16) - arrow.SetTipLength(0.3) - arrow.SetTipRadius(0.1) - - glyph = vtkGlyph3D() --- - arrow = vtkArrowSource() - arrow.SetTipResolution(16) - arrow.SetTipLength(0.3) - arrow.SetTipRadius(0.1) - - glyph = vtkGlyph3D() --- - arrowSource = vtkArrowSource() - - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(arrowSource.GetOutputPort()) - glyph3D.SetVectorModeToUseNormal() - glyph3D.SetInputData(input_data) --- - arrowSource = vtkArrowSource() - # Subsample the dataset. - maskPts = vtkMaskPoints() - maskPts.SetInputConnection(source.GetOutputPort()) - maskPts.SetOnRatio(source.GetOutput().GetNumberOfPoints() // glyphPoints) - maskPts.SetRandomMode(1) diff --git a/data/examples/pp/vtkAxes b/data/examples/pp/vtkAxes deleted file mode 100644 index 6713354..0000000 --- a/data/examples/pp/vtkAxes +++ /dev/null @@ -1,41 +0,0 @@ - axes = vtkAxes() - axes.SetOrigin(0, 0, 0) - axesMapper = vtkPolyDataMapper() - axesMapper.SetInputConnection(axes.GetOutputPort()) - axesActor = vtkActor() - axesActor.SetMapper(axesMapper) --- - axes = vtkAxes() - axes.SetOrigin(bounds[0], bounds[2], bounds[4]) - axes.SetScaleFactor(popSplatter.GetOutput().GetLength() / 5.0) - axesTubes = vtkTubeFilter() - axesTubes.SetInputConnection(axes.GetOutputPort()) - axesTubes.SetRadius(axes.GetScaleFactor() / 25.0) --- - axes = vtkAxes() - axes.SetOrigin(bounds[0], bounds[2], bounds[4]) - axes.SetScaleFactor(popSplatter.GetOutput().GetLength() / 5) - - axesTubes = vtkTubeFilter() - axesTubes.SetInputConnection(axes.GetOutputPort()) --- - modelAxesSource = vtkAxes() - modelAxesSource.SetScaleFactor(10) - modelAxesSource.SetOrigin(0, 0, 0) - - modelAxesMapper = vtkPolyDataMapper() - modelAxesMapper.SetInputConnection(modelAxesSource.GetOutputPort()) --- - cowAxesSource = vtkAxes() - cowAxesSource.SetScaleFactor(10.0) - cowAxesSource.SetOrigin(0, 0, 0) - - cowAxesMapper = vtkPolyDataMapper() - cowAxesMapper.SetInputConnection(cowAxesSource.GetOutputPort()) --- - axes = vtkAxes() - axes.SetScaleFactor(0.5) - - tubeAxes = vtkTubeFilter() - tubeAxes.SetInputConnection(axes.GetOutputPort()) - tubeAxes.SetRadius(0.1) diff --git a/data/examples/pp/vtkAxesActor b/data/examples/pp/vtkAxesActor deleted file mode 100644 index d1bda74..0000000 --- a/data/examples/pp/vtkAxesActor +++ /dev/null @@ -1,118 +0,0 @@ - axes = vtkAxesActor() - # The axes are positioned with a user transform - axes.SetUserTransform(transform) - - # properties of the axes labels can be set as follows - # this sets the x axis label to red --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText('X') - axes.SetYAxisLabelText('Y') - axes.SetZAxisLabelText('Z') - axes.SetTotalLength(1.0, 1.0, 1.0) --- - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') - axes.SetYAxisLabelText('North') - # Zenith - axes.SetZAxisLabelText('Zenith') - --- - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') - axes.SetYAxisLabelText('North') - # Zenith - axes.SetZAxisLabelText('Zenith') - --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - # The axes can be positioned with a user transform. - axes.SetUserTransform(transform) - - # The renderers, render window and interactor. - renderers = list() --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - widget = vtkOrientationMarkerWidget() - rgba = [0.0, 0.0, 0.0, 0.0] - colors.GetColor("Carrot", rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) - widget.SetOrientationMarker(axes) --- - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyzLabels[0]) - axes.SetYAxisLabelText(xyzLabels[1]) - axes.SetZAxisLabelText(xyzLabels[2]) --- - axes = vtkAxesActor() - axes.SetScale(scale[0], scale[1], scale[2]) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyzLabels[0]) - axes.SetYAxisLabelText(xyzLabels[1]) - axes.SetZAxisLabelText(xyzLabels[2]) --- - axes = vtkAxesActor() - - widget = vtkOrientationMarkerWidget() - rgba = [0] * 4 - colors.GetColor('Carrot', rgba) - widget.SetOutlineColor(rgba[0], rgba[1], rgba[2]) --- - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyz_labels[0]) - axes.SetYAxisLabelText(xyz_labels[1]) - axes.SetZAxisLabelText(xyz_labels[2]) --- - axes = vtkAxesActor() - axes.SetScale(scale) - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText(xyz_labels[0]) - axes.SetYAxisLabelText(xyz_labels[1]) - axes.SetZAxisLabelText(xyz_labels[2]) --- - axes = vtkAxesActor() - axes.SetShaftTypeToCylinder() - axes.SetXAxisLabelText('X') - axes.SetYAxisLabelText('Y') - axes.SetZAxisLabelText('Z') - axes.SetTotalLength(1.0, 1.0, 1.0) diff --git a/data/examples/pp/vtkAxis b/data/examples/pp/vtkAxis deleted file mode 100644 index 21e6142..0000000 --- a/data/examples/pp/vtkAxis +++ /dev/null @@ -1,19 +0,0 @@ - x_axis = left_chart.GetAxis(vtkAxis.BOTTOM) - x_axis.GetGridPen().SetColor(colors.GetColor4ub("LightGrey")) - x_axis.SetTitle('x') - y_axis = left_chart.GetAxis(vtkAxis.LEFT) - y_axis.GetGridPen().SetColor(colors.GetColor4ub("LightGrey")) - y_axis.SetTitle('cos(x)') - left_chart.GetBackgroundBrush().SetColorF(*colors.GetColor4d('MistyRose')) - left_chart.GetBackgroundBrush().SetOpacityF(0.4) - left_chart.SetTitle('Cosine') --- - x_axis = right_chart.GetAxis(vtkAxis.BOTTOM) - x_axis.GetGridPen().SetColor(colors.GetColor4ub("LightCyan")) - x_axis.SetTitle('x') - y_axis = right_chart.GetAxis(vtkAxis.LEFT) - y_axis.GetGridPen().SetColor(colors.GetColor4ub("LightCyan")) - y_axis.SetTitle('sin(x)') - right_chart.GetBackgroundBrush().SetColorF(*colors.GetColor4d('Thistle')) - right_chart.GetBackgroundBrush().SetOpacityF(0.4) - right_chart.SetTitle('Sine') diff --git a/data/examples/pp/vtkBMPReader b/data/examples/pp/vtkBMPReader deleted file mode 100644 index 698949d..0000000 --- a/data/examples/pp/vtkBMPReader +++ /dev/null @@ -1,6 +0,0 @@ - reader = vtkBMPReader() - reader.SetFileName(fileName) - # Convert the image to a grey scale. - luminance = vtkImageLuminance() - luminance.SetInputConnection(reader.GetOutputPort()) - # Pass the data to the pipeline as polygons. diff --git a/data/examples/pp/vtkBMPWriter b/data/examples/pp/vtkBMPWriter deleted file mode 100644 index 0538139..0000000 --- a/data/examples/pp/vtkBMPWriter +++ /dev/null @@ -1,13 +0,0 @@ - writer = vtkBMPWriter() - elif ext == '.jpg': - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': --- - writer = vtkBMPWriter() - elif ext == '.jpg': - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': diff --git a/data/examples/pp/vtkBYUReader b/data/examples/pp/vtkBYUReader deleted file mode 100644 index a8681b3..0000000 --- a/data/examples/pp/vtkBYUReader +++ /dev/null @@ -1,90 +0,0 @@ - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data.DeepCopy(reader.GetOutput()) - - return poly_data --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a sphere if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - cow = vtkBYUReader() - cow.SetGeometryFileName(file_name) - cow.Update() - - cowMapper = vtkPolyDataMapper() - cowMapper.SetInputConnection(cow.GetOutputPort()) --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. --- - reader = vtkBYUReader() - reader.SetGeometryFileName(file_name) - reader.Update() - poly_data = reader.GetOutput() - else: - # Return a None if the extension is unknown. diff --git a/data/examples/pp/vtkBalloonRepresentation b/data/examples/pp/vtkBalloonRepresentation deleted file mode 100644 index b21a7fa..0000000 --- a/data/examples/pp/vtkBalloonRepresentation +++ /dev/null @@ -1,6 +0,0 @@ - balloonRep = vtkBalloonRepresentation() - balloonRep.SetBalloonLayoutToImageRight() - - balloonWidget = vtkBalloonWidget() - balloonWidget.SetInteractor(iren) - balloonWidget.SetRepresentation(balloonRep) diff --git a/data/examples/pp/vtkBalloonWidget b/data/examples/pp/vtkBalloonWidget deleted file mode 100644 index 894c177..0000000 --- a/data/examples/pp/vtkBalloonWidget +++ /dev/null @@ -1,6 +0,0 @@ - balloonWidget = vtkBalloonWidget() - balloonWidget.SetInteractor(iren) - balloonWidget.SetRepresentation(balloonRep) - balloonWidget.AddBalloon(sphereActor, 'This is a sphere') - balloonWidget.AddBalloon(regularPolygonActor, 'This is a regular polygon') - diff --git a/data/examples/pp/vtkBandedPolyDataContourFilter b/data/examples/pp/vtkBandedPolyDataContourFilter deleted file mode 100644 index e3d2104..0000000 --- a/data/examples/pp/vtkBandedPolyDataContourFilter +++ /dev/null @@ -1,27 +0,0 @@ - bandedContours = vtkBandedPolyDataContourFilter() - bandedContours.SetInputConnection(elevation.GetOutputPort()) - bandedContours.SetScalarModeToValue() - bandedContours.GenerateContourEdgesOn() - bandedContours.GenerateValues(11, elevation.GetScalarRange()) - --- - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputData(cc.GetOutput()) - # Use either the minimum or maximum value for each band. - for k in bands: - bcf.SetValue(k, bands[k][2]) - # We will use an indexed lookup table. --- - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputData(source) - # Use either the minimum or maximum value for each band. - for i in range(len(bands)): - bcf.SetValue(i, bands[i][2]) - # We will use an indexed lookup table. --- - bcf = vtkBandedPolyDataContourFilter() - bcf.SetInputConnection(elevation.GetOutputPort()) - bcf.SetScalarModeToValue() - bcf.GenerateContourEdgesOn() - bcf.GenerateValues(7, elevation.GetScalarRange()) - diff --git a/data/examples/pp/vtkBiQuadraticQuad b/data/examples/pp/vtkBiQuadraticQuad deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkBiQuadraticQuadraticHexahedron b/data/examples/pp/vtkBiQuadraticQuadraticHexahedron deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkBiQuadraticQuadraticWedge b/data/examples/pp/vtkBiQuadraticQuadraticWedge deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkBiQuadraticTriangle b/data/examples/pp/vtkBiQuadraticTriangle deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkBillboardTextActor3D b/data/examples/pp/vtkBillboardTextActor3D deleted file mode 100644 index 45716ce..0000000 --- a/data/examples/pp/vtkBillboardTextActor3D +++ /dev/null @@ -1,6 +0,0 @@ - text_actor = vtkBillboardTextActor3D() - text_actor.SetInput('') - text_actor.SetPosition(actor.GetPosition()) - text_actor.GetTextProperty().SetFontSize(12) - text_actor.GetTextProperty().SetColor(colors.GetColor3d('Gold')) - text_actor.GetTextProperty().SetJustificationToCentered() diff --git a/data/examples/pp/vtkBooleanOperationPolyDataFilter b/data/examples/pp/vtkBooleanOperationPolyDataFilter deleted file mode 100644 index 50c116a..0000000 --- a/data/examples/pp/vtkBooleanOperationPolyDataFilter +++ /dev/null @@ -1,6 +0,0 @@ - booleanOperation = vtkBooleanOperationPolyDataFilter() - if operation.lower() == 'union': - booleanOperation.SetOperationToUnion() - elif operation.lower() == 'intersection': - booleanOperation.SetOperationToIntersection() - elif operation.lower() == 'difference': diff --git a/data/examples/pp/vtkBooleanTexture b/data/examples/pp/vtkBooleanTexture deleted file mode 100644 index 9702b13..0000000 --- a/data/examples/pp/vtkBooleanTexture +++ /dev/null @@ -1,6 +0,0 @@ - booleanTexture = vtkBooleanTexture() - - booleanTexture.SetXSize(resolution) - booleanTexture.SetYSize(resolution) - booleanTexture.SetThickness(thickness) - diff --git a/data/examples/pp/vtkBox b/data/examples/pp/vtkBox deleted file mode 100644 index f5f9dc3..0000000 --- a/data/examples/pp/vtkBox +++ /dev/null @@ -1,6 +0,0 @@ - box = vtkBox() - box.SetBounds(-1, 1, -1, 1, -1, 1) - - # combine the two implicit functions - boolean = vtkImplicitBoolean() - boolean.SetOperationTypeToDifference() diff --git a/data/examples/pp/vtkBoxWidget b/data/examples/pp/vtkBoxWidget deleted file mode 100644 index cc33e97..0000000 --- a/data/examples/pp/vtkBoxWidget +++ /dev/null @@ -1,13 +0,0 @@ - boxWidget = vtkBoxWidget() - boxWidget.SetInteractor(iren) - boxWidget.SetPlaceFactor(1.25) - boxWidget.GetOutlineProperty().SetColor(colors.GetColor3d('Gold')) - - # --- - boxWidget = vtkBoxWidget() - boxWidget.SetInteractor(interactor) - boxWidget.SetProp3D(coneActor) - boxWidget.SetPlaceFactor(1.25) # Make the box 1.25x larger than the actor - boxWidget.PlaceWidget() - boxWidget.On() diff --git a/data/examples/pp/vtkBrownianPoints b/data/examples/pp/vtkBrownianPoints deleted file mode 100644 index f1abb5a..0000000 --- a/data/examples/pp/vtkBrownianPoints +++ /dev/null @@ -1,13 +0,0 @@ - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) - brown.SetInputConnection(grad.GetOutputPort()) - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) --- - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) - brown.SetInputConnection(grad.GetOutputPort()) - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) diff --git a/data/examples/pp/vtkButterflySubdivisionFilter b/data/examples/pp/vtkButterflySubdivisionFilter deleted file mode 100644 index 1164cf6..0000000 --- a/data/examples/pp/vtkButterflySubdivisionFilter +++ /dev/null @@ -1,13 +0,0 @@ - smooth_butterfly = vtkButterflySubdivisionFilter() - smooth_butterfly.SetNumberOfSubdivisions(3) - smooth_butterfly.SetInputConnection(cleanPolyData.GetOutputPort()) - - # Create a mapper and actor for initial dataset - mapper = vtkPolyDataMapper() --- - butterfly = vtkButterflySubdivisionFilter() - butterfly.SetInputConnection(src.GetOutputPort()) - butterfly.SetNumberOfSubdivisions(3) - butterfly.Update() - - linear = vtkLinearSubdivisionFilter() diff --git a/data/examples/pp/vtkCamera b/data/examples/pp/vtkCamera deleted file mode 100644 index 2a4a640..0000000 --- a/data/examples/pp/vtkCamera +++ /dev/null @@ -1,279 +0,0 @@ - camera = vtkCamera() - camera.SetPosition(1, 1, 1) - camera.SetFocalPoint(0, 0, 0) - - renderer = vtkRenderer() - renWin = vtkRenderWindow() --- - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(30) - camera.Elevation(30) --- - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(30) - camera.Elevation(30) --- - camera = vtkCamera() - camera.SetClippingRange(0.1, 0.4) - planesArray = [0] * 24 - - camera.GetFrustumPlanes(1.0, planesArray) - --- - camera = vtkCamera() - planes_array = [0] * 24 - camera.GetFrustumPlanes(1, planes_array) - planes.append(vtkPlanes()) - planes[0].SetFrustumPlanes(planes_array) - --- - camera = vtkCamera() - camera.SetPosition(4.6, -2.0, 3.8) - camera.SetFocalPoint(0.0, 0.0, 0.0) - camera.SetClippingRange(3.2, 10.2) - camera.SetViewUp(0.3, 1.0, 0.13) - ren.SetActiveCamera(camera) --- - camera = vtkCamera() - camera.SetPosition(0, -1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Azimuth(150) - camera.Elevation(30) --- - aCamera = vtkCamera() - aCamera.Azimuth(-40.0) - aCamera.Elevation(50.0) - - renderer.SetActiveCamera(aCamera) - renderer.ResetCamera() --- - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) --- - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) --- - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) --- - a_camera = vtkCamera() - a_camera.SetViewUp(0, 0, -1) - a_camera.SetPosition(0, -1, 0) - a_camera.SetFocalPoint(0, 0, 0) - a_camera.ComputeViewPlaneNormal() - a_camera.Azimuth(30.0) --- - camera = vtkCamera() - camera.SetPosition(0, -1, 0) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.Elevation(30) - camera.Azimuth(30) --- - camera = vtkCamera() - camera.SetClippingRange(.274, 13.72) - camera.SetFocalPoint(0.433816, 0.333131, 0.449) - camera.SetPosition(-1.96987, 1.15145, 1.49053) - camera.SetViewUp(0.378927, 0.911821, 0.158107) - renderer.SetActiveCamera(camera) --- - camera = vtkCamera() - - # Setup the renderers - left_renderer = vtkRenderer() - render_window.AddRenderer(left_renderer) - left_renderer.SetViewport(left_viewport) --- - camera = vtkCamera() - - # Setup the renderers - leftRenderer = vtkRenderer() - renderWindow.AddRenderer(leftRenderer) - leftRenderer.SetViewport(leftViewport) --- - cam1 = vtkCamera() - cam1.SetFocalPoint(0, 0, 0) - cam1.SetPosition(1, 0, 0) - cam1.SetViewUp(0, 1, 0) - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) --- - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) --- - cam = vtkCamera() - cam.SetClippingRange(1.51176, 75.5879) - cam.SetFocalPoint(2.33749, 2.96739, 3.61023) - cam.SetPosition(10.8787, 5.27346, 15.8687) - cam.SetViewAngle(30) - cam.SetViewUp(-0.0610856, 0.987798, -0.143262) --- - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) --- - cam1 = vtkCamera() - cam1.SetClippingRange(17.4043, 870.216) - cam1.SetFocalPoint(136.71, 104.025, 23) - cam1.SetPosition(204.747, 258.939, 63.7925) - cam1.SetViewUp(-0.102647, -0.210897, 0.972104) - cam1.Zoom(1.2) --- - cam1 = vtkCamera() - cam1.SetClippingRange(0.0475572, 2.37786) - cam1.SetFocalPoint(0.052665, -0.129454, -0.0573973) - cam1.SetPosition(0.327637, -0.116299, -0.256418) - cam1.SetViewUp(-0.0225386, 0.999137, 0.034901) - renderer1.SetActiveCamera(cam1) --- - cam1 = vtkCamera() - renderer1.SetActiveCamera(cam1) - renderer2.SetActiveCamera(cam1) - renderer1.ResetCamera() - cam1.Elevation(-30) - cam1.Dolly(1.2) --- - camera = vtkCamera() - camera.SetFocalPoint(4.5, 1, 0) - camera.SetPosition(4.5, 1.0, 6.73257) - camera.SetViewUp(0, 1, 0) - - ren1.SetActiveCamera(camera) --- - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) --- - aCam = vtkCamera() - aCam.SetFocalPoint(0.00657892, 0, 2.41026) - aCam.SetPosition(-1.94838, -47.1275, 39.4607) - aCam.SetViewUp(0.00653193, 0.617865, 0.786257) - ren1.ResetCamera() - aCam.Dolly(1.) --- - aCam = vtkCamera() - aCam.SetFocalPoint(2.47736, -0.150024, 2.42361) - aCam.SetPosition(1.57547, -13.4601, 5.47872) - aCam.SetViewUp(0.00197003, 0.223588, 0.974682) - # aCam.Dolly(4.0) - aCam.SetClippingRange(1, 100) --- - camera = vtkCamera() - camera.SetFocalPoint(0.918037, -0.0779233, 2.69513) - camera.SetPosition(0.840735, -23.6176, 8.50211) - camera.SetViewUp(0.00227904, 0.239501, 0.970893) - camera.SetClippingRange(1, 100) - --- - camera = vtkCamera() - camera.SetFocalPoint(0.0286334, 0.0362996, 0.0379685) - camera.SetPosition(1.37067, 1.08629, -1.30349) - camera.SetViewAngle(17.673) - camera.SetClippingRange(1, 10) - camera.SetViewUp(-0.376306, -0.5085, -0.774482) --- - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) --- - aCamera = vtkCamera() - aCamera.SetClippingRange(0.726079, 36.3039) - aCamera.SetFocalPoint(2.43584, 2.15046, 1.11104) - aCamera.SetPosition(-4.76183, -10.4426, 3.17203) - aCamera.ComputeViewPlaneNormal() - aCamera.SetViewUp(0.0511273, 0.132773, 0.989827) --- - camera = vtkCamera() - camera.SetClippingRange(0.0332682, 1.66341) - camera.SetFocalPoint(0.0511519, -0.127555, -0.0554379) - camera.SetPosition(0.516567, -0.124763, -0.349538) - camera.SetViewAngle(18.1279) - camera.SetViewUp(-0.013125, 0.99985, -0.0112779) --- - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) --- - camera = vtkCamera() - camera.SetFocalPoint(0.113766, -1.13665, -1.01919) - camera.SetPosition(-29.4886, -63.1488, 26.5807) - camera.SetViewAngle(24.4617) - camera.SetViewUp(0.17138, 0.331163, 0.927879) - camera.SetClippingRange(1, 100) --- - camera = vtkCamera() - camera.SetPosition(0, 0, 100) - camera.SetFocalPoint(0, 0, 0) - - # Create a renderer, render window, and interactor - renderer = vtkRenderer() --- - cam1 = vtkCamera() - cam1.SetViewUp(0, -1, 0) - cam1.SetPosition(0, 0, -1) - ren1.SetActiveCamera(cam1) - ren1.ResetCamera() - cam1.SetViewUp(0, -1, 0) --- - camera = vtkCamera() - camera.SetPosition(41.0433, 27.9637, 30.442) - camera.SetFocalPoint(11.5603, -1.51931, 0.95899) - camera.SetClippingRange(18.9599, 91.6042) - camera.SetViewUp(0, 1, 0) - --- - camera1 = vtkCamera() - camera1.SetPosition(54.7263, 41.6467, 44.125) - camera1.SetFocalPoint(11.5603, -1.51931, 0.95899) - camera1.SetClippingRange(42.4226, 115.659) - camera1.SetViewUp(0, 1, 0) - renWin.GetRenderers().GetFirstRenderer().SetActiveCamera(camera1) --- - aCamera = vtkCamera() - aren.SetActiveCamera(aCamera) - aren.ResetCamera() - - aCamera.SetFocalPoint(3.505, 2.505, 1.255) - aCamera.SetPosition(3.505, 24.6196, 1.255) --- - camera = vtkCamera() - - normals = vtkPolyDataNormals() - normals.SetInputData(polyData) - normals.SetFeatureAngle(30.0) - for i in range(0, 3): diff --git a/data/examples/pp/vtkCameraOrientationWidget b/data/examples/pp/vtkCameraOrientationWidget deleted file mode 100644 index d3bafd6..0000000 --- a/data/examples/pp/vtkCameraOrientationWidget +++ /dev/null @@ -1,113 +0,0 @@ - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderers[single_object_key]) - cam_orient_manipulator.SetInteractor(iren) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderers[single_object_key]) - cam_orient_manipulator.SetInteractor(iren) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - cam_orient_manipulator.On() - - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - cam_orient_manipulator.On() - - axes = vtkAxesActor() - axes.SetXAxisLabelText('East') --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - cam_orient_manipulator = vtkCameraOrientationWidget() - has_cow = True - - curvature_types = ['Gauss_Curvature', 'Mean_Curvature'] - for idx, curvature_name in enumerate(curvature_types): - --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - # Add the actors to the scene --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren2) - # Enable the widget. - cam_orient_manipulator.On() - except AttributeError: - pass --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren) - # Enable the widget. - cam_orient_manipulator.On() - - # add actors --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(ren) - # Enable the widget. - cam_orient_manipulator.On() - - # add actors --- - cow = vtkCameraOrientationWidget() - cow.SetParentRenderer(ren) - # Turn off if you do not want it. - cow.On() - cow.EnabledOn() - --- - cow = vtkCameraOrientationWidget() - cow.SetParentRenderer(ren) - if no_sliders: - # Turn off if you do not want it. - cow.On() - cow.EnabledOn() --- - cam_orient_manipulator = vtkCameraOrientationWidget() - cam_orient_manipulator.SetParentRenderer(renderer) - # Enable the widget. - cam_orient_manipulator.On() - - ren_win.Render() --- - cam_orient_manipulator = vtkCameraOrientationWidget() - has_cow = True - - window_width = 1024 - window_height = 1024 - diff --git a/data/examples/pp/vtkCameraPass b/data/examples/pp/vtkCameraPass deleted file mode 100644 index 93ad5f3..0000000 --- a/data/examples/pp/vtkCameraPass +++ /dev/null @@ -1,34 +0,0 @@ - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - --- - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - --- - camera_p = vtkCameraPass() - seq = vtkSequencePass() - opaque = vtkOpaquePass() - lights = vtkLightsPass() - overlay = vtkOverlayPass() - --- - cameraP = vtkCameraPass() - cameraP.SetDelegatePass(seq) - - # Tell the renderer to use our render pass pipeline - glrenderer = renderer - glrenderer.SetPass(cameraP) --- - camera_p = vtkCameraPass() - camera_p.SetDelegatePass(seq) - - # Tell the renderer to use our render pass pipeline. - renderer.SetPass(camera_p) - diff --git a/data/examples/pp/vtkCategoryLegend b/data/examples/pp/vtkCategoryLegend deleted file mode 100644 index ea67e31..0000000 --- a/data/examples/pp/vtkCategoryLegend +++ /dev/null @@ -1,6 +0,0 @@ - legend = vtkCategoryLegend() - legend.SetScalarsToColors(categoricalLut) - legend.SetValues(legendValues) - legend.SetTitle('Cell Type') - legend.GetBrush().SetColor(colors.GetColor4ub('Silver')) - diff --git a/data/examples/pp/vtkCell b/data/examples/pp/vtkCell deleted file mode 100644 index 1b9ed68..0000000 --- a/data/examples/pp/vtkCell +++ /dev/null @@ -1,6 +0,0 @@ - source = vtkCellTypeSource() - source.SetCellType(cellMap[cellName]) - source.Update() - print('Cell: ', cellName) - - originalPoints = source.GetOutput().GetPoints() diff --git a/data/examples/pp/vtkCellArray b/data/examples/pp/vtkCellArray deleted file mode 100644 index b7f54c9..0000000 --- a/data/examples/pp/vtkCellArray +++ /dev/null @@ -1,356 +0,0 @@ - Lines = vtkCellArray() - Lines.InsertNextCell(2) - Lines.InsertCellPoint(0) - Lines.InsertCellPoint(1) - Lines.InsertNextCell(2) - Lines.InsertCellPoint(2) --- - triangles = vtkCellArray() - - # Build the meshgrid manually. - count = 0 - for i in range(size - 1): - for j in range(size - 1): --- - cells = vtkCellArray() - for k in range(0, nk - 1): - for j in range(0, nj - 1): - for i in range(0, ni - 1): - multi_index = ([i, i + 1, i + 1, i, i, i + 1, i + 1, i], - [j, j, j + 1, j + 1, j, j, j + 1, j + 1], --- - aCellArray = vtkCellArray() - - # Define a polygonal hole with a clockwise polygon - aPolygon = vtkPolygon() - - aPolygon.GetPointIds().InsertNextId(22) --- - sourceVertices = vtkCellArray() - - sp_id = sourcePoints.InsertNextPoint(1.0, 0.1, 0.0) - sourceVertices.InsertNextCell(1) - sourceVertices.InsertCellPoint(sp_id) - --- - targetVertices = vtkCellArray() - - tp_id = targetPoints.InsertNextPoint(1.0, 0.0, 0.0) - targetVertices.InsertNextCell(1) - targetVertices.InsertCellPoint(tp_id) - --- - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - - unstructuredGrid = vtkUnstructuredGrid() - unstructuredGrid.SetPoints(points) - unstructuredGrid.SetCells(VTK_TETRA, cellArray) --- - lines = vtkCellArray() - lines.InsertNextCell(line0) - lines.InsertNextCell(line1) - - # Add the lines to the polydata container - linesPolyData.SetLines(lines) --- - polys = vtkCellArray() - scalars = vtkFloatArray() - - # Load the point, cell, and data attributes. - for i, xi in enumerate(x): - points.InsertPoint(i, xi) --- - lines = vtkCellArray() - lines.InsertNextCell(line) - - polyData = vtkPolyData() - polyData.SetPoints(points) - polyData.SetLines(lines) --- - lines = vtkCellArray() - lines.InsertNextCell(line) - - polyData = vtkPolyData() - polyData.SetPoints(points) - polyData.SetLines(lines) --- - hexs = vtkCellArray() - hexs.InsertNextCell(hexahedron) - - # Add the points and hexahedron to an unstructured grid. - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) --- - cell_array = vtkCellArray() - cell_array.InsertNextCell(tetra) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.SetCells(VTK_TETRA, cell_array) --- - lines = vtkCellArray() - - for i in range(0, 3): - line = vtkLine() - line.GetPointIds().SetId(0, i) - line.GetPointIds().SetId(1, i + 1) --- - vertices = vtkCellArray() - # We need an an array of point id's for InsertNextCell. - pid = [0] - pid[0] = points.InsertNextPoint(p) - vertices.InsertNextCell(1, pid) - --- - polygons = vtkCellArray() - polygons.InsertNextCell(polygon) - - # Create a PolyData - polygonPolyData = vtkPolyData() - polygonPolyData.SetPoints(points) --- - lines = vtkCellArray() - lines.InsertNextCell(7) - lines.InsertCellPoint(0) - lines.InsertCellPoint(1) - lines.InsertCellPoint(2) - lines.InsertCellPoint(3) --- - cells = vtkCellArray() - cells.InsertNextCell(polyLine) - - # Create a polydata to store everything in - polyData = vtkPolyData() - --- - cells = vtkCellArray() - cells.InsertNextCell(pyramid) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) - ug.InsertNextCell(pyramid.GetCellType(), pyramid.GetPointIds()) --- - quads = vtkCellArray() - quads.InsertNextCell(quad) - - # Create a polydata to store everything in - polydata = vtkPolyData() - --- - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - unstructuredGrid1.SetCells(VTK_TETRA, cellArray) - - # The second tetrahedron - unstructuredGrid2 = vtkUnstructuredGrid() --- - cellArray = vtkCellArray() - cellArray.InsertNextCell(tetra) - unstructuredGrid2.SetCells(VTK_TETRA, cellArray) - - # Create a mapper and actor - mapper1 = vtkDataSetMapper() --- - triangles = vtkCellArray() - triangles.InsertNextCell(triangle) - - # Create a polydata object - trianglePolyData = vtkPolyData() - --- - cells = vtkCellArray() - cells.InsertNextCell(triangleStrip) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetStrips(cells) --- - vertices = vtkCellArray() - vertices.InsertNextCell(vertex) - - polydata = vtkPolyData() - polydata.SetPoints(points) - polydata.SetVerts(vertices) --- - line = vtkCellArray() - line.Allocate(8) - line.InsertNextCell(2) - line.InsertCellPoint(0) - line.InsertCellPoint(1) - line.InsertNextCell(2) --- - cells = vtkCellArray() - cells.InsertNextCell(poly_line) - - # Add the lines to the dataset - poly_data.SetLines(cells) - --- - cells = vtkCellArray() - cells.InsertNextCell(poly_line) - - # Add the lines to the dataset - poly_data.SetLines(cells) - --- - Triangles = vtkCellArray() - Triangle = vtkTriangle() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) --- - tris = vtkCellArray() - - cells = [[2, 0, 4], [1, 2, 4], [3, 1, 4], [0, 3, 4], [0, 2, 5], [2, 1, 5], [1, 3, 5], [3, 0, 5]] - - for cell in cells: - tris.InsertNextCell(3) --- - lines = vtkCellArray() - lines.InsertNextCell(10) # The number of points. - lines.InsertCellPoint(0) - lines.InsertCellPoint(1) - lines.InsertCellPoint(2) - lines.InsertCellPoint(3) --- - lines = vtkCellArray() - for pt in pts: - pt_id = points.InsertNextPoint(pt) - if pt_id < len(pts) - 1: - line = vtkLine() - line.GetPointIds().SetId(0, pt_id) --- - poly = vtkCellArray() - poly.InsertNextCell(8) # The number of points. - poly.InsertCellPoint(0) - poly.InsertCellPoint(1) - poly.InsertCellPoint(2) - poly.InsertCellPoint(3) --- - Triangles = vtkCellArray() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - --- - lines = vtkCellArray() - - # Create four lines. - for i in range(4): - line = vtkLine() - line.GetPointIds().SetId(0, i) --- - lines = vtkCellArray() - lines.InsertNextCell(line1) - lines.InsertNextCell(line2) - - # Create the vtkPolyData to contain the points and cellArray with the lines - polydata = vtkPolyData() --- - triangles = vtkCellArray() - - # Build the meshgrid manually - count = 0 - for i in range(size - 1): - for j in range(size - 1): --- - Triangles = vtkCellArray() - - Points.InsertNextPoint(1.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 0.0, 0.0) - Points.InsertNextPoint(0.0, 1.0, 0.0) - --- - Vertices = vtkCellArray() - - id = Points.InsertNextPoint(1.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 0.0, 0.0) --- - Vertices = vtkCellArray() - - id = Points.InsertNextPoint(1.0, 0.0, 0.0) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(id) - id = Points.InsertNextPoint(0.0, 0.0, 0.0) --- - lines = vtkCellArray() - line = vtkLine() - line.GetPointIds().SetId(0, 0) - line.GetPointIds().SetId(1, 1) - lines.InsertNextCell(line) - line.GetPointIds().SetId(0, 1) --- - cells = vtkCellArray() - cells.Initialize() - - if sides[0]: - # Top - top = vtkPolyLine() --- - hexs = vtkCellArray() - hexs.InsertNextCell(hexa) - - # Add the points and hexahedron to an unstructured grid. - uGrid = vtkUnstructuredGrid() - uGrid.SetPoints(points) --- - verts = vtkCellArray() - norms = vtkDoubleArray() - scalars = vtkDoubleArray() - - x = [0.0] * 3 - pts.InsertNextPoint(x) --- - ca = vtkCellArray() - fp = vtkPoints() - fp.InsertNextPoint(0, 1, 0) - fp.InsertNextPoint(8, 1, 0) - fp.InsertNextPoint(8, 2, 0) - fp.InsertNextPoint(10, 0.01, 0) --- - ca2 = vtkCellArray() - fp2 = vtkPoints() - fp2.InsertNextPoint(0, 1, 0) - fp2.InsertNextPoint(8, 1, 0) - fp2.InsertNextPoint(8, 2, 0) - fp2.InsertNextPoint(10, 0.01, 0) --- - ca = vtkCellArray() - pts = vtkPoints() - pts.InsertNextPoint(0, 1, 0) - pts.InsertNextPoint(8, 1, 0) - pts.InsertNextPoint(8, 2, 0) - pts.InsertNextPoint(10, 0, 0) --- - ca2 = vtkCellArray() - pts2 = vtkPoints() - pts2.InsertNextPoint(0, 1, 0) - pts2.InsertNextPoint(8, 1, 0) - pts2.InsertNextPoint(8, 2, 0) - pts2.InsertNextPoint(10, 0.01, 0) --- - lines = vtkCellArray() - pl = vtkPolyLine() - pl.GetPointIds().SetNumberOfIds(points.GetNumberOfPoints()) - for i in range(points.GetNumberOfPoints()): - pl.GetPointIds().SetId(i, i) - lines.InsertNextCell(pl) --- - triangles = vtkCellArray() - - # Set this up for each of the initial sides, then call the recursive function. - stride = (len(indices) - 1) // 3 - - # The cell data will allow us to color the triangles based on the level of --- - lines = vtkCellArray() - lines.InsertNextCell(num_pts + 1, vertex_indices) - - pd.SetPoints(points) - pd.SetLines(lines) - diff --git a/data/examples/pp/vtkCellLocator b/data/examples/pp/vtkCellLocator deleted file mode 100644 index 7ae6536..0000000 --- a/data/examples/pp/vtkCellLocator +++ /dev/null @@ -1,6 +0,0 @@ - locator = vtkCellLocator() - locator.SetDataSet(smooth_loop.GetOutput()) - locator.BuildLocator() - - maxloop = 1000 - dist = 20.0 / maxloop diff --git a/data/examples/pp/vtkCellPicker b/data/examples/pp/vtkCellPicker deleted file mode 100644 index 6da6032..0000000 --- a/data/examples/pp/vtkCellPicker +++ /dev/null @@ -1,6 +0,0 @@ - picker = vtkCellPicker() - picker.SetTolerance(0.0005) - - # Pick from this location. - picker.Pick(pos[0], pos[1], 0, self.GetDefaultRenderer()) - diff --git a/data/examples/pp/vtkCellTypeSource b/data/examples/pp/vtkCellTypeSource deleted file mode 100644 index 1b9ed68..0000000 --- a/data/examples/pp/vtkCellTypeSource +++ /dev/null @@ -1,6 +0,0 @@ - source = vtkCellTypeSource() - source.SetCellType(cellMap[cellName]) - source.Update() - print('Cell: ', cellName) - - originalPoints = source.GetOutput().GetPoints() diff --git a/data/examples/pp/vtkCellTypes b/data/examples/pp/vtkCellTypes deleted file mode 100644 index 2bf76e0..0000000 --- a/data/examples/pp/vtkCellTypes +++ /dev/null @@ -1,13 +0,0 @@ - cellName = vtkCellTypes.GetClassNameFromTypeId(cell.GetCellType()) - print(cellName, 'NumberOfPoints:', cell.GetNumberOfPoints(), 'CellDimension:', cell.GetCellDimension()) - legendValues.InsertNextValue(cellName) - it.GoToNextCell() - - # Tube the edges --- - ct = vtkCellTypes() - - numberOfCells = clipper.GetOutput().GetNumberOfCells() - print('------------------------') - print('The clipped dataset(inside) contains a\n', clipper.GetOutput().GetClassName(), 'that has', numberOfCells, - 'cells') diff --git a/data/examples/pp/vtkChart b/data/examples/pp/vtkChart deleted file mode 100644 index 891d66d..0000000 --- a/data/examples/pp/vtkChart +++ /dev/null @@ -1,52 +0,0 @@ - left_chart = vtkChartXY() - left_chart_scene = vtkContextScene() - left_chart_actor = vtkContextActor() - - left_chart_scene.AddItem(left_chart) - left_chart_actor.SetScene(left_chart_scene) --- - right_chart = vtkChartXY() - right_chart_scene = vtkContextScene() - right_chart_actor = vtkContextActor() - - right_chart_scene.AddItem(right_chart) - right_chart_actor.SetScene(right_chart_scene) --- - points = left_chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 1) - points.SetColor(*colors.GetColor4ub('Black')) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CROSS) - - points = right_chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 2) - points.SetColor(*colors.GetColor4ub('Black')) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.PLUS) - --- - chart = vtkChartXY() - view.GetScene().AddItem(chart) - chart.SetShowLegend(True) - - table = vtkTable() - --- - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 1) - points.SetColor(0, 0, 0, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CROSS) - - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 2) - points.SetColor(0, 0, 0, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.PLUS) - - points = chart.AddPlot(vtkChart.POINTS) - points.SetInputData(table, 0, 3) - points.SetColor(0, 0, 255, 255) - points.SetWidth(1.0) - points.SetMarkerStyle(vtkPlotPoints.CIRCLE) - diff --git a/data/examples/pp/vtkChartXY b/data/examples/pp/vtkChartXY deleted file mode 100644 index b4fc5ed..0000000 --- a/data/examples/pp/vtkChartXY +++ /dev/null @@ -1,20 +0,0 @@ - left_chart = vtkChartXY() - left_chart_scene = vtkContextScene() - left_chart_actor = vtkContextActor() - - left_chart_scene.AddItem(left_chart) - left_chart_actor.SetScene(left_chart_scene) --- - right_chart = vtkChartXY() - right_chart_scene = vtkContextScene() - right_chart_actor = vtkContextActor() - - right_chart_scene.AddItem(right_chart) - right_chart_actor.SetScene(right_chart_scene) --- - chart = vtkChartXY() - view.GetScene().AddItem(chart) - chart.SetShowLegend(True) - - table = vtkTable() - diff --git a/data/examples/pp/vtkChartXYZ b/data/examples/pp/vtkChartXYZ deleted file mode 100644 index 04210de..0000000 --- a/data/examples/pp/vtkChartXYZ +++ /dev/null @@ -1,6 +0,0 @@ - chart = vtkChartXYZ() - chart.SetGeometry(vtkRectf(10.0, 10.0, 630, 470)) - - plot = vtkPlotSurface() - - view = vtkContextView() diff --git a/data/examples/pp/vtkChartsCore b/data/examples/pp/vtkChartsCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCircularLayoutStrategy b/data/examples/pp/vtkCircularLayoutStrategy deleted file mode 100644 index d490417..0000000 --- a/data/examples/pp/vtkCircularLayoutStrategy +++ /dev/null @@ -1,6 +0,0 @@ - circularLayoutStrategy = vtkCircularLayoutStrategy() - - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(g) - - graphLayoutView.SetLayoutStrategy(circularLayoutStrategy) diff --git a/data/examples/pp/vtkClass b/data/examples/pp/vtkClass deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCleanPolyData b/data/examples/pp/vtkCleanPolyData deleted file mode 100644 index 97bef48..0000000 --- a/data/examples/pp/vtkCleanPolyData +++ /dev/null @@ -1,97 +0,0 @@ - cleanPolyData = vtkCleanPolyData() - cleanPolyData.SetInputData(trianglePolyData) - - # Use a filter to smooth the data (will add triangles and smooth). - smooth_loop = vtkLoopSubdivisionFilter() - smooth_loop.SetNumberOfSubdivisions(3) --- - cleanFilter = vtkCleanPolyData() - cleanFilter.SetInputConnection(appendFilter.GetOutputPort()) - cleanFilter.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - clean1 = vtkCleanPolyData() - clean1.SetInputConnection(tri1.GetOutputPort()) - clean1.Update() - input1 = clean1.GetOutput() - - poly2 = ReadPolyData(fn2) --- - clean2 = vtkCleanPolyData() - clean2.SetInputConnection(tri2.GetOutputPort()) - clean2.Update() - input2 = clean2.GetOutput() - else: - sphereSource1 = vtkSphereSource() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - # The next source will be a parametric function --- - cleanPolyData = vtkCleanPolyData() - cleanPolyData.SetInputData(trianglePolyData) - - # Use a filter to smooth the data (will add triangles and smooth) - # Use two different filters to show the difference - smooth_loop = vtkLoopSubdivisionFilter() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(clipper.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - normals = vtkPolyDataNormals() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - - return cleaner.GetOutput() --- - cleaner = vtkCleanPolyData() - cleaner.SetInputConnection(tri.GetOutputPort()) - cleaner.SetTolerance(0.005) - cleaner.Update() - cleanerBounds = cleaner.GetOutput().GetBounds() - diff --git a/data/examples/pp/vtkClipDataSet b/data/examples/pp/vtkClipDataSet deleted file mode 100644 index a7a2b4f..0000000 --- a/data/examples/pp/vtkClipDataSet +++ /dev/null @@ -1,55 +0,0 @@ - skin_clip = vtkClipDataSet() - skin_clip.SetInputConnection(skin_extractor.GetOutputPort()) - skin_clip.SetClipFunction(clip_function) - skin_clip.SetValue(0) - skin_clip.GenerateClipScalarsOn() - skin_clip.Update() --- - lens_clip = vtkClipDataSet() - lens_clip.SetInputConnection(lens_probe.GetOutputPort()) - lens_clip.SetValue(500) - lens_clip.GenerateClipScalarsOff() - lens_clip.Update() - --- - clipper = vtkClipDataSet() - clipper.SetInputData(rgrid) - clipper.InsideOutOn() - clipper.SetValue(0.0) - clipper.Update() - --- - clipper = vtkClipDataSet() - clipper.SetInputData(rgrid) - clipper.InsideOutOn() - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() --- - description = 'Use a vtkClipDataSet to clip a vtkUnstructuredGrid..' - epilogue = ''' - Use a vtkClipDataSet to clip a vtkUnstructuredGrid.. - The resulting output and clipped output are presented in yellow and red respectively. - To illustrate the clipped interfaces, the example uses a vtkTransform to rotate each - output about their centers. --- - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOff() - clipper.Update() --- - clipper1 = vtkClipDataSet() - clipper1.SetClipFunction(clipPlane) - clipper1.SetInputData(reader.GetOutput()) - clipper1.SetValue(0.0) - clipper1.InsideOutOn() - clipper1.GenerateClippedOutputOn() --- - clipper = vtkClipDataSet() - clipper.SetClipFunction(clipPlane) - clipper.SetInputData(reader.GetOutput()) - clipper.SetValue(0.0) - clipper.GenerateClippedOutputOn() - clipper.Update() diff --git a/data/examples/pp/vtkClipPolyData b/data/examples/pp/vtkClipPolyData deleted file mode 100644 index 745355e..0000000 --- a/data/examples/pp/vtkClipPolyData +++ /dev/null @@ -1,83 +0,0 @@ - clipper = vtkClipPolyData() - clipper.SetInputData(polyData) - clipper.SetClipFunction(plane) - clipper.SetValue(0) - clipper.Update() - --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(superquadric_source.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - # This will give us the polygonal data that is clipped away - clipper.GenerateClippedOutputOn() - --- -clipper = vtk.vtkClipPolyData() -clipper.SetClipFunction(implicit) -clipper.SetInputConnection(sphere.GetOutputPort()) -clipper.InsideOutOn() -clipper.Update() - --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(surface.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - # Now the tangents. --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(subdivide.GetOutputPort()) - clipper.SetClipFunction(clip_plane) - clipper.GenerateClippedOutputOn() - - cleaner = vtkCleanPolyData() --- - clipper = vtkClipPolyData() - clipper.SetInputConnection(plane.GetOutputPort()) - clipper.SetClipFunction(boolean) - clipper.GenerateClippedOutputOn() - clipper.GenerateClipScalarsOn() - clipper.SetValue(0) --- - aClipper = vtkClipPolyData() - aClipper.SetInputConnection(geometry.GetOutputPort()) - aClipper.SetValue(127.5) - aClipper.GenerateClipScalarsOff() - aClipper.InsideOutOn() - aClipper.GetOutput().GetPointData().CopyScalarsOff() --- - clipper = vtkClipPolyData() - clipper.SetClipFunction(plane) - clipper.InsideOutOn() - if fn: - reader = vtkXMLPolyDataReader() - reader.SetFileName(fp) diff --git a/data/examples/pp/vtkCollisionDetectionFilter b/data/examples/pp/vtkCollisionDetectionFilter deleted file mode 100644 index 8e65853..0000000 --- a/data/examples/pp/vtkCollisionDetectionFilter +++ /dev/null @@ -1,6 +0,0 @@ - collide = vtkCollisionDetectionFilter() - collide.SetInputConnection(0, sphere0.GetOutputPort()) - collide.SetTransform(0, transform0) - collide.SetInputConnection(1, sphere1.GetOutputPort()) - collide.SetMatrix(1, matrix1) - collide.SetBoxTolerance(0.0) diff --git a/data/examples/pp/vtkColor3ub b/data/examples/pp/vtkColor3ub deleted file mode 100644 index 33d9311..0000000 --- a/data/examples/pp/vtkColor3ub +++ /dev/null @@ -1,6 +0,0 @@ - color = vtkColor3ub(colorSeries.GetColor(i)) - c = list() - for j in range(0, 3): - c.append(color[j] / 255.0) - t = scalarRange[0] + (scalarRange[1] - scalarRange[0]) / (numColors - 1) * i - lut.AddRGBPoint(t, *c) diff --git a/data/examples/pp/vtkColorSeries b/data/examples/pp/vtkColorSeries deleted file mode 100644 index be33e5c..0000000 --- a/data/examples/pp/vtkColorSeries +++ /dev/null @@ -1,181 +0,0 @@ - colorSeries = vtkColorSeries() - seriesEnum = colorSeries.BREWER_QUALITATIVE_SET3 - colorSeries.SetColorScheme(seriesEnum) - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - - # Fill in a few known colors, the rest will be generated if needed. --- - color_series = vtkColorSeries() - color_series.SetColorScheme(color_map_idx) - print(f'Using color scheme #: {color_series.GetColorScheme()}, {color_series.GetColorSchemeName()}') - - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() --- - colorSeries = vtkColorSeries() - for i in range(colorSeries.GetNumberOfColorSchemes()): - colorSeries.SetColorScheme(i) - colorSchemes[i] = colorSeries.GetColorSchemeName() - return colorSchemes - --- - colorSeries = vtkColorSeries() - colorSeriesEnum = colorSeries.SPECTRUM - colorSeries.SetColorScheme(colorSeriesEnum) - - colorSeries.BuildLookupTable(lut1) - colorSeries.BuildLookupTable(lut2) --- - colorSeries = vtkColorSeries() - colorSeries.SetColorSchemeByName('Brewer Qualitative Pastel2') - rendererColors.append(colorSeries.GetColor(0)) - rendererColors.append(colorSeries.GetColor(1)) - rendererColors.append(colorSeries.GetColor(2)) - rendererColors.append(colorSeries.GetColor(3)) --- - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeriesEnum = colorSeries.BREWER_DIVERGING_SPECTRAL_8 - colorSeries.SetColorScheme(colorSeriesEnum) - lut.SetScaleToLog10() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) --- - colorSeries = vtkColorSeries() - colorSeries.SetColorScheme(vtkColorSeries.BREWER_DIVERGING_SPECTRAL_11) - - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, vtkColorSeries.ORDINAL) - --- - cs = vtkColorSeries() - sizes = list() - for i in range(0, cs.GetNumberOfColorSchemes()): - cs.SetColorScheme(i) - sizes.append(cs.GetNumberOfColors()) - vc = list() --- - s += 'vtkColorSeries\n' - s += self.MakeHTMLStyle() - s += '\n' - return s - - def MakeTableHeader(self): --- - res += '

    Color series available in vtkColorSeries

    \n' - res += '\n' - res += self.MakeTable() - res += '
    \n' - res += '\n' - return res --- - description = 'how to create a custom vtkColorSeries.' - epilogue = ''' -A vtkLookupTable is explicitly produced, it is populated with colors from the vtkColorSeries - using GetColorRepeating, since the size of the vtkLookupTable may be larger than the - colors in the vtkColorSeries. - --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKBlueColors') - - myColors.AddColor(nc.GetColor3ub('alice_blue')) - myColors.AddColor(nc.GetColor3ub('blue')) - myColors.AddColor(nc.GetColor3ub('blue_light')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKBrownColors') - - myColors.AddColor(nc.GetColor3ub('beige')) - myColors.AddColor(nc.GetColor3ub('brown')) - myColors.AddColor(nc.GetColor3ub('brown_madder')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKRedColors') - - myColors.AddColor(nc.GetColor3ub('alizarin_crimson')) - myColors.AddColor(nc.GetColor3ub('brick')) - myColors.AddColor(nc.GetColor3ub('cadmium_red_deep')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKOrangeColors') - - myColors.AddColor(nc.GetColor3ub('cadmium_orange')) - myColors.AddColor(nc.GetColor3ub('cadmium_red_light')) - myColors.AddColor(nc.GetColor3ub('carrot')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKWhiteColors') - - myColors.AddColor(nc.GetColor3ub('antique_white')) - myColors.AddColor(nc.GetColor3ub('azure')) - myColors.AddColor(nc.GetColor3ub('bisque')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKGreyColors') - - myColors.AddColor(nc.GetColor3ub('cold_grey')) - myColors.AddColor(nc.GetColor3ub('dim_grey')) - myColors.AddColor(nc.GetColor3ub('grey')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKMagentaColors') - - myColors.AddColor(nc.GetColor3ub('blue_violet')) - myColors.AddColor(nc.GetColor3ub('cobalt_violet_deep')) - myColors.AddColor(nc.GetColor3ub('magenta')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKCyanColors') - - myColors.AddColor(nc.GetColor3ub('aquamarine')) - myColors.AddColor(nc.GetColor3ub('aquamarine_medium')) - myColors.AddColor(nc.GetColor3ub('cyan')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKYellowColors') - - myColors.AddColor(nc.GetColor3ub('aureoline_yellow')) - myColors.AddColor(nc.GetColor3ub('banana')) - myColors.AddColor(nc.GetColor3ub('cadmium_lemon')) --- - myColors = vtkColorSeries() - myColors.SetColorSchemeByName('VTKGreenColors') - - myColors.AddColor(nc.GetColor3ub('chartreuse')) - myColors.AddColor(nc.GetColor3ub('chrome_oxide_green')) - myColors.AddColor(nc.GetColor3ub('cinnabar_green')) --- - color_series = vtkColorSeries() - # Select a color scheme. - # color_series_enum = color_series.BREWER_DIVERGING_BROWN_BLUE_GREEN_9 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_10 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_3 - # color_series_enum = color_series.BREWER_DIVERGING_PURPLE_ORANGE_9 --- - color_series = vtkColorSeries() - # Select a color scheme. - # color_series_enum = color_series.BREWER_DIVERGING_BROWN_BLUE_GREEN_9 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_10 - # color_series_enum = color_series.BREWER_DIVERGING_SPECTRAL_3 - # color_series_enum = color_series.BREWER_DIVERGING_PURPLE_ORANGE_9 --- - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeries.SetColorSchemeName('Hawaii') - colorSeries.SetColor(0, colors.GetColor3ub("turquoise_blue")) - colorSeries.SetColor(1, colors.GetColor3ub("sea_green_medium")) - colorSeries.SetColor(2, colors.GetColor3ub("sap_green")) --- - colorSeries = vtkColorSeries() - colorSeries.SetNumberOfColors(8) - colorSeriesEnum = colorSeries.BREWER_DIVERGING_BROWN_BLUE_GREEN_8 - colorSeries.SetColorScheme(colorSeriesEnum) - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) --- - colorSeries = vtkColorSeries() - # Select a color scheme. - # for i in range(0,62): - # colorSeries.SetColorScheme(i) - # print('Colour scheme {:2d}: {:s}'.format(colorSeries.GetColorScheme(), colorSeries.GetColorSchemeName())) - diff --git a/data/examples/pp/vtkColorTransferFunction b/data/examples/pp/vtkColorTransferFunction deleted file mode 100644 index ee133a3..0000000 --- a/data/examples/pp/vtkColorTransferFunction +++ /dev/null @@ -1,132 +0,0 @@ - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - for scheme in cm[ct]: - ctf.AddRGBPoint(*scheme) - - table_size = 256 --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - cm = color_maps[color_map] - - ctf.AddRGBPoint(0.0, *cm['start']) - ctf.AddRGBPoint(0.5, *cm['mid']) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) - p3 = [1.0] + list(colors.GetColor3d(end)) - ctf.AddRGBPoint(*p1) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - cm = color_maps[color_map] - - ctf.AddRGBPoint(0.0, *cm['start']) - ctf.AddRGBPoint(0.5, *cm['mid']) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) - p3 = [1.0] + list(colors.GetColor3d(end)) - ctf.AddRGBPoint(*p1) --- - volume_color = vtkColorTransferFunction() - volume_color.AddRGBPoint(0, 0.0, 0.0, 0.0) - volume_color.AddRGBPoint(500, 240.0 / 255.0, 184.0 / 255.0, 160.0 / 255.0) - volume_color.AddRGBPoint(1000, 240.0 / 255.0, 184.0 / 255.0, 160.0 / 255.0) - volume_color.AddRGBPoint(1150, 1.0, 1.0, 240.0 / 255.0) # Ivory - --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.230, 0.299, 0.754) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.706, 0.016, 0.150) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) - p3 = [1.0] + list(colors.GetColor3d('DarkOrange')) - ctf.AddRGBPoint(*p1) --- - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() - - # Use a color series to create a transfer function - for i in range(0, color_series.GetNumberOfColors()): - color = color_series.GetColor(i) --- -colorFunction = vtk.vtkColorTransferFunction() -colorFunction.SetColorSpaceToHSV() -colorFunction.HSVWrapOff() -colorFunction.AddRGBPoint(drange[0], 0.0, 0.0, 1.0) -colorFunction.AddRGBPoint(drange[1], 1.0, 0.0, 0.0) - --- - colorFunc = vtkColorTransferFunction() - colorFunc.AddRGBPoint(50, 1.0, 0.0, 0.0) - colorFunc.AddRGBPoint(100, 0.0, 1.0, 0.0) - colorFunc.AddRGBPoint(150, 0.0, 0.0, 1.0) - - # The previous two classes stored properties. --- - ctf = vtkColorTransferFunction() - - if colorScheme == 1: - # Green to purple diverging. - ctf.SetColorSpaceToDiverging() - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Green to tan. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.677, 0.492, 0.093) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.758, 0.214, 0.233) --- - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - # Cool to warm. - ctf.AddRGBPoint(0.0, 0.085, 0.532, 0.201) - ctf.AddRGBPoint(0.5, 0.865, 0.865, 0.865) - ctf.AddRGBPoint(1.0, 0.758, 0.214, 0.233) --- - lut = vtkColorTransferFunction() - lut.SetColorSpaceToHSV() - numColors = colorSeries.GetNumberOfColors() - for i in range(0, numColors): - color = vtkColor3ub(colorSeries.GetColor(i)) - c = list() --- - colorTransferFunction = vtkColorTransferFunction() - colorTransferFunction.AddRGBPoint(0.0, 0.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(64.0, 1.0, 0.0, 0.0) - colorTransferFunction.AddRGBPoint(128.0, 0.0, 0.0, 1.0) - colorTransferFunction.AddRGBPoint(192.0, 0.0, 1.0, 0.0) - colorTransferFunction.AddRGBPoint(255.0, 0.0, 0.2, 0.0) diff --git a/data/examples/pp/vtkCommand b/data/examples/pp/vtkCommand deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonColor b/data/examples/pp/vtkCommonColor deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonComputationalGeometry b/data/examples/pp/vtkCommonComputationalGeometry deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonCore b/data/examples/pp/vtkCommonCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonDataModel b/data/examples/pp/vtkCommonDataModel deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonExecutionModel b/data/examples/pp/vtkCommonExecutionModel deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonMath b/data/examples/pp/vtkCommonMath deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCommonTransforms b/data/examples/pp/vtkCommonTransforms deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCompassRepresentation b/data/examples/pp/vtkCompassRepresentation deleted file mode 100644 index f83109d..0000000 --- a/data/examples/pp/vtkCompassRepresentation +++ /dev/null @@ -1,6 +0,0 @@ - compassRepresentation = vtkCompassRepresentation() - - compassWidget = vtkCompassWidget() - compassWidget.SetInteractor(renderWindowInteractor) - compassWidget.SetRepresentation(compassRepresentation) - diff --git a/data/examples/pp/vtkCompassWidget b/data/examples/pp/vtkCompassWidget deleted file mode 100644 index 6856039..0000000 --- a/data/examples/pp/vtkCompassWidget +++ /dev/null @@ -1,6 +0,0 @@ - compassWidget = vtkCompassWidget() - compassWidget.SetInteractor(renderWindowInteractor) - compassWidget.SetRepresentation(compassRepresentation) - - # add a callback to update the camera position on vtkCommand::WidgetValueChangedEvent - compassWidget.AddObserver(vtkCommand.WidgetValueChangedEvent, CompassWidgetValueChangedCallback) diff --git a/data/examples/pp/vtkCompositeDataDisplayAttributes b/data/examples/pp/vtkCompositeDataDisplayAttributes deleted file mode 100644 index b377f56..0000000 --- a/data/examples/pp/vtkCompositeDataDisplayAttributes +++ /dev/null @@ -1,6 +0,0 @@ - cdsa = vtkCompositeDataDisplayAttributes() - mapper.SetCompositeDataDisplayAttributes(cdsa) - - # You can use the vtkCompositeDataDisplayAttributes to set the color, - # opacity and visibiliy of individual blocks of the multiblock dataset. - # Attributes are mapped by block pointers (vtkDataObject*), so these can diff --git a/data/examples/pp/vtkCompositeDataGeometryFilter b/data/examples/pp/vtkCompositeDataGeometryFilter deleted file mode 100644 index f6c6ffc..0000000 --- a/data/examples/pp/vtkCompositeDataGeometryFilter +++ /dev/null @@ -1,27 +0,0 @@ - polydata = vtkCompositeDataGeometryFilter() - polydata.SetInputConnection(edges.GetOutputPort()) - - # Create the Renderer, RenderWindow, and RenderWindowInteractor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() --- - geomFilter = vtkCompositeDataGeometryFilter() - geomFilter.SetInputConnection(of.GetOutputPort()) - - # Create an iso-surface - at 10. - cf = vtkContourFilter() - cf.SetInputData(amr) --- - geomFilter2 = vtkCompositeDataGeometryFilter() - geomFilter2.SetInputConnection(cf.GetOutputPort()) - - # Create the render window, renderer, and interactor. - aren = vtkRenderer() - renWin = vtkRenderWindow() --- - geometry = vtkCompositeDataGeometryFilter() - geometry.SetInputConnection(0, reader.GetOutputPort(0)) - geometry.Update() - - # Mapper - mapper = vtkPolyDataMapper() diff --git a/data/examples/pp/vtkCompositePolyDataMapper b/data/examples/pp/vtkCompositePolyDataMapper deleted file mode 100644 index 64da0a2..0000000 --- a/data/examples/pp/vtkCompositePolyDataMapper +++ /dev/null @@ -1,6 +0,0 @@ - mapper = vtkCompositePolyDataMapper() - mapper.SetInputDataObject(mbds) - cdsa = vtkCompositeDataDisplayAttributes() - mapper.SetCompositeDataDisplayAttributes(cdsa) - - # You can use the vtkCompositeDataDisplayAttributes to set the color, diff --git a/data/examples/pp/vtkCompositePolyDataMapper2 b/data/examples/pp/vtkCompositePolyDataMapper2 deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCone b/data/examples/pp/vtkCone deleted file mode 100644 index 8e42cf8..0000000 --- a/data/examples/pp/vtkCone +++ /dev/null @@ -1,6 +0,0 @@ - cone = vtkCone() - cone.SetAngle(20) - - vertPlane = vtkPlane() - vertPlane.SetOrigin(.1, 0, 0) - vertPlane.SetNormal(-1, 0, 0) diff --git a/data/examples/pp/vtkConeSource b/data/examples/pp/vtkConeSource deleted file mode 100644 index 472949d..0000000 --- a/data/examples/pp/vtkConeSource +++ /dev/null @@ -1,300 +0,0 @@ - coneSource = vtkConeSource() - coneSource.Update() - - input2.ShallowCopy(coneSource.GetOutput()) - - # Append the two meshes --- - coneSource = vtkConeSource() - # coneSource.SetResolution(60) - # coneSource.SetCenter(-2,0,0) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - source = vtkConeSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - # Use the golden ratio for the height. Because we can! - source.SetHeight(1.6180339887498948482) - source.SetResolution(128) --- - cone = vtkConeSource() - cone.SetResolution(20) - cone.Update() - - # implicit function that will be used to slice the mesh - implicitPolyDataDistance = vtkImplicitPolyDataDistance() --- - cone = vtkConeSource() - cone.SetResolution(50) - cone.SetDirection(0, 0, -1) - cone.SetHeight(3.0) - cone.CappingOn() - cone.Update() --- - source = vtkConeSource() - source.SetCenter(0, 0, 0) - source.SetResolution(100) - - # mapper - mapper = vtkPolyDataMapper() --- - cone = vtkConeSource() - cone.SetResolution(5) - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) - glyph.SetVectorModeToUseNormal() --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - source = vtkConeSource() - source.SetResolution(25) - source.SetDirection(0, 1, 0) - source.SetHeight(1) - source.Update() - poly_data.DeepCopy(source.GetOutput()) --- - cone = vtkConeSource() - cone.SetResolution(6) - - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) --- - cone = vtkConeSource() - cone.SetResolution(8) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - --- - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetHeight(1.0) - coneSource.SetRadius(0.25) - coneSource.SetDirection(0.0, 1.0, 0.0) - coneSource.SetResolution(60) --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - coneMapper = vtkPolyDataMapper() --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - # --- - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - bounds = cone.GetOutput().GetBounds() --- - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - --- - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) - - cone_mapper = vtkPolyDataMapper() --- - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.Update() - sources.append(coneSource) - elif i == 2: - # Create a cube --- - cone = vtkConeSource() - cone.SetResolution(6) - cone.SetDirection(0, 1, 0) - cone.SetHeight(1) - cone.Update() - --- - cone = vtkConeSource() - cone.SetResolution(11) - cone.SetHeight(1) - cone.SetRadius(0.25) - - cones = vtkGlyph3D() --- - coneSrc = vtkConeSource() - coneSrc.SetRadius(0.5) - coneSrc.SetHeight(2) - - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) --- - cone = vtkConeSource() - cone.SetResolution(24) - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) --- - cone = vtkConeSource() - cone.SetResolution(6) - - transform = vtkTransform() - transform.Translate(0.5, 0.0, 0.0) - --- - coneSrc = vtkConeSource() - coneSrc.SetRadius(.5) - coneSrc.SetHeight(2) - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - coneActor = vtkActor() --- - coneSrc = vtkConeSource() - coneSrc.SetRadius(.5) - coneSrc.SetHeight(2) - coneMap = vtkPolyDataMapper() - coneMap.SetInputConnection(coneSrc.GetOutputPort()) - coneActor = vtkActor() --- - camCS = vtkConeSource() - camCS.SetHeight(1.5) - camCS.SetResolution(12) - camCS.SetRadius(0.4) - - camCBS = vtkCubeSource() --- - camCS = vtkConeSource() - camCS.SetHeight(1.5) - camCS.SetResolution(12) - camCS.SetRadius(0.4) - - camCBS = vtkCubeSource() --- - sph = vtkConeSource() - sph.SetRadius(0.1) - sph.SetHeight(0.5) - - # Set up the glyph filter - glyph = vtkGlyph3D() --- - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetRadius(5.0) - coneSource.SetHeight(15.0) - coneSource.SetDirection(0, 1, 0) - coneSource.SetResolution(60) --- - cs2 = vtkConeSource() - cs2.SetRadius(0.25) - cs2.SetHeight(0.5) - - # Set up the glyph filter - glyph = vtkGlyph3D() --- - cone = vtkConeSource() - cone.SetCenter(0.0, 0.0, 0.0) - cone.SetDirection(0, 1, 0) - cone.Update() - sources.append(cone) - # Create a cube --- - cone = vtkConeSource() - cone.SetCenter(0.0, 0.0, 0.0) - cone.SetDirection(0, 1, 0) - cone.Update() - sources.append(cone) - # Create a cube --- - coneSource = vtkConeSource() - coneSource.SetCenter(0.0, 0.0, 0.0) - coneSource.SetRadius(5.0) - coneSource.SetHeight(10) - coneSource.SetDirection(0, 1, 0) - coneSource.SetResolution(6) --- - cone = vtkConeSource() - cone.SetResolution(6) - cone.CappingOn() - cone.Update() - coneBounds = cone.GetOutput().GetBounds() - --- - cone_source = vtkConeSource() - glyph_filter.SetSourceConnection(cone_source.GetOutputPort()) - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(glyph_filter.GetOutputPort()) --- - cone_source = vtkConeSource() - cone_source.SetCenter(point_coords) - self.glyph_filter.SetSourceConnection(cone_source.GetOutputPort()) - elif self.glyph_filter.GetPointId() == 1: - cube_source = vtkCubeSource() - cube_source.SetCenter(point_coords) --- - cone_source = vtkConeSource() - cone_source.SetResolution(24) - cone_source.SetDirection(1.0, 1.0, 1.0) - - cone_mapper = vtkPolyDataMapper() - cone_mapper.SetInputConnection(cone_source.GetOutputPort()) --- - cone = vtkConeSource() - cone.SetResolution(20) - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(cone.GetOutputPort()) - coneActor = vtkActor() - coneActor.SetMapper(coneMapper) diff --git a/data/examples/pp/vtkConnectivityFilter b/data/examples/pp/vtkConnectivityFilter deleted file mode 100644 index 8a527ed..0000000 --- a/data/examples/pp/vtkConnectivityFilter +++ /dev/null @@ -1,13 +0,0 @@ - connectivityFilter = vtkConnectivityFilter() - connectivityFilter.SetInputConnection(appendFilter.GetOutputPort()) - connectivityFilter.SetExtractionModeToAllRegions() - connectivityFilter.ColorRegionsOn() - connectivityFilter.Update() - --- - connect = vtkConnectivityFilter() - connect.SetInputConnection(deci.GetOutputPort()) - connect.SetExtractionModeToLargestRegion() - connect.Update() - print('After Connectivity.') - print('There are: ', NumberOfTriangles(connect.GetOutput()), 'triangles') diff --git a/data/examples/pp/vtkContextActor b/data/examples/pp/vtkContextActor deleted file mode 100644 index c7f321c..0000000 --- a/data/examples/pp/vtkContextActor +++ /dev/null @@ -1,13 +0,0 @@ - left_chart_actor = vtkContextActor() - - left_chart_scene.AddItem(left_chart) - left_chart_actor.SetScene(left_chart_scene) - - left_renderer.AddActor(left_chart_actor) --- - right_chart_actor = vtkContextActor() - - right_chart_scene.AddItem(right_chart) - right_chart_actor.SetScene(right_chart_scene) - - right_renderer.AddActor(right_chart_actor) diff --git a/data/examples/pp/vtkContextMouseEvent b/data/examples/pp/vtkContextMouseEvent deleted file mode 100644 index e685f7d..0000000 --- a/data/examples/pp/vtkContextMouseEvent +++ /dev/null @@ -1,6 +0,0 @@ - mouseEvent = vtkContextMouseEvent() - mouseEvent.SetInteractor(view.GetInteractor()) - - pos = vtkVector2i() - - lastPos = vtkVector2i() diff --git a/data/examples/pp/vtkContextScene b/data/examples/pp/vtkContextScene deleted file mode 100644 index cd5b694..0000000 --- a/data/examples/pp/vtkContextScene +++ /dev/null @@ -1,13 +0,0 @@ - left_chart_scene = vtkContextScene() - left_chart_actor = vtkContextActor() - - left_chart_scene.AddItem(left_chart) - left_chart_actor.SetScene(left_chart_scene) - --- - right_chart_scene = vtkContextScene() - right_chart_actor = vtkContextActor() - - right_chart_scene.AddItem(right_chart) - right_chart_actor.SetScene(right_chart_scene) - diff --git a/data/examples/pp/vtkContextTransform b/data/examples/pp/vtkContextTransform deleted file mode 100644 index a33b0e7..0000000 --- a/data/examples/pp/vtkContextTransform +++ /dev/null @@ -1,6 +0,0 @@ - placeLegend = vtkContextTransform() - placeLegend.AddItem(legend) - placeLegend.Translate(640 - 20, 480 - 12 * 16) - - contextView = vtkContextView() - contextView.GetScene().AddItem(placeLegend) diff --git a/data/examples/pp/vtkContextView b/data/examples/pp/vtkContextView deleted file mode 100644 index 698755e..0000000 --- a/data/examples/pp/vtkContextView +++ /dev/null @@ -1,20 +0,0 @@ - contextView = vtkContextView() - contextView.GetScene().AddItem(placeLegend) - - renderer = contextView.GetRenderer() - - renderWindow = contextView.GetRenderWindow() --- - view = vtkContextView() - view.GetRenderer().SetBackground(colors.GetColor3d('SlateGray')) - view.GetRenderWindow().SetSize(400, 300) - - chart = vtkChartXY() - view.GetScene().AddItem(chart) --- - view = vtkContextView() - view.GetRenderer().SetBackground(colors.GetColor3d("Silver")) - view.GetRenderWindow().SetSize(640, 480) - view.GetScene().AddItem(chart) - - # Create a surface diff --git a/data/examples/pp/vtkContourFilter b/data/examples/pp/vtkContourFilter deleted file mode 100644 index c2c0088..0000000 --- a/data/examples/pp/vtkContourFilter +++ /dev/null @@ -1,265 +0,0 @@ - cf = vtkContourFilter() - cf.SetInputData(amr) - cf.SetNumberOfContours(1) - cf.SetValue(0, 10.0) - - geomFilter2 = vtkCompositeDataGeometryFilter() --- - surface = vtkContourFilter() - surface.SetInputConnection(splatter.GetOutputPort()) - surface.SetValue(0, 0.01) - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(surface.GetOutputPort()) --- - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() --- - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() --- - surface = vtkContourFilter() - surface.SetInputConnection(sample.GetOutputPort()) - surface.SetValue(0, 0.0) - - # mapper - mapper = vtkPolyDataMapper() --- - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, 1, 1) - - # Map the contours to graphical primitives - contourMapper = vtkPolyDataMapper() --- - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, 2.0, 2.0) - - # Map the contours to graphical primitives. - contourMapper = vtkPolyDataMapper() --- - contourFilter = vtkContourFilter() - contourFilter.SetInputConnection(reader.GetOutputPort()) - # Change the range(2nd and 3rd Parameter) based on your - # requirement. recommended value for 1st parameter is above 1 - # contourFilter.GenerateValues(5, 80.0, 100.0) - contourFilter.SetValue(0, iso_value) --- - popSurface = vtkContourFilter() - popSurface.SetInputConnection(popSplatter.GetOutputPort()) - popSurface.SetValue(0, 0.01) - - popMapper = vtkPolyDataMapper() - popMapper.SetInputConnection(popSurface.GetOutputPort()) --- - lateSurface = vtkContourFilter() - lateSurface.SetInputConnection(lateSplatter.GetOutputPort()) - lateSurface.SetValue(0, 0.01) - - lateMapper = vtkPolyDataMapper() - lateMapper.SetInputConnection(lateSurface.GetOutputPort()) --- - contour = vtkContourFilter() - contour.SetInputConnection(sample.GetOutputPort()) - range = [1.0, 6.0] - contour.GenerateValues(5, range) - # Map the contour. - contourMapper = vtkPolyDataMapper() --- - contour = vtkContourFilter() - contour.SetInputData(vol) - contour.SetValue(0, 0.0) - - volMapper = vtkPolyDataMapper() - volMapper.SetInputConnection(contour.GetOutputPort()) --- - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 175) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) --- - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 175) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) --- - iso = vtkContourFilter() - iso.SetInputData(pl3d.GetOutput().GetBlock(0)) - iso.SetValue(0, 0.38) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(iso.GetOutputPort()) --- - contour = vtkContourFilter() - contour.SetInputConnection(sample.GetOutputPort()) - contour.GenerateValues(5, 0, 1.2) - - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) --- - cutter = vtkContourFilter() - cutter.SetInputConnection(reader.GetOutputPort()) - cutter.ComputeScalarsOff() - cutter.ComputeNormalsOff() - cutter.GenerateValues( - numberOfCuts, --- - contour = vtkContourFilter() - flyingEdges = vtkFlyingEdges2D() - isoMapper = vtkPolyDataMapper() - if useContouring: - contour.SetInputConnection(extractVOI.GetOutputPort()) - contour.GenerateValues(12, scalarRange) --- - description = 'Either vtkFlyingEdges2D or vtkContourFilter is used to generate contour lines.' - epilogue = ''' - Generate 2D contour lines, corresponding to tissue density, on one CT slice through the head. - The contour lines are colored by the tissue density. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, --- - help='Use vtkContourFilter instead of vtkFlyingEdges2D.') - args = parser.parse_args() - return args.filename, args.useContouring - - -if __name__ == '__main__': --- - iso = vtkContourFilter() - iso.SetInputConnection(extractVOI.GetOutputPort()) - iso.GenerateValues(12, 500, 1150) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) --- - contour = vtkContourFilter() - contour.SetInputConnection(imp.GetOutputPort()) - contour.SetValue(0, 0.25) - - impMapper = vtkPolyDataMapper() - impMapper.SetInputConnection(contour.GetOutputPort()) --- - theConeSurface = vtkContourFilter() - theConeSurface.SetInputConnection(theConeSample.GetOutputPort()) - theConeSurface.SetValue(0, 0.0) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(theConeSurface.GetOutputPort()) --- - theCreamSurface = vtkContourFilter() - theCreamSurface.SetInputConnection(theCreamSample.GetOutputPort()) - theCreamSurface.SetValue(0, 0.0) - - creamMapper = vtkPolyDataMapper() - creamMapper.SetInputConnection(theCreamSurface.GetOutputPort()) --- - iso = vtkContourFilter() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, 128) - - isoMapper = vtkPolyDataMapper() - isoMapper.SetInputConnection(iso.GetOutputPort()) --- - Marching = vtkContourFilter() - Marching.SetInputData(Grid) - Marching.SetValue(0, 0.5) - Marching.Update() - - # Extract the edges of the triangles just found. --- - contour = vtkContourFilter() - contour.SetInputConnection(probe.GetOutputPort()) - contour.GenerateValues(50, sg.GetScalarRange()) - - contourMapper = vtkPolyDataMapper() - contourMapper.SetInputConnection(contour.GetOutputPort()) --- - contour = vtkContourFilter() - contour.SetInputConnection(splat.GetOutputPort()) - contour.SetValue(0, 0.9) - splatMapper = vtkPolyDataMapper() - splatMapper.SetInputConnection(contour.GetOutputPort()) - splatActor = vtkActor() --- - contour = vtkContourFilter() - contour.SetInputConnection(splatter.GetOutputPort()) - contour.SetValue(0, 0.25) - - splatMapper = vtkPolyDataMapper() - splatMapper.SetInputConnection(contour.GetOutputPort()) --- - blobbyLogoIso = vtkContourFilter() - blobbyLogoIso.SetInputConnection(blobbyLogoImp.GetOutputPort()) - blobbyLogoIso.SetValue(1, 1.5) - - # Map to rendering primitives. - blobbyLogoMapper = vtkPolyDataMapper() --- - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) - arrowCF.SetValue(0, 0.2) - - arrowWT = vtkWarpTo() - arrowWT.SetInputConnection(arrowCF.GetOutputPort()) --- - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) - arrowCF.SetValue(0, 0.2) - - arrowWT = vtkWarpTo() - arrowWT.SetInputConnection(arrowCF.GetOutputPort()) --- - contours = vtkContourFilter() - contours.SetInputConnection(sample.GetOutputPort()) - contours.GenerateValues(1, value, value) - - # map the contours to graphical primitives - contourMapper = vtkPolyDataMapper() --- - contour = vtkContourFilter() - contour.SetInputData(volume) - contour.SetValue(0, 50) - - # Create mapper. - mapper = vtkPolyDataMapper() --- - contour = vtkContourFilter() - contour.SetInputConnection(func.GetOutputPort()) - ranges = [1.0, 6.0] - contour.GenerateValues(numberOfContours, ranges) - - # Map contour --- - contour = vtkContourFilter() - contour.SetInputConnection(extract.GetOutputPort()) - contour.GenerateValues(numberOfContours, ranges) - append.AddInputConnection(contour.GetOutputPort()) - sliceNum += sliceIncr - append.Update() --- - iso = vtkContourFilter() - iso.SetInputData(pl3dOutput) - iso.SetValue(0, .22) - - normals = vtkPolyDataNormals() - normals.SetInputConnection(iso.GetOutputPort()) diff --git a/data/examples/pp/vtkContourTriangulator b/data/examples/pp/vtkContourTriangulator deleted file mode 100644 index 1f7b6ac..0000000 --- a/data/examples/pp/vtkContourTriangulator +++ /dev/null @@ -1,6 +0,0 @@ - poly = vtkContourTriangulator() - poly.SetInputConnection(iso.GetOutputPort()) - - poly_mapper = vtkDataSetMapper() - poly_mapper.SetInputConnection(poly.GetOutputPort()) - poly_mapper.ScalarVisibilityOff() diff --git a/data/examples/pp/vtkContourWidget b/data/examples/pp/vtkContourWidget deleted file mode 100644 index 3b28a4c..0000000 --- a/data/examples/pp/vtkContourWidget +++ /dev/null @@ -1,6 +0,0 @@ - contourWidget = vtkContourWidget() - contourWidget.SetInteractor(interactor) - contourWidget.SetRepresentation(contourRep) - contourWidget.On() - - for arg in sys.argv: diff --git a/data/examples/pp/vtkConvexPointSet b/data/examples/pp/vtkConvexPointSet deleted file mode 100644 index 66ab349..0000000 --- a/data/examples/pp/vtkConvexPointSet +++ /dev/null @@ -1,6 +0,0 @@ - cps = vtkConvexPointSet() - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(0, 1, 0) diff --git a/data/examples/pp/vtkCoordinate b/data/examples/pp/vtkCoordinate deleted file mode 100644 index 2fa0918..0000000 --- a/data/examples/pp/vtkCoordinate +++ /dev/null @@ -1,13 +0,0 @@ - normCoords = vtkCoordinate() - normCoords.SetCoordinateSystemToNormalizedViewport() - - # Set up the mapper and actor (2D) for the grid. - mapper = vtkPolyDataMapper2D() - mapper.SetInputData(Grid) --- - coordinate = vtkCoordinate() - coordinate.SetCoordinateSystemToNormalizedViewport() - - mapper = vtkPolyDataMapper2D() - mapper.SetInputData(poly) - mapper.SetTransformCoordinate(coordinate) diff --git a/data/examples/pp/vtkCubeAxesActor b/data/examples/pp/vtkCubeAxesActor deleted file mode 100644 index 5680ca5..0000000 --- a/data/examples/pp/vtkCubeAxesActor +++ /dev/null @@ -1,6 +0,0 @@ - cubeAxesActor = vtkCubeAxesActor() - cubeAxesActor.SetUseTextActor3D(1) - cubeAxesActor.SetBounds(superquadricSource.GetOutput().GetBounds()) - cubeAxesActor.SetCamera(renderer.GetActiveCamera()) - cubeAxesActor.GetTitleTextProperty(0).SetColor(axis1Color) - cubeAxesActor.GetTitleTextProperty(0).SetFontSize(48) diff --git a/data/examples/pp/vtkCubeSource b/data/examples/pp/vtkCubeSource deleted file mode 100644 index d06a745..0000000 --- a/data/examples/pp/vtkCubeSource +++ /dev/null @@ -1,223 +0,0 @@ - cubeSource = vtkCubeSource() - - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(cubeSource.GetOutputPort()) - glyph3D.SetInputData(polydata) - glyph3D.Update() --- - cube = vtkCubeSource() - cube.Update() - - # mapper - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputData(cube.GetOutput()) --- - plane = vtkCubeSource() - plane.SetCenter(center) - plane.SetXLength(x_length) - plane.SetYLength(thickness) - plane.SetZLength(z_length) - --- - plane = vtkCubeSource() - plane.SetCenter(center) - plane.SetXLength(x_length) - plane.SetYLength(thickness) - plane.SetZLength(z_length) - --- - cubeSource = vtkCubeSource() - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(cubeSource.GetOutputPort()) - shrink.SetShrinkFactor(0.9) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - # Subdivide the triangles --- -cube = vtk.vtkCubeSource() -cube.SetBounds(-1, 1, -1, 1, -1, 1) -cube.Update() - -# Create 3D cells so vtkImplicitDataSet evaluates inside vs outside correctly -tri = vtk.vtkDelaunay3D() --- - cube_source = vtkCubeSource() - cube_source.SetXLength(4.0) - cube_source.SetYLength(9.0) - cube_source.SetZLength(1.0) - cube_source.SetCenter(0.0, 0.0, 0.0) - --- - cube = vtkCubeSource() - - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cube.GetOutputPort()) - - cubeActor = vtkActor() --- - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() --- - cube = vtkCubeSource() - - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(cube.GetOutputPort()) - - tangents = vtkPolyDataTangents() --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - surface = vtkCubeSource() - - # Triangulate. - triangulation = vtkTriangleFilter() - triangulation.SetInputConnection(surface.GetOutputPort()) - --- - plane = vtkCubeSource() - plane.SetCenter((bounds[1] + bounds[0]) / 2.0, - bounds[2] - thickness / 2.0, - (bounds[5] + bounds[4]) / 2.0) - plane.SetXLength(bounds[1] - bounds[0] + (rnge[0] * expand)) - plane.SetYLength(thickness) --- - cubeSource = vtkCubeSource() - cubeSource.SetXLength(4.0) - cubeSource.SetYLength(9.0) - cubeSource.SetZLength(1.0) - cubeSource.SetCenter(0.0, 0.0, 0.0) - --- - cubeSource = vtkCubeSource() - cubeSource.SetCenter(0.0, 0.0, 0.0) - cubeSource.Update() - sources.append(cubeSource) - else: - # Create a cylinder --- - cube = vtkCubeSource() - cube.SetXLength(40) - cube.SetYLength(30) - cube.SetZLength(20) - cubeMapper = vtkPolyDataMapper() - cubeMapper.SetInputConnection(cube.GetOutputPort()) --- - CubeModel = vtkCubeSource() - CubeModel.SetCenter(.5, .5, .5) - - Edges = vtkExtractEdges() - Edges.SetInputConnection(CubeModel.GetOutputPort()) - --- - baseModel = vtkCubeSource() - baseModel.SetXLength(1.5) - baseModel.SetYLength(.01) - baseModel.SetZLength(1.5) - - baseMapper = vtkPolyDataMapper() --- - camCBS = vtkCubeSource() - camCBS.SetXLength(1.5) - camCBS.SetZLength(0.8) - camCBS.SetCenter(0.4, 0, 0) - - camAPD = vtkAppendFilter() --- - camCBS = vtkCubeSource() - camCBS.SetXLength(1.5) - camCBS.SetZLength(0.8) - camCBS.SetCenter(0.4, 0, 0) - - camAPD = vtkAppendPolyData() --- - cube_source = vtkCubeSource() - cube_source.Update() - - face_colors = vtkUnsignedCharArray() - face_colors.SetNumberOfComponents(3) - face_x_plus = colors.GetColor3ub('Red') --- - cs = vtkCubeSource() - cs.SetXLength(0.5) - cs.SetYLength(1) - cs.SetZLength(2) - ss = vtkSphereSource() - ss.SetRadius(0.25) --- - cube = vtkCubeSource() - cube.SetCenter(0.0, 0.0, 0.0) - cube.Update() - sources.append(cube) - # Create a cylinder - cylinder = vtkCylinderSource() --- - cube = vtkCubeSource() - cube.SetCenter(0.0, 0.0, 0.0) - cube.Update() - sources.append(cube) - # Create a cylinder - cylinder = vtkCylinderSource() --- - cube_source = vtkCubeSource() - cube_source.SetCenter(point_coords) - self.glyph_filter.SetSourceConnection(cube_source.GetOutputPort()) - elif self.glyph_filter.GetPointId() == 2: - sphere_source = vtkSphereSource() - sphere_source.SetCenter(point_coords) --- - box_source = vtkCubeSource() - box_source.SetXLength(2.0) - - box_normals = vtkPolyDataNormals() - box_normals.SetInputConnection(box_source.GetOutputPort()) - box_normals.ComputePointNormalsOff() --- - cube = vtkCubeSource() - cube.SetXLength(200) - cube.SetYLength(200) - cube.SetZLength(200) - cube.Update() - cm = vtkPolyDataMapper() diff --git a/data/examples/pp/vtkCubicLine b/data/examples/pp/vtkCubicLine deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkCurvatures b/data/examples/pp/vtkCurvatures deleted file mode 100644 index 56d5d15..0000000 --- a/data/examples/pp/vtkCurvatures +++ /dev/null @@ -1,34 +0,0 @@ - gc = vtkCurvatures() - gc.SetInputData(source) - gc.SetCurvatureTypeToGaussian() - gc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(gc.GetOutput(), 'Gauss_Curvature') --- - mc = vtkCurvatures() - mc.SetInputData(source) - mc.SetCurvatureTypeToMean() - mc.Update() - if desired_surface in ['Bour', 'Enneper', 'Hills', 'RandomHills', 'Torus']: - adjust_edge_curvatures(mc.GetOutput(), 'Mean_Curvature') --- - cc = vtkCurvatures() - if i < 2: - cc.SetInputConnection(cleaner.GetOutputPort()) - else: - cc.SetInputConnection(rh_fn_src.GetOutputPort()) - if i % 2 == 0: --- - cc = vtkCurvatures() - cc.SetInputData(source) - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() - else: --- - cc = vtkCurvatures() - cc.SetInputData(source) - needs_adjusting = ['Hills', 'ParametricTorus', 'Plane', 'RandomHills', 'Torus'] - if gaussian_curvature: - cc.SetCurvatureTypeToGaussian() - cc.Update() diff --git a/data/examples/pp/vtkCutter b/data/examples/pp/vtkCutter deleted file mode 100644 index 9c609d9..0000000 --- a/data/examples/pp/vtkCutter +++ /dev/null @@ -1,62 +0,0 @@ - cutter = vtkCutter() - cutter.SetInputConnection(modelSource.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateValues(10, -0.5, 0.5) - - modelMapper = vtkPolyDataMapper() --- - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputConnection(cube.GetOutputPort()) - cutter.Update() - - FeatureEdges = vtkFeatureEdges() --- - circleCutter = vtkCutter() - circleCutter.SetInputConnection(sphereSource.GetOutputPort()) - cutPlane = vtkPlane() - cutPlane.SetOrigin(sphereSource.GetCenter()) - cutPlane.SetNormal(0, 0, 1) - circleCutter.SetCutFunction(cutPlane) --- - cutter = vtkCutter() - cutter.SetInputConnection(sphere.GetOutputPort()) - cutter.SetCutFunction(plane) - stripper2 = vtkStripper() - stripper2.SetInputConnection(cutter.GetOutputPort()) - dataToStencil2 = vtkPolyDataToImageStencil() --- - planeCut = vtkCutter() - planeCut.SetInputData(pl3d.GetOutput().GetBlock(0)) - planeCut.SetCutFunction(plane) - - cutMapper = vtkDataSetMapper() - cutMapper.SetInputConnection(planeCut.GetOutputPort()) --- - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputConnection(cube.GetOutputPort()) - cutter.Update() - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) --- - cutter = vtkCutter() - cutter.SetInputConnection(reader.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateValues(numberOfCuts, 0.99, 0.99 * high) - - cutterMapper = vtkPolyDataMapper() --- - cutter = vtkCutter() - cutter.SetCutFunction(plane) - cutter.SetInputData(aBeamActor.GetMapper().GetInput()) - cutter.Update() - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) --- - cutter = vtkCutter() - cutter.SetInputConnection(extract.GetOutputPort()) - cutter.SetCutFunction(plane) - cutter.GenerateCutScalarsOff() - cutter.SetSortByToSortByCell() - diff --git a/data/examples/pp/vtkCylinder b/data/examples/pp/vtkCylinder deleted file mode 100644 index ae95bfa..0000000 --- a/data/examples/pp/vtkCylinder +++ /dev/null @@ -1,13 +0,0 @@ - cylinder = vtkCylinder() - cylinder.SetTransform(transformCylinder) - cylinder.SetRadius(.3) - - boolean = vtkImplicitBoolean() - boolean.AddFunction(cylinder) --- - implicit_cylinder = vtkCylinder() - implicit_cylinder.SetRadius(radius / 2.0) - sampled_cylinder = vtkSampleFunction() - sampled_cylinder.SetSampleDimensions(sample_resolution, sample_resolution, sample_resolution) - sampled_cylinder.SetModelBounds(x_min, x_max, x_min, x_max, x_min, x_max) - sampled_cylinder.SetImplicitFunction(implicit_cylinder) diff --git a/data/examples/pp/vtkCylinderSource b/data/examples/pp/vtkCylinderSource deleted file mode 100644 index e3aa700..0000000 --- a/data/examples/pp/vtkCylinderSource +++ /dev/null @@ -1,74 +0,0 @@ - cylinder = vtkCylinderSource() - cylinder.SetResolution(8) - - # The mapper is responsible for pushing the geometry into the graphics - # library. It may also do color mapping, if scalars or other - # attributes are defined. --- - cylinderSource = vtkCylinderSource() - cylinderSource.SetCenter(0.0, 0.0, 0.0) - cylinderSource.SetRadius(5.0) - cylinderSource.SetHeight(7.0) - cylinderSource.SetResolution(100) - --- - cylinderSource = vtkCylinderSource() - cylinderSource.SetResolution(15) - - # Generate a random start and end point - startPoint = [0] * 3 - endPoint = [0] * 3 --- - cylinder = vtkCylinderSource() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cylinder.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) --- - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.SetResolution(6) - cylinder.Update() - bounds = cylinder.GetOutput().GetBounds() - sources.append(cylinder) --- - cylinderSource = vtkCylinderSource() - cylinderSource.SetCenter(0.0, 0.0, 0.0) - cylinderSource.Update() - sources.append(cylinderSource) - - mapper = vtkPolyDataMapper() --- - pegGeometry = vtkCylinderSource() - pegGeometry.SetResolution(8) - pegMapper = vtkPolyDataMapper() - pegMapper.SetInputConnection(pegGeometry.GetOutputPort()) - - puckGeometry = vtkCylinderSource() - puckGeometry.SetResolution(gv.puckResolution) - puckMapper = vtkPolyDataMapper() - puckMapper.SetInputConnection(puckGeometry.GetOutputPort()) - - tableGeometry = vtkPlaneSource() --- - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.Update() - sources.append(cylinder) - - return sources --- - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.Update() - sources.append(cylinder) - - return sources --- - cylinder = vtkCylinderSource() - cylinder.SetCenter(0.0, 0.0, 0.0) - cylinder.SetRadius(3.0) - cylinder.SetHeight(5.0) - cylinder.SetResolution(100) - diff --git a/data/examples/pp/vtkDICOMImageReader b/data/examples/pp/vtkDICOMImageReader deleted file mode 100644 index 6d32cb0..0000000 --- a/data/examples/pp/vtkDICOMImageReader +++ /dev/null @@ -1,20 +0,0 @@ - reader = vtkDICOMImageReader() - reader.SetFileName(input_filename) - reader.Update() - - # Visualize - image_viewer = vtkImageViewer2() --- - reader = vtkDICOMImageReader() - folder = get_program_parameters() - # Read DICOM files in the specified directory - reader.SetDirectoryName(folder) - reader.Update() - --- - reader = vtkDICOMImageReader() - reader.SetDirectoryName(dicom_dir) - reader.Update() - volume.DeepCopy(reader.GetOutput()) - - if use_flying_edges: diff --git a/data/examples/pp/vtkDataObject b/data/examples/pp/vtkDataObject deleted file mode 100644 index 7d8bf1a..0000000 --- a/data/examples/pp/vtkDataObject +++ /dev/null @@ -1,6 +0,0 @@ - dobj = vtkDataObject() - dobj.GetFieldData().AddArray(bitter) - dobj.GetFieldData().AddArray(crispy) - dobj.GetFieldData().AddArray(crunchy) - dobj.GetFieldData().AddArray(salty) - dobj.GetFieldData().AddArray(oily) diff --git a/data/examples/pp/vtkDataObjectReader b/data/examples/pp/vtkDataObjectReader deleted file mode 100644 index 871f479..0000000 --- a/data/examples/pp/vtkDataObjectReader +++ /dev/null @@ -1,6 +0,0 @@ - reader = vtkDataObjectReader() - reader.SetFileName(ifn) - - size = 3187 # maximum number possible - - xAxis = 'INTEREST_RATE' diff --git a/data/examples/pp/vtkDataObjectToDataSetFilter b/data/examples/pp/vtkDataObjectToDataSetFilter deleted file mode 100644 index 03adfeb..0000000 --- a/data/examples/pp/vtkDataObjectToDataSetFilter +++ /dev/null @@ -1,6 +0,0 @@ - do2ds = vtkDataObjectToDataSetFilter() - do2ds.SetInputConnection(reader.GetOutputPort()) - do2ds.SetDataSetTypeToPolyData() - # format: component#, arrayname, arraycomp, minArrayId, maxArrayId, normalize - do2ds.DefaultNormalizeOn() - do2ds.SetPointComponent(0, xAxis, 0) diff --git a/data/examples/pp/vtkDataSet b/data/examples/pp/vtkDataSet deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkDataSetAttributes b/data/examples/pp/vtkDataSetAttributes deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkDataSetMapper b/data/examples/pp/vtkDataSetMapper deleted file mode 100644 index 805286b..0000000 --- a/data/examples/pp/vtkDataSetMapper +++ /dev/null @@ -1,577 +0,0 @@ - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - - colors = vtkNamedColors() - - actor = vtkActor() --- - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - mapper.SetColorModeToMapScalars() - mapper.SetScalarRange(scalars.GetRange()) - - actor = vtkActor() --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(appendFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetPointSize(5) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(connectivityFilter.GetOutputPort()) - mapper.Update() - - actor = vtkActor() - actor.SetMapper(mapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(warpTo.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(source.GetOutputPort()) - mapper.SetInputConnection(shrink.GetOutputPort()) - mapper.SetScalarRange(0, numCells + 1) - mapper.SetLookupTable(lut) - mapper.SetScalarModeToUseCellData() --- - mapper = vtkDataSetMapper() - mapper.SetInputData(ug) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) --- - mapper = vtkDataSetMapper() - mapper.SetInputData(uGrid) - - actor = vtkActor() - actor.GetProperty().SetColor(colors.GetColor3d("PeachPuff")) - actor.SetMapper(mapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - --- - mapper = vtkDataSetMapper() - mapper.SetInputData(cells[key][0]) - actor = vtkActor() - actor.SetMapper(mapper) - actor.SetProperty(get_actor_property()) - --- - mapper = vtkDataSetMapper() - mapper.SetInputData(ugrid) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor( --- - mapper = vtkDataSetMapper() - mapper.SetInputData(ug) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d("Tomato")) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() --- - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() --- - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() --- - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(tessellate.GetOutputPort()) - mapper.ScalarVisibilityOff() - - # Create an actor for the grid - actor = vtkActor() --- - glyph3DMapper = vtkDataSetMapper() - glyph3DMapper.SetInputConnection(glyph3D.GetOutputPort()) - glyph3DMapper.ScalarVisibilityOff() - - glyph3DActor = vtkActor() - glyph3DActor.SetMapper(glyph3DMapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Tomato')) - --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - - back = vtkProperty() - back.SetColor(colors.GetColor3d('Tomato')) - --- - mapper1 = vtkDataSetMapper() - mapper1.SetInputData(unstructuredGrid1) - - actor1 = vtkActor() - actor1.SetMapper(mapper1) - actor1.GetProperty().SetColor(colors.GetColor3d("Cyan")) --- - mapper2 = vtkDataSetMapper() - mapper2.SetInputData(unstructuredGrid2) - - actor2 = vtkActor() - actor2.SetMapper(mapper2) - actor2.GetProperty().SetColor(colors.GetColor3d("Yellow")) --- - mapper = vtkDataSetMapper() - mapper.SetInputData(polydata) - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) - actor.GetProperty().SetRepresentationToWireframe() --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrink.GetOutputPort()) - mapper.ScalarVisibilityOff() - - actor = vtkActor() - actor.SetMapper(mapper) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(merge.GetOutputPort()) - mapper.SetScalarRange(0, 255) - actor = vtkActor() - actor.SetMapper(mapper) - --- - dataMapper = vtkDataSetMapper() - dataMapper.SetInputConnection(extract.GetOutputPort()) - dataMapper.SetScalarModeToUsePointFieldData() - dataMapper.SetColorModeToMapScalars() - data = elev.GetOutputDataObject(0).GetPointData() - dataMapper.ScalarVisibilityOn() --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - - # Create the Actor - actor = vtkActor() - actor.SetMapper(mapper) --- - geometryMapper = vtkDataSetMapper() - geometryMapper.SetInputConnection(geometryShrink.GetOutputPort()) - geometryMapper.SetScalarModeToUseCellData() - geometryMapper.SetScalarRange(0, 11) - - geometryActor = vtkActor() --- - mapper = vtk.vtkDataSetMapper() - mapper.SetInputData(output) - # mapper.SetScalarRange(scalar_range) - mapper.ScalarVisibilityOff() - - # Create the Actor --- - skin_mapper = vtkDataSetMapper() - skin_mapper.SetInputConnection(skin_clip.GetOutputPort()) - skin_mapper.ScalarVisibilityOff() - - skin = vtkActor() - skin.SetMapper(skin_mapper) --- - lens_mapper = vtkDataSetMapper() - lens_mapper.SetInputConnection(lens_clip.GetOutputPort()) - lens_mapper.SetScalarRange(lens_clip.GetOutput().GetScalarRange()) - lens_mapper.SetLookupTable(bw_lut) - - lens = vtkActor() --- - clipMapper = vtkDataSetMapper() - clipMapper.SetInputData(polyData) - - clipActor = vtkActor() - clipActor.SetMapper(clipMapper) - clipActor.GetProperty().SetDiffuseColor(clipColor) --- - clipperMapper = vtkDataSetMapper() - clipperMapper.SetInputConnection(clipper.GetOutputPort()) - - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) - clipperActor.GetProperty().SetRepresentationToWireframe() --- - clipperMapper = vtkDataSetMapper() - clipperMapper.SetInputConnection(clipper.GetOutputPort()) - clipperMapper.ScalarVisibilityOff() - - clipperOutsideMapper = vtkDataSetMapper() - clipperOutsideMapper.SetInputConnection(clipper.GetOutputPort(1)) - clipperOutsideMapper.ScalarVisibilityOff() - - clipperActor = vtkActor() - clipperActor.SetMapper(clipperMapper) --- - iso_mapper = vtkDataSetMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) - iso_mapper.ScalarVisibilityOff() - - iso_actor = vtkActor() - iso_actor.SetMapper(iso_mapper) --- - poly_mapper = vtkDataSetMapper() - poly_mapper.SetInputConnection(poly.GetOutputPort()) - poly_mapper.ScalarVisibilityOff() - - poly_actor = vtkActor() - poly_actor.SetMapper(poly_mapper) --- - self.selected_mapper = vtkDataSetMapper() - self.selected_actor = vtkActor() - - def left_button_press_event(self, obj, event): - colors = vtkNamedColors() - --- - source_mapper = vtkDataSetMapper() - if best_distance == distance_before_align: - source_mapper.SetInputData(original_source_polydata) - print('Using original alignment') - elif best_distance == distance_after_align: - source_mapper.SetInputData(source_polydata) --- - target_mapper = vtkDataSetMapper() - target_mapper.SetInputData(tpd.GetOutput()) - target_mapper.ScalarVisibilityOff() - - target_actor = vtkActor() - target_actor.SetMapper(target_mapper) --- - outsideMapper = vtkDataSetMapper() - outsideMapper.SetInputData(threshold.GetOutput().GetBlock(outsideId).GetBlock(0)) - outsideMapper.ScalarVisibilityOff() - - outsideActor = vtkActor() - outsideActor.SetMapper(outsideMapper) --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(threshold.GetOutput().GetBlock(insideId).GetBlock(0)) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) --- - borderMapper = vtkDataSetMapper() - borderMapper.SetInputData(threshold.GetOutput().GetBlock(borderId).GetBlock(0)) - borderMapper.ScalarVisibilityOff() - - borderActor = vtkActor() - borderActor.SetMapper(borderMapper) --- - surfaceMapper = vtkDataSetMapper() - surfaceMapper.SetInputData(polyData2) - surfaceMapper.ScalarVisibilityOff() - - # Surface of object containing cell - surfaceActor = vtkActor() --- - input_mapper = vtkDataSetMapper() - input_mapper.SetInputConnection(point_source.GetOutputPort()) - input_actor = vtkActor() - input_actor.SetMapper(input_mapper) - input_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) - input_actor.GetProperty().SetPointSize(5) --- - selected_mapper = vtkDataSetMapper() - selected_mapper.SetInputData(selected) - - selected_actor = vtkActor() - selected_actor.SetMapper(selected_mapper) - selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) --- - not_selected_mapper = vtkDataSetMapper() - not_selected_mapper.SetInputData(not_selected) - - not_selected_actor = vtkActor() - not_selected_actor.SetMapper(not_selected_mapper) - not_selected_actor.GetProperty().SetColor(colors.GetColor3d("MidnightBlue")) --- - inputMapper = vtkDataSetMapper() - inputMapper.SetInputConnection(sphereSource.GetOutputPort()) - inputActor = vtkActor() - inputActor.SetMapper(inputMapper) - inputActor.SetBackfaceProperty(backfaces) - inputActor.GetProperty().SetColor(colors.GetColor3d('MistyRose')) --- - selectedMapper = vtkDataSetMapper() - selectedMapper.SetInputData(selected) - - selectedActor = vtkActor() - selectedActor.SetMapper(selectedMapper) - selectedActor.SetBackfaceProperty(backfaces) --- - notSelectedMapper = vtkDataSetMapper() - notSelectedMapper.SetInputData(notSelected) - - notSelectedActor = vtkActor() - notSelectedActor.SetMapper(notSelectedMapper) - notSelectedActor.SetBackfaceProperty(backfaces) --- -mapper2 = vtk.vtkDataSetMapper() -mapper2.SetInputConnection(elev.GetOutputPort()) -actor2 = vtk.vtkActor() -actor2.SetMapper(mapper2) -actor2.GetProperty().SetRepresentationToWireframe() - --- - mapper = vtkDataSetMapper() - mapper.SetInputData(grid) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(shrinkFilter.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().SetColor(colors.GetColor3d('PeachPuff')) --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - --- - mapper = vtkDataSetMapper() - mapper.SetLookupTable(lut) - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) --- - grid_mapper = vtkDataSetMapper() - grid_mapper.SetInputConnection(geometry_filter.GetOutputPort()) - - grid_actor = vtkActor() - grid_actor.SetMapper(grid_mapper) - grid_actor.GetProperty().EdgeVisibilityOn() --- - aMapper = vtkDataSetMapper() - aMapper.SetInputConnection(tcoords.GetOutputPort()) - - # Create a mapper, sphere and texture map for each case. - for i in range(0, 16): - aBoolean = MakeBooleanTexture(i, 64, 0) --- - outerMapper = vtkDataSetMapper() - outerMapper.SetInputConnection(tcoords.GetOutputPort()) - - tmap = vtkStructuredPointsReader() - tmap.SetFileName(fileName) - --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) --- - clippedMapper = vtkDataSetMapper() - if correct_output: - clippedMapper.SetInputData(clipper1.GetClippedOutput()) - else: - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() --- - insideMapper = vtkDataSetMapper() - insideMapper.SetInputData(clipper.GetOutput()) - insideMapper.ScalarVisibilityOff() - - insideActor = vtkActor() - insideActor.SetMapper(insideMapper) --- - clippedMapper = vtkDataSetMapper() - clippedMapper.SetInputData(clipper.GetClippedOutput()) - clippedMapper.ScalarVisibilityOff() - - clippedActor = vtkActor() - clippedActor.SetMapper(clippedMapper) --- - ugridMapper = vtkDataSetMapper() - ugridMapper.SetInputData(ugrid) - - ugridActor = vtkActor() - ugridActor.SetMapper(ugridMapper) - ugridActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) --- - cutMapper = vtkDataSetMapper() - cutMapper.SetInputConnection(planeCut.GetOutputPort()) - cutMapper.SetScalarRange(sg.GetPointData().GetScalars().GetRange()) - - cutActor = vtkActor() - cutActor.SetMapper(cutMapper) --- - aBeamMapper = vtkDataSetMapper() - aBeamMapper.SetInputConnection(surface.GetOutputPort()) - aBeamActor = vtkActor() - aBeamActor.SetMapper(aBeamMapper) - aBeamActor.AddPosition(0, 0, 0) - aBeamActor.GetProperty().SetColor( --- - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(color.GetOutputPort()) - plateMapper.SetLookupTable(lut) - plateMapper.SetScalarRange(-1, 1) - - plateActor = vtkActor() --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(warp.GetOutputPort()) - tmp = bessel.GetScalarRange() - mapper.SetScalarRange(tmp[0], tmp[1]) - - carpet = vtkActor() --- - dataMapper = vtkDataSetMapper() - dataMapper.SetInputConnection(shrink.GetOutputPort()) - dataActor = vtkActor() - dataActor.SetMapper(dataMapper) - - # outline --- - isoMapper = vtkDataSetMapper() - isoMapper.SetInputConnection(connect.GetOutputPort()) - isoMapper.ScalarVisibilityOff() - isoActor = vtkActor() - isoActor.SetMapper(isoMapper) - isoActor.GetProperty().SetColor(colors.GetColor3d('raw_sienna')) --- - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(warp.GetOutputPort()) - plateActor = vtkActor() - plateActor.SetMapper(plateMapper) - plateActor.GetProperty().SetColor( - colors.GetColor3d('PlateColor')) --- - arrowMapper = vtkDataSetMapper() - arrowMapper.SetInputConnection(arrowTF.GetOutputPort()) - arrowMapper.ScalarVisibilityOff() - - # Draw the azimuth arrows. - a1Actor = vtkLODActor() --- - arrowMapper2 = vtkDataSetMapper() - arrowMapper2.SetInputConnection(arrowTF3.GetOutputPort()) - arrowMapper2.ScalarVisibilityOff() - - # Draw the roll arrows. - a6Actor = vtkLODActor() --- - arrowMapper = vtkDataSetMapper() - arrowMapper.SetInputConnection(arrowTF.GetOutputPort()) - arrowMapper.ScalarVisibilityOff() - - # Draw the azimuth arrows. - a1Actor = vtkLODActor() --- - arrowMapper2 = vtkDataSetMapper() - arrowMapper2.SetInputConnection(arrowTF3.GetOutputPort()) - arrowMapper2.ScalarVisibilityOff() - - # Draw the roll arrows. - a6Actor = vtkLODActor() --- - hawaiiMapper = vtkDataSetMapper() - hawaiiMapper.SetInputConnection(elevation.GetOutputPort()) - hawaiiMapper.SetScalarRange(0, 1000) - hawaiiMapper.ScalarVisibilityOn() - hawaiiMapper.SetLookupTable(lut) - --- - mapper = vtkDataSetMapper() - mapper.SetInputConnection(colorIt.GetOutputPort()) - - actor = vtkActor() - actor.SetMapper(mapper) - --- - arrowGlyphMapper = vtkDataSetMapper() - # Colour by scalars. - arrowGlyphMapper.SetScalarRange(scalarRange) - arrowGlyphMapper.SetColorModeToMapScalars() - arrowGlyphMapper.ScalarVisibilityOn() - arrowGlyphMapper.SetLookupTable(lut) --- - planesMapper = vtkDataSetMapper() - planesMapper.SetInputConnection(append.GetOutputPort()) - planesMapper.SetScalarRange(0, 7) - - actor.SetMapper(planesMapper) - actor.GetProperty().SetAmbient(1.) --- - planesMapper = vtkDataSetMapper() - planesMapper.SetInputConnection(append.GetOutputPort()) - planesMapper.SetScalarRange(0, 7) - - actor.SetMapper(planesMapper) - actor.GetProperty().SetAmbient(1.) --- - icon_mapper = vtkDataSetMapper() - icon_mapper.SetInputConnection(reader.GetOutputPort()) - - icon_actor = vtkActor() - icon_actor.SetMapper(icon_mapper) - icon_actor.GetProperty().SetColor(colors.GetColor3d('Silver')) --- - mapper = vtkDataSetMapper() - mapper.SetInputData(output) - mapper.SetScalarRange(scalar_range) - mapper.SetLookupTable(lut) - - actor = vtkActor() diff --git a/data/examples/pp/vtkDataSetReader b/data/examples/pp/vtkDataSetReader deleted file mode 100644 index 6dadbf4..0000000 --- a/data/examples/pp/vtkDataSetReader +++ /dev/null @@ -1,13 +0,0 @@ - reader = vtkDataSetReader() - reader.SetFileName(fileName) - - # Create the scene. - # We generate a whole bunch of planes which correspond to - # the geometry in the analysis; tables, bookshelves and so on. --- - reader = vtkDataSetReader() - reader.SetFileName(fileName) - reader.Update() - - # Now we will generate a single streamline in the data. We select the - # integration order to use (RungeKutta order 4) and associate it with diff --git a/data/examples/pp/vtkDataSetSurfaceFilter b/data/examples/pp/vtkDataSetSurfaceFilter deleted file mode 100644 index 4a6d427..0000000 --- a/data/examples/pp/vtkDataSetSurfaceFilter +++ /dev/null @@ -1,6 +0,0 @@ - surface = vtkDataSetSurfaceFilter() - surface.SetInputData(uGrid) - surface.Update() - - aBeamMapper = vtkDataSetMapper() - aBeamMapper.SetInputConnection(surface.GetOutputPort()) diff --git a/data/examples/pp/vtkDataSetTriangleFilter b/data/examples/pp/vtkDataSetTriangleFilter deleted file mode 100644 index 17e4ac9..0000000 --- a/data/examples/pp/vtkDataSetTriangleFilter +++ /dev/null @@ -1,6 +0,0 @@ -tri = vtk.vtkDataSetTriangleFilter() -tri.SetInputData(grid) -tri.SetTetrahedraOnly(1) -tri.Update() -output = tri.GetOutput() - diff --git a/data/examples/pp/vtkDecimate b/data/examples/pp/vtkDecimate deleted file mode 100644 index 2a52791..0000000 --- a/data/examples/pp/vtkDecimate +++ /dev/null @@ -1,6 +0,0 @@ - deci = vtkDecimatePro() - deci.SetInputConnection(reader.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.SetAbsoluteError(0.0005) - deci.MaximumIterations = 6 - deci.SetFeatureAngle(30) diff --git a/data/examples/pp/vtkDecimatePro b/data/examples/pp/vtkDecimatePro deleted file mode 100644 index 3a1fb1e..0000000 --- a/data/examples/pp/vtkDecimatePro +++ /dev/null @@ -1,41 +0,0 @@ - decimate = vtkDecimatePro() - decimate.SetInputData(inputPolyData) - decimate.SetTargetReduction(reduction) - decimate.PreserveTopologyOn() - decimate.Update() - --- - deci = vtkDecimatePro() - deci.SetInputConnection(cyber.GetOutputPort()) - deci.SetTargetReduction(0.7) - deci.PreserveTopologyOn() - - normals = vtkPolyDataNormals() --- - deci = vtkDecimatePro() - deci.SetInputConnection(fran.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() --- - deci = vtkDecimatePro() - deci.SetInputConnection(hawaii.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.PreserveTopologyOn() - - decimatedNormals = vtkPolyDataNormals() --- - deci = vtkDecimatePro() - deci.SetInputConnection(reader.GetOutputPort()) - deci.SetTargetReduction(0.9) - deci.SetAbsoluteError(0.0005) - deci.MaximumIterations = 6 - deci.SetFeatureAngle(30) --- - decimator = vtkDecimatePro() - decimator.SetInputConnection(last_connection.GetOutputPort()) - decimator.SetFeatureAngle(tissue['decimate_angle']) - decimator.PreserveTopologyOn() - decimator.SetErrorIsAbsolute(1) - decimator.SetAbsoluteError(tissue['decimate_error']) diff --git a/data/examples/pp/vtkDeformPointSet b/data/examples/pp/vtkDeformPointSet deleted file mode 100644 index 96b7b09..0000000 --- a/data/examples/pp/vtkDeformPointSet +++ /dev/null @@ -1,6 +0,0 @@ - deform = vtkDeformPointSet() - deform.SetInputData(ele.GetOutput()) - deform.SetControlMeshData(pd) - deform.Update() - - controlPoint = pts.GetPoint(5) diff --git a/data/examples/pp/vtkDelaunay2D b/data/examples/pp/vtkDelaunay2D deleted file mode 100644 index 10920f8..0000000 --- a/data/examples/pp/vtkDelaunay2D +++ /dev/null @@ -1,55 +0,0 @@ - delaunay = vtkDelaunay2D() - delaunay.SetInputData(aPolyData) - delaunay.SetSourceData(boundary) - - # Visualize - meshMapper = vtkPolyDataMapper() --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(polydata) - - # Visualize - mesh_mapper = vtkPolyDataMapper() - mesh_mapper.SetInputConnection(delaunay.GetOutputPort()) --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(polydata) - delaunay.Update() - - # Create a mapper and actor - triangulatedMapper = vtkPolyDataMapper() --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(inputPolyData) - delaunay.Update() - outputPolyData = delaunay.GetOutput() - - bounds = 6 * [0.0] --- - delny = vtkDelaunay2D() - delny.SetInputData(profile) - delny.SetTolerance(0.001) - mapMesh = vtkPolyDataMapper() - mapMesh.SetInputConnection(delny.GetOutputPort()) - meshActor = vtkActor() --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - --- - delaunay = vtkDelaunay2D() - delaunay.SetInputData(plane) - delaunay.Update() - - polydata = delaunay.GetOutput() - diff --git a/data/examples/pp/vtkDelaunay3D b/data/examples/pp/vtkDelaunay3D deleted file mode 100644 index 7d862b8..0000000 --- a/data/examples/pp/vtkDelaunay3D +++ /dev/null @@ -1,20 +0,0 @@ - delaunay1 = vtkDelaunay3D() - delaunay1.SetInputConnection(sphereSource1.GetOutputPort()) - delaunay1.Update() - - sphereSource2 = vtkSphereSource() - sphereSource2.SetCenter(5, 0, 0) --- - delaunay2 = vtkDelaunay3D() - delaunay2.SetInputConnection(sphereSource2.GetOutputPort()) - delaunay2.Update() - - appendFilter = vtkAppendFilter() - appendFilter.AddInputConnection(delaunay1.GetOutputPort()) --- -tri = vtk.vtkDelaunay3D() -tri.SetInputConnection(cube.GetOutputPort()) -tri.BoundingTriangulationOff() - -# vtkImplicitDataSet needs some scalars to interpolate to find inside/outside -elev = vtk.vtkElevationFilter() diff --git a/data/examples/pp/vtkDelimitedTextReader b/data/examples/pp/vtkDelimitedTextReader deleted file mode 100644 index 2b6f312..0000000 --- a/data/examples/pp/vtkDelimitedTextReader +++ /dev/null @@ -1,13 +0,0 @@ - points_reader = vtkDelimitedTextReader() - points_reader.SetFileName(tmp_path) - points_reader.DetectNumericColumnsOn() - points_reader.SetFieldDelimiterCharacters(',') - points_reader.SetHaveHeaders(True) - --- - points_reader = vtkDelimitedTextReader() - points_reader.SetFileName(points_fn) - points_reader.DetectNumericColumnsOn() - points_reader.SetFieldDelimiterCharacters('\t') - points_reader.SetHaveHeaders(True) - diff --git a/data/examples/pp/vtkDiscreteFlyingEdges3D b/data/examples/pp/vtkDiscreteFlyingEdges3D deleted file mode 100644 index adf56e0..0000000 --- a/data/examples/pp/vtkDiscreteFlyingEdges3D +++ /dev/null @@ -1,20 +0,0 @@ - contour = vtkDiscreteFlyingEdges3D() - except AttributeError: - contour = vtkDiscreteMarchingCubes() - else: - contour = vtkDiscreteMarchingCubes() - contour.SetInputConnection(voi.GetOutputPort()) --- - discrete_cubes = vtkDiscreteFlyingEdges3D() - except AttributeError: - using_marching_cubes = True - discrete_cubes = vtkDiscreteMarchingCubes() - else: - using_marching_cubes = True --- - discrete = vtkDiscreteFlyingEdges3D() - except AttributeError: - discrete = vtkDiscreteMarchingCubes() - else: - discrete = vtkDiscreteMarchingCubes() - discrete.SetInputData(blob) diff --git a/data/examples/pp/vtkDiscreteMarchingCubes b/data/examples/pp/vtkDiscreteMarchingCubes deleted file mode 100644 index 4d7bb56..0000000 --- a/data/examples/pp/vtkDiscreteMarchingCubes +++ /dev/null @@ -1,34 +0,0 @@ - contour = vtkDiscreteMarchingCubes() - else: - contour = vtkDiscreteMarchingCubes() - contour.SetInputConnection(voi.GetOutputPort()) - # contour.ComputeNormalsOn() - - print('Doing label', index) - --- - discrete_cubes = vtkDiscreteMarchingCubes() - else: - using_marching_cubes = True - discrete_cubes = vtkDiscreteMarchingCubes() - smoother = vtkWindowedSincPolyDataFilter() - selector = vtkThreshold() - scalars_off = vtkMaskFields() - geometry = vtkGeometryFilter() - writer = vtkXMLPolyDataWriter() --- - discrete = vtkDiscreteMarchingCubes() - else: - discrete = vtkDiscreteMarchingCubes() - discrete.SetInputData(blob) - discrete.GenerateValues(n, 1, n) - - lut = make_colors(n) - --- - discrete = vtkDiscreteMarchingCubes() - discrete.SetInputData(blob) - discrete.GenerateValues(n, 1, n) - - smoothing_iterations = 15 - pass_band = 0.001 diff --git a/data/examples/pp/vtkDiscretizableColorTransferFunction b/data/examples/pp/vtkDiscretizableColorTransferFunction deleted file mode 100644 index e8c99f1..0000000 --- a/data/examples/pp/vtkDiscretizableColorTransferFunction +++ /dev/null @@ -1,69 +0,0 @@ - ctf = vtkDiscretizableColorTransferFunction() - ctf.SetColorSpaceToLab() - ctf.SetScaleToLinear() - - ctf.AddRGBPoint(-30.3399130649763, 0.0862745098039216, 0.00392156862745098, 0.298039215686275) - ctf.AddRGBPoint(-29.3502559661865, 0.113725, 0.0235294, 0.45098) --- - ctf = vtkDiscretizableColorTransferFunction() - - ctf.SetColorSpaceToRGB() - ctf.SetScaleToLinear() - - ctf.SetNanColor(0.0, 0.0, 0.0) --- - ctf = vtkDiscretizableColorTransferFunction() - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': --- - s = ['', f'def get_ctf():', comment, f'{indent}ctf = vtkDiscretizableColorTransferFunction()', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': --- - s = ['', f'vtkNew GetCTF()', '{', comment, - f'{indent}vtkNew ctf;', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() --- - ctf = vtkDiscretizableColorTransferFunction() - - ctf.SetColorSpaceToRGB() - ctf.SetScaleToLinear() - ctf.SetNanColor(0.5, 0.5, 0.5) - ctf.SetBelowRangeColor(0.0, 0.0, 0.0) --- - new_ctf = vtkDiscretizableColorTransferFunction() - new_ctf.SetScale(old_ctf.GetScale()) - new_ctf.SetColorSpace(old_ctf.GetColorSpace()) - new_ctf.SetNanColor(old_ctf.GetNanColor()) - if not reverse: - new_ctf.SetBelowRangeColor(old_ctf.GetBelowRangeColor()) --- - ctf = vtkDiscretizableColorTransferFunction() - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': --- - s = ['', f'def get_ctf():', comment, f'{indent}ctf = vtkDiscretizableColorTransferFunction()', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() - if interp_space == 'hsv': --- - s = ['', f'vtkNew GetCTF()', '{', comment, - f'{indent}vtkNew ctf;', ''] - - interp_space = parameters['color_map_details'].get('interpolationspace', None) - if interp_space: - interp_space = interp_space.lower() diff --git a/data/examples/pp/vtkDiskSource b/data/examples/pp/vtkDiskSource deleted file mode 100644 index aa2e5fb..0000000 --- a/data/examples/pp/vtkDiskSource +++ /dev/null @@ -1,13 +0,0 @@ - diskSource = vtkDiskSource() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(diskSource.GetOutputPort()) - --- - diskSource = vtkDiskSource() - diskSource.Update() - - featureEdges = vtkFeatureEdges() - featureEdges.SetInputConnection(diskSource.GetOutputPort()) - featureEdges.BoundaryEdgesOn() diff --git a/data/examples/pp/vtkDoubleArray b/data/examples/pp/vtkDoubleArray deleted file mode 100644 index dc2d1c3..0000000 --- a/data/examples/pp/vtkDoubleArray +++ /dev/null @@ -1,145 +0,0 @@ - latitude = vtk.vtkDoubleArray() - latitude.SetName('latitude') - longitude = vtk.vtkDoubleArray() - longitude.SetName('longitude') - for i in range(-90, 90, 10): - for j in range(-180, 180, 20): - g.AddVertex() - latitude.InsertNextValue(i) --- - weights = vtkDoubleArray() - weights.SetNumberOfComponents(1) - weights.SetName('Weights') - - # Set the edge weights - weights.InsertNextValue(1.0) --- - weights = vtkDoubleArray() - weights.SetNumberOfComponents(1) - weights.SetName('Weights') - - # Set the edge weights - weights.InsertNextValue(1.0) --- - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], --- - warpData = vtkDoubleArray() - warpData.SetNumberOfComponents(3) - warpData.SetName("warpData") - warp = [0.0, 0.0, 0.0] - warp[1] = 0.0 - warpData.InsertNextTuple(warp) --- - xArray = vtkDoubleArray() - xArray.InsertNextValue(0.0) - xArray.InsertNextValue(2.0) - - yArray = vtkDoubleArray() - yArray.InsertNextValue(0.0) - yArray.InsertNextValue(1.0) - yArray.InsertNextValue(2.0) - - zArray = vtkDoubleArray() - zArray.InsertNextValue(0.0) - - grid.SetXCoordinates(xArray) - grid.SetYCoordinates(yArray) - grid.SetZCoordinates(zArray) --- - xCoords = vtkDoubleArray() - for i in range(0, len(x)): - xCoords.InsertNextValue(x[i]) - yCoords = vtkDoubleArray() - for i in range(0, len(y)): - yCoords.InsertNextValue(y[i]) - zCoords = vtkDoubleArray() - for i in range(0, len(z)): - zCoords.InsertNextValue(z[i]) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, --- - xArray = vtkDoubleArray() - xArray.InsertNextValue(0.0) - xArray.InsertNextValue(2.0) - - yArray = vtkDoubleArray() - yArray.InsertNextValue(0.0) - yArray.InsertNextValue(1.0) - yArray.InsertNextValue(2.0) - - zArray = vtkDoubleArray() - zArray.InsertNextValue(0.0) - zArray.InsertNextValue(5.0) - - grid.SetXCoordinates(xArray) - grid.SetYCoordinates(yArray) --- - tcoords = vtkDoubleArray() - image = vtkImageData() - texture = vtkTexture() - - # Create texture - dimension = 16 * lineStippleRepeat --- - vectors = vtkDoubleArray() - vectors.SetNumberOfComponents(3) - vectors.SetNumberOfTuples(dims[0] * dims[1] * dims[2]) - points = vtkPoints() - points.Allocate(dims[0] * dims[1] * dims[2]) - --- - scalars = vtkDoubleArray() - scalars.SetNumberOfComponents(1) - scalars.SetNumberOfTuples(26 * 26 * 26) - for k in range(0, 26): - z = -0.5 + k * sp - kOffset = k * 26 * 26 --- - normals = vtkDoubleArray() - normals.SetNumberOfComponents(3) - normals.SetNumberOfTuples(2) - normals.SetTuple(0, nrms[:3]) - normals.SetTuple(1, nrms[3:]) - --- - scalars = vtkDoubleArray() - numberOfPoints = reader.GetOutput().GetNumberOfPoints() - scalars.SetNumberOfTuples(numberOfPoints) - pts = reader.GetOutput().GetPoints() - for i in range(0, numberOfPoints): - point = pts.GetPoint(i) --- - derivs = vtkDoubleArray() - derivs.SetNumberOfTuples(numPts) - - bessel = vtkPolyData() - bessel.CopyStructure(inputPd) - bessel.SetPoints(newPts) --- - norms = vtkDoubleArray() - scalars = vtkDoubleArray() - - x = [0.0] * 3 - pts.InsertNextPoint(x) - norms.SetNumberOfTuples(1) - norms.SetNumberOfComponents(3) --- - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], --- - elevation = vtkDoubleArray() - elevation.SetNumberOfTuples(points.GetNumberOfPoints()) - - # We define the parameters for the hills here. - # [[0: x0, 1: y0, 2: x variance, 3: y variance, 4: amplitude]...] - hd = [[-2.5, -2.5, 2.5, 6.5, 3.5], [2.5, 2.5, 2.5, 2.5, 2], diff --git a/data/examples/pp/vtkEarthSource b/data/examples/pp/vtkEarthSource deleted file mode 100644 index 236b02d..0000000 --- a/data/examples/pp/vtkEarthSource +++ /dev/null @@ -1,6 +0,0 @@ - earthSource = vtkEarthSource() - earthSource.OutlineOn() - earthSource.Update() - r = earthSource.GetRadius() - - # Create a sphere diff --git a/data/examples/pp/vtkElevationFilter b/data/examples/pp/vtkElevationFilter deleted file mode 100644 index 5d120a7..0000000 --- a/data/examples/pp/vtkElevationFilter +++ /dev/null @@ -1,153 +0,0 @@ - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) - elev.SetHighPoint(3, 3, 3) - elev.SetInputConnection(brown.GetOutputPort()) - - # Updating here because I will need to probe scalar ranges before --- - elev = vtkElevationFilter() - elev.SetLowPoint(-3, -3, -3) - elev.SetHighPoint(3, 3, 3) - elev.SetInputConnection(brown.GetOutputPort()) - - # Set up the parallel coordinates Representation to be used in the View --- - ele = vtkElevationFilter() - ele.SetInputConnection(sphere.GetOutputPort()) - ele.SetLowPoint(0, 0, -0.5); - ele.SetHighPoint(0, 0, 0.5); - ele.SetLowPoint((bounds[1] + bounds[0]) / 2.0, - (bounds[3] + bounds[2]) / 2.0, --- -elev = vtk.vtkElevationFilter() -elev.SetInputConnection(tri.GetOutputPort()) - -implicit = vtk.vtkImplicitDataSet() -implicit.SetDataSet(elev.GetOutput()) - --- - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(sphere.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -1) - colorIt.SetHighPoint(0, 0, 1) - - mapper = vtkDataSetMapper() --- - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(transFilter.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -1) - colorIt.SetHighPoint(0, 0, 1) - - lut = vtkLookupTable() --- - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - --- - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - --- - elevation_filter = vtkElevationFilter() - elevation_filter.SetScalarRange(0, 1) - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - elevation_filter.SetInputConnection(sources[i].GetOutputPort()) - elevation_filters.append(elevation_filter) --- - elevation_filter = vtkElevationFilter() - elevation_filter.SetLowPoint(0, bounds[2], 0) - elevation_filter.SetHighPoint(0, bounds[3], 0) - # elevation_filter.SetInputConnection(sphere.GetOutputPort()) - elevation_filter.SetInputConnection(cone.GetOutputPort()) - --- - elev = vtkElevationFilter() - # Elevation values will range from 0 to 1 between the Low and High Points - elev.SetLowPoint(-2, 0, 0) - elev.SetHighPoint(2, 0, 0) - elev.SetInputConnection(grad.GetOutputPort()) - --- - elevation = vtkElevationFilter() - elevation.SetInputConnection(transF.GetOutputPort()) - elevation.SetLowPoint(0, bounds[2], 0) - elevation.SetHighPoint(0, bounds[3], 0) - - bandedContours = vtkBandedPolyDataContourFilter() --- - elev_filter = vtkElevationFilter() - elev_filter.SetInputData(src) - elev_filter.SetLowPoint(0, bounds[2], 0) - elev_filter.SetHighPoint(0, bounds[3], 0) - elev_filter.SetScalarRange(bounds[2], bounds[3]) - elev_filter.Update() --- - elev_filter = vtkElevationFilter() - elev_filter.SetInputData(src) - elev_filter.SetLowPoint(0, bounds[2], 0) - elev_filter.SetHighPoint(0, bounds[3], 0) - elev_filter.SetScalarRange(bounds[2], bounds[3]) - elev_filter.Update() --- - elev = vtkElevationFilter() - # Elevation values will range from 0 to 1 between the Low and High Points - elev.SetLowPoint(-2, -2, 0) - elev.SetHighPoint(2, 2, 0) - elev.SetInputConnection(grad.GetOutputPort()) - --- - elevation = vtkElevationFilter() - elevation.SetInputConnection(hawaii.GetOutputPort()) - elevation.SetLowPoint(0, 0, 0) - elevation.SetHighPoint(0, 0, 1000) - elevation.SetScalarRange(0, 1000) - --- - colorIt = vtkElevationFilter() - colorIt.SetInputConnection(shrink.GetOutputPort()) - colorIt.SetLowPoint(0, 0, -.5) - colorIt.SetHighPoint(0, 0, .5) - - mapper = vtkDataSetMapper() --- - elevation = vtkElevationFilter() - elevation.SetInputConnection(coneSource.GetOutputPort()) - elevation.SetLowPoint(0, bounds[2], 0) - elevation.SetHighPoint(0, bounds[3], 0) - - bcf = vtkBandedPolyDataContourFilter() --- - elev = vtkElevationFilter() - elev.SetInputConnection(sphere.GetOutputPort()) - elev.SetLowPoint(0, sphereBounds[2], 0) - elev.SetHighPoint(0, sphereBounds[3], 0) - elev.Update() - return elev --- - elev = vtkElevationFilter() - elev.SetInputConnection(cleaner.GetOutputPort()) - elev.SetLowPoint(0, cleanerBounds[2], 0) - elev.SetHighPoint(0, cleanerBounds[3], 0) - elev.Update() - return elev --- - elev = vtkElevationFilter() - elev.SetInputConnection(coneNormals.GetOutputPort()) - elev.SetLowPoint(coneBounds[0], 0, 0) - elev.SetHighPoint(coneBounds[1], 0, 0) - - # vtkButterflySubdivisionFilter and vtkLinearSubdivisionFilter operate on triangles. --- - colors = vtkElevationFilter() - colors.SetInputConnection(plane.GetOutputPort()) - colors.SetLowPoint(-0.25, -0.25, -0.25) - colors.SetHighPoint(0.25, 0.25, 0.25) - planeMapper = vtkPolyDataMapper() - planeMapper.SetInputData(colors.GetPolyDataOutput()) diff --git a/data/examples/pp/vtkExodusIIReader b/data/examples/pp/vtkExodusIIReader deleted file mode 100644 index 474387a..0000000 --- a/data/examples/pp/vtkExodusIIReader +++ /dev/null @@ -1,6 +0,0 @@ - reader = vtkExodusIIReader() - reader.SetFileName(filename) - reader.UpdateInformation() - reader.SetTimeStep(10) - reader.SetAllArrayStatus(vtkExodusIIReader.NODAL, 1) # enables all NODAL variables - reader.Update() diff --git a/data/examples/pp/vtkExplicitStructuredGrid b/data/examples/pp/vtkExplicitStructuredGrid deleted file mode 100644 index c947f49..0000000 --- a/data/examples/pp/vtkExplicitStructuredGrid +++ /dev/null @@ -1,13 +0,0 @@ - grid = vtkExplicitStructuredGrid() - grid.SetDimensions(ni, nj, nk) - grid.SetPoints(points) - grid.SetCells(cells) - return grid - --- - converter = vtkExplicitStructuredGridToUnstructuredGrid() - converter.SetInputData(grid) - converter.Update() - return converter.GetOutput() - - diff --git a/data/examples/pp/vtkExplicitStructuredGridToUnstructuredGrid b/data/examples/pp/vtkExplicitStructuredGridToUnstructuredGrid deleted file mode 100644 index 6584244..0000000 --- a/data/examples/pp/vtkExplicitStructuredGridToUnstructuredGrid +++ /dev/null @@ -1,6 +0,0 @@ - converter = vtkExplicitStructuredGridToUnstructuredGrid() - converter.SetInputData(grid) - converter.Update() - return converter.GetOutput() - - diff --git a/data/examples/pp/vtkExtractEdges b/data/examples/pp/vtkExtractEdges deleted file mode 100644 index 1091fcb..0000000 --- a/data/examples/pp/vtkExtractEdges +++ /dev/null @@ -1,34 +0,0 @@ - edges = vtkExtractEdges() - edges.SetInputData(root) - - # PART 3 Show the data - # also demonstrate a composite aware filter - # this filter aggregates all blocks into one polydata --- - extractEdges = vtkExtractEdges() - extractEdges.SetInputConnection(reader.GetOutputPort()) - - legendValues = vtkVariantArray() - it = reader.GetOutput().NewCellIterator() - it.InitTraversal() --- - extract = vtkExtractEdges() - extract.SetInputConnection(delny.GetOutputPort()) - tubes = vtkTubeFilter() - tubes.SetInputConnection(extract.GetOutputPort()) - tubes.SetRadius(0.01) - tubes.SetNumberOfSides(6) --- - triangleEdges = vtkExtractEdges() - triangleEdges.SetInputConnection(Marching.GetOutputPort()) - - # Draw the edges as tubes instead of lines. Also create the associated - # mapper and actor to display the tubes. - triangleEdgeTubes = vtkTubeFilter() --- - Edges = vtkExtractEdges() - Edges.SetInputConnection(CubeModel.GetOutputPort()) - - Tubes = vtkTubeFilter() - Tubes.SetInputConnection(Edges.GetOutputPort()) - Tubes.SetRadius(.01) diff --git a/data/examples/pp/vtkExtractGeometry b/data/examples/pp/vtkExtractGeometry deleted file mode 100644 index 66072fc..0000000 --- a/data/examples/pp/vtkExtractGeometry +++ /dev/null @@ -1,6 +0,0 @@ - extract = vtkExtractGeometry() - extract.SetInputConnection(sample.GetOutputPort()) - extract.SetImplicitFunction(booleanUnion) - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(extract.GetOutputPort()) diff --git a/data/examples/pp/vtkExtractGrid b/data/examples/pp/vtkExtractGrid deleted file mode 100644 index 81d07d3..0000000 --- a/data/examples/pp/vtkExtractGrid +++ /dev/null @@ -1,6 +0,0 @@ - extract = vtkExtractGrid() - extract.SetVOI(1, 55, -1000, 1000, -1000, 1000) - extract.SetInputData(pl3dOutput) - - # The (implicit) plane is used to do the cutting - plane = vtkPlane() diff --git a/data/examples/pp/vtkExtractSelection b/data/examples/pp/vtkExtractSelection deleted file mode 100644 index b7a5554..0000000 --- a/data/examples/pp/vtkExtractSelection +++ /dev/null @@ -1,27 +0,0 @@ - extract = vtkExtractSelection() - extract.SetInputConnection(0, elev.GetOutputPort()) - extract.SetInputConnection(1, annotationLink.GetOutputPort(2)) - - def update_render_windows(obj, event): - ''' --- - extract_selection = vtkExtractSelection() - extract_selection.SetInputData(0, self.data) - extract_selection.SetInputData(1, selection) - extract_selection.Update() - - # In selection --- - extract_selection = vtkExtractSelection() - extract_selection.SetInputConnection(0, point_source.GetOutputPort()) - extract_selection.SetInputData(1, selection) - extract_selection.Update() - - # In selection. --- - extractSelection = vtkExtractSelection() - extractSelection.SetInputConnection(0, sphereSource.GetOutputPort()) - extractSelection.SetInputData(1, selection) - extractSelection.Update() - - # In selection diff --git a/data/examples/pp/vtkExtractVOI b/data/examples/pp/vtkExtractVOI deleted file mode 100644 index a3af4d0..0000000 --- a/data/examples/pp/vtkExtractVOI +++ /dev/null @@ -1,34 +0,0 @@ - voi = vtkExtractVOI() - voi.SetInputConnection(reader_volume.GetOutputPort()) - voi.SetVOI(0, 517, 0, 228, 0, 392) - voi.SetSampleRate(1, 1, 1) - voi.Update() # Necessary for GetScalarRange(). - srange = voi.GetOutput().GetScalarRange() # Needs Update() before! --- - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) - extractVOI.SetVOI(0, 255, 0, 255, 45, 45) - # scalarRange = extractVOI.GetOutput().GetScalarRange() - scalarRange = [500, 1150] - # print(scalarRange) --- - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) - extractVOI.SetVOI(0, 255, 0, 255, 45, 45) - - iso = vtkContourFilter() - iso.SetInputConnection(extractVOI.GetOutputPort()) --- - extract = vtkExtractVOI() - extract.SetInputConnection(func.GetOutputPort()) - extract.SetVOI(0, dims[0] - 1, - 0, dims[1] - 1, - sliceNum + sliceIncr, sliceNum + sliceIncr) - append.AddInputConnection(extract.GetOutputPort()) --- - extract = vtkExtractVOI() - extract.SetInputConnection(func.GetOutputPort()) - extract.SetVOI(0, dims[0] - 1, - 0, dims[1] - 1, - sliceNum + sliceIncr, sliceNum + sliceIncr) - ranges = [1.0, 6.0] diff --git a/data/examples/pp/vtkFeatureEdges b/data/examples/pp/vtkFeatureEdges deleted file mode 100644 index 8378473..0000000 --- a/data/examples/pp/vtkFeatureEdges +++ /dev/null @@ -1,55 +0,0 @@ - featureEdges = vtkFeatureEdges() - featureEdges.SetInputConnection(diskSource.GetOutputPort()) - featureEdges.BoundaryEdgesOn() - featureEdges.FeatureEdgesOff() - featureEdges.ManifoldEdgesOff() - featureEdges.NonManifoldEdgesOff() --- - boundaryEdges = vtkFeatureEdges() - boundaryEdges.SetInputData(polyData) - boundaryEdges.BoundaryEdgesOn() - boundaryEdges.FeatureEdgesOff() - boundaryEdges.NonManifoldEdgesOff() - boundaryEdges.ManifoldEdgesOff() --- - featureEdges = vtkFeatureEdges() - featureEdges.FeatureEdgesOff() - featureEdges.BoundaryEdgesOn() - featureEdges.NonManifoldEdgesOn() - featureEdges.SetInputData(polyData) - featureEdges.Update() --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() --- - FeatureEdges = vtkFeatureEdges() - FeatureEdges.SetInputConnection(cutter.GetOutputPort()) - FeatureEdges.BoundaryEdgesOn() - FeatureEdges.FeatureEdgesOff() - FeatureEdges.NonManifoldEdgesOff() - FeatureEdges.ManifoldEdgesOff() --- - edges = vtkFeatureEdges() - edges.SetInputConnection(id_filter.GetOutputPort()) - edges.BoundaryEdgesOn() - edges.ManifoldEdgesOff() - edges.NonManifoldEdgesOff() - edges.FeatureEdgesOff() diff --git a/data/examples/pp/vtkFieldDataToAttributeDataFilter b/data/examples/pp/vtkFieldDataToAttributeDataFilter deleted file mode 100644 index cb4f600..0000000 --- a/data/examples/pp/vtkFieldDataToAttributeDataFilter +++ /dev/null @@ -1,6 +0,0 @@ - fd2ad = vtkFieldDataToAttributeDataFilter() - fd2ad.SetInputConnection(do2ds.GetOutputPort()) - fd2ad.SetInputFieldToDataObjectField() - fd2ad.SetOutputAttributeDataToPointData() - fd2ad.DefaultNormalizeOn() - fd2ad.SetScalarComponent(0, scalar, 0) diff --git a/data/examples/pp/vtkFiltersCore b/data/examples/pp/vtkFiltersCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersExtraction b/data/examples/pp/vtkFiltersExtraction deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersFlowPaths b/data/examples/pp/vtkFiltersFlowPaths deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersGeneral b/data/examples/pp/vtkFiltersGeneral deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersGeometry b/data/examples/pp/vtkFiltersGeometry deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersHybrid b/data/examples/pp/vtkFiltersHybrid deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersHyperTree b/data/examples/pp/vtkFiltersHyperTree deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersModeling b/data/examples/pp/vtkFiltersModeling deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersPoints b/data/examples/pp/vtkFiltersPoints deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersProgrammable b/data/examples/pp/vtkFiltersProgrammable deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersSources b/data/examples/pp/vtkFiltersSources deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFiltersTexture b/data/examples/pp/vtkFiltersTexture deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkFixedPointVolumeRayCastMapper b/data/examples/pp/vtkFixedPointVolumeRayCastMapper deleted file mode 100644 index be8e1a0..0000000 --- a/data/examples/pp/vtkFixedPointVolumeRayCastMapper +++ /dev/null @@ -1,20 +0,0 @@ - volume_mapper = vtkFixedPointVolumeRayCastMapper() - volume_mapper.SetInputConnection(reader.GetOutputPort()) - - # The color transfer function maps voxel intensities to colors. - # It is modality-specific, and often anatomy-specific as well. - # The goal is to one color for flesh (between 500 and 1000) --- - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(dataImporter.GetOutputPort()) - - # The class vtkVolume is used to pair the previously declared volume as well as the properties - # to be used when rendering that volume. - volume = vtkVolume() --- - volumeMapper = vtkFixedPointVolumeRayCastMapper() - volumeMapper.SetInputConnection(reader.GetOutputPort()) - - # The volume holds the mapper and the property and - # can be used to position/orient the volume. - volume = vtkVolume() diff --git a/data/examples/pp/vtkFloatArray b/data/examples/pp/vtkFloatArray deleted file mode 100644 index f4ec762..0000000 --- a/data/examples/pp/vtkFloatArray +++ /dev/null @@ -1,226 +0,0 @@ - scalars = vtkFloatArray() - ug1.GetPointData().SetScalars(scalars) - MakeScalars(dims, origin, spacing, scalars) - - lo = [0, 0, 0] - hi = [9, 9, 9] --- - scalars2 = vtkFloatArray() - ug2.GetPointData().SetScalars(scalars2) - MakeScalars(dims, origin, spacing2, scalars2) - - lo2 = [0, 0, 0] - hi2 = [9, 9, 9] --- - scalars3 = vtkFloatArray() - ug3.GetPointData().SetScalars(scalars3) - MakeScalars(dims, origin3, spacing2, scalars3) - - lo3 = [10, 10, 10] - hi3 = [19, 19, 19] --- - scalars = vtkFloatArray() - - # Load the point, cell, and data attributes. - for i, xi in enumerate(x): - points.InsertPoint(i, xi) - for pt in pts: --- - scales = vtkFloatArray() - scales.SetNumberOfComponents(1) - scales.SetName('Scales') - scales.InsertNextValue(2.0) - scales.InsertNextValue(5.0) - --- - xCoords = vtkFloatArray() - for x, i in enumerate(np.linspace(-1.0, 1.0, 15)): - xCoords.InsertNextValue(i) - - yCoords = vtkFloatArray() - for y, i in enumerate(np.linspace(-1.0, 1.0, 15)): - yCoords.InsertNextValue(i) - - zCoords = vtkFloatArray() - for z, i in enumerate(np.linspace(-1.0, 1.0, 15)): - zCoords.InsertNextValue(i) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, --- - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(rgrid.GetNumberOfPoints()): --- - xCoords = vtkFloatArray() - for x, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - xCoords.InsertNextValue(i) - - yCoords = vtkFloatArray() - for y, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - yCoords.InsertNextValue(i) - - zCoords = vtkFloatArray() - for z, i in enumerate(np.linspace(-1.0, 1.0, dimension)): - zCoords.InsertNextValue(i) - - # # create a grid - if not using numpy - # dimension = 51 - # xCoords = vtkFloatArray() - # for i in range(0, dimension): - # xCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - # - # yCoords = vtkFloatArray() - # for i in range(0, dimension): - # yCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - # - # zCoords = vtkFloatArray() - # for i in range(0, dimension): - # zCoords.InsertNextValue(-1.0 + i * 2.0 / (dimension - 1)) - - # The coordinates are assigned to the rectilinear grid. Make sure that - # the number of values in each of the XCoordinates, YCoordinates, --- - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(0, rgrid.GetNumberOfPoints()): --- - newScalars = vtkFloatArray() - xyz = list(zip(res[keys[1]], res[keys[2]], res[keys[3]])) - for i in range(0, res[keys[0]][0]): - # print(xyz[i]) - newPts.InsertPoint(i, xyz[i]) - newScalars.InsertValue(i, res[keys[4]][i]) --- - array_x = vtkFloatArray() - array_x.SetName('X Axis') - table.AddColumn(array_x) - - array_cos = vtkFloatArray() - array_cos.SetName('Cosine') - table.AddColumn(array_cos) - - array_sin = vtkFloatArray() - array_sin.SetName('Sine') - table.AddColumn(array_sin) - - # Fill in the table with some example values. - num_points = 40 --- - arrX = vtkFloatArray() - arrX.SetName('X Axis') - - arrC = vtkFloatArray() - arrC.SetName('Cosine') - - arrS = vtkFloatArray() - arrS.SetName('Sine') - - arrT = vtkFloatArray() - arrT.SetName('Sine-Cosine') - - table.AddColumn(arrC) - table.AddColumn(arrS) - table.AddColumn(arrX) --- - bitter = vtkFloatArray() - bitter.SetNumberOfTuples(numTuples) - - crispy = vtkFloatArray() - crispy.SetNumberOfTuples(numTuples) - - crunchy = vtkFloatArray() - crunchy.SetNumberOfTuples(numTuples) - - salty = vtkFloatArray() - salty.SetNumberOfTuples(numTuples) - - oily = vtkFloatArray() - oily.SetNumberOfTuples(numTuples) - - rand_seq = vtkMinimalStandardRandomSequence() - rand_seq.SetSeed(8775070) - --- - arr = vtkFloatArray() - table.AddColumn(arr) - - table.SetNumberOfRows(numPoints) - for i in range(numPoints): - x = i * inc --- - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): --- - signedDistances = vtkFloatArray() - signedDistances.SetNumberOfComponents(1) - signedDistances.SetName('SignedDistances') - - # Evaluate the signed distance function at all of the grid points - for pointId in range(points.GetNumberOfPoints()): --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - t_coords = vtkFloatArray() - t_coords.SetNumberOfComponents(2) - t_coords.SetNumberOfTuples(num_pts) - t_coords.SetName('Texture Coordinates') - pt_id = 0 - u = u0 --- - Scalars = vtkFloatArray() - Scalars.InsertNextValue(1.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(0.0) - Scalars.InsertNextValue(1.0) - Scalars.InsertNextValue(0.0) --- - norms = vtkFloatArray() - - norms.SetNumberOfComponents(3) - points.InsertPoint(0, 0.0, 0.0, 0.0) - norms.InsertTuple3(0, 0.0, 0.0, 1.0) - points.InsertPoint(1, 0.0, 0.0, 0.0) --- - cellData = vtkFloatArray() - for i in range(0, xResolution * yResolution): - cellData.InsertNextValue(i) - aPlane.Update() # Force an update so we can set cell data. - aPlane.GetOutput().GetCellData().SetScalars(cellData) - --- - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): --- - textures = vtkFloatArray() - textures.SetNumberOfComponents(2) - textures.SetNumberOfTuples(2 * polydata.GetNumberOfPoints()) - textures.SetName("Textures") - - for i in range(0, x_res): diff --git a/data/examples/pp/vtkFlyingEdges2D b/data/examples/pp/vtkFlyingEdges2D deleted file mode 100644 index dcbe319..0000000 --- a/data/examples/pp/vtkFlyingEdges2D +++ /dev/null @@ -1,20 +0,0 @@ - flyingEdges = vtkFlyingEdges2D() - isoMapper = vtkPolyDataMapper() - if useContouring: - contour.SetInputConnection(extractVOI.GetOutputPort()) - contour.GenerateValues(12, scalarRange) - isoMapper.SetInputConnection(contour.GetOutputPort()) --- - description = 'Either vtkFlyingEdges2D or vtkContourFilter is used to generate contour lines.' - epilogue = ''' - Generate 2D contour lines, corresponding to tissue density, on one CT slice through the head. - The contour lines are colored by the tissue density. - ''' - parser = argparse.ArgumentParser(description=description, epilog=epilogue, --- - help='Use vtkContourFilter instead of vtkFlyingEdges2D.') - args = parser.parse_args() - return args.filename, args.useContouring - - -if __name__ == '__main__': diff --git a/data/examples/pp/vtkFlyingEdges3D b/data/examples/pp/vtkFlyingEdges3D deleted file mode 100644 index 97deb1e..0000000 --- a/data/examples/pp/vtkFlyingEdges3D +++ /dev/null @@ -1,90 +0,0 @@ - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) --- - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) --- - bone_extractor = vtkFlyingEdges3D() - except AttributeError: - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) --- - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) --- - bone_extractor = vtkFlyingEdges3D() - except AttributeError: - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) --- - skin_extractor = vtkFlyingEdges3D() - except AttributeError: - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) --- - mc = vtkFlyingEdges3D() - except AttributeError: - mc = vtkMarchingCubes() - else: - mc = vtkMarchingCubes() - --- - surface = vtkFlyingEdges3D() - except AttributeError: - surface = vtkMarchingCubes() - else: - surface = vtkMarchingCubes() - surface.SetInputData(volume) --- - iso = vtkFlyingEdges3D() - except AttributeError: - using_marching_cubes = True - iso = vtkMarchingCubes() - else: - using_marching_cubes = True --- - iso_surface = vtkFlyingEdges3D() - except AttributeError: - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(gaussian.GetOutputPort()) --- - iso_surface = vtkFlyingEdges3D() - except AttributeError: - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(select_tissue.GetOutputPort()) --- - iso_surface = vtkFlyingEdges3D() - iso_surface.SetInputConnection(last_connection.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) --- - iso_sphere = vtkFlyingEdges3D() - except AttributeError: - iso_sphere = vtkMarchingCubes() - else: - iso_sphere = vtkMarchingCubes() - iso_sphere.SetValue(0, 1.0) diff --git a/data/examples/pp/vtkFollower b/data/examples/pp/vtkFollower deleted file mode 100644 index ed5d537..0000000 --- a/data/examples/pp/vtkFollower +++ /dev/null @@ -1,34 +0,0 @@ - textActor = vtkFollower() - textActor.SetMapper(textMapper) - textActor.SetScale(0.2, 0.2, 0.2) - textActor.AddPosition(0, -0.1, 0) - textActor.GetProperty().SetColor(colors.GetColor3d('Peacock')) - --- - XActor = vtkFollower() - XActor.SetMapper(XTextMapper) - XActor.SetScale(0.02, .02, .02) - XActor.SetPosition(0.35, -0.05, -0.05) - XActor.GetProperty().SetColor(0, 0, 0) - --- - YActor = vtkFollower() - YActor.SetMapper(YTextMapper) - YActor.SetScale(0.02, .02, .02) - YActor.SetPosition(-0.05, 0.35, -0.05) - YActor.GetProperty().SetColor(0, 0, 0) - --- - ZActor = vtkFollower() - ZActor.SetMapper(ZTextMapper) - ZActor.SetScale(0.02, .02, .02) - ZActor.SetPosition(-0.05, -0.05, 0.35) - ZActor.GetProperty().SetColor(0, 0, 0) - --- - LabelActor = vtkFollower() - LabelActor.SetMapper(LabelMapper) - LabelActor.SetPosition(x, y, z) - LabelActor.SetScale(2, 2, 2) - LabelActor.SetOrigin(TextSrc.GetOutput().GetCenter()) - diff --git a/data/examples/pp/vtkForceDirectedLayoutStrategy b/data/examples/pp/vtkForceDirectedLayoutStrategy deleted file mode 100644 index 8a1ab92..0000000 --- a/data/examples/pp/vtkForceDirectedLayoutStrategy +++ /dev/null @@ -1,27 +0,0 @@ - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) --- - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) --- - force_directed = vtkForceDirectedLayoutStrategy() - - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(random_graph_source.GetOutput()) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) --- - force_directed = vtkForceDirectedLayoutStrategy() - - layout_view = vtkGraphLayoutView() - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - layout_view.SetLayoutStrategyToForceDirected() diff --git a/data/examples/pp/vtkFrustumSource b/data/examples/pp/vtkFrustumSource deleted file mode 100644 index 8b99247..0000000 --- a/data/examples/pp/vtkFrustumSource +++ /dev/null @@ -1,6 +0,0 @@ - frustumSource = vtkFrustumSource() - frustumSource.ShowLinesOff() - frustumSource.SetPlanes(planes) - - shrink = vtkShrinkPolyData() - shrink.SetInputConnection(frustumSource.GetOutputPort()) diff --git a/data/examples/pp/vtkGaussianKernel b/data/examples/pp/vtkGaussianKernel deleted file mode 100644 index d53bc80..0000000 --- a/data/examples/pp/vtkGaussianKernel +++ /dev/null @@ -1,6 +0,0 @@ - gaussian_kernel = vtkGaussianKernel() - gaussian_kernel.SetSharpness(2) - gaussian_kernel.SetRadius(12) - - interpolator = vtkPointInterpolator() - interpolator.SetInputData(box) diff --git a/data/examples/pp/vtkGaussianSplatter b/data/examples/pp/vtkGaussianSplatter deleted file mode 100644 index e146fc6..0000000 --- a/data/examples/pp/vtkGaussianSplatter +++ /dev/null @@ -1,48 +0,0 @@ - splatter = vtkGaussianSplatter() - splatter.SetInputData(polydata) - splatter.SetSampleDimensions(50, 50, 50) - splatter.SetRadius(0.5) - splatter.ScalarWarpingOff() - --- - popSplatter = vtkGaussianSplatter() - popSplatter.SetInputConnection(fd2ad.GetOutputPort()) - popSplatter.SetSampleDimensions(150, 150, 150) - popSplatter.SetRadius(0.05) - popSplatter.ScalarWarpingOff() - --- - lateSplatter = vtkGaussianSplatter() - lateSplatter.SetInputConnection(fd2ad.GetOutputPort()) - lateSplatter.SetSampleDimensions(150, 150, 150) - lateSplatter.SetRadius(0.05) - lateSplatter.SetScaleFactor(0.05) - --- - popSplatter = vtkGaussianSplatter() - popSplatter.SetInputData(dataSet) - popSplatter.SetSampleDimensions(100, 100, 100) - popSplatter.SetRadius(0.05) - popSplatter.ScalarWarpingOff() - --- - lateSplatter = vtkGaussianSplatter() - lateSplatter.SetInputData(dataSet) - lateSplatter.SetSampleDimensions(50, 50, 50) - lateSplatter.SetRadius(0.05) - lateSplatter.SetScaleFactor(0.005) - --- - splat = vtkGaussianSplatter() - splat.SetInputData(pData) - splat.SetModelBounds(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0) - splat.SetSampleDimensions(75, 75, 75) - splat.SetRadius(0.5) - splat.SetEccentricity(5.0) --- - splatter = vtkGaussianSplatter() - splatter.SetInputConnection(mask.GetOutputPort()) - splatter.SetSampleDimensions(100, 100, 100) - splatter.SetEccentricity(2.5) - splatter.NormalWarpingOn() - splatter.SetScaleFactor(1.0) diff --git a/data/examples/pp/vtkGenericCell b/data/examples/pp/vtkGenericCell deleted file mode 100644 index 0b0a67f..0000000 --- a/data/examples/pp/vtkGenericCell +++ /dev/null @@ -1,34 +0,0 @@ - cell = vtkGenericCell() - it = tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets --- - cell = vtkGenericCell() - it = self.tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets --- - cell = vtkGenericCell() - it = tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets --- - cell = vtkGenericCell() - it = self.tessellate.GetOutput().NewCellIterator() - it.InitTraversal() - while not it.IsDoneWithTraversal(): - it.GetCell(cell) - cellMap[cell.GetRepresentativeCell().GetClassName()] = numTets --- - cell = vtkGenericCell() - it.GetCell(cell) - cellName = vtkCellTypes.GetClassNameFromTypeId(cell.GetCellType()) - print(cellName, 'NumberOfPoints:', cell.GetNumberOfPoints(), 'CellDimension:', cell.GetCellDimension()) - legendValues.InsertNextValue(cellName) - it.GoToNextCell() diff --git a/data/examples/pp/vtkGeoAssignCoordinates b/data/examples/pp/vtkGeoAssignCoordinates deleted file mode 100644 index a62d6f3..0000000 --- a/data/examples/pp/vtkGeoAssignCoordinates +++ /dev/null @@ -1,6 +0,0 @@ - assign = vtk.vtkGeoAssignCoordinates() - assign.SetInputData(g) - - assign.SetLatitudeArrayName('latitude') - assign.SetLongitudeArrayName('longitude') - assign.SetGlobeRadius(1.0) diff --git a/data/examples/pp/vtkGeoGraticule b/data/examples/pp/vtkGeoGraticule deleted file mode 100644 index 7720ffd..0000000 --- a/data/examples/pp/vtkGeoGraticule +++ /dev/null @@ -1,6 +0,0 @@ - geoGraticle = vtk.vtkGeoGraticule() - transformProjection = vtk.vtkGeoTransform() - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() - transformGraticle = vtk.vtkTransformFilter() - diff --git a/data/examples/pp/vtkGeoProjection b/data/examples/pp/vtkGeoProjection deleted file mode 100644 index 66f775b..0000000 --- a/data/examples/pp/vtkGeoProjection +++ /dev/null @@ -1,7 +0,0 @@ - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() - transformGraticle = vtk.vtkTransformFilter() - - reader = vtk.vtkXMLPolyDataReader() - transformReader = vtk.vtkTransformFilter() - graticleMapper = vtk.vtkPolyDataMapper() diff --git a/data/examples/pp/vtkGeoTransform b/data/examples/pp/vtkGeoTransform deleted file mode 100644 index 449dfcf..0000000 --- a/data/examples/pp/vtkGeoTransform +++ /dev/null @@ -1,6 +0,0 @@ - transformProjection = vtk.vtkGeoTransform() - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() - transformGraticle = vtk.vtkTransformFilter() - - reader = vtk.vtkXMLPolyDataReader() diff --git a/data/examples/pp/vtkGeometryFilter b/data/examples/pp/vtkGeometryFilter deleted file mode 100644 index b83a91d..0000000 --- a/data/examples/pp/vtkGeometryFilter +++ /dev/null @@ -1,13 +0,0 @@ - geometry = vtkGeometryFilter() - geometry.SetInputConnection(transform_model.GetOutputPort()) - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(geometry.GetOutputPort()) - mapper.SetScalarRange(start_label, end_label) --- - geometry = vtkGeometryFilter() - writer = vtkXMLPolyDataWriter() - - # Define all of the variables - file_prefix = 'Label' - smoothing_iterations = 15 diff --git a/data/examples/pp/vtkGeovisCore b/data/examples/pp/vtkGeovisCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkGlyph2D b/data/examples/pp/vtkGlyph2D deleted file mode 100644 index 97512f9..0000000 --- a/data/examples/pp/vtkGlyph2D +++ /dev/null @@ -1,6 +0,0 @@ - glyph2D = vtkGlyph2D() - glyph2D.SetSourceConnection(polygonSource.GetOutputPort()) - glyph2D.SetInputData(polydata) - glyph2D.Update() - - mapper = vtkPolyDataMapper() diff --git a/data/examples/pp/vtkGlyph3D b/data/examples/pp/vtkGlyph3D deleted file mode 100644 index ca42d38..0000000 --- a/data/examples/pp/vtkGlyph3D +++ /dev/null @@ -1,132 +0,0 @@ - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(cubeSource.GetOutputPort()) - glyph3D.SetInputData(polydata) - glyph3D.Update() - - # Visualize --- - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - --- - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - --- - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - --- - glyph3D = vtkGlyph3D() - glyph3D.SetInputData(uGrid) - glyph3D.SetSourceConnection(sphereSource.GetOutputPort()) - glyph3D.ScalingOff() - glyph3D.Update() - --- - arrowGlyph = vtkGlyph3D() - arrowGlyph.SetInputConnection(0, graphToPoly.GetOutputPort(1)) - arrowGlyph.SetInputConnection(1, arrowSource.GetOutputPort()) - - # Add the edge arrow actor to the view. - arrowMapper = vtkPolyDataMapper() --- - balls = vtkGlyph3D() - balls.SetInputConnection(delny.GetOutputPort()) - balls.SetSourceConnection(ball.GetOutputPort()) - mapBalls = vtkPolyDataMapper() - mapBalls.SetInputConnection(balls.GetOutputPort()) - ballActor = vtkActor() --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.25) --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(sphere.GetOutputPort()) - glyph.SetSourceConnection(cone.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.25) --- - lines = vtkGlyph3D() - lines.SetInputConnection(threshold.GetOutputPort()) - lines.SetSourceConnection(line.GetOutputPort()) - lines.SetScaleFactor(0.005) - lines.SetScaleModeToScaleByScalar() - lines.Update() --- - cones = vtkGlyph3D() - cones.SetInputConnection(mask.GetOutputPort()) - cones.SetSourceConnection(cone.GetOutputPort()) - cones.SetScaleFactor(0.4) - cones.SetScaleModeToScaleByVector() - --- - Vertices = vtkGlyph3D() - Vertices.SetInputConnection(ThresholdIn.GetOutputPort()) - Vertices.SetSourceConnection(Sphere.GetOutputPort()) - # Create a mapper and actor to display the glyphs. - SphereMapper = vtkPolyDataMapper() - SphereMapper.SetInputConnection(Vertices.GetOutputPort()) --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(ptMask.GetOutputPort()) - glyph.SetSourceConnection(transformF.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleModeToScaleByVector() - glyph.SetScaleFactor(0.004) --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(elev.GetOutputPort()) - glyph.SetSourceConnection(sph.GetOutputPort()) - glyph.ScalingOn() - glyph.SetScaleModeToScaleByScalar() - glyph.SetVectorModeToUseVector() --- - glyph = vtkGlyph3D() - glyph.SetSourceConnection(arrow.GetOutputPort()) - glyph.SetInputConnection(mask_pts.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleFactor(scale_factor) - glyph.SetColorModeToColorByVector() --- - glyph = vtkGlyph3D() - glyph.SetSourceConnection(arrow.GetOutputPort()) - glyph.SetInputConnection(mask_pts.GetOutputPort()) - glyph.SetVectorModeToUseNormal() - glyph.SetScaleFactor(scale_factor) - glyph.SetColorModeToColorByVector() --- - glyph = vtkGlyph3D() - glyph.SetInputConnection(elev.GetOutputPort()) - - # Here is where we build the glyph table - # that will be indexed into according to the IndexMode - glyph.SetSourceConnection(0, cs.GetOutputPort()) --- - glyph3D = vtkGlyph3D() - glyph3D.SetSourceConnection(arrowSource.GetOutputPort()) - glyph3D.SetVectorModeToUseNormal() - glyph3D.SetInputData(input_data) - glyph3D.SetScaleFactor(.2) - glyph3D.Update() --- - arrowGlyph = vtkGlyph3D() - arrowGlyph.SetScaleFactor(scaleFactor) - arrowGlyph.SetVectorModeToUseNormal() - arrowGlyph.SetColorModeToColorByScalar() - arrowGlyph.SetScaleModeToScaleByVector() - arrowGlyph.OrientOn() diff --git a/data/examples/pp/vtkGlyph3DMapper b/data/examples/pp/vtkGlyph3DMapper deleted file mode 100644 index b76b4c8..0000000 --- a/data/examples/pp/vtkGlyph3DMapper +++ /dev/null @@ -1,41 +0,0 @@ - mapper = vtkGlyph3DMapper() - mapper.SetInputData(pd) - mapper.SetSourceConnection(sphere_source.GetOutputPort()) - mapper.ScalarVisibilityOff() - mapper.ScalingOff() - --- - pointMapper = vtkGlyph3DMapper() - pointMapper.SetInputData(polyData) - pointMapper.SetSourceConnection(sphere.GetOutputPort()) - - pointActor = vtkActor() - pointActor.SetMapper(pointMapper) --- - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) - point_mapper.SetSourceConnection(sphere.GetOutputPort()) - point_mapper.ScalingOn() - point_mapper.ScalarVisibilityOff() - --- - point_mapper = vtkGlyph3DMapper() - point_mapper.SetInputData(cells[key][0]) - point_mapper.SetSourceConnection(sphere.GetOutputPort()) - point_mapper.ScalingOn() - point_mapper.ScalarVisibilityOff() - --- - mapper = vtkGlyph3DMapper() - mapper.SetInputData(pd) - mapper.SetSourceConnection(sphere_source.GetOutputPort()) - mapper.ScalarVisibilityOff() - mapper.ScalingOff() - --- - pointMapper = vtkGlyph3DMapper() - pointMapper.SetInputConnection(reader.GetOutputPort()) - pointMapper.SetSourceConnection(sphere.GetOutputPort()) - pointMapper.ScalingOff() - pointMapper.ScalarVisibilityOff() - diff --git a/data/examples/pp/vtkGlyphSource2D b/data/examples/pp/vtkGlyphSource2D deleted file mode 100644 index 5ecd188..0000000 --- a/data/examples/pp/vtkGlyphSource2D +++ /dev/null @@ -1,6 +0,0 @@ - arrowSource = vtkGlyphSource2D() - arrowSource.SetGlyphTypeToEdgeArrow() - arrowSource.SetScale(0.1) - arrowSource.Update() - - # Use Glyph3D to repeat the glyph on all edges. diff --git a/data/examples/pp/vtkGraphLayout b/data/examples/pp/vtkGraphLayout deleted file mode 100644 index c40fdd5..0000000 --- a/data/examples/pp/vtkGraphLayout +++ /dev/null @@ -1,8 +0,0 @@ - graphLayoutView = vtkGraphLayoutView() - - layout = vtkGraphLayout() - strategy = vtkSimple2DLayoutStrategy() - layout.SetInputData(g) - layout.SetLayoutStrategy(strategy) - - # Tell the view to use the vertex layout we provide diff --git a/data/examples/pp/vtkGraphLayoutView b/data/examples/pp/vtkGraphLayoutView deleted file mode 100644 index 53985cb..0000000 --- a/data/examples/pp/vtkGraphLayoutView +++ /dev/null @@ -1,111 +0,0 @@ - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetLayoutStrategy('Simple 2D') - graphLayoutView.GetLayoutStrategy().SetEdgeWeightField('Graphs') - graphLayoutView.GetLayoutStrategy().SetWeightEdges(1) - graphLayoutView.SetEdgeColorArrayName('Color') --- - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetVertexLabelVisibility(1) - - rGraph = vtkRenderedGraphRepresentation() - rGraph.SafeDownCast(graphLayoutView.GetRepresentation()).GetVertexLabelTextProperty().SetColor( --- - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(graph) - graphLayoutView.SetLayoutStrategyToPassThrough() - graphLayoutView.SetVertexColorArrayName('Color') - graphLayoutView.ColorVerticesOn() - --- - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.ResetCamera() --- - treeLayoutView = vtkGraphLayoutView() - treeLayoutView.AddRepresentationFromInput(tree) - treeLayoutView.SetLayoutStrategyToTree() - treeLayoutView.ResetCamera() - treeLayoutView.Render() - treeLayoutView.GetInteractor().Start() --- - view = vtkGraphLayoutView() - view.SetRepresentationFromInput(tree) - # Apply a theme to the views - theme = vtkViewTheme() - view.ApplyViewTheme(theme.CreateMellowTheme()) - view.SetVertexColorArrayName('VertexDegree') --- - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(g) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.AddRepresentationFromInput(g) --- - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(g) - - graphLayoutView.SetLayoutStrategy(circularLayoutStrategy) - graphLayoutView.SetVertexLabelVisibility(1) - graphLayoutView.SetEdgeLabelVisibility(1) --- - graph_layout_view = vtkGraphLayoutView() - graph_layout_view.AddRepresentationFromInput(random_graph_source.GetOutput()) - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - graph_layout_view.SetLayoutStrategyToForceDirected() - graph_layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) --- - layout_view = vtkGraphLayoutView() - # If we create a layout object directly, just set the pointer through this method. - # graph_layout_view.SetLayoutStrategy(force_directed) - layout_view.SetLayoutStrategyToForceDirected() - layout_view.AddRepresentationFromInput(g) - layout_view.ApplyViewTheme(theme) --- -view = vtkGraphLayoutView() -view.AddRepresentationFromInputConnection(source.GetOutputPort()) - - -def selectionCallback(caller, event): - # In C++ there is some extra data passed to the callback, but in Python --- - graph_layout_view0 = vtkGraphLayoutView() - graph_layout_view0.SetRenderWindow(ren_win) - graph_layout_view0.SetInteractor(iren) - graph_layout_view0.GetRenderer().SetViewport(left_viewport) - graph_layout_view0.AddRepresentationFromInput(g0) - # If we create a layout object directly, just set the pointer through this method. --- - graph_layout_view1 = vtkGraphLayoutView() - graph_layout_view1.SetRenderWindow(ren_win) - graph_layout_view1.SetInteractor(iren) - graph_layout_view1.GetRenderer().SetViewport(right_viewport) - graph_layout_view1.AddRepresentationFromInput(g0) - # If we create a layout object directly, just set the pointer through this method. --- - graphLayoutView = vtkGraphLayoutView() - - layout = vtkGraphLayout() - strategy = vtkSimple2DLayoutStrategy() - layout.SetInputData(g) - layout.SetLayoutStrategy(strategy) --- - graphLayoutView = vtkGraphLayoutView() - graphLayoutView.AddRepresentationFromInput(g) - graphLayoutView.SetLayoutStrategy('Simple 2D') - graphLayoutView.ResetCamera() - graphLayoutView.Render() - --- - view = vtkGraphLayoutView() - view.AddRepresentationFromInputConnection(source.GetOutputPort()) - view.SetVertexLabelArrayName('vertex id') - view.SetVertexLabelVisibility(True) - view.SetVertexColorArrayName('vertex id') - view.SetColorVertices(True) diff --git a/data/examples/pp/vtkGraphMapper b/data/examples/pp/vtkGraphMapper deleted file mode 100644 index 838fb3a..0000000 --- a/data/examples/pp/vtkGraphMapper +++ /dev/null @@ -1,6 +0,0 @@ - mapper = vtk.vtkGraphMapper() - mapper.SetInputConnection(assign.GetOutputPort()) - actor = vtk.vtkActor() - actor.SetMapper(mapper) - ren = vtk.vtkRenderer() - ren.AddActor(actor) diff --git a/data/examples/pp/vtkGraphToGlyphs b/data/examples/pp/vtkGraphToGlyphs deleted file mode 100644 index f049782..0000000 --- a/data/examples/pp/vtkGraphToGlyphs +++ /dev/null @@ -1,6 +0,0 @@ - gGlyph = vtkGraphToGlyphs() - rGraph.SafeDownCast(layout_view.GetRepresentation()).SetGlyphType(gGlyph.CIRCLE) - layout_view.GetRenderer().SetBackground(colors.GetColor3d('Navy')) - layout_view.GetRenderer().SetBackground2(colors.GetColor3d('MidnightBlue')) - layout_view.GetRenderWindow().SetWindowName('ScaleVertices') - layout_view.Render() diff --git a/data/examples/pp/vtkGraphToPolyData b/data/examples/pp/vtkGraphToPolyData deleted file mode 100644 index a33be3f..0000000 --- a/data/examples/pp/vtkGraphToPolyData +++ /dev/null @@ -1,13 +0,0 @@ - graphToPolyData = vtkGraphToPolyData() - graphToPolyData.SetInputData(g) - graphToPolyData.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - graphToPoly = vtkGraphToPolyData() - graphToPoly.SetInputConnection(layout.GetOutputPort()) - graphToPoly.EdgeGlyphOutputOn() - - # Set the position (0: edge start, 1: edge end) where - # the edge arrows should go. diff --git a/data/examples/pp/vtkHDFReader b/data/examples/pp/vtkHDFReader deleted file mode 100644 index da98658..0000000 --- a/data/examples/pp/vtkHDFReader +++ /dev/null @@ -1,6 +0,0 @@ - reader = vtkHDFReader() - reader.SetFileName(fn) - reader.Update() - print('Number of steps: ', reader.GetNumberOfSteps()) - polydata = reader.GetOutput() - diff --git a/data/examples/pp/vtkHDRReader b/data/examples/pp/vtkHDRReader deleted file mode 100644 index c3ef150..0000000 --- a/data/examples/pp/vtkHDRReader +++ /dev/null @@ -1,76 +0,0 @@ - reader = vtkHDRReader() - - # Check the image can be read - if not reader.CanReadFile(file_name): - print('CanReadFile failed for ', file_name) - return --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None --- - reader = vtkHDRReader() - extensions = reader.GetFileExtensions() - # Check the image can be read. - if not reader.CanReadFile(str(fn_path)): - print('CanReadFile failed for ', fn_path) - return None diff --git a/data/examples/pp/vtkHardwareSelector b/data/examples/pp/vtkHardwareSelector deleted file mode 100644 index 25b0a15..0000000 --- a/data/examples/pp/vtkHardwareSelector +++ /dev/null @@ -1,6 +0,0 @@ - hsel = vtkHardwareSelector() - hsel.SetFieldAssociation(vtkDataObject.FIELD_ASSOCIATION_CELLS) - hsel.SetRenderer(ren1) - - x, y = caller.GetRenderWindow().GetSize() - diff --git a/data/examples/pp/vtkHausdorffDistancePointSetFilter b/data/examples/pp/vtkHausdorffDistancePointSetFilter deleted file mode 100644 index 39179d9..0000000 --- a/data/examples/pp/vtkHausdorffDistancePointSetFilter +++ /dev/null @@ -1,13 +0,0 @@ - distance = vtkHausdorffDistancePointSetFilter() - distance.SetInputData(0, tpd.GetOutput()) - distance.SetInputData(1, source_polydata) - distance.Update() - - distance_before_align = distance.GetOutput(0).GetFieldData().GetArray('HausdorffDistance').GetComponent(0, 0) --- - distance = vtkHausdorffDistancePointSetFilter() - test_transform = vtkTransform() - test_transform_pd = vtkTransformPolyDataFilter() - lm_transform = vtkLandmarkTransform() - lm_transform_pd = vtkTransformPolyDataFilter() - diff --git a/data/examples/pp/vtkHedgeHog b/data/examples/pp/vtkHedgeHog deleted file mode 100644 index afe4f56..0000000 --- a/data/examples/pp/vtkHedgeHog +++ /dev/null @@ -1,13 +0,0 @@ - hedgehog = vtkHedgeHog() - hedgehog.SetInputData(sgrid) - hedgehog.SetScaleFactor(0.1) - - sgridMapper = vtkPolyDataMapper() - sgridMapper.SetInputConnection(hedgehog.GetOutputPort()) --- - hhog = vtkHedgeHog() - hhog.SetInputConnection(reader.GetOutputPort()) - hhog.SetScaleFactor(0.3) - - lut = vtkLookupTable() - # lut.SetHueRange(.667, 0.0) diff --git a/data/examples/pp/vtkHexagonalPrism b/data/examples/pp/vtkHexagonalPrism deleted file mode 100644 index 0229773..0000000 --- a/data/examples/pp/vtkHexagonalPrism +++ /dev/null @@ -1,13 +0,0 @@ - hexagonalPrism = vtkHexagonalPrism() - for i in range(0, numberOfVertices): - hexagonalPrism.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.InsertNextCell(hexagonalPrism.GetCellType(), --- - hexagonal_prism = vtkHexagonalPrism() - - scale = 2.0 - hexagonal_prism.GetPoints().SetPoint(0, 11 / scale, 10 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(1, 13 / scale, 10 / scale, 10 / scale) - hexagonal_prism.GetPoints().SetPoint(2, 14 / scale, 12 / scale, 10 / scale) diff --git a/data/examples/pp/vtkHexahedron b/data/examples/pp/vtkHexahedron deleted file mode 100644 index 70ae281..0000000 --- a/data/examples/pp/vtkHexahedron +++ /dev/null @@ -1,27 +0,0 @@ - hex_ = vtkHexahedron() - for i in range(0, numberOfVertices): - hex_.GetPointIds().SetId(i, i) - - # Add the points and hexahedron to an unstructured grid - uGrid = vtkUnstructuredGrid() --- - hexahedron = vtkHexahedron() - - for i in range(0, len(pointCoordinates)): - points.InsertNextPoint(pointCoordinates[i]) - hexahedron.GetPointIds().SetId(i, i) - --- - hexahedron = vtkHexahedron() - for i in range(0, number_of_vertices): - hexahedron.GetPointIds().SetId(i, i) - - # Add the points and hexahedron to an unstructured grid - ug = vtkUnstructuredGrid() --- - hexa = vtkHexahedron() - for i, pointCoord in enumerate(pointCoords): - points.InsertNextPoint(pointCoord) - hexa.GetPointIds().SetId(i, i) - - # Add the hexahedron to a cell array. diff --git a/data/examples/pp/vtkHull b/data/examples/pp/vtkHull deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkHyperStreamline b/data/examples/pp/vtkHyperStreamline deleted file mode 100644 index c5aaa91..0000000 --- a/data/examples/pp/vtkHyperStreamline +++ /dev/null @@ -1,27 +0,0 @@ - s1 = vtkHyperStreamline() - s1.SetInputData(ptLoad.GetOutput()) - s1.SetStartPosition(9, 9, -9) - s1.IntegrateMinorEigenvector() - s1.SetMaximumPropagationDistance(18.0) - s1.SetIntegrationStepLength(0.1) --- - s2 = vtkHyperStreamline() - s2.SetInputData(ptLoad.GetOutput()) - s2.SetStartPosition(-9, -9, -9) - s2.IntegrateMinorEigenvector() - s2.SetMaximumPropagationDistance(18.0) - s2.SetIntegrationStepLength(0.1) --- - s3 = vtkHyperStreamline() - s3.SetInputData(ptLoad.GetOutput()) - s3.SetStartPosition(9, -9, -9) - s3.IntegrateMinorEigenvector() - s3.SetMaximumPropagationDistance(18.0) - s3.SetIntegrationStepLength(0.1) --- - s4 = vtkHyperStreamline() - s4.SetInputData(ptLoad.GetOutput()) - s4.SetStartPosition(-9, 9, -9) - s4.IntegrateMinorEigenvector() - s4.SetMaximumPropagationDistance(18.0) - s4.SetIntegrationStepLength(0.1) diff --git a/data/examples/pp/vtkHyperTreeGridSource b/data/examples/pp/vtkHyperTreeGridSource deleted file mode 100644 index def418b..0000000 --- a/data/examples/pp/vtkHyperTreeGridSource +++ /dev/null @@ -1,6 +0,0 @@ - source = vtkHyperTreeGridSource() - source.SetMaximumLevel(6) - source.SetDimensions(4, 4, 3) # GridCell 3, 3, 2 - source.SetGridScale(1.5, 1.0, 0.7) - source.SetBranchFactor(4) - source.SetDescriptor(descriptor) diff --git a/data/examples/pp/vtkHyperTreeGridToUnstructuredGrid b/data/examples/pp/vtkHyperTreeGridToUnstructuredGrid deleted file mode 100644 index eed2d85..0000000 --- a/data/examples/pp/vtkHyperTreeGridToUnstructuredGrid +++ /dev/null @@ -1,6 +0,0 @@ - htg2ug = vtkHyperTreeGridToUnstructuredGrid() - htg2ug.SetInputConnection(source.GetOutputPort()) - htg2ug.Update() - - shrink = vtkShrinkFilter() - shrink.SetInputConnection(htg2ug.GetOutputPort()) diff --git a/data/examples/pp/vtkIOExodus b/data/examples/pp/vtkIOExodus deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOGeometry b/data/examples/pp/vtkIOGeometry deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOHDF b/data/examples/pp/vtkIOHDF deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOImage b/data/examples/pp/vtkIOImage deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOImport b/data/examples/pp/vtkIOImport deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOInfovis b/data/examples/pp/vtkIOInfovis deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOLegacy b/data/examples/pp/vtkIOLegacy deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOPLY b/data/examples/pp/vtkIOPLY deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOParallel b/data/examples/pp/vtkIOParallel deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIOXML b/data/examples/pp/vtkIOXML deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIdFilter b/data/examples/pp/vtkIdFilter deleted file mode 100644 index b5bb29a..0000000 --- a/data/examples/pp/vtkIdFilter +++ /dev/null @@ -1,27 +0,0 @@ - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) --- - id_filter = vtkIdFilter() - id_filter.SetInputData(source) - id_filter.SetPointIds(True) - id_filter.SetCellIds(False) - id_filter.SetPointIdsArrayName(array_name) - id_filter.SetCellIdsArrayName(array_name) diff --git a/data/examples/pp/vtkIdList b/data/examples/pp/vtkIdList deleted file mode 100644 index baf2d23..0000000 --- a/data/examples/pp/vtkIdList +++ /dev/null @@ -1,103 +0,0 @@ - dodechedronFacesIdList = vtkIdList() - # Number faces that make up the cell. - dodechedronFacesIdList.InsertNextId(numberOfFaces) - for face in dodechedronFace: - # Number of points in the face == numberOfFaceVertices - dodechedronFacesIdList.InsertNextId(len(face)) --- - vil = vtkIdList() - for i in it: - vil.InsertNextId(int(i)) - return vil - - --- - faceId = vtkIdList() - faceId.InsertNextId(6) # Six faces make up the cell. - for face in faces: - faceId.InsertNextId(len(face)) # The number of points in the face. - [faceId.InsertNextId(i) for i in face] - --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - --- - indices = vtkIdList() - lineCount = 0 - - while cells.GetNextCell(indices): - print('Line {0}:'.format(lineCount)) - for i in range(indices.GetNumberOfIds()): --- - idList = vtkIdList() - while (linesPolyData.GetLines().GetNextCell(idList)): - print('Line has {0} points'.format(idList.GetNumberOfIds())) - for pointId in range(idList.GetNumberOfIds() - 1): - print('{0} {1}'.format(idList.GetId(pointId), idList.GetId(pointId + 1))) - --- - Ids = vtkIdList() - Ids.InsertNextId(0) - Ids.InsertNextId(1) - Ids.InsertNextId(2) - Ids.InsertNextId(3) - Ids.InsertNextId(4) --- - idList = vtkIdList() - for i in range(0, cells.GetNumberOfCells()): - cells.GetNextCell(idList) - # If a cell has three points it is a triangle. - if idList.GetNumberOfIds() == 3: - numOfTriangles += 1 --- - idList = vtkIdList() - for i in range(0, cells.GetNumberOfCells()): - cells.GetNextCell(idList) - # If a cell has three points it is a triangle. - if idList.GetNumberOfIds() == 3: - numOfTriangles += 1 --- - cell_ids = vtkIdList() - source.GetPointCells(pt_id, cell_ids) - neighbour = set() - for cell_idx in range(0, cell_ids.GetNumberOfIds()): - cell_id = cell_ids.GetId(cell_idx) - cell_point_ids = vtkIdList() - source.GetCellPoints(cell_id, cell_point_ids) - for cell_pt_idx in range(0, cell_point_ids.GetNumberOfIds()): - neighbour.add(cell_point_ids.GetId(cell_pt_idx)) - return neighbour - diff --git a/data/examples/pp/vtkIdType b/data/examples/pp/vtkIdType deleted file mode 100644 index 63cc2d0..0000000 --- a/data/examples/pp/vtkIdType +++ /dev/null @@ -1,6 +0,0 @@ - # pts = array of 6 4-tuples of vtkIdType (int) representing the faces - # of the cube in terms of the above vertices - pts = [(0, 3, 2, 1), (4, 5, 6, 7), (0, 1, 5, 4), - (1, 2, 6, 5), (2, 3, 7, 6), (3, 0, 4, 7)] - - # We'll create the building blocks of polydata including data attributes. diff --git a/data/examples/pp/vtkIdTypeArray b/data/examples/pp/vtkIdTypeArray deleted file mode 100644 index 0f9dbcf..0000000 --- a/data/examples/pp/vtkIdTypeArray +++ /dev/null @@ -1,20 +0,0 @@ - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - ids.InsertNextValue(picker.GetCellId()) - - selection_node = vtkSelectionNode() - selection_node.SetFieldType(vtkSelectionNode.CELL) --- - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - - # Set values. - for i in range(10, 20): - ids.InsertNextValue(i) --- - ids = vtkIdTypeArray() - ids.SetNumberOfComponents(1) - - # Specify that we want to extract cells 10 through 19 - i = 10 - while i < 20: diff --git a/data/examples/pp/vtkImageAccumulate b/data/examples/pp/vtkImageAccumulate deleted file mode 100644 index 2005c24..0000000 --- a/data/examples/pp/vtkImageAccumulate +++ /dev/null @@ -1,6 +0,0 @@ - histogram = vtkImageAccumulate() - if use_flying_edges: - try: - using_marching_cubes = False - discrete_cubes = vtkDiscreteFlyingEdges3D() - except AttributeError: diff --git a/data/examples/pp/vtkImageActor b/data/examples/pp/vtkImageActor deleted file mode 100644 index c93f3be..0000000 --- a/data/examples/pp/vtkImageActor +++ /dev/null @@ -1,223 +0,0 @@ - inputActor = vtkImageActor() - inputActor.GetMapper().SetInputConnection(inputCastFilter.GetOutputPort()) - - normalizedActor = vtkImageActor() - normalizedActor.GetMapper().SetInputConnection(normalizeCastFilter.GetOutputPort()) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) --- - source1Actor = vtkImageActor() - source1Actor.GetMapper().SetInputConnection(source1CastFilter.GetOutputPort()) - - source2Actor = vtkImageActor() - source2Actor.GetMapper().SetInputConnection(source2CastFilter.GetOutputPort()) - - summedActor = vtkImageActor() - summedActor.GetMapper().SetInputConnection(summedCastFilter.GetOutputPort()) - - # There will be one render window - renderWindow = vtkRenderWindow() - renderWindow.SetSize(600, 300) --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(cast.GetOutputPort()) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - - filteredActor = vtkImageActor() - filteredActor.GetMapper().SetInputConnection(div.GetOutputPort()) - - # Define the viewport ranges. - # (xmin, ymin, xmax, ymax) - originalViewport = [0.0, 0.0, 0.5, 1.0] --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(originalColor.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetDisplayExtent( - reader.GetDataExtent()[0], reader.GetDataExtent()[1], - reader.GetDataExtent()[2], reader.GetDataExtent()[3], --- - laplacianActor = vtkImageActor() - laplacianActor.GetMapper().SetInputConnection(laplacianColor.GetOutputPort()) - laplacianActor.GetProperty().SetInterpolationTypeToNearest() - laplacianActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - enhancedColor = vtkImageMapToWindowLevelColors() --- - enhancedActor = vtkImageActor() - enhancedActor.GetMapper().SetInputConnection(enhancedColor.GetOutputPort()) - enhancedActor.GetProperty().SetInterpolationTypeToNearest() - enhancedActor.SetDisplayExtent(originalActor.GetDisplayExtent()) - - # Setup the renderers. --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection( - reader.GetOutputPort()) - - filteredActor = vtkImageActor() - filteredActor.GetMapper().SetInputConnection( - smoothing_filter.GetOutputPort()) - - # Define the viewport ranges. - # (xmin, ymin, xmax, ymax) --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputData(originalData) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetDisplayExtent(reader.GetDataExtent()[0], reader.GetDataExtent()[1], reader.GetDataExtent()[2], --- - noisyActor = vtkImageActor() - noisyActor.GetMapper().SetInputData(noisyData) - noisyActor.GetProperty().SetColorWindow(colorWindow) - noisyActor.GetProperty().SetColorLevel(colorLevel) - noisyActor.GetProperty().SetInterpolationTypeToNearest() - noisyActor.SetDisplayExtent(originalActor.GetDisplayExtent()) --- - hybridMedianActor = vtkImageActor() - hybridMedianActor.GetMapper().SetInputConnection(hybridMedian.GetOutputPort()) - hybridMedianActor.GetProperty().SetColorWindow(colorWindow) - hybridMedianActor.GetProperty().SetColorLevel(colorLevel) - hybridMedianActor.GetProperty().SetInterpolationTypeToNearest() - hybridMedianActor.SetDisplayExtent(originalActor.GetDisplayExtent()) --- - medianActor = vtkImageActor() - medianActor.GetMapper().SetInputConnection(median.GetOutputPort()) - medianActor.GetProperty().SetColorWindow(colorWindow) - medianActor.GetProperty().SetColorLevel(colorLevel) - medianActor.GetProperty().SetInterpolationTypeToNearest() - --- - idealActor = vtkImageActor() - idealActor.GetMapper().SetInputConnection(idealColor.GetOutputPort()) - idealActor.GetProperty().SetInterpolationTypeToNearest() - - butterworthColor = vtkImageMapToWindowLevelColors() - butterworthColor.SetWindow(500) --- - butterworthActor = vtkImageActor() - butterworthActor.GetMapper().SetInputConnection(butterworthColor.GetOutputPort()) - butterworthActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup the renderers. - idealRenderer = vtkRenderer() --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputData(originalData) - originalActor.GetProperty().SetColorWindow(colorWindow) - originalActor.GetProperty().SetColorLevel(colorLevel) - originalActor.GetProperty().SetInterpolationTypeToNearest() - originalActor.SetZSlice(middleSlice) --- - noisyActor = vtkImageActor() - noisyActor.GetMapper().SetInputData(noisyData) - noisyActor.GetProperty().SetColorWindow(colorWindow) - noisyActor.GetProperty().SetColorLevel(colorLevel) - noisyActor.GetProperty().SetInterpolationTypeToNearest() - noisyActor.SetZSlice(middleSlice) --- - gaussianActor = vtkImageActor() - gaussianActor.GetMapper().SetInputConnection(gaussian.GetOutputPort()) - gaussianActor.GetProperty().SetColorWindow(colorWindow) - gaussianActor.GetProperty().SetColorLevel(colorLevel) - gaussianActor.GetProperty().SetInterpolationTypeToNearest() - gaussianActor.SetZSlice(middleSlice) --- - medianActor = vtkImageActor() - medianActor.GetMapper().SetInputConnection(median.GetOutputPort()) - medianActor.GetProperty().SetColorWindow(colorWindow) - medianActor.GetProperty().SetColorLevel(colorLevel) - medianActor.GetProperty().SetInterpolationTypeToNearest() - medianActor.SetZSlice(middleSlice) --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(reader.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - - connectedActor = vtkImageActor() - connectedActor.GetMapper().SetInputConnection(con.GetOutputPort()) - connectedActor.GetProperty().SetInterpolationTypeToNearest() - - erodeActor = vtkImageActor() - erodeActor.GetMapper().SetInputConnection(erode.GetOutputPort()) - erodeActor.GetProperty().SetInterpolationTypeToNearest() - - dilateActor = vtkImageActor() - dilateActor.GetMapper().SetInputConnection(dilate.GetOutputPort()) - dilateActor.GetProperty().SetInterpolationTypeToNearest() - - openingActor = vtkImageActor() - openingActor.GetMapper().SetInputConnection(dilate2.GetOutputPort()) - openingActor.GetProperty().SetInterpolationTypeToNearest() - - closingActor = vtkImageActor() - closingActor.GetMapper().SetInputConnection(erode1.GetOutputPort()) - closingActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup renderers - originalRenderer = vtkRenderer() --- - constantPadActor = vtkImageActor() - constantPadActor.GetMapper().SetInputConnection( - constantPadColor.GetOutputPort()) - constantPadActor.GetProperty().SetInterpolationTypeToNearest() - - mirrorPadColor = vtkImageMapToWindowLevelColors() --- - mirrorPadActor = vtkImageActor() - mirrorPadActor.GetMapper().SetInputConnection( - mirrorPadColor.GetOutputPort()) - mirrorPadActor.GetProperty().SetInterpolationTypeToNearest() - - # Setup the renderers. --- - originalActor = vtkImageActor() - originalActor.GetMapper().SetInputConnection(reader.GetOutputPort()) - originalActor.GetProperty().SetInterpolationTypeToNearest() - - compressedActor = vtkImageActor() - compressedActor.GetMapper().SetInputConnection(compress.GetOutputPort()) - compressedActor.GetProperty().SetInterpolationTypeToNearest() - CreateImageActor(compressedActor, 160, 120) - - # Define the viewport ranges. --- - image_actor = vtkImageActor() - image_actor.SetInputData(image_data) - - # Create a renderer to display the image in the background - background_renderer = vtkRenderer() - --- - actor = vtkImageActor() - actor.GetMapper().SetInputConnection(castFilter.GetOutputPort()) - - # Setup renderer - renderer = vtkRenderer() - renderer.AddActor(actor) --- - sagittal = vtkImageActor() - sagittal.GetMapper().SetInputConnection(sagittal_colors.GetOutputPort()) - sagittal.SetDisplayExtent(128, 128, 0, 255, 0, 92) - sagittal.ForceOpaqueOn() - - # Create the second (axial) plane of the three planes. We use the --- - axial = vtkImageActor() - axial.GetMapper().SetInputConnection(axial_colors.GetOutputPort()) - axial.SetDisplayExtent(0, 255, 0, 255, 46, 46) - axial.ForceOpaqueOn() - - # Create the third (coronal) plane of the three planes. We use --- - coronal = vtkImageActor() - coronal.GetMapper().SetInputConnection(coronal_colors.GetOutputPort()) - coronal.SetDisplayExtent(0, 255, 128, 128, 0, 92) - coronal.ForceOpaqueOn() - - # It is convenient to create an initial view of the data. The diff --git a/data/examples/pp/vtkImageAppend b/data/examples/pp/vtkImageAppend deleted file mode 100644 index 506609e..0000000 --- a/data/examples/pp/vtkImageAppend +++ /dev/null @@ -1,6 +0,0 @@ - imageAppend = vtkImageAppend() - imageAppend.SetInputConnection(stencil.GetOutputPort()) - imageAppend.AddInputConnection(stencil2.GetOutputPort()) - - viewer = vtkImageViewer() - interator = vtkRenderWindowInteractor() diff --git a/data/examples/pp/vtkImageButterworthHighPass b/data/examples/pp/vtkImageButterworthHighPass deleted file mode 100644 index d5a1e46..0000000 --- a/data/examples/pp/vtkImageButterworthHighPass +++ /dev/null @@ -1,6 +0,0 @@ - butterworthHighPass = vtkImageButterworthHighPass() - butterworthHighPass.SetInputConnection(fft.GetOutputPort()) - butterworthHighPass.SetXCutOff(0.1) - butterworthHighPass.SetYCutOff(0.1) - - butterworthRfft = vtkImageRFFT() diff --git a/data/examples/pp/vtkImageCanvasSource2D b/data/examples/pp/vtkImageCanvasSource2D deleted file mode 100644 index b4ac204..0000000 --- a/data/examples/pp/vtkImageCanvasSource2D +++ /dev/null @@ -1,13 +0,0 @@ - source1 = vtkImageCanvasSource2D() - source1.SetScalarTypeToUnsignedChar() - source1.SetNumberOfScalarComponents(3) - source1.SetExtent(0, 100, 0, 100, 0, 0) - source1.SetDrawColor(colors.GetColor4ub('SteelBlue')) - source1.FillBox(0, 100, 0, 100) --- - canvas_source = vtkImageCanvasSource2D() - canvas_source.SetExtent(0, 100, 0, 100, 0, 0) - canvas_source.SetScalarTypeToUnsignedChar() - canvas_source.SetNumberOfScalarComponents(3) - canvas_source.SetDrawColor(colors.GetColor4ub('warm_grey')) - canvas_source.FillBox(0, 100, 0, 100) diff --git a/data/examples/pp/vtkImageCast b/data/examples/pp/vtkImageCast deleted file mode 100644 index 5dfe2ab..0000000 --- a/data/examples/pp/vtkImageCast +++ /dev/null @@ -1,84 +0,0 @@ - inputCastFilter = vtkImageCast() - inputCastFilter.SetInputConnection(source.GetOutputPort()) - inputCastFilter.SetOutputScalarTypeToUnsignedChar() - inputCastFilter.Update() - - normalizeCastFilter = vtkImageCast() - normalizeCastFilter.SetInputConnection(normalizeFilter.GetOutputPort()) - normalizeCastFilter.SetOutputScalarTypeToUnsignedChar() - normalizeCastFilter.Update() - - # Create actors --- - source1Double = vtkImageCast() - source1Double.SetInputConnection(0, source1.GetOutputPort()) - source1Double.SetOutputScalarTypeToDouble() - - # Create image 2 - source2 = vtkImageSinusoidSource() --- - source1CastFilter = vtkImageCast() - source1CastFilter.SetInputConnection(source1.GetOutputPort()) - source1CastFilter.SetOutputScalarTypeToUnsignedChar() - source1CastFilter.Update() - - source2CastFilter = vtkImageCast() - source2CastFilter.SetInputConnection(source2.GetOutputPort()) - source2CastFilter.SetOutputScalarTypeToUnsignedChar() - source2CastFilter.Update() - - summedCastFilter = vtkImageCast() - summedCastFilter.SetInputConnection(sumFilter.GetOutputPort()) - summedCastFilter.SetOutputScalarTypeToUnsignedChar() - summedCastFilter.Update() - - # Create actors --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - - # Get rid of the discrete scalars. - smooth = vtkImageGaussianSmooth() --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - laplacian = vtkImageLaplacian() --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToFloat() - - smoothing_filter = vtkImageGaussianSmooth() - smoothing_filter.SetDimensionality(2) --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - originalData = vtkImageData() --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToDouble() - cast.Update() - - originalData = vtkImageData() --- - castFilter = vtkImageCast() - castFilter.SetInputConnection(source.GetOutputPort()) - castFilter.SetOutputScalarTypeToUnsignedChar() - castFilter.Update() - - # Create an actor --- - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) - cast.SetOutputScalarTypeToFloat() - - # Magnify the image. - magnify = vtkImageMagnify() diff --git a/data/examples/pp/vtkImageConstantPad b/data/examples/pp/vtkImageConstantPad deleted file mode 100644 index 0d7a467..0000000 --- a/data/examples/pp/vtkImageConstantPad +++ /dev/null @@ -1,27 +0,0 @@ - constantPad = vtkImageConstantPad() - constantPad.SetInputConnection(reader.GetOutputPort()) - constantPad.SetConstant(800) - constantPad.SetOutputWholeExtent(-127, 383, -127, 383, 22, 22) - - mirrorPad = vtkImageMirrorPad() --- - pad = vtkImageConstantPad() - pad.SetInputConnection(polar.GetOutputPort()) - pad.SetOutputNumberOfScalarComponents(3) - pad.SetConstant(200.0) - - # At this point we have Hue, Value, Saturation. --- - grey_padder = vtkImageConstantPad() - grey_padder.SetInputConnection(grey_reader.GetOutputPort()) - grey_padder.SetOutputWholeExtent(0, 511, 0, 511, slice_number, slice_number) - grey_padder.SetConstant(0) - - grey_plane = vtkPlaneSource() --- - segment_padder = vtkImageConstantPad() - segment_padder.SetInputConnection(segment_reader.GetOutputPort()) - segment_padder.SetOutputWholeExtent(0, 511, 0, 511, slice_number, slice_number) - segment_padder.SetConstant(0) - - segment_plane = vtkPlaneSource() diff --git a/data/examples/pp/vtkImageData b/data/examples/pp/vtkImageData deleted file mode 100644 index 6e0ded1..0000000 --- a/data/examples/pp/vtkImageData +++ /dev/null @@ -1,82 +0,0 @@ - imageData = vtkImageData() - imageData.SetDimensions(3, 4, 5) - imageData.AllocateScalars(VTK_DOUBLE, 1) - - dims = imageData.GetDimensions() - --- - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort()) - imageDataGeometryFilter.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort()) --- - originalData = vtkImageData() - originalData.DeepCopy(cast.GetOutput()) - - noisyData = vtkImageData() - - AddShotNoise(originalData, noisyData, 2000.0, 0.1, reader.GetOutput().GetExtent()) - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) --- - originalData = vtkImageData() - originalData.DeepCopy(cast.GetOutput()) - - noisyData = vtkImageData() - - AddShotNoise(originalData, noisyData, 2000.0, 0.1, reader.GetOutput().GetExtent()) - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) --- - blank_image = vtkImageData() - blank_image.SetExtent(extent) - blank_image.AllocateScalars(3, 1) # VTK_UNSIGNED_CHAR, 1 component - blank_image.GetPointData().GetScalars().Fill(0) - blank_image.SetSpacing(spacing) - blank_image.SetOrigin(origin) --- - box = vtkImageData() - box.SetDimensions(dims) - box.SetSpacing((bounds[1::2] - bounds[:-1:2]) / (dims - 1)) - box.SetOrigin(bounds[::2]) - - # Gaussian kernel --- - blob_image = vtkImageData() - - max_r = 50 - 2.0 * radius - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): --- - volume = vtkImageData() - if dicom_dir is None: - sphere_source = vtkSphereSource() - sphere_source.SetPhiResolution(20) - sphere_source.SetThetaResolution(20) - sphere_source.Update() --- - blob_image = vtkImageData() - - max_r = 50 - 2.0 * radius - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): --- - whiteImage = vtkImageData() - bounds = [0] * 6 - circle.GetBounds(bounds) - spacing = [0] * 3 # desired volume spacing - spacing[0] = 0.5 - spacing[1] = 0.5 --- - image = vtkImageData() - texture = vtkTexture() - - # Create texture - dimension = 16 * lineStippleRepeat - diff --git a/data/examples/pp/vtkImageDataGeometryFilter b/data/examples/pp/vtkImageDataGeometryFilter deleted file mode 100644 index f87abf6..0000000 --- a/data/examples/pp/vtkImageDataGeometryFilter +++ /dev/null @@ -1,48 +0,0 @@ - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(source1.GetOutputPort()) - imageDataGeometryFilter.Update() - - # Create a mapper and actor - mapper = vtkPolyDataMapper() --- - imageDataGeometryFilter = vtkImageDataGeometryFilter() - imageDataGeometryFilter.SetInputConnection(reader.GetOutputPort()) - imageDataGeometryFilter.Update() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(imageDataGeometryFilter.GetOutputPort()) --- - geometry = vtkImageDataGeometryFilter() - geometry.SetInputConnection(luminance.GetOutputPort()) - # Warp the data in a direction perpendicular to the image plane. - warp = vtkWarpScalar() - warp.SetInputConnection(geometry.GetOutputPort()) - warp.SetScaleFactor(-0.1) --- - geometry = vtkImageDataGeometryFilter() - geometry.SetInputConnection(gaussian.GetOutputPort()) - - aClipper = vtkClipPolyData() - aClipper.SetInputConnection(geometry.GetOutputPort()) - aClipper.SetValue(127.5) --- - g = vtkImageDataGeometryFilter() - g.SetInputData(ptLoad.GetOutput()) - g.SetExtent(0, 100, 0, 100, 0, 0) - g.Update() # for scalar range - - gm = vtkPolyDataMapper() --- - plane = vtkImageDataGeometryFilter() - plane.SetInputConnection(ptLoad.GetOutputPort()) - plane.SetExtent(2, 2, 0, 99, 0, 99) - - # Generate the tensor axes. - axes = vtkAxes() --- - plane = vtkImageDataGeometryFilter() - plane.SetInputConnection(ptLoad.GetOutputPort()) - plane.SetExtent(2, 2, 0, 99, 0, 99) - - # Generate the ellipsoids. - sphere = vtkSphereSource() diff --git a/data/examples/pp/vtkImageDilateErode3D b/data/examples/pp/vtkImageDilateErode3D deleted file mode 100644 index 937334e..0000000 --- a/data/examples/pp/vtkImageDilateErode3D +++ /dev/null @@ -1,39 +0,0 @@ - dilate = vtkImageDilateErode3D() - dilate.SetInputConnection(reader.GetOutputPort()) - dilate.SetDilateValue(0) - dilate.SetErodeValue(255) - dilate.SetKernelSize(31, 31, 1) - --- - erode = vtkImageDilateErode3D() - erode.SetInputConnection(reader.GetOutputPort()) - erode.SetDilateValue(255) - erode.SetErodeValue(0) - erode.SetKernelSize(31, 31, 1) - --- - dilate1 = vtkImageDilateErode3D() - dilate1.SetInputConnection(reader.GetOutputPort()) - dilate1.SetDilateValue(0) - dilate1.SetErodeValue(255) - dilate1.SetKernelSize(31, 31, 1) - - erode1 = vtkImageDilateErode3D() - erode1.SetInputConnection(dilate1.GetOutputPort()) - erode1.SetDilateValue(255) - erode1.SetErodeValue(0) - erode1.SetKernelSize(31, 31, 1) - --- - erode2 = vtkImageDilateErode3D() - erode2.SetInputConnection(reader.GetOutputPort()) - erode2.SetDilateValue(255) - erode2.SetErodeValue(0) - erode2.SetKernelSize(31, 31, 1) - - dilate2 = vtkImageDilateErode3D() - dilate2.SetInputConnection(erode2.GetOutputPort()) - dilate2.SetDilateValue(0) - dilate2.SetErodeValue(255) - dilate2.SetKernelSize(31, 31, 1) - diff --git a/data/examples/pp/vtkImageEuclideanToPolar b/data/examples/pp/vtkImageEuclideanToPolar deleted file mode 100644 index e31dd31..0000000 --- a/data/examples/pp/vtkImageEuclideanToPolar +++ /dev/null @@ -1,6 +0,0 @@ - polar = vtkImageEuclideanToPolar() - polar.SetInputConnection(gradient.GetOutputPort()) - polar.SetThetaMaximum(255.0) - - # Add a third component to the data. - # This is needed since the gradient filter only generates two components, diff --git a/data/examples/pp/vtkImageExtractComponents b/data/examples/pp/vtkImageExtractComponents deleted file mode 100644 index 5ff2d77..0000000 --- a/data/examples/pp/vtkImageExtractComponents +++ /dev/null @@ -1,20 +0,0 @@ - idealReal = vtkImageExtractComponents() - idealReal.SetInputConnection(idealRfft.GetOutputPort()) - idealReal.SetComponents(0) - - butterworthHighPass = vtkImageButterworthHighPass() - butterworthHighPass.SetInputConnection(fft.GetOutputPort()) --- - butterworthReal = vtkImageExtractComponents() - butterworthReal.SetInputConnection(butterworthRfft.GetOutputPort()) - butterworthReal.SetComponents(0) - - # Create the actors. - idealColor = vtkImageMapToWindowLevelColors() --- - permute = vtkImageExtractComponents() - permute.SetInputConnection(pad.GetOutputPort()) - permute.SetComponents(0, 2, 1) - - # Convert back into RGB values. - rgb = vtkImageHSVToRGB() diff --git a/data/examples/pp/vtkImageFFT b/data/examples/pp/vtkImageFFT deleted file mode 100644 index 5c2fac5..0000000 --- a/data/examples/pp/vtkImageFFT +++ /dev/null @@ -1,13 +0,0 @@ - fft = vtkImageFFT() - fft.SetInputConnection(reader.GetOutputPort()) - - idealHighPass = vtkImageIdealHighPass() - idealHighPass.SetInputConnection(fft.GetOutputPort()) - idealHighPass.SetXCutOff(0.1) --- - fft = vtkImageFFT() - fft.SetInputConnection(reader.GetOutputPort()) - - mag = vtkImageMagnitude() - mag.SetInputConnection(fft.GetOutputPort()) - diff --git a/data/examples/pp/vtkImageFlip b/data/examples/pp/vtkImageFlip deleted file mode 100644 index 95bb89d..0000000 --- a/data/examples/pp/vtkImageFlip +++ /dev/null @@ -1,76 +0,0 @@ - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - # flip = vtkImageFlip() - # flip.SetInputConnection(normal_reader.GetOutputPort()) - # flip.SetFilteredAxes(0) - - normal = vtkTexture() - normal.InterpolateOn() --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - --- - flip = vtkImageFlip() - flip.SetInputConnection(img_reader.GetOutputPort(0)) - flip.SetFilteredAxis(1) # flip y axis - cube_map.SetInputConnection(i, flip.GetOutputPort()) - i += 1 - diff --git a/data/examples/pp/vtkImageFourierCenter b/data/examples/pp/vtkImageFourierCenter deleted file mode 100644 index a832541..0000000 --- a/data/examples/pp/vtkImageFourierCenter +++ /dev/null @@ -1,6 +0,0 @@ - center = vtkImageFourierCenter() - center.SetInputConnection(mag.GetOutputPort()) - - compress = vtkImageLogarithmicScale() - compress.SetInputConnection(center.GetOutputPort()) - compress.SetConstant(15) diff --git a/data/examples/pp/vtkImageGaussianSmooth b/data/examples/pp/vtkImageGaussianSmooth deleted file mode 100644 index 6c72d0c..0000000 --- a/data/examples/pp/vtkImageGaussianSmooth +++ /dev/null @@ -1,55 +0,0 @@ - smooth = vtkImageGaussianSmooth() - smooth.SetInputConnection(cast.GetOutputPort()) - smooth.SetStandardDeviations(0.8, 0.8, 0) - - m1 = vtkSphere() - m1.SetCenter(310, 130, 0) --- - smoothing_filter = vtkImageGaussianSmooth() - smoothing_filter.SetDimensionality(2) - smoothing_filter.SetInputConnection(cast.GetOutputPort()) - smoothing_filter.SetStandardDeviations(4.0, 4.0) - smoothing_filter.SetRadiusFactors(2.0, 2.0) - --- - smooth = vtkImageGaussianSmooth() - smooth.SetDimensionality(3) - smooth.SetInputConnection(reader.GetOutputPort()) - smooth.SetStandardDeviations(1.75, 1.75, 0.0) - smooth.SetRadiusFactor(2) - --- - gaussian = vtkImageGaussianSmooth() - gaussian.SetDimensionality(2) - gaussian.SetInputData(noisyData) - gaussian.SetStandardDeviations(2.0, 2.0) - gaussian.SetRadiusFactors(2.0, 2.0) - --- - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviations(2, 2) - gaussian.SetDimensionality(2) - gaussian.SetRadiusFactors(1, 1) - gaussian.SetInputConnection(imageIn.GetOutputPort()) - --- - smooth = vtkImageGaussianSmooth() - smooth.SetInputConnection(magnify.GetOutputPort()) - smooth.SetDimensionality(2) - smooth.SetStandardDeviations(1.5, 1.5, 0.0) - smooth.SetRadiusFactors(2.01, 2.01, 0.0) - --- - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviations(gaussian_standard_deviation, gaussian_standard_deviation, - gaussian_standard_deviation) - gaussian.SetRadiusFactors(gaussian_radius, gaussian_radius, gaussian_radius) - gaussian.SetInputConnection(select_tissue.GetOutputPort()) - --- - gaussian = vtkImageGaussianSmooth() - gaussian.SetStandardDeviation(*gsd) - gaussian.SetRadiusFactors(*grf) - gaussian.SetInputConnection(shrinker.GetOutputPort()) - last_connection = gaussian - diff --git a/data/examples/pp/vtkImageGradient b/data/examples/pp/vtkImageGradient deleted file mode 100644 index f66c41b..0000000 --- a/data/examples/pp/vtkImageGradient +++ /dev/null @@ -1,34 +0,0 @@ - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) --- - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - brown = vtkBrownianPoints() - brown.SetMinimumSpeed(0.5) - brown.SetMaximumSpeed(1.0) --- - gradient = vtkImageGradient() - gradient.SetInputConnection(smooth.GetOutputPort()) - gradient.SetDimensionality(2) - - # Convert the data to polar coordinates. - # The image magnitude is mapped into saturation value, --- - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - - # Elevation just to generate another scalar attribute that varies nicely over the data range - elev = vtkElevationFilter() --- - grad = vtkImageGradient() - grad.SetDimensionality(3) - grad.SetInputConnection(rt.GetOutputPort()) - - # Elevation just to generate another scalar attribute that varies nicely over the data range - elev = vtkElevationFilter() diff --git a/data/examples/pp/vtkImageHSVToRGB b/data/examples/pp/vtkImageHSVToRGB deleted file mode 100644 index 6326beb..0000000 --- a/data/examples/pp/vtkImageHSVToRGB +++ /dev/null @@ -1,6 +0,0 @@ - rgb = vtkImageHSVToRGB() - rgb.SetInputConnection(permute.GetOutputPort()) - rgb.SetMaximum(255.0) - - # Set up a viewer for the image. - # Note that vtkImageViewer and vtkImageViewer2 are convenience wrappers around diff --git a/data/examples/pp/vtkImageHybridMedian2D b/data/examples/pp/vtkImageHybridMedian2D deleted file mode 100644 index 6fc8edf..0000000 --- a/data/examples/pp/vtkImageHybridMedian2D +++ /dev/null @@ -1,8 +0,0 @@ - hybridMedian1 = vtkImageHybridMedian2D() - hybridMedian1.SetInputData(noisyData) - hybridMedian = vtkImageHybridMedian2D() - hybridMedian.SetInputConnection(hybridMedian1.GetOutputPort()) - - colorWindow = (scalarRange[1] - scalarRange[0]) * 0.8 - colorLevel = colorWindow / 2 - originalActor = vtkImageActor() diff --git a/data/examples/pp/vtkImageIdealHighPass b/data/examples/pp/vtkImageIdealHighPass deleted file mode 100644 index 79e3fbe..0000000 --- a/data/examples/pp/vtkImageIdealHighPass +++ /dev/null @@ -1,6 +0,0 @@ - idealHighPass = vtkImageIdealHighPass() - idealHighPass.SetInputConnection(fft.GetOutputPort()) - idealHighPass.SetXCutOff(0.1) - idealHighPass.SetYCutOff(0.1) - - idealRfft = vtkImageRFFT() diff --git a/data/examples/pp/vtkImageImport b/data/examples/pp/vtkImageImport deleted file mode 100644 index 18693c2..0000000 --- a/data/examples/pp/vtkImageImport +++ /dev/null @@ -1,6 +0,0 @@ - dataImporter = vtkImageImport() - # The previously created array is converted to a string of chars and imported. - data_string = data_matrix.tobytes() - dataImporter.CopyImportVoidPointer(data_string, len(data_string)) - # The type of the newly imported data is set to unsigned char (uint8) - dataImporter.SetDataScalarTypeToUnsignedChar() diff --git a/data/examples/pp/vtkImageIslandRemoval2D b/data/examples/pp/vtkImageIslandRemoval2D deleted file mode 100644 index 4cd37dd..0000000 --- a/data/examples/pp/vtkImageIslandRemoval2D +++ /dev/null @@ -1,6 +0,0 @@ - island_remover = vtkImageIslandRemoval2D() - island_remover.SetAreaThreshold(tissue['island_area']) - island_remover.SetIslandValue(tissue['island_replace']) - island_remover.SetReplaceValue(tissue['tissue']) - island_remover.SetInput(last_connection.GetOutput()) - island_remover.Update() diff --git a/data/examples/pp/vtkImageLaplacian b/data/examples/pp/vtkImageLaplacian deleted file mode 100644 index d342c3f..0000000 --- a/data/examples/pp/vtkImageLaplacian +++ /dev/null @@ -1,6 +0,0 @@ - laplacian = vtkImageLaplacian() - laplacian.SetInputConnection(cast.GetOutputPort()) - laplacian.SetDimensionality(3) - - enhance = vtkImageMathematics() - enhance.SetInputConnection(0, cast.GetOutputPort()) diff --git a/data/examples/pp/vtkImageLogarithmicScale b/data/examples/pp/vtkImageLogarithmicScale deleted file mode 100644 index e2d4ebc..0000000 --- a/data/examples/pp/vtkImageLogarithmicScale +++ /dev/null @@ -1,6 +0,0 @@ - compress = vtkImageLogarithmicScale() - compress.SetInputConnection(center.GetOutputPort()) - compress.SetConstant(15) - compress.Update() - - # Create the actors. diff --git a/data/examples/pp/vtkImageLuminance b/data/examples/pp/vtkImageLuminance deleted file mode 100644 index ff56c62..0000000 --- a/data/examples/pp/vtkImageLuminance +++ /dev/null @@ -1,6 +0,0 @@ - luminance = vtkImageLuminance() - luminance.SetInputConnection(reader.GetOutputPort()) - # Pass the data to the pipeline as polygons. - geometry = vtkImageDataGeometryFilter() - geometry.SetInputConnection(luminance.GetOutputPort()) - # Warp the data in a direction perpendicular to the image plane. diff --git a/data/examples/pp/vtkImageMagnify b/data/examples/pp/vtkImageMagnify deleted file mode 100644 index e8ab350..0000000 --- a/data/examples/pp/vtkImageMagnify +++ /dev/null @@ -1,6 +0,0 @@ - magnify = vtkImageMagnify() - magnify.SetInputConnection(cast.GetOutputPort()) - magnify.SetMagnificationFactors(2, 2, 1) - magnify.InterpolateOn() - - # Smooth the data. diff --git a/data/examples/pp/vtkImageMagnitude b/data/examples/pp/vtkImageMagnitude deleted file mode 100644 index 8be01d4..0000000 --- a/data/examples/pp/vtkImageMagnitude +++ /dev/null @@ -1,6 +0,0 @@ - mag = vtkImageMagnitude() - mag.SetInputConnection(fft.GetOutputPort()) - - center = vtkImageFourierCenter() - center.SetInputConnection(mag.GetOutputPort()) - diff --git a/data/examples/pp/vtkImageMandelbrotSource b/data/examples/pp/vtkImageMandelbrotSource deleted file mode 100644 index 26a9d74..0000000 --- a/data/examples/pp/vtkImageMandelbrotSource +++ /dev/null @@ -1,13 +0,0 @@ - source1 = vtkImageMandelbrotSource() - source1.SetWholeExtent(0, 255, 0, 255, 0, 0) - source1.Update() - - source1Double = vtkImageCast() - source1Double.SetInputConnection(0, source1.GetOutputPort()) --- - source = vtkImageMandelbrotSource() - source.Update() - - print(source.GetOutput().GetScalarTypeAsString()) - - castFilter = vtkImageCast() diff --git a/data/examples/pp/vtkImageMapToColors b/data/examples/pp/vtkImageMapToColors deleted file mode 100644 index 138098d..0000000 --- a/data/examples/pp/vtkImageMapToColors +++ /dev/null @@ -1,27 +0,0 @@ - color = vtkImageMapToColors() - color.SetLookupTable(wlut) - color.SetInputData(actor.GetMapper().GetInput()) - - actor.GetMapper().SetInputConnection(color.GetOutputPort()) - return --- - sagittal_colors = vtkImageMapToColors() - sagittal_colors.SetInputConnection(reader.GetOutputPort()) - sagittal_colors.SetLookupTable(bw_lut) - sagittal_colors.Update() - - sagittal = vtkImageActor() --- - axial_colors = vtkImageMapToColors() - axial_colors.SetInputConnection(reader.GetOutputPort()) - axial_colors.SetLookupTable(hue_lut) - axial_colors.Update() - - axial = vtkImageActor() --- - coronal_colors = vtkImageMapToColors() - coronal_colors.SetInputConnection(reader.GetOutputPort()) - coronal_colors.SetLookupTable(sat_lut) - coronal_colors.Update() - - coronal = vtkImageActor() diff --git a/data/examples/pp/vtkImageMapToWindowLevelColors b/data/examples/pp/vtkImageMapToWindowLevelColors deleted file mode 100644 index 3a241ff..0000000 --- a/data/examples/pp/vtkImageMapToWindowLevelColors +++ /dev/null @@ -1,48 +0,0 @@ - originalColor = vtkImageMapToWindowLevelColors() - originalColor.SetWindow(colorWindow) - originalColor.SetLevel(colorLevel) - originalColor.SetInputConnection(reader.GetOutputPort()) - - originalActor = vtkImageActor() --- - laplacianColor = vtkImageMapToWindowLevelColors() - laplacianColor.SetWindow(1000) - laplacianColor.SetLevel(0) - laplacianColor.SetInputConnection(laplacian.GetOutputPort()) - - laplacianActor = vtkImageActor() --- - enhancedColor = vtkImageMapToWindowLevelColors() - enhancedColor.SetWindow(colorWindow) - enhancedColor.SetLevel(colorLevel) - enhancedColor.SetInputConnection(enhance.GetOutputPort()) - - enhancedActor = vtkImageActor() --- - idealColor = vtkImageMapToWindowLevelColors() - idealColor.SetWindow(500) - idealColor.SetLevel(0) - idealColor.SetInputConnection(idealReal.GetOutputPort()) - - idealActor = vtkImageActor() --- - butterworthColor = vtkImageMapToWindowLevelColors() - butterworthColor.SetWindow(500) - butterworthColor.SetLevel(0) - butterworthColor.SetInputConnection(butterworthReal.GetOutputPort()) - - butterworthActor = vtkImageActor() --- - constantPadColor = vtkImageMapToWindowLevelColors() - constantPadColor.SetWindow(2000) - constantPadColor.SetLevel(1000) - constantPadColor.SetInputConnection(constantPad.GetOutputPort()) - - constantPadActor = vtkImageActor() --- - mirrorPadColor = vtkImageMapToWindowLevelColors() - mirrorPadColor.SetWindow(2000) - mirrorPadColor.SetLevel(1000) - mirrorPadColor.SetInputConnection(mirrorPad.GetOutputPort()) - - mirrorPadActor = vtkImageActor() diff --git a/data/examples/pp/vtkImageMapper b/data/examples/pp/vtkImageMapper deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImageMarchingCubes b/data/examples/pp/vtkImageMarchingCubes deleted file mode 100644 index 1bc2869..0000000 --- a/data/examples/pp/vtkImageMarchingCubes +++ /dev/null @@ -1,13 +0,0 @@ - iso_smoothed = vtkImageMarchingCubes() - iso_smoothed.SetInputConnection(smooth.GetOutputPort()) - iso_smoothed.SetValue(0, 1150) - - iso_smoothed_mapper = vtkPolyDataMapper() - iso_smoothed_mapper.SetInputConnection(iso_smoothed.GetOutputPort()) --- - iso = vtkImageMarchingCubes() - iso.SetInputConnection(subsample.GetOutputPort()) - iso.SetValue(0, 1150) - - iso_mapper = vtkPolyDataMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) diff --git a/data/examples/pp/vtkImageMathematics b/data/examples/pp/vtkImageMathematics deleted file mode 100644 index d694073..0000000 --- a/data/examples/pp/vtkImageMathematics +++ /dev/null @@ -1,51 +0,0 @@ - div = vtkImageMathematics() - div.SetInputConnection(0, smooth.GetOutputPort()) - div.SetInputConnection(1, m3.GetOutputPort()) - div.SetOperationToMultiply() - - # Create the actors. --- - enhance = vtkImageMathematics() - enhance.SetInputConnection(0, cast.GetOutputPort()) - enhance.SetInputConnection(1, laplacian.GetOutputPort()) - enhance.SetOperationToSubtract() - - colorWindow = (scalarRange[1] - scalarRange[0]) --- - shotNoise = vtkImageMathematics() - shotNoise.SetInputConnection(0, shotNoiseThresh1.GetOutputPort()) - shotNoise.SetInputConnection(1, shotNoiseThresh2.GetOutputPort()) - shotNoise.SetOperationToAdd() - - add = vtkImageMathematics() - add.SetInputData(0, inputImage) - add.SetInputConnection(1, shotNoise.GetOutputPort()) - add.SetOperationToAdd() - add.Update() - outputImage.DeepCopy(add.GetOutput()) --- - shotNoise = vtkImageMathematics() - shotNoise.SetInputConnection(0, shotNoiseThresh1.GetOutputPort()) - shotNoise.SetInputConnection(1, shotNoiseThresh2.GetOutputPort()) - shotNoise.SetOperationToAdd() - - add = vtkImageMathematics() - add.SetInputData(0, inputImage) - add.SetInputConnection(1, shotNoise.GetOutputPort()) - add.SetOperationToAdd() - add.Update() - outputImage.DeepCopy(add.GetOutput()) --- - max_value = vtkImageMathematics() - max_value.SetInputData(0, blob_image) - max_value.SetInputData(1, thres.GetOutput()) - max_value.SetOperationToMax() - max_value.Modified() - max_value.Update() --- - max_value = vtkImageMathematics() - max_value.SetInputData(0, blob_image) - max_value.SetInputData(1, thres.GetOutput()) - max_value.SetOperationToMax() - max_value.Modified() - max_value.Update() diff --git a/data/examples/pp/vtkImageMedian3D b/data/examples/pp/vtkImageMedian3D deleted file mode 100644 index 540b8f8..0000000 --- a/data/examples/pp/vtkImageMedian3D +++ /dev/null @@ -1,13 +0,0 @@ - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) - - hybridMedian1 = vtkImageHybridMedian2D() - hybridMedian1.SetInputData(noisyData) --- - median = vtkImageMedian3D() - median.SetInputData(noisyData) - median.SetKernelSize(5, 5, 1) - - gaussian = vtkImageGaussianSmooth() - gaussian.SetDimensionality(2) diff --git a/data/examples/pp/vtkImageMirrorPad b/data/examples/pp/vtkImageMirrorPad deleted file mode 100644 index 8ab6814..0000000 --- a/data/examples/pp/vtkImageMirrorPad +++ /dev/null @@ -1,6 +0,0 @@ - mirrorPad = vtkImageMirrorPad() - mirrorPad.SetInputConnection(reader.GetOutputPort()) - mirrorPad.SetOutputWholeExtent(constantPad.GetOutputWholeExtent()) - - # Create actors - constantPadColor = vtkImageMapToWindowLevelColors() diff --git a/data/examples/pp/vtkImageNoiseSource b/data/examples/pp/vtkImageNoiseSource deleted file mode 100644 index c5544ba..0000000 --- a/data/examples/pp/vtkImageNoiseSource +++ /dev/null @@ -1,13 +0,0 @@ - shotNoiseSource = vtkImageNoiseSource() - shotNoiseSource.SetWholeExtent(extent) - shotNoiseSource.SetMinimum(0.0) - shotNoiseSource.SetMaximum(1.0) - - shotNoiseThresh1 = vtkImageThreshold() --- - shotNoiseSource = vtkImageNoiseSource() - shotNoiseSource.SetWholeExtent(extent) - shotNoiseSource.SetMinimum(0.0) - shotNoiseSource.SetMaximum(1.0) - - shotNoiseThresh1 = vtkImageThreshold() diff --git a/data/examples/pp/vtkImageNormalize b/data/examples/pp/vtkImageNormalize deleted file mode 100644 index c5352a2..0000000 --- a/data/examples/pp/vtkImageNormalize +++ /dev/null @@ -1,6 +0,0 @@ - normalizeFilter = vtkImageNormalize() - - normalizeFilter.SetInputConnection(source.GetOutputPort()) - normalizeFilter.Update() - - inputCastFilter = vtkImageCast() diff --git a/data/examples/pp/vtkImageRFFT b/data/examples/pp/vtkImageRFFT deleted file mode 100644 index 74a6592..0000000 --- a/data/examples/pp/vtkImageRFFT +++ /dev/null @@ -1,13 +0,0 @@ - idealRfft = vtkImageRFFT() - idealRfft.SetInputConnection(idealHighPass.GetOutputPort()) - - idealReal = vtkImageExtractComponents() - idealReal.SetInputConnection(idealRfft.GetOutputPort()) - idealReal.SetComponents(0) --- - butterworthRfft = vtkImageRFFT() - butterworthRfft.SetInputConnection(butterworthHighPass.GetOutputPort()) - - butterworthReal = vtkImageExtractComponents() - butterworthReal.SetInputConnection(butterworthRfft.GetOutputPort()) - butterworthReal.SetComponents(0) diff --git a/data/examples/pp/vtkImageReader2Factory b/data/examples/pp/vtkImageReader2Factory deleted file mode 100644 index d19f871..0000000 --- a/data/examples/pp/vtkImageReader2Factory +++ /dev/null @@ -1,230 +0,0 @@ - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - cast = vtkImageCast() --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Process the image. --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - fft = vtkImageFFT() --- - reader_factory = vtkImageReader2Factory() - reader = reader_factory.CreateImageReader2(file_name) - reader.SetFileName(file_name) - reader.Update() - - # Smoothed pipeline. --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - scalarRange = [0] * 2 --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Dilate --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - # Pipelines --- - readerFactory = vtkImageReader2Factory() - reader = readerFactory.CreateImageReader2(fileName) - reader.SetFileName(fileName) - reader.Update() - - fft = vtkImageFFT() --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn)) - img_reader.SetFileName(str(fn)) - - # Each image must be flipped in Y due to canvas - # versus vtk ordering. --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(fn_path)) - img_reader.SetFileName(str(fn_path)) - - texture.SetInputConnection(img_reader.GetOutputPort(0)) - --- - reader_factory = vtkImageReader2Factory() - img_reader = reader_factory.CreateImageReader2(str(image_path)) - img_reader.SetFileName(str(image_path)) - - texture = vtkTexture() - texture.InterpolateOn() --- - readerFactory = vtkImageReader2Factory() - textureFile = readerFactory.CreateImageReader2(fileName) - textureFile.SetFileName(fileName) - textureFile.Update() - - atext = vtkTexture() diff --git a/data/examples/pp/vtkImageSeedConnectivity b/data/examples/pp/vtkImageSeedConnectivity deleted file mode 100644 index 02ce587..0000000 --- a/data/examples/pp/vtkImageSeedConnectivity +++ /dev/null @@ -1,6 +0,0 @@ - con = vtkImageSeedConnectivity() - con.SetInputConnection(reader.GetOutputPort()) - con.AddSeed(300, 200) - con.SetInputConnectValue(0) - con.SetOutputConnectedValue(0) - con.SetOutputUnconnectedValue(255) diff --git a/data/examples/pp/vtkImageShiftScale b/data/examples/pp/vtkImageShiftScale deleted file mode 100644 index 2b92443..0000000 --- a/data/examples/pp/vtkImageShiftScale +++ /dev/null @@ -1,6 +0,0 @@ - m3 = vtkImageShiftScale() - m3.SetInputConnection(m2.GetOutputPort()) - m3.SetScale(0.000095) - - div = vtkImageMathematics() - div.SetInputConnection(0, smooth.GetOutputPort()) diff --git a/data/examples/pp/vtkImageShrink3D b/data/examples/pp/vtkImageShrink3D deleted file mode 100644 index d90f155..0000000 --- a/data/examples/pp/vtkImageShrink3D +++ /dev/null @@ -1,20 +0,0 @@ - subsample_smoothed = vtkImageShrink3D() - subsample_smoothed.SetInputConnection(smooth.GetOutputPort()) - subsample_smoothed.SetShrinkFactors(4, 4, 1) - - iso_smoothed = vtkImageMarchingCubes() - iso_smoothed.SetInputConnection(smooth.GetOutputPort()) --- - subsample = vtkImageShrink3D() - subsample.SetInputConnection(reader.GetOutputPort()) - subsample.SetShrinkFactors(4, 4, 1) - - iso = vtkImageMarchingCubes() - iso.SetInputConnection(subsample.GetOutputPort()) --- - shrinker = vtkImageShrink3D() - shrinker.SetInputConnection(last_connection.GetOutputPort()) - shrinker.SetShrinkFactors(sample_rate) - shrinker.AveragingOn() - last_connection = shrinker - diff --git a/data/examples/pp/vtkImageSinusoidSource b/data/examples/pp/vtkImageSinusoidSource deleted file mode 100644 index 5375520..0000000 --- a/data/examples/pp/vtkImageSinusoidSource +++ /dev/null @@ -1,13 +0,0 @@ - source = vtkImageSinusoidSource() - source.Update() - - normalizeFilter = vtkImageNormalize() - - normalizeFilter.SetInputConnection(source.GetOutputPort()) --- - source2 = vtkImageSinusoidSource() - source2.SetWholeExtent(0, 255, 0, 255, 0, 0) - source2.Update() - - # Do the sum - sumFilter = vtkImageWeightedSum() diff --git a/data/examples/pp/vtkImageStencil b/data/examples/pp/vtkImageStencil deleted file mode 100644 index 56345fb..0000000 --- a/data/examples/pp/vtkImageStencil +++ /dev/null @@ -1,27 +0,0 @@ - stencil = vtkImageStencil() - stencil.SetInputData(blank_image) - stencil.SetStencilConnection(dataToStencil.GetOutputPort()) - stencil.ReverseStencilOn() - stencil.SetBackgroundValue(255) - stencil.Update() --- - imgstenc = vtkImageStencil() - imgstenc.SetInputData(whiteImage) - imgstenc.SetStencilConnection(pol2stenc.GetOutputPort()) - imgstenc.ReverseStencilOff() - imgstenc.SetBackgroundValue(outval) - imgstenc.Update() --- - stencil = vtkImageStencil() - stencil.SetInputConnection(reader.GetOutputPort()) - stencil.SetStencilConnection(dataToStencil.GetOutputPort()) - stencil.ReverseStencilOn() - stencil.SetBackgroundValue(500) - --- - stencil2 = vtkImageStencil() - stencil2.SetInputConnection(reader2.GetOutputPort()) - stencil2.SetStencilConnection(dataToStencil2.GetOutputPort()) - stencil2.SetBackgroundValue(500) - - imageAppend = vtkImageAppend() diff --git a/data/examples/pp/vtkImageThreshold b/data/examples/pp/vtkImageThreshold deleted file mode 100644 index a45fec9..0000000 --- a/data/examples/pp/vtkImageThreshold +++ /dev/null @@ -1,58 +0,0 @@ - shotNoiseThresh1 = vtkImageThreshold() - shotNoiseThresh1.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh1.ThresholdByLower(1.0 - noiseFraction) - shotNoiseThresh1.SetInValue(0) - shotNoiseThresh1.SetOutValue(noiseAmplitude) - shotNoiseThresh2 = vtkImageThreshold() - shotNoiseThresh2.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh2.ThresholdByLower(noiseFraction) - shotNoiseThresh2.SetInValue(1.0 - noiseAmplitude) - shotNoiseThresh2.SetOutValue(0.0) - --- - shotNoiseThresh1 = vtkImageThreshold() - shotNoiseThresh1.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh1.ThresholdByLower(1.0 - noiseFraction) - shotNoiseThresh1.SetInValue(0) - shotNoiseThresh1.SetOutValue(noiseAmplitude) - shotNoiseThresh2 = vtkImageThreshold() - shotNoiseThresh2.SetInputConnection(shotNoiseSource.GetOutputPort()) - shotNoiseThresh2.ThresholdByLower(noiseFraction) - shotNoiseThresh2.SetInValue(1.0 - noiseAmplitude) - shotNoiseThresh2.SetOutValue(0.0) - --- - thres = vtkImageThreshold() - thres.SetInputConnection(sampler.GetOutputPort()) - thres.ThresholdByLower(radius * radius) - thres.ReplaceInOn() - thres.ReplaceOutOn() - thres.SetInValue(i + 1) --- - thres = vtkImageThreshold() - thres.SetInputConnection(sampler.GetOutputPort()) - thres.ThresholdByLower(radius * radius) - thres.ReplaceInOn() - thres.ReplaceOutOn() - thres.SetInValue(i + 1) --- - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(reader.GetOutputPort()) - --- - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(reader.GetOutputPort()) - --- - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue['tissue'], tissue['tissue']) - select_tissue.SetInValue(255) - select_tissue.SetOutValue(0) - select_tissue.SetInputConnection(last_connection.GetOutputPort()) - last_connection = select_tissue diff --git a/data/examples/pp/vtkImageViewer b/data/examples/pp/vtkImageViewer deleted file mode 100644 index 2910798..0000000 --- a/data/examples/pp/vtkImageViewer +++ /dev/null @@ -1,20 +0,0 @@ - image_viewer = vtkImageViewer() - image_viewer.SetInputData(reader.GetOutput()) - - image_viewer.SetColorWindow(1) - image_viewer.SetColorLevel(1) - image_viewer.SetPosition(0, 100) --- - viewer = vtkImageViewer() - interator = vtkRenderWindowInteractor() - viewer.SetInputConnection(imageAppend.GetOutputPort()) - viewer.SetupInteractor(interator) - viewer.SetZSlice(0) - viewer.SetColorWindow(2000) --- - viewer = vtkImageViewer() - viewer.SetInputConnection(rgb.GetOutputPort()) - viewer.SetZSlice(22) - viewer.SetColorWindow(255.0) - viewer.SetColorLevel(127.0) - viewer.GetRenderWindow().SetSize(512, 512) diff --git a/data/examples/pp/vtkImageViewer2 b/data/examples/pp/vtkImageViewer2 deleted file mode 100644 index 9ebb92e..0000000 --- a/data/examples/pp/vtkImageViewer2 +++ /dev/null @@ -1,13 +0,0 @@ - image_viewer = vtkImageViewer2() - image_viewer.SetInputConnection(reader.GetOutputPort()) - render_window_interactor = vtkRenderWindowInteractor() - image_viewer.SetupInteractor(render_window_interactor) - image_viewer.Render() - image_viewer.GetRenderer().SetBackground(colors.GetColor3d("SlateGray")) --- - image_viewer = vtkImageViewer2() - image_viewer.SetInputConnection(reader.GetOutputPort()) - # Slice status message - slice_text_prop = vtkTextProperty() - slice_text_prop.SetFontFamilyToCourier() - slice_text_prop.SetFontSize(20) diff --git a/data/examples/pp/vtkImageWeightedSum b/data/examples/pp/vtkImageWeightedSum deleted file mode 100644 index beabe72..0000000 --- a/data/examples/pp/vtkImageWeightedSum +++ /dev/null @@ -1,13 +0,0 @@ - sumFilter = vtkImageWeightedSum() - sumFilter.SetWeight(0, 0.8) - sumFilter.SetWeight(1, 0.2) - sumFilter.AddInputConnection(source1Double.GetOutputPort()) - sumFilter.AddInputConnection(source2.GetOutputPort()) - sumFilter.Update() --- - SumFilter = vtkImageWeightedSum() - for x in range(0, NumOfImages, 1): - SumFilter.AddInputConnection(ImageSets[x]) - SumFilter.SetWeight(x, Weights[x]) - SumFilter.Update() - diff --git a/data/examples/pp/vtkImageWrapPad b/data/examples/pp/vtkImageWrapPad deleted file mode 100644 index 4136fdd..0000000 --- a/data/examples/pp/vtkImageWrapPad +++ /dev/null @@ -1,6 +0,0 @@ - pad = vtkImageWrapPad() - pad.SetInputConnection(reader.GetOutputPort()) - pad.SetOutputWholeExtent(extent[0], extent[1] + 1, extent[2], extent[3] + 1, extent[4], extent[5] + 1) - pad.Update() - - # Copy the scalar point data of the volume into the scalar cell data diff --git a/data/examples/pp/vtkImagingColor b/data/examples/pp/vtkImagingColor deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingCore b/data/examples/pp/vtkImagingCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingFourier b/data/examples/pp/vtkImagingFourier deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingGeneral b/data/examples/pp/vtkImagingGeneral deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingHybrid b/data/examples/pp/vtkImagingHybrid deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingMath b/data/examples/pp/vtkImagingMath deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingMorphological b/data/examples/pp/vtkImagingMorphological deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingSources b/data/examples/pp/vtkImagingSources deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingStatistics b/data/examples/pp/vtkImagingStatistics deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImagingStencil b/data/examples/pp/vtkImagingStencil deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkImplicitBoolean b/data/examples/pp/vtkImplicitBoolean deleted file mode 100644 index 5f8378e..0000000 --- a/data/examples/pp/vtkImplicitBoolean +++ /dev/null @@ -1,34 +0,0 @@ - boolean = vtkImplicitBoolean() - boolean.SetOperationTypeToDifference() - # boolean.SetOperationTypeToUnion() - # boolean.SetOperationTypeToIntersection() - boolean.AddFunction(box) - boolean.AddFunction(sphere) --- - boolean = vtkImplicitBoolean() - boolean.AddFunction(cylinder) - boolean.AddFunction(sphere) - - clipper = vtkClipPolyData() - clipper.SetInputConnection(plane.GetOutputPort()) --- - booleanUnion = vtkImplicitBoolean() - booleanUnion.AddFunction(sphere) - booleanUnion.AddFunction(sphere2) - booleanUnion.SetOperationType(0) # boolean Union - - extract = vtkExtractGeometry() --- - theCone = vtkImplicitBoolean() - theCone.SetOperationTypeToIntersection() - theCone.AddFunction(cone) - theCone.AddFunction(vertPlane) - theCone.AddFunction(basePlane) - --- - theCream = vtkImplicitBoolean() - theCream.SetOperationTypeToDifference() - theCream.AddFunction(iceCream) - theCream.AddFunction(bite) - - # The sample function generates a distance function from the diff --git a/data/examples/pp/vtkImplicitDataSet b/data/examples/pp/vtkImplicitDataSet deleted file mode 100644 index 0a6e5de..0000000 --- a/data/examples/pp/vtkImplicitDataSet +++ /dev/null @@ -1,6 +0,0 @@ -implicit = vtk.vtkImplicitDataSet() -implicit.SetDataSet(elev.GetOutput()) - -clipper = vtk.vtkClipPolyData() -clipper.SetClipFunction(implicit) -clipper.SetInputConnection(sphere.GetOutputPort()) diff --git a/data/examples/pp/vtkImplicitModeller b/data/examples/pp/vtkImplicitModeller deleted file mode 100644 index fa08fca..0000000 --- a/data/examples/pp/vtkImplicitModeller +++ /dev/null @@ -1,27 +0,0 @@ - imp = vtkImplicitModeller() - imp.SetInputConnection(reader.GetOutputPort()) - imp.SetSampleDimensions(110, 40, 20) - imp.SetMaximumDistance(0.25) - imp.SetModelBounds(-1.0, 10.0, -1.0, 3.0, -1.0, 1.0) - --- - blobbyLogoImp = vtkImplicitModeller() - blobbyLogoImp.SetInputConnection(appendAll.GetOutputPort()) - blobbyLogoImp.SetMaximumDistance(.075) - blobbyLogoImp.SetSampleDimensions(64, 64, 64) - blobbyLogoImp.SetAdjustDistance(0.05) - --- - arrowIM = vtkImplicitModeller() - arrowIM.SetInputData(pd) - arrowIM.SetSampleDimensions(50, 20, 8) - - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) --- - arrowIM = vtkImplicitModeller() - arrowIM.SetInputData(pd) - arrowIM.SetSampleDimensions(50, 20, 8) - - arrowCF = vtkContourFilter() - arrowCF.SetInputConnection(arrowIM.GetOutputPort()) diff --git a/data/examples/pp/vtkImplicitPlaneRepresentation b/data/examples/pp/vtkImplicitPlaneRepresentation deleted file mode 100644 index d29f4d2..0000000 --- a/data/examples/pp/vtkImplicitPlaneRepresentation +++ /dev/null @@ -1,6 +0,0 @@ - rep = vtkImplicitPlaneRepresentation() - rep.SetPlaceFactor(1.25) # This must be set prior to placing the widget - rep.PlaceWidget(actor.GetBounds()) - rep.SetNormal(plane.GetNormal()) - - plane_widget = vtkImplicitPlaneWidget2() diff --git a/data/examples/pp/vtkImplicitPlaneWidget2 b/data/examples/pp/vtkImplicitPlaneWidget2 deleted file mode 100644 index 918ae03..0000000 --- a/data/examples/pp/vtkImplicitPlaneWidget2 +++ /dev/null @@ -1,6 +0,0 @@ - plane_widget = vtkImplicitPlaneWidget2() - plane_widget.SetInteractor(iren) - plane_widget.SetRepresentation(rep) - plane_widget.AddObserver(vtkCommand.InteractionEvent, my_callback) - - renderer.GetActiveCamera().Azimuth(-60) diff --git a/data/examples/pp/vtkImplicitPolyDataDistance b/data/examples/pp/vtkImplicitPolyDataDistance deleted file mode 100644 index c97c5d2..0000000 --- a/data/examples/pp/vtkImplicitPolyDataDistance +++ /dev/null @@ -1,20 +0,0 @@ - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(cone.GetOutput()) - - # create a grid - xCoords = vtkFloatArray() - for x, i in enumerate(np.linspace(-1.0, 1.0, 15)): --- - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(cone.GetOutput()) - - # create a grid - dimension = 51 - xCoords = vtkFloatArray() --- - implicitPolyDataDistance = vtkImplicitPolyDataDistance() - implicitPolyDataDistance.SetInput(sphereSource.GetOutput()) - - # Setup a grid - points = vtkPoints() - step = 0.1 diff --git a/data/examples/pp/vtkImplicitTextureCoords b/data/examples/pp/vtkImplicitTextureCoords deleted file mode 100644 index d0ff2ce..0000000 --- a/data/examples/pp/vtkImplicitTextureCoords +++ /dev/null @@ -1,13 +0,0 @@ - tcoords = vtkImplicitTextureCoords() - tcoords.SetInputConnection(aSphere.GetOutputPort()) - tcoords.SetRFunction(quadric1) - tcoords.SetSFunction(quadric2) - - aMapper = vtkDataSetMapper() --- - tcoords = vtkImplicitTextureCoords() - tcoords.SetInputConnection(sphere2.GetOutputPort()) - tcoords.SetRFunction(planes) - - outerMapper = vtkDataSetMapper() - outerMapper.SetInputConnection(tcoords.GetOutputPort()) diff --git a/data/examples/pp/vtkInfovisCore b/data/examples/pp/vtkInfovisCore deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInfovisLayout b/data/examples/pp/vtkInfovisLayout deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkIntArray b/data/examples/pp/vtkIntArray deleted file mode 100644 index 3add430..0000000 --- a/data/examples/pp/vtkIntArray +++ /dev/null @@ -1,55 +0,0 @@ - idArray = vtkIntArray() - idArray.SetNumberOfTuples(numCells) - for i in range(0, numCells): - idArray.InsertTuple1(i, i + 1) - idArray.SetName('Ids') - source.GetOutput().GetCellData().AddArray(idArray) --- - edgeColors = vtkIntArray() - edgeColors.SetNumberOfComponents(1) - edgeColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) --- - vertexIDs = vtkIntArray() - vertexIDs.SetNumberOfComponents(1) - vertexIDs.SetName('VertexIDs') - - # Set the vertex labels - vertexIDs.InsertNextValue(0) --- - vertexColors = vtkIntArray() - vertexColors.SetNumberOfComponents(1) - vertexColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(3) --- - vertexIDs = vtkIntArray() - vertexIDs.SetNumberOfComponents(1) - vertexIDs.SetName('VertexIDs') - - # Set the vertex labels - vertexIDs.InsertNextValue(0) --- - degree = vtkIntArray() - degree.SetNumberOfComponents(1) - degree.SetName('degree') - degree.SetNumberOfTuples(7) - degree.SetValue(0, 2) - degree.SetValue(1, 1) --- - vertexColors = vtkIntArray() - vertexColors.SetNumberOfComponents(1) - vertexColors.SetName('Color') - - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) --- - data = vtkIntArray() - data.SetNumberOfComponents(0) - data.SetName('Iteration Level') - - # This is the starting triangle. - t = vtkTriangle() diff --git a/data/examples/pp/vtkInteract b/data/examples/pp/vtkInteract deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInteractionImage b/data/examples/pp/vtkInteractionImage deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInteractionStyle b/data/examples/pp/vtkInteractionStyle deleted file mode 100644 index 21f337e..0000000 --- a/data/examples/pp/vtkInteractionStyle +++ /dev/null @@ -1,6 +0,0 @@ - additional_modules = ['vtkInteractionStyle', 'vtkRenderingFreeType', - 'vtkRenderingContextOpenGL2', 'vtkRenderingOpenGL2', 'vtkRenderingVolumeOpenGL2', - 'vtkRenderingUI'] - comments = [ - '', - '# You may need to uncomment one or more of the following imports.', diff --git a/data/examples/pp/vtkInteractionWidgets b/data/examples/pp/vtkInteractionWidgets deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInteractorStyle b/data/examples/pp/vtkInteractorStyle deleted file mode 100644 index fdf2c59..0000000 --- a/data/examples/pp/vtkInteractorStyle +++ /dev/null @@ -1,13 +0,0 @@ - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Unlike the previous scripts where we performed some operations and then - # exited, here we leave an event loop running. The user can use the mouse --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Here we use a vtkBoxWidget to transform the underlying coneActor (by - # manipulating its transformation matrix). Many other types of widgets diff --git a/data/examples/pp/vtkInteractorStyleImage b/data/examples/pp/vtkInteractorStyleImage deleted file mode 100644 index 086c15b..0000000 --- a/data/examples/pp/vtkInteractorStyleImage +++ /dev/null @@ -1,76 +0,0 @@ - style = vtkInteractorStyleImage() - renderWindowInteractor.SetInteractorStyle(style) - - renderWindow.SetWindowName('Glyph2D'); - renderWindow.Render() - renderWindowInteractor.Start() --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # Renderers share one camera. --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - idealRenderer.GetActiveCamera().Dolly(1.4) --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - renderWindowInteractor.SetRenderWindow(renderWindow) - - # The renderers share one camera. --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - constantPadRenderer.GetActiveCamera().Dolly(1.2) --- - style = vtkInteractorStyleImage() - - renderWindowInteractor.SetInteractorStyle(style) - - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindowInteractor.Initialize() --- - style = vtkInteractorStyleImage() - renderWindowInteractor.SetInteractorStyle(style) - - # Render and start interaction - renderWindowInteractor.SetRenderWindow(renderWindow) - renderWindow.Render() diff --git a/data/examples/pp/vtkInteractorStyleRubberBandPick b/data/examples/pp/vtkInteractorStyleRubberBandPick deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInteractorStyleSwitch b/data/examples/pp/vtkInteractorStyleSwitch deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkInteractorStyleTrackballActor b/data/examples/pp/vtkInteractorStyleTrackballActor deleted file mode 100644 index a04a784..0000000 --- a/data/examples/pp/vtkInteractorStyleTrackballActor +++ /dev/null @@ -1,6 +0,0 @@ - style = vtkInteractorStyleTrackballActor() - iren.SetInteractorStyle(style) - - # create source - sphereSource = vtkSphereSource() - diff --git a/data/examples/pp/vtkInteractorStyleTrackballCamera b/data/examples/pp/vtkInteractorStyleTrackballCamera deleted file mode 100644 index bd9b2d5..0000000 --- a/data/examples/pp/vtkInteractorStyleTrackballCamera +++ /dev/null @@ -1,258 +0,0 @@ - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Add the actors to the renderer. - renderer.AddActor(axesActor) - renderer.AddActor(textActor) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = vtkCamera() - camera.SetPosition(0, 1, 0) - camera.SetFocalPoint(0, 0, 0) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # create source - src = vtkPointSource() - src.SetCenter(0, 0, 0) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer.AddActor(actor) - renderer.AddActor(scalar_bar) - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer.AddActor(actor) - renderer.AddActor(scalar_bar) - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) --- - i_style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(i_style) - - iren.Start() - - --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # Create a common text property. - text_property = vtkTextProperty() - text_property.SetFontSize(24) --- - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - render_window.Render() - - interactor.Start() --- -style = vtk.vtkInteractorStyleTrackballCamera() -interactor.SetInteractorStyle(style) - -renderer.AddVolume(volume) - -scalarBar = vtk.vtkScalarBarActor() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - iren.Initialize() - iren.UpdateSize(ren_width * 2, ren_height * 2) - --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # Define the renderers and allocate them to layers. - for i in range(0, 2): - renderers.append(vtkRenderer()) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - skybox = vtkOpenGLSkybox() - - irradiance = ren.GetEnvMapIrradiance() --- - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() --- - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() --- - style = vtkInteractorStyleTrackballCamera() - interactor.SetInteractorStyle(style) - - # Set up tone mapping, so we can vary the exposure. - # Custom Passes. - camera_p = vtkCameraPass() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Unlike the previous scripts where we performed some operations and then - # exited, here we leave an event loop running. The user can use the mouse --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - # - # Here we use a vtkBoxWidget to transform the underlying coneActor (by - # manipulating its transformation matrix). Many other types of widgets --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ctf = list() - ctf.append(get_ctf(False)) - ctf.append(rescale_ctf(ctf[0], 0, 1, False)) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - camera = ren.GetActiveCamera() - camera.SetRoll(15) - camera.Elevation(-15) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren.AddActor(actor) - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - --- - istyle = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(istyle) - iren.SetRenderWindow(renWin) - ren.ResetCamera() - renWin.Render() - iren.Start() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren_win.AddRenderer(ren) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - ren_win.AddRenderer(ren) - # Important: The interactor must be set prior to enabling the widget. - iren.SetRenderWindow(ren_win) --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - color_size = len(max(parameters['colors'].values(), key=len)) - name_size = len(max(parameters['names'], key=len)) - int_size = 2 --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - sliders = dict() - left_step_size = 1.0 / 9 - left_pos_y = 0.275 --- - istyle = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(istyle) - iren.SetRenderWindow(renWin) - ren.ResetCamera() - renWin.Render() - iren.Start() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - renWin.GetInteractor().SetInteractorStyle(style) - - ren1.ResetCamera() - renWin.Render() --- - style = vtkInteractorStyleTrackballCamera() - iren.SetInteractorStyle(style) - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('ParaViewBkg')) - diff --git a/data/examples/pp/vtkIterativeClosestPointTransform b/data/examples/pp/vtkIterativeClosestPointTransform deleted file mode 100644 index 26f4b3b..0000000 --- a/data/examples/pp/vtkIterativeClosestPointTransform +++ /dev/null @@ -1,13 +0,0 @@ - icp = vtkIterativeClosestPointTransform() - icp.SetSource(source) - icp.SetTarget(target) - icp.GetLandmarkTransform().SetModeToRigidBody() - # icp.DebugOn() - icp.SetMaximumNumberOfIterations(20) --- - icp = vtkIterativeClosestPointTransform() - icp.SetSource(source_polydata) - icp.SetTarget(tpd.GetOutput()) - icp.GetLandmarkTransform().SetModeToRigidBody() - icp.SetMaximumNumberOfLandmarks(100) - icp.SetMaximumMeanDistance(.00001) diff --git a/data/examples/pp/vtkJPEGReader b/data/examples/pp/vtkJPEGReader deleted file mode 100644 index 48b8671..0000000 --- a/data/examples/pp/vtkJPEGReader +++ /dev/null @@ -1,13 +0,0 @@ - jpeg_reader = vtkJPEGReader() - if not jpeg_reader.CanReadFile(fn): - print('Error reading file:', fn) - return - - jpeg_reader.SetFileName(fn) --- - reader = vtkJPEGReader() - reader.SetFileName(jpegfile) - - # Create texture object - texture = vtkTexture() - texture.SetInputConnection(reader.GetOutputPort()) diff --git a/data/examples/pp/vtkJPEGWriter b/data/examples/pp/vtkJPEGWriter deleted file mode 100644 index c08f5e7..0000000 --- a/data/examples/pp/vtkJPEGWriter +++ /dev/null @@ -1,34 +0,0 @@ - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': - if rgba: - rgba = False --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() --- - writer = vtkJPEGWriter() - else: - writer = vtkPNGWriter() - writer.SetFileName(self.path) - writer.SetInputData(w2if.GetOutput()) - writer.Write() --- - writer = vtkJPEGWriter() - elif ext == '.pnm': - writer = vtkPNMWriter() - elif ext == '.ps': - if rgba: - rgba = False diff --git a/data/examples/pp/vtkLODActor b/data/examples/pp/vtkLODActor deleted file mode 100644 index 18a28c5..0000000 --- a/data/examples/pp/vtkLODActor +++ /dev/null @@ -1,125 +0,0 @@ - actor = vtkLODActor() - actor.SetNumberOfCloudPoints(100000) - actor.SetMapper(mapper) - - # Create the renderer. - ren = vtkRenderer() --- - camActor = vtkLODActor() - camActor.SetMapper(camMapper) - camActor.SetScale(2, 2, 2) - - # Draw the arrows. - pd = vtkPolyData() --- - a1Actor = vtkLODActor() - a1Actor.SetMapper(arrowMapper) - a1Actor.RotateZ(180) - a1Actor.SetPosition(1, 0, -1) - a1Actor.GetProperty().SetColor(colors.GetColor3d('AzimuthArrowColor')) - a1Actor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) --- - a2Actor = vtkLODActor() - a2Actor.SetMapper(arrowMapper) - a2Actor.RotateZ(180) - a2Actor.RotateX(180) - a2Actor.SetPosition(1, 0, 1) - a2Actor.GetProperty().SetColor(colors.GetColor3d('AzimuthArrowColor')) --- - a3Actor = vtkLODActor() - a3Actor.SetMapper(arrowMapper) - a3Actor.RotateZ(180) - a3Actor.RotateX(90) - a3Actor.SetPosition(1, -1, 0) - a3Actor.GetProperty().SetColor(colors.GetColor3d('ElevationArrowColor')) --- - a4Actor = vtkLODActor() - a4Actor.SetMapper(arrowMapper) - a4Actor.RotateZ(180) - a4Actor.RotateX(-90) - a4Actor.SetPosition(1, 1, 0) - a4Actor.GetProperty().SetColor(colors.GetColor3d('ElevationArrowColor')) --- - a5Actor = vtkLODActor() - a5Actor.SetMapper(spikeMapper) - a5Actor.SetScale(.3, .3, .6) - a5Actor.RotateY(90) - a5Actor.SetPosition(-2, 0, 0) - a5Actor.GetProperty().SetColor(colors.GetColor3d('SpikeColor')) --- - fpActor = vtkLODActor() - fpActor.SetMapper(fpMapper) - fpActor.SetPosition(-9, 0, 0) - fpActor.GetProperty().SetSpecularColor(colors.GetColor3d('White')) - fpActor.GetProperty().SetSpecular(0.3) - fpActor.GetProperty().SetAmbient(0.2) --- - a6Actor = vtkLODActor() - a6Actor.SetMapper(arrowMapper2) - a6Actor.RotateZ(90) - a6Actor.SetPosition(-4, 0, 0) - a6Actor.SetScale(1.5, 1.5, 1.5) - a6Actor.GetProperty().SetColor(colors.GetColor3d('RollArrowColor')) --- - camActor = vtkLODActor() - camActor.SetMapper(camMapper) - camActor.SetScale(2, 2, 2) - - # Draw the arrows. - pd = vtkPolyData() --- - a1Actor = vtkLODActor() - a1Actor.SetMapper(arrowMapper) - a1Actor.SetPosition(-9, 0, -1) - a1Actor.GetProperty().SetColor(colors.GetColor3d("AzimuthArrowColor")) - a1Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - a1Actor.GetProperty().SetSpecular(0.3) --- - a2Actor = vtkLODActor() - a2Actor.SetMapper(arrowMapper) - a2Actor.RotateX(180) - a2Actor.SetPosition(-9, 0, 1) - a2Actor.GetProperty().SetColor(colors.GetColor3d("AzimuthArrowColor")) - a2Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) --- - a3Actor = vtkLODActor() - a3Actor.SetMapper(arrowMapper) - a3Actor.RotateX(-90) - a3Actor.SetPosition(-9, -1, 0) - a3Actor.GetProperty().SetColor(colors.GetColor3d("ElevationArrowColor")) - a3Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) --- - a4Actor = vtkLODActor() - a4Actor.SetMapper(arrowMapper) - a4Actor.RotateX(90) - a4Actor.SetPosition(-9, 1, 0) - a4Actor.GetProperty().SetColor(colors.GetColor3d("ElevationArrowColor")) - a4Actor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) --- - a5Actor = vtkLODActor() - a5Actor.SetMapper(spikeMapper) - a5Actor.SetScale(0.3, 0.3, 0.6) - a5Actor.RotateY(-90) - a5Actor.SetPosition(-8, 0, 0) - a5Actor.GetProperty().SetColor(colors.GetColor3d("SpikeColor")) --- - a7Actor = vtkLODActor() - a7Actor.SetMapper(spikeMapper) - a7Actor.SetScale(0.2, 0.2, 0.7) - a7Actor.RotateZ(90) - a7Actor.RotateY(-90) - a7Actor.SetPosition(-9, 1, 0) --- - fpActor = vtkLODActor() - fpActor.SetMapper(fpMapper) - fpActor.SetPosition(-9, 0, 0) - fpActor.GetProperty().SetSpecularColor(colors.GetColor3d("White")) - fpActor.GetProperty().SetSpecular(0.3) - fpActor.GetProperty().SetAmbient(0.2) --- - a6Actor = vtkLODActor() - a6Actor.SetMapper(arrowMapper2) - a6Actor.RotateZ(90) - a6Actor.SetPosition(-4, 0, 0) - a6Actor.SetScale(1.5, 1.5, 1.5) - a6Actor.GetProperty().SetColor(colors.GetColor3d("RollArrowColor")) diff --git a/data/examples/pp/vtkLabeledDataMapper b/data/examples/pp/vtkLabeledDataMapper deleted file mode 100644 index 33824f7..0000000 --- a/data/examples/pp/vtkLabeledDataMapper +++ /dev/null @@ -1,20 +0,0 @@ - label_mapper = vtkLabeledDataMapper() - label_mapper.SetInputData(cells[key][0]) - label_mapper.SetLabelTextProperty(label_property) - - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) --- - label_mapper = vtkLabeledDataMapper() - label_mapper.SetInputData(cells[key][0]) - label_mapper.SetLabelTextProperty(label_property) - - label_actor = vtkActor2D() - label_actor.SetMapper(label_mapper) --- - labelMapper = vtkLabeledDataMapper() - labelMapper.SetInputConnection(reader.GetOutputPort()) - labelActor = vtkActor2D() - labelActor.SetMapper(labelMapper) - - # The geometry diff --git a/data/examples/pp/vtkLandmarkTransform b/data/examples/pp/vtkLandmarkTransform deleted file mode 100644 index 4094ae7..0000000 --- a/data/examples/pp/vtkLandmarkTransform +++ /dev/null @@ -1,13 +0,0 @@ - lm_transform = vtkLandmarkTransform() - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - best_distance = VTK_DOUBLE_MAX - best_points = vtkPoints() - best_distance = best_bounding_box( --- - lm_transform = vtkLandmarkTransform() - lm_transform_pd = vtkTransformPolyDataFilter() - - lm_transform.SetModeToSimilarity() - lm_transform.SetTargetLandmarks(target_landmarks.GetPoints()) - diff --git a/data/examples/pp/vtkLight b/data/examples/pp/vtkLight deleted file mode 100644 index b31709c..0000000 --- a/data/examples/pp/vtkLight +++ /dev/null @@ -1,74 +0,0 @@ - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. --- - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. --- - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - --- - light = vtkLight() - light.SetPosition(2.0, 0.0, 2.0) - light.SetFocalPoint(0.0, 0.0, 0.0) - - ren.AddLight(light) - --- - light1 = vtkLight() - light1.SetFocalPoint(0, 0, 0) - light1.SetPosition(0, 1, 0.2) - light1.SetColor(colors.GetColor3d('HighNoonSun')) - light1.SetIntensity(0.3) - renderer.AddLight(light1) --- - light2 = vtkLight() - light2.SetFocalPoint(0, 0, 0) - light2.SetPosition(1.0, 1.0, 1.0) - light2.SetColor(colors.GetColor3d('100W Tungsten')) - light2.SetIntensity(0.8) - renderer.AddLight(light2) --- - light = vtkLight() - light.SetFocalPoint(1.875, 0.6125, 0) - light.SetPosition(0.875, 1.6125, 1) - ren.AddLight(light) - - # We want to eliminate perspective effects on the apparent lighting. --- - l1 = vtkLight() - l1.SetPosition(-4.0, 4.0, -1.0) - l1.SetFocalPoint(box_actor.GetPosition()) - l1.SetColor(colors.GetColor3d('White')) - l1.PositionalOn() - renderer.AddLight(l1) --- - l2 = vtkLight() - l2.SetPosition(4.0, 5.0, 1.0) - l2.SetFocalPoint(sphere_actor.GetPosition()) - l2.SetColor(colors.GetColor3d('Magenta')) - l2.PositionalOn() - renderer.AddLight(l2) --- - la = vtkLightActor() - la.SetLight(l1) - renderer.AddViewProp(la) - angle = l2.GetConeAngle() - if l2.LightTypeIsSceneLight() and l2.GetPositional() and angle < 180.0: # spotlight - la = vtkLightActor() - la.SetLight(l2) - renderer.AddViewProp(la) - - renderer.SetBackground2(colors.GetColor3d('Black')) - renderer.SetBackground(colors.GetColor3d('Silver')) diff --git a/data/examples/pp/vtkLightActor b/data/examples/pp/vtkLightActor deleted file mode 100644 index e1c8dba..0000000 --- a/data/examples/pp/vtkLightActor +++ /dev/null @@ -1,11 +0,0 @@ - la = vtkLightActor() - la.SetLight(l1) - renderer.AddViewProp(la) - angle = l2.GetConeAngle() - if l2.LightTypeIsSceneLight() and l2.GetPositional() and angle < 180.0: # spotlight - la = vtkLightActor() - la.SetLight(l2) - renderer.AddViewProp(la) - - renderer.SetBackground2(colors.GetColor3d('Black')) - renderer.SetBackground(colors.GetColor3d('Silver')) diff --git a/data/examples/pp/vtkLightKit b/data/examples/pp/vtkLightKit deleted file mode 100644 index fd28be9..0000000 --- a/data/examples/pp/vtkLightKit +++ /dev/null @@ -1,13 +0,0 @@ - light_kit = vtkLightKit() - light_kit.AddLightsToRenderer(renderer) - - renderer.AddActor(text_actor) - renderer.AddActor(actor) - renderer.AddActor(label_actor) --- - light_kit = vtkLightKit() - light_kit.AddLightsToRenderer(renderer) - - renderer.AddActor(text_actor) - renderer.AddActor(actor) - renderer.AddActor(label_actor) diff --git a/data/examples/pp/vtkLightsPass b/data/examples/pp/vtkLightsPass deleted file mode 100644 index d571c0b..0000000 --- a/data/examples/pp/vtkLightsPass +++ /dev/null @@ -1,20 +0,0 @@ - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) --- - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) --- - lights = vtkLightsPass() - overlay = vtkOverlayPass() - - passes = vtkRenderPassCollection() - passes.AddItem(lights) - passes.AddItem(opaque) diff --git a/data/examples/pp/vtkLine b/data/examples/pp/vtkLine deleted file mode 100644 index e51c894..0000000 --- a/data/examples/pp/vtkLine +++ /dev/null @@ -1,58 +0,0 @@ - line0 = vtkLine() - line0.GetPointIds().SetId(0, 0) # the second 0 is the index of the Origin in linesPolyData's points - line0.GetPointIds().SetId(1, 1) # the second 1 is the index of P0 in linesPolyData's points - - # Create the second line (between Origin and P1) - line1 = vtkLine() - line1.GetPointIds().SetId(0, 0) # the second 0 is the index of the Origin in linesPolyData's points - line1.GetPointIds().SetId(1, 2) # 2 is the index of P1 in linesPolyData's points - - # Create a vtkCellArray container and store the lines in it - lines = vtkCellArray() --- - line = vtkLine() - for i in range(0, number_of_vertices): - line.GetPointIds().SetId(i, i) - - ug = vtkUnstructuredGrid() - ug.SetPoints(points) --- - line = vtkLine() - line.GetPointIds().SetId(0, i) - line.GetPointIds().SetId(1, i + 1) - lines.InsertNextCell(line) - - # Create a polydata to store everything in --- - line = vtkLine() - line.GetPointIds().SetId(0, pt_id) - line.GetPointIds().SetId(1, pt_id + 1) - lines.InsertNextCell(line) - - polydata = vtkPolyData() --- - line = vtkLine() - line.GetPointIds().SetId(0, i) - line.GetPointIds().SetId(1, i + 1) - lines.InsertNextCell(line) - - # Create a polydata to store everything in. --- - line1 = vtkLine() - line1.GetPointIds().SetId(0, 0) - line1.GetPointIds().SetId(1, 1) - - # Create line2 - line2 = vtkLine() - line2.GetPointIds().SetId(0, 2) - line2.GetPointIds().SetId(1, 3) - - # Create a cellArray containing the lines - lines = vtkCellArray() --- - line = vtkLine() - line.GetPointIds().SetId(0, 0) - line.GetPointIds().SetId(1, 1) - lines.InsertNextCell(line) - line.GetPointIds().SetId(0, 1) - line.GetPointIds().SetId(1, 2) diff --git a/data/examples/pp/vtkLineSource b/data/examples/pp/vtkLineSource deleted file mode 100644 index e8173a7..0000000 --- a/data/examples/pp/vtkLineSource +++ /dev/null @@ -1,48 +0,0 @@ - lineSource = vtkLineSource() - lineSource.SetPoint1(0.0, 0.0, 0.0) - lineSource.SetPoint2(0.0, 1.0, 0.0) - lineSource.SetResolution(20) - lineSource.Update() - --- - lineSource = vtkLineSource() - lineSource.SetPoint1(p0) - lineSource.SetPoint2(p1) - - # Visualize - colors = vtkNamedColors() --- - lineSource = vtkLineSource() - lineSource.SetPoint1(1.0, 0.0, 0.0) - lineSource.SetPoint2(.0, 1.0, 0.0) - - # Setup actor and mapper - lineMapper = vtkPolyDataMapper() --- - lines = vtkLineSource() - # Create two points, P0 and P1 - p0 = [1.0, 0.0, 0.0] - p1 = [5.0, 0.0, 0.0] - - lines.SetResolution(11) --- - line = vtkLineSource() - line.SetResolution(1) - - lines = vtkGlyph3D() - lines.SetInputConnection(threshold.GetOutputPort()) - lines.SetSourceConnection(line.GetOutputPort()) --- - line1 = vtkLineSource() - line1.SetResolution(25) - line1.SetPoint1(-6.36, 0.25, 0.06) - line1.SetPoint2(-6.36, 0.25, 5.37) - - rakeMapper = vtkPolyDataMapper() --- - line = vtkLineSource() - line.SetResolution(39) - line.SetPoint1(0.08, 2.50, 0.71) - line.SetPoint2(0.08, 4.50, 0.71) - rakeMapper = vtkPolyDataMapper() - rakeMapper.SetInputConnection(line.GetOutputPort()) diff --git a/data/examples/pp/vtkLineWidget b/data/examples/pp/vtkLineWidget deleted file mode 100644 index f6a7ffc..0000000 --- a/data/examples/pp/vtkLineWidget +++ /dev/null @@ -1,13 +0,0 @@ - lineWidget = vtkLineWidget() - lineWidget.SetResolution(numOfStreamLines) - lineWidget.SetInputData(pl3d_output) - lineWidget.GetPolyData(seeds) - if illustration: - lineWidget.SetAlignToNone() --- - lineWidget2 = vtkLineWidget() - lineWidget2.SetResolution(numOfStreamLines) - lineWidget2.SetInputData(pl3d_output) - lineWidget2.GetPolyData(seeds2) - lineWidget2.SetKeyPressActivationValue('L') - lineWidget2.SetAlignToZAxis() diff --git a/data/examples/pp/vtkLinearExtrusionFilter b/data/examples/pp/vtkLinearExtrusionFilter deleted file mode 100644 index 74253d4..0000000 --- a/data/examples/pp/vtkLinearExtrusionFilter +++ /dev/null @@ -1,27 +0,0 @@ - extrude = vtkLinearExtrusionFilter() - extrude.SetInputData(polyData) - extrude.SetExtrusionTypeToNormalExtrusion() - extrude.SetVector(nx, ny, nz) - extrude.Update() - --- - extrude = vtkLinearExtrusionFilter() - extrude.SetInputData(polyData) - extrude.SetExtrusionTypeToNormalExtrusion() - extrude.SetVector(0, 0, 100.0) - extrude.Update() - --- - extruder = vtkLinearExtrusionFilter() - extruder.SetInputData(circle) - extruder.SetScaleFactor(1.0) - # extruder.SetExtrusionTypeToNormalExtrusion() - extruder.SetExtrusionTypeToVectorExtrusion() - extruder.SetVector(0, 0, 1) --- - Extrude = vtkLinearExtrusionFilter() - Extrude.SetInputConnection(RibbonFilter.GetOutputPort()) - Extrude.SetVector(0, 1, 0) - Extrude.SetExtrusionType(1) - Extrude.SetScaleFactor(0.7) - diff --git a/data/examples/pp/vtkLinearSubdivisionFilter b/data/examples/pp/vtkLinearSubdivisionFilter deleted file mode 100644 index f4d6d9f..0000000 --- a/data/examples/pp/vtkLinearSubdivisionFilter +++ /dev/null @@ -1,55 +0,0 @@ - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - # Now the tangents. - tangents = vtkPolyDataTangents() - tangents.SetInputConnection(subdivide.GetOutputPort()) --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(3) - - # Now the tangents. - tangents = vtkPolyDataTangents() --- - subdivide = vtkLinearSubdivisionFilter() - subdivide.SetInputConnection(triangulation.GetOutputPort()) - subdivide.SetNumberOfSubdivisions(5) - - clip_plane = vtkPlane() - clip_plane.SetOrigin(0, 0.3, 0) --- - linear = vtkLinearSubdivisionFilter() - linear.SetInputConnection(src.GetOutputPort()) - linear.SetNumberOfSubdivisions(3) - linear.Update() - - lut = MakeLUT(scalarRange) diff --git a/data/examples/pp/vtkLogLookupTable b/data/examples/pp/vtkLogLookupTable deleted file mode 100644 index 6478fd6..0000000 --- a/data/examples/pp/vtkLogLookupTable +++ /dev/null @@ -1,6 +0,0 @@ - lut = vtkLogLookupTable() - lut.SetHueRange(.6667, 0.0) - - s1Mapper = vtkPolyDataMapper() - s1Mapper.SetInputConnection(s1.GetOutputPort()) - s1Mapper.SetLookupTable(lut) diff --git a/data/examples/pp/vtkLookUp b/data/examples/pp/vtkLookUp deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkLookupTable b/data/examples/pp/vtkLookupTable deleted file mode 100644 index ceae55a..0000000 --- a/data/examples/pp/vtkLookupTable +++ /dev/null @@ -1,490 +0,0 @@ - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - - colorSeries = vtkColorSeries() - seriesEnum = colorSeries.BREWER_QUALITATIVE_SET3 - colorSeries.SetColorScheme(seriesEnum) - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(20) - lut.SetTableRange(0.0, 19.0) - lut.Build() - lut.SetTableValue(0, 0.1, 0.1, 0.1) - lut.SetTableValue(1, 0, 0, 1) --- - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) - lookupTable.SetTableValue(0, colors.GetColor4d('Red')) - lookupTable.SetTableValue(1, colors.GetColor4d('Lime')) - lookupTable.Build() - --- - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(3) - lookupTable.SetTableValue(0, colors.GetColor4d('Red')) - lookupTable.SetTableValue(1, colors.GetColor4d('White')) - lookupTable.SetTableValue(2, colors.GetColor4d('Lime')) - lookupTable.Build() --- - lookupTable = vtkLookupTable() - lookupTable.SetNumberOfTableValues(2) - lookupTable.SetTableValue(0, colors.GetColor4d('Yellow')) - lookupTable.SetTableValue(1, colors.GetColor4d('Lime')) - lookupTable.Build() - --- - lut = vtkLookupTable() - lut.SetTableRange(0, 256) - lut.SetHueRange(0.1, 0.1) - lut.SetSaturationRange(1.0, 0.1) - lut.SetValueRange(0.4, 1.0) - lut.Build() --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - categoricalLut = vtkLookupTable() - originalLut = reader.GetOutput().GetCellData().GetScalars().GetLookupTable() - - categoricalLut.DeepCopy(originalLut) - categoricalLut.IndexedLookupOn() - --- - bw_lut = vtkLookupTable() - bw_lut.SetTableRange(0, 2000) - bw_lut.SetSaturationRange(0, 0) - bw_lut.SetHueRange(0, 0) - bw_lut.SetValueRange(0, 1) - bw_lut.Build() # effective built --- - hue_lut = vtkLookupTable() - hue_lut.SetTableRange(0, 2000) - hue_lut.SetHueRange(0, 1) - hue_lut.SetSaturationRange(1, 1) - hue_lut.SetValueRange(1, 1) - hue_lut.Build() # effective built --- - sat_lut = vtkLookupTable() - sat_lut.SetTableRange(0, 2000) - sat_lut.SetHueRange(0.6, 0.6) - sat_lut.SetSaturationRange(0, 1) - sat_lut.SetValueRange(1, 1) - sat_lut.Build() # effective built --- - bw_lut = vtkLookupTable() - bw_lut.SetTableRange(0, 2048) - bw_lut.SetSaturationRange(0, 0) - bw_lut.SetHueRange(0, 0) - bw_lut.SetValueRange(0.2, 1) - bw_lut.Build() --- - colorLookupTable = vtkLookupTable() - colorLookupTable.SetTableRange(minz, maxz) - colorLookupTable.Build() - - # Generate the colors for each point based on the color map - colors = vtkUnsignedCharArray() --- - lut = vtkLookupTable() - lut.SetNumberOfColors(n) - lut.SetTableRange(0, n - 1) - lut.SetScaleToLinear() - lut.Build() - lut.SetTableValue(0, 0, 0, 0, 1) --- - lut = vtkLookupTable() - lut.SetNumberOfColors(n) - lut.SetTableRange(0, n - 1) - lut.SetScaleToLinear() - lut.Build() - lut.SetTableValue(0, 0, 0, 0, 1) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lut = vtkLookupTable() - - planeMapper = vtkPolyDataMapper() - planeMapper.SetLookupTable(lut) - planeMapper.SetInputConnection(plane.GetOutputPort()) - planeMapper.SetScalarRange(pl3dOutput.GetScalarRange()) --- - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0) - lut.SetSaturationRange(1, 1) - lut.SetValueRange(1, 1) - - mapper = vtkDataSetMapper() --- - lut1 = vtkLookupTable() - lut2 = vtkLookupTable() - colorSeries = vtkColorSeries() - colorSeriesEnum = colorSeries.SPECTRUM - colorSeries.SetColorScheme(colorSeriesEnum) - - colorSeries.BuildLookupTable(lut1) --- - lut3 = vtkLookupTable() - colorSeries.BuildLookupTable(lut3) - lut3.IndexedLookupOff() - res &= TestTables(lut1, lut3, False) - - # One indexed, the other ordinal. --- - lut3 = vtkLookupTable() - colorSeries.BuildLookupTable(lut3) - values = vtkVariantArray() - str = "abcdefghijklmnopqrstuvwxyz" - for i in range(lut3.GetNumberOfTableValues()): - values.InsertNextValue(vtkVariant(str[i])) --- - lut = vtkLookupTable() - lut.SetHueRange(.667, 0.0) - lut.Build() - - scalarRange = [0] * 2 - cones.Update() --- - lut = vtkLookupTable() - lut.SetHueRange(.667, 0.0) - lut.Build() - - streamerMapper = vtkPolyDataMapper() - streamerMapper.SetInputConnection(tubes.GetOutputPort()) --- - lut = vtkLookupTable() - MakeLUT(color_scheme, lut) - - plateMapper = vtkDataSetMapper() - plateMapper.SetInputConnection(color.GetOutputPort()) - plateMapper.SetLookupTable(lut) --- - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - # Computational planes. - floorComp = vtkStructuredGridGeometryFilter() - floorComp.SetExtent(0, 37, 0, 75, 0, 0) --- - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - # Computational planes. - floorComp = vtkStructuredGridGeometryFilter() - floorComp.SetExtent(0, 37, 0, 75, 0, 0) --- - lut = vtkLookupTable() - lut.SetHueRange(0.667, 0.0) - - seeds = [[-0.74, 0.0, 0.3], [-0.74, 0.0, 1.0], [-0.74, 0.0, 2.0], [-0.74, 0.0, 3.0]] - - renderers = list() --- - lut = vtkLookupTable() - MakeLogLUT(lut) - # lut.SetHueRange(.6667, 0.0) - tensorAxesMapper = vtkPolyDataMapper() - tensorAxesMapper.SetInputConnection(tensorAxes.GetOutputPort()) - tensorAxesMapper.SetLookupTable(lut) --- - lut = vtkLookupTable() - MakeLogLUT(lut) - # lut.SetHueRange(.6667, 0.0) - tensorEllipsoidsMapper = vtkPolyDataMapper() - tensorEllipsoidsMapper.SetInputConnection(ellipNormals.GetOutputPort()) - tensorEllipsoidsMapper.SetLookupTable(lut) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(tableSize) - lut.Build() - - # Fill in a few known colors, the rest will be generated if needed - lut.SetTableValue(0, nc.GetColor4d("Black")) --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(tableSize) - lut.Build() - - for i in range(0, tableSize): - rgb = list(ctf.GetColor(float(i) / tableSize)) + [1] --- - lut = vtkLookupTable() - lut.SetHueRange(0.0, 0.66667) - - for i in range(0, 10): - # Create the reader and warp the data vith vectors. - reader.append(vtkDataSetReader()) --- - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, vtkColorSeries.ORDINAL) - - coneMapper = vtkPolyDataMapper() - coneMapper.SetInputConnection(bandedContours.GetOutputPort()) - coneMapper.SetScalarRange(elevation.GetScalarRange()) --- - lut = vtkLookupTable() - # lut.SetHueRange(.667, 0.0) - lut.Build() - - hhogMapper = vtkPolyDataMapper() - hhogMapper.SetInputConnection(hhog.GetOutputPort()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - if size == 0: - lut.SetNumberOfTableValues(numberOfColors) - else: - lut.SetNumberOfTableValues(size) - lut.SetTableRange(0, lut.GetNumberOfTableValues()) --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.CATEGORICAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.ORDINAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lutr = vtkLookupTable() - lutr.DeepCopy(lut) - t = lut.GetNumberOfTableValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - rgba = [0.0] * 3 --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.CATEGORICAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - color_series.BuildLookupTable(lut, color_series.ORDINAL) - lut.SetNanColor(0, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(table_size) - lut.Build() - - for i in range(0, table_size): - rgba = list(ctf.GetColor(float(i) / table_size)) --- - lutr = vtkLookupTable() - lutr.DeepCopy(lut) - t = lut.GetNumberOfTableValues() - 1 - rev_range = reversed(list(range(t + 1))) - for i in rev_range: - rgba = [0.0] * 3 --- - lut = vtkLookupTable() - lut.SetNumberOfColors(16) - lut.SetTableRange(0, 15) - lut.Build() - - lut.SetTableValue(0, colors.GetColor4d('Black')) --- - lut = vtkLookupTable() - lut.SetNumberOfColors(len(colors)) - lut.SetTableRange(0, len(colors) - 1) - lut.Build() - - nc = vtkNamedColors() --- - lut = vtkLookupTable() - lut.SetNumberOfColors(len(colors)) - lut.SetTableRange(0, len(colors) - 1) - lut.Build() - - nc = vtkNamedColors() --- - lut = vtkLookupTable() - lut.SetNumberOfColors(16) - lut.SetTableRange(0, 15) - lut.Build() - - lut.SetTableValue(0, colors.GetColor4d('Black')) --- - lut = vtkLookupTable() - lut.SetHueRange(0.7, 0) - lut.SetSaturationRange(1.0, 0) - lut.SetValueRange(0.5, 1.0) - elif color_scheme == 2: - # Make the lookup table with a preset number of colours. --- - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - else: - # Make the lookup using a Brewer palette. - colorSeries = vtkColorSeries() --- - lut = vtkLookupTable() - colorSeries.BuildLookupTable(lut, colorSeries.ORDINAL) - lut.SetNanColor(1, 0, 0, 1) - return lut - - --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(256) - lut.SetHueRange(0.6, 0.6) - lut.SetSaturationRange(0.0, 1.0) - lut.Build() - --- - lut = vtkLookupTable() - lut.SetNumberOfTableValues(7) - lut.SetTableValue(0, nc.GetColor4d("My Red")) - # Let's make the dark green one partially transparent. - rgba = nc.GetColor4d("Lime") - rgba[3] = 0.3 --- - clut = vtkLookupTable() - clut.SetHueRange(0, 0.67) - clut.Build() - - cutterMapper = vtkPolyDataMapper() - cutterMapper.SetInputConnection(cutter.GetOutputPort()) --- - lut = vtkLookupTable() - lut.Build() - - # Read the source file. - reader = vtkUnstructuredGridReader() - reader.SetFileName(file_name) diff --git a/data/examples/pp/vtkLoopSubdivisionFilter b/data/examples/pp/vtkLoopSubdivisionFilter deleted file mode 100644 index b00298f..0000000 --- a/data/examples/pp/vtkLoopSubdivisionFilter +++ /dev/null @@ -1,13 +0,0 @@ - smooth_loop = vtkLoopSubdivisionFilter() - smooth_loop.SetNumberOfSubdivisions(3) - smooth_loop.SetInputConnection(cleanPolyData.GetOutputPort()) - - # Create a mapper and actor for smoothed dataset. - mapper = vtkPolyDataMapper() --- - smooth_loop = vtkLoopSubdivisionFilter() - smooth_loop.SetNumberOfSubdivisions(3) - smooth_loop.SetInputConnection(cleanPolyData.GetOutputPort()) - smooth_butterfly = vtkButterflySubdivisionFilter() - smooth_butterfly.SetNumberOfSubdivisions(3) - smooth_butterfly.SetInputConnection(cleanPolyData.GetOutputPort()) diff --git a/data/examples/pp/vtkMCubesReader b/data/examples/pp/vtkMCubesReader deleted file mode 100644 index 46cef2b..0000000 --- a/data/examples/pp/vtkMCubesReader +++ /dev/null @@ -1,13 +0,0 @@ - reader = vtkMCubesReader() - reader.SetFileName(fileName) - if not noConnectivity: - reader.Update() - print('Before Connectivity.') - print('There are: ', NumberOfTriangles(reader.GetOutput()), 'triangles') --- - reader = vtkMCubesReader() - reader.SetFileName(fileName) - reader.FlipNormalsOff() - reader.Update() - print('Before Decimation.') - print('There are: ', NumberOfTriangles(reader.GetOutput()), 'triangles') diff --git a/data/examples/pp/vtkMarchingContourFilter b/data/examples/pp/vtkMarchingContourFilter deleted file mode 100644 index bb2b5f7..0000000 --- a/data/examples/pp/vtkMarchingContourFilter +++ /dev/null @@ -1,13 +0,0 @@ - popSurface = vtkMarchingContourFilter() - popSurface.SetInputConnection(popSplatter.GetOutputPort()) - popSurface.SetValue(0, 0.01) - popMapper = vtkPolyDataMapper() - popMapper.SetInputConnection(popSurface.GetOutputPort()) - popMapper.ScalarVisibilityOff() --- - lateSurface = vtkMarchingContourFilter() - lateSurface.SetInputConnection(lateSplatter.GetOutputPort()) - lateSurface.SetValue(0, 0.01) - lateMapper = vtkPolyDataMapper() - lateMapper.SetInputConnection(lateSurface.GetOutputPort()) - lateMapper.ScalarVisibilityOff() diff --git a/data/examples/pp/vtkMarchingCubes b/data/examples/pp/vtkMarchingCubes deleted file mode 100644 index 1bbc91f..0000000 --- a/data/examples/pp/vtkMarchingCubes +++ /dev/null @@ -1,115 +0,0 @@ - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - skin_mapper = vtkPolyDataMapper() - skin_mapper.SetInputConnection(skin_extractor.GetOutputPort()) --- - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - skin_stripper = vtkStripper() - skin_stripper.SetInputConnection(skin_extractor.GetOutputPort()) --- - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) - bone_extractor.SetValue(0, 1150) - - bone_stripper = vtkStripper() - bone_stripper.SetInputConnection(bone_extractor.GetOutputPort()) --- - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - skin_extractor.Update() - - skin_stripper = vtkStripper() --- - bone_extractor = vtkMarchingCubes() - else: - bone_extractor = vtkMarchingCubes() - bone_extractor.SetInputConnection(reader.GetOutputPort()) - bone_extractor.SetValue(0, 1150) - - bone_stripper = vtkStripper() - bone_stripper.SetInputConnection(bone_extractor.GetOutputPort()) --- - skin_extractor = vtkMarchingCubes() - else: - skin_extractor = vtkMarchingCubes() - skin_extractor.SetInputConnection(reader.GetOutputPort()) - skin_extractor.SetValue(0, 500) - - # Define a spherical clip function to clip the isosurface - clip_function = vtkSphere() --- - mc = vtkMarchingCubes() - else: - mc = vtkMarchingCubes() - - mc.SetInputConnection(reader.GetOutputPort()) - mc.ComputeNormalsOn() - mc.ComputeGradientsOn() - mc.SetValue(0, threshold) # second value acts as threshold --- - surface = vtkMarchingCubes() - else: - surface = vtkMarchingCubes() - surface.SetInputData(volume) - surface.ComputeNormalsOn() - surface.SetValue(0, iso_value) - - renderer = vtkRenderer() --- - iso = vtkMarchingCubes() - else: - using_marching_cubes = True - iso = vtkMarchingCubes() - iso.SetInputConnection(reader.GetOutputPort()) - iso.ComputeGradientsOn() - iso.ComputeScalarsOff() - iso.SetValue(0, 1150) - if using_marching_cubes: --- - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(gaussian.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) --- - iso_surface = vtkMarchingCubes() - else: - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(select_tissue.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOn() - iso_surface.SetValue(0, iso_value) --- - iso_surface = vtkMarchingCubes() - iso_surface.SetInputConnection(last_connection.GetOutputPort()) - iso_surface.ComputeScalarsOff() - iso_surface.ComputeGradientsOff() - iso_surface.ComputeNormalsOff() - iso_surface.SetValue(0, iso_value) --- - iso_sphere = vtkMarchingCubes() - else: - iso_sphere = vtkMarchingCubes() - iso_sphere.SetValue(0, 1.0) - iso_sphere.SetInputConnection(sampled_sphere.GetOutputPort()) - - # Create a sampled cylinder - implicit_cylinder = vtkCylinder() diff --git a/data/examples/pp/vtkMarchingSquares b/data/examples/pp/vtkMarchingSquares deleted file mode 100644 index 8c0cae7..0000000 --- a/data/examples/pp/vtkMarchingSquares +++ /dev/null @@ -1,6 +0,0 @@ - iso = vtkMarchingSquares() - iso.SetInputConnection(reader.GetOutputPort()) - iso.SetValue(0, iso_value) - - iso_mapper = vtkDataSetMapper() - iso_mapper.SetInputConnection(iso.GetOutputPort()) diff --git a/data/examples/pp/vtkMaskFields b/data/examples/pp/vtkMaskFields deleted file mode 100644 index 97112f6..0000000 --- a/data/examples/pp/vtkMaskFields +++ /dev/null @@ -1,6 +0,0 @@ - scalars_off = vtkMaskFields() - geometry = vtkGeometryFilter() - writer = vtkXMLPolyDataWriter() - - # Define all of the variables - file_prefix = 'Label' diff --git a/data/examples/pp/vtkMaskPoints b/data/examples/pp/vtkMaskPoints deleted file mode 100644 index 61342ed..0000000 --- a/data/examples/pp/vtkMaskPoints +++ /dev/null @@ -1,41 +0,0 @@ - mask = vtkMaskPoints() - mask.SetInputConnection(threshold.GetOutputPort()) - mask.SetOnRatio(5) - - cone = vtkConeSource() - cone.SetResolution(11) --- - ptMask = vtkMaskPoints() - ptMask.SetInputConnection(normals.GetOutputPort()) - ptMask.SetOnRatio(10) - ptMask.RandomModeOn() - - # In this case we are using a cone as a glyph. We transform the cone so --- - mask = vtkMaskPoints() - mask.SetInputConnection(normals.GetOutputPort()) - mask.SetOnRatio(8) - # mask.RandomModeOn() - - splatter = vtkGaussianSplatter() --- - mask_pts = vtkMaskPoints() - mask_pts.SetOnRatio(5) - mask_pts.RandomModeOn() - if reverse_normals: - reverse.SetInputData(src) - reverse.ReverseCellsOn() --- - mask_pts = vtkMaskPoints() - mask_pts.SetOnRatio(5) - mask_pts.RandomModeOn() - if reverse_normals: - reverse.SetInputData(src) - reverse.ReverseCellsOn() --- - maskPts = vtkMaskPoints() - maskPts.SetInputConnection(source.GetOutputPort()) - maskPts.SetOnRatio(source.GetOutput().GetNumberOfPoints() // glyphPoints) - maskPts.SetRandomMode(1) - - arrowGlyph = vtkGlyph3D() diff --git a/data/examples/pp/vtkMaskPolyData b/data/examples/pp/vtkMaskPolyData deleted file mode 100644 index 9be1ed0..0000000 --- a/data/examples/pp/vtkMaskPolyData +++ /dev/null @@ -1,13 +0,0 @@ - mask = vtkMaskPolyData() - mask.SetInputConnection(deci.GetOutputPort()) - mask.SetOnRatio(2) - - cyberMapper = vtkPolyDataMapper() - cyberMapper.SetInputConnection(mask.GetOutputPort()) --- - stripperMask = vtkMaskPolyData() - stripperMask.SetInputConnection(stripper.GetOutputPort()) - stripperMask.SetOnRatio(2) - - stripperMapper = vtkPolyDataMapper() - stripperMapper.SetInputConnection(stripperMask.GetOutputPort()) diff --git a/data/examples/pp/vtkMath b/data/examples/pp/vtkMath deleted file mode 100644 index 8feddc7..0000000 --- a/data/examples/pp/vtkMath +++ /dev/null @@ -1,65 +0,0 @@ - while angle <= 2.0 * vtkMath.Pi() + (vtkMath.Pi() / 60.0): - points.InsertNextPoint(r1 * math.cos(angle) + centerX, - r2 * math.sin(angle) + centerY, - 0.0) - angle = angle + (vtkMath.Pi() / 60.0) - idx += 1 - - line = vtkPolyLine() - line.GetPointIds().SetNumberOfIds(idx) - for i in range(0, idx): --- - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - max_r = 10.0 --- - while angle <= 2.0 * vtkMath.Pi() + (vtkMath.Pi() / 60.0): - points.InsertNextPoint(r1 * math.cos(angle) + centerX, - r2 * math.sin(angle) + centerY, - 0.0) - angle = angle + (vtkMath.Pi() / 60.0) - idx += 1 - - line = vtkPolyLine() - line.GetPointIds().SetNumberOfIds(idx) - for i in range(0, idx): --- - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - # The Z axis is an arbitrary vector cross X - arbitrary = [0] * 3 - for i in range(0, 3): --- - length = vtkMath.Norm(normalizedX) - vtkMath.Normalize(normalizedX) - - # The Z axis is an arbitrary vector cross X - arbitrary = [0] * 3 - for i in range(0, 3): --- - distSquared = vtkMath.Distance2BetweenPoints(p0, p1) - - dist = math.sqrt(distSquared) - - print('p0 = ', p0) - print('p1 = ', p1) --- - theta = i * vtkMath.RadiansFromDegrees(15.0) - x[0] = radius * math.cos(theta) - x[1] = radius * math.sin(theta) - v[0] = -x[1] - v[1] = x[0] - offset = i + jOffset + kOffset --- - x = distance * math.cos(vtkMath.RadiansFromDegrees(heading)) * math.cos(vtkMath.RadiansFromDegrees(tilt)) - y = distance * math.sin(vtkMath.RadiansFromDegrees(heading)) * math.cos(vtkMath.RadiansFromDegrees(tilt)) - z = distance * math.sin(vtkMath.RadiansFromDegrees(tilt)) - - camera.SetPosition(x, y, z) - camera.SetFocalPoint(0, 0, 0) - camera.SetViewUp(0, 0, 1) - camera.SetClippingRange(0.1, distance + 1) diff --git a/data/examples/pp/vtkMatrix4x4 b/data/examples/pp/vtkMatrix4x4 deleted file mode 100644 index d6674ae..0000000 --- a/data/examples/pp/vtkMatrix4x4 +++ /dev/null @@ -1,132 +0,0 @@ - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) --- - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) --- - matrix = vtkMatrix4x4() - - # Create the direction cosine matrix - matrix.Identity() - for i in range(0, 3): - matrix.SetElement(i, 0, normalizedX[i]) --- - matrix1 = vtkMatrix4x4() - transform0 = vtkTransform() - - collide = vtkCollisionDetectionFilter() - collide.SetInputConnection(0, sphere0.GetOutputPort()) - collide.SetTransform(0, transform0) --- - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) --- - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) --- - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) --- - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) --- - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) --- - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) --- - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) --- - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) --- - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) --- - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) --- - self.si_mat = vtkMatrix4x4() - self.si_mat.Zero() - self.si_mat.SetElement(0, 0, 1) - self.si_mat.SetElement(1, 2, 1) - self.si_mat.SetElement(2, 1, -1) - self.si_mat.SetElement(3, 3, 1) --- - self.is_mat = vtkMatrix4x4() - self.is_mat.Zero() - self.is_mat.SetElement(0, 0, 1) - self.is_mat.SetElement(1, 2, -1) - self.is_mat.SetElement(2, 1, -1) - self.is_mat.SetElement(3, 3, 1) --- - self.lr_mat = vtkMatrix4x4() - self.lr_mat.Zero() - self.lr_mat.SetElement(0, 2, -1) - self.lr_mat.SetElement(1, 1, -1) - self.lr_mat.SetElement(2, 0, 1) - self.lr_mat.SetElement(3, 3, 1) --- - self.rl_mat = vtkMatrix4x4() - self.rl_mat.Zero() - self.rl_mat.SetElement(0, 2, 1) - self.rl_mat.SetElement(1, 1, -1) - self.rl_mat.SetElement(2, 0, 1) - self.rl_mat.SetElement(3, 3, 1) --- - self.hf_mat = vtkMatrix4x4() - self.hf_mat.Zero() - self.hf_mat.SetElement(0, 0, -1) - self.hf_mat.SetElement(1, 1, 1) - self.hf_mat.SetElement(2, 2, -1) - self.hf_mat.SetElement(3, 3, 1) diff --git a/data/examples/pp/vtkMergeData b/data/examples/pp/vtkMergeData deleted file mode 100644 index e69de29..0000000 diff --git a/data/examples/pp/vtkMergeFilter b/data/examples/pp/vtkMergeFilter deleted file mode 100644 index 03553be..0000000 --- a/data/examples/pp/vtkMergeFilter +++ /dev/null @@ -1,6 +0,0 @@ - merge = vtkMergeFilter() - merge.SetGeometryConnection(warp.GetOutputPort()) - merge.SetScalarsConnection(reader.GetOutputPort()) - mapper = vtkDataSetMapper() - mapper.SetInputConnection(merge.GetOutputPort()) - mapper.SetScalarRange(0, 255) diff --git a/data/examples/pp/vtkMergePoints b/data/examples/pp/vtkMergePoints deleted file mode 100644 index 9201bde..0000000 --- a/data/examples/pp/vtkMergePoints +++ /dev/null @@ -1,6 +0,0 @@ - locator = vtkMergePoints() - locator.SetDivisions(64, 64, 92) - locator.SetNumberOfPointsPerBucket(2) - locator.AutomaticOff() - - if use_flying_edges: diff --git a/data/examples/pp/vtkMetaImageReader b/data/examples/pp/vtkMetaImageReader deleted file mode 100644 index 0acc737..0000000 --- a/data/examples/pp/vtkMetaImageReader +++ /dev/null @@ -1,118 +0,0 @@ - reader_volume = vtkMetaImageReader() - reader_volume.SetFileName(ifn) - reader_volume.Update() - - # Extract the region of interest. - voi = vtkExtractVOI() --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # Pad the volume so that we can change the point data into cell - # data. --- - reader = vtkMetaImageReader() - histogram = vtkImageAccumulate() - if use_flying_edges: - try: - using_marching_cubes = False - discrete_cubes = vtkDiscreteFlyingEdges3D() --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. - if use_flying_edges: --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. - # The triangle stripper is used to create triangle strips from the --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # An isosurface, or contour value of 500 is known to correspond to - # the skin of the patient. --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - - # The volume will be displayed by ray-cast alpha compositing. - # A ray-cast mapper is needed to do the ray-casting. - volume_mapper = vtkFixedPointVolumeRayCastMapper() --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - # An isosurface, or contour value of 500 is known to correspond to the - # skin of the patient. --- - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) --- - reader = vtkMetaImageReader() - reader.SetFileName(file_name) - reader.Update() - - locator = vtkMergePoints() - locator.SetDivisions(64, 64, 92) --- - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - extractVOI = vtkExtractVOI() - extractVOI.SetInputConnection(reader.GetOutputPort()) --- - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() - - cast = vtkImageCast() - cast.SetInputConnection(reader.GetOutputPort()) --- - reader = vtkMetaImageReader() - reader.SetFileName(str(file_name)) - reader.Update() - - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) --- - reader = vtkMetaImageReader() - reader.SetFileName(str(file_name)) - reader.Update() - - select_tissue = vtkImageThreshold() - select_tissue.ThresholdBetween(tissue, tissue) --- - reader = vtkMetaImageReader() - reader.SetFileName(str(fn)) - reader.SetDataSpacing(data_spacing) - reader.SetDataOrigin(data_origin) - reader.SetDataExtent(voi) - reader.Update() --- - grey_reader = vtkMetaImageReader() - grey_reader.SetFileName(str(fn_1)) - grey_reader.Update() - - grey_padder = vtkImageConstantPad() - grey_padder.SetInputConnection(grey_reader.GetOutputPort()) --- - segment_reader = vtkMetaImageReader() - segment_reader.SetFileName(str(fn_2)) - segment_reader.Update() - - segment_padder = vtkImageConstantPad() - segment_padder.SetInputConnection(segment_reader.GetOutputPort()) diff --git a/data/examples/pp/vtkMetaImageWriter b/data/examples/pp/vtkMetaImageWriter deleted file mode 100644 index 35507c7..0000000 --- a/data/examples/pp/vtkMetaImageWriter +++ /dev/null @@ -1,13 +0,0 @@ - writer = vtkMetaImageWriter() - writer.SetFileName("output.mha") - writer.SetInputData(mask) - writer.Write() - - --- - imageWriter = vtkMetaImageWriter() - imageWriter.SetFileName('labelImage.mhd') - imageWriter.SetInputConnection(imgstenc.GetOutputPort()) - imageWriter.Write() - - imageWriter = vtkPNGWriter() diff --git a/data/examples/pp/vtkMinimalStandardRandomSequence b/data/examples/pp/vtkMinimalStandardRandomSequence deleted file mode 100644 index aad6938..0000000 --- a/data/examples/pp/vtkMinimalStandardRandomSequence +++ /dev/null @@ -1,174 +0,0 @@ - rng = vtk.vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - for i in range(0, 10): - rng.Next() - x = rng.GetRangeValue(0.0, 1.0) - rng.Next() --- - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.Initialize(seed) - for x in range(gridSize): - for y in range(gridSize): - d1 = randomSequence.GetValue() / 2.0 - 0.25 - randomSequence.Next() --- - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.Initialize(seed) - for x in range(0, gridSize): - for y in range(0, gridSize): - d = randomSequence.GetValue() - randomSequence.Next() --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(5070) # for testing - for i in range(0, points.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): - rng.Next() --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - max_r = 10.0 - - # The Z axis is an arbitrary vector cross X - arbitrary = [0.0] * 3 --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) # For testing. - for i in range(0, 3): - rng.Next() - startPoint[i] = rng.GetRangeValue(-10, 10) - rng.Next() --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) # For testing. - for i in range(0, 3): - rng.Next() - startPoint[i] = rng.GetRangeValue(-10, 10) - rng.Next() --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775070) - for p in range(0, 10): - xyz = [None] * 3 - for idx in range(0, len(xyz)): - xyz[idx] = rng.GetRangeValue(-1.0, 1.0) --- - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aHexahedron.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aHexahedron.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): --- - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aHexahedron.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aHexahedron.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): --- - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aTetra.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aTetra.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): --- - rng = vtkMinimalStandardRandomSequence() - points.SetNumberOfPoints(aTetra.GetNumberOfPoints()) - rng.SetSeed(5070) # for testing - for i in range(0, aTetra.GetNumberOfPoints()): - perturbation = [0.0] * 3 - for j in range(0, 3): --- - rng = vtkMinimalStandardRandomSequence() - rng.SetSeed(8775586) # For testing. - for x in range(0, GridSize): - for y in range(0, GridSize): - rng.Next() - xx = x + rng.GetRangeValue(-0.2, 0.2) --- - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(1) - for i in range(0, 50): - p1 = randomSequence.GetValue() - randomSequence.Next() - p2 = randomSequence.GetValue() --- - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): - - sphere = vtkSphere() - sphere.SetRadius(radius) --- - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(1, n): - r = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - g = random_sequence.GetRangeValue(0.4, 1) --- - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(0, n): - - sphere = vtkSphere() - sphere.SetRadius(radius) --- - random_sequence = vtkMinimalStandardRandomSequence() - random_sequence.SetSeed(5071) - for i in range(1, n): - r = random_sequence.GetRangeValue(0.4, 1) - random_sequence.Next() - g = random_sequence.GetRangeValue(0.4, 1) --- - randomSequence = vtkMinimalStandardRandomSequence() - # randomSequence.SetSeed(1043618065) - # randomSequence.SetSeed(5170) - randomSequence.SetSeed(8775070) - # Add spheres to play with - for i in range(NUMBER_OF_SPHERES): --- - randomSequence = vtkMinimalStandardRandomSequence() - # randomSequence.SetSeed(1043618065) - # randomSequence.SetSeed(5170) - randomSequence.SetSeed(8775070) - # Add spheres to play with - for i in range(numberOfSpheres): --- - rand_seq = vtkMinimalStandardRandomSequence() - rand_seq.SetSeed(8775070) - - for i in range(numTuples): - bitter.SetTuple1(i, rand_seq.GetRangeValue(1, 10)) - rand_seq.Next() --- - rn = vtkMinimalStandardRandomSequence() - rn.SetSeed(1) - - # Define z values for the topography (random height) - topography = numpy.zeros([size, size]) - for i in range(size): --- - rng = vtkMinimalStandardRandomSequence() - # rng.SetSeed(8775070) - rng.SetSeed(5127) - - # Create a renderer - renderer = vtkRenderer() --- - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(1) - for i in range(0, gv.numberOfPucks): - puck.append(vtkActor()) - puck[i].SetMapper(puckMapper) - color = [0, 0, 0] --- - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(8775070) - x = randomSequence.GetRangeValue(xmin, xmax) - randomSequence.Next() - y = randomSequence.GetRangeValue(ymin, ymax) - randomSequence.Next() diff --git a/data/examples/pp/vtkMultiBlockDataSet b/data/examples/pp/vtkMultiBlockDataSet deleted file mode 100644 index 5c86f9d..0000000 --- a/data/examples/pp/vtkMultiBlockDataSet +++ /dev/null @@ -1,15 +0,0 @@ - mbds = vtkMultiBlockDataSet() - mbds.SetNumberOfBlocks(3) - mbds.SetBlock(0, sphere1.GetOutput()) - # Leave block 1 NULL. NULL blocks are valid and should be handled by - # algorithms that process multiblock datasets. Especially when - # running in parallel where the blocks owned by other processes are --- - root = vtkMultiBlockDataSet() - - branch = vtkMultiBlockDataSet() - root.SetBlock(0, branch) - - # Make some leaves. - leaf1 = vtkSphereSource() - leaf1.SetCenter(0, 0, 0) diff --git a/data/examples/pp/vtkMultiBlockPLOT3DReader b/data/examples/pp/vtkMultiBlockPLOT3DReader deleted file mode 100644 index 2519f8b..0000000 --- a/data/examples/pp/vtkMultiBlockPLOT3DReader +++ /dev/null @@ -1,104 +0,0 @@ - reader = vtkMultiBlockPLOT3DReader() - reader.SetXYZFileName(xyzFile) - reader.SetQFileName(qFile) - reader.SetScalarFunctionNumber(100) - reader.SetVectorFunctionNumber(202) - reader.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFn) - pl3d.SetQFileName(qFn) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(dataFn1) - pl3d.SetQFileName(dataFn2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - reader = vtkMultiBlockPLOT3DReader() - reader.SetXYZFileName(xyzFilename) - reader.SetQFileName(qFilename) - reader.Update() # Force a read to occur. - - pd = reader.GetOutput().GetBlock(0) --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.AutoDetectFormatOn() - pl3d.SetXYZFileName(xyxFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(153) - pl3d.SetVectorFunctionNumber(200) --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) # Density - pl3d.SetVectorFunctionNumber(202) # Momentum - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) # Density - pl3d.SetVectorFunctionNumber(202) # Momentum - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(fileName1) - pl3d.SetQFileName(fileName2) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyz_file) - pl3d.SetQFileName(q_file) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() --- - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFile) - pl3d.SetQFileName(qFile) - pl3d.SetScalarFunctionNumber(100) - pl3d.SetVectorFunctionNumber(202) - pl3d.Update() diff --git a/data/examples/pp/vtkMultiThreshold b/data/examples/pp/vtkMultiThreshold deleted file mode 100644 index 31f3af3..0000000 --- a/data/examples/pp/vtkMultiThreshold +++ /dev/null @@ -1,6 +0,0 @@ - threshold = vtkMultiThreshold() - # Outside points have a 0 value in ALL points of a cell - outsideId = threshold.AddBandpassIntervalSet( - 0, 0, - vtkDataObject.FIELD_ASSOCIATION_POINTS, 'SelectedPoints', - 0, 1) diff --git a/data/examples/pp/vtkMutableDirectedGraph b/data/examples/pp/vtkMutableDirectedGraph deleted file mode 100644 index ad3e483..0000000 --- a/data/examples/pp/vtkMutableDirectedGraph +++ /dev/null @@ -1,62 +0,0 @@ - g = vtk.vtkMutableDirectedGraph() - latitude = vtk.vtkDoubleArray() - latitude.SetName('latitude') - longitude = vtk.vtkDoubleArray() - longitude.SetName('longitude') - for i in range(-90, 90, 10): --- - graph = vtkMutableDirectedGraph() - # Create a graph - v1 = graph.AddVertex() - v2 = graph.AddVertex() - v3 = graph.AddVertex() - --- - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddVertex() - graph.AddEdge(v1, v2) - --- - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddVertex() - v3 = graph.AddVertex() - graph.AddEdge(v1, v2) --- - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() - v2 = graph.AddChild(v1) - graph.AddChild(v1) - graph.AddChild(v2) --- - graph = vtkMutableDirectedGraph() - - a = graph.AddVertex() - b = graph.AddChild(a) - c = graph.AddChild(a) - d = graph.AddChild(b) --- - g = vtkMutableDirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() --- - g = vtkMutableDirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() - --- - g = vtkMutableDirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddGraphEdge(v1, v2) diff --git a/data/examples/pp/vtkMutableUndirectedGraph b/data/examples/pp/vtkMutableUndirectedGraph deleted file mode 100644 index 2d2dada..0000000 --- a/data/examples/pp/vtkMutableUndirectedGraph +++ /dev/null @@ -1,41 +0,0 @@ - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddEdge(v1, v2) --- - g = vtkMutableUndirectedGraph() - - # Add 4 vertices to the graph - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() --- - g = vtkMutableUndirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() - v2 = g.AddVertex() - v3 = g.AddVertex() --- - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() - - g.AddEdge(v1, v2) --- - g0 = vtkMutableUndirectedGraph() - - v1 = g0.AddVertex() - v2 = g0.AddVertex() - v3 = g0.AddVertex() - --- - g1 = vtkMutableUndirectedGraph() - - v1 = g1.AddVertex() - v2 = g1.AddVertex() - - g1.AddEdge(v1, v2) diff --git a/data/examples/pp/vtkMyCallback b/data/examples/pp/vtkMyCallback deleted file mode 100644 index f3ccb8f..0000000 --- a/data/examples/pp/vtkMyCallback +++ /dev/null @@ -1,13 +0,0 @@ - mo1 = vtkMyCallback(ren1) - ren1.AddObserver('StartEvent', mo1) - - # - # Now we loop over 360 degrees and render the cone each time. - # --- - callback = vtkMyCallback() - boxWidget.AddObserver('InteractionEvent', callback) - - # - # Normally the user presses the 'i' key to bring a 3D widget to life. Here - # we will manually enable it so it appears with the cone. diff --git a/data/examples/pp/vtkNamedColor b/data/examples/pp/vtkNamedColor deleted file mode 100644 index df901c3..0000000 --- a/data/examples/pp/vtkNamedColor +++ /dev/null @@ -1,6 +0,0 @@ - nc = vtkNamedColors() - # We can print out the variables. - # The color name and RGBA values are displayed. - print(nc) - - # Here we just print out the colors and any diff --git a/data/examples/pp/vtkNamedColors b/data/examples/pp/vtkNamedColors deleted file mode 100644 index c080710..0000000 --- a/data/examples/pp/vtkNamedColors +++ /dev/null @@ -1,2898 +0,0 @@ - colors = vtkNamedColors() - - # The text is on a single line and bottom-justified. - singleLineTextB = vtkTextMapper() - singleLineTextB.SetInput('Single line (bottom)') - tprop = singleLineTextB.GetTextProperty() --- - colors = vtkNamedColors() - - # Create the axes and the associated mapper and actor. - axes = vtkAxes() - axes.SetOrigin(0, 0, 0) - axesMapper = vtkPolyDataMapper() --- - colors = vtkNamedColors() - - # Create Sphere 1. - sphere1 = vtkSphereSource() - sphere1.SetRadius(3) - sphere1.SetCenter(0, 0, 0) --- - colors = vtkNamedColors() - - # PART 1 Make some Data. - # Make a tree. - root = vtkMultiBlockDataSet() - --- - colors = vtkNamedColors() - - # Create and populate the AMR dataset - # The dataset should look like - # Level 0 - # uniform grid, dimensions 11, 11, 11, AMR box (0, 0, 0) - (9, 9, 9) --- - named_colors = vtkNamedColors() - - # Make a 32 x 32 grid. - size = 32 - - # Define z values for the topography. --- - colors = vtkNamedColors() - ifn, index = get_program_parameters() - - # Prepare to read the file. - reader_volume = vtkMetaImageReader() - reader_volume.SetFileName(ifn) --- - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBohemianDome()) --- - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - parametricObjects = list() - parametricObjects.append(vtk.vtkParametricBoy()) --- - colors = vtk.vtkNamedColors() - - colors.SetColor("BkgColor", [26, 51, 102, 255]) - - # Uncomment one of the following. - # parametricObject = vtk.vtkParametricBoy() --- - colors = vtk.vtkNamedColors() - - g = vtk.vtkMutableDirectedGraph() - latitude = vtk.vtkDoubleArray() - latitude.SetName('latitude') - longitude = vtk.vtkDoubleArray() --- - colors = vtk.vtkNamedColors() - - geoGraticle = vtk.vtkGeoGraticule() - transformProjection = vtk.vtkGeoTransform() - destinationProjection = vtk.vtkGeoProjection() - sourceProjection = vtk.vtkGeoProjection() --- - colors = vtkNamedColors() - - actor = vtkActor() - actor.SetMapper(mapper) - actor.GetProperty().EdgeVisibilityOn() - actor.GetProperty().LightingOff() --- - colors = vtkNamedColors() - - renderer = vtkRenderer() - renderer.AddActor(actor) - renderer.SetBackground(colors.GetColor3d('DimGray')) - --- - colors = vtkNamedColors() - - # Create 5 points (vtkPolyData) - pointSource = vtkPointSource() - pointSource.SetNumberOfPoints(5) - pointSource.Update() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [0.3, 0.2, 0.1, 1.0]) - - input1 = vtkPolyData() --- - colors = vtkNamedColors() - - sphereSource1 = vtkSphereSource() - sphereSource1.Update() - - delaunay1 = vtkDelaunay3D() --- - colors = vtkNamedColors() - - # Generate a 10 x 10 grid of points - points = vtkPoints() - gridSize = 10 - seed = 0 --- - colors = vtkNamedColors() - - # Create a set of heights on a grid. - # This is often called a "terrain map". - points = vtkPoints() - --- - colors = vtkNamedColors() - - polydata = vtkPolyData() - polydata.SetPoints(sphereSource.GetOutput().GetPoints()) - - splatter = vtkGaussianSplatter() --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 0) - points.InsertNextPoint(2, 2, 0) --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(2, 2, 2) --- - colors = vtkNamedColors() - perlinNoise = vtkPerlinNoise() - perlinNoise.SetFrequency(2, 1.25, 1.5) - perlinNoise.SetPhase(0, 0, 0) - - sample = vtkSampleFunction() --- - colors = vtkNamedColors() - - # Create the polydata geometry - sphereSource = vtkSphereSource() - sphereSource.Update() - --- - colors = vtkNamedColors() - # Create points on an XY grid with random Z coordinate - points = vtkPoints() - gridSize = 10 - seed = 0 - randomSequence = vtkMinimalStandardRandomSequence() --- - colors = vtkNamedColors() - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 1, 1) - points.InsertNextPoint(2, 2, 2) - --- - colors = vtkNamedColors() - # Create the RenderWindow, Renderer and both Actors - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) - renderWindowInteractor = vtkRenderWindowInteractor() --- - colors = vtkNamedColors() - - arrowSource = vtkArrowSource() - # arrowSource.SetShaftRadius(0.01) - # arrowSource.SetTipLength(.9) - --- - colors = vtkNamedColors() - - # create a Sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(0.5) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - titles = list() --- - colors = vtkNamedColors() - - # Create a mapper and actor. - mapper = vtkDataSetMapper() - mapper.SetInputConnection(source.GetOutputPort()) - mapper.SetInputConnection(shrink.GetOutputPort()) --- - colors = vtkNamedColors() - - # Create a circle - polygonSource = vtkRegularPolygonSource() - # Comment this line to generate a disk instead of a circle. - polygonSource.GeneratePolygonOff() --- - namedColors = vtkNamedColors() - - # Create a vtkUnsignedCharArray container and store the colors in it - colors = vtkUnsignedCharArray() - colors.SetNumberOfComponents(3) - try: --- - colors = vtkNamedColors() - - coneSource = vtkConeSource() - # coneSource.SetResolution(60) - # coneSource.SetCenter(-2,0,0) - --- - colors = vtkNamedColors() - - mapper = vtkDataSetMapper() - mapper.SetInputData(ug) - - actor = vtkActor() --- - colors = vtkNamedColors() - - # Create a rendering window and renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('Cube1') --- -If your VTK version is 5.x then remove the line: colors = vtkNamedColors() - and replace the set background parameters with (1.0, 0.9688, 0.8594) - -""" - -# noinspection PyUnresolvedReferences --- - colors = vtkNamedColors() - - # x = array of 8 3-tuples of float representing the vertices of a cube: - x = [(0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (1.0, 1.0, 0.0), (0.0, 1.0, 0.0), - (0.0, 0.0, 1.0), (1.0, 0.0, 1.0), (1.0, 1.0, 1.0), (0.0, 1.0, 1.0)] - --- - colors = vtkNamedColors() - # Set the background color. - bkg = map(lambda x: x / 255.0, [26, 51, 102, 255]) - colors.SetColor("BkgColor", *bkg) - - # This creates a polygonal cylinder model with eight circumferential --- - colors = vtkNamedColors() - - # Create a sphere - cylinderSource = vtkCylinderSource() - cylinderSource.SetCenter(0.0, 0.0, 0.0) - cylinderSource.SetRadius(5.0) --- - colors = vtkNamedColors() - - diskSource = vtkDiskSource() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() --- - colors = vtkNamedColors() - - dodecahedron = MakeDodecahedron() - - # Visualize - mapper = vtkPolyDataMapper() --- - colors = vtkNamedColors() - - # Earth source - earthSource = vtkEarthSource() - earthSource.OutlineOn() - earthSource.Update() --- - colors = vtkNamedColors() - - angle = 0 - r1 = 50 - r2 = 30 - centerX = 10.0 --- - colors = vtkNamedColors() - - angle = 0 - r1 = 50 - r2 = 30 - centerX = 10.0 --- - colors = vtkNamedColors() - - camera = vtkCamera() - camera.SetClippingRange(0.1, 0.4) - planesArray = [0] * 24 - --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - # Create container to hold the 3D object generators (sources) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - # For the hexahedron setup the coordinates of eight points. --- - colors = vtkNamedColors() - - # Create one sphere for all. - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) --- - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('Black')) --- - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.ShadowOn() - pty.SetJustificationToCentered() --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('LightSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('OrangeRed')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('DarkSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('Seashell')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('Gold')) - pty.SetDiffuseColor(colors.GetColor3d('Yellow')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('SteelBlue')) - pty.SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - # Create one sphere for all. - sphere = vtkSphereSource() - sphere.SetPhiResolution(21) - sphere.SetThetaResolution(21) --- - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.SetJustificationToCentered() - pty.SetColor(colors.GetColor3d('Black')) --- - colors = vtkNamedColors() - - pty = vtkTextProperty() - pty.BoldOn() - pty.ShadowOn() - pty.SetJustificationToCentered() --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('LightSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('OrangeRed')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('DarkSalmon')) - pty.SetDiffuseColor(colors.GetColor3d('Seashell')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('Gold')) - pty.SetDiffuseColor(colors.GetColor3d('Yellow')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - pty = vtkProperty() - pty.SetAmbientColor(colors.GetColor3d('SteelBlue')) - pty.SetDiffuseColor(colors.GetColor3d('LightSteelBlue')) - pty.SetSpecularColor(colors.GetColor3d('White')) --- - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(lineSource.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) --- - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(linesPolyData) - - actor = vtkActor() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create an arrow. --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create a cylinder. --- - colors = vtkNamedColors() - - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricKuen() - source = vtkParametricFunctionSource() --- - colors = vtkNamedColors() - - # Create one text property for all. - text_property = vtkTextProperty() - text_property.SetJustificationToCentered() - text_property.SetFontSize(int(renderer_size / 12)) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricSuperEllipsoid() --- - colors = vtkNamedColors() - - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - surface = vtkParametricSuperToroid() - source = vtkParametricFunctionSource() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 77, 255]) - - # Create a plane --- - colors = vtkNamedColors() - - planes = list() - titles = list() - - # Using frustum planes. --- - colors = vtkNamedColors() - - mappers = list() - actors = list() - text_mappers = list() - text_actors = list() --- - colors = vtkNamedColors() - - # Create the geometry of a point (the coordinate) - points = vtkPoints() - p = [1.0, 2.0, 3.0] - --- - colors = vtkNamedColors() - - # Setup four points - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) --- - colors = vtkNamedColors() - - # create polyhedron (cube) - # The point Ids are: [0, 1, 2, 3, 4, 5, 6, 7] - - points = vtkPoints() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # vtkPoints represents 3D points. The data model for vtkPoints is an array of --- - colors = vtkNamedColors() - - # Create five points. - origin = [0.0, 0.0, 0.0] - p0 = [1.0, 0.0, 0.0] - p1 = [0.0, 1.0, 0.0] --- - colors = vtkNamedColors() - - points = vtkPoints() - - p0 = [1.0, 1.0, 1.0] - p1 = [-1.0, 1.0, 1.0] --- - colors = vtkNamedColors() - - # Create four points (must be in counter clockwise order) - p0 = [0.0, 0.0, 0.0] - p1 = [1.0, 0.0, 0.0] - p2 = [1.0, 1.0, 0.0] --- - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticHexahedron() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) --- - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticHexahedron() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) --- - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticTetra() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) --- - namedColors = vtkNamedColors() - - uGrid = MakeQuadraticTetra() - - tessellate = vtkTessellatorFilter() - tessellate.SetInputData(uGrid) --- - colors = vtkNamedColors() - - # Create a pentagon - polygonSource = vtkRegularPolygonSource() - polygonSource.SetNumberOfSides(5) - polygonSource.SetRadius(5) --- - colors = vtkNamedColors() - - # Create a cube. - cubeSource = vtkCubeSource() - - shrink = vtkShrinkFilter() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [51, 77, 102, 255]) - - sourceObjects = list() --- - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(5.0) --- - colors = vtkNamedColors() - - bounds = [-10.0, 10.0, 10.0, 20.0, -5.0, 5.0] - - boxSource = vtkTessellatedBoxSource() - boxSource.SetLevel(3) --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(1, 0, 0) - points.InsertNextPoint(1, 1, 0) --- - colors = vtkNamedColors() - - # Create a rendering window and renderer. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('TextActor') --- - colors = vtkNamedColors() - - # Create a triangle - points = vtkPoints() - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(0.0, 0.0, 0.0) --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - points.InsertNextPoint(0, 1, 0) - points.InsertNextPoint(1, 0, 0) --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0, 0, 0) - - vertex = vtkVertex() --- - colors = vtkNamedColors() - - graph = vtkMutableDirectedGraph() - # Create a graph - v1 = graph.AddVertex() - v2 = graph.AddVertex() --- - colors = vtkNamedColors() - - # Create a graph - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() --- - colors = vtkNamedColors() - - # Create a graph - graph = vtkMutableDirectedGraph() - - v1 = graph.AddVertex() --- - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() --- - colors = vtkNamedColors() - - g = vtkMutableDirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() --- - colors = vtkNamedColors() - # Create a graph - g = vtkMutableUndirectedGraph() - - # Add 4 vertices to the graph - v1 = g.AddVertex() --- - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - # Create 3 vertices - v1 = g.AddVertex() --- - colors = vtkNamedColors() - - random_graph_source = vtkRandomGraphSource() - random_graph_source.SetNumberOfVertices(5) - random_graph_source.SetNumberOfEdges(4) - # This ensures repeatable results for testing. Turn this off for real use. --- - colors = vtkNamedColors() - - g = vtkMutableUndirectedGraph() - - v1 = g.AddVertex() - v2 = g.AddVertex() --- - colors = vtkNamedColors() - - # Create the first graph - g0 = vtkMutableUndirectedGraph() - - v1 = g0.AddVertex() --- - colors = vtkNamedColors() - # Create hyper tree grid source - - descriptor = 'RRR .R. .RR ..R ..R .R.|R.......................... ' \ - '........................... ........................... ' \ - '.............R............. ....RR.RR........R......... ' \ --- - colors = vtkNamedColors() - - # Create an image - source1 = vtkImageCanvasSource2D() - source1.SetScalarTypeToUnsignedChar() - source1.SetNumberOfScalarComponents(3) --- - colors = vtkNamedColors() - - # Create an image - source = vtkImageSinusoidSource() - source.Update() - --- - colors = vtkNamedColors() - - # Create image 1 - source1 = vtkImageMandelbrotSource() - source1.SetWholeExtent(0, 255, 0, 255, 0, 0) - source1.Update() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - imageData = vtkImageData() - imageData.SetDimensions(3, 4, 5) --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - # Read the image. - reader_factory = vtkImageReader2Factory() --- - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - # colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Read the image. - readerFactory = vtkImageReader2Factory() --- - colors = vtkNamedColors() - points = vtkPoints() - points.InsertNextPoint(10, 10, 0) - points.InsertNextPoint(100, 100, 0) - points.InsertNextPoint(200, 200, 0) - --- - colors = vtkNamedColors() - - # Verify input arguments - fn = get_program_parameters() - if fn: - # Read the image --- - colors = vtkNamedColors() - - # Create a float image - source = vtkImageMandelbrotSource() - source.Update() - --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [60, 93, 144, 255]) - - # Read in an image and compute a luminance value. The image is extracted --- - colors = vtkNamedColors() - - # create a sphere - sphere = vtkSphere() - sphere.SetRadius(1) - sphere.SetCenter(1, 0, 0) --- - colors = vtkNamedColors() - - # create an ellipsoid using a implicit quadric - quadric = vtkQuadric() - quadric.SetCoefficients(0.5, 1, 0.2, 0, 0.1, 0, 0, 0.2, 0, 0) - --- - colors = vtkNamedColors() - - sphere = vtkSphere() - sphere.SetCenter(0, 0, 0) - sphere.SetRadius(0.5) - --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor("BkgColor", [51, 77, 102, 255]) - - sphere = vtkSphere() --- - colors = vtkNamedColors() - - implicitFunction = vtkSuperquadric() - implicitFunction.SetPhiRoundness(2.5) - implicitFunction.SetThetaRoundness(.5) - --- - colors = vtkNamedColors() - - # Generate an image data set with multiple attribute arrays to probe and view - rt = vtkRTAnalyticSource() - rt.SetWholeExtent(-3, 3, -3, 3, -3, 3) - grad = vtkImageGradient() --- - colors = vtkNamedColors() - - # Generate an example image data set with multiple attribute arrays to probe - # and view. - # This is where you would put your reader instead of this rt->elev pipeline... - rt = vtkRTAnalyticSource() --- - colors = vtkNamedColors() - - source = vtkRandomGraphSource() - source.DirectedOff() - source.SetNumberOfVertices(100) - source.SetEdgeProbability(0) # Basically generates a tree --- - colors = vtkNamedColors() - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - source.Update() --- - colors = vtkNamedColors() - - source = vtkSphereSource() - source.SetCenter(0, 0, 0) - source.SetRadius(1) - source.Update() --- - colors = vtkNamedColors() - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - iren = vtkRenderWindowInteractor() - --- - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - lut = get_diverging_lut('cool_warm') - # lut = get_diverging_lut1('DarkRed', 'Gainsboro', 'Green') - --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) --- - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - lut = get_diverging_lut('cool_warm') - # lut = get_diverging_lut1('DarkRed', 'Gainsboro', 'Green') - --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d(start)) - p2 = [0.5] + list(colors.GetColor3d(mid)) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # create a rendering window and renderer --- - colors = vtkNamedColors() - - input_filename = get_program_parameters() - - # Read the DICOM file - reader = vtkDICOMImageReader() --- - colors = vtkNamedColors() - reader = vtkDICOMImageReader() - folder = get_program_parameters() - # Read DICOM files in the specified directory - reader.SetDirectoryName(folder) - reader.Update() --- - colors = vtkNamedColors() - - # Input file and variable - filename, nodal_var = get_program_parameters() - - # Read Exodus Data --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - # Read the source file. - reader = vtkXMLImageDataReader() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - # Create the reader for the data. - print('Loading ', filename) --- - colors = vtkNamedColors() - - reader = vtkMultiBlockPLOT3DReader() - reader.SetXYZFileName(xyzFile) - reader.SetQFileName(qFile) - reader.SetScalarFunctionNumber(100) --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - # Read all the data from the file - reader = vtkXMLPolyDataReader() --- - colors = vtkNamedColors() - - # vtkSLCReader to read. - reader = vtkSLCReader() - reader.SetFileName(InputFilename) - reader.Update() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - reader = vtkSTLReader() - reader.SetFileName(filename) --- - colors = vtk.vtkNamedColors() - - file_name = get_program_parameters() - - # Read the source file. - reader = vtk.vtkXMLUnstructuredGridReader() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - reader = vtkXMLPolyDataReader() - reader.SetFileName(filename) --- - colors = vtkNamedColors() - - # Read the dataset. - reader = vtkHDFReader() - reader.SetFileName(fn) - reader.Update() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - sphereSource = vtkSphereSource() - sphereSource.Update() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - sphereSource = vtkSphereSource() - sphereSource.Update() --- - colors = vtkNamedColors() - - file_name, start_label, end_label = get_program_parameters() - if start_label > end_label: - end_label, start_label = start_label, end_label - --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('BkgColor', [51, 77, 102, 255]) - --- - colors = vtkNamedColors() - - file_name = get_program_parameters() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) --- - colors = vtkNamedColors() - diskSource = vtkDiskSource() - diskSource.Update() - - featureEdges = vtkFeatureEdges() - featureEdges.SetInputConnection(diskSource.GetOutputPort()) --- - colors = vtkNamedColors() - backgroundColor = colors.GetColor3d('steel_blue') - boundaryColor = colors.GetColor3d('Banana') - clipColor = colors.GetColor3d('Tomato') - - if filePath and os.path.isfile(filePath): --- - colors = vtkNamedColors() - - # Create polydata to slice the grid with. In this case, use a cone. This could - # be any polydata including a stl file. - cone = vtkConeSource() - cone.SetResolution(20) --- - colors = vtkNamedColors() - - # Create polydata to slice the grid with. In this case, use a cone. This - # could - # be any polydata including a stl file. - cone = vtkConeSource() --- - named_colors = vtkNamedColors() - - # Create a grid points - points = vtkPoints() - GridSize = 20; - xx = 0.0 --- - colors = vtkNamedColors() - backFaceColor = colors.GetColor3d('Gold') - inputActorColor = colors.GetColor3d('NavajoWhite') - decimatedActorColor = colors.GetColor3d('NavajoWhite') - # colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) - # colors.SetColor('rightBkg', [0.4, 0.5, 0.6, 1.0]) --- - colors = vtkNamedColors() - - # Set the background color. - # colors.SetColor('bkg', [0.2, 0.3, 0.4, 1.0]) - - # Create a sphere to deform --- - colors = vtkNamedColors() - - points_reader = vtkDelimitedTextReader() - points_reader.SetFileName(points_fn) - points_reader.DetectNumericColumnsOn() - points_reader.SetFieldDelimiterCharacters('\t') --- - colors = vtkNamedColors() - - # Create a property to be used for the back faces. Turn off all - # shading by specifying 0 weights for specular and diffuse. Max the - # ambient. - back_faces = vtkProperty() --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - renderer = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - # To see the line - lineMapper = vtkPolyDataMapper() - lineMapper.SetInputData(polydata) - --- - colors = vtkNamedColors() - - reader = vtkPNGReader() - if not reader.CanReadFile(file_name): - print('Error: Could not read', file_name) - return --- - colors = vtkNamedColors() - - # Generate some "random" points. - points = vtkPoints() - randomSequence = vtkMinimalStandardRandomSequence() - randomSequence.SetSeed(1) --- - colors = vtkNamedColors() - ren.SetBackground(colors.GetColor3d('Burlywood')) - - ren_win.Render() - - iren.Start() --- - colors = vtkNamedColors() - - colors.SetColor('SkinColor', [240, 184, 160, 255]) - colors.SetColor('BackfaceColor', [255, 229, 200, 255]) - colors.SetColor('BkgColor', [51, 77, 102, 255]) - --- - colors = vtkNamedColors() - - reader = vtkDataObjectReader() - reader.SetFileName(ifn) - - size = 3187 # maximum number possible --- - colors = vtkNamedColors() - - colors.SetColor('PopColor', [230, 230, 230, 255]) - - fileName = get_program_parameters() - --- - colors = vtkNamedColors() - - dicom_dir, iso_value = get_program_parameters() - if iso_value is None and dicom_dir is not None: - print('An ISO value is needed.') - return () --- - colors = vtkNamedColors() - ren.SetBackground(colors.GetColor3d('Burlywood')) - - ren_win.Render() - - iren.Start() --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - renderer = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - # Get the location of the click (in window coordinates) - pos = self.GetInteractor().GetEventPosition() - - picker = vtkCellPicker() --- - colors = vtkNamedColors() - - plane_source = vtkPlaneSource() - plane_source.Update() - - triangle_filter = vtkTriangleFilter() --- -colors = vtkNamedColors() -NUMBER_OF_SPHERES = 10 - - -class MouseInteractorHighLightActor(vtkInteractorStyleTrackballCamera): - --- - colors = vtkNamedColors() - - # A renderer and render window - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('SteelBlue')) - --- - colors = vtkNamedColors() - - renwin = vtkRenderWindow() - renwin.SetWindowName('MultiplePlots') - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renwin) --- - colors = vtkNamedColors() - - view = vtkContextView() - view.GetRenderer().SetBackground(colors.GetColor3d('SlateGray')) - view.GetRenderWindow().SetSize(400, 300) - --- - colors = vtkNamedColors() - - numTuples = 12 - - bitter = vtkFloatArray() - bitter.SetNumberOfTuples(numTuples) --- - colors = vtkNamedColors() - - chart = vtkChartXYZ() - chart.SetGeometry(vtkRectf(10.0, 10.0, 630, 470)) - - plot = vtkPlotSurface() --- - colors = vtkNamedColors() - - src_fn, tgt_fn = get_program_parameters() - print('Loading source:', src_fn) - source_polydata = read_poly_data(src_fn) - # Save the source polydata in case the alignment process does not improve --- - colors = vtkNamedColors() - - operation, fn1, fn2 = get_program_parameters() - if fn1 and fn2: - poly1 = ReadPolyData(fn1) - tri1 = vtkTriangleFilter() --- - colors = vtkNamedColors() - outsideColor = colors.GetColor3d('Crimson') - insideColor = colors.GetColor3d('Banana') - borderColor = colors.GetColor3d('Mint') - surfaceColor = colors.GetColor3d('Peacock') - backgroundColor = colors.GetColor3d('Silver') --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() --- - colors = vtkNamedColors() - colors.SetColor("ParaViewBkg", [82, 87, 110, 255]) - - window_width = 1024 - window_height = 512 - --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) --- - colors = vtkNamedColors() - - # We are going to handle two different sources. - # The first source is a superquadric source. - torus = vtkSuperquadricSource() - torus.SetCenter(0.0, 0.0, 0.0) --- - colors = vtkNamedColors() - # Colour transfer function. - ctf = vtkColorTransferFunction() - ctf.SetColorSpaceToDiverging() - p1 = [0.0] + list(colors.GetColor3d('MidnightBlue')) - p2 = [0.5] + list(colors.GetColor3d('Gainsboro')) --- - colors = vtkNamedColors() - - # Create a mapper and actor. - mapper = vtkPolyDataMapper() - mapper.SetInputData(source) - mapper.SetScalarModeToUsePointFieldData() --- - colors = vtkNamedColors() - lineColor = colors.GetColor3d('peacock') - modelColor = colors.GetColor3d('silver') - backgroundColor = colors.GetColor3d('wheat') - - modelSource = vtkSphereSource() --- - colors = vtkNamedColors() - - point_source = vtkPointSource() - - point_source.SetNumberOfPoints(50) - point_source.Update() --- - colors = vtkNamedColors() - - # colors.SetColor('leftBkg', [0.6, 0.5, 0.4, 1.0]) - # colors.SetColor('centreBkg', [0.3, 0.1, 0.4, 1.0]) - # colors.SetColor('rightBkg', [0.4, 0.5, 0.6, 1.0]) - --- - colors = vtkNamedColors() - - # Create a cube - cube = vtkSphereSource() - cube.SetRadius(50) - cube.SetThetaResolution(100) --- - colors = vtkNamedColors() - - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(1.0) - sphereSource.Update() --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.SetWindowName('Outline') --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - # Create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - nc = vtkNamedColors() - - # Make a 32 x 32 grid - size = 32 - - rn = vtkMinimalStandardRandomSequence() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() --- - colors = vtkNamedColors() - - filename = get_program_parameters() - - # setup points and vertices - Points = vtkPoints() --- - colors = vtkNamedColors() - - # Create a line - lineSource = vtkLineSource() - lineSource.SetPoint1(1.0, 0.0, 0.0) - lineSource.SetPoint2(.0, 1.0, 0.0) --- - colors = vtkNamedColors() - - points = vtkPoints() - points.InsertNextPoint(0.0, 0.0, 0.0) - points.InsertNextPoint(1.0, 0.0, 0.0) - points.InsertNextPoint(2.0, 0.0, 0.0) --- - colors = vtkNamedColors() - - # Create a grid - grid = vtkRectilinearGrid() - grid.SetDimensions(2, 3, 1) - --- - colors = vtkNamedColors() - - x = [-1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542, -0.911458, -0.859375, -0.807292, -0.755208, - -0.703125, -0.651042, -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542, -0.286458, -0.234375, - -0.182292, -0.130209, -0.078125, -0.026042, 0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458, - 0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958, 0.651042, 0.703125, 0.755208, 0.807292, 0.859375, --- - colors = vtkNamedColors() - - # Create a grid - grid = vtkRectilinearGrid() - - grid.SetDimensions(2, 3, 2) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('Bkg', [26, 51, 102, 255]) - - # Create the rendering objects. --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a visualization - # pipeline (it is a source process object); it produces data (output type is --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a visualization - # pipeline (it is a source process object); it produces data (output type is --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the renderers. - renderers = OrderedDict() --- - colors = vtkNamedColors() - sphere = vtkSphereSource() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(sphere.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) --- - colors = vtkNamedColors() - cylinder = vtkCylinderSource() - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(cylinder.GetOutputPort()) - actor = vtkActor() - actor.SetMapper(mapper) --- - colors = vtkNamedColors() - reader = vtkOBJReader() - reader.SetFileName(fileName) - mapper = vtkPolyDataMapper() - mapper.SetInputConnection(reader.GetOutputPort()) - actor = vtkActor() --- - colors = vtkNamedColors() - - mapper = vtkPolyDataMapper() - mapper.SetInputData(pd) - - actor = vtkActor() --- - colors = vtkNamedColors() - - # Points start at upper right and proceed anti-clockwise. - points = vtkPoints() - points.SetNumberOfPoints(4) - points.InsertPoint(0, 1, 1, 0) --- - colors = vtkNamedColors() - - # Make the slab and axes actors. - cube_source = vtkCubeSource() - cube_source.SetXLength(4.0) - cube_source.SetYLength(9.0) --- - colors = vtkNamedColors() - - renderer = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) --- - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('CubeColor', [250, 128, 114, 255]) - colors.SetColor('BkgColor', [230, 230, 230, 255]) - --- - colors = vtkNamedColors() - - colors.SetColor('A1Diff', [255, 204, 77, 255]) - colors.SetColor('A2Amb', [51, 51, 255, 255]) - colors.SetColor('A2Diff', [51, 255, 204, 255]) - colors.SetColor('A3Amb', [128, 166, 255, 255]) --- - colors = vtkNamedColors() - - iren = vtkRenderWindowInteractor() - renWin = vtkRenderWindow() - renWin.SetMultiSamples(0) - --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - - ren_win = vtkRenderWindow() --- - colors = vtkNamedColors() - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - ren.AutomaticLightCreationOff() - --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - colors.SetColor('DarkTeal', [0, 128, 77, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) --- - colors = vtkNamedColors() - colors.SetColor('Brass', [184, 115, 51, 255]) - - ren = vtkOpenGLRenderer() - ren.SetBackground(colors.GetColor3d('Black')) - --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - # Default background color. --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - - fn, surface_name, use_cubemap, use_tonemapping = get_program_parameters() --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) --- - colors = vtkNamedColors() - - # Default background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - colors.SetColor('VTKBlue', [6, 79, 141, 255]) - # Let's make a complementary colour to VTKBlue. --- - colors = vtkNamedColors() - - slider = vtkSliderRepresentation2D() - - slider.SetMinimumValue(properties.minimum_value) - slider.SetMaximumValue(properties.maximum_value) --- - colors = vtkNamedColors() - - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(xyzFn) - pl3d.SetQFileName(qFn) - pl3d.SetScalarFunctionNumber(100) --- - colors = vtkNamedColors() - # Set the background color. - colors.SetColor('BkgColor', [26, 51, 102, 255]) - # colors.SetColor('BkgColor', [60, 93, 144, 255]) - - ren1 = vtkRenderer() --- - colors = vtkNamedColors() - colors.SetColor('HighNoonSun', [255, 255, 251, 255]) # Color temp. 5400°K - colors.SetColor('100W Tungsten', [255, 214, 170, 255]) # Color temp. 2850°K - - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Silver')) --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('bkg', [26, 51, 102, 255]) - - # The following lines create a sphere represented by polygons. --- - colors = vtkNamedColors() - - lines = vtkLineSource() - # Create two points, P0 and P1 - p0 = [1.0, 0.0, 0.0] - p1 = [5.0, 0.0, 0.0] --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - renderer1 = vtkRenderer() - renderer1.SetViewport(0.0, 0.0, 0.5, 1.0) --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) --- - colors = vtkNamedColors() - - cubeSource = vtkCubeSource() - cubeSource.SetXLength(4.0) - cubeSource.SetYLength(9.0) - cubeSource.SetZLength(1.0) --- - colors = vtkNamedColors() - # Set the background color. - colors.SetColor('BkgColor1', [60, 93, 144, 255]) - colors.SetColor('BkgColor2', [26, 51, 102, 255]) - - ren = vtkRenderer() --- - colors = vtkNamedColors() - - points = vtkPoints() - - grid_size = 8 - counter = 0 --- - colors = vtkNamedColors() - - rMin = 0.5 - rMax = 1.0 - dims = [13, 11, 11] - --- - colors = vtkNamedColors() - - renderer = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(renderer) - iren = vtkRenderWindowInteractor() --- - colors = vtkNamedColors() - - # Setup the render window, renderer, and interactor. - renderer = vtkRenderer() - renderWindow = vtkRenderWindow() - renderWindow.AddRenderer(renderer) --- - colors = vtkNamedColors() - - renWin = vtkRenderWindow() - - iren = vtkRenderWindowInteractor() - iren.SetRenderWindow(renWin) --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # hidden sphere - sphere1 = vtkSphereSource() --- - colors = vtkNamedColors() - - # Load in the texture map. A texture is any unsigned char image. If it - # is not of this type, you will have to map it through a lookup table - # or by using vtkImageShiftScale. - # --- - colors = vtkNamedColors() - - # Read the data. - pl3d = vtkMultiBlockPLOT3DReader() - pl3d.SetXYZFileName(dataFn1) - pl3d.SetQFileName(dataFn2) --- - colors = vtkNamedColors() - - # - # Now we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource "cone" is part of a - # visualization pipeline (it is a source process object) it produces data --- - colors = vtkNamedColors() - - # - # The pipeline creation is documented in Tutorial_Step1. - # - cone = vtkConeSource() --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource "cone" is part of a - # visualization pipeline (it is a source process object) it produces data --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data --- - colors = vtkNamedColors() - - # - # Next we create an instance of vtkConeSource and set some of its - # properties. The instance of vtkConeSource 'cone' is part of a - # visualization pipeline (it is a source process object) it produces data --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() --- - colors = vtkNamedColors() - renderer = vtkRenderer() - renderer.SetBackground(colors.GetColor3d('Wheat')) - renderer.UseHiddenLineRemovalOn() - - renderWindow = vtkRenderWindow() --- - colors = vtkNamedColors() - - x = [[0, 0, 0], [1, 0, 0], [2, 0, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [0, 0, 1], [1, 0, 1], [2, 0, 1], [0, 1, 1], - [1, 1, 1], [2, 1, 1], [0, 1, 2], [1, 1, 2], [2, 1, 2], [0, 1, 3], [1, 1, 3], [2, 1, 3], [0, 1, 4], [1, 1, 4], - [2, 1, 4], [0, 1, 5], [1, 1, 5], [2, 1, 5], [0, 1, 6], [1, 1, 6], [2, 1, 6]] - # Here we have kept consistency with the Cxx example of the same name. --- - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(2) --- - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('ParaViewBkg')) - ren_win = vtkRenderWindow() --- - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) --- - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - ren_win = vtkRenderWindow() - ren_win.SetSize(640 * 2, 480 * 2) - ren_win.SetWindowName('RescaleReverseLUT') --- - colors = vtkNamedColors() - - cone = vtkConeSource() - cone.SetHeight(3.0) - cone.SetRadius(1.0) - cone.SetResolution(10) --- - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - --- - colors = vtkNamedColors() - - polyData = ReadPolyData(pd_fn) - mapper = vtkPolyDataMapper() - mapper.SetInputData(polyData) - --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - # We store background colors in a vector. Then we extract the red, green and - # blue components later when coloring the reneder background. - rendererColors = list() - colorSeries = vtkColorSeries() --- - colors = vtkNamedColors() - - # We begin by creating the data we want to render. - # For this tutorial, we create a 3D-image containing three overlaping cubes. - # This data can of course easily be replaced by data from a medical CT-scan or anything else three dimensional. - # The only limit is that the data must be reduced to unsigned 8 bit or 16 bit integers. --- - colors = vtkNamedColors() - colors.SetColor('ParaViewBkg', 82, 87, 110, 255) - - sphere = vtkSphereSource() - sphere.SetThetaResolution(64) - sphere.SetPhiResolution(32) --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create a rendering window, renderer and interactor. - ren = vtkRenderer() --- - colors = vtkNamedColors() - - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - iren = vtkRenderWindowInteractor() --- - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - # Demonstrate the use of clipping on polygonal data - # - - # create pipeline --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - - ren1 = vtkRenderer() --- - colors = vtkNamedColors() - - aren = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Now create the RenderWindow, Renderer and Interactor. - # --- - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - # Create a cube - cube = vtkCubeSource() - cube.SetXLength(40) - cube.SetYLength(30) --- - colors = vtkNamedColors() - - fileName, numberOfCuts = get_program_parameters() - reader = vtkXMLPolyDataReader() - reader.SetFileName(fileName) - reader.Update() --- - colors = vtkNamedColors() - - reader = vtkXMLPolyDataReader() - reader.SetFileName(inputFilename) - reader.Update() - --- - colors = vtkNamedColors() - - # Setup the coordinates of eight points - # (the two faces must be in counter clockwise order as viewed from the - # outside) - pointCoords = [ --- - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # This example shows how to use decimation to reduce a polygonal mesh. We also - # use mesh smoothing and generate surface normals to give a pleasing result. --- - colors = vtkNamedColors() - - # Read a vtk file - # - plate = vtkPolyDataReader() - plate.SetFileName(file_name) --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - ren1 = vtkRenderer() - - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren = vtkRenderer() - ren_win = vtkRenderWindow() - ren_win.AddRenderer(ren) --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - - ren1 = vtkRenderer() --- - colors = vtkNamedColors() - - # Create lines which serve as the 'seed' geometry. The lines spell the - # word 'hello'. - # - reader = vtkPolyDataReader() --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - # - ren1 = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - # Create implicit function primitives. These have been carefully placed to - # give the effect that we want. We are going to use various combinations of - # these functions to create the shape we want for example, we use planes - # intersected with a cone (which is infinite in extent) to get a finite --- - colors = vtkNamedColors() - - # Read the CT data of the human head. - reader = vtkMetaImageReader() - reader.SetFileName(fileName) - reader.Update() --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and Interactor. - ren1 = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren1) --- - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # --- - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # --- - colors = vtkNamedColors() - - xyxFile, qFile = get_program_parameters() - - # Read the data. - # --- - color = vtkNamedColors() - - # Rotate the final figure 0, 90, 180, 270 degrees. - rotation = abs(int(rotation)) - if rotation > 3: - rotation = 0 --- - colors = vtkNamedColors() - - textureFile, motorFile = get_program_parameters() - - # Create the Renderer, RenderWindow and RenderWindowInteractor. - ren = vtkRenderer() --- - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] --- - colors = vtkNamedColors() - # Set the furniture colors, matching those in the VTKTextBook. - tableTopColor = [0.59, 0.427, 0.392] - filingCabinetColor = [0.8, 0.8, 0.6] - bookShelfColor = [0.8, 0.8, 0.6] - windowColor = [0.3, 0.3, 0.5] --- - colors = vtkNamedColors() - - # Create the pipeline. - reader = vtkMCubesReader() - reader.SetFileName(fileName) - if not noConnectivity: --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the pipeline. - reader = vtkMCubesReader() --- - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('PlateColor', [255, 160, 140, 255]) - colors.SetColor('BkgColor', [65, 99, 149, 255]) - --- - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # Create the pipeline. - # --- - colors = vtkNamedColors() - - aren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(aren) - iren = vtkRenderWindowInteractor() --- - colors = vtkNamedColors() - - fran = vtkPolyDataReader() - fran.SetFileName(fileName) - - normals = vtkPolyDataNormals() --- - colors = vtkNamedColors() - - fileName = get_program_parameters() - - # Create the RenderWindow, Renderer and Interactor. - # --- - colors = vtkNamedColors() - - fileNames, useRibbons = get_program_parameters() - useTubes = not useRibbons - - # Set up the stocks --- - colors = vtkNamedColors() - - fileName1, fileName2, numOfStreamLines, illustration = get_program_parameters() - if illustration: - numOfStreamLines = 25 - --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and interactive renderer. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - # Create the RenderWindow, Renderer and interactive renderer. - # - ren = vtkRenderer() - renWin = vtkRenderWindow() --- - colors = vtkNamedColors() - - # Set the background color. - colors.SetColor('BkgColor', [65, 99, 149, 255]) - - # Read a vtk file --- - colors = vtkNamedColors() - - fileName1, fileName2 = get_program_parameters() - - # Here we read data from a annular combustor. A combustor burns fuel and air - # in a gas turbine (e.g., a jet engine) and the hot gas eventually makes its --- - colors = vtkNamedColors() - - # Here we read the file keeping only the alpha characters - # and calculate the frequency of each letter. - with open(fileName) as f: - freq = Counter() --- - colors = vtkNamedColors() - - # Set up the renderer, window, and interactor. - # - ren = vtkRenderer() - ren.SetBackground(colors.GetColor3d('Wheat')) --- - nc = vtkNamedColors() - - lut = vtkLookupTable() - lut.SetNumberOfTableValues(tableSize) - lut.Build() - --- - nc = vtkNamedColors() - - # Provide some geometry - resolution = 3 - - plane11 = vtkPlaneSource() --- - colors = vtkNamedColors() - - # For testing - rng = vtkMinimalStandardRandomSequence() - # rng.SetSeed(8775070) - rng.SetSeed(5127) --- - colors = vtkNamedColors() - - fileName1, fileName2, fileName3 = get_program_parameters() - aRenderer = vtkRenderer() - aRenderWindow = vtkRenderWindow() - aRenderWindow.AddRenderer(aRenderer) --- - colors = vtkNamedColors() - - thickness = list() - displacement = list() - for i in range(0, 10): - thickness.append('thickness' + str(i)) --- - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor('AzimuthArrowColor', [255, 77, 77, 255]) - colors.SetColor('ElevationArrowColor', [77, 255, 77, 255]) - colors.SetColor('RollArrowColor', [255, 255, 77, 255]) --- - colors = vtkNamedColors() - - # Set the colors. - colors.SetColor("AzimuthArrowColor", [255, 77, 77, 255]) - colors.SetColor("ElevationArrowColor", [77, 255, 77, 255]) - colors.SetColor("RollArrowColor", [255, 255, 77, 255]) --- - colors = vtkNamedColors() - - # Create a sphere - sphereSource = vtkSphereSource() - sphereSource.SetCenter(0.0, 0.0, 0.0) - sphereSource.SetRadius(10) --- - colors = vtkNamedColors() - - # Generate an image data set with multiple attribute arrays to probe and view - # We will glyph these points with cones and scale/orient/color them with the - # various attributes - --- - colors = vtkNamedColors() - - sphere0 = vtkSphereSource() - sphere0.SetRadius(0.29) - sphere0.SetPhiResolution(31) - sphere0.SetThetaResolution(31) --- - colors = vtkNamedColors() - - # create a rendering window and renderer - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) --- - colors = vtkNamedColors() - - ren = vtkRenderer() - renWin = vtkRenderWindow() - renWin.AddRenderer(ren) - renWin.SetSize(640, 480) --- - self.nc = vtkNamedColors() - self.htmlRGBA = HTMLToFromRGBAColor() - - @staticmethod - def MakeHTMLStyle(): - s = '