microscope.h 1.2 KB

#include "fieldslice.h"
#include "nearfield.h"

#include <iostream>
using namespace std;

struct sourcePoint
    bsPoint f;
    ptype A;

struct microscopeStruct
	int padding;

	int ss;

	//field slice at the detector
	fieldslice Ufd;
	fieldslice Ud;
	bool scalarSim;

	//detector image
	scalarslice* D;		//sample
	scalarslice* Di;		//incident field image

	ptype objective[2];

	//image position and orientation in world space
	rts::quad<ptype, 3> pos;

	vector<sourcePoint> focalPoints;


	nearfieldStruct nf;

	void init();
	void destroy();

    //functions for dealing with extended sources
	void SimulateExtendedSource();
	void LoadExtendedSource(std::string filename);

	void SimulateScattering();
	void SimulateImaging();
	void Simulate();
	void setNearfield();
	void setRes(int x_res, int y_res, int pad, int supersampling);
	void setPos(bsPoint pMin, bsPoint pMax, bsVector normal);

	void applyBandpass();
	void getFarField();
	void integrateDetector();
	void clearDetector();

	//compute detector measurements
	scalarslice getAbsorbance();
	scalarslice getTransmittance();
	scalarslice getIntensity();

	string toStr();