Class: Disp3D::NodeCoord

Inherits:
NodeCollection show all
Defined in:
lib/node/node_coord.rb

Instance Attribute Summary

Attributes inherited from Node

#instance_id, #name, #parents

Instance Method Summary collapse

Methods inherited from NodeCollection

#add, #box, #child, #child_nodes, #child_path_id, #draw, #include?, #open

Methods inherited from Node

#ancestors, #post_draw, #pre_draw

Constructor Details

#initialize(name = nil, base_position = Vector3.new(), length = 1) ⇒ NodeCoord

Returns a new instance of NodeCoord.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/node/node_coord.rb', line 8

def initialize(name = nil, base_position = Vector3.new(), length = 1)
  super(name)
  @length = length
  @base_position = base_position
  @x_color = [1,0,0,1]
  @y_color = [0,1,0,1]
  @z_color = [0,0,1,1]

  @x_node = NodeArrows.new(geom[0])
  @y_node = NodeArrows.new(geom[1])
  @z_node = NodeArrows.new(geom[2])
  @x_node.colors = @x_color
  @y_node.colors = @y_color
  @z_node.colors = @z_color
  add(@x_node)
  add(@y_node)
  add(@z_node)
end

Instance Method Details

#update_for_displayObject



27
28
29
30
31
32
# File 'lib/node/node_coord.rb', line 27

def update_for_display
  @x_node.geom = geom[0]
  @y_node.geom = geom[1]
  @z_node.geom = geom[2]
  super
end