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