Class: Gdsii::Box

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

Overview

Represents a GDSII box 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, boxtype = nil, xy = nil) {|_self| ... } ⇒ Box

Create a box record grouping given a layer, boxtype, and xy coordinates. The box object is to have exactly 5 coordinate pairs.

box = Gdsii::Box.new(1, 0, [0,0, 0,10, 10,10, 10,0, 0,0])

Yields:

  • (_self)

Yield Parameters:

  • _self (Gdsii::Box)

    the object that the method was called on



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

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

Instance Method Details

#boxtypeObject

Get the boxtype number (returns Fixnum).



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

def boxtype() @records.get_data(GRT_BOXTYPE); end

#boxtype=(val) ⇒ Object

Set the boxtype number.



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

def boxtype=(val) @records.set(GRT_BOXTYPE, val); end

#boxtype_recordObject

Get the boxtype record (returns Record).



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

def boxtype_record() @records.get(GRT_BOXTYPE); end