xref: /haiku/src/libs/icon/transformer/PathSource.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 PATH_SOURCE_H
9 #define PATH_SOURCE_H
10 
11 
12 #include "IconBuild.h"
13 #include "Transformer.h"
14 
15 #include "agg_path_storage.h"
16 #include "agg_conv_curve.h"
17 
18 
19 _BEGIN_ICON_NAMESPACE
20 
21 
22 template <class Type> class Container;
23 class VectorPath;
24 
25 typedef agg::path_storage					AGGPath;
26 typedef agg::conv_curve<AGGPath>			AGGCurvedPath;
27 
28 class PathSource : public VertexSource {
29  public:
30 									PathSource(Container<VectorPath>* paths);
31 	virtual							~PathSource();
32 
33     virtual	void					rewind(unsigned path_id);
34     virtual	unsigned				vertex(double* x, double* y);
35 
36 	virtual	bool					WantsOpenPaths() const;
37 	virtual	double					ApproximationScale() const;
38 
39 	// PathSource
40 			void					Update(bool leavePathsOpen,
41 										double approximationScale);
42 
43 			void					SetGlobalScale(double scale);
44 
45  private:
46 		 	Container<VectorPath>*	fPaths;
47 		 	AGGPath					fAGGPath;
48 		 	AGGCurvedPath			fAGGCurvedPath;
49 
50 		 	double					fGlobalScale;
51 		 	double					fLastTransformerScale;
52 };
53 
54 
55 _END_ICON_NAMESPACE
56 
57 
58 #endif	// PATH_SOURCE_H
59