Mercurial > hg > svgui
comparison layer/Colour3DPlotRenderer.h @ 1076:e536dfc6b250 spectrogram-minor-refactor
Two functions, rather than one with a boolean arg
author | Chris Cannam |
---|---|
date | Thu, 30 Jun 2016 10:36:52 +0100 |
parents | 2e1d6c2ed3ee |
children | 7ebfb61b1701 |
comparison
equal
deleted
inserted
replaced
1075:2e1d6c2ed3ee | 1076:e536dfc6b250 |
---|---|
97 /** | 97 /** |
98 * Render the requested area using the given painter, obtaining | 98 * Render the requested area using the given painter, obtaining |
99 * geometry (e.g. start frame) from the stored | 99 * geometry (e.g. start frame) from the stored |
100 * LayerGeometryProvider. | 100 * LayerGeometryProvider. |
101 * | 101 * |
102 * If complete is false, as much of the rect will be rendered as | 102 * The whole rect will be rendered and the returned QRect will be |
103 * can be managed given internal time constraints. The returned | 103 * equal to the passed QRect. (See renderTimeConstrained for an |
104 * QRect (the rendered field in the RenderResult struct) will | 104 * alternative that may render only part of the rect in cases |
105 * contain the area that was rendered. Note that we always render | 105 * where obtaining source data is slow and retaining |
106 * the full requested height, it's only width that is | 106 * responsiveness is important.) |
107 * time-constrained. | |
108 * | |
109 * If complete is true, the whole rect will be rendered and the | |
110 * returned QRect will be equal to the passed QRect. | |
111 * | 107 * |
112 * If the model to render from is not ready, this will throw a | 108 * If the model to render from is not ready, this will throw a |
113 * std::logic_error exception. The model must be ready and the | 109 * std::logic_error exception. The model must be ready and the |
114 * layer requesting the render must not be dormant in its view, so | 110 * layer requesting the render must not be dormant in its view, so |
115 * that the LayerGeometryProvider returns valid results; it is the | 111 * that the LayerGeometryProvider returns valid results; it is the |
116 * caller's responsibility to ensure these. | 112 * caller's responsibility to ensure these. |
117 */ | 113 */ |
118 RenderResult render(QPainter &paint, | 114 RenderResult render(QPainter &paint, QRect rect); |
119 QRect rect, | 115 |
120 bool complete); | 116 /** |
117 * Render the requested area using the given painter, obtaining | |
118 * geometry (e.g. start frame) from the stored | |
119 * LayerGeometryProvider. | |
120 * | |
121 * As much of the rect will be rendered as can be managed given | |
122 * internal time constraints (using a RenderTimer object | |
123 * internally). The returned QRect (the rendered field in the | |
124 * RenderResult struct) will contain the area that was | |
125 * rendered. Note that we always render the full requested height, | |
126 * it's only width that is time-constrained. | |
127 * | |
128 * If the model to render from is not ready, this will throw a | |
129 * std::logic_error exception. The model must be ready and the | |
130 * layer requesting the render must not be dormant in its view, so | |
131 * that the LayerGeometryProvider returns valid results; it is the | |
132 * caller's responsibility to ensure these. | |
133 */ | |
134 RenderResult renderTimeConstrained(QPainter &paint, QRect rect); | |
121 | 135 |
122 private: | 136 private: |
123 Sources m_sources; | 137 Sources m_sources; |
124 Parameters m_params; | 138 Parameters m_params; |
125 | 139 |
147 // carried out by repainting to cache (via the draw buffer) any | 161 // carried out by repainting to cache (via the draw buffer) any |
148 // area that is being requested but is not valid in the cache, and | 162 // area that is being requested but is not valid in the cache, and |
149 // then repainting from cache to the requested painter. | 163 // then repainting from cache to the requested painter. |
150 ScrollableImageCache m_cache; | 164 ScrollableImageCache m_cache; |
151 | 165 |
166 RenderResult render(QPainter &paint, QRect rect, bool timeConstrained); | |
152 | 167 |
153 //!!! fft model scaling? | 168 //!!! fft model scaling? |
154 | 169 |
155 //!!! should we own the Dense3DModelPeakCache here? or should it persist | 170 //!!! should we own the Dense3DModelPeakCache here? or should it persist |
156 }; | 171 }; |