00001 /********************************************************************** 00002 depict.h - 2D Depiction of molecules using OBPainter. 00003 00004 Copyright (C) 2009-2010 by Tim Vandermeersch 00005 Some portions Copyright (C) 2009 by Chris Morley 00006 00007 This file is part of the Open Babel project. 00008 For more information, see <http://openbabel.org/> 00009 00010 This program is free software; you can redistribute it and/or modify 00011 it under the terms of the GNU General Public License as published by 00012 the Free Software Foundation version 2 of the License. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 ***********************************************************************/ 00019 #ifndef OB_DEPICT_H 00020 #define OB_DEPICT_H 00021 00022 #include <openbabel/babelconfig.h> 00023 #include <openbabel/math/vector3.h> 00024 00025 namespace OpenBabel 00026 { 00027 00028 class OBMol; 00029 class OBPainter; 00030 class OBDepictPrivate; 00031 00032 #ifndef OBDEPICT 00033 #define OBDEPICT 00034 #endif 00035 00041 class OBDEPICT OBDepict 00042 { 00043 public: 00044 enum AtomLabelType { 00045 AtomId = 1, 00046 AtomIndex, 00047 AtomSymmetryClass, 00048 AtomValence, 00049 AtomTetrahedralStereo 00050 }; 00051 00052 enum OptionType{ 00053 bwAtoms = 0x0001, 00054 internalColor = 0x0002, 00055 drawTermC = 0x0010, 00056 drawAllC = 0x0020, 00057 genWedgeHash = 0x0100 00058 }; 00059 00063 OBDepict(OBPainter *painter); 00069 bool DrawMolecule(OBMol *mol); 00075 bool AddAtomLabels(AtomLabelType type); 00076 00077 void SetBondLength(double length); 00078 double GetBondLength() const; 00079 00080 void SetPenWidth(double length); 00081 double GetPenWidth() const; 00082 00083 void SetBondSpacing(double spacing); 00084 double GetBondSpacing() const; 00085 00086 void SetBondWidth(double width); 00087 double GetBondWidth() const; 00088 00089 //void SetDrawingTerminalCarbon(bool enabled); 00090 //bool GetDrawingTerminalCarbon() const; 00091 00092 void SetOption(unsigned opts); //extendable with binary compatibility 00093 unsigned GetOptions() const; 00094 void ClearOptions(); 00095 00096 void SetFontFamily(const std::string &family); 00097 const std::string& GetFontFamily() const; 00098 00099 void SetFontSize(int pointSize, bool subscript = false); 00100 int GetFontSize(bool subscript = false) const; 00101 00102 void SetAliasMode(bool b=true); 00103 00104 void SetBondColor(const std::string& scolor); 00105 00106 private: 00107 OBDepictPrivate * const d; 00108 }; 00109 00110 } 00111 00112 #endif 00113
This file is part of the documentation for Open Babel, version 2.3.