Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
interface_distance_functions.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 core/protocols/ligand_docking/ligand_options/interface_distance_functions.cc
11 /// @brief helper functions for the Interface class
12 /// @author Gordon Lemmon (glemmon@gmail.com)
13 ///
14 // Unit Headers
16 #include <core/types.hh>
17 #include <basic/Tracer.hh>
18 
20 #include <utility/vector1.hh>
21 
22 
23 namespace protocols {
24 namespace ligand_docking {
25 namespace ligand_options {
26 
27 static basic::Tracer interface_distance_tracer("protocols.ligand_docking.ligand_options.InterfaceBuilder", basic::t_debug);
28 
30  core::conformation::Residue const & ligand_interface_residue,
31  core::Vector const potential_interface_vector,
32  core::Real const cutoff
33 ){
34  core::Real cutoff_squared= cutoff*cutoff;
35  for(core::Size i = 1, i_end = ligand_interface_residue.nheavyatoms(); i <= i_end; ++i) {
36  core::Vector ligand_vector= ligand_interface_residue.xyz(i);
37  if( is_interface_vector(potential_interface_vector, ligand_vector, cutoff_squared) )
38  return true;
39  }
40  return false;
41 }
42 
44  core::conformation::Residue const & ligand_interface_residue,
45  core::Vector const potential_interface_vector,
46  core::Real const cutoff
47 ){
48  core::Real cutoff_squared= cutoff*cutoff;
49  core::Size ligand_neighbor_atom_id= ligand_interface_residue.nbr_atom();
50  core::Vector ligand_vector= ligand_interface_residue.xyz(ligand_neighbor_atom_id);
51 
52  return is_interface_vector(potential_interface_vector, ligand_vector, cutoff_squared);
53 }
54 
56  core::Vector const & questionable_vector,
57  core::Vector const & ligand_vector,
58  core::Real const cutoff_squared
59 ){
60 
61  double distance_squared = ligand_vector.distance_squared(questionable_vector);
62  if ( distance_squared <= cutoff_squared ) {
63  return true; // don't need to go through all atoms
64  }
65  else{
66  return false;
67  }
68 }
69 
70 } //namespace ligand_options
71 } //namespace ligand_docking
72 } //namespace protocols