Class: VORuby::STC::V1_30::HalfspaceType
- Inherits:
-
Object
- Object
- VORuby::STC::V1_30::HalfspaceType
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
n area on the unit sphere defined by the intersection with a plane.
Instance Attribute Summary collapse
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#vector ⇒ Object
Returns the value of attribute vector.
Class Method Summary collapse
Instance Method Summary collapse
- #==(h) ⇒ Object
-
#initialize(vector, offset) ⇒ HalfspaceType
constructor
A new instance of HalfspaceType.
- #to_s ⇒ Object
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(vector, offset) ⇒ HalfspaceType
Returns a new instance of HalfspaceType.
5751 5752 5753 5754 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5751 def initialize(vector, offset) self.vector = vector self.offset = offset end |
Instance Attribute Details
#offset ⇒ Object
Returns the value of attribute offset.
5749 5750 5751 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5749 def offset @offset end |
#vector ⇒ Object
Returns the value of attribute vector.
5749 5750 5751 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5749 def vector @vector end |
Class Method Details
.from_xml(xml) ⇒ Object
5796 5797 5798 5799 5800 5801 5802 5803 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5796 def self.from_xml(xml) root = element_from(xml) self.new( Double3Type.from_xml(REXML::XPath.first(root, 'x:Vector', {'x' => obj_ns.uri})), HSOffsetType.from_xml(REXML::XPath.first(root, 'x:Offset', {'x' => obj_ns.uri})) ) end |
Instance Method Details
#==(h) ⇒ Object
5777 5778 5779 5780 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5777 def ==(h) self.vector == h.vector and self.offset == h.offset end |
#to_s ⇒ Object
5792 5793 5794 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5792 def to_s "#{self.vector} #{self.offset}" end |
#to_xml(name = nil) ⇒ Object
5782 5783 5784 5785 5786 5787 5788 5789 5790 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5782 def to_xml(name=nil) el = element(name) el.add_element(self.vector.to_xml('Vector')) el.add_element(self.offset.to_xml('Offset')) collapse_namespaces(el) el end |