Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OrderedFragSet.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/fragments/FragSet.cc
12 /// @brief set of fragments for a certain alignment frame
13 /// @author Oliver Lange (olange@u.washington.edu)
14 /// @author James Thompson (tex@u.washington.edu)
15 /// @date Wed Oct 20 12:08:31 2007
16 ///
17 
18 // Unit Headers
20 
21 // Package Headers
22 //#include <core/fragment/BBTorsionSRFD.hh>
24 #include <core/fragment/Frame.hh>
25 // AUTO-REMOVED #include <core/fragment/FragData.hh>
26 
27 // Project Headers
28 // AUTO-REMOVED #include <core/pose/Pose.hh>
29 #include <core/types.hh>
30 
31 
32 // ObjexxFCL Headers
33 
34 // Utility headers
35 #include <utility/vector1.fwd.hh>
36 // AUTO-REMOVED #include <utility/io/izstream.hh>
37 #include <utility/pointer/owning_ptr.hh>
38 #include <basic/Tracer.hh>
39 #include <ostream>
40 
42 #include <utility/vector1.hh>
43 
44 #ifdef WIN32
45 #include <iterator>
46 #endif
47 
48 namespace core {
49 namespace fragment {
50 
51 using namespace kinematics;
52 
53 static basic::Tracer tr("core.fragments");
54 // preliminary reader method --- reads classic rosetta++ frag files
55 
56 
59 
61  return new OrderedFragSet( *this );
62 }
64  return new OrderedFragSet();
65 }
66 
67 ///@brief get fragments that start somewhere between start and end
69  MoveMap const&,
71  core::Size end, //not used
72  core::Size, //min_overlap not used
73  core::Size, //min_length not used
74  FrameList &frame_list
75 ) const {
76  Size count( 0 );
77  for ( Size pos=start; pos<=end; pos++ ) {
78  count += frames( pos, frame_list );
79  }
80  return count;
81 }
82 
83 
84 /// @brief Accessor for the Frame at the specified insertion position. Returns false if
85 /// there is no frame at the specified position.
86 Size OrderedFragSet::frames( Size pos, FrameList &out_frames ) const
87 {
88  FrameMap::const_iterator it = frames_.find(pos);
89  if ( it == frames_.end() ) return 0;
90  if ( it->second.begin() != it->second.end() ) {
91  copy( it->second.begin(), it->second.end(), back_inserter( out_frames ) ); // should append frames
92  return it->second.size();
93  }
94 
95  return 0;
96 }
97 
99  return FrameIterator( new OrderedFragSetIterator_( frames_.begin(), frames_.end() ) );
100 }
101 
103  return FrameIterator( new OrderedFragSetIterator_( frames_.end(), frames_.end() ) );
104 }
105 
106 bool OrderedFragSet::empty() const {
107  return frames_.size()==0;
108 }
109 
110 
111 
113 {
114  Size seqpos( aframe->start() );
115  frames_[ seqpos ].push_back( aframe );
116 }
117 
118 }//fragment
119 }// core