Class: VORuby::STC::V1_10::STC::VelocityIntervalType

Inherits:
PositionIntervalType show all
Defined in:
lib/voruby/stc/1.10/stc.rb

Overview

Contains a spatial velocity CoordInterval. A special kind of area is a circle or sphere (in two or three dimensions), defined by a center position and a radius; the radius requires a unit

Direct Known Subclasses

VelocityInterval

Instance Attribute Summary collapse

Attributes inherited from PositionIntervalType

#coord_interval, #unit

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(options = {}) ⇒ VelocityIntervalType

Returns a new instance of VelocityIntervalType.



2233
2234
2235
2236
# File 'lib/voruby/stc/1.10/stc.rb', line 2233

def initialize(options={})
  raise_argument_required_error('velocity time unit') if !options.has_key?(:vel_time_unit)
  super(options)
end

Instance Attribute Details

#vel_time_unitObject

Returns the value of attribute vel_time_unit.



2231
2232
2233
# File 'lib/voruby/stc/1.10/stc.rb', line 2231

def vel_time_unit
  @vel_time_unit
end

Class Method Details

.from_xml(xml) ⇒ Object



2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
# File 'lib/voruby/stc/1.10/stc.rb', line 2257

def self.from_xml(xml)
  root = element_from(xml)
  
  options = {
    :unit => PosUnit.new(root.attributes.get_attribute_ns(obj_ns.uri, 'unit').value),
    :vel_time_unit => VelTimeUnit.new(root.attributes.get_attribute_ns(obj_ns.uri, 'vel_time_unit').value),
    :coord_interval => xml_to_obj(root, CoordInterval, true)
  }
  
  self.new(options)
end

Instance Method Details

#==(s) ⇒ Object



2247
2248
2249
# File 'lib/voruby/stc/1.10/stc.rb', line 2247

def ==(s)
  super(s) and self.vel_time_unit == s.vel_time_unit
end

#to_xml(name = nil) ⇒ Object



2251
2252
2253
2254
2255
# File 'lib/voruby/stc/1.10/stc.rb', line 2251

def to_xml(name=nil)
  el = super(name)
  el.attributes["#{obj_ns.prefix}:vel_time_unit"] = self.vel_time_unit.to_s
  el
end