OpenCOVER
ColorBar.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef _COLOR_BAR_H_
9#define _COLOR_BAR_H_
10
11#include "coColorBar.h"
12#include <OpenVRUI/coMenu.h>
13#include <OpenVRUI/coRowMenu.h>
18
19#include <cover/coTabletUI.h>
20#include <util/coTabletUIMessages.h>
21#include <cover/coVRTui.h>
22
23#include <util/coTypes.h>
24#include <cover/coInteractor.h>
25
26// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27// class ColorBar
28//
29// ColorBar manages a coColorbar, the submenu in which the colorbar appears
30// and the button which opens/closes the submenu
31//
32// Initial version: 2002-02, dr
33// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34// (C) 2002 by Vircinity IT Consulting
35// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
36namespace opencover
37{
38namespace ui
39{
40class SpecialElement;
41}
42
43class PLUGIN_UTILEXPORT ColorBar: public ui::Owner
44{
45private:
46 vrui::vruiMatrix *floatingMat_ = nullptr;
47 coColorBar *colorbar_ = nullptr, *hudbar_ = nullptr;
48 ui::Menu *colorsMenu_ = nullptr;
49 std::string title_;
50 std::string name_;
51 std::string species_;
52 ui::SpecialElement *uiColorBar_ = nullptr;
53 ui::Slider *minSlider_ = nullptr;
54 ui::Slider *maxSlider_ = nullptr;
55 ui::Slider *stepSlider_ = nullptr;
56 ui::Button *autoScale_ = nullptr;
57 ui::Action *execute_ = nullptr;
58 ui::Slider *center_ = nullptr;
59 ui::Slider *compress_ = nullptr;
60 ui::Slider *insetCenter_ = nullptr;
61 ui::Slider *insetWidth_ = nullptr;
62 ui::Slider *opacityFactor_ = nullptr;
63 ui::Button *show_ = nullptr;
64
65 opencover::coInteractor *inter_ = nullptr;
66
67 void updateTitle();
68
69 float min = 0.0;
70 float max = 1.0;
71 int numColors = 0;
72 std::vector<float> r, g, b, a;
73 bool hudVisible_ = false;
74
75public:
76
90 ColorBar(ui::Menu *menu);
91
94
95 bool hudVisible() const;
96 void setHudPosition(osg::Vec3 pos, osg::Vec3 hpr, float size);
97
108 void update(const std::string &species, float min, float max, int numColors, const float *r, const float *g, const float *b, const float *a);
109
111 void setName(const char *name);
112
116 const char *getName();
117
129 static void parseAttrib(const char *attrib, std::string &species,
130 float &min, float &max, int &numColors,
131 std::vector<float> &r, std::vector<float> &g, std::vector<float> &b, std::vector<float> &a);
132
133 void parseAttrib(const char *attrib);
134 void setVisible(bool);
135 bool isVisible();
136
139};
140}
141#endif
Tablet user interface proxy classes.
feedback parameter changes to COVISE
make OpenCOVER core functionality available via tablet user interface
Definition: ARToolKit.h:33
abstract feedback class for interacting with parameters of visualization modules (e....
Definition: coInteractor.h:37
Definition: coColorBar.h:43
Definition: ColorBar.h:44
const char * getName()
bool hudVisible() const
void update(const std::string &species, float min, float max, int numColors, const float *r, const float *g, const float *b, const float *a)
~ColorBar()
destructor
static void parseAttrib(const char *attrib, std::string &species, float &min, float &max, int &numColors, std::vector< float > &r, std::vector< float > &g, std::vector< float > &b, std::vector< float > &a)
void setVisible(bool)
void addInter(opencover::coInteractor *inter)
void parseAttrib(const char *attrib)
void setHudPosition(osg::Vec3 pos, osg::Vec3 hpr, float size)
ColorBar(ui::Menu *menu)
void setName(const char *name)
Definition: vruiMatrix.h:20