xref: /haiku/src/libs/icon/transformer/PathSource.h (revision fb07ece069b8b7ca52eda06449ce2f0460b294ab)
1*fb07ece0SStephan Aßmus /*
2*fb07ece0SStephan Aßmus  * Copyright 2006, Haiku.
3*fb07ece0SStephan Aßmus  * Distributed under the terms of the MIT License.
4*fb07ece0SStephan Aßmus  *
5*fb07ece0SStephan Aßmus  * Authors:
6*fb07ece0SStephan Aßmus  *		Stephan Aßmus <superstippi@gmx.de>
7*fb07ece0SStephan Aßmus  */
8*fb07ece0SStephan Aßmus 
9*fb07ece0SStephan Aßmus #ifndef PATH_SOURCE_H
10*fb07ece0SStephan Aßmus #define PATH_SOURCE_H
11*fb07ece0SStephan Aßmus 
12*fb07ece0SStephan Aßmus #include "Transformer.h"
13*fb07ece0SStephan Aßmus 
14*fb07ece0SStephan Aßmus #include "agg_path_storage.h"
15*fb07ece0SStephan Aßmus #include "agg_conv_curve.h"
16*fb07ece0SStephan Aßmus 
17*fb07ece0SStephan Aßmus class PathContainer;
18*fb07ece0SStephan Aßmus class VectorPath;
19*fb07ece0SStephan Aßmus 
20*fb07ece0SStephan Aßmus typedef agg::path_storage					AGGPath;
21*fb07ece0SStephan Aßmus typedef agg::conv_curve<AGGPath>			AGGCurvedPath;
22*fb07ece0SStephan Aßmus 
23*fb07ece0SStephan Aßmus class PathSource : public VertexSource {
24*fb07ece0SStephan Aßmus  public:
25*fb07ece0SStephan Aßmus 								PathSource(PathContainer* paths);
26*fb07ece0SStephan Aßmus 	virtual						~PathSource();
27*fb07ece0SStephan Aßmus 
28*fb07ece0SStephan Aßmus     virtual	void				rewind(unsigned path_id);
29*fb07ece0SStephan Aßmus     virtual	unsigned			vertex(double* x, double* y);
30*fb07ece0SStephan Aßmus 
31*fb07ece0SStephan Aßmus 	virtual	bool				WantsOpenPaths() const;
32*fb07ece0SStephan Aßmus 	virtual	double				ApproximationScale() const;
33*fb07ece0SStephan Aßmus 
34*fb07ece0SStephan Aßmus 	// PathSource
35*fb07ece0SStephan Aßmus 			void				Update(bool leavePathsOpen,
36*fb07ece0SStephan Aßmus 									   double approximationScale);
37*fb07ece0SStephan Aßmus 
38*fb07ece0SStephan Aßmus  private:
39*fb07ece0SStephan Aßmus 		 	PathContainer*		fPaths;
40*fb07ece0SStephan Aßmus 		 	AGGPath				fAGGPath;
41*fb07ece0SStephan Aßmus 		 	AGGCurvedPath		fAGGCurvedPath;
42*fb07ece0SStephan Aßmus };
43*fb07ece0SStephan Aßmus 
44*fb07ece0SStephan Aßmus #endif // PATH_SOURCE_H
45