mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-01 02:18:09 +02:00
Importing latest version of LStream package, bug fixes (mag instances, layer were duplicated)
This commit is contained in:
@@ -484,7 +484,12 @@ Compressed::compress_instances (const db::Cell::const_iterator &begin_instances,
|
||||
disp = create_repetition_from_array (&inst_array, array, irregular_array);
|
||||
}
|
||||
|
||||
db::CellInstArray single_inst (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
db::CellInstArray single_inst;
|
||||
if (! inst_array.is_complex ()) {
|
||||
single_inst = db::CellInstArray (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
} else {
|
||||
single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (-disp) * inst_array.front ()));
|
||||
}
|
||||
|
||||
// no compression -> just keep as is
|
||||
if (prop_id != 0) {
|
||||
@@ -499,7 +504,13 @@ Compressed::compress_instances (const db::Cell::const_iterator &begin_instances,
|
||||
// As we configured the compressor with level 0, no regular array formation will happen here. This is
|
||||
// good for instances as array instances are special.
|
||||
db::Vector disp = inst_array.front ().disp ();
|
||||
db::CellInstArray single_inst (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
|
||||
db::CellInstArray single_inst;
|
||||
if (! inst_array.is_complex ()) {
|
||||
single_inst = db::CellInstArray (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
} else {
|
||||
single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (-disp) * inst_array.front ()));
|
||||
}
|
||||
|
||||
if (prop_id != 0) {
|
||||
inst_with_properties_compressor.add (db::CellInstArrayWithProperties (single_inst, prop_id), disp);
|
||||
|
||||
@@ -111,8 +111,26 @@ Writer::write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLayou
|
||||
m_meta_data_view_id = -1;
|
||||
|
||||
m_layers_to_write.clear ();
|
||||
options.get_valid_layers (layout, m_layers_to_write, db::SaveLayoutOptions::LP_OnlyNumbered);
|
||||
options.get_valid_layers (layout, m_layers_to_write, db::SaveLayoutOptions::LP_OnlyNamed);
|
||||
|
||||
#if KLAYOUT_MAJOR_VERSION == 0 && (KLAYOUT_MINOR_VERSION < 30 || (KLAYOUT_MINOR_VERSION == 30 && KLAYOUT_TINY_VERSION < 5))
|
||||
{
|
||||
options.get_valid_layers (layout, m_layers_to_write, db::SaveLayoutOptions::LP_OnlyNumbered);
|
||||
options.get_valid_layers (layout, m_layers_to_write, db::SaveLayoutOptions::LP_OnlyNamed);
|
||||
|
||||
// clean up layer duplicates - see TODO above
|
||||
auto lw = m_layers_to_write.begin ();
|
||||
std::set<unsigned int> lseen;
|
||||
for (auto l = m_layers_to_write.begin (); l != m_layers_to_write.end (); ++l) {
|
||||
if (lseen.find (l->first) == lseen.end ()) {
|
||||
*lw++ = *l;
|
||||
lseen.insert (l->first);
|
||||
}
|
||||
}
|
||||
m_layers_to_write.erase (lw, m_layers_to_write.end ());
|
||||
}
|
||||
#else
|
||||
options.get_valid_layers (layout, m_layers_to_write, db::SaveLayoutOptions::LP_AsIs);
|
||||
#endif
|
||||
|
||||
m_cells_to_write.clear ();
|
||||
options.get_cells (layout, m_cells_to_write, m_layers_to_write);
|
||||
|
||||
Reference in New Issue
Block a user