Skip to content
Snippets Groups Projects
Commit d0e4fbe3 authored by Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin
Browse files

STYLE: src/Python: Fix more issue running autopep8 --aggressive

Former-commit-id: 70dc5752
parent 70653ef3
No related branches found
No related tags found
No related merge requests found
[flake8]
max-line-length = 150
ignore =
# E111 indentation is not a multiple of four
E111,
# E114 indentation is not a multiple of four (comment)
E114,
# E122 continuation line missing indentation or outdented
E122,
# E127 continuation line over-indented for visual indent
E127,
# E131 continuation line unaligned for hanging indent
E131,
# E201 whitespace after '('
E201,
# E201 whitespace after '['
E201,
# E202 whitespace before ')'
E202,
# E203 whitespace before ','
E203,
# E211 whitespace before '('
E211,
# E221 multiple spaces before operator
E221,
# E225 missing whitespace around operator
E225,
# E231 missing whitespace after ','
E231,
# E251 unexpected spaces around keyword / parameter equals
E251,
# E261 at least two spaces before inline comment
E261,
# E262 inline comment should start with '# '
E262,
# E241 multiple spaces after ','
E241,
# E265 block comment should start with '# '
E265,
# E266 too many leading '#' for block comment
E266,
# E302 expected 2 blank lines, found 1
E302,
# E303 too many blank lines (2)
E303,
# E303 too many blank lines (3)
E303,
# E303 too many blank lines (4)
E303,
# E305 expected 2 blank lines after class or function definition, found 1
E305,
# E401 multiple imports on one line
E401,
# E501 line too long
E501,
# E701 multiple statements on one line (colon)
E701,
# E702 multiple statements on one line (semicolon)
E702,
# E703 statement ends with a semicolon
E703,
# E721 do not compare types, use 'isinstance()'
E721,
# E999 SyntaxError
......@@ -93,11 +43,3 @@ ignore =
F841,
# F841 local variable 'timerId' is assigned to but never used
F841,
# W191 indentation contains tabs
W191,
# W291 trailing whitespace
W291,
# W293 blank line contains whitespace
W293,
# W391 blank line at end of file
W391,
......@@ -6,11 +6,11 @@ import random
'''
There are two alternative ways to apply the transform.
1) Use vtkTransformPolyDataFilter to create a new transformed polydata.
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.
2) Apply the transform directly to the actor using vtkProp3D's SetUserMatrix.
No new data is produced.
To do this, set USER_MATRIX = False
'''
......
......@@ -81,7 +81,7 @@ def UpdateRenderWindows(obj, event):
# Set up callback to update 3d render window when selections are changed in
# parallel coordinates view
annotationLink.AddObserver("AnnotationChangedEvent", UpdateRenderWindows)
annotationLink.AddObserver("AnnotationChangedEvent", UpdateRenderWindows)
def ToggleInspectors(obj, event):
......
......@@ -8,25 +8,25 @@ Two different surfaces are used in this demonstration with each surface coloured
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 similar
a set of colours for the vtkLookUp tables. We have used a diverging colour space similar
to that in ParaView.
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 red 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 red areas have a positive Gaussian curvature. In the case of the mean curvature the
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 red 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.
This example also demonstrates the use of lists and the linking of the elements of the
lists together to form a pipeline.
'''
import vtk
......
......@@ -62,6 +62,6 @@ renWin.SetSize(600, 600)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
ren.SetBackground(0, 0, 0)
ren.GetActiveCamera().SetPosition(223, -122, -91)
ren.GetActiveCamera().SetPosition(223, -122, -91)
renWin.Render()
iren.Start()
......@@ -76,12 +76,12 @@ def get_program_parameters():
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.
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.')
......
......@@ -71,7 +71,7 @@ def as_triangles(indices, cellarray, level, data):
cellarray.InsertNextCell(triangle)
data.InsertNextValue(level)
as_triangles(indices[0: stride], cellarray, level + 1, data)
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)
......@@ -111,13 +111,13 @@ if __name__ == "__main__":
# This is the starting triangle.
t = vtk.vtkTriangle()
t.GetPointIds().SetId(0, 0)
t.GetPointIds().SetId(1, stride)
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[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)
......
......@@ -13,7 +13,7 @@ def GetProgramParameters():
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
......@@ -215,7 +215,7 @@ def MakeLUT(scalarRange):
def GlyphActor(source, glyphPoints, scalarRange, scaleFactor, lut):
"""
"""
Create the actor for glyphing the normals.
:param: source: the surface.
......@@ -281,7 +281,7 @@ def MakeLabel(textLabel, renWinSize):
"""
Create a label.
:param textLabel: The 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.
......@@ -305,7 +305,7 @@ def MakeAxesActor():
"""
Make an axis actor.
:return: The axis actor.
:return: The axis actor.
"""
axes = vtk.vtkAxesActor()
axes.SetShaftTypeToCylinder()
......
......@@ -79,7 +79,7 @@ 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..
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.')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment