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