Loading...
Searching...
No Matches
depict.h
Go to the documentation of this file.
/**********************************************************************
depict.h - 2D Depiction of molecules using OBPainter.
Copyright (C) 2009-2010 by Tim Vandermeersch
Some portions Copyright (C) 2009 by Chris Morley
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
***********************************************************************/
#ifndef OB_DEPICT_H
#define OB_DEPICT_H
#include <openbabel/babelconfig.h>
#include <openbabel/math/vector3.h>
namespace OpenBabel
{
class OBMol;
class OBPainter;
class OBDepictPrivate;
#ifndef OBDEPICT
#define OBDEPICT
#endif
class OBDEPICT OBDepict
{
public:
enum AtomLabelType {
AtomId = 1,
AtomIndex,
AtomSymmetryClass,
AtomValence,
AtomTetrahedralStereo
};
enum OptionType{
bwAtoms = 0x0001,
internalColor = 0x0002,
noMargin = 0x0004,
drawTermC = 0x0010,
drawAllC = 0x0020,
noWedgeHashGen = 0x0100,
asymmetricDoubleBond = 0x0200,
allExplicit = 0x0400
};
OBDepict(OBPainter *painter);
OBDepict(OBPainter *painter, bool withBall, bool symbolOnBall=false);
~OBDepict();
bool DrawMolecule(OBMol *mol);
bool AddAtomLabels(AtomLabelType type);
void SetBondLength(double length);
double GetBondLength() const;
void SetPenWidth(double length);
double GetPenWidth() const;
void SetBondSpacing(double spacing);
double GetBondSpacing() const;
void SetBondWidth(double width);
double GetBondWidth() const;
//void SetDrawingTerminalCarbon(bool enabled);
//bool GetDrawingTerminalCarbon() const;
void SetOption(unsigned opts); //extendable with binary compatibility
unsigned GetOptions() const;
void ClearOptions();
void SetFontFamily(const std::string &family);
const std::string& GetFontFamily() const;
void SetFontSize(int pointSize, bool subscript = false);
int GetFontSize(bool subscript = false) const;
void SetAliasMode(bool b=true);
void SetBondColor(const std::string& scolor);
private:
OBDepictPrivate * d;
};
}
#endif
OpenBabel::OBDepict
2D depiction of molecules using OBPainter.
Definition depict.h:42
OpenBabel::OBDepict::AtomLabelType
AtomLabelType
Definition depict.h:44
OpenBabel::OBDepict::AtomTetrahedralStereo
@ AtomTetrahedralStereo
Definition depict.h:49
OpenBabel::OBDepict::AtomIndex
@ AtomIndex
Definition depict.h:46
OpenBabel::OBDepict::AtomId
@ AtomId
Definition depict.h:45
OpenBabel::OBDepict::AtomValence
@ AtomValence
Definition depict.h:48
OpenBabel::OBDepict::AtomSymmetryClass
@ AtomSymmetryClass
Definition depict.h:47
OpenBabel::OBDepict::OptionType
OptionType
Definition depict.h:52
OpenBabel::OBDepict::bwAtoms
@ bwAtoms
Definition depict.h:53
OpenBabel::OBDepict::allExplicit
@ allExplicit
Definition depict.h:60
OpenBabel::OBDepict::noMargin
@ noMargin
Definition depict.h:55
OpenBabel::OBDepict::noWedgeHashGen
@ noWedgeHashGen
Definition depict.h:58
OpenBabel::OBDepict::drawTermC
@ drawTermC
Definition depict.h:56
OpenBabel::OBDepict::asymmetricDoubleBond
@ asymmetricDoubleBond
Definition depict.h:59
OpenBabel::OBDepict::drawAllC
@ drawAllC
Definition depict.h:57
OpenBabel::OBDepict::internalColor
@ internalColor
Definition depict.h:54
OpenBabel::OBDepict::OBDepict
OBDepict(OBPainter *painter)
Definition depict.cpp:116
OpenBabel::OBMol
Molecule Class.
Definition mol.h:121
OpenBabel::OBPainter
Abstract painter base class used by OBDepict.
Definition painter.h:129
OpenBabel
Global namespace for all Open Babel code.
Definition alias.h:23
vector3.h
Handle 3D coordinates.