Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

atom_predicates.h

Go to the documentation of this file.
00001 // -*- mode: c++; -*-
00002 //
00003 //The Biomolecule Toolkit (BTK) is a C++ library for use in the
00004 //modeling, analysis, and design of biological macromolecules.
00005 //Copyright (C) 2002, Tim Robertson <kid50@users.sourceforge.net>
00006 //
00007 //This program is free software; you can redistribute it and/or modify
00008 //it under the terms of the GNU Lesser General Public License as published
00009 //by the Free Software Foundation; either version 2.1 of the License, or (at
00010 //your option) any later version.
00011 //
00012 //This program is distributed in the hope that it will be useful,  but
00013 //WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 //Lesser General Public License for more details. 
00016 //
00017 //You should have received a copy of the GNU Lesser General Public License 
00018 //along with this program; if not, write to the Free Software Foundation, 
00019 //Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00024 
00025 #ifndef BTK_ATOM_PREDICATES_H
00026 #define BTK_ATOM_PREDICATES_H
00027 
00028 
00029 namespace BTK {
00030 
00031   // this is only here to be a defualt argument
00032   struct is_any {
00033     template <typename AtomType>
00034     bool operator()(AtomType& a){
00035       return true;
00036     }
00037   };
00038 
00039   struct is_calpha {
00040     template <typename AtomType>
00041     bool operator()(AtomType& a){
00042       return (a.atom_index() == ATOM::CA);
00043     }
00044   };
00045 
00046   struct is_protein_bb {
00047     template <typename AtomType>
00048     bool operator()(AtomType& a){
00049       return (a.atom_index() == ATOM::CA ||
00050               a.atom_index() == ATOM::C  ||
00051               a.atom_index() == ATOM::N );
00052     }
00053   };
00054 
00055   struct is_group_num_gt {
00056     is_group_num_gt(int n) : _n(n) {}
00057 
00058     template <typename AtomType>
00059     bool operator()(AtomType& a){
00060       return a.group_num() > _n;
00061     }
00062 
00063     int _n;
00064   };
00065 
00066   struct is_group_num_lt {
00067     is_group_num_lt(int n) : _n(n) {}
00068 
00069     template <typename AtomType>
00070     bool operator()(AtomType& a){
00071       return a.group_num() < _n;
00072     }
00073 
00074     int _n;
00075   };
00076 
00077   struct is_selected {
00078     template <typename AtomType>
00079     bool operator()(AtomType& a){
00080       return a.is_selected();
00081     }
00082   };
00083 
00084 }
00085 
00086 #endif
00087 
00088 

Generated on Wed Apr 14 00:43:16 2004 for BTK by doxygen 1.3.6