xref: /haiku/src/libs/icon/transformer/ContourTransformer.h (revision 3be9edf8da228afd9fec0390f408c964766122aa)
1 /*
2  * Copyright 2006-2007, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 #ifndef CONTOUR_TRANSFORMER_H
9 #define CONTOUR_TRANSFORMER_H
10 
11 
12 #include "Transformer.h"
13 
14 #include <agg_conv_contour.h>
15 
16 
17 namespace BPrivate {
18 namespace Icon {
19 
20 typedef agg::conv_contour<VertexSource>		Contour;
21 
22 class ContourTransformer : public Transformer,
23 						   public Contour {
24  public:
25 	enum {
26 		archive_code	= 'cntr',
27 	};
28 
29 								ContourTransformer(
30 									VertexSource& source);
31 								ContourTransformer(
32 									VertexSource& source,
33 									BMessage* archive);
34 
35 	virtual						~ContourTransformer();
36 
37 	virtual	Transformer*		Clone(VertexSource& source) const;
38 
39 	virtual	void				rewind(unsigned path_id);
40     virtual	unsigned			vertex(double* x, double* y);
41 
42 	virtual	void				SetSource(VertexSource& source);
43 
44 	virtual	double				ApproximationScale() const;
45 
46 #ifdef ICON_O_MATIC
47 	// IconObject interface
48 	virtual	status_t			Archive(BMessage* into,
49 										bool deep = true) const;
50 
51 	virtual	PropertyObject*		MakePropertyObject() const;
52 	virtual	bool				SetToPropertyObject(
53 									const PropertyObject* object);
54 #endif
55 };
56 
57 }	// namespace Icon
58 }	// namespace BPrivate
59 
60 #endif	// CONTOUR_TRANSFORMER_H
61