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