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