00001 // $Id: mmdb_mask.h $ 00002 // ================================================================= 00003 // 00004 // CCP4 Coordinate Library: support of coordinate-related 00005 // functionality in protein crystallography applications. 00006 // 00007 // Copyright (C) Eugene Krissinel 2000-2013. 00008 // 00009 // This library is free software: you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License version 3, modified in accordance with the provisions 00012 // of the license to address the requirements of UK law. 00013 // 00014 // You should have received a copy of the modified GNU Lesser 00015 // General Public License along with this library. If not, copies 00016 // may be downloaded from http://www.ccp4.ac.uk/ccp4license.php 00017 // 00018 // This program is distributed in the hope that it will be useful, 00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 // GNU Lesser General Public License for more details. 00022 // 00023 // ================================================================= 00024 // 00025 // 12.09.13 <-- Date of Last Modification. 00026 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00027 // ----------------------------------------------------------------- 00028 // 00029 // **** Module : MMDBF_Mask <interface> 00030 // ~~~~~~~~~ 00031 // **** Project : MacroMolecular Data Base (MMDB) 00032 // ~~~~~~~~~ 00033 // 00034 // **** Classes : mmdb::Mask ( atom selection mask ) 00035 // ~~~~~~~~~ 00036 // 00037 // (C) E. Krissinel 2000-2013 00038 // 00039 // ================================================================= 00040 // 00041 00042 #ifndef __MMDB_Mask__ 00043 #define __MMDB_Mask__ 00044 00045 #include "mmdb_io_stream.h" 00046 00047 namespace mmdb { 00048 00049 // ========================== Mask ============================= 00050 00051 DefineClass(Mask); 00052 DefineStreamFunctions(Mask); 00053 00054 class Mask : public io::Stream { 00055 00056 public : 00057 00058 Mask (); 00059 Mask ( io::RPStream Object ); 00060 ~Mask(); 00061 00062 void SetMaskBit ( int BitNo ); 00063 void NewMask ( PPMask Mask, int nMasks ); 00064 00065 void CopyMask ( PMask Mask ); // this = Mask 00066 void SetMask ( PMask Mask ); // this = this | Mask 00067 void RemoveMask ( PMask Mask ); // this = this & (~Mask) 00068 void SelMask ( PMask Mask ); // this = this & Mask 00069 void XadMask ( PMask Mask ); // this = this ^ Mask 00070 void ClearMask (); // this = NULL 00071 void NegMask (); // this = ~this 00072 00073 bool CheckMask ( PMask Mask ); // true if the bit is on 00074 bool isMask (); // true if any mask bit is on 00075 00076 inline int getLength() { return mlen; } 00077 00078 pstr Print ( pstr S ); // returns binary string 00079 00080 void write ( io::RFile f ); 00081 void read ( io::RFile f ); 00082 00083 protected : 00084 int mlen; 00085 wvector m; 00086 00087 void InitMask(); 00088 void Expand ( int n ); 00089 00090 }; 00091 00092 } // namespace mmdb 00093 00094 #endif 00095
1.7.2