class Gdsii::Strans

Represents a GDSII structure translation object (Strans).

Public Class Methods

new(mag=nil, angle=nil, reflect_x=false, abs_mag=false, abs_angle=false) { |self| ... } click to toggle source

Constructor

Calls superclass method Gdsii::Group.new
# File lib/gdsii/strans.rb, line 22
def initialize(mag=nil, angle=nil, reflect_x=false, abs_mag=false, abs_angle=false)
  super()
  @records[GRT_STRANS] = Record.new(GRT_STRANS, 0)
  self.reflect_x = true if reflect_x
  self.abs_mag = true if abs_mag
  self.abs_angle = true if abs_angle
  self.mag = mag unless mag.nil?
  self.angle = angle unless angle.nil?
  yield self if block_given?
end

Public Instance Methods

abs_angle=(flag) click to toggle source

Set the strans absAngle bit

# File lib/gdsii/strans.rb, line 128
def abs_angle=(flag)
  self.value = flag ? value | 0x0002 : value & 0xfffd
end
abs_angle?() click to toggle source

Return true if the absolute angle bit is set; false if not

# File lib/gdsii/strans.rb, line 121
def abs_angle?()
  (value & 0x0002) == 0x0002
end
abs_mag=(flag) click to toggle source

Set or clear the absolute magnification bit (true = set; false = clear)

# File lib/gdsii/strans.rb, line 114
def abs_mag=(flag)
  self.value = flag ? value | 0x0004 : value & 0xfffb
end
abs_mag?() click to toggle source

Return true if an absolute magnification is set; false if not

# File lib/gdsii/strans.rb, line 107
def abs_mag?()
  (value & 0x0004) == 0x0004
end
angle() click to toggle source

Get the strans angle value (returns Fixnum)

# File lib/gdsii/strans.rb, line 67
def angle() @records.get_data(GRT_ANGLE); end
angle=(val) click to toggle source

Set the strans angle record

# File lib/gdsii/strans.rb, line 72
def angle=(val) @records.set(GRT_ANGLE,val); end
angle_record() click to toggle source

Get the strans angle (returns Record)

# File lib/gdsii/strans.rb, line 62
def angle_record() @records.get_data(GRT_ANGLE); end
mag() click to toggle source

Get the strans magnification value (returns Fixnum)

# File lib/gdsii/strans.rb, line 82
def mag() @records.get_data(GRT_MAG); end
mag=(val) click to toggle source

Set the strans magnification record

# File lib/gdsii/strans.rb, line 87
def mag=(val) @records.set(GRT_MAG,val); end
mag_record() click to toggle source

Get the strans magnification (returns Record)

# File lib/gdsii/strans.rb, line 77
def mag_record() @records.get_data(GRT_MAG); end
record() click to toggle source

Get the strans bitarray (returns Record)

# File lib/gdsii/strans.rb, line 36
def record() @records.get(GRT_STRANS); end
reflect_x=(flag) click to toggle source

Set or clear the strans x-reflect bit (true = set; false = clear)

# File lib/gdsii/strans.rb, line 100
def reflect_x=(flag)
  self.value = flag ? value | 0x8000 : value & 0x7fff
end
reflect_x?() click to toggle source

Return true if the translation bitarray indicates that a reflection about the x-axis is set.

# File lib/gdsii/strans.rb, line 93
def reflect_x?()
  (value & 0x8000) == 0x8000
end
value() click to toggle source

Get the strans bitarray data (returns Fixnum). The recommendation is to not access this directly but rather use the various bitwise query methods instead: reflect_x?, abs_angle?, abs_mag?.

# File lib/gdsii/strans.rb, line 43
def value() @records.get_data(GRT_STRANS); end
value=(val) click to toggle source

Set the strans bitarray record. The recommendation is to not access this directly but rather use the various bitwise manipulation methods instead: reflect_x=, abs_angle=, abs_mag=.

  • 15 = reflect_x

  • 2 = abs_mag

  • 1 = abs_angle

  • All others reserved for future use.

# File lib/gdsii/strans.rb, line 55
def value=(val)
  @records.set(GRT_STRANS,val);
end