Last change
on this file since 259 was
259,
checked in by qiaow, 19 years ago
|
Volume Class: wrapper of Texture3D. Don't have to deal with "OpenGL intensive" Texture3D class.
ColorMap? Class: wrapper of Texture1D. Don't have to deal with "OpenGL intensive" Texture1D class.
define.h: NVIS system wide defines. Hides OpenGL defined types.
|
File size:
1.6 KB
|
Line | |
---|
1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * nanovis.h: package header |
---|
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 | #include <GL/glew.h> |
---|
18 | #include <GL/glut.h> |
---|
19 | #include <Cg/cgGL.h> |
---|
20 | #include <stdlib.h> |
---|
21 | #include <math.h> |
---|
22 | #include <time.h> |
---|
23 | #include <iostream> |
---|
24 | #include <stdio.h> |
---|
25 | #include <assert.h> |
---|
26 | #include <tcl.h> |
---|
27 | #include <float.h> |
---|
28 | |
---|
29 | #include "config.h" |
---|
30 | |
---|
31 | |
---|
32 | //defines for the image based flow visualization |
---|
33 | #define NPN 256 //resolution of background pattern |
---|
34 | #define NMESH 256 //resolution of flow mesh |
---|
35 | #define DM ((float) (1.0/(NMESH-1.0))) //distance in world coords between mesh lines |
---|
36 | #define NPIX 512 //display size |
---|
37 | #define SCALE 3.0 //scale for background pattern. small value -> fine texture |
---|
38 | #define MAX_N_VOLUMES 10 //maximum of volumes the application can handle |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | typedef struct Vector2{ |
---|
43 | float x,y; |
---|
44 | float mag(){ |
---|
45 | return sqrt(x*x+y*y); |
---|
46 | } |
---|
47 | }; |
---|
48 | |
---|
49 | |
---|
50 | typedef struct RegGrid2{ |
---|
51 | int width, height; |
---|
52 | Vector2* field; |
---|
53 | |
---|
54 | RegGrid2(int w, int h){ |
---|
55 | width = w; |
---|
56 | height = h; |
---|
57 | field = new Vector2[w*h]; |
---|
58 | } |
---|
59 | |
---|
60 | void put(Vector2& v, int x ,int y){ |
---|
61 | field[x+y*width] = v; |
---|
62 | } |
---|
63 | |
---|
64 | Vector2& get(int x, int y){ |
---|
65 | return field[x+y*width]; |
---|
66 | } |
---|
67 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.