Class: Disp3D::NodeLeaf
Direct Known Subclasses
NodeArrows, NodeCone, NodeLines, NodePoints, NodePolylines, NodeRectangle, NodeSphere, NodeTeaPod, NodeText, NodeTris, NodeWorkplane
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #box ⇒ Object
- #draw(currnet_view) ⇒ Object
-
#initialize(geometry = nil, name = nil) ⇒ NodeLeaf
constructor
A new instance of NodeLeaf.
- #update_for_display ⇒ Object
Methods inherited from Node
#ancestors, #post_draw, #pre_draw
Constructor Details
#initialize(geometry = nil, name = nil) ⇒ NodeLeaf
Returns a new instance of NodeLeaf.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/node/node_leaf.rb', line 11 def initialize(geometry = nil, name = nil) Util3D.check_arg_type(Symbol, name, true) Util3D.check_arg_type(GMath3D::Geom, geometry, true, true) super(name) @geom = geometry @material_color = [1,1,1,1] @shininess = nil @shininess_default = 32.0 @dislay_list_created = nil end |
Instance Method Details
#box ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/node/node_leaf.rb', line 28 def box return nil if @geom == nil if(@geom.kind_of?(Array)) return nil if @geom.size == 0 rtn_box = @geom[0].box @geom.each do |element| rtn_box += element.box end else rtn_box = @geom.box end return box_transform(rtn_box) end |
#draw(currnet_view) ⇒ Object
24 25 26 |
# File 'lib/node/node_leaf.rb', line 24 def draw currnet_view draw_inner(self.method(:draw_element), currnet_view) end |
#update_for_display ⇒ Object
42 43 44 |
# File 'lib/node/node_leaf.rb', line 42 def update_for_display @dislay_list_created = nil end |