1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (c) 2004-2013 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | */ |
---|
6 | #ifndef NVFLOWVISRENDERER_H |
---|
7 | #define NVFLOWVISRENDERER_H |
---|
8 | |
---|
9 | #include <map> |
---|
10 | #include <string> |
---|
11 | |
---|
12 | #include <vrmath/Vector3f.h> |
---|
13 | #include <vrmath/Vector4f.h> |
---|
14 | |
---|
15 | #include "NvVectorField.h" |
---|
16 | |
---|
17 | class NvParticleRenderer; |
---|
18 | |
---|
19 | class NvFlowVisRenderer |
---|
20 | { |
---|
21 | public: |
---|
22 | NvFlowVisRenderer(int w, int h); |
---|
23 | |
---|
24 | ~NvFlowVisRenderer(); |
---|
25 | |
---|
26 | void initialize(); |
---|
27 | |
---|
28 | void initialize(const std::string& vfName); |
---|
29 | |
---|
30 | void advect(); |
---|
31 | |
---|
32 | void reset(); |
---|
33 | |
---|
34 | void render(); |
---|
35 | |
---|
36 | void addVectorField(Volume *volPtr, const vrmath::Vector3f& ori, float scaleX, |
---|
37 | float scaleY, float scaleZ, float max); |
---|
38 | |
---|
39 | void addVectorField(const std::string& vfName, Volume *volPtr, const vrmath::Vector3f& ori, |
---|
40 | float scaleX, float scaleY, float scaleZ, float max); |
---|
41 | |
---|
42 | void removeVectorField(const std::string& vfName); |
---|
43 | |
---|
44 | void addPlane(const std::string& vfName, const std::string& name); |
---|
45 | |
---|
46 | void removePlane(const std::string& vfName, const std::string& name); |
---|
47 | |
---|
48 | /** |
---|
49 | * @brief Specify the axis of the index plane |
---|
50 | */ |
---|
51 | void setPlaneAxis(const std::string& vfName, const std::string& name, int axis); |
---|
52 | |
---|
53 | /** |
---|
54 | * @param pos Specify the position of slice |
---|
55 | */ |
---|
56 | void setPlanePos(const std::string& vfName, const std::string& name, float pos); |
---|
57 | |
---|
58 | void setParticleColor(const std::string& vfName, const std::string& name, const vrmath::Vector4f& color); |
---|
59 | |
---|
60 | void activatePlane(const std::string& vfName, const std::string& name); |
---|
61 | |
---|
62 | void deactivatePlane(const std::string& vfName, const std::string& name); |
---|
63 | |
---|
64 | void activateVectorField(const std::string& vfName); |
---|
65 | |
---|
66 | void deactivateVectorField(const std::string& vfName); |
---|
67 | |
---|
68 | //////////////////// |
---|
69 | // DEVICE SHAPE |
---|
70 | void addDeviceShape(const std::string& vfName, const std::string& name, const NvDeviceShape& shape); |
---|
71 | |
---|
72 | void removeDeviceShape(const std::string& vfName, const std::string& name); |
---|
73 | |
---|
74 | void activateDeviceShape(const std::string& vfName); |
---|
75 | |
---|
76 | void deactivateDeviceShape(const std::string& vfName); |
---|
77 | |
---|
78 | void activateDeviceShape(const std::string& vfName, const std::string& name); |
---|
79 | |
---|
80 | void deactivateDeviceShape(const std::string& vfName, const std::string& name); |
---|
81 | |
---|
82 | bool active() |
---|
83 | { |
---|
84 | return _activated; |
---|
85 | } |
---|
86 | |
---|
87 | void active(bool state) |
---|
88 | { |
---|
89 | _activated = state; |
---|
90 | } |
---|
91 | |
---|
92 | private: |
---|
93 | int _psys_width; |
---|
94 | int _psys_height; |
---|
95 | |
---|
96 | std::map<std::string, NvVectorField *> _vectorFieldMap; |
---|
97 | |
---|
98 | bool _activated; |
---|
99 | }; |
---|
100 | |
---|
101 | #endif |
---|