Class: VORuby::STC::V1_10::STC::PixelCoordSystemType
- Inherits:
-
CoordSysType
- Object
- CoordSysType
- VORuby::STC::V1_10::STC::PixelCoordSystemType
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Overview
The pixel coordinate system definition
Direct Known Subclasses
Instance Attribute Summary collapse
-
#pixel_coord_frames ⇒ Object
Returns the value of attribute pixel_coord_frames.
Attributes inherited from CoordSysType
Class Method Summary collapse
Instance Method Summary collapse
- #==(f) ⇒ Object
- #coord_frames ⇒ Object
- #coord_frames=(cs) ⇒ Object
-
#initialize(options = {}) ⇒ PixelCoordSystemType
constructor
A new instance of PixelCoordSystemType.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ PixelCoordSystemType
Returns a new instance of PixelCoordSystemType.
1644 1645 1646 1647 1648 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1644 def initialize(={}) raise_argument_required_error('list of pixel coordinate systems') if !.has_key?(:pixel_coord_frames) [:coord_frames] = [:pixel_coord_frames] super() end |
Instance Attribute Details
#pixel_coord_frames ⇒ Object
Returns the value of attribute pixel_coord_frames.
1642 1643 1644 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1642 def pixel_coord_frames @pixel_coord_frames end |
Class Method Details
.from_xml(xml) ⇒ Object
1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1682 def self.from_xml(xml) root = element_from(xml) = { :id => Id.new(root.attributes.get_attribute_ns(obj_ns.uri, 'ID').value), :pixel_coord_frames => PixelCoordFrameList.new( REXML::XPath.match(root, 'x:PixelCoordFrame', {'x' => obj_ns.uri}).collect { |p| PixelCoordFrame.from_xml(p) } ) } self.new() end |
Instance Method Details
#==(f) ⇒ Object
1667 1668 1669 1670 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1667 def ==(f) self.id == f.id and self.pixel_coord_frames == f.pixel_coord_frames end |
#coord_frames ⇒ Object
1659 1660 1661 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1659 def coord_frames self.pixel_coord_frames end |
#coord_frames=(cs) ⇒ Object
1663 1664 1665 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1663 def coord_frames=(cs) self.pixel_coord_frames = cs end |
#to_xml(name = nil) ⇒ Object
1672 1673 1674 1675 1676 1677 1678 1679 1680 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1672 def to_xml(name=nil) el = element(name) el.attributes["#{obj_ns.prefix}:ID"] = self.id.to_s self.pixel_coord_frames.each { |f| el.add_element(f.to_xml) } collapse_namespaces(el) el end |