Mercurial > hg > svgui
comparison layer/SliceLayer.cpp @ 248:28c8e8e3c537
* Fix many compile warnings, remove some debug output
author | Chris Cannam |
---|---|
date | Mon, 30 Apr 2007 13:36:23 +0000 |
parents | 8dc50f57d480 |
children | a2ae3d93c645 |
comparison
equal
deleted
inserted
replaced
247:0e9f59f991aa | 248:28c8e8e3c537 |
---|---|
135 range = f1 - f0 + 1; | 135 range = f1 - f0 + 1; |
136 | 136 |
137 if (includeBinDescription) { | 137 if (includeBinDescription) { |
138 | 138 |
139 float minvalue = 0.f; | 139 float minvalue = 0.f; |
140 if (minbin < m_values.size()) minvalue = m_values[minbin]; | 140 if (minbin < int(m_values.size())) minvalue = m_values[minbin]; |
141 | 141 |
142 float maxvalue = minvalue; | 142 float maxvalue = minvalue; |
143 if (maxbin < m_values.size()) maxvalue = m_values[maxbin]; | 143 if (maxbin < int(m_values.size())) maxvalue = m_values[maxbin]; |
144 | 144 |
145 if (minvalue > maxvalue) std::swap(minvalue, maxvalue); | 145 if (minvalue > maxvalue) std::swap(minvalue, maxvalue); |
146 | 146 |
147 QString binstr; | 147 QString binstr; |
148 if (maxbin != minbin) { | 148 if (maxbin != minbin) { |
259 // int yorigin = (v->height() / 2) + (h / 2); | 259 // int yorigin = (v->height() / 2) + (h / 2); |
260 | 260 |
261 QPainterPath path; | 261 QPainterPath path; |
262 float thresh = -80.f; | 262 float thresh = -80.f; |
263 | 263 |
264 int mh = m_sliceableModel->getHeight(); | 264 size_t mh = m_sliceableModel->getHeight(); |
265 | 265 |
266 int divisor = 0; | 266 int divisor = 0; |
267 | 267 |
268 m_values.clear(); | 268 m_values.clear(); |
269 for (size_t bin = 0; bin < mh; ++bin) { | 269 for (size_t bin = 0; bin < mh; ++bin) { |
431 } | 431 } |
432 */ | 432 */ |
433 } | 433 } |
434 | 434 |
435 int | 435 int |
436 SliceLayer::getVerticalScaleWidth(View *v, QPainter &paint) const | 436 SliceLayer::getVerticalScaleWidth(View *, QPainter &paint) const |
437 { | 437 { |
438 if (m_energyScale == LinearScale) { | 438 if (m_energyScale == LinearScale) { |
439 return std::max(paint.fontMetrics().width("0.0") + 13, | 439 return std::max(paint.fontMetrics().width("0.0") + 13, |
440 paint.fontMetrics().width("x10-10")); | 440 paint.fontMetrics().width("x10-10")); |
441 } else { | 441 } else { |
534 int val = 0; | 534 int val = 0; |
535 | 535 |
536 int garbage0, garbage1, garbage2; | 536 int garbage0, garbage1, garbage2; |
537 if (!min) min = &garbage0; | 537 if (!min) min = &garbage0; |
538 if (!max) max = &garbage1; | 538 if (!max) max = &garbage1; |
539 if (!deflt) deflt = &garbage1; | 539 if (!deflt) deflt = &garbage2; |
540 | 540 |
541 if (name == "Gain") { | 541 if (name == "Gain") { |
542 | 542 |
543 *min = -50; | 543 *min = -50; |
544 *max = 50; | 544 *max = 50; |
850 bool normalize = (attributes.value("normalize").trimmed() == "true"); | 850 bool normalize = (attributes.value("normalize").trimmed() == "true"); |
851 setNormalize(normalize); | 851 setNormalize(normalize); |
852 } | 852 } |
853 | 853 |
854 bool | 854 bool |
855 SliceLayer::getValueExtents(float &min, float &max, bool &logarithmic, | 855 SliceLayer::getValueExtents(float &, float &, bool &, QString &) const |
856 QString &units) const | |
857 { | 856 { |
858 return false; | 857 return false; |
859 } | 858 } |
860 | 859 |