00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_GFX_IMPL_BACKBONE_TRACE_HH 00020 #define OST_GFX_IMPL_BACKBONE_TRACE_HH 00021 00022 /* 00023 Authors: Ansgar Philippsen, Marco Biasini 00024 */ 00025 00026 #include <ost/mol/entity_view.hh> 00027 00028 #include <ost/gfx/module_config.hh> 00029 #include <ost/gfx/impl/entity_detail.hh> 00030 00031 namespace ost { namespace gfx { namespace impl { 00032 00033 class BackboneTraceBuilder; 00034 00040 class DLLEXPORT_OST_GFX BackboneTrace { 00041 public: 00042 00043 // empty trace 00044 BackboneTrace(); 00045 00046 // initialize with a view, and build 00047 BackboneTrace(const mol::EntityView& ent); 00048 00049 // number of node-lists 00050 int GetListCount() const; 00051 00052 // grab a list 00053 const NodeEntryList& GetList(int index) const; 00054 // grab a list 00055 NodeEntryList& GetList(int index); 00056 00057 // reset the view and rebuild 00058 void ResetView(const mol::EntityView& ent); 00059 00060 // used internally - adds a finished nodelist 00061 void AddNodeEntryList(const NodeEntryList& entries); 00062 00063 // used internally - calculates some derived values for a nodelist 00064 void PrepList(NodeEntryList& nelist) const; 00065 00066 // re-creates internal nodelist-list based on view 00067 /* 00068 seq_hack will apply an additional hackish N/N+1 rnum check 00069 to determine if two consecutive residues are connected 00070 */ 00071 void Rebuild(); 00072 00073 // entity has new positions 00074 void OnUpdatedPositions(); 00075 00076 // extract portions of this backbone trace for a subview 00077 // this is faster then re-generating a trace 00078 BackboneTrace CreateSubset(const mol::EntityView& subview); 00079 00080 // experimental 00081 void SetSeqHack(bool f); 00082 bool GetSeqHack() const {return seq_hack_;} 00083 00084 // experimental 00085 void SetTwistHack(bool f); 00086 bool GetTwistHack() const {return twist_hack_;} 00087 00088 private: 00089 mol::EntityView view_; 00090 NodeEntryListList node_list_list_; 00091 bool seq_hack_; 00092 bool twist_hack_; 00093 00094 }; 00095 00096 }}} 00097 00098 #endif