Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConformationViewer.hh
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 #ifndef INCLUDED_protocols_viewer_ConformationViewer_hh
15 #define INCLUDED_protocols_viewer_ConformationViewer_hh
16 
17 
18 // Unit headers
20 
21 // Package headers
26 #include <core/id/AtomID.hh>
27 
28 // Project headers
29 
30 #include <utility/pointer/owning_ptr.hh>
31 #include <utility/pointer/ReferenceCount.hh>
32 #include <utility/signals/Link.hh>
33 // AUTO-REMOVED #include <utility/vector1.hh>
34 
37 
38 #include <utility/vector1_bool.hh>
39 
40 //Auto Headers
41 
42 
43 
44 // C++ Headers
45 
46 #ifdef GL_GRAPHICS
47 #include <pthread.h>
48 #endif
49 
50 namespace protocols {
51 namespace viewer {
52 
53 /// @brief observer that attaches to a Conformation and displays graphics
55 
56 private: // typedefs
57 
59 
60 public: // typedefs
61 
63 
64 public: // construct/destruct
65 
66  /// @brief default constructor
68 
69  /// @brief constructor
71 
72  /// @brief constructor
73  ConformationViewer( std::string const & name, int length, int width, bool debug_pause );
74 
75  // @brief default destructor
77 
78 
79 private: // disallow copy
80 
81  /// @brief disallow copy constructor
82  // NOTE: if implementing copy constructor, remember to set 'conf_' to NULL
83  // as there is no transferal of subject Conformation on copy construct
84  ConformationViewer( ConformationViewer const & rval );
85 
86  /// @brief disallow copy assignment
87  // NOTE: if ConformationViewer copy assignment, remember to leave 'conf_' untouched
88  // as any current subject Conformation is kept on copy assign
90 
91 
92 public: // window management
93 
94  /// called by glutDisplayFunc
95  void
96  display_func();
97 
98  /// called by glutIdleFunc
99  void
101 
102  ///
103  int
104  window() const
105  {
106  return my_window_;
107  }
108 
109  ///
110  void
111  window( int const setting )
112  {
113  my_window_ = setting;
114  }
115 
116  int
117  get_width() const
118  {
119  return width_;
120  }
121 
122  int
123  get_length() const
124  {
125  return length_;
126  }
127 
129  get_gs() {
130  return current_gs_;
131  }
132 
133  ///
134  std::string const &
135  name() const
136  {
137  return name_;
138  }
139 
140 public: // observer interface
141 
142  /// @brief is currently observing a Conformation?
143  /// @return the Conformation, otherwise NULL
145  is_observing() const;
146 
147  /// @brief attach to Conformation
148  void
150 
151  /// @brief detach from Conformation
152  void
153  detach_from();
154 
155  /// @brief upon receiving a ConnectionEvent do...
156  void
158 
159  /// @brief upon receiving a GeneralEvent update the residues and atom tree root
160  void
162 
163 private:
167 
168  // density isosurface
170 
172 
174 
176 
178  int length_;
179  int width_;
180 
182 
183  utility::signals::Link connection_event_link_;
184  utility::signals::Link xyz_event_link_;
185 
186  /// @brief the Conformation being observed, we need this to ensure
187  /// debug_pause is reset upon detachment
189 
190 #ifdef GL_GRAPHICS
191  pthread_mutex_t residues_mut_;
192 #endif
193 
194 };
195 
196 } // viewer
197 } // protocols
198 
199 
200 #endif