Class for sharing data between classes
Go to file
divaldo 8f4f41dc87 Update 'README.md' 2018-07-02 23:53:27 +02:00
include New get/set functions. Minor changes. 2018-07-02 23:04:15 +02:00
src New get/set functions. Minor changes. 2018-07-02 23:04:15 +02:00
README.md Update 'README.md' 2018-07-02 23:53:27 +02:00
data.txt Added example project and data file 2018-07-02 01:20:09 +02:00
main.cpp New get/set functions. Minor changes. 2018-07-02 23:04:15 +02:00

README.md

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
Length_X Lenght_Y Length_Z
Nx Ny Nz
index material (NxNy*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();