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

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

Fix camera reset for nanovis. Includes refactoring of vector/matrix classes
in nanovis to consolidate into vrmath library. Also add preliminary canonical
view control to clients for testing.

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