1 |
querten |
1.1 |
|
2 |
querten |
1.40 |
// main.h
|
3 |
querten |
1.1 |
//
|
4 |
|
|
//////////////////////////////////////////////////////////////////////
|
5 |
|
|
|
6 |
|
|
#ifndef _MAIN_H__
|
7 |
|
|
#define _MAIN_H__
|
8 |
|
|
|
9 |
querten |
1.67 |
#define FROG_VERSION 1.106
|
10 |
querten |
1.45 |
#define FROG_AUTHORLIST "Loic.Quertenmont@cern.ch\nVincent.Roberfroid@cern.ch"
|
11 |
querten |
1.44 |
|
12 |
querten |
1.46 |
#include "Includes/GL/glew.h"
|
13 |
querten |
1.1 |
#ifdef linux
|
14 |
querten |
1.46 |
#include "Includes/GL/glxew.h"
|
15 |
querten |
1.1 |
#include <GL/gl.h>
|
16 |
|
|
#include <GL/glu.h>
|
17 |
querten |
1.46 |
#include "Includes/GLUT/glut.h"
|
18 |
querten |
1.65 |
#elif macos
|
19 |
|
|
#include "Includes/GL/glxew.h"
|
20 |
|
|
#include <OpenGL/gl.h>
|
21 |
|
|
#include <OpenGL/glu.h>
|
22 |
|
|
#include <GLUT/glut.h>
|
23 |
roberfro |
1.22 |
#else
|
24 |
querten |
1.46 |
#include <windows.h>
|
25 |
querten |
1.63 |
#include <atlconv.h>
|
26 |
querten |
1.46 |
#include "Includes/GL/wglew.h"
|
27 |
querten |
1.1 |
#include <gl/gl.h>
|
28 |
|
|
#include <gl/glu.h>
|
29 |
querten |
1.46 |
#include <gl/glut.h>
|
30 |
querten |
1.1 |
#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 |
querten |
1.34 |
#pragma comment (lib,"Includes/CURL/Lib/libcurl.lib")
|
36 |
querten |
1.61 |
#pragma comment (lib,"Includes/ZLIB/Lib/zdll.lib")
|
37 |
querten |
1.63 |
|
38 |
querten |
1.1 |
#endif
|
39 |
querten |
1.35 |
|
40 |
|
|
bool SCREENSAVER = false;
|
41 |
querten |
1.65 |
bool SHOOTER = false;
|
42 |
querten |
1.1 |
|
43 |
querten |
1.12 |
#include <time.h>
|
44 |
|
|
time_t start;
|
45 |
|
|
time_t end;
|
46 |
|
|
|
47 |
querten |
1.1 |
#include <stdio.h>
|
48 |
|
|
#include <math.h>
|
49 |
|
|
|
50 |
querten |
1.25 |
#include "Includes/FROG/FROG_Objects.h"
|
51 |
roberfro |
1.22 |
#include "Includes/FROG/FROG_Events.h"
|
52 |
|
|
#include "Includes/FROG/FROG_Geometry.h"
|
53 |
querten |
1.21 |
|
54 |
querten |
1.45 |
#include "Includes/FROG/FROG_Fonts.h"
|
55 |
querten |
1.21 |
#include "Includes/FROG/FROG_Element_Tools.h"
|
56 |
querten |
1.1 |
|
57 |
querten |
1.40 |
#include "Includes/FROG/FROG_Texture.h"
|
58 |
querten |
1.27 |
#include "Includes/FROG/FROG_ReadCards.h"
|
59 |
querten |
1.40 |
#include "Includes/FROG/FROG_Net_Tools.h"
|
60 |
querten |
1.41 |
#include "Includes/FROG/FROG_View_Tools.h"
|
61 |
|
|
|
62 |
querten |
1.45 |
FROG_Fonts* Fonts;
|
63 |
querten |
1.41 |
FROG_ReadCards* Card;
|
64 |
|
|
FROG_Objects_Extended* frogObjects_;
|
65 |
|
|
|
66 |
|
|
std::vector<FROG_View*> ActiveViews;
|
67 |
querten |
1.42 |
FROG_View_Screen* ViewScreen;
|
68 |
querten |
1.41 |
FROG_View* ViewMain;
|
69 |
querten |
1.55 |
FROG_View_Menu* ViewMenu;
|
70 |
querten |
1.41 |
|
71 |
querten |
1.1 |
int SAVE_WINDOW_W = 800;
|
72 |
|
|
int SAVE_WINDOW_H = 600;
|
73 |
|
|
int SAVE_WINDOW_X = 10;
|
74 |
|
|
int SAVE_WINDOW_Y = 10;
|
75 |
|
|
|
76 |
querten |
1.21 |
|
77 |
querten |
1.19 |
bool FULLSCREEN = false;
|
78 |
|
|
int WINDOW_WIDTH = 800;
|
79 |
|
|
int WINDOW_HEIGHT = 600;
|
80 |
|
|
int SCREENSHOT = 0;
|
81 |
querten |
1.47 |
char SCREENSHOT_FORMAT[255] = {"png"};
|
82 |
|
|
|
83 |
|
|
|
84 |
querten |
1.1 |
|
85 |
querten |
1.7 |
int TEMP_I = 0;
|
86 |
querten |
1.1 |
bool MouseStates[3];
|
87 |
|
|
|
88 |
|
|
GLuint LogoTexture;
|
89 |
querten |
1.37 |
GLuint LogoTxtTexture;
|
90 |
querten |
1.1 |
|
91 |
querten |
1.68 |
char ScreenShotName[1024] = {"screenshot"};
|
92 |
|
|
std::string AbsolutePath;
|
93 |
querten |
1.67 |
std::string inputConfig = "config.txt";
|
94 |
querten |
1.4 |
std::string inputVisFile;
|
95 |
roberfro |
1.36 |
std::string inputVisFileFromCard;
|
96 |
roberfro |
1.22 |
std::vector<std::string> inputGeom;
|
97 |
querten |
1.1 |
|
98 |
querten |
1.40 |
// MultiThreading Variables
|
99 |
|
|
#ifdef linux
|
100 |
|
|
pthread_t Thread_H;
|
101 |
querten |
1.65 |
#elif macos
|
102 |
|
|
pthread_t Thread_H;
|
103 |
querten |
1.40 |
#else
|
104 |
|
|
HANDLE Thread_H = NULL;
|
105 |
|
|
DWORD Thread_Id = 0;
|
106 |
|
|
#endif
|
107 |
|
|
bool Thread_Run = false;
|
108 |
|
|
|
109 |
querten |
1.56 |
float SelectedObject_color[4] = {1,1,1,1};
|
110 |
|
|
int SelectedObject_Counter = 0;
|
111 |
querten |
1.65 |
//bool SelectedObject_DrawFlag = true;
|
112 |
querten |
1.40 |
|
113 |
querten |
1.66 |
bool Geometry_WireFrame = false;
|
114 |
querten |
1.40 |
|
115 |
roberfro |
1.36 |
int updateVisFileTime = -1;
|
116 |
|
|
|
117 |
roberfro |
1.22 |
FROG_Events* events;
|
118 |
querten |
1.26 |
FROG_Element_Event* event;
|
119 |
querten |
1.1 |
|
120 |
querten |
1.25 |
FROG_Geometry* geom;
|
121 |
querten |
1.1 |
|
122 |
querten |
1.13 |
char gSim = 0;
|
123 |
querten |
1.7 |
char gReco = 15;
|
124 |
querten |
1.1 |
|
125 |
querten |
1.65 |
//unsigned int mCLicked_DetId = (unsigned int) -1;
|
126 |
querten |
1.21 |
bool mDisplayMother = false;
|
127 |
querten |
1.1 |
bool mLoading = true;
|
128 |
|
|
int mLoading_I = 0;
|
129 |
querten |
1.59 |
bool mEventChanging = true;
|
130 |
querten |
1.1 |
|
131 |
querten |
1.57 |
unsigned int mAutomaticShooter_LastEvent = 0;
|
132 |
|
|
bool mAutomaticShooter = false;
|
133 |
|
|
|
134 |
|
|
|
135 |
querten |
1.1 |
int eventNumber = 0;
|
136 |
querten |
1.47 |
int eventTime = 5;
|
137 |
querten |
1.1 |
|
138 |
|
|
bool mHelpScreen= false;
|
139 |
querten |
1.17 |
|
140 |
roberfro |
1.15 |
bool stateChanged = false;
|
141 |
querten |
1.1 |
|
142 |
querten |
1.17 |
bool print_FrameWork = false;
|
143 |
querten |
1.16 |
|
144 |
querten |
1.40 |
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 |
querten |
1.1 |
|
151 |
|
|
void reshape (int w, int h);
|
152 |
|
|
void display();
|
153 |
querten |
1.43 |
void display2();
|
154 |
querten |
1.58 |
void displayForScreenShot();
|
155 |
querten |
1.43 |
void displaytext();
|
156 |
querten |
1.20 |
|
157 |
querten |
1.1 |
void LoadCard(const char* inputCard );
|
158 |
roberfro |
1.9 |
void gl_select(int x, int y);
|
159 |
|
|
void list_hits(GLint hits, GLuint *names);
|
160 |
querten |
1.1 |
|
161 |
querten |
1.47 |
void AutomaticEventChanging (int Extra);
|
162 |
|
|
|
163 |
querten |
1.40 |
|
164 |
roberfro |
1.36 |
void updateEventsFile();
|
165 |
|
|
|
166 |
|
|
|
167 |
querten |
1.68 |
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 |
querten |
1.2 |
#endif
|
189 |
|
|
|