Class: VORuby::STC::V1_30::Size3Type

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

Overview

Consists of a Size (3 doubles) and optional position angle element.

Direct Known Subclasses

Error3, PixSize3, Resolution3, Size3, Transform3

Instance Attribute Summary collapse

Attributes inherited from Double3Type

#c1, #c2, #c3, #gen_unit, #unit, #vel_time_unit

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Double3Type

double3_from_xml, #initialize, #to_s

Methods inherited from STCBaseType

#initialize, 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

This class inherits a constructor from VORuby::STC::V1_30::Double3Type

Instance Attribute Details

#pos_angle1Object

Returns the value of attribute pos_angle1.



2068
2069
2070
# File 'lib/voruby/stc/1.30/stc.rb', line 2068

def pos_angle1
  @pos_angle1
end

#pos_angle2Object

Returns the value of attribute pos_angle2.



2068
2069
2070
# File 'lib/voruby/stc/1.30/stc.rb', line 2068

def pos_angle2
  @pos_angle2
end

Class Method Details

.from_xml(xml) ⇒ Object



2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
# File 'lib/voruby/stc/1.30/stc.rb', line 2096

def self.from_xml(xml)
  root = element_from(xml)
  
  c1, c2, c3, options = Double3Type.double3_from_xml(root)
  
  pos_angle1 = REXML::XPath.first(root, 'x:PosAngle1', {'x' => obj_ns.uri})
  options[:pos_angle1] = PosAngleType.from_xml(pos_angle1) if pos_angle1
  
  pos_angle2 = REXML::XPath.first(root, 'x:PosAngle2', {'x' => obj_ns.uri})
  options[:pos_angle2] = PosAngleType.from_xml(pos_angle2) if pos_angle2
  
  self.new(c1, c2, c3, options)
end

Instance Method Details

#==(s) ⇒ Object



2080
2081
2082
2083
2084
# File 'lib/voruby/stc/1.30/stc.rb', line 2080

def ==(s)
  super(s) and
  self.pos_angle1 == s.pos_angle1 and
  self.pos_angle2 == s.pos_angle2
end

#to_xml(name = nil) ⇒ Object



2086
2087
2088
2089
2090
2091
2092
2093
2094
# File 'lib/voruby/stc/1.30/stc.rb', line 2086

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.pos_angle1.to_xml('PosAngle1')) if self.pos_angle1
  el.add_element(self.pos_angle2.to_xml('PosAngle2')) if self.pos_angle2
  
  collapse_namespaces(el)
  el
end