# HG changeset patch # User Chris Cannam # Date 1234452403 0 # Node ID 89737ffa458015d126409710ee5eaa5a93eeb6b8 # Parent 6a24c797c15766fbe239f0d3a31e187d0bb4b4c7 * Some fairly simplistic code to set up layer type properties based on RDF data about feature types (both when running transforms and when importing features from RDF files). diff -r 6a24c797c157 -r 89737ffa4580 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Mon Feb 09 16:50:52 2009 +0000 +++ b/framework/MainWindowBase.cpp Thu Feb 12 15:26:43 2009 +0000 @@ -1564,12 +1564,38 @@ if (layer->isLayerOpaque() || dynamic_cast(layer)) { + // these always go in a new pane, with nothing + // else going in the same pane + Pane *singleLayerPane = addPaneToStack(); if (m_timeRulerLayer) { m_document->addLayerToView(singleLayerPane, m_timeRulerLayer); } m_document->addLayerToView(singleLayerPane, layer); + } else if (layer->getLayerColourSignificance() == + Layer::ColourHasMeaningfulValue) { + + // these can go in a pane with something else, but + // only if none of the something elses also have + // this quality + + bool needNewPane = false; + for (int i = 0; i < pane->getLayerCount(); ++i) { + Layer *otherLayer = pane->getLayer(i); + if (otherLayer && + (otherLayer->getLayerColourSignificance() == + Layer::ColourHasMeaningfulValue)) { + needNewPane = true; + break; + } + } + if (needNewPane) { + pane = addPaneToStack(); + } + + m_document->addLayerToView(pane, layer); + } else { if (pane->getLayerCount() > 4) {