Ignore:
Timestamp:
Jun 3, 2009, 11:47:01 AM (15 years ago)
Author:
vrinside
Message:

working on 2d slice view for flow visualization (problem with loading png file -- arrow)
So I commented out the texture-mapped flow direction visualization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/VelocityArrowsSlice.h

    r1487 r1489  
    44#include <Cg/cgGL.h>
    55#include <vector>
     6
     7#define USE_NANOVIS_LIB
     8
     9#ifdef USE_NANOVIS_LIB
     10#include "Texture2D.h"
    611#include "Vector3.h"
     12#else
     13#include <vr3d/vrTexture2D.h>
     14
     15typedef vrTexture2D Texture2D;
     16
     17class Vector3 {
     18public :
     19        float x, y, z;
     20        Vector3() : x(0.0f), y(0.0f), z(0.0f) {}
     21        Vector3(float x1, float y1, float z1) : x(x1), y(y1), z(z1) {}
     22        Vector3 operator*(float scale)
     23        {
     24                Vector3 vec;
     25                vec.x = x * scale;
     26                vec.y = y * scale;
     27                vec.z = z * scale;
     28                return vec;
     29        }
     30    Vector3 scale(const Vector3& scale)
     31    {
     32        Vector3 vec;
     33        vec.x = x * scale.x;
     34        vec.y = y * scale.y;
     35        vec.z = z * scale.z;
     36            return vec;
     37    }
     38
     39        Vector3 operator*(const Vector3& scale)
     40        {
     41                Vector3 vec;
     42                vec.x = x * scale.x;
     43                vec.y = y * scale.y;
     44                vec.z = z * scale.z;
     45                return vec;
     46
     47        }
     48        friend Vector3 operator+(const Vector3& value1, const Vector3& value2);
     49
     50    void set(float x1, float y1, float z1)
     51    {
     52        x = x1; y = y1; z = z1;
     53    }
     54};
     55
     56inline Vector3 operator+(const Vector3& value1, const Vector3& value2)
     57{
     58        return Vector3(value1.x + value2.x, value1.y + value2.y, value1.z + value2.z);
     59}
     60
     61#endif
     62
    763
    864class VelocityArrowsSlice {
    9 
     65public :
     66        enum RenderMode {
     67                LINES,
     68                GLYPHES,
     69        };
     70private :
    1071        unsigned int _vectorFieldGraphicsID;
    1172        float _vfXscale;
     
    2081        CGcontext _context;
    2182        CGprogram _queryVelocityFP;
    22         CGparameter _ipVectorFieldParam;
     83        CGparameter _qvVectorFieldParam;
    2384
    2485        int _renderTargetWidth;
     
    3697
    3798        Vector3 _maxVelocityScale;
    38         Vector3 _arrowColor;
     99        Vector3 _arrowColor;
    39100
    40101        bool _enabled; 
     
    42103        bool _dirtySamplingPosition;
    43104        bool _dirtyRenderTarget;
     105
     106        unsigned int _vertexBufferGraphicsID;
     107
     108        CGprogram _particleVP;
     109        CGparameter _mvpParticleParam;
     110        CGparameter _mvParticleParam;
     111        CGparameter _mvTanHalfFOVParam;
     112        CGparameter _mvCurrentTimeParam;
    44113       
     114        CGprogram _particleFP;
     115        CGparameter _vectorParticleParam;
     116
     117        Texture2D* _arrowsTex;
     118
     119        RenderMode _renderMode;
    45120private :
    46121        void createRenderTarget();
     
    48123public :
    49124        VelocityArrowsSlice();
    50         ~VelocityArrowsSlice();
     125        ~VelocityArrowsSlice();
    51126
    52127        void vectorField(unsigned int vfGraphicsID, float xScale, float yScale, float zScale);
     
    60135        bool enabled() const;
    61136        void tickCountForMinSizeAxis(int tickCount);
    62         int tickCountForMinSizeAxis() const;
    63         void arrowColor(const Vector3& color);
     137    int tickCountForMinSizeAxis() const;
     138    void arrowColor(const Vector3& color);
     139        void renderMode(RenderMode mode);
     140        RenderMode renderMode() const;
    64141};
    65142
     
    90167}
    91168
     169inline void VelocityArrowsSlice::renderMode(VelocityArrowsSlice::RenderMode mode)
     170{
     171        _renderMode = mode;
     172        _dirty = true;
     173}
     174
     175inline VelocityArrowsSlice::RenderMode VelocityArrowsSlice::renderMode() const
     176{
     177        return _renderMode;
     178}
Note: See TracChangeset for help on using the changeset viewer.