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
23 stars 4 forks source link

Save common const arguments for Voxel class methods as static members #54

Closed jmaglic closed 3 years ago

jmaglic commented 3 years ago

Current status

Currently, each voxels requires to be passed a load of variables from higher classes in order to, for instance, determine its type.

Issue

It is a big hassle adding another argument to any method because of this. This is only further complicated by all the recursive functions in the Voxel class.

Proposed change

Whenever possible, constant arguments required for voxel methods should be saved as static members in the voxel class. This way all voxel instances have access to those variables and they only need to be saved in one central location. In order to avoid issues, these variables should be reset before the calculation ends.