Skip to content

Commit d7ae9ba

Browse files
author
Haydelj
committed
cleaned up dead code and removed outdated comments
1 parent 3e000f3 commit d7ae9ba

File tree

4 files changed

+2
-33
lines changed

4 files changed

+2
-33
lines changed

src/Core/Datatypes/ColorMap.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,8 @@ double ColorMap::getTransformedValue(double f) const
192192
ColorRGB ColorMap::getColorMapVal(double v) const
193193
{
194194
double f = getTransformedValue(v);
195-
//now grab the RGB
196195
auto colorWithoutAlpha = color_->getColorMapVal(f);
197-
//TODO:
198196
return applyAlpha(f, colorWithoutAlpha);
199-
//return colorWithoutAlpha;
200197
}
201198

202199
ColorRGB ColorMap::applyAlpha(double transformed, ColorRGB colorWithoutAlpha) const
@@ -207,7 +204,6 @@ ColorRGB ColorMap::applyAlpha(double transformed, ColorRGB colorWithoutAlpha) co
207204

208205
double ColorMap::alpha(double transformedValue) const
209206
{
210-
//transformedValue *= 365.0f;
211207
if(alphaLookup_.size() == 0) return 0.5;
212208
int i;
213209
for(i = 0; (i < alphaLookup_.size()) && (alphaLookup_[i] < transformedValue); i += 2);

src/Core/Datatypes/ColorMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace Datatypes {
5252
const std::string& name = "Rainbow", const size_t resolution = 256,
5353
const double shift = 0.0, const bool invert = false,
5454
const double rescale_scale = .5, const double rescale_shift = 1.0,
55-
const std::vector<double>& alphaPoints = std::vector<double>());
55+
const std::vector<double>& alphaPoints = {});
5656
//TODO cbright: pass in alpha vector
5757
virtual ColorMap* clone() const override;
5858

@@ -117,7 +117,7 @@ namespace Datatypes {
117117
static ColorMapHandle create(const std::string& name = "Rainbow", const size_t &resolution = 256,
118118
const double &shift = 0.0, const bool &invert = false,
119119
const double &rescale_scale = .5, const double &rescale_shift = 1.0,
120-
const std::vector<double>& alphaPoints = std::vector<double>());
120+
const std::vector<double>& alphaPoints = {});
121121
typedef std::vector<std::string> NameList;
122122
static NameList getList();
123123
private:

src/Interface/Modules/Visualization/CreateStandardColorMapDialog.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ void CreateStandardColorMapDialog::onInvertCheck(bool b)
160160
AlphaFunctionManager::AlphaFunctionManager(const QPointF& start, const QPointF& end, ModuleStateHandle state, const boost::atomic<bool>& pulling) :
161161
state_(state),
162162
defaultStart_(start), defaultEnd_(end),
163-
alphaFunction_(ALPHA_VECTOR_LENGTH, DEFAULT_ALPHA),
164163
dialogPulling_(pulling)
165164
{
166165
}
@@ -229,14 +228,12 @@ bool AlphaFunctionManager::alreadyExists(const QPointF& point) const
229228
void AlphaFunctionManager::insert(const QPointF& p)
230229
{
231230
alphaPoints_.insert(p);
232-
updateAlphaFunction();
233231
pushToState();
234232
}
235233

236234
void AlphaFunctionManager::clear()
237235
{
238236
alphaPoints_.clear();
239-
alphaFunction_.assign(ALPHA_VECTOR_LENGTH, DEFAULT_ALPHA);
240237
pushToState();
241238
}
242239

@@ -247,7 +244,6 @@ void AlphaFunctionManager::pushToState()
247244
if (!alphaPoints_.empty())
248245
{
249246
Variable::List alphaPointsVec;
250-
//strip endpoints before saving user-added points
251247
auto begin = alphaPoints_.begin(), end = alphaPoints_.end();
252248
std::for_each(begin, end, [&](const QPointF& p) { alphaPointsVec.emplace_back(Name("alphaPoint"),
253249
makeAnonymousVariableList(p.x()/colormapPreviewWidth, 1.0f - p.y()/colormapPreviewHeight)); });
@@ -257,8 +253,6 @@ void AlphaFunctionManager::pushToState()
257253
{
258254
state_->setValue(Parameters::AlphaUserPointsVector, Variable::List());
259255
}
260-
261-
state_->setTransientValue(Parameters::AlphaFunctionVector, alphaFunction_);
262256
}
263257
}
264258

@@ -295,26 +289,6 @@ void ColormapPreview::clearAlphaPointGraphics()
295289
addDefaultLine();
296290
}
297291

298-
void AlphaFunctionManager::updateAlphaFunction()
299-
{
300-
//from v4, color endpoints (0 and 1) are fixed at alpha = 0.5.
301-
// alphaFunction_ will sample from in between these endpoints, evenly spaced throughout open interval (0,1)
302-
303-
for (int i = 0; i < static_cast<int>(alphaFunction_.size()); ++i)
304-
{
305-
if (false && i > 0 && i < alphaFunction_.size() - 1)
306-
{
307-
double color = i / static_cast<double>(ALPHA_SAMPLES + 1);
308-
auto between = alphaLineEndpointsAtColor(color);
309-
alphaFunction_[i] = interpolateAlphaLineValue(between.first, between.second, color);
310-
}
311-
else
312-
{
313-
alphaFunction_[i] = DEFAULT_ALPHA;
314-
}
315-
}
316-
}
317-
318292
std::pair<QPointF,QPointF> AlphaFunctionManager::alphaLineEndpointsAtColor(double color) const
319293
{
320294
auto rightIter = alphaPoints_.upper_bound(colorToPoint(color));

src/Interface/Modules/Visualization/CreateStandardColorMapDialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ namespace SCIRun {
6767
const double DEFAULT_ALPHA = 0.5;
6868
const QPointF defaultStart_;
6969
const QPointF defaultEnd_;
70-
std::vector<double> alphaFunction_;
7170
const boost::atomic<bool>& dialogPulling_;
7271
public:
7372
auto begin() const -> decltype(alphaPoints_.begin()) { return alphaPoints_.begin(); }

0 commit comments

Comments
 (0)