Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VoxelSetIterator.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 // :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 protocols/match/VoxelSetIterator.hh
12 /// @brief Declaration for iterator to traverse the 64 bins each hit covers in the OccupiedSpaceHash
13 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com), porting to mini
14 
15 #ifndef INCLUDED_protocols_match_VoxelSetIterator_hh
16 #define INCLUDED_protocols_match_VoxelSetIterator_hh
17 
18 // Unit headers
20 
21 // Package headers
22 //#include <protocols/match/SixDHasher.fwd.hh>
24 
25 // Numeric headers
26 #include <numeric/xyzVector.hh>
27 #include <numeric/geometry/BoundingBox.hh>
28 #include <numeric/geometry/hashing/SixDHasher.fwd.hh>
29 
30 // Utility headers
31 #include <utility/fixedsizearray1.hh>
32 #include <utility/FixedSizeLexicographicalIterator.hh>
33 
34 namespace protocols {
35 namespace match {
36 
37 /// @brief Helper class for the OccupiedSpaceHasher which manages the logic for how
38 /// to iterate across the 64 voxels that each 6-D point covers.
39 ///
40 /// @details This class ensures that the bounding box for the hash is not
41 /// walked outside of, that the phi and psi are wrapped at 360, and that
42 /// when theta is near a gimbal-lock angle of 180 or 0, that phi and psi are
43 /// appropriately wrapped to the negative rotation. This class may be rapidly
44 /// allocated and deallocated on the stack -- no calls to new are made anywhere.
46 {
47 public:
48  typedef core::Size Size;
49  typedef core::Real Real;
51  typedef numeric::geometry::BoundingBox< Vector > BoundingBox;
53  typedef numeric::geometry::hashing::Size6 Size6;
54  typedef numeric::geometry::hashing::Bin6D Bin6D;
55 
56 public:
58  BoundingBox const & bb,
59  Size3 const & n_xyz_bins,
60  Size3 const & n_euler_bins,
61  Real3 const & xyz_bin_widths,
62  Real3 const & euler_bin_widths,
63  Real3 const & xyz_bin_halfwidths,
64  Real3 const & euler_bin_halfwidths,
65  Real6 const & point
66  );
67 
68  void operator ++ ();
69  bool at_end() const;
70  void get_bin_and_pos( Size6 & bin, Size & pos ) const;
71 
72 private:
73  void calc_bin_and_pos();
74 
75 private:
84 
87 
88  //bool wrap_theta_;
91 
92  utility::fixedsizearray1< Size, 2 > wrapped_phipsi_bins_;
93  utility::fixedsizearray1< Size, 2 > wrapped_phipsi_halfbins_;
94 
95  utility::FixedSizeLexicographicalIterator< 6 > iter64_;
96  Size6 curr_bin_; // The voxel for the
97  Size curr_pos_; // which of the 64 different half-width voxels in the regular width voxel
98 };
99 
100 
101 }
102 }
103 
104 #endif