COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coDoColormap.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 CO_DO_COLORMAP_H
9 #define CO_DO_COLORMAP_H
10 
11 #include "coDistributedObject.h"
12 
13 /****************************************************************
14  ** **
15  ** Integer Array Class Version: 1.1 **
16  ** **
17  ** **
18  ** Description : Classes for multi-dimensional Integer **
19  ** Arrays **
20  ** **
21  ** Classes : coDoColormap **
22  ** **
23  ** Copyright (C) 1997 by University of Stuttgart **
24  ** Computer Center (RUS) **
25  ** Allmandring 30a **
26  ** 70550 Stuttgart **
27  ** **
28  ** **
29  ** Author : A. Werner (RUS) **
30  ** **
31  ** History : 26.06.97 Implementation **
32  ** **
33 \****************************************************************/
34 
35 namespace covise
36 {
37 
39 {
40  friend class coDoInitializer;
41  static coDistributedObject *virtualCtor(coShmArray *arr);
42 
43 private:
44  coIntShm shm_numSteps; // number values in Map
45  coFloatShmArray shm_colors; // RGBAX values 5*float
46  coFloatShm shm_min; // minimum value
47  coFloatShm shm_max; // maximum value
48  coCharShmArray shm_name; // Colormap name
49 
50 protected:
51  int rebuildFromShm();
52  int getObjInfo(int, coDoInfo **) const;
53  coDoColormap(const coObjInfo &info, coShmArray *arr);
54  coDoColormap *cloneObject(const coObjInfo &newinfo) const;
55 
56 public:
57  coDoColormap(const coObjInfo &info)
58  : coDistributedObject(info, "COLMAP")
59  {
60  getObjectFromShm();
61  };
62 
63  coDoColormap(const coObjInfo &info,
64  int numSteps,
65  float min,
66  float max,
67  const float *map,
68  const char *name);
69 
70  float *getAddress() const
71  {
72  return (float *)shm_colors.getDataPtr();
73  }
74  float getMin() const
75  {
76  return shm_min;
77  }
78  float getMax() const
79  {
80  return shm_max;
81  }
82  int getNumSteps() const
83  {
84  return shm_numSteps;
85  }
86  const char *getMapName() const
87  {
88  return (const char *)shm_name.getDataPtr();
89  }
90 
91  virtual ~coDoColormap()
92  {
93  }
94 };
95 }
96 #endif
float getMin() const
Definition: coDoColormap.h:74
coDoColormap(const coObjInfo &info)
Definition: coDoColormap.h:57
GLuint const GLchar * name
Definition: khronos-glext.h:6722
int getNumSteps() const
Definition: coDoColormap.h:82
Definition: covise_shm.h:481
coFloatShm shm_min
Definition: coDoColormap.h:46
Definition: covise_statics.cpp:54
float * getAddress() const
Definition: coDoColormap.h:70
coCharShmArray shm_name
Definition: coDoColormap.h:48
coIntShm shm_numSteps
Definition: coDoColormap.h:44
Definition: covise_shm.h:615
Definition: coObjID.h:230
Definition: coDistributedObject.h:266
coFloatShmArray shm_colors
Definition: coDoColormap.h:45
#define DOEXPORT
Definition: coExport.h:307
const char * getMapName() const
Definition: coDoColormap.h:86
coFloatShm shm_max
Definition: coDoColormap.h:47
virtual ~coDoColormap()
Definition: coDoColormap.h:91
Definition: coDoColormap.h:38
Definition: coDistributedObject.h:295
float getMax() const
Definition: coDoColormap.h:78
int min(int a, int b)
Definition: cutil_math.h:60
int max(int a, int b)
Definition: cutil_math.h:55