-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSynRad.h
149 lines (121 loc) · 3.95 KB
/
SynRad.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
Program: MolFlow+ / Synrad+
Description: Monte Carlo simulator for ultra-high vacuum and synchrotron radiation
Authors: Jean-Luc PONS / Roberto KERSEVAN / Marton ADY
Copyright: E.S.R.F / CERN
Website: https://cern.ch/molflow
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Full license text: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
*/
#pragma once
#include "Interface.h"
//#include "ExportDesorption.h"
#include "FacetMesh.h"
#include "FacetDetails.h"
#include "TrajectoryDetails.h"
#include "Viewer3DSettings.h"
#include "TextureSettings.h"
#include "GlobalSettings.h"
#include "ProfilePlotter.h"
#include "SpectrumPlotter.h"
#include "TexturePlotter.h"
#include "RegionInfo.h"
#include "RegionEditor.h"
class Worker;
class SynRad : public Interface
{
public:
SynRad();
void LoadFile(std::string fileName="");
void InsertGeometry(bool newStr,std::string fileName="");
void SaveFile();
// Util functions
//void SendHeartBeat(bool forced=false);
//void SetParam(GLTextField *txt,double value);
void PlaceComponents();
void LoadParam(char *fName=NULL,int position=-1);
//void ExportDes(bool selectedOnly);
void ClearFacetParams();
void UpdateFacetParams(bool updateSelection=false);
void ApplyFacetParams();
void StartStopSimulation();
void SaveConfig();
void LoadConfig();
void UpdateFacetHits(bool all=false);
void QuickPipe();
void UpdatePlotters();
void ClearRegions();
void RemoveRegion(int index);
void NewRegion();
// Recent files
char *recentPARs[MAX_RECENT];
int nbRecentPAR;
void AddRecentPAR(const char *fileName);
void RemoveRecentPAR(const char *fileName);
void UpdateRecentPARMenu();
void PlaceScatteringControls(bool newReflectionMode);
bool EvaluateVariable(VLIST * v);
// Components
GLTextField *doseNumber;
GLTextField *facetTeleport;
GLTextField *facetSticking;
GLTextField *facetRMSroughness;
GLTextField *facetAutoCorrLength;
GLCombo *facetReflType;
GLToggle *facetDoScattering;
GLTextField *facetStructure;
GLCombo *facetProfileCombo;
GLToggle *facetSpectrumToggle;
GLButton *facetTexBtn;
GLLabel *modeLabel;
GLLabel *doseLabel;
GLLabel *facetTPLabel;
GLLabel *facetRMSroughnessLabel;
GLLabel *facetAutoCorrLengthLabel;
GLLabel *facetLinkLabel;
GLLabel *facetStructureLabel;
GLTextField *facetSuperDest;
// GLLabel *facetTLabel;
GLLabel *facetRLabel;
GLLabel *facetReLabel;
GLLabel *facetSpecLabel;
GLMenu *PARloadToMenu;
GLMenu *PARremoveMenu;
GLMenu *ShowHitsMenu;
//Materials (photon reflection)
vector<string> materialPaths;
void RebuildPARMenus();
//Dialog
RegionInfo *regionInfo;
//ExportDesorption *exportDesorption;
FacetMesh *facetMesh;
FacetDetails *facetDetails;
TrajectoryDetails *trajectoryDetails;
Viewer3DSettings *viewer3DSettings;
TextureSettings *textureSettings;
GlobalSettings *globalSettings;
ProfilePlotter *profilePlotter;
SpectrumPlotter *spectrumPlotter;
TexturePlotter *texturePlotter;
RegionEditor *regionEditor;
//char *nbF;
// Testing
//int nbSt;
//void LogProfile();
void BuildPipe(double ratio,int steps=0);
void EmptyGeometry();
void CrashHandler(Error *e);
protected:
int OneTimeSceneInit();
int RestoreDeviceObjects();
int InvalidateDeviceObjects();
int FrameMove();
void ProcessMessage(GLComponent *src,int message);
};