molovol / MoloVol

MoloVol is a free, cross-plattform, scientific software for volume and surface computations of single molecules and crystallographic unit cells.
https://molovol.com
MIT License
22 stars 4 forks source link

Add feature: import ions separately #127

Closed jmaglic closed 2 years ago

jmaglic commented 2 years ago

With this change, charged atoms can be imported with a different radius than the uncharged atomic radius. Despite this, charged atoms are recognised as the correct atom when it comes to the molecular formula and molecular weight.

This change also refactors some pre-existing code. The import functions are now no longer methods of the Model class, but are contained inside of the namespace ImportMngr. Since they are no longer members of Model, they now require input arguments and provide an output variable. Previously the import section relied heavily on the use of private members as global variables, which was difficult to read.

This change also introduces proper unit tests as part of ctest via CMake. Currently, only one unit test has been written for a new minor function. The implementation of unit tests is currently complicated by the code structure. To compile unit tests, it is necessary to compile and use the code as a library. This is not possible as long as base.h is included within the library code because the wxWidgets functions are missing (this issue may be circumventable). For now, a small section of the code has been isolated from the rest, so that it can be compiled as a library. As an upside, this section has become more modular.

Resolves: #113