Class: NumRu::DCLMouseLine
- Inherits:
-
Object
- Object
- NumRu::DCLMouseLine
- Defined in:
- lib/numru/dcl_mouse.rb
Instance Attribute Summary collapse
-
#rx ⇒ Object
Returns the value of attribute rx.
-
#ry ⇒ Object
Returns the value of attribute ry.
-
#ux ⇒ Object
Returns the value of attribute ux.
-
#uy ⇒ Object
Returns the value of attribute uy.
-
#vx ⇒ Object
Returns the value of attribute vx.
-
#vy ⇒ Object
Returns the value of attribute vy.
-
#wx ⇒ Object
Returns the value of attribute wx.
-
#wy ⇒ Object
Returns the value of attribute wy.
Instance Method Summary collapse
-
#draw(type = 1, index = 1) ⇒ Object
Drawn in the V coordinate so that it will be a straight line on the display.
-
#initialize(num = 2) ⇒ DCLMouseLine
constructor
A new instance of DCLMouseLine.
Constructor Details
#initialize(num = 2) ⇒ DCLMouseLine
Returns a new instance of DCLMouseLine.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/numru/dcl_mouse.rb', line 46 def initialize(num=2) raise("Number of points must be 2 or greater") if num<2 @p = Array.new num.times{@p.push(DCLMousePt.new)} @ux = @p.collect{|p| p.ux} @uy = @p.collect{|p| p.uy} @vx = @p.collect{|p| p.vx} @vy = @p.collect{|p| p.vy} @rx = @p.collect{|p| p.rx} @ry = @p.collect{|p| p.ry} @wx = @p.collect{|p| p.wx} @wy = @p.collect{|p| p.wy} end |
Instance Attribute Details
#rx ⇒ Object
Returns the value of attribute rx.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def rx @rx end |
#ry ⇒ Object
Returns the value of attribute ry.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def ry @ry end |
#ux ⇒ Object
Returns the value of attribute ux.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def ux @ux end |
#uy ⇒ Object
Returns the value of attribute uy.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def uy @uy end |
#vx ⇒ Object
Returns the value of attribute vx.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def vx @vx end |
#vy ⇒ Object
Returns the value of attribute vy.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def vy @vy end |
#wx ⇒ Object
Returns the value of attribute wx.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def wx @wx end |
#wy ⇒ Object
Returns the value of attribute wy.
60 61 62 |
# File 'lib/numru/dcl_mouse.rb', line 60 def wy @wy end |
Instance Method Details
#draw(type = 1, index = 1) ⇒ Object
Drawn in the V coordinate so that it will be a straight line on the display
64 65 66 |
# File 'lib/numru/dcl_mouse.rb', line 64 def draw(type=1,index=1) DCL.sgplzv(vx,vy,type,index) end |