source: trunk/packages/vizservers/nanovis/NvFlowVisRenderer.h @ 2892

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