# HG changeset patch # User Chris Cannam # Date 1234452403 0 # Node ID b3140e9e066583f27213ae95def0aba5b797537f # Parent 4afdcecbd62ec4b9e79f60aad3328455dcc64f09 * 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 4afdcecbd62e -r b3140e9e0665 layer/TimeInstantLayer.cpp --- a/layer/TimeInstantLayer.cpp Wed Feb 11 14:44:14 2009 +0000 +++ b/layer/TimeInstantLayer.cpp Thu Feb 12 15:26:43 2009 +0000 @@ -63,6 +63,10 @@ std::cerr << "TimeInstantLayer::setModel(" << model << ")" << std::endl; #endif + if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) { + setPlotStyle(PlotSegmentation); + } + emit modelReplaced(); } diff -r 4afdcecbd62e -r b3140e9e0665 layer/TimeInstantLayer.h --- a/layer/TimeInstantLayer.h Wed Feb 11 14:44:14 2009 +0000 +++ b/layer/TimeInstantLayer.h Thu Feb 12 15:26:43 2009 +0000 @@ -100,6 +100,14 @@ void setProperties(const QXmlAttributes &attributes); + virtual ColourSignificance getLayerColourSignificance() const { + if (m_plotStyle == PlotSegmentation) { + return ColourHasMeaningfulValue; + } else { + return ColourDistinguishes; + } + } + protected: SparseOneDimensionalModel::PointList getLocalPoints(View *v, int) const; diff -r 4afdcecbd62e -r b3140e9e0665 layer/TimeValueLayer.cpp --- a/layer/TimeValueLayer.cpp Wed Feb 11 14:44:14 2009 +0000 +++ b/layer/TimeValueLayer.cpp Thu Feb 12 15:26:43 2009 +0000 @@ -69,6 +69,13 @@ m_scaleMinimum = 0; m_scaleMaximum = 0; + if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) { + setPlotStyle(PlotSegmentation); + } + if (m_model && m_model->getRDFTypeURI().endsWith("Change")) { + setPlotStyle(PlotSegmentation); + } + // std::cerr << "TimeValueLayer::setModel(" << model << ")" << std::endl; emit modelReplaced(); diff -r 4afdcecbd62e -r b3140e9e0665 layer/TimeValueLayer.h --- a/layer/TimeValueLayer.h Wed Feb 11 14:44:14 2009 +0000 +++ b/layer/TimeValueLayer.h Thu Feb 12 15:26:43 2009 +0000 @@ -129,6 +129,14 @@ void setProperties(const QXmlAttributes &attributes); + virtual ColourSignificance getLayerColourSignificance() const { + if (m_plotStyle == PlotSegmentation) { + return ColourHasMeaningfulValue; + } else { + return ColourDistinguishes; + } + } + protected: void getScaleExtents(View *, float &min, float &max, bool &log) const; int getYForValue(View *, float value) const;