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

Last change on this file since 3463 was 3463, checked in by ldelgass, 7 years ago

Begin process of renaming R2 library

  • Property svn:eol-style set to native
File size: 1.8 KB
RevLine 
[2798]1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
[379]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 *
[3177]10 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
[379]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 */
[2820]16#ifndef TRANSFER_FUNCTION_H
17#define TRANSFER_FUNCTION_H
[379]18
[2820]19#include <R2/R2Object.h>
[379]20
21#include "Texture1D.h"
[2820]22#include "Vector3.h"
[379]23
[3463]24class TransferFunction
[2820]25{
[973]26public:
27    TransferFunction(int size, float *data);
[2831]28
[973]29    void update(float *data);
[2831]30
[973]31    void update(int size, float *data);
[2831]32
33    GLuint id()
34    {
35        return _id;
[1493]36    }
[2831]37
38    void id(GLuint id)
39    {
40        _id = id;
[1493]41    }
[2831]42
43    Texture1D *getTexture()
44    {
45        return _tex;
[973]46    }
[2831]47
48    float *getData()
49    { 
50        return _data; 
[973]51    }
[2831]52
53    int getSize() const
54    {
55        return _size;
[1493]56    }
[2831]57
58    const char *name() const
59    {
60        return _name;
[1493]61    }
[2831]62
63    void name(const char *name)
64    {
65        _name = name;
[1493]66    }
[2820]67
68    static void sample(float fraction, float *key, int count, Vector3 *keyValue, Vector3 *ret);
[2831]69
[2820]70    static void sample(float fraction, float *key, int count, float *keyValue, float *ret);
[2831]71
72protected :
73    ~TransferFunction();
74
75private:
[2844]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
[2831]80    const char *_name;
[2844]81    GLuint _id;         ///< OpenGL texture identifier
[379]82};
83
84#endif
Note: See TracBrowser for help on using the repository browser.