00001 /********************************************************************** 00002 alias.h - OBGenericData class to hold alias information on atoms 00003 Copyright (C) Copyright (C) 2007 by Chris Morley 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation version 2 of the License. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 ***********************************************************************/ 00014 00015 #ifndef OB_ALIAS_H 00016 #define OB_ALIAS_H 00017 00018 00019 #include <vector> 00020 #include <openbabel/mol.h> 00021 00022 namespace OpenBabel 00023 { 00024 // This macro is used in DLL builds. If it has not 00025 // been set in babelconfig.h, define it as nothing. 00026 #ifndef OBAPI 00027 #define OBAPI 00028 #endif 00029 00030 const unsigned int AliasDataType = 0x7883; 00031 00048 class OBAPI AliasData : public OBGenericData 00049 { 00050 protected: 00051 std::string _alias; 00052 std::vector<unsigned int> _expandedatoms; 00053 public: 00054 00055 AliasData(): OBGenericData("Alias", AliasDataType){ } 00056 00057 virtual OBGenericData* Clone(OBBase* /*parent*/) const{return new AliasData(*this);} 00058 00060 void SetAlias(const std::string& alias) {_alias = alias;} 00061 void SetAlias(const char* alias) {_alias = alias;} 00062 00064 std::string GetAlias()const { return _alias; } 00065 00067 void SetExpandedAtoms(std::vector<unsigned int>& atoms){ _expandedatoms = atoms; } 00068 00070 std::vector<unsigned int> GetExpandedAtoms()const { return _expandedatoms; } 00071 00072 bool IsExpanded()const { return !_expandedatoms.empty(); } 00073 00074 00075 bool Expand(OBMol& mol, const unsigned int atomindex); 00076 00077 }; 00078 } //namespace 00079 00080 #endif // OB_ALIAS_H 00081
This file is part of the documentation for Open Babel, version 2.2.0.