WIP: some refactoring, introducing cut layer in via definition

This commit is contained in:
Matthias Koefferlein
2025-08-18 22:53:45 +02:00
parent 33ffa6367f
commit 39c8e0ca15
7 changed files with 56 additions and 16 deletions
+17 -6
View File
@@ -1604,19 +1604,30 @@ LayoutViewBase::rename_properties (unsigned int index, const std::string &new_na
layer_list_changed_event (4);
}
bool
LayoutViewBase::set_current_layer (unsigned int cv_index, const db::LayerProperties &lp)
lay::LayerPropertiesConstIterator
LayoutViewBase::find_layer (unsigned int cv_index, const db::LayerProperties &lp) const
{
// rename the ones that got shifted.
lay::LayerPropertiesConstIterator l = begin_layers ();
while (! l.at_end ()) {
if (l->source (true).cv_index () == int (cv_index) && l->source (true).layer_props ().log_equal (lp)) {
set_current_layer (l);
return true;
return l;
}
++l;
}
return false;
return lay::LayerPropertiesConstIterator ();
}
bool
LayoutViewBase::set_current_layer (unsigned int cv_index, const db::LayerProperties &lp)
{
lay::LayerPropertiesConstIterator l = find_layer (cv_index, lp);
if (! l.is_null ()) {
set_current_layer (l);
return true;
} else {
return false;
}
}
void
@@ -602,6 +602,13 @@ public:
*/
virtual lay::LayerPropertiesConstIterator current_layer () const;
/**
* @brief Finds the first layer by layer properties and cell view index
*
* Returns a null iterator if the layer is not found in the list.
*/
virtual lay::LayerPropertiesConstIterator find_layer (unsigned int cv_index, const db::LayerProperties &properties) const;
/**
* @brief Return the layers that are selected in the layer browser
*