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