Class: VORuby::STC::V1_30::ConvexHullType
- Inherits:
-
ShapeType
- Object
- STCBaseType
- CoordIntervalType
- SpatialIntervalType
- RegionType
- ShapeType
- VORuby::STC::V1_30::ConvexHullType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
A convex hull: the smallest convex polygon that contains all its points; in spherical coordinates all points have to be contained within a hemisphere.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
Attributes inherited from RegionType
#area, #coord_system_id, #note
Attributes inherited from SpatialIntervalType
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
- #==(c) ⇒ Object
-
#initialize(points, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ ConvexHullType
constructor
A new instance of ConvexHullType.
- #to_s ⇒ Object
- #to_xml(name = nil) ⇒ Object
Methods inherited from ShapeType
Methods inherited from RegionType
Methods inherited from SpatialIntervalType
Methods inherited from CoordIntervalType
coord_interval_from_xml, #hi_include?, #lo_include?
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(points, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ ConvexHullType
Returns a new instance of ConvexHullType.
5869 5870 5871 5872 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5869 def initialize(points, area=nil, lo_include=true, hi_include=true, ={}) super(area, lo_include, hi_include, ) self.points = points end |
Instance Attribute Details
#points ⇒ Object
Returns the value of attribute points.
5867 5868 5869 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5867 def points @points end |
Class Method Details
.from_xml(xml) ⇒ Object
5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5901 def self.from_xml(xml) root = element_from(xml) self.new( PointList.new( REXML::XPath.match(root, 'x:Point', {'x' => obj_ns.uri}).collect{ |p| Double3Type.from_xml(p) } ), *ShapeType.shape_from_xml(root) ) end |
Instance Method Details
#==(c) ⇒ Object
5883 5884 5885 5886 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5883 def ==(c) super(c) and self.points == c.points end |
#to_s ⇒ Object
5897 5898 5899 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5897 def to_s "CHULL #{self.coord_system_id || IdRef.new('J2000')} #{self.points}" end |
#to_xml(name = nil) ⇒ Object
5888 5889 5890 5891 5892 5893 5894 5895 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5888 def to_xml(name=nil) el = super(name) self.points.each{ |p| el.add_element(p.to_xml('Point')) } collapse_namespaces(el) el end |