Loading...
Searching...
No Matches
commandpainter.h
Go to the documentation of this file.
/**********************************************************************
commandpainter.h - Render as depiction commands
Copyright (C) 2012 by Noel O'Boyle
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_COMMANDPAINTER_H
#define OB_COMMANDPAINTER_H
#include <openbabel/depict/painter.h>
namespace OpenBabel
{
class CommandPainter : public OBPainter
{
public:
CommandPainter(std::ostream& ofs);
~CommandPainter();
void NewCanvas(double width, double height);
bool IsGood() const;
void SetFontFamily(const std::string &fontFamily) {} // FIXME
void SetFontSize(int pointSize);
void SetFillColor(const OBColor &color);
void SetFillRadial(const OBColor &start, const OBColor &end);
void SetPenColor(const OBColor &color);
void SetPenWidth(double width);
double GetPenWidth();
void DrawLine(double x1, double y1, double x2, double y2, const std::vector<double> & dashes=std::vector<double>());
void DrawPolygon(const std::vector<std::pair<double,double> > &points);
void DrawCircle(double x, double y, double r);
void DrawBall(double x, double y, double r, double opacity = 1.0);
void DrawText(double x, double y, const std::string &text);
OBFontMetrics GetFontMetrics(const std::string &text);
private:
std::ostream& m_ofs;
std::streamsize m_oldprec;
double m_pen_width;
};
}
#endif
OpenBabel::CommandPainter::IsGood
bool IsGood() const
Definition commandpainter.cpp:45
OpenBabel::CommandPainter::GetPenWidth
double GetPenWidth()
Definition commandpainter.cpp:78
OpenBabel::CommandPainter::CommandPainter
CommandPainter(std::ostream &ofs)
Definition commandpainter.cpp:28
OpenBabel::CommandPainter::GetFontMetrics
OBFontMetrics GetFontMetrics(const std::string &text)
Definition commandpainter.cpp:125
OpenBabel::CommandPainter::SetFillRadial
void SetFillRadial(const OBColor &start, const OBColor &end)
Definition commandpainter.cpp:60
OpenBabel::CommandPainter::SetPenWidth
void SetPenWidth(double width)
Definition commandpainter.cpp:72
OpenBabel::CommandPainter::NewCanvas
void NewCanvas(double width, double height)
Definition commandpainter.cpp:40
OpenBabel::CommandPainter::~CommandPainter
~CommandPainter()
Definition commandpainter.cpp:34
OpenBabel::CommandPainter::SetFontSize
void SetFontSize(int pointSize)
Definition commandpainter.cpp:50
OpenBabel::CommandPainter::DrawText
void DrawText(double x, double y, const std::string &text)
Definition commandpainter.cpp:120
OpenBabel::CommandPainter::SetFontFamily
void SetFontFamily(const std::string &fontFamily)
Definition commandpainter.h:34
OpenBabel::CommandPainter::SetFillColor
void SetFillColor(const OBColor &color)
Definition commandpainter.cpp:55
OpenBabel::CommandPainter::SetPenColor
void SetPenColor(const OBColor &color)
Definition commandpainter.cpp:67
OpenBabel::CommandPainter::DrawLine
void DrawLine(double x1, double y1, double x2, double y2, const std::vector< double > &dashes=std::vector< double >())
Definition commandpainter.cpp:83
OpenBabel::CommandPainter::DrawBall
void DrawBall(double x, double y, double r, double opacity=1.0)
Definition commandpainter.cpp:115
OpenBabel::CommandPainter::DrawPolygon
void DrawPolygon(const std::vector< std::pair< double, double > > &points)
Definition commandpainter.cpp:98
OpenBabel::CommandPainter::DrawCircle
void DrawCircle(double x, double y, double r)
Definition commandpainter.cpp:110
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
painter.h
Base class for graphical 2D depiction classes (e.g., "paint" to SVG).
OpenBabel::OBColor
Color class used by OBDepict.
Definition painter.h:38
OpenBabel::OBFontMetrics
Font metrics class used by OBDepict.
Definition painter.h:117