Skip to content

Commit b8f7839

Browse files
author
hpcdgrie
committed
Show species under hud color bar
1 parent e437a73 commit b8f7839

2 files changed

Lines changed: 3 additions & 61 deletions

File tree

src/OpenCOVER/PluginUtil/colors/ColorBar.cpp

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,65 +46,6 @@ static const char V_BLENDWITHMATERIAL[] = "blend_with_material";
4646
using namespace vrui;
4747
using namespace opencover;
4848

49-
// namespace opencover
50-
// {
51-
52-
// opencover::ColorMap interpolateColorMap(const opencover::ColorMap &cm)
53-
// {
54-
// if(cm.steps() == cm.r.size())
55-
// return cm;
56-
// int numSteps = cm.steps;
57-
// opencover::ColorMap interpolatedMap = cm;
58-
// interpolatedMap.r.resize(numSteps);
59-
// interpolatedMap.g.resize(numSteps);
60-
// interpolatedMap.b.resize(numSteps);
61-
// interpolatedMap.a.resize(numSteps);
62-
// interpolatedMap.samplingPoints.resize(numSteps);
63-
64-
// auto numColors = cm.samplingPoints.size();
65-
// double delta = 1.0 / (numSteps - 1);
66-
// int idx = 0;
67-
68-
// for (int i = 0; i < numSteps - 1; i++)
69-
// {
70-
// double x = i * delta;
71-
// while (cm.samplingPoints[idx + 1] <= x)
72-
// {
73-
// idx++;
74-
// if (idx > numColors - 2)
75-
// {
76-
// idx = numColors - 2;
77-
// break;
78-
// }
79-
// }
80-
81-
// double d = (x - cm.samplingPoints[idx]) / (cm.samplingPoints[idx + 1] - cm.samplingPoints[idx]);
82-
// interpolatedMap.r[i] = static_cast<float>((1 - d) * cm.r[idx] + d * cm.r[idx + 1]);
83-
// interpolatedMap.g[i] = static_cast<float>((1 - d) * cm.g[idx] + d * cm.g[idx + 1]);
84-
// interpolatedMap.b[i] = static_cast<float>((1 - d) * cm.b[idx] + d * cm.b[idx + 1]);
85-
// interpolatedMap.a[i] = static_cast<float>((1 - d) * cm.a[idx] + d * cm.a[idx + 1]);
86-
// interpolatedMap.samplingPoints[i] = static_cast<float>(i) / (numSteps - 1);
87-
// }
88-
89-
// interpolatedMap.r[numSteps - 1] = cm.r[numColors - 1];
90-
// interpolatedMap.g[numSteps - 1] = cm.g[numColors - 1];
91-
// interpolatedMap.b[numSteps - 1] = cm.b[numColors - 1];
92-
// interpolatedMap.a[numSteps - 1] = cm.a[numColors - 1];
93-
// interpolatedMap.samplingPoints[numSteps - 1] = 1.0f;
94-
95-
// interpolatedMap.steps = numSteps;
96-
97-
// return interpolatedMap;
98-
// }
99-
100-
// ColorBar::ColorBar(ui::Menu *menu)
101-
// : ui::Owner(std::string("ColorBar"), menu)
102-
// , colorsMenu_(menu)
103-
// , map_(menu->name())
104-
// {
105-
// init();
106-
// }
107-
10849
ColorBar::ColorBar(ui::Group *group)
10950
: ui::Owner(std::string("ColorBar"), group)
11051
, colorsMenu_(group)
@@ -476,7 +417,7 @@ void ColorBar::show(bool state)
476417
{
477418
if(!hudbar_)
478419
{
479-
hudbar_ = std::make_unique<coColorBar>(name_, map_);
420+
hudbar_ = std::make_unique<coColorBar>(name_, map_, false);
480421
hudbar_->getUIElement()->createGeometry();
481422
}
482423
auto vtr = hudbar_->getUIElement()->getDCS();

src/OpenCOVER/PluginUtil/colors/ColorBar.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class PLUGIN_UTILEXPORT ColorBar: public ui::Owner
5151
{
5252
protected:
5353
vrui::vruiMatrix *floatingMat_ = nullptr;
54-
std::unique_ptr<coColorBar> colorbar_, hudbar_;
54+
std::unique_ptr<coColorBar> colorbar_; // the colorbar in vrui
55+
std::unique_ptr<coColorBar> hudbar_; // the hud for the desktop
5556
ui::Group *colorsMenu_ = nullptr;
5657
std::string title_;
5758
std::string name_;

0 commit comments

Comments
 (0)