ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FastOpenGlDisplayer/soft/main.h
Revision: 1.15
Committed: Wed Apr 30 09:48:03 2008 UTC (17 years ago) by roberfro
Content type: text/plain
Branch: MAIN
Changes since 1.14: +5 -1 lines
Log Message:
Bug rotation corrected

File Contents

# User Rev Content
1 querten 1.1
2     // SimEvent.h: interface for the SimEvent class.
3     //
4     //////////////////////////////////////////////////////////////////////
5    
6     #ifndef _MAIN_H__
7     #define _MAIN_H__
8    
9    
10     #ifdef linux
11     #include <GL/gl.h>
12     #include <GL/glu.h>
13     #include "../interface/glut.h"
14 querten 1.12 #include <ext/hash_map>
15     using namespace __gnu_cxx;
16     typedef hash_map<unsigned int, char*, hash<unsigned int>, equal_to<unsigned int> > HASH_Map;
17 querten 1.1 #else
18     #define _CRT_SECURE_NO_DEPRECATE 1
19     #include <windows.h>
20     #include <gl/gl.h>
21     #include <gl/glu.h>
22     #include <gl/glut.h>
23     #pragma comment (lib,"glaux.lib")
24     #pragma comment (lib,"glu32.lib")
25     #pragma comment (lib,"opengl32.lib")
26     #pragma comment (lib,"glut.lib")
27     #pragma comment (lib,"glut32.lib")
28 querten 1.12 #include <hash_map>
29     using namespace stdext;
30 roberfro 1.14 typedef hash_map<unsigned int, char*, hash_compare<unsigned int, std::less<unsigned int> > > HASH_Map;
31 querten 1.1 #endif
32    
33 querten 1.12 HASH_Map test;
34    
35     #include <time.h>
36     time_t start;
37     time_t end;
38    
39 querten 1.1 #include <stdio.h>
40     #include <math.h>
41    
42     #include "../interface/SimEvent.h"
43     #include "../interface/Geometry.h"
44    
45     #include "DrawPrimitive.h"
46     #include "ScreenShot.h"
47     #include "Logo.h"
48     #include "Texture.h"
49     #include "ReadCards.h"
50     #include "FROG_Struct.h"
51 querten 1.12 #include "ObjectInfo.h"
52 querten 1.1
53     int SAVE_WINDOW_W = 800;
54     int SAVE_WINDOW_H = 600;
55     int SAVE_WINDOW_X = 10;
56     int SAVE_WINDOW_Y = 10;
57    
58     bool FULLSCREEN = false;
59     int WINDOW_WIDTH = 800;
60     int WINDOW_HEIGHT = 600;
61     int SCREENSHOT = 0;
62    
63 querten 1.7 int TEMP_I = 0;
64    
65 querten 1.1 float CAM_R = 700;
66     float CAM_tx = 0.0;
67     float CAM_ty = 0.0;
68 roberfro 1.15 int TRANS_tx = 0.0;
69     int TRANS_ty = 0.0;
70 querten 1.1
71     int CMS_TRACKER_RADIUS = 129;
72 querten 1.6 int CMS_TRACKER_LENGTH = 300;
73 querten 1.1
74     int TRACKING_RADIUS = 129;//295;
75 querten 1.6 int TRACKING_LENGTH = 300;//645;
76 querten 1.1
77     float PT_CUTOFF = 1.0;
78 querten 1.7 double EECAL_CUTOFF[3] = {0.2,0.6,0.0001};
79     double EHCAL_CUTOFF[4] = {1.5,1.5,0.5,5.0};
80 querten 1.1
81     bool MouseStates[3];
82    
83     std::vector<GLuint> theSimTracks;
84 querten 1.5 GLuint theGeomMuon[3];
85 querten 1.6 GLuint theGeomMuonInEvent;
86 querten 1.1 GLuint theGeomTracker[6];
87     GLuint theGeomTrackerInEvent;
88     GLuint theGeomEcal[3];
89     GLuint theGeomEcalInEvent;
90     GLuint theGeomHcal[4];
91     GLuint theGeomHcalInEvent;
92    
93     GLuint LogoTexture;
94    
95     double t = 0;
96    
97 querten 1.4 std::string inputVisFile;
98     std::string inputTrackerGeom;
99     std::string inputEcalGeom;
100     std::string inputHcalGeom;
101 querten 1.5 std::string inputMuonGeom;
102 querten 1.1
103     MySimEvent* event;
104     MySimEvents* events;
105    
106     Geometry* geom;
107    
108     char gTracker = 0;
109     char gEcal = 0;
110     char gHcal = 0;
111 querten 1.5 char gMuon = 0;
112 querten 1.13 char gSim = 0;
113 querten 1.7 char gReco = 15;
114 querten 1.1
115 querten 1.12 int mObj_I = -1;
116     int mColl_I = -1;
117 querten 1.1 bool mLoading = true;
118     int mLoading_I = 0;
119    
120     int eventNumber = 0;
121    
122     bool mHelpScreen= false;
123     bool mRotate = true;
124 roberfro 1.15
125     bool mTranslation = false;
126     bool stateChanged = false;
127 querten 1.1 float mDt = 0.005f;
128    
129    
130     GLint Menu_Geom_Tracker = 0;
131     GLint Menu_Geom_Ecal = 0;
132     GLint Menu_Geom_Hcal = 0;
133 querten 1.5 GLint Menu_Geom_Muon = 0;
134 querten 1.1 GLint Menu_Geom = 0;
135     GLint Menu_SimEvent = 0;
136     GLint Menu_RecoEvent = 0;
137     GLint Menu_Main = 0;
138    
139     WidthAndColor WaC_BackGround = {1.0 , 0.0 , 1.0 , 0.0 , 1.0};
140     WidthAndColor WaC_Txt = {1.0 , 0.0 , 1.0 , 1.0 , 1.0};
141     WidthAndColor WaC_CMS_Framework = {1.0 , 1.0 , 0.5 , 1.0 , 0.3};
142     WidthAndColor WaC_LHC_Axis = {3.0 , 1.0 , 0.5 , 1.0 , 0.3};
143     WidthAndColor WaC_Default_SimTrack = {2.0 , 0.0 , 1.0 , 1.0 , 1.0};
144     WidthAndColor WaC_Selected_SimTrack = {2.0 , 1.0 , 1.0 , 0.0 , 1.0};
145    
146 querten 1.8 std::vector<IdAndWidthAndColor*> WaC_SimTracks;
147    
148 querten 1.1 void DrawTrack(MySimTrack* track, MySimVertex* vertex1, MySimVertex* vertex2);
149     void reshape (int w, int h);
150     void display();
151 querten 1.5 void initGeomMuon();
152 querten 1.6 void initGeomMuonInEvent();
153 querten 1.1 void initGeomTracker();
154     void initGeomTrackerInEvent();
155     void initGeomEcal();
156     void initGeomEcalInEvent();
157     void initGeomHcal();
158     void initGeomHcalInEvent();
159 roberfro 1.14 void defineColorForSimTrack(int i);
160 querten 1.5
161 querten 1.1 void initSimTrack();
162     void init();
163     void menu_callback(int value);
164     void menu_create();
165     void LoadCard(const char* inputCard );
166 roberfro 1.9 void gl_select(int x, int y);
167     void list_hits(GLint hits, GLuint *names);
168 querten 1.1
169 querten 1.2 #endif
170