Class: VORuby::STC::V1_30::PosVector1CoordinateType

Inherits:
BasicCoordinateType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Position scalar coordinate type; sibling of BasicCoordinateType. Single Error, Resolution, Size, PixSize elements indicate definite values; pairs indicate ranges.

Direct Known Subclasses

Position1D, VelVector1CoordinateType

Instance Attribute Summary collapse

Attributes inherited from BasicCoordinateType

#error, #pix_size, #resolution, #size, #value

Attributes inherited from CoordinateType

#frame_id, #name

Attributes included from STCReference

#id, #idref, #ucd, #xlink_href, #xlink_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasicCoordinateType

basic_coordinate_from_xml

Methods inherited from CoordinateType

coordinate_from_xml

Methods inherited from STCBaseType

#initialize, stc_base_from_xml

Methods included from STCReference

#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml

Methods included from SerializableToXml

#element

Constructor Details

This class inherits a constructor from VORuby::STC::V1_30::STCBaseType

Instance Attribute Details

#coord_system_idObject

Returns the value of attribute coord_system_id.



2580
2581
2582
# File 'lib/voruby/stc/1.30/stc.rb', line 2580

def coord_system_id
  @coord_system_id
end

#unitObject

Returns the value of attribute unit.



2580
2581
2582
# File 'lib/voruby/stc/1.30/stc.rb', line 2580

def unit
  @unit
end

Class Method Details

.from_xml(xml) ⇒ Object



2625
2626
2627
2628
# File 'lib/voruby/stc/1.30/stc.rb', line 2625

def self.from_xml(xml)
  root = element_from(xml)
  self.new(pos_vector1_coordinate_from_xml(root))
end

.pos_vector1_coordinate_from_xml(root) ⇒ Object



2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
# File 'lib/voruby/stc/1.30/stc.rb', line 2613

def self.pos_vector1_coordinate_from_xml(root)
  options = BasicCoordinateType.basic_coordinate_from_xml(root)
  
  cis = root.attributes.get_attribute_ns(obj_ns.uri, 'coord_system_id')
  options[:coord_system_id] = IdRef.new(cis.value) if cis
  
  unit = root.attributes.get_attribute_ns(obj_ns.uri, 'unit')
  options[:unit] = PosUnitType.new(unit.value) if unit
  
  options
end

Instance Method Details

#==(c) ⇒ Object



2598
2599
2600
2601
2602
# File 'lib/voruby/stc/1.30/stc.rb', line 2598

def ==(c)
  super(c) and
  self.coord_system_id == c.coord_system_id and
  self.unit == c.unit
end

#to_xml(name = nil) ⇒ Object



2604
2605
2606
2607
2608
2609
2610
2611
# File 'lib/voruby/stc/1.30/stc.rb', line 2604

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