| 121 | } |
| 122 | |
| 123 | void |
| 124 | CellView::set_cell (cell_index_type index) |
| 125 | { |
| 126 | tl_assert (m_layout_href.get () != 0); |
| 127 | |
| 128 | db::Layout &layout = m_layout_href->layout (); |
| 129 | |
| 130 | if (! layout.is_valid_cell_index (index)) { |
| 131 | |
| 132 | reset_cell (); |
| 133 | |
| 134 | } else { |
| 135 | |
| 136 | m_cell_index = index; |
| 137 | mp_cell = &layout.cell (m_cell_index); |
| 138 | |
| 139 | m_unspecific_path.clear (); |
| 140 | m_specific_path.clear (); |
| 141 | m_unspecific_path.push_back (index); |
| 142 | |
| 143 | while (! layout.cell (index).is_top ()) { |
| 144 | index = *layout.cell (index).begin_parent_cells (); |
| 145 | m_unspecific_path.push_back (index); |
| 146 | } |
| 147 | |
| 148 | std::reverse (m_unspecific_path.begin (), m_unspecific_path.end ()); |
| 149 | |
| 150 | mp_ctx_cell = mp_cell; |
| 151 | m_ctx_cell_index = m_cell_index; |
| 152 | |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void |
| 157 | CellView::set_cell (const std::string &name) |
no test coverage detected