Class: GeoTreeModule::Node
- Inherits:
-
Object
- Object
- GeoTreeModule::Node
- Defined in:
- lib/geotree/node.rb
Overview
Base class for KDTree nodes
Instance Attribute Summary collapse
-
#bounds ⇒ Object
Returns the value of attribute bounds.
-
#leaf ⇒ Object
Returns the value of attribute leaf.
-
#modified ⇒ Object
Returns the value of attribute modified.
-
#name ⇒ Object
Returns the value of attribute name.
-
#next_node ⇒ Object
Returns the value of attribute next_node.
-
#prev_node ⇒ Object
Returns the value of attribute prev_node.
-
#vertical ⇒ Object
If true, the slabs are stacked vertically; otherwise, they’re arranged horizontally.
Instance Method Summary collapse
-
#initialize(name, leaf, vertical, bounds) ⇒ Node
constructor
A new instance of Node.
- #splittable ⇒ Object
Constructor Details
#initialize(name, leaf, vertical, bounds) ⇒ Node
Returns a new instance of Node.
70 71 72 73 74 75 76 |
# File 'lib/geotree/node.rb', line 70 def initialize(name,leaf,vertical,bounds) @name = name @leaf = leaf @vertical = vertical @bounds = bounds @modified = false end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds.
68 69 70 |
# File 'lib/geotree/node.rb', line 68 def bounds @bounds end |
#leaf ⇒ Object
Returns the value of attribute leaf.
63 64 65 |
# File 'lib/geotree/node.rb', line 63 def leaf @leaf end |
#modified ⇒ Object
Returns the value of attribute modified.
69 70 71 |
# File 'lib/geotree/node.rb', line 69 def modified @modified end |
#name ⇒ Object
Returns the value of attribute name.
64 65 66 |
# File 'lib/geotree/node.rb', line 64 def name @name end |
#next_node ⇒ Object
Returns the value of attribute next_node.
68 69 70 |
# File 'lib/geotree/node.rb', line 68 def next_node @next_node end |
#prev_node ⇒ Object
Returns the value of attribute prev_node.
68 69 70 |
# File 'lib/geotree/node.rb', line 68 def prev_node @prev_node end |
#vertical ⇒ Object
If true, the slabs are stacked vertically; otherwise, they’re arranged horizontally
67 68 69 |
# File 'lib/geotree/node.rb', line 67 def vertical @vertical end |
Instance Method Details
#splittable ⇒ Object
78 79 80 81 |
# File 'lib/geotree/node.rb', line 78 def splittable s = [@bounds.w,@bounds.h].max s >= SPLITTABLE_LINEAR_SIZE end |