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

Authored by christianschaerf on Dec 1 2019, 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 TranscriptDec 1 2019, 11:36 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
christianschaerf requested review of this revision.Dec 1 2019, 11:36 AM

+1

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

aacid added a subscriber: aacid.Dec 1 2019, 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.Dec 2 2019, 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.Dec 2 2019, 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.Dec 3 2019, 9:49 PM

Thanks.

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