// Cellrefarrays also have to resolve to integer placement. // Placement errors will occur if the x, y instance counts do not divide the array X, Y values cleanly. private void pSaveOASIS(oasWriter ow) { ow.modal.absoluteMode = ow.modal.absoluteMode switch { false => true, _ => ow.modal.absoluteMode }; byte info_byte = 128; //explicid cellname,repition; if (count_x > 1 || count_y > 1) { info_byte += 8; } switch (trans.mirror_x) { case true: info_byte += 1; break; } switch (Math.Abs(trans.mag - 1)) { case > double.Epsilon: info_byte += 4; break; } if (trans.angle != 0) { info_byte += 2; } if (point.X != ow.modal.placement_x) { info_byte += 32; } if (point.Y != ow.modal.placement_y) { info_byte += 16; } ow.writeUnsignedInteger(18); ow.writeRaw(info_byte); ow.writeString(cell_ref.cellName); switch (info_byte & 4) { case > 0: ow.writeReal(trans.mag); break; } switch (info_byte & 2) { case > 0: ow.writeReal(trans.angle); break; } switch (info_byte & 32) { case > 0: ow.modal.placement_x = point.X; ow.writeSignedInteger(ow.modal.placement_x); break; } switch (info_byte & 16) { case > 0: ow.modal.placement_y = point.Y; ow.writeSignedInteger(ow.modal.placement_y); break; } switch (info_byte & 8) { case > 0 when count_x == 1: ow.writeUnsignedInteger(3); ow.modal.y_dimension = count_y; ow.writeUnsignedInteger((uint)(count_y - 2)); ow.modal.y_space = pitch.Y; ow.writeUnsignedInteger((uint)pitch.Y); break; case > 0 when count_y == 1: ow.writeUnsignedInteger(2); ow.modal.x_dimension = count_x; ow.writeUnsignedInteger((uint)(count_x - 2)); ow.modal.x_space = pitch.X; ow.writeUnsignedInteger((uint)pitch.X); break; case > 0: ow.writeUnsignedInteger(1); ow.modal.x_dimension = count_x; ow.modal.y_dimension = count_y; ow.writeUnsignedInteger((uint)(count_x - 2)); ow.writeUnsignedInteger((uint)(count_y - 2)); ow.modal.x_space = pitch.X; ow.modal.y_space = pitch.Y; ow.writeUnsignedInteger((uint)pitch.X); ow.writeUnsignedInteger((uint)pitch.Y); break; } }
private void pSaveOASIS(oasWriter ow) { ow.modal.absoluteMode = ow.modal.absoluteMode switch { false => true, _ => ow.modal.absoluteMode }; byte info_byte = 128; //explicid cellname; switch (trans.mirror_x) { case true: info_byte += 1; break; } switch (Math.Abs(trans.mag - 1)) { case > double.Epsilon: info_byte += 4; break; } if (trans.angle != 0) { info_byte += 2; } if (point.X != ow.modal.placement_x) { info_byte += 32; } if (point.Y != ow.modal.placement_y) { info_byte += 16; } ow.writeUnsignedInteger(18); ow.writeRaw(info_byte); ow.writeString(cell_ref.cellName); switch (info_byte & 4) { case > 0: ow.writeReal(trans.mag); break; } switch (info_byte & 2) { case > 0: ow.writeReal(trans.angle); break; } switch (info_byte & 32) { case > 0: ow.modal.placement_x = point.X; ow.writeSignedInteger(ow.modal.placement_x); break; } switch (info_byte & 16) { case > 0: ow.modal.placement_y = point.Y; ow.writeSignedInteger(ow.modal.placement_y); break; } }