| 3229 | #endif |
| 3230 | |
| 3231 | void |
| 3232 | LayoutViewBase::reload_layout (unsigned int cv_index) |
| 3233 | { |
| 3234 | stop (); |
| 3235 | cancel_esc (); |
| 3236 | |
| 3237 | // save the current view state |
| 3238 | lay::DisplayState state; |
| 3239 | save_view (state); |
| 3240 | |
| 3241 | // this is the cellview at the given index (use a copy since the original is overwritten) |
| 3242 | CellView cvorg = cellview (cv_index); |
| 3243 | |
| 3244 | // obtain the original filename |
| 3245 | std::string filename = cvorg->filename (); |
| 3246 | std::string technology = cvorg->tech_name (); |
| 3247 | std::string name = cvorg->name (); |
| 3248 | |
| 3249 | // recreate hidden cells by doing a name referencing |
| 3250 | std::vector <std::string> hidden_cells; |
| 3251 | if (m_hidden_cells.size () > cv_index) { |
| 3252 | hidden_cells.reserve (m_hidden_cells [cv_index].size ()); |
| 3253 | for (std::set <cell_index_type>::const_iterator ci = m_hidden_cells [cv_index].begin (); ci != m_hidden_cells [cv_index].end (); ++ci) { |
| 3254 | hidden_cells.push_back (std::string (cvorg->layout ().cell_name (*ci))); |
| 3255 | } |
| 3256 | } |
| 3257 | |
| 3258 | // Set up a list of present layers |
| 3259 | std::set <db::LayerProperties, db::LPLogicalLessFunc> present_layers; |
| 3260 | for (LayerPropertiesConstIterator lay_iter = begin_layers (); ! lay_iter.at_end (); ++lay_iter) { |
| 3261 | if (! lay_iter->has_children ()) { |
| 3262 | present_layers.insert (lay_iter->source (true /*real*/).layer_props ()); |
| 3263 | } |
| 3264 | } |
| 3265 | |
| 3266 | std::map <unsigned int, db::LayerProperties> org_layers; |
| 3267 | |
| 3268 | for (unsigned int i = 0; i < cvorg->layout ().layers (); ++i) { |
| 3269 | if (cvorg->layout ().is_valid_layer (i)) { |
| 3270 | const db::LayerProperties &p = cvorg->layout ().get_properties (i); |
| 3271 | if (! p.log_equal (db::LayerProperties ())) { |
| 3272 | org_layers.insert (std::make_pair (i, p)); |
| 3273 | } |
| 3274 | } |
| 3275 | } |
| 3276 | |
| 3277 | lay::LayoutHandle *handle; |
| 3278 | |
| 3279 | // reset the layout: create a dummy handle and install this in between |
| 3280 | // this will clear the original layout if not further referenced. |
| 3281 | // Since the dummy layout will act as a placeholder if something goes wrong |
| 3282 | // when reading the file, it must have the layers created as well |
| 3283 | lay::CellView cv_empty; |
| 3284 | |
| 3285 | handle = new lay::LayoutHandle (new db::Layout (is_editable (), manager ()), filename); |
| 3286 | handle->set_tech_name (technology); |
| 3287 | cv_empty.set (handle); |
| 3288 |
nothing calls this directly
no test coverage detected