Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 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 |
comparison
equal
deleted
inserted
replaced
155:6a24c797c157 | 156:89737ffa4580 |
---|---|
1562 layer = m_document->createImportedLayer(dm); | 1562 layer = m_document->createImportedLayer(dm); |
1563 | 1563 |
1564 if (layer->isLayerOpaque() || | 1564 if (layer->isLayerOpaque() || |
1565 dynamic_cast<Colour3DPlotLayer *>(layer)) { | 1565 dynamic_cast<Colour3DPlotLayer *>(layer)) { |
1566 | 1566 |
1567 // these always go in a new pane, with nothing | |
1568 // else going in the same pane | |
1569 | |
1567 Pane *singleLayerPane = addPaneToStack(); | 1570 Pane *singleLayerPane = addPaneToStack(); |
1568 if (m_timeRulerLayer) { | 1571 if (m_timeRulerLayer) { |
1569 m_document->addLayerToView(singleLayerPane, m_timeRulerLayer); | 1572 m_document->addLayerToView(singleLayerPane, m_timeRulerLayer); |
1570 } | 1573 } |
1571 m_document->addLayerToView(singleLayerPane, layer); | 1574 m_document->addLayerToView(singleLayerPane, layer); |
1575 | |
1576 } else if (layer->getLayerColourSignificance() == | |
1577 Layer::ColourHasMeaningfulValue) { | |
1578 | |
1579 // these can go in a pane with something else, but | |
1580 // only if none of the something elses also have | |
1581 // this quality | |
1582 | |
1583 bool needNewPane = false; | |
1584 for (int i = 0; i < pane->getLayerCount(); ++i) { | |
1585 Layer *otherLayer = pane->getLayer(i); | |
1586 if (otherLayer && | |
1587 (otherLayer->getLayerColourSignificance() == | |
1588 Layer::ColourHasMeaningfulValue)) { | |
1589 needNewPane = true; | |
1590 break; | |
1591 } | |
1592 } | |
1593 if (needNewPane) { | |
1594 pane = addPaneToStack(); | |
1595 } | |
1596 | |
1597 m_document->addLayerToView(pane, layer); | |
1572 | 1598 |
1573 } else { | 1599 } else { |
1574 | 1600 |
1575 if (pane->getLayerCount() > 4) { | 1601 if (pane->getLayerCount() > 4) { |
1576 pane = addPaneToStack(); | 1602 pane = addPaneToStack(); |