# HG changeset patch # User Chris Cannam # Date 1221828935 0 # Node ID 04b7fd31e1c6b4451fac46e8ae0989692e135303 # Parent 288f455330411c24a71cc88ab67aa9d8f6c47e1f * Add segmentation plot type to region layer (plotting not implemented yet) diff -r 288f45533041 -r 04b7fd31e1c6 data/model/RegionModel.h --- a/data/model/RegionModel.h Thu Sep 18 16:08:14 2008 +0000 +++ b/data/model/RegionModel.h Fri Sep 19 12:55:35 2008 +0000 @@ -95,7 +95,8 @@ RegionModel(size_t sampleRate, size_t resolution, bool notifyOnAdd = true) : IntervalModel(sampleRate, resolution, notifyOnAdd), - m_valueQuantization(0) + m_valueQuantization(0), + m_haveDistinctValues(false) { } @@ -105,7 +106,8 @@ IntervalModel(sampleRate, resolution, valueMinimum, valueMaximum, notifyOnAdd), - m_valueQuantization(0) + m_valueQuantization(0), + m_haveDistinctValues(false) { } @@ -116,6 +118,8 @@ float getValueQuantization() const { return m_valueQuantization; } void setValueQuantization(float q) { m_valueQuantization = q; } + bool haveDistinctValues() const { return m_haveDistinctValues; } + QString getTypeName() const { return tr("Region"); } virtual void toXml(QTextStream &out, @@ -197,8 +201,15 @@ return SortNumeric; } + virtual void addPoint(const Point &point) + { + if (point.value != 0.f) m_haveDistinctValues = true; + IntervalModel::addPoint(point); + } + protected: float m_valueQuantization; + bool m_haveDistinctValues; }; #endif