xref: /haiku/src/libs/icon/transformer/PathSource.h (revision 6427935280aaac0a1a4557bae55184708819560d)
1fb07ece0SStephan Aßmus /*
2325a6253SAxel Dörfler  * Copyright 2006-2007, Haiku.
3fb07ece0SStephan Aßmus  * Distributed under the terms of the MIT License.
4fb07ece0SStephan Aßmus  *
5fb07ece0SStephan Aßmus  * Authors:
6fb07ece0SStephan Aßmus  *		Stephan Aßmus <superstippi@gmx.de>
7fb07ece0SStephan Aßmus  */
8fb07ece0SStephan Aßmus #ifndef PATH_SOURCE_H
9fb07ece0SStephan Aßmus #define PATH_SOURCE_H
10fb07ece0SStephan Aßmus 
11325a6253SAxel Dörfler 
1225dc253dSIngo Weinhold #include "IconBuild.h"
13fb07ece0SStephan Aßmus #include "Transformer.h"
14fb07ece0SStephan Aßmus 
15fb07ece0SStephan Aßmus #include "agg_path_storage.h"
16fb07ece0SStephan Aßmus #include "agg_conv_curve.h"
17fb07ece0SStephan Aßmus 
18325a6253SAxel Dörfler 
1925dc253dSIngo Weinhold _BEGIN_ICON_NAMESPACE
2025dc253dSIngo Weinhold 
21325a6253SAxel Dörfler 
22*64279352SZardshard template <class Type> class Container;
23fb07ece0SStephan Aßmus class VectorPath;
24fb07ece0SStephan Aßmus 
25fb07ece0SStephan Aßmus typedef agg::path_storage					AGGPath;
26fb07ece0SStephan Aßmus typedef agg::conv_curve<AGGPath>			AGGCurvedPath;
27fb07ece0SStephan Aßmus 
28fb07ece0SStephan Aßmus class PathSource : public VertexSource {
29fb07ece0SStephan Aßmus  public:
30*64279352SZardshard 									PathSource(Container<VectorPath>* paths);
31fb07ece0SStephan Aßmus 	virtual							~PathSource();
32fb07ece0SStephan Aßmus 
33fb07ece0SStephan Aßmus     virtual	void					rewind(unsigned path_id);
34fb07ece0SStephan Aßmus     virtual	unsigned				vertex(double* x, double* y);
35fb07ece0SStephan Aßmus 
36fb07ece0SStephan Aßmus 	virtual	bool					WantsOpenPaths() const;
37fb07ece0SStephan Aßmus 	virtual	double					ApproximationScale() const;
38fb07ece0SStephan Aßmus 
39fb07ece0SStephan Aßmus 	// PathSource
40fb07ece0SStephan Aßmus 			void					Update(bool leavePathsOpen,
41fb07ece0SStephan Aßmus 										double approximationScale);
42fb07ece0SStephan Aßmus 
4312a257d7SStephan Aßmus 			void					SetGlobalScale(double scale);
4412a257d7SStephan Aßmus 
45fb07ece0SStephan Aßmus  private:
46*64279352SZardshard 		 	Container<VectorPath>*	fPaths;
47fb07ece0SStephan Aßmus 		 	AGGPath					fAGGPath;
48fb07ece0SStephan Aßmus 		 	AGGCurvedPath			fAGGCurvedPath;
4912a257d7SStephan Aßmus 
5012a257d7SStephan Aßmus 		 	double					fGlobalScale;
5112a257d7SStephan Aßmus 		 	double					fLastTransformerScale;
52fb07ece0SStephan Aßmus };
53fb07ece0SStephan Aßmus 
5425dc253dSIngo Weinhold 
5525dc253dSIngo Weinhold _END_ICON_NAMESPACE
5625dc253dSIngo Weinhold 
57325a6253SAxel Dörfler 
58fb07ece0SStephan Aßmus #endif	// PATH_SOURCE_H
59