Molecular editor: Enable loading molecules in other formats than cml
ClosedPublic

Authored by christianschaerf on Sun, Dec 1, 11:36 AM.

Details

Summary

This patch implements loading Molecules in the XYZ and PDB formats by instantiating the appropriate subclass of Avogadro::Io::FileFormat
based on the file ending.

Additionally, some error handling code was added so Kalzium does not crash when loading a molecule fails.

Note that this patch requires C++14 since make_unique is used. Should it, for some reason, not be possible to include C++14-only code into Kalzium,
this can be worked around by constructing a std::unique_ptr with raw new.

Diff Detail

Repository
R326 Kalzium
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KDE Edu. · View Herald TranscriptSun, Dec 1, 11:36 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
christianschaerf requested review of this revision.Sun, Dec 1, 11:36 AM

+1

Tested on PDB from rcsb.org and converted XYZ files. Thanks.

aacid added a subscriber: aacid.Sun, Dec 1, 7:03 PM
aacid added inline comments.
compoundviewer/CMakeLists.txt
35

This is wrong CXX_STANDARD_REQUIRED is a bool not a number see
https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html

Sorry, I did not know that. Hope it is fixed now.

aacid added a comment.Mon, Dec 2, 11:10 PM

Sorry, I did not know that. Hope it is fixed now.

No need to be sorry :)

This is why we do code review, so we can all collectively improve the code :)

aacid added a comment.Mon, Dec 2, 11:12 PM

@yurchor will you do the honors and commit this to master or want me to?

@yurchor will you do the honors and commit this to master or want me to?

We need some Dr. Christian Schärf's email for this commit for proper attribution.

@christianschaerf Can you give an email address?

My email is c.schaerf@t-online.de

And I don't have a doctoral degree :)

yurchor accepted this revision.Tue, Dec 3, 9:49 PM

Thanks.

This revision is now accepted and ready to land.Tue, Dec 3, 9:49 PM
This revision was automatically updated to reflect the committed changes.