Class: VORuby::STC::V1_30::SpaceFrameType
- Inherits:
-
CoordFrameType
- Object
- STCBaseType
- CoordFrameType
- VORuby::STC::V1_30::SpaceFrameType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
A spatial coordinate frame consists of a coordinate frame, a reference position, a flavor, and, optionally, an offset center.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#coord_flavor ⇒ Object
Returns the value of attribute coord_flavor.
-
#offset_center ⇒ Object
Returns the value of attribute offset_center.
-
#reference_position ⇒ Object
Returns the value of attribute reference_position.
-
#space_ref_frame ⇒ Object
Returns the value of attribute space_ref_frame.
Attributes inherited from CoordFrameType
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
- #==(f) ⇒ Object
-
#initialize(space_ref_frame, reference_position, coord_flavor, offset_center = nil, name = nil, options = {}) ⇒ SpaceFrameType
constructor
A new instance of SpaceFrameType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from CoordFrameType
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(space_ref_frame, reference_position, coord_flavor, offset_center = nil, name = nil, options = {}) ⇒ SpaceFrameType
Returns a new instance of SpaceFrameType.
7654 7655 7656 7657 7658 7659 7660 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7654 def initialize(space_ref_frame, reference_position, coord_flavor, offset_center=nil, name=nil, ={}) super(name, ) self.space_ref_frame = space_ref_frame self.reference_position = reference_position self.coord_flavor = coord_flavor self.offset_center = offset_center end |
Instance Attribute Details
#coord_flavor ⇒ Object
Returns the value of attribute coord_flavor.
7652 7653 7654 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7652 def coord_flavor @coord_flavor end |
#offset_center ⇒ Object
Returns the value of attribute offset_center.
7652 7653 7654 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7652 def offset_center @offset_center end |
#reference_position ⇒ Object
Returns the value of attribute reference_position.
7652 7653 7654 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7652 def reference_position @reference_position end |
#space_ref_frame ⇒ Object
Returns the value of attribute space_ref_frame.
7652 7653 7654 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7652 def space_ref_frame @space_ref_frame end |
Class Method Details
.from_xml(xml) ⇒ Object
7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7712 def self.from_xml(xml) root = element_from(xml) offset_center = REXML::XPath.first(root, 'x:OffsetCenter', {'x' => obj_ns.uri}) self.new( xml_to_obj(root, SpaceRefFrame, true), xml_to_obj(root, ReferencePosition, true), xml_to_obj(root, CoordFlavor, true), offset_center ? CoordValueType.from_xml(offset_center) : nil, *CoordFrameType.coord_frame_from_xml(root) ) end |
Instance Method Details
#==(f) ⇒ Object
7692 7693 7694 7695 7696 7697 7698 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7692 def ==(f) super(f) and self.space_ref_frame == f.space_ref_frame and self.reference_position == f.reference_position and self.offset_center == f.offset_center and self.coord_flavor == f.coord_flavor end |
#to_xml(name = nil) ⇒ Object
7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 |
# File 'lib/voruby/stc/1.30/stc.rb', line 7700 def to_xml(name=nil) el = super(name) el.add_element(self.space_ref_frame.to_xml) el.add_element(self.reference_position.to_xml) el.add_element(self.offset_center.to_xml('OffsetCenter')) if self.offset_center el.add_element(self.coord_flavor.to_xml) collapse_namespaces(el) el end |