Class: Disp3D::NodeRectangle

Inherits:
NodeLeaf show all
Defined in:
lib/node/node_rectangle.rb

Instance Attribute Summary

Attributes inherited from Node

#instance_id, #name, #parents

Instance Method Summary collapse

Methods inherited from NodeLeaf

#draw, #update_for_display

Methods inherited from Node

#ancestors, #post_draw, #pre_draw

Constructor Details

#initialize(geom, name = nil) ⇒ NodeRectangle

texture_image should be rmagick image



6
7
8
9
10
# File 'lib/node/node_rectangle.rb', line 6

def initialize(geom, name = nil)
  Util3D.check_arg_type(Symbol, name, true)
  Util3D.check_arg_type(GMath3D::Rectangle, geom, false, false) #Array is not allowed
  super
end

Instance Method Details

#boxObject



12
13
14
# File 'lib/node/node_rectangle.rb', line 12

def box
  return @geom.box
end

#image=(texture_image) ⇒ Object



16
17
18
19
20
21
# File 'lib/node/node_rectangle.rb', line 16

def image=(texture_image)
  Util3D.check_arg_type(Magick::Image, texture_image, true)
  @image = texture_image
  initialize_texture
  update_for_display
end