class Gdsii::Strans
Represents a GDSII structure translation object (Strans).
Public Class Methods
Constructor
# 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
Set the strans absAngle bit
# File lib/gdsii/strans.rb, line 128 def abs_angle=(flag) self.value = flag ? value | 0x0002 : value & 0xfffd end
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
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
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
Get the strans angle value (returns Fixnum)
# File lib/gdsii/strans.rb, line 67 def angle() @records.get_data(GRT_ANGLE); end
Set the strans angle record
# File lib/gdsii/strans.rb, line 72 def angle=(val) @records.set(GRT_ANGLE,val); end
Get the strans angle (returns Record)
# File lib/gdsii/strans.rb, line 62 def angle_record() @records.get_data(GRT_ANGLE); end
Get the strans magnification value (returns Fixnum)
# File lib/gdsii/strans.rb, line 82 def mag() @records.get_data(GRT_MAG); end
Set the strans magnification record
# File lib/gdsii/strans.rb, line 87 def mag=(val) @records.set(GRT_MAG,val); end
Get the strans magnification (returns Record)
# File lib/gdsii/strans.rb, line 77 def mag_record() @records.get_data(GRT_MAG); end
Get the strans bitarray (returns Record)
# File lib/gdsii/strans.rb, line 36 def record() @records.get(GRT_STRANS); end
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
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
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
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