PMDCollector.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libpagemaker project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef __PMDCOLLECTOR_H__
11#define __PMDCOLLECTOR_H__
12
13#include <memory>
14#include <vector>
15
16#include <boost/optional.hpp>
17
18#include "PMDPage.h"
19#include "PMDTypes.h"
20#include "Units.h"
21#include "geometry.h"
22
23namespace libpagemaker
24{
25
26class OutputShape;
27class PMDLineSet;
28
37{
38 typedef std::vector<std::shared_ptr<const OutputShape> > PageShapes_t;
39 typedef std::vector<PageShapes_t> PageShapesList_t;
40
41 /*
42 * Height and width in PMD page units.
43 * One PMD page unit is 1/20 of a point (1/720 inch)
44 */
45 boost::optional<PMDShapeUnit> m_pageWidth;
46 boost::optional<PMDShapeUnit> m_pageHeight;
47
48 std::vector<PMDPage> m_pages;
49 std::vector<PMDColor> m_color;
50 std::vector<PMDFont> m_font;
52
53 void writePage(const PMDPage &,
54 librevenge::RVNGDrawingInterface *,
55 const std::vector<std::shared_ptr<const OutputShape> > &) const;
56
57 void paintShape(const OutputShape &shape,
58 librevenge::RVNGDrawingInterface *) const;
59
62 void fillOutputShapesByPage(PageShapesList_t &pageShapes) const;
63public:
65
66 /* State-mutating functions */
69 void setDoubleSided(bool);
70 void addShapeToPage(unsigned pageID, const std::shared_ptr<PMDLineSet> &shape);
71 void addColor(const PMDColor &color);
72 void addFont(const PMDFont &font);
73
74 unsigned addPage();
75
76 /* Output functions */
77 void draw(librevenge::RVNGDrawingInterface *) const;
78};
79
80}
81
82#endif /* __PMDCOLLECTOR_H__ */
83/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition OutputShape.h:27
void paintShape(const OutputShape &shape, librevenge::RVNGDrawingInterface *) const
Definition PMDCollector.cpp:180
std::vector< PMDColor > m_color
Definition PMDCollector.h:49
boost::optional< PMDShapeUnit > m_pageWidth
Definition PMDCollector.h:45
std::vector< PMDFont > m_font
Definition PMDCollector.h:50
void setPageHeight(PMDShapeUnit)
Definition PMDCollector.cpp:154
void addShapeToPage(unsigned pageID, const std::shared_ptr< PMDLineSet > &shape)
Definition PMDCollector.cpp:175
bool m_doubleSided
Definition PMDCollector.h:51
std::vector< PageShapes_t > PageShapesList_t
Definition PMDCollector.h:39
void fillOutputShapesByPage_OneSided(PageShapesList_t &pageShapes) const
Definition PMDCollector.cpp:684
void fillOutputShapesByPage_TwoSided(PageShapesList_t &pageShapes) const
Definition PMDCollector.cpp:647
void setDoubleSided(bool)
Definition PMDCollector.cpp:143
void addColor(const PMDColor &color)
Definition PMDCollector.cpp:165
void addFont(const PMDFont &font)
Definition PMDCollector.cpp:170
void draw(librevenge::RVNGDrawingInterface *) const
Definition PMDCollector.cpp:712
boost::optional< PMDShapeUnit > m_pageHeight
Definition PMDCollector.h:46
void writePage(const PMDPage &, librevenge::RVNGDrawingInterface *, const std::vector< std::shared_ptr< const OutputShape > > &) const
Definition PMDCollector.cpp:624
void fillOutputShapesByPage(PageShapesList_t &pageShapes) const
Definition PMDCollector.cpp:703
PMDCollector()
Definition PMDCollector.cpp:138
unsigned addPage()
Definition PMDCollector.cpp:159
void setPageWidth(PMDShapeUnit)
Definition PMDCollector.cpp:149
std::vector< std::shared_ptr< const OutputShape > > PageShapes_t
Definition PMDCollector.h:38
std::vector< PMDPage > m_pages
Definition PMDCollector.h:48
Definition geometry.h:53
Definition PMDPage.h:24
Definition geometry.h:25
LengthUnit< SHAPE_UNITS_PER_INCH > PMDShapeUnit
Definition Units.h:59
Definition PMDTypes.h:24
Definition PMDTypes.h:36

Generated for libpagemaker by doxygen 1.18.0