Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 173:5a2845883dd6
* update to putative segmenter program
author | Chris Cannam |
---|---|
date | Tue, 09 Jun 2009 13:03:06 +0000 |
parents | 875a21ad7a95 |
children | 366f044c20e4 |
comparison
equal
deleted
inserted
replaced
172:f6a8fc35df93 | 173:5a2845883dd6 |
---|---|
2634 if (!inAView) removeLayerEditDialog(layer); | 2634 if (!inAView) removeLayerEditDialog(layer); |
2635 | 2635 |
2636 // Check whether we need to add or remove model from play source | 2636 // Check whether we need to add or remove model from play source |
2637 Model *model = layer->getModel(); | 2637 Model *model = layer->getModel(); |
2638 if (model) { | 2638 if (model) { |
2639 Model *source = model->getSourceModel(); | |
2639 if (inAView) { | 2640 if (inAView) { |
2640 m_playSource->addModel(model); | 2641 m_playSource->addModel(model); |
2642 if (source && source != model) { | |
2643 m_playSource->addModel(source); | |
2644 } | |
2641 } else { | 2645 } else { |
2642 bool found = false; | 2646 bool found = false; |
2643 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { | 2647 for (int i = 0; i < m_paneStack->getPaneCount(); ++i) { |
2644 Pane *pane = m_paneStack->getPane(i); | 2648 Pane *pane = m_paneStack->getPane(i); |
2645 if (!pane) continue; | 2649 if (!pane) continue; |
2646 for (int j = 0; j < pane->getLayerCount(); ++j) { | 2650 for (int j = 0; j < pane->getLayerCount(); ++j) { |
2647 Layer *pl = pane->getLayer(j); | 2651 Layer *pl = pane->getLayer(j); |
2648 if (pl && pl->getModel() == model) { | 2652 if (pl && (pl->getModel() == model || |
2653 pl->getModel() == source)) { | |
2649 found = true; | 2654 found = true; |
2650 break; | 2655 break; |
2651 } | 2656 } |
2652 } | 2657 } |
2653 if (found) break; | 2658 if (found) break; |
2654 } | 2659 } |
2655 if (!found) m_playSource->removeModel(model); | 2660 if (!found) { |
2661 m_playSource->removeModel(model); | |
2662 if (source && source != model) { | |
2663 m_playSource->removeModel(source); | |
2664 } | |
2665 } | |
2656 } | 2666 } |
2657 } | 2667 } |
2658 | 2668 |
2659 updateMenuStates(); | 2669 updateMenuStates(); |
2660 } | 2670 } |