Class: VORuby::STC::V1_30::GenVector3CoordinateType

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

Overview

Generic 3-D coordinate type. Single CError3, CResolution3, CSize3, CPixSize3 elements indicate definite values; pairs indicate ranges.

Instance Attribute Summary collapse

Attributes inherited from Vector3CoordinateType

#error, #name1, #name2, #name3, #pix_size, #resolution, #size, #value

Attributes inherited from CoordinateType

#frame_id, #name

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Vector3CoordinateType

vector3_coordinate_from_xml

Methods inherited from CoordinateType

coordinate_from_xml

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::STCBaseType

Instance Attribute Details

#unitObject

Returns the value of attribute unit.



2545
2546
2547
# File 'lib/voruby/stc/1.30/stc.rb', line 2545

def unit
  @unit
end

Class Method Details

.from_xml(xml) ⇒ Object



2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
# File 'lib/voruby/stc/1.30/stc.rb', line 2565

def self.from_xml(xml)
  root = element_from(xml)

  options = Vector3CoordinateType.vector3_coordinate_from_xml(root)

  unit = root.attributes.get_attribute_ns(obj_ns.uri, 'unit')
  options[:unit] = UnitType.new(unit.value) if unit

  self.new(options)
end

Instance Method Details

#==(c) ⇒ Object



2555
2556
2557
# File 'lib/voruby/stc/1.30/stc.rb', line 2555

def ==(c)
  super(c) and self.unit == c.unit
end

#to_xml(name = nil) ⇒ Object



2559
2560
2561
2562
2563
# File 'lib/voruby/stc/1.30/stc.rb', line 2559

def to_xml(name=nil)
  el = super(name)
  el.attributes["#{obj_ns.prefix}:unit"] = self.unit.to_s if self.unit
  el
end