Class: Topolys::Vertex
Overview
Object
Instance Attribute Summary collapse
-
#point ⇒ Point3D
readonly
Point3D geometry.
Attributes inherited from Object
#attributes, #children, #id, #parents
Instance Method Summary collapse
- #child_class ⇒ Object
- #edges ⇒ Object
-
#initialize(point) ⇒ Vertex
constructor
Initializes a Vertex object, use Model.get_point instead.
- #parent_class ⇒ Object
- #recalculate ⇒ Object
- #to_json ⇒ Object
Methods inherited from Object
#debug, #hash, link, #link_child, #link_parent, #short_id, #short_name, #to_s, unlink, #unlink_child, #unlink_parent
Constructor Details
#initialize(point) ⇒ Vertex
Initializes a Vertex object, use Model.get_point instead
Throws if point is incorrect type
818 819 820 821 822 823 |
# File 'lib/topolys/model.rb', line 818 def initialize(point) super() @point = point recalculate end |
Instance Attribute Details
#point ⇒ Point3D (readonly)
Returns Point3D geometry.
810 811 812 |
# File 'lib/topolys/model.rb', line 810 def point @point end |
Instance Method Details
#child_class ⇒ Object
839 840 841 |
# File 'lib/topolys/model.rb', line 839 def child_class NilClass end |
#edges ⇒ Object
843 844 845 |
# File 'lib/topolys/model.rb', line 843 def edges @parents end |
#parent_class ⇒ Object
835 836 837 |
# File 'lib/topolys/model.rb', line 835 def parent_class Edge end |
#recalculate ⇒ Object
831 832 833 |
# File 'lib/topolys/model.rb', line 831 def recalculate super() end |
#to_json ⇒ Object
825 826 827 828 829 |
# File 'lib/topolys/model.rb', line 825 def to_json result = super result[:point] = { x: @point.x, y: @point.y, z: @point.z } return result end |