Class: VORuby::STC::V1_30::CoordSysType

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

Overview

Coordinate system definition: a collection of coordinate frames.

Direct Known Subclasses

AstroCoordSystemType, PixelCoordSystemType

Instance Attribute Summary collapse

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from STCBaseType

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

#initialize(coord_frames, options = {}) ⇒ CoordSysType

Returns a new instance of CoordSysType.



7928
7929
7930
7931
# File 'lib/voruby/stc/1.30/stc.rb', line 7928

def initialize(coord_frames, options={})
  super(options)
  self.coord_frames = coord_frames
end

Instance Attribute Details

#coord_framesObject

Returns the value of attribute coord_frames.



7926
7927
7928
# File 'lib/voruby/stc/1.30/stc.rb', line 7926

def coord_frames
  @coord_frames
end

Class Method Details

.coord_sys_from_xml(root) ⇒ Object



7955
7956
7957
7958
7959
7960
# File 'lib/voruby/stc/1.30/stc.rb', line 7955

def self.coord_sys_from_xml(root)
  cfs = xml_to_obj(root, CoordFrame)
  cfs = nil if cfs.size == 0
  
  [cfs, STCBaseType.stc_base_from_xml(root)]
end

.from_xml(xml) ⇒ Object



7962
7963
7964
7965
# File 'lib/voruby/stc/1.30/stc.rb', line 7962

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

Instance Method Details

#==(s) ⇒ Object



7941
7942
7943
7944
# File 'lib/voruby/stc/1.30/stc.rb', line 7941

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

#to_xml(name = nil) ⇒ Object



7946
7947
7948
7949
7950
7951
7952
7953
# File 'lib/voruby/stc/1.30/stc.rb', line 7946

def to_xml(name=nil)
  el = super(name)
  
  self.coord_frames.each{ |cf| el.add_element(cf.to_xml) } if self.coord_frames
  
  collapse_namespaces(el)
  el
end