Chemical Data Processing Library C++ API - Version 1.4.0
HierarchyViewChain.hpp
Go to the documentation of this file.
1 /*
2  * HierarchyViewChain.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_BIOMOL_HIERARCHYVIEWCHAIN_HPP
30 #define CDPL_BIOMOL_HIERARCHYVIEWCHAIN_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <memory>
35 
36 #include <boost/iterator/indirect_iterator.hpp>
37 
40 #include "CDPL/Util/BitSet.hpp"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Biomol
47  {
48 
49  class HierarchyViewModel;
50 
56  {
57 
58  friend class HierarchyViewModel;
59 
60  typedef std::shared_ptr<HierarchyViewFragment> FragmentPtr;
61  typedef std::vector<FragmentPtr> FragmentList;
62 
63  public:
65  typedef boost::indirect_iterator<FragmentList::const_iterator, const HierarchyViewFragment> ConstFragmentIterator;
66 
71  std::size_t getNumFragments() const;
72 
79  const HierarchyViewFragment& getFragment(std::size_t idx) const;
80 
86 
92 
98 
104 
105  private:
107  initFragments(true) {}
108 
109  void initFragmentList() const;
110  void visitAtom(const Chem::Atom& atom, HierarchyViewFragment& frag, Util::BitSet& vis_atoms) const;
111 
112  mutable FragmentList fragments;
113  mutable bool initFragments;
114  };
115  } // namespace Biomol
116 } // namespace CDPL
117 
118 #endif // CDPL_BIOMOL_HIERARCHYVIEWCHAIN_HPP
Definition of the preprocessor macro CDPL_BIOMOL_API.
#define CDPL_BIOMOL_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Declaration of type CDPL::Util::BitSet.
Definition of class CDPL::Biomol::HierarchyViewFragment.
Data structure for the representation of biological macromolecule chains.
Definition: HierarchyViewChain.hpp:56
ConstFragmentIterator getFragmentsBegin() const
Returns a constant iterator pointing to the first chain fragment.
ConstFragmentIterator end() const
Returns a constant iterator pointing one past the last chain fragment (range-based for support).
std::size_t getNumFragments() const
Returns the number of fragments this chain consists of.
boost::indirect_iterator< FragmentList::const_iterator, const HierarchyViewFragment > ConstFragmentIterator
A constant iterator over the chain fragments.
Definition: HierarchyViewChain.hpp:65
ConstFragmentIterator begin() const
Returns a constant iterator pointing to the first chain fragment (range-based for support).
const HierarchyViewFragment & getFragment(std::size_t idx) const
Returns the chain fragment at index idx.
ConstFragmentIterator getFragmentsEnd() const
Returns a constant iterator pointing one past the last chain fragment.
Data structure for the representation of a single contiguous fragment of a biological macromolecule c...
Definition: HierarchyViewFragment.hpp:49
Data structure for the representation of individual biological macromolecule models.
Definition: HierarchyViewModel.hpp:57
Abstract base class for nodes of the Biomol::HierarchyView tree (models, chains, residues).
Definition: HierarchyViewNode.hpp:48
Abstract base class representing a chemical atom and its bonded neighborhood.
Definition: Atom.hpp:57
boost::dynamic_bitset BitSet
Dynamic bitset class.
Definition: BitSet.hpp:46
The namespace of the Chemical Data Processing Library.