COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
WSColormap.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 WSCOLORMAP_H
9 #define WSCOLORMAP_H
10 
11 #include "WSExport.h"
12 #include "WSCoviseStub.h"
13 
14 #include <QList>
15 #include <QString>
16 
17 namespace covise
18 {
19 
21 {
22 
23 public:
25  {
26  r = 0.0f;
27  g = 0.0f;
28  b = 0.0f;
29  a = 0.0f;
30  position = 0.0f;
31  }
32 
33  WSColormapPin(float red, float green, float blue, float alpha, float pos)
34  {
35  r = red;
36  g = green;
37  b = blue;
38  a = alpha;
39  position = pos;
40  }
41 
42  WSColormapPin(const covise::covise__ColormapPin &pin)
43  {
44  r = pin.r;
45  g = pin.g;
46  b = pin.b;
47  a = pin.a;
48  position = pin.position;
49  }
50  virtual ~WSColormapPin(){};
51 
52  virtual covise::covise__ColormapPin getSerialisable() const;
53 
54  QString toString() const;
55 
56  float r;
57  float g;
58  float b;
59  float a;
60  float position;
61 };
62 
64 {
65 public:
66  WSColormap();
67  WSColormap(const QString &name, const QList<WSColormapPin> &pins);
68  WSColormap(const covise::covise__Colormap &colormap);
69  virtual ~WSColormap()
70  {
71  }
72 
73  const QList<WSColormapPin> &getPins() const
74  {
75  return this->pins;
76  }
77 
78  virtual covise::covise__Colormap getSerialisable() const;
79 
80  void setFromSerialisable(const covise::covise__Colormap &serialisable);
81 
82  QString toString() const;
83  QString toCoviseString() const;
84 
85 private:
86  QString name;
87  QList<WSColormapPin> pins;
88 };
89 }
90 #endif // WSCOLORMAP_H
GLfloat GLfloat GLfloat alpha
Definition: khronos-glext.h:6341
float g
Definition: WSColormap.h:57
float position
Definition: WSColormap.h:60
GLboolean GLboolean GLboolean GLboolean a
Definition: khronos-glext.h:6895
QList< WSColormapPin > pins
Definition: WSColormap.h:87
virtual ~WSColormapPin()
Definition: WSColormap.h:50
WSColormapPin()
Definition: WSColormap.h:24
const QList< WSColormapPin > & getPins() const
Definition: WSColormap.h:73
QString name
Definition: WSColormap.h:86
GLdouble GLdouble GLdouble r
Definition: khronos-glext.h:6457
float b
Definition: WSColormap.h:58
GLuint const GLchar * name
Definition: khronos-glext.h:6722
Definition: WSColormap.h:63
GLfloat green
Definition: khronos-glext.h:6341
GLfloat GLfloat blue
Definition: khronos-glext.h:6341
GLboolean GLboolean g
Definition: khronos-glext.h:6895
WSColormapPin(float red, float green, float blue, float alpha, float pos)
Definition: WSColormap.h:33
float a
Definition: WSColormap.h:59
Definition: WSColormap.h:20
float r
Definition: WSColormap.h:56
#define WSLIBEXPORT
Definition: coExport.h:373
GLboolean GLboolean GLboolean b
Definition: khronos-glext.h:6895
virtual ~WSColormap()
Definition: WSColormap.h:69
WSColormapPin(const covise::covise__ColormapPin &pin)
Definition: WSColormap.h:42