PlantSimulationLab / Helios

The Helios simulation system is a versatile modeling framework that handles tasks such as managing geometry and associated data structures through a C++ API. Plug-ins build off of the Helios core engine, and access the geometry and data via the Helios context. The sytem comes with a visualization plug-in that can produce stunning renderings of model geometry and data with relatively little effort.
http://baileylab.ucdavis.edu/software/helios
GNU General Public License v2.0
61 stars 27 forks source link

Tree orchards and vineyards generation improvements #44

Closed leroycorentin closed 1 month ago

leroycorentin commented 1 month ago

This pull request allows to easily build configurable and realistic tree orchards and vineyards. It contains the following changes:

Note that existing client code does not need to be altered in any way because of these changes. They only affect the inner Helios code of WeberPennTree and CanopyGenerator plugins.

For the CanopyGenerator plugin I mainly added features for the grapevine canopies because they are what I am interested in building, and it is quite tedious to reflect the changes for all canopy types. If you think these features (such as dead plant probability or spread parameters) are useful, maybe you can make the changes to implement them for other canopy types as well.

I have not changed the documentation to reflect these changes yet, because if I run doxygen, it makes changes pretty much everywhere, mainly because I have a more up-to-date version. If you accept these changes I can add some information in the documentation and downgrade doxygen to avoid having many changes in all documentation files.

I tried to accommodate to the existing syntax in the files I changed. However in the sample projects I added, I used tabulation indents (mainly because I am used to it and space indentation is very painful to my eyes). I can change it to spaces for consistency if you want.

I also wrote my commit messages with the format I am used to, but let me know if you want me to change them so it complies with your own rules.

Thank you for making such a great Open Source project. I hope my contributions can help people using Helios.

leroycorentin commented 1 month ago

Now all canopy classes inherit from BaseCanopyParameters, and all grapevine canopy classes inherit from BaseGrapeVineParameters.

This allowed to remove duplicate code for the canopy type classes, but there is still some redundancy. I think maybe something like a decorator pattern could be used to improve this in the future.

bnbailey-psl commented 1 month ago

Merged in Helios v1.3.20. Thank you for your contribution!

leroycorentin commented 1 week ago

Hey @bnbailey-psl I don't understand why but the sample projects (_treeorchard and vineyard) I added are not there. I can see the new files in the changes summary of commit 9601e54 on master, but I can't see their content, and they don't seem to have actually been created. This is weird because on my branch they are present, as we can see in this PR. Was there a problem while merging the PR in v1.3.20?

bnbailey-psl commented 6 days ago

Hey @leroycorentin , apologies for the confusion. I changed the names of these samples slightly so that it was more explicit which plugins they correspond to. They are weberpenntree_orchard and canopygenerator_vineyard. I should have been more explicit on the name change in the CHANGELOG. Hopefully other than that they merged correctly?

leroycorentin commented 3 days ago

Oh right sorry, I don't know how I missed that. Thanks!