OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
backbone_trace.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GFX_IMPL_BACKBONE_TRACE_HH
20 #define OST_GFX_IMPL_BACKBONE_TRACE_HH
21 
22 /*
23  Authors: Ansgar Philippsen, Marco Biasini
24  */
25 
26 #include <ost/mol/entity_view.hh>
27 
28 #include <ost/gfx/module_config.hh>
30 
31 namespace ost { namespace gfx { namespace impl {
32 
33 class BackboneTraceBuilder;
34 
41 public:
42 
43  // empty trace
44  BackboneTrace();
45 
46  // initialize with a view, and build
47  BackboneTrace(const mol::EntityView& ent);
48 
49  // number of node-lists
50  int GetListCount() const;
51 
52  // grab a list
53  const NodeEntryList& GetList(int index) const;
54  // grab a list
55  NodeEntryList& GetList(int index);
56 
57  // reset the view and rebuild
58  void ResetView(const mol::EntityView& ent);
59 
60  // used internally - adds a finished nodelist
61  void AddNodeEntryList(const NodeEntryList& entries);
62 
63  // used internally - calculates some derived values for a nodelist
64  void PrepList(NodeEntryList& nelist) const;
65 
66  // re-creates internal nodelist-list based on view
67  /*
68  seq_hack will apply an additional hackish N/N+1 rnum check
69  to determine if two consecutive residues are connected
70  */
71  void Rebuild();
72 
73  // entity has new positions
74  void OnUpdatedPositions();
75 
76  // extract portions of this backbone trace for a subview
77  // this is faster then re-generating a trace
78  BackboneTrace CreateSubset(const mol::EntityView& subview);
79 
80  // experimental
81  void SetSeqHack(bool f);
82  bool GetSeqHack() const {return seq_hack_;}
83 
84  // experimental
85  void SetTwistHack(bool f);
86  bool GetTwistHack() const {return twist_hack_;}
87 
88 private:
89  mol::EntityView view_;
90  NodeEntryListList node_list_list_;
91  bool seq_hack_;
92  bool twist_hack_;
93 
94 };
95 
96 }}}
97 
98 #endif