Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <BALL/FORMAT/PDBFile.h>
- #include <BALL/KERNEL/system.h>
- #include <BALL/STRUCTURE/secondaryStructureProcessor.h>
- #include <BALL/VIEW/KERNEL/mainControl.h>
- #include <BALL/VIEW/WIDGETS/scene.h>
- #include <BALL/VIEW/MODELS/cartoonModel.h>
- #include <BALL/VIEW/MODELS/standardColorProcessor.h>
- #include <QtGui/QApplication>
- BALL::System* importPDBFile(const char* fileName)
- {
- BALL::System* system = new BALL::System();
- BALL::PDBFile infile;
- infile.open(fileName);
- infile >> *system;
- BALL::FragmentDB db("");
- system->apply(db.normalize_names);
- system->apply(db.build_bonds);
- BALL::SecondaryStructureProcessor modProc;
- system->apply(modProc);
- return system;
- }
- void showPeptideRepresentation(BALL::System* system, BALL::VIEW::MainControl& control)
- {
- control.insert(*system, "PDB File", false);
- auto* scene = new BALL::VIEW::Scene(&control);
- control.setCentralWidget(scene);
- auto& repManager = control.getRepresentationManager();
- auto* rep = repManager.createRepresentation();
- rep->setComposite(system);
- rep->setColorProcessor(new BALL::VIEW::SecondaryStructureColorProcessor());
- rep->setModelProcessor(new BALL::VIEW::AddCartoonModel());
- control.update(*rep);
- repManager.focusRepresentation(*rep);
- }
- int main(int argc, char* argv[])
- {
- QApplication app(argc, argv);
- BALL::VIEW::MainControl control;
- control.registerThis();
- showPeptideRepresentation(importPDBFile(argv[1]), control);
- control.show();
- return app.exec();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement