Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SilentObserver.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file
11 /// @brief
12 /// @author
13 
14 // Unit headers
16 
17 // Package headers
18 // AUTO-REMOVED #include <protocols/viewer/viewers.hh>
19 
20 #include <core/types.hh>
21 
23 //#include <core/io/silent/ProteinSilentStruct.hh>
26 
27 #include <core/pose/Pose.hh>
28 // AUTO-REMOVED #include <core/pose/signals/DestructionEvent.hh>
30 
31 #include <ObjexxFCL/string.functions.hh>
32 
33 #include <core/id/types.hh>
34 #include <utility/vector1.hh>
35 
36 using ObjexxFCL::string_of;
37 
38 
39 // Project headers
40 
41 // C++ Headers
42 
43 
44 namespace protocols {
45 namespace viewer {
46 
47 
48 /// @brief default constructor
50 
51 /// @brief constructor
52 SilentObserver::SilentObserver( std::string const & name_in, bool fullatom = false ) :
53  frame_count_( 0 ),
54  fullatom_( fullatom ),
55  silent_file_name_( name_in + ".out" )
56 {
58 }
59 
60 
61 /// @brief default destructor
63  detach_from();
64 }
65 
66 
67 /// @brief attach to a Pose
68 void
70  detach_from();
72 }
73 
74 
75 /// @grief detach from Pose
76 void
78  energy_event_link_.invalidate();
79 }
80 
81 
82 /// @brief upon receiving an EnergyEvent write to silent file
83 void
86 ) {
87  frame_count_++;
88  // std::cout << "frame(" << frame_count_ << ")" << std::endl;
89  //core::io::silent::ProteinSilentStruct pss( *event.pose, "frame" + string_of(frame_count_) );
90  using namespace core::io::silent;
92  ss->fill_struct( *event.pose, "frame" + string_of(frame_count_) );
93 
94  sfd_->write_silent_struct( *ss, silent_file_name_ );
95 }
96 
97 
98 } // namespace conformation
99 } // namespace core
100 
101