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

Last change on this file since 457 was 457, checked in by mmc, 15 years ago

Fixed the server so you can have more than 10 volumes max.

File size: 2.8 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
60
61typedef struct Vector2{
62  float x,y;
63  float mag(){
64    return sqrt(x*x+y*y);
65  }
66};
67
68
69typedef struct RegGrid2{
70  int width, height;
71  Vector2* field;
72
73  RegGrid2(int w, int h){
74    width = w;
75    height = h;
76    field = new Vector2[w*h];
77  }
78
79  void put(Vector2& v, int x ,int y){
80    field[x+y*width] = v;
81  }
82
83  Vector2& get(int x, int y){
84    return field[x+y*width];
85  }
86};
87
88
89//variables for mouse events
90float live_rot_x = 90.;         //object rotation angles
91float live_rot_y = 180.;
92float live_rot_z = -135;
93
94float live_obj_x = -0.0;        //object translation location from the origin
95float live_obj_y = -0.0;
96float live_obj_z = -2.5;
97
98float live_diffuse = 1.;
99float live_specular = 3.;
100
101int left_last_x, left_last_y, right_last_x, right_last_y;       //last locations mouse events
102bool left_down = false;                                         
103bool right_down = false;
104
105float lic_slice_x=0, lic_slice_y=0, lic_slice_z=0.3;//image based flow visualization slice location
106
107int win_width = NPIX;                   //size of the render window
108int win_height = NPIX;                  //size of the render window
109
110
111//image based flow visualization variables
112int    iframe = 0;
113int    Npat   = 64;
114int    alpha  = (int)round(0.12*255);
115float  sa;
116float  tmax   = NPIX/(SCALE*NPN);
117float  dmax   = SCALE/NPIX;
118
119
120//currently active shader, default renders one volume only
121int cur_shader = 0;
Note: See TracBrowser for help on using the repository browser.