Class for sharing data between classes
Go to file
David Baranyai f1d96e7cc7 Added example project and data file 2018-07-02 01:20:09 +02:00
include Added example project and data file 2018-07-02 01:20:09 +02:00
src Added example project and data file 2018-07-02 01:20:09 +02:00
README.md Added example project and data file 2018-07-02 01:20:09 +02:00
data.txt Added example project and data file 2018-07-02 01:20:09 +02:00
main.cpp Added example project and data file 2018-07-02 01:20:09 +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 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();