Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomGraph.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 src/core/conformation/AtomGraph.cc
11 /// @author Sam DeLuca
12 
13 ///@detail right now there isnt a canonical mapping from nodes back to atom objects.
14 
20 
23 
24 #include <utility/vector1.hh>
25 
26 
27 namespace core {
28 namespace conformation {
29 
30 void
32  Conformation const & conformation,
33  AtomGraphOP atom_graph
34 )
35 {
36  //TODO: doing this because I don't want to pull in an entire pose :( gotta be a better way
38  for (platform::Size resid = 1; resid <= conformation.size(); ++resid)
39  {
40  num_atoms += conformation.residue_type(resid).natoms();
41  }
42  num_atoms++;
43  atom_graph->set_num_vertices(num_atoms);
44  platform::Size index_id = 1;
45 
46  for ( platform::Size resid=1 ;resid <= conformation.size(); ++resid ) {
47  core::conformation::Residue current_res(conformation.residue(resid));
48  for(platform::Size atomno=1; atomno <= current_res.natoms(); ++atomno )
49  {
50  AtomGraphVertexData current_vertex = atom_graph->get_vertex(index_id).data();
51  current_vertex.xyz() = current_res.xyz(atomno);
52  current_vertex.atom_name() = current_res.atom_name(atomno);
53  core::Real lj_radius = current_res.atom_type(atomno).lj_radius();
54  current_vertex.atom_radius_squared() = lj_radius*lj_radius;
55 
56 
57  num_atoms++;
58  }
59  }
60 
61 }
62 
63 
66  Conformation const & conformation,
67  AtomGraphOP atom_graph,
68  PointPosition const & additional_point
69 
70 )
71 {
72  //TODO: doing this because I don't want to pull in an entire pose :( gotta be a better way
74  for (platform::Size resid = 1; resid <= conformation.size(); ++resid)
75  {
76  num_atoms += conformation.residue_type(resid).natoms();
77  }
78  num_atoms++;
79  atom_graph->set_num_vertices(num_atoms);
80  platform::Size index_id = 1;
81  for ( platform::Size resid=1 ;resid <= conformation.size(); ++resid ) {
82  core::conformation::Residue current_res(conformation.residue(resid));
83  for(platform::Size atomno=1; atomno <= current_res.natoms(); ++atomno )
84  {
85  AtomGraphVertexData current_vertex = atom_graph->get_vertex(index_id).data();
86  current_vertex.xyz() = current_res.xyz(atomno);
87  current_vertex.atom_name() = current_res.atom_name(atomno);
88  current_vertex.residue_id() = resid;
89  //num_atoms++;
90  }
91  }
92  //add the additional point
93  atom_graph->get_vertex(num_atoms).data().xyz() = additional_point;
94 
95  return num_atoms; //this is the ID of the additional point
96 }
97 
98 
99 }
100 }