Class: VORuby::STC::V1_30::GenericCoordFrameType

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

Direct Known Subclasses

CoordFrame, PixelFrameType

Instance Attribute Summary collapse

Attributes inherited from CoordFrameType

#name

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CoordFrameType

coord_frame_from_xml

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_ref_frame, coord_ref_pos, coord_flavor, name = nil, options = {}) ⇒ GenericCoordFrameType

Returns a new instance of GenericCoordFrameType.



6316
6317
6318
6319
6320
6321
# File 'lib/voruby/stc/1.30/stc.rb', line 6316

def initialize(coord_ref_frame, coord_ref_pos, coord_flavor, name=nil, options={})
  super(name, options)
  self.coord_ref_frame = coord_ref_frame
  self.coord_ref_pos = coord_ref_pos
  self.coord_flavor = coord_flavor
end

Instance Attribute Details

#coord_flavorObject

Returns the value of attribute coord_flavor.



6314
6315
6316
# File 'lib/voruby/stc/1.30/stc.rb', line 6314

def coord_flavor
  @coord_flavor
end

#coord_ref_frameObject

Returns the value of attribute coord_ref_frame.



6314
6315
6316
# File 'lib/voruby/stc/1.30/stc.rb', line 6314

def coord_ref_frame
  @coord_ref_frame
end

#coord_ref_posObject

Returns the value of attribute coord_ref_pos.



6314
6315
6316
# File 'lib/voruby/stc/1.30/stc.rb', line 6314

def coord_ref_pos
  @coord_ref_pos
end

Class Method Details

.from_xml(xml) ⇒ Object



6367
6368
6369
6370
# File 'lib/voruby/stc/1.30/stc.rb', line 6367

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

.generic_coord_frame_from_xml(root) ⇒ Object



6358
6359
6360
6361
6362
6363
6364
6365
# File 'lib/voruby/stc/1.30/stc.rb', line 6358

def self.generic_coord_frame_from_xml(root)
  [
    xml_to_obj(root, CoordRefFrame, true),
    xml_to_obj(root, CoordRefPos, true),
    xml_to_obj(root, CoordFlavor, true),
    *CoordFrameType.coord_frame_from_xml(root)
  ]
end

Instance Method Details

#==(f) ⇒ Object



6341
6342
6343
6344
6345
6346
# File 'lib/voruby/stc/1.30/stc.rb', line 6341

def ==(f)
  super(f) and
  self.coord_ref_frame == f.coord_ref_frame and
  self.coord_ref_pos == f.coord_ref_pos and
  self.coord_flavor == f.coord_flavor
end

#to_xml(name = nil) ⇒ Object



6348
6349
6350
6351
6352
6353
6354
6355
6356
# File 'lib/voruby/stc/1.30/stc.rb', line 6348

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.coord_ref_frame.to_xml) if self.coord_ref_frame
  el.add_element(self.coord_ref_pos.to_xml) if self.coord_ref_pos
  el.add_element(self.coord_flavor.to_xml)
  
  el
end