Parameters/README.md

74 lines
1.3 KiB
Markdown

# Parameters - Class for sharing data between classes
## Using
* Copy the source files into the corresponding directory in your project
* Create a pointer and initialize the class. For example:
```
Parameters *parameters = Parameters::GetInstance();
```
It's the only way to initialize it, because the constructor is private.
## How it works?
On the first initialization, it reads the file in the given format:
Energy Shape <br />
Length_X Lenght_Y Length_Z <br />
Nx Ny Nz <br />
index material (*Nx*Ny*Nz)
Throws error if the index is incorrect in the file.
## Public functions
Returns with a vector which contains the dimension (X, Y, Z):
```
std::vector<double> GetDimension();
```
Returns with a vector which contains N (X, Y, Z):
```
std::vector<double> GetVoxel();
```
Get/Set the energy:
```
double GetEnergy();
void SetEnergy(double);
```
Get/Set the shape:
```
double GetShape();
void SetShape(double);
```
Returns with the material form the list by it's index (returns -1 if the index is out of range):
```
double GetMaterial(int index);
```
Returns with the material from the list by it's coordinates (not implemented yet):
```
double GetMaterial(int x, int y, int z);
```
Returns with the list size:
```
double GetListSize();
```
Returns with the vector:
```
std::vector<double> GetMaterialList();
```