source: trunk/packages/vizservers/nanovis/TransferFunction.h @ 3437

Last change on this file since 3437 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * ----------------------------------------------------------------------
4 * ColorMap.h: color map class contains an array of (RGBA) values
5 *
6 * ======================================================================
7 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
8 *           Purdue Rendering and Perceptualization Lab (PURPL)
9 *
10 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
11 *
12 *  See the file "license.terms" for information on usage and
13 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 * ======================================================================
15 */
16#ifndef TRANSFER_FUNCTION_H
17#define TRANSFER_FUNCTION_H
18
19#include <R2/R2Object.h>
20
21#include "Texture1D.h"
22#include "Vector3.h"
23
24class TransferFunction : public R2Object
25{
26public:
27    TransferFunction(int size, float *data);
28
29    void update(float *data);
30
31    void update(int size, float *data);
32
33    GLuint id()
34    {
35        return _id;
36    }
37
38    void id(GLuint id)
39    {
40        _id = id;
41    }
42
43    Texture1D *getTexture()
44    {
45        return _tex;
46    }
47
48    float *getData()
49    {
50        return _data;
51    }
52
53    int getSize() const
54    {
55        return _size;
56    }
57
58    const char *name() const
59    {
60        return _name;
61    }
62
63    void name(const char *name)
64    {
65        _name = name;
66    }
67
68    static void sample(float fraction, float *key, int count, Vector3 *keyValue, Vector3 *ret);
69
70    static void sample(float fraction, float *key, int count, float *keyValue, float *ret);
71
72protected :
73    ~TransferFunction();
74
75private:
76    /// the resolution of the color map, how many (RGBA) quadraples
77    int _size;
78    float *_data;
79    Texture1D *_tex;    ///< the texture storing the colors
80    const char *_name;
81    GLuint _id;         ///< OpenGL texture identifier
82};
83
84#endif
Note: See TracBrowser for help on using the repository browser.