source: trunk/packages/vizservers/nanovis/VolumeInterpolator.h @ 2921

Last change on this file since 2921 was 2877, checked in by ldelgass, 12 years ago

Some minor refactoring, also add some more fine grained config.h defines
(e.g. replace NV40 define with feature defines). Add tests for some required
OpenGL extensions (should always check for extensions or base version before
calling entry points from the extension). Also, clamp diffuse and specular
values on input and warn when they are out of range.

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef VOLUME_INTERPOLATOR_H
3#define VOLUME_INTERPOLATOR_H
4
5#include <vector>
6
7#include "Volume.h"
8
9class VolumeInterpolator
10{
11public :
12    VolumeInterpolator();
13
14    void addVolume(Volume *vol);
15
16    void clearAll();
17   
18    void start();
19
20    Volume *update(float fraction);
21
22    void stop();
23
24    void computeKeys(float fraction, int count, float *interp, int *key1, int *key2);
25
26    bool isStarted() const;
27
28    double getInterval() const;
29
30    double getStartTime() const;
31
32    unsigned int getReferenceVolumeID() const;
33
34    Volume *getVolume();
35
36private:
37    Volume *_volume;
38
39    std::vector<Volume*> _volumes;
40
41    double _interval;
42    bool _started;
43    unsigned int _numBytes;
44    unsigned int _dataCount;
45    unsigned int _numComponents;
46    unsigned int _referenceOfVolume;
47    double _startTime;
48};
49
50inline bool VolumeInterpolator::isStarted() const
51{
52    return _started;
53}
54
55inline double VolumeInterpolator::getStartTime() const
56{
57    return _startTime;
58}
59
60inline double VolumeInterpolator::getInterval() const
61{
62    return _interval;
63}
64
65inline unsigned int VolumeInterpolator::getReferenceVolumeID() const
66{
67    return _referenceOfVolume;
68}
69
70#endif
71
Note: See TracBrowser for help on using the repository browser.