source: trunk/gui/vizservers/nanovis/Lic.h @ 397

Last change on this file since 397 was 397, checked in by qiaow, 19 years ago

Lic class working!!
OpenGL scaling calls now are inside of Lic and ParticleSystem? classes.

File size: 2.3 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 * Lic.h: line integral convolution class
4 *
5 * ======================================================================
6 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
7 *           Purdue Rendering and Perceptualization Lab (PURPL)
8 *
9 *  Copyright (c) 2004-2006  Purdue Research Foundation
10 *
11 *  See the file "license.terms" for information on usage and
12 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 * ======================================================================
14 */
15
16
17#ifndef _LIC_H_
18#define _LIC_H_
19
20#include "GL/glew.h"
21#include "Cg/cgGL.h"
22
23#include "define.h"
24#include "config.h"
25#include "global.h"
26
27#include "Vector3.h"
28#include "Volume.h"
29
30
31#define NPN 256   //resolution of background pattern
32#define NMESH 256 //resolution of flow mesh
33#define DM ((float) (1.0/(NMESH-1.0))) //distance in world coords between mesh lines
34#define NPIX  512 //display size 
35#define SCALE 3.0 //scale for background pattern. small value -> fine texture
36
37class Lic{
38
39private:
40  int display_width, display_height;
41  int size;             //the lic is a square of size, it can be stretched
42  float* slice_vector; //storage for the per slice vectors driving the follow
43  Vector3 scale;        //scaling factor stretching the lic plane to fit the actual dimensions
44  float offset;         //[0,1] offset could be x, y, or z direction
45
46  //some convolve variables. They can pretty much stay fixed
47  int iframe;
48  int Npat;
49  int alpha;
50  float sa;
51  float tmax;
52  float dmax;
53
54  //CG shader parameters
55  CGcontext m_g_context;
56  CGparameter m_vel_tex_param;
57  CGparameter m_vel_tex_param_render_vel, m_plane_normal_param_render_vel;
58  CGprogram m_render_vel_fprog;
59
60  NVISid color_tex, pattern_tex, mag_tex;
61  NVISid fbo, vel_fbo, slice_vector_tex;  //for projecting 3d vector to 2d vector on a plane
62
63  Volume* vector_field;
64
65public:
66  Vector3 normal;
67  Lic(int _size, int _width, int _height, float _offset,
68                  CGcontext _context, NVISid _vector_field,
69                  float scalex, float scaley, float scalez);
70  ~Lic();
71
72  void convolve();
73  void display();       //display the convolution result
74  void make_patterns();
75  void make_magnitudes();
76  void get_velocity(float x, float y, float* px, float* py);
77  void get_slice();
78  void set_offset(float v);
79
80};
81
82#endif
Note: See TracBrowser for help on using the repository browser.