5 #include <RMF/FileHandle.h>
16 int main(
int argc,
char **argv) {
19 double score = std::numeric_limits<double>::max();
20 std::string file_type =
"auto";
21 boost::int64_t frame = 0;
22 boost::int64_t frame_step = 0;
24 "Recolor the hierarchies using the display colors",
27 "The upper bound for the restraints scores to"\
29 "restraints by score.", &score);
31 "pymol, chimera or auto (to use suffix)",
34 "The frame index or a negative number for every"
37 "If non-zero output every n frames", &frame_step);
40 "Export an RMF file to a viewer",
54 if (file_type==
"auto") {
58 if (file_type==
"pymol") {
60 }
else if (file_type==
"chimera") {
67 std::cout<<
"writing to file " << output << std::endl;
68 RMF::FileConstHandle rh= RMF::open_rmf_file_read_only(io[0]);
75 IMP::Pointer<IMP::display::Writer> w
77 if (frame_step == 0) frame_step = std::numeric_limits<int>::max();
79 for (
unsigned int frame_iteration = frame;
80 frame_iteration < rh.get_number_of_frames();
81 frame_iteration += frame_step) {
82 w->set_frame(cur_frame++);
84 for (
unsigned int i=0; i< hs.size(); ++i) {
91 for (
unsigned int i=0; i< ps.size(); ++i) {
105 for (
unsigned int i=0; i< ps.size(); ++i) {
111 if (file_type==
"pymol") {
112 std::cout <<
"launching pymol..." << std::endl;
113 return system((std::string(
"pymol")+
" "+output).c_str());
115 std::cout <<
"launching chimera..." << std::endl;
116 return system((std::string(
"chimera")+
" "+output).c_str());
121 }
catch (
const IMP::Exception &e) {
122 std::cerr <<
"Error: " << e.what() << std::endl;
124 }
catch (
const std::exception &e) {
125 std::cerr <<
"Error: " << e.what() << std::endl;