source: trunk/gui/vizservers/nanovis/nanovis.h @ 445

Last change on this file since 445 was 445, checked in by mmc, 18 years ago

Created new "transfunc" command for defining transfer functions.
Fixed gradient calculation. Centered volume on origin.

File size: 2.9 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#include <GL/glew.h>
17#include <GL/glut.h>
18#include <Cg/cgGL.h>
19#include <stdlib.h>
20#include <math.h>
21#include <time.h>
22#include <iostream>
23#include <stdio.h>
24#include <assert.h>
25#include <float.h>
26
27#include "define.h"
28#include "global.h"
29#include "socket/Socket.h"
30#include "Camera.h"
31#include "ConvexPolygon.h"
32#include "Texture3D.h"
33#include "Texture2D.h"
34#include "Texture1D.h"
35#include "TransferFunction.h"
36#include "Mat4x4.h"
37#include "Volume.h"
38#include "ParticleSystem.h"
39#include "PerfQuery.h"
40#include "Event.h"
41#include "Lic.h"
42#include "VolumeRenderer.h"
43#include "PlaneRenderer.h"
44
45#include "config.h"
46
47#include <tcl.h>
48#ifndef CONST84
49# define CONST84
50#endif
51
52
53//defines for the image based flow visualization
54#define NPN 256         //resolution of background pattern
55#define NMESH 256       //resolution of flow mesh
56#define DM  ((float) (1.0/(NMESH-1.0))) //distance in world coords between mesh lines
57#define NPIX  512       //display size
58#define SCALE 3.0       //scale for background pattern. small value -> fine texture
59#define MAX_N_VOLUMES 10 //maximum of volumes the application can handle
60
61
62typedef struct Vector2{
63  float x,y;
64  float mag(){
65    return sqrt(x*x+y*y);
66  }
67};
68
69
70typedef struct RegGrid2{
71  int width, height;
72  Vector2* field;
73
74  RegGrid2(int w, int h){
75    width = w;
76    height = h;
77    field = new Vector2[w*h];
78  }
79
80  void put(Vector2& v, int x ,int y){
81    field[x+y*width] = v;
82  }
83
84  Vector2& get(int x, int y){
85    return field[x+y*width];
86  }
87};
88
89
90//variables for mouse events
91float live_rot_x = 0.;          //object rotation angles
92float live_rot_y = 0.;
93float live_rot_z = 0.;
94
95float live_obj_x = -0.0;        //object translation location from the origin
96float live_obj_y = -0.0;
97float live_obj_z = -2.5;
98
99float live_diffuse = 1.;
100float live_specular = 3.;
101
102int left_last_x, left_last_y, right_last_x, right_last_y;       //last locations mouse events
103bool left_down = false;                                         
104bool right_down = false;
105
106float lic_slice_x=0, lic_slice_y=0, lic_slice_z=0.3;//image based flow visualization slice location
107
108int win_width = NPIX;                   //size of the render window
109int win_height = NPIX;                  //size of the render window
110
111
112//image based flow visualization variables
113int    iframe = 0;
114int    Npat   = 64;
115int    alpha  = (int)round(0.12*255);
116float  sa;
117float  tmax   = NPIX/(SCALE*NPN);
118float  dmax   = SCALE/NPIX;
119
120
121//currently active shader, default renders one volume only
122int cur_shader = 0;
Note: See TracBrowser for help on using the repository browser.