Mercurial > hg > svgui
comparison layer/Colour3DPlotLayer.cpp @ 193:57c2350a8c40
* Add slice layers (so you can display a slice of a colour 3d plot as if it were
a spectrum)
* Make spectrum layer a subclass of slice layer
author | Chris Cannam |
---|---|
date | Fri, 26 Jan 2007 16:59:57 +0000 |
parents | 42118892f428 |
children | 6b023411087b |
comparison
equal
deleted
inserted
replaced
192:fcc043f75c41 | 193:57c2350a8c40 |
---|---|
28 | 28 |
29 //#define DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1 | 29 //#define DEBUG_COLOUR_3D_PLOT_LAYER_PAINT 1 |
30 | 30 |
31 | 31 |
32 Colour3DPlotLayer::Colour3DPlotLayer() : | 32 Colour3DPlotLayer::Colour3DPlotLayer() : |
33 Layer(), | |
34 m_model(0), | 33 m_model(0), |
35 m_cache(0), | 34 m_cache(0), |
36 m_colourScale(LinearScale) | 35 m_colourScale(LinearScale) |
37 { | 36 { |
38 | 37 |
43 } | 42 } |
44 | 43 |
45 void | 44 void |
46 Colour3DPlotLayer::setModel(const DenseThreeDimensionalModel *model) | 45 Colour3DPlotLayer::setModel(const DenseThreeDimensionalModel *model) |
47 { | 46 { |
47 if (m_model == model) return; | |
48 const DenseThreeDimensionalModel *oldModel = m_model; | |
48 m_model = model; | 49 m_model = model; |
49 if (!m_model || !m_model->isOK()) return; | 50 if (!m_model || !m_model->isOK()) return; |
50 | 51 |
51 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); | 52 connect(m_model, SIGNAL(modelChanged()), this, SIGNAL(modelChanged())); |
52 connect(m_model, SIGNAL(modelChanged(size_t, size_t)), | 53 connect(m_model, SIGNAL(modelChanged(size_t, size_t)), |
58 connect(m_model, SIGNAL(modelChanged()), this, SLOT(cacheInvalid())); | 59 connect(m_model, SIGNAL(modelChanged()), this, SLOT(cacheInvalid())); |
59 connect(m_model, SIGNAL(modelChanged(size_t, size_t)), | 60 connect(m_model, SIGNAL(modelChanged(size_t, size_t)), |
60 this, SLOT(cacheInvalid(size_t, size_t))); | 61 this, SLOT(cacheInvalid(size_t, size_t))); |
61 | 62 |
62 emit modelReplaced(); | 63 emit modelReplaced(); |
64 emit sliceableModelReplaced(oldModel, model); | |
63 } | 65 } |
64 | 66 |
65 void | 67 void |
66 Colour3DPlotLayer::cacheInvalid() | 68 Colour3DPlotLayer::cacheInvalid() |
67 { | 69 { |