Class: Kamelopard::ViewVolume

Inherits:
Object
  • Object
show all
Defined in:
lib/kamelopard/classes.rb

Overview

Supporting object for the PhotoOverlay class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(near, leftFov = -45,, rightFov = 45, bottomFov = -45,, topFov = 45) ⇒ ViewVolume

Returns a new instance of ViewVolume.



1445
1446
1447
1448
1449
1450
1451
# File 'lib/kamelopard/classes.rb', line 1445

def initialize(near, leftFov = -45, rightFov = 45, bottomFov = -45, topFov = 45)
    @leftFov = leftFov
    @rightFov = rightFov
    @bottomFov = bottomFov
    @topFov = topFov
    @near = near
end

Instance Attribute Details

#bottomFovObject

Returns the value of attribute bottomFov.



1444
1445
1446
# File 'lib/kamelopard/classes.rb', line 1444

def bottomFov
  @bottomFov
end

#leftFovObject

Returns the value of attribute leftFov.



1444
1445
1446
# File 'lib/kamelopard/classes.rb', line 1444

def leftFov
  @leftFov
end

#nearObject

Returns the value of attribute near.



1444
1445
1446
# File 'lib/kamelopard/classes.rb', line 1444

def near
  @near
end

#rightFovObject

Returns the value of attribute rightFov.



1444
1445
1446
# File 'lib/kamelopard/classes.rb', line 1444

def rightFov
  @rightFov
end

#topFovObject

Returns the value of attribute topFov.



1444
1445
1446
# File 'lib/kamelopard/classes.rb', line 1444

def topFov
  @topFov
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
# File 'lib/kamelopard/classes.rb', line 1453

def to_kml(elem = nil)
    p = REXML::Element.new 'ViewVolume'
    {
        :near => @near,
        :leftFov => @leftFov,
        :rightFov => @rightFov,
        :topFov => @topFov,
        :bottomFov => @bottomFov
    }.each do |k, v|
        d = REXML::Element.new k.to_s
        d.text = v
        p << d
    end
    elem << p unless elem.nil?
    p
end