1 /*************************************************************************
2 ** TpicSpecialHandler.h                                                 **
3 **                                                                      **
4 ** This file is part of dvisvgm -- the DVI to SVG converter             **
5 ** Copyright (C) 2005-2015 Martin Gieseking <martin.gieseking@uos.de>   **
6 **                                                                      **
7 ** This program is free software; you can redistribute it and/or        **
8 ** modify it under the terms of the GNU General Public License as       **
9 ** published by the Free Software Foundation; either version 3 of       **
10 ** the License, or (at your option) any later version.                  **
11 **                                                                      **
12 ** This program is distributed in the hope that it will be useful, but  **
13 ** WITHOUT ANY WARRANTY; without even the implied warranty of           **
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         **
15 ** GNU General Public License for more details.                         **
16 **                                                                      **
17 ** You should have received a copy of the GNU General Public License    **
18 ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
19 *************************************************************************/
20 
21 #ifndef DVISVGM_TPICSPECIALHANDLER_H
22 #define DVISVGM_TPICSPECIALHANDLER_H
23 
24 #include <list>
25 #include "Pair.h"
26 #include "SpecialHandler.h"
27 
28 class TpicSpecialHandler : public SpecialHandler, public DVIEndPageListener
29 {
30 	public:
31 		TpicSpecialHandler ();
info()32 		const char* info () const   {return "TPIC specials";}
name()33 		const char* name () const   {return "tpic";}
34 		const char** prefixes () const;
35 		bool process (const char *prefix, std::istream &is, SpecialActions *actions);
36 
37 	protected:
38 		void dviEndPage (unsigned pageno);
39 		void reset ();
40 		void drawLines (bool stroke, bool fill, double ddist, SpecialActions *actions);
41 		void drawSplines (double ddist, SpecialActions *actions);
42 		void drawArc (double cx, double cy, double rx, double ry, double angle1, double angle2, SpecialActions *actions);
43 
44 	private:
45 		double _penwidth; ///< pen width in PS point units
46 		double _fill;     ///< fill intensity [0,1]; if < 0, we don't fill anything
47 		std::vector<DPair> _points;
48 };
49 
50 #endif
51