Class: VORuby::STC::V1_10::STC::Coord3VecIntervalType
- Inherits:
-
CoordIntervalType
- Object
- CoordIntervalType
- VORuby::STC::V1_10::STC::Coord3VecIntervalType
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Overview
2-D coordinate interval type
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hi_limit ⇒ Object
Returns the value of attribute hi_limit.
-
#lo_limit ⇒ Object
Returns the value of attribute lo_limit.
Attributes inherited from CoordIntervalType
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from CoordIntervalType
#fill_factor, #fill_factor=, #initialize
Methods included from SerializableToXml
Constructor Details
This class inherits a constructor from VORuby::STC::V1_10::STC::CoordIntervalType
Instance Attribute Details
#hi_limit ⇒ Object
Returns the value of attribute hi_limit.
1940 1941 1942 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1940 def hi_limit @hi_limit end |
#lo_limit ⇒ Object
Returns the value of attribute lo_limit.
1940 1941 1942 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1940 def lo_limit @lo_limit end |
Class Method Details
.from_xml(xml) ⇒ Object
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1981 def self.from_xml(xml) root = element_from(xml) = {} lo_include = root.attributes.get_attribute_ns(obj_ns.uri, 'lo_include') [:lo_include] = (lo_include.value == 'true' ? true : false) if lo_include hi_include = root.attributes.get_attribute_ns(obj_ns.uri, 'hi_include') [:hi_include] = (hi_include.value == 'true' ? true : false) if hi_include fill_factor = root.attributes.get_attribute_ns(obj_ns.uri, 'fill_factor') [:fill_factor] = Float(fill_factor.value) if fill_factor lo_limit = REXML::XPath.first(root, 'x:LoLimit3Vec', {'x' => obj_ns.uri}) [:lo_limit] = Double3.from_xml(lo_limit) if lo_limit hi_limit = REXML::XPath.first(root, 'x:HiLimit3Vec', {'x' => obj_ns.uri}) [:hi_limit] = Double3.from_xml(hi_limit) if hi_limit self.new() end |
Instance Method Details
#==(i) ⇒ Object
1956 1957 1958 1959 1960 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1956 def ==(i) super(i) and self.lo_limit == i.lo_limit and self.hi_limit == i.hi_limit end |
#to_xml(name = nil) ⇒ Object
1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 |
# File 'lib/voruby/stc/1.10/stc.rb', line 1962 def to_xml(name=nil) el = super(name) if self.lo_limit lo_limit = REXML::Element.new("#{obj_ns.prefix}:LoLimit3Vec") lo_limit.text = self.lo_limit.to_s el.add_element(lo_limit) end if self.hi_limit hi_limit = REXML::Element.new("#{obj_ns.prefix}:HiLimit3Vec") hi_limit.text = self.hi_limit.to_s el.add_element(hi_limit) end collapse_namespaces(el) el end |