Commit d0658e0b020c37c7c50e56e6e2d78fc3e4a035bb

Authored by tfmoraes
1 parent a02ad1c8

STL: Using colour instead of color

Showing 1 changed file with 18 additions and 18 deletions   Show diff stats
invesalius/data/measures.py
... ... @@ -22,12 +22,12 @@ class CirclePointRepresentation(object):
22 22 """
23 23 This class represents a circle that indicate a point in the surface
24 24 """
25   - def __init__(self, color=(1, 0, 0), radius=1.0):
  25 + def __init__(self, colour=(1, 0, 0), radius=1.0):
26 26 """
27   - color: the color of the representation
  27 + colour: the colour of the representation
28 28 radius: the radius of circle representation
29 29 """
30   - self.color = color
  30 + self.colour = colour
31 31 self.radius = radius
32 32  
33 33 def GetRepresentation(self, x, y, z):
... ... @@ -47,7 +47,7 @@ class CirclePointRepresentation(object):
47 47  
48 48 a = vtk.vtkActor2D()
49 49 a.SetMapper(m)
50   - a.GetProperty().SetColor(self.color)
  50 + a.GetProperty().SetColor(self.colour)
51 51  
52 52 return a
53 53  
... ... @@ -55,14 +55,14 @@ class CrossPointRepresentation(object):
55 55 """
56 56 This class represents a cross that indicate a point in the surface
57 57 """
58   - def __init__(self, camera, color=(1, 0, 0), size=1.0):
  58 + def __init__(self, camera, colour=(1, 0, 0), size=1.0):
59 59 """
60   - color: the color of the representation
  60 + colour: the colour of the representation
61 61 size: the size of the representation
62 62 camera: the active camera, to get the orientation to draw the cross
63 63 """
64 64 self.camera = camera
65   - self.color = color
  65 + self.colour = colour
66 66 self.size = size
67 67  
68 68 def GetRepresentation(self, x, y, z):
... ... @@ -114,12 +114,12 @@ class CrossPointRepresentation(object):
114 114  
115 115 a = vtk.vtkActor2D()
116 116 a.SetMapper(m)
117   - a.GetProperty().SetColor(self.color)
  117 + a.GetProperty().SetColor(self.colour)
118 118 return a
119 119  
120 120 class LinearMeasure(object):
121   - def __init__(self, render, color=(1, 0, 0), representation=None):
122   - self.color = color
  121 + def __init__(self, render, colour=(1, 0, 0), representation=None):
  122 + self.colour = colour
123 123 self.points = []
124 124 self.point_actor1 = None
125 125 self.point_actor2 = None
... ... @@ -128,7 +128,7 @@ class LinearMeasure(object):
128 128 if not representation:
129 129 representation = CirclePointRepresentation()
130 130 self.representation = representation
131   - print color
  131 + print colour
132 132  
133 133 def SetPoint1(self, x, y, z):
134 134 self.points.append((x, y, z))
... ... @@ -159,7 +159,7 @@ class LinearMeasure(object):
159 159  
160 160 a = vtk.vtkActor2D()
161 161 a.SetMapper(m)
162   - a.GetProperty().SetColor(self.color)
  162 + a.GetProperty().SetColor(self.colour)
163 163 self.line_actor = a
164 164 self.render.AddActor(self.line_actor)
165 165  
... ... @@ -171,7 +171,7 @@ class LinearMeasure(object):
171 171 textsource = vtk.vtkTextSource()
172 172 textsource.SetText(text)
173 173 textsource.SetBackgroundColor((250/255.0, 247/255.0, 218/255.0))
174   - textsource.SetForegroundColor(self.color)
  174 + textsource.SetForegroundColor(self.colour)
175 175  
176 176 m = vtk.vtkPolyDataMapper2D()
177 177 m.SetInputConnection(textsource.GetOutputPort())
... ... @@ -199,8 +199,8 @@ class LinearMeasure(object):
199 199  
200 200  
201 201 class AngularMeasure(object):
202   - def __init__(self, render, color=(1, 0, 0), representation=None):
203   - self.color = color
  202 + def __init__(self, render, colour=(1, 0, 0), representation=None):
  203 + self.colour = colour
204 204 self.points = [0, 0, 0]
205 205 self.number_of_points = 0
206 206 self.point_actor1 = None
... ... @@ -211,7 +211,7 @@ class AngularMeasure(object):
211 211 if not representation:
212 212 representation = CirclePointRepresentation()
213 213 self.representation = representation
214   - print color
  214 + print colour
215 215  
216 216 def SetPoint1(self, x, y, z):
217 217 self.points[0] = (x, y, z)
... ... @@ -256,7 +256,7 @@ class AngularMeasure(object):
256 256  
257 257 a = vtk.vtkActor2D()
258 258 a.SetMapper(m)
259   - a.GetProperty().SetColor(self.color)
  259 + a.GetProperty().SetColor(self.colour)
260 260 self.line_actor = a
261 261 return a
262 262  
... ... @@ -296,7 +296,7 @@ class AngularMeasure(object):
296 296 textsource = vtk.vtkTextSource()
297 297 textsource.SetText(text)
298 298 textsource.SetBackgroundColor((250/255.0, 247/255.0, 218/255.0))
299   - textsource.SetForegroundColor(self.color)
  299 + textsource.SetForegroundColor(self.colour)
300 300  
301 301 m = vtk.vtkPolyDataMapper2D()
302 302 m.SetInputConnection(textsource.GetOutputPort())
... ...