Blame view

main.cpp 1.72 KB
3f56f1f9   dmayerich   initial commit
1
  #include "sphere.h"
d6f53e68   dmayerich   rts organization
2
  #include "rts/optics/material.h"
3f56f1f9   dmayerich   initial commit
3
4
5
6
7
8
9
10
11
12
13
14
  #include <vector>
  //#include "rts/complex.h"
  
  #include "nearfield.h"
  //nearfieldStruct* NF;
  
  #include "microscope.h"
  microscopeStruct* SCOPE;
  
  #include "fieldslice.h"
  
  #include "fileout.h"
396a5f12   David Mayerich   added custom code...
15
16
17
  //#include "options.h"
  #include "arguments.h"
  #include "rts/tools/arguments.h"
3f56f1f9   dmayerich   initial commit
18
  #include "montecarlo.h"
d6f53e68   dmayerich   rts organization
19
20
21
22
  #include "rts/math/point.h"
  #include "rts/math/spherical_bessel.h"
  #include "rts/math/matrix.h"
  #include "rts/math/quaternion.h"
3f56f1f9   dmayerich   initial commit
23
  
d6f53e68   dmayerich   rts organization
24
  #include "rts/envi/envi.h"
3f56f1f9   dmayerich   initial commit
25
26
27
  
  #include "warnings.h"
  
3f36b18e   David Mayerich   Adding planewave ...
28
29
30
31
32
33
  #include "planewave.h"
  
  //user interface
  #include "qtMainDialog.h"
  bool gui = false;
  
396a5f12   David Mayerich   added custom code...
34
35
36
37
38
39
  #ifdef _WIN32
  bool ansi = false;
  #else
  bool ansi = true;
  #endif
  
3f56f1f9   dmayerich   initial commit
40
  fileoutStruct gFileOut;
51b6469a   dmayerich   added look-up tables
41
  bool verbose = false;
3f56f1f9   dmayerich   initial commit
42
43
  using namespace std;
  
396a5f12   David Mayerich   added custom code...
44
  int cbessjyva(double v,complex<double> z,double &vm,complex<double>*cjv,
3f56f1f9   dmayerich   initial commit
45
46
47
48
      complex<double>*cyv,complex<double>*cjvp,complex<double>*cyvp);
  
  int main(int argc, char *argv[])
  {
396a5f12   David Mayerich   added custom code...
49
50
51
      //arguments test
      rts::arglist args;
      SetArguments(args);
3f56f1f9   dmayerich   initial commit
52
  
396a5f12   David Mayerich   added custom code...
53
54
  	//parse the input arguments
  	args.parse(argc, argv);
3f36b18e   David Mayerich   Adding planewave ...
55
  
3f56f1f9   dmayerich   initial commit
56
  	SCOPE = new microscopeStruct();
396a5f12   David Mayerich   added custom code...
57
58
59
60
61
62
63
64
65
66
67
68
69
  	
  	//load the user specified parameters into the simulation
      LoadParameters(args);
  
  	//activate ansi output if specified
  	args.set_ansi(ansi);
  
  	//display help and exit
  	if(args("help"))
  	{
  		cout<<args.toStr()<<endl;
  		exit(1);
  	}
3f56f1f9   dmayerich   initial commit
70
  
3f56f1f9   dmayerich   initial commit
71
72
73
  	//initialize GPU memory for fields
  	SCOPE->init();
  
3f36b18e   David Mayerich   Adding planewave ...
74
75
76
77
78
79
80
81
82
83
84
85
86
87
      if(gui)
      {
          QApplication app(argc, argv);
          qtMainDialog bsDialog;
  
          //populate the user interface with the default and command-line values
          bsDialog.populateUi();
          bsDialog.show();
          return app.exec();
      }
      else
      {
  
          gFileOut.Save(SCOPE);
3f56f1f9   dmayerich   initial commit
88
  
3f36b18e   David Mayerich   Adding planewave ...
89
90
          if(verbose)
              OutputOptions();
51b6469a   dmayerich   added look-up tables
91
  
3f36b18e   David Mayerich   Adding planewave ...
92
93
          SCOPE->destroy();
      }
3f56f1f9   dmayerich   initial commit
94
95
  
  
7d43100a   dmayerich   allow appending t...
96
  
3f56f1f9   dmayerich   initial commit
97
98
  
  }