Class: NumRu::DCLMouseLine

Inherits:
Object
  • Object
show all
Defined in:
lib/numru/dcl_mouse.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rxObject

Returns the value of attribute rx.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def rx
  @rx
end

#ryObject

Returns the value of attribute ry.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def ry
  @ry
end

#uxObject

Returns the value of attribute ux.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def ux
  @ux
end

#uyObject

Returns the value of attribute uy.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def uy
  @uy
end

#vxObject

Returns the value of attribute vx.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def vx
  @vx
end

#vyObject

Returns the value of attribute vy.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def vy
  @vy
end

#wxObject

Returns the value of attribute wx.



60
61
62
# File 'lib/numru/dcl_mouse.rb', line 60

def wx
  @wx
end

#wyObject

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