changeset 156:89737ffa4580

* 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).
author Chris Cannam
date Thu, 12 Feb 2009 15:26:43 +0000
parents 6a24c797c157
children ae56bf90cdf9
files framework/MainWindowBase.cpp
diffstat 1 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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<Colour3DPlotLayer *>(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) {