Class: Kamelopard::Tour
Overview
Corresponds to a KML gx:Tour object
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#last_abs_view ⇒ Object
Returns the value of attribute last_abs_view.
-
#name ⇒ Object
Returns the value of attribute name.
-
#playlist ⇒ Object
Returns the value of attribute playlist.
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#<<(a) ⇒ Object
Add another element to this Tour.
-
#initialize(name = nil, description = nil, no_wait = false) ⇒ Tour
constructor
A new instance of Tour.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?
Constructor Details
#initialize(name = nil, description = nil, no_wait = false) ⇒ Tour
Returns a new instance of Tour.
1815 1816 1817 1818 1819 1820 1821 1822 |
# File 'lib/kamelopard/classes.rb', line 1815 def initialize(name = nil, description = nil, no_wait = false) super() @name = name @description = description @playlist = [] DocumentHolder.instance.current_document.tours << self Wait.new(0.1, :comment => "This wait is automatic, and helps prevent animation glitches") unless no_wait end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
1813 1814 1815 |
# File 'lib/kamelopard/classes.rb', line 1813 def description @description end |
#icon ⇒ Object
Returns the value of attribute icon.
1813 1814 1815 |
# File 'lib/kamelopard/classes.rb', line 1813 def icon @icon end |
#last_abs_view ⇒ Object
Returns the value of attribute last_abs_view.
1813 1814 1815 |
# File 'lib/kamelopard/classes.rb', line 1813 def last_abs_view @last_abs_view end |
#name ⇒ Object
Returns the value of attribute name.
1813 1814 1815 |
# File 'lib/kamelopard/classes.rb', line 1813 def name @name end |
#playlist ⇒ Object
Returns the value of attribute playlist.
1813 1814 1815 |
# File 'lib/kamelopard/classes.rb', line 1813 def playlist @playlist end |
Instance Method Details
#<<(a) ⇒ Object
Add another element to this Tour
1825 1826 1827 1828 |
# File 'lib/kamelopard/classes.rb', line 1825 def <<(a) @playlist << a @last_abs_view = a.view if a.kind_of? FlyTo end |
#to_kml(elem = nil) ⇒ Object
1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 |
# File 'lib/kamelopard/classes.rb', line 1830 def to_kml(elem = nil) k = XML::Node.new 'gx:Tour' super k Kamelopard.kml_array(k, [ [ @name, 'name' ], [ @description, 'description' ], ]) p = XML::Node.new 'gx:Playlist' @playlist.map do |a| a.to_kml p end k << p elem << k unless elem.nil? k end |