Class: VORuby::STC::V1_30::Pos3VecIntervalType

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

Overview

3-D coordinate interval type.

Direct Known Subclasses

Position3VecInterval

Instance Attribute Summary collapse

Attributes inherited from SpatialIntervalType

#epoch, #unit

Attributes inherited from CoordIntervalType

#fill_factor, #frame_id, #hi_include, #lo_include

Attributes included from STCReference

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SpatialIntervalType

spatial_interval_from_xml

Methods inherited from CoordIntervalType

coord_interval_from_xml, #hi_include?, #lo_include?

Methods inherited from STCBaseType

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

#initialize(lo_limit, hi_limit, lo_include = true, hi_include = true, options = {}) ⇒ Pos3VecIntervalType

Returns a new instance of Pos3VecIntervalType.



4309
4310
4311
4312
4313
# File 'lib/voruby/stc/1.30/stc.rb', line 4309

def initialize(lo_limit, hi_limit, lo_include=true, hi_include=true, options={})
  self.lo_limit = lo_limit
  self.hi_limit = hi_limit
  super(lo_include, hi_include, options)
end

Instance Attribute Details

#hi_limitObject

Returns the value of attribute hi_limit.



4307
4308
4309
# File 'lib/voruby/stc/1.30/stc.rb', line 4307

def hi_limit
  @hi_limit
end

#lo_limitObject

Returns the value of attribute lo_limit.



4307
4308
4309
# File 'lib/voruby/stc/1.30/stc.rb', line 4307

def lo_limit
  @lo_limit
end

Class Method Details

.from_xml(xml) ⇒ Object



4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
# File 'lib/voruby/stc/1.30/stc.rb', line 4343

def self.from_xml(xml)
  root = element_from(xml)
  
  lo_limit = REXML::XPath.first(root, 'x:LoLimit3Vec', {'x' => obj_ns.uri})
  hi_limit = REXML::XPath.first(root, 'x:HiLimit3Vec', {'x' => obj_ns.uri})
  
  self.new(
    lo_limit ? Double3Type.from_xml(lo_limit) : nil,
    hi_limit ? Double3Type.from_xml(hi_limit) : nil,
    *SpatialIntervalType.spatial_interval_from_xml(root)
  )
end

Instance Method Details

#==(i) ⇒ Object



4327
4328
4329
4330
4331
# File 'lib/voruby/stc/1.30/stc.rb', line 4327

def ==(i)
  super(i) and
  self.lo_limit == i.lo_limit and
  self.hi_limit == i.hi_limit
end

#to_xml(name = nil) ⇒ Object



4333
4334
4335
4336
4337
4338
4339
4340
4341
# File 'lib/voruby/stc/1.30/stc.rb', line 4333

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.lo_limit.to_xml('LoLimit3Vec')) if self.lo_limit
  el.add_element(self.hi_limit.to_xml('HiLimit3Vec')) if self.hi_limit
  
  collapse_namespaces(el)
  el
end