mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-07 19:51:32 +02:00
BUGFIX: db::Shapes::insert(db::Shapes) wasn't working correctly!
This commit is contained in:
@@ -174,9 +174,15 @@ Shapes::do_insert (const Shapes &d)
|
||||
if (layout () == d.layout ()) {
|
||||
|
||||
// both shape containers reside in the same repository space - simply copy
|
||||
m_layers.reserve (d.m_layers.size ());
|
||||
for (tl::vector<LayerBase *>::const_iterator l = d.m_layers.begin (); l != d.m_layers.end (); ++l) {
|
||||
m_layers.push_back ((*l)->clone (this, manager ()));
|
||||
if (m_layers.empty ()) {
|
||||
m_layers.reserve (d.m_layers.size ());
|
||||
for (tl::vector<LayerBase *>::const_iterator l = d.m_layers.begin (); l != d.m_layers.end (); ++l) {
|
||||
m_layers.push_back ((*l)->clone (this, manager ()));
|
||||
}
|
||||
} else {
|
||||
for (tl::vector<LayerBase *>::const_iterator l = d.m_layers.begin (); l != d.m_layers.end (); ++l) {
|
||||
(*l)->insert_into (this);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (layout () == 0) {
|
||||
|
||||
@@ -493,6 +493,7 @@ public:
|
||||
virtual void transform_into (Shapes *target, const Trans &trans, GenericRepository &rep, ArrayRepository &array_rep, pm_delegate_type &pm) const = 0;
|
||||
virtual void transform_into (Shapes *target, const ICplxTrans &trans, GenericRepository &rep, ArrayRepository &array_rep) const = 0;
|
||||
virtual void transform_into (Shapes *target, const ICplxTrans &trans, GenericRepository &rep, ArrayRepository &array_rep, pm_delegate_type &pm) const = 0;
|
||||
virtual void insert_into (Shapes *target) = 0;
|
||||
virtual void deref_into (Shapes *target) = 0;
|
||||
virtual void deref_into (Shapes *target, pm_delegate_type &pm) = 0;
|
||||
virtual void deref_and_transform_into (Shapes *target, const Trans &trans) = 0;
|
||||
|
||||
@@ -834,6 +834,13 @@ layer_class<Sh, StableTag>::transform_into (Shapes *target, const ICplxTrans &tr
|
||||
}
|
||||
}
|
||||
|
||||
template <class Sh, class StableTag>
|
||||
void
|
||||
layer_class<Sh, StableTag>::insert_into (Shapes *target)
|
||||
{
|
||||
target->insert (m_layer.begin (), m_layer.end ());
|
||||
}
|
||||
|
||||
template <class Sh, class StableTag>
|
||||
void
|
||||
layer_class<Sh, StableTag>::deref_into (Shapes *target)
|
||||
@@ -870,6 +877,7 @@ layer_class<Sh, StableTag>::deref_and_transform_into (Shapes *target, const Tran
|
||||
{
|
||||
deref_and_transform_into_shapes deref_op (target);
|
||||
for (typename layer_type::iterator s = m_layer.begin (); s != m_layer.end (); ++s) {
|
||||
|
||||
deref_op (*s, trans, pm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ public:
|
||||
virtual void transform_into (Shapes *target, const Trans &trans, GenericRepository &rep, ArrayRepository &array_rep, pm_delegate_type &pm) const;
|
||||
virtual void transform_into (Shapes *target, const ICplxTrans &trans, GenericRepository &rep, ArrayRepository &array_rep) const;
|
||||
virtual void transform_into (Shapes *target, const ICplxTrans &trans, GenericRepository &rep, ArrayRepository &array_rep, pm_delegate_type &pm) const;
|
||||
virtual void insert_into (Shapes *target);
|
||||
virtual void deref_into (Shapes *target);
|
||||
virtual void deref_into (Shapes *target, pm_delegate_type &pm);
|
||||
virtual void deref_and_transform_into (Shapes *target, const Trans &trans);
|
||||
|
||||
Reference in New Issue
Block a user