1 /*
2  * pen_fill.cc -- ePiX::pen_fill class, for filled screen elements
3  *
4  * This file is part of ePiX, a C++ library for creating high-quality
5  * figures in LaTeX
6  *
7  * Version 1.1.11
8  * Last Change: August 12, 2007
9  */
10 
11 /*
12  * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
13  * Andrew D. Hwang <rot 13 nujnat at zngupf dot ubylpebff dot rqh>
14  * Department of Mathematics and Computer Science
15  * College of the Holy Cross
16  * Worcester, MA, 01610-2395, USA
17  */
18 
19 /*
20  * ePiX is free software; you can redistribute it and/or modify it
21  * under the terms of the GNU General Public License as published by
22  * the Free Software Foundation; either version 2 of the License, or
23  * (at your option) any later version.
24  *
25  * ePiX is distributed in the hope that it will be useful, but WITHOUT
26  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
28  * License for more details.
29  *
30  * You should have received a copy of the GNU General Public License
31  * along with ePiX; if not, write to the Free Software Foundation, Inc.,
32  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef EPIX_PEN_FILL
36 #define EPIX_PEN_FILL
37 
38 #include <list>
39 #include <string>
40 
41 #include "edge_data.h"
42 
43 #include "Color.h"
44 #include "path_style.h"
45 #include "tile.h"
46 
47 namespace ePiX {
48 
49   class length;
50   class screen_mask;
51 
52   class pen_fill : public tile {
53   public:
54     pen_fill();
55 
56     pen_fill(const Color&, const pen_data&, const std::list<edge2d>&);
57 
58     pen_fill(const Color&, const pen_data&, double theta,
59 	     const std::list<edge2d>&);
60 
61     pen_fill* clone() const;
62 
63     pen_fill& map_by(const affine&);
64     pen_fill& crop_to(const screen_mask&);
65 
66     bool is_empty() const;
67 
68     std::string print_to(const format&, const std::string&) const;
69     void add_to_palette() const;
70 
71   private:
72     Color    m_tint;
73     pen_data m_line;
74 
75     path_state m_style;
76 
77     std::list<edge2d> m_border; // filled boundary (loop)
78     std::list<edge2d> m_edges;  // visible boundary (path)
79   }; // end of class pen_fill
80 
81 } // end of namespace
82 
83 #endif /* EPIX_PEN_FILL */
84