Class: VORuby::STC::V1_10::STC::CoordSysType
- Inherits:
-
Object
- Object
- VORuby::STC::V1_10::STC::CoordSysType
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Overview
A CoordSys consists of at least one coordinate frame
Direct Known Subclasses
Instance Attribute Summary collapse
-
#coord_frames ⇒ Object
Returns the value of attribute coord_frames.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #==(c) ⇒ Object
-
#initialize(options = {}) ⇒ CoordSysType
constructor
A new instance of CoordSysType.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ CoordSysType
Returns a new instance of CoordSysType.
1436 1437 1438 1439 1440 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1436 def initialize(={}) raise_argument_required_error('id') if !.has_key?(:id) raise_argument_required_error('coordinate frames') if !.has_key?(:coord_frames) .each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#coord_frames ⇒ Object
Returns the value of attribute coord_frames.
1434 1435 1436 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1434 def coord_frames @coord_frames end |
#id ⇒ Object
Returns the value of attribute id.
1434 1435 1436 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1434 def id @id end |
Class Method Details
.from_xml(xml) ⇒ Object
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1471 def self.from_xml(xml) root = element_from(xml) = { :id => Id.new(root.attributes.get_attribute_ns(obj_ns.uri, 'ID').value), :coord_frames => xml_to_obj(root, CoordFrame) } self.new() end |
Instance Method Details
#==(c) ⇒ Object
1456 1457 1458 1459 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1456 def ==(c) self.id == c.id and self.coord_frames == c.coord_frames end |
#to_xml(name = nil) ⇒ Object
1461 1462 1463 1464 1465 1466 1467 1468 1469 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1461 def to_xml(name=nil) el = element(name) el.attributes["#{obj_ns.prefix}:ID"] = self.id.to_s self.coord_frames.each { |f| el.add_element(f.to_xml) } collapse_namespaces(el) el end |