Class: Gdsii::Node

Inherits:
Element
  • Object
show all
Includes:
Access::ELFlags, Access::Layer, Access::Plex, Access::XY
Defined in:
lib/gdsii/node.rb

Overview

Represents a GDSII Node element. Most methods are from Element or from the various included Access module methods.

Instance Method Summary collapse

Methods included from Access::Plex

#plex, #plex=, #plex_record

Methods included from Access::ELFlags

#elflags, #elflags=, #elflags_record

Methods included from Access::XY

#xy, #xy=, #xy_record

Methods included from Access::Layer

#layer, #layer=, #layer_record

Constructor Details

#initialize(layer = nil, nodetype = nil, xy = nil) {|_self| ... } ⇒ Node

Create a node record grouping given a layer, nodetype, and xy coordinates. The node object can have 1-50 coordinate pairs.

node = Gdsii::Node.new(1, 0, [0,0])

Yields:

  • (_self)

Yield Parameters:

  • _self (Gdsii::Node)

    the object that the method was called on



40
41
42
43
44
45
46
47
# File 'lib/gdsii/node.rb', line 40

def initialize(layer=nil, nodetype=nil, xy=nil)
  super()
  @records[GRT_NODE] = Record.new(GRT_NODE)
  self.layer = layer unless layer.nil?
  self.nodetype = nodetype unless nodetype.nil?
  self.xy = xy unless xy.nil?
  yield self if block_given?
end

Instance Method Details

#nodetypeObject

Get the nodetype number (returns Fixnum).



57
# File 'lib/gdsii/node.rb', line 57

def nodetype() @records.get_data(GRT_NODETYPE); end

#nodetype=(val) ⇒ Object

Set the nodetype number.



62
# File 'lib/gdsii/node.rb', line 62

def nodetype=(val) @records.set(GRT_NODETYPE, val); end

#nodetype_recordObject

Get the nodetype record (returns Record).



52
# File 'lib/gdsii/node.rb', line 52

def nodetype_record() @records.get(GRT_NODETYPE); end