Class: Quad
- Inherits:
-
Object
- Object
- Quad
- Defined in:
- lib/r2d/quad.rb
Overview
quad.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#c1 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#c2 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#c3 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#c4 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#color ⇒ Object
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#x1 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#x2 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#x3 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#x4 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#y1 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#y2 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#y3 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
-
#y4 ⇒ Object
readonly
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right.
Instance Method Summary collapse
- #add ⇒ Object
-
#initialize(x1, y1, x2, y2, x3, y3, x4, y4, c = "white", visible = true) ⇒ Quad
constructor
A new instance of Quad.
- #remove ⇒ Object
Constructor Details
#initialize(x1, y1, x2, y2, x3, y3, x4, y4, c = "white", visible = true) ⇒ Quad
Returns a new instance of Quad.
14 15 16 17 18 19 |
# File 'lib/r2d/quad.rb', line 14 def initialize(x1, y1, x2, y2, x3, y3, x4, y4, c="white", visible=true) @x1, @y1, @x2, @y2, @x3, @y3, @x4, @y4 = x1, y1, x2, y2, x3, y3, x4, y4 @color = c update_color(c) if visible then add end end |
Instance Attribute Details
#c1 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def c1 @c1 end |
#c2 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def c2 @c2 end |
#c3 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def c3 @c3 end |
#c4 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def c4 @c4 end |
#color ⇒ Object
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def color @color end |
#x1 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def x1 @x1 end |
#x2 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def x2 @x2 end |
#x3 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def x3 @x3 end |
#x4 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def x4 @x4 end |
#y1 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def y1 @y1 end |
#y2 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def y2 @y2 end |
#y3 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def y3 @y3 end |
#y4 ⇒ Object (readonly)
x1,y1 == top left x2,y2 == top right x3,y3 == bottom left x4,y4 == bottom right
8 9 10 |
# File 'lib/r2d/quad.rb', line 8 def y4 @y4 end |