Parameters/README.md

74 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2018-07-02 01:20:09 +02:00
# 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:
2018-07-02 01:24:15 +02:00
Energy Shape <br />
Length_X Lenght_Y Length_Z <br />
Nx Ny Nz <br />
2018-07-02 01:20:09 +02:00
index material (*Nx*Ny*Nz)
2018-07-02 01:24:15 +02:00
2018-07-02 01:20:09 +02:00
Throws error if the index is incorrect in the file.
## Public functions
2018-07-02 23:53:27 +02:00
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);
```
2018-07-02 01:20:09 +02:00
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();
```