Chemical Data Processing Library C++ API - Version 1.1.1
ImageWriter.hpp
Go to the documentation of this file.
1 /*
2  * ImageWriter.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
24 
25 #ifndef CDPL_VIS_IMAGEWRITER_HPP
26 #define CDPL_VIS_IMAGEWRITER_HPP
27 
28 #include <memory>
29 
30 #include "CDPL/Vis/APIPrefix.hpp"
31 
32 
33 typedef struct _cairo_surface cairo_surface_t;
34 
35 
36 namespace CDPL
37 {
38 
39  namespace Base
40  {
41 
42  class DataIOBase;
43  }
44 
45  namespace Chem
46  {
47 
48  class Reaction;
49  class MolecularGraph;
50  } // namespace Chem
51 
52  namespace Vis
53  {
54 
55  class View2D;
56  class ReactionView2D;
57  class StructureView2D;
58  class Rectangle2D;
59 
61  {
62 
63  protected:
64  ImageWriter(const Base::DataIOBase& io_base);
65 
66  virtual ~ImageWriter();
67 
70 
71  virtual cairo_surface_t* createCairoSurface(double, double) const = 0;
72  virtual cairo_surface_t* createCairoSurface() const = 0;
73 
74  private:
75  ImageWriter(const ImageWriter&);
76 
77  cairo_surface_t* renderImage(View2D&) const;
78 
79  void getImageBounds(View2D&, Rectangle2D&) const;
80 
81  ImageWriter& operator=(const ImageWriter&);
82 
83  typedef std::unique_ptr<StructureView2D> StructureViewPtr;
84  typedef std::unique_ptr<ReactionView2D> ReactionViewPtr;
85 
86  const Base::DataIOBase& ioBase;
87  StructureViewPtr structureView;
88  ReactionViewPtr reactionView;
89  };
90  } // namespace Vis
91 } // namespace CDPL
92 
93 #endif // CDPL_VIS_IMAGEWRITER_HPP
CDPL::Vis::ImageWriter::createCairoSurface
virtual cairo_surface_t * createCairoSurface() const =0
CDPL::Vis::View2D
The abstract base of classes implementing the 2D visualization of data objects.
Definition: View2D.hpp:59
CDPL::Vis::ImageWriter
Definition: ImageWriter.hpp:61
CDPL::Vis::ImageWriter::renderReactionImage
cairo_surface_t * renderReactionImage(const Chem::Reaction &)
cairo_surface_t
struct _cairo_surface cairo_surface_t
Definition: CairoPointer.hpp:36
CDPL::Base::DataIOBase
Provides infrastructure for the registration of I/O callback functions.
Definition: DataIOBase.hpp:59
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
CDPL::Vis::ImageWriter::renderMolGraphImage
cairo_surface_t * renderMolGraphImage(const Chem::MolecularGraph &)
CDPL_VIS_API
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::Reaction
Reaction.
Definition: Reaction.hpp:52
CDPL::Vis::Rectangle2D
Specifies an axis aligned rectangular area in 2D space.
Definition: Rectangle2D.hpp:51
CDPL::Vis::ImageWriter::~ImageWriter
virtual ~ImageWriter()
APIPrefix.hpp
Definition of the preprocessor macro CDPL_VIS_API.
CDPL::Vis::ImageWriter::ImageWriter
ImageWriter(const Base::DataIOBase &io_base)
CDPL::Vis::ImageWriter::createCairoSurface
virtual cairo_surface_t * createCairoSurface(double, double) const =0