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