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_MOL_SECONDARY_STRUCTURE_HH 00020 #define OST_MOL_SECONDARY_STRUCTURE_HH 00021 00022 #include <ost/mol/module_config.hh> 00023 00024 namespace ost { namespace mol { 00025 00029 struct DLLEXPORT_OST_MOL SecStructure { 00030 typedef enum { 00031 ALPHA_HELIX ='H', 00032 PI_HELIX ='I', 00033 THREE_TEN_HELIX ='G', 00034 TURN ='T', 00035 EXTENDED ='E', 00036 BETA_BRIDGE ='B', 00037 BEND ='S', 00038 COIL ='C' 00039 } Type; 00040 explicit SecStructure(char type) : type_(Type(type)) {} 00041 explicit SecStructure(Type type) : type_(type) {} 00042 SecStructure() : type_(COIL) { } 00043 bool operator==(const Type& rhs) const 00044 { 00045 return type_==rhs; 00046 } 00047 00048 bool operator==(const SecStructure& rhs) const 00049 { 00050 return type_==rhs.type_; 00051 } 00052 00053 bool operator!=(const Type& rhs) const 00054 { 00055 return !this->operator==(rhs); 00056 } 00057 bool operator!=(const SecStructure& rhs) const 00058 { 00059 return !this->operator==(rhs); 00060 } 00061 00062 bool IsHelical() const 00063 { 00064 return type_==ALPHA_HELIX || type_==PI_HELIX || type_==THREE_TEN_HELIX; 00065 } 00066 00067 bool IsExtended() const 00068 { 00069 return type_==EXTENDED || type_==BETA_BRIDGE; 00070 } 00071 00072 bool IsCoil() const 00073 { 00074 return type_==COIL || type_==BEND || type_==TURN; 00075 } 00076 operator char() const { return type_; } 00077 private: 00078 Type type_; 00079 }; 00080 00081 }} // ns 00082 #endif