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

Last change on this file since 3464 was 3464, checked in by ldelgass, 11 years ago

Set tracing back to off by default in nanovis

  • 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 "Texture1D.h"
20#include "Vector3.h"
21
22class TransferFunction
23{
24public:
25    TransferFunction(int size, float *data);
26
27    void update(float *data);
28
29    void update(int size, float *data);
30
31    GLuint id()
32    {
33        return _id;
34    }
35
36    void id(GLuint id)
37    {
38        _id = id;
39    }
40
41    Texture1D *getTexture()
42    {
43        return _tex;
44    }
45
46    float *getData()
47    {
48        return _data;
49    }
50
51    int getSize() const
52    {
53        return _size;
54    }
55
56    const char *name() const
57    {
58        return _name;
59    }
60
61    void name(const char *name)
62    {
63        _name = name;
64    }
65
66    static void sample(float fraction, float *key, int count, Vector3 *keyValue, Vector3 *ret);
67
68    static void sample(float fraction, float *key, int count, float *keyValue, float *ret);
69
70protected :
71    ~TransferFunction();
72
73private:
74    /// the resolution of the color map, how many (RGBA) quadraples
75    int _size;
76    float *_data;
77    Texture1D *_tex;    ///< the texture storing the colors
78    const char *_name;
79    GLuint _id;         ///< OpenGL texture identifier
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.