ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FastOpenGlDisplayer/soft/main.h
(Generate patch)

Comparing UserCode/FastOpenGlDisplayer/soft/main.h (file contents):
Revision 1.14 by roberfro, Mon Apr 28 11:47:49 2008 UTC vs.
Revision 1.68 by querten, Wed Nov 19 08:39:30 2008 UTC

# Line 1 | Line 1
1  
2 < // SimEvent.h: interface for the SimEvent class.
2 > // main.h
3   //
4   //////////////////////////////////////////////////////////////////////
5  
6   #ifndef _MAIN_H__
7   #define _MAIN_H__
8  
9 + #define FROG_VERSION 1.106
10 + #define FROG_AUTHORLIST "Loic.Quertenmont@cern.ch\nVincent.Roberfroid@cern.ch"
11  
12 + #include "Includes/GL/glew.h"
13   #ifdef linux
14 + #include "Includes/GL/glxew.h"
15   #include <GL/gl.h>
16   #include <GL/glu.h>
17 < #include "../interface/glut.h"
18 < #include <ext/hash_map>
19 < using namespace __gnu_cxx;
20 < typedef hash_map<unsigned int, char*, hash<unsigned int>, equal_to<unsigned int> > HASH_Map;
21 < #else
22 < #define _CRT_SECURE_NO_DEPRECATE 1
17 > #include "Includes/GLUT/glut.h"  
18 > #elif macos
19 > #include "Includes/GL/glxew.h"
20 > #include <OpenGL/gl.h>
21 > #include <OpenGL/glu.h>
22 > #include <GLUT/glut.h>
23 > #else
24   #include <windows.h>
25 + #include <atlconv.h>
26 + #include "Includes/GL/wglew.h"
27   #include <gl/gl.h>
28   #include <gl/glu.h>
29 < #include <gl/glut.h>
29 > #include <gl/glut.h>
30   #pragma comment (lib,"glaux.lib")
31   #pragma comment (lib,"glu32.lib")
32   #pragma comment (lib,"opengl32.lib")
33   #pragma comment (lib,"glut.lib")
34   #pragma comment (lib,"glut32.lib")
35 < #include <hash_map>
36 < using namespace stdext;
37 < typedef hash_map<unsigned int, char*, hash_compare<unsigned int, std::less<unsigned int> > > HASH_Map;
35 > #pragma comment (lib,"Includes/CURL/Lib/libcurl.lib")
36 > #pragma comment (lib,"Includes/ZLIB/Lib/zdll.lib")
37 >
38   #endif
39  
40 < HASH_Map test;
40 > bool SCREENSAVER = false;
41 > bool SHOOTER     = false;
42  
43   #include <time.h>
44   time_t start;
# Line 39 | Line 47 | time_t end;
47   #include <stdio.h>
48   #include <math.h>
49  
50 < #include "../interface/SimEvent.h"
51 < #include "../interface/Geometry.h"
52 <
53 < #include "DrawPrimitive.h"
54 < #include "ScreenShot.h"
55 < #include "Logo.h"
56 < #include "Texture.h"
57 < #include "ReadCards.h"
58 < #include "FROG_Struct.h"
59 < #include "ObjectInfo.h"
50 > #include "Includes/FROG/FROG_Objects.h"
51 > #include "Includes/FROG/FROG_Events.h"
52 > #include "Includes/FROG/FROG_Geometry.h"
53 >
54 > #include "Includes/FROG/FROG_Fonts.h"
55 > #include "Includes/FROG/FROG_Element_Tools.h"
56 >
57 > #include "Includes/FROG/FROG_Texture.h"
58 > #include "Includes/FROG/FROG_ReadCards.h"
59 > #include "Includes/FROG/FROG_Net_Tools.h"
60 > #include "Includes/FROG/FROG_View_Tools.h"
61 >
62 > FROG_Fonts* Fonts;
63 > FROG_ReadCards* Card;
64 > FROG_Objects_Extended* frogObjects_;
65 >
66 > std::vector<FROG_View*> ActiveViews;
67 > FROG_View_Screen* ViewScreen;
68 > FROG_View* ViewMain;
69 > FROG_View_Menu* ViewMenu;
70  
71   int SAVE_WINDOW_W = 800;
72   int SAVE_WINDOW_H = 600;
73   int SAVE_WINDOW_X = 10;
74   int SAVE_WINDOW_Y = 10;
75  
58 bool FULLSCREEN = false;
59 int WINDOW_WIDTH = 800;
60 int WINDOW_HEIGHT = 600;
61 int SCREENSHOT = 0;
76  
77 < int TEMP_I = 0;
77 > bool  FULLSCREEN        = false;
78 > int   WINDOW_WIDTH      = 800;
79 > int   WINDOW_HEIGHT     = 600;
80 > int   SCREENSHOT        = 0;
81 > char  SCREENSHOT_FORMAT[255] = {"png"};
82  
65 float CAM_R  = 700;
66 float CAM_tx = 0.0;
67 float CAM_ty = 0.0;
68
69 int CMS_TRACKER_RADIUS = 129;
70 int CMS_TRACKER_LENGTH = 300;
71
72 int TRACKING_RADIUS = 129;//295;
73 int TRACKING_LENGTH = 300;//645;
74
75 float PT_CUTOFF = 1.0;
76 double EECAL_CUTOFF[3] = {0.2,0.6,0.0001};
77 double EHCAL_CUTOFF[4] = {1.5,1.5,0.5,5.0};
83  
79 bool MouseStates[3];
84  
85 < std::vector<GLuint> theSimTracks;
86 < GLuint theGeomMuon[3];
83 < GLuint theGeomMuonInEvent;
84 < GLuint theGeomTracker[6];
85 < GLuint theGeomTrackerInEvent;
86 < GLuint theGeomEcal[3];
87 < GLuint theGeomEcalInEvent;
88 < GLuint theGeomHcal[4];
89 < GLuint theGeomHcalInEvent;
85 > int TEMP_I = 0;
86 > bool MouseStates[3];
87  
88   GLuint LogoTexture;
89 + GLuint LogoTxtTexture;
90  
91 < double t = 0;
92 <
91 > char ScreenShotName[1024] = {"screenshot"};
92 > std::string AbsolutePath;
93 > std::string inputConfig = "config.txt";
94   std::string inputVisFile;
95 < std::string inputTrackerGeom;
96 < std::string inputEcalGeom;
97 < std::string inputHcalGeom;
98 < std::string inputMuonGeom;
99 <
100 < MySimEvent*  event;
101 < MySimEvents* events;
102 <
103 < Geometry* geom;
104 <
105 < char gTracker   = 0;
106 < char gEcal      = 0;
107 < char gHcal      = 0;
108 < char gMuon      = 0;
95 > std::string inputVisFileFromCard;
96 > std::vector<std::string> inputGeom;
97 >
98 > // MultiThreading Variables
99 > #ifdef linux
100 >   pthread_t Thread_H;
101 > #elif macos
102 >   pthread_t Thread_H;
103 > #else
104 >   HANDLE Thread_H   = NULL;
105 >   DWORD  Thread_Id  = 0;
106 > #endif
107 > bool   Thread_Run = false;
108 >
109 > float SelectedObject_color[4] = {1,1,1,1};
110 > int   SelectedObject_Counter  = 0;
111 > //bool  SelectedObject_DrawFlag = true;
112 >
113 > bool Geometry_WireFrame = false;
114 >
115 > int updateVisFileTime = -1;
116 >
117 > FROG_Events* events;
118 > FROG_Element_Event* event;
119 >
120 > FROG_Geometry* geom;
121 >
122   char gSim       = 0;
123   char gReco      = 15;
124  
125 < int  mObj_I     = -1;
126 < int  mColl_I    = -1;
125 > //unsigned int mCLicked_DetId = (unsigned int) -1;
126 > bool mDisplayMother  = false;
127   bool mLoading   = true;
128   int  mLoading_I = 0;
129 + bool mEventChanging = true;
130 +
131 + unsigned int mAutomaticShooter_LastEvent = 0;
132 + bool mAutomaticShooter = false;
133 +
134  
135   int eventNumber = 0;
136 + int eventTime   = 5;
137  
138   bool  mHelpScreen= false;
121 bool  mRotate    = true;
122 float mDt                = 0.005f;
139  
140 + bool stateChanged = false;
141  
142 < GLint Menu_Geom_Tracker = 0;
126 < GLint Menu_Geom_Ecal    = 0;
127 < GLint Menu_Geom_Hcal    = 0;
128 < GLint Menu_Geom_Muon    = 0;
129 < GLint Menu_Geom         = 0;
130 < GLint Menu_SimEvent     = 0;
131 < GLint Menu_RecoEvent    = 0;
132 < GLint Menu_Main         = 0;
133 <
134 < WidthAndColor WaC_BackGround        = {1.0 , 0.0 , 1.0 , 0.0 , 1.0};
135 < WidthAndColor WaC_Txt               = {1.0 , 0.0 , 1.0 , 1.0 , 1.0};
136 < WidthAndColor WaC_CMS_Framework     = {1.0 , 1.0 , 0.5 , 1.0 , 0.3};
137 < WidthAndColor WaC_LHC_Axis          = {3.0 , 1.0 , 0.5 , 1.0 , 0.3};
138 < WidthAndColor WaC_Default_SimTrack  = {2.0 , 0.0 , 1.0 , 1.0 , 1.0};
139 < WidthAndColor WaC_Selected_SimTrack = {2.0 , 1.0 , 1.0 , 0.0 , 1.0};
142 > bool print_FrameWork = false;
143  
144 < std::vector<IdAndWidthAndColor*> WaC_SimTracks;
144 > float BackGround_Color[4] = {0.0 , 0.0 , 0.0 , 1.0};
145 > float Txt_Color[4]        = {0.0 , 1.0 , 1.0 , 1.0};
146 > float Framework_Color[4]  = {1.0 , 0.5 , 1.0 , 0.3};
147 > float Framework_Thickness =  1.0;
148 > float ZAxis_Color[4]      = {1.0 , 0.5 , 1.0 , 0.3};
149 > float ZAxis_Thickness     =  3;
150  
143 void DrawTrack(MySimTrack* track, MySimVertex* vertex1, MySimVertex* vertex2);
151   void reshape (int w, int h);
152   void display();
153 < void initGeomMuon();
154 < void initGeomMuonInEvent();
155 < void initGeomTracker();
156 < void initGeomTrackerInEvent();
150 < void initGeomEcal();
151 < void initGeomEcalInEvent();
152 < void initGeomHcal();
153 < void initGeomHcalInEvent();
154 < void defineColorForSimTrack(int i);
155 <
156 < void initSimTrack();
157 < void init();
158 < void menu_callback(int value);
159 < void menu_create();
153 > void display2();
154 > void displayForScreenShot();
155 > void displaytext();
156 >
157   void LoadCard(const char* inputCard );
158   void gl_select(int x, int y);
159   void list_hits(GLint hits, GLuint *names);
160  
161 + void AutomaticEventChanging (int Extra);
162 +
163 +
164 + void updateEventsFile();
165 +
166 +
167 + namespace PATH{
168 +        bool GlobalPath(const char* LocalPath, const char* AbsolutePath, char* ResultPath){
169 +                FILE* FileExist = fopen(LocalPath,"r");
170 +                if(FileExist){
171 +                        fclose(FileExist);
172 +                        sprintf(ResultPath,"%s",LocalPath);
173 +                }else{  
174 +                        sprintf(ResultPath,"%s%s",AbsolutePath,LocalPath);
175 +                        FILE* FileExist = fopen(ResultPath,"r");
176 +                        if(FileExist){                  
177 +                                fclose(FileExist);
178 +                        }else{
179 +                                return false;
180 +                        }
181 +                }
182 +                printf("GLOBALPATH = %s\n",ResultPath);
183 +                return true;            
184 +        }
185 + }
186 +
187  
188   #endif
189  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines