xref: /haiku/src/libs/icon/transformer/ContourTransformer.h (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
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 "IconBuild.h"
13 #include "Transformer.h"
14 
15 #include <agg_conv_contour.h>
16 
17 
18 _BEGIN_ICON_NAMESPACE
19 
20 
21 typedef agg::conv_contour<VertexSource>		Contour;
22 
23 class ContourTransformer : public Transformer,
24 						   public Contour {
25  public:
26 	enum {
27 		archive_code	= 'cntr',
28 	};
29 
30 								ContourTransformer(
31 									VertexSource& source);
32 								ContourTransformer(
33 									VertexSource& source,
34 									BMessage* archive);
35 
36 	virtual						~ContourTransformer();
37 
38 	virtual	Transformer*		Clone(VertexSource& source) const;
39 
40 	virtual	void				rewind(unsigned path_id);
41     virtual	unsigned			vertex(double* x, double* y);
42 
43 	virtual	void				SetSource(VertexSource& source);
44 
45 	virtual	double				ApproximationScale() const;
46 
47 #ifdef ICON_O_MATIC
48 	// IconObject interface
49 	virtual	status_t			Archive(BMessage* into,
50 										bool deep = true) const;
51 
52 	virtual	PropertyObject*		MakePropertyObject() const;
53 	virtual	bool				SetToPropertyObject(
54 									const PropertyObject* object);
55 #endif
56 };
57 
58 _END_ICON_NAMESPACE
59 
60 
61 #endif	// CONTOUR_TRANSFORMER_H
62