source: nanovis/tags/1.1.2/VelocityArrowsSlice.h @ 4937

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

Add basic VTK structured points reader to nanovis, update copyright dates.

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
6#ifndef VELOCITY_ARROW_SLICE_H
7#define VELOCITY_ARROW_SLICE_H
8
9#include <vector>
10
11#include <vrmath/Vector3f.h>
12
13#include "Texture2D.h"
14#include "NvShader.h"
15
16class VelocityArrowsSlice
17{
18public:
19    enum RenderMode {
20        LINES,
21        GLYPHS,
22    };
23
24    VelocityArrowsSlice();
25
26    ~VelocityArrowsSlice();
27
28    void setVectorField(unsigned int vfGraphicsID, const vrmath::Vector3f& origin,
29                        float xScale, float yScale, float zScale, float max);
30
31    void axis(int axis);
32
33    int axis() const
34    {
35        return _axis;
36    }
37
38    void slicePos(float pos)
39    {
40        _slicePos = pos;
41        _dirty = true;
42    }
43
44    float slicePos() const
45    {
46        return _slicePos;
47    }
48
49    void queryVelocity();
50
51    void render();
52
53    void enabled(bool enabled)
54    {
55        _enabled = enabled;
56    }
57
58    bool enabled() const
59    {
60        return _enabled;
61    }
62
63    void tickCountForMinSizeAxis(int tickCount)
64    {
65        _tickCountForMinSizeAxis = tickCount;
66    }
67
68    int tickCountForMinSizeAxis() const
69    {
70        return _tickCountForMinSizeAxis;
71    }
72
73    void arrowColor(const vrmath::Vector3f& color)
74    {
75        _arrowColor = color;
76    }
77
78    void renderMode(RenderMode mode)
79    {
80        _renderMode = mode;
81        _dirty = true;
82    }
83
84    RenderMode renderMode() const
85    {
86        return _renderMode;
87    }
88
89private:
90    void createRenderTarget();
91
92    void computeSamplingTicks();
93
94    unsigned int _vectorFieldGraphicsID;
95    float _vfXscale;
96    float _vfYscale;
97    float _vfZscale;
98    float _slicePos;
99    int _axis;
100
101    unsigned int _fbo;
102    unsigned int _tex;
103    float _maxPointSize;
104
105    NvShader _queryVelocityFP;
106
107    NvShader _particleShader;
108
109    int _renderTargetWidth;
110    int _renderTargetHeight;
111    vrmath::Vector3f *_velocities;
112    std::vector<vrmath::Vector3f> _samplingPositions;
113    vrmath::Vector3f _projectionVector;
114
115    int _tickCountForMinSizeAxis;
116    int _tickCountX;
117    int _tickCountY;
118    int _tickCountZ;
119
120    int _pointCount;
121
122    vrmath::Vector3f _maxVelocityScale;
123    vrmath::Vector3f _arrowColor;
124
125    bool _enabled;
126    bool _dirty;
127    bool _dirtySamplingPosition;
128    bool _dirtyRenderTarget;
129
130    unsigned int _vertexBufferGraphicsID;
131
132    Texture2D *_arrowsTex;
133
134    RenderMode _renderMode;
135};
136
137#endif
Note: See TracBrowser for help on using the repository browser.