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 PERSPECTIVE_TRANSFORMER_H 9fb07ece0SStephan Aßmus #define PERSPECTIVE_TRANSFORMER_H 10fb07ece0SStephan Aßmus 11325a6253SAxel Dörfler 12325a6253SAxel Dörfler #include "Transformer.h" 13325a6253SAxel Dörfler 14fb07ece0SStephan Aßmus #include <agg_conv_transform.h> 15fb07ece0SStephan Aßmus #include <agg_trans_perspective.h> 16fb07ece0SStephan Aßmus 17325a6253SAxel Dörfler 18325a6253SAxel Dörfler namespace BPrivate { 19325a6253SAxel Dörfler namespace Icon { 20fb07ece0SStephan Aßmus 21fb07ece0SStephan Aßmus typedef agg::conv_transform<VertexSource, 22fb07ece0SStephan Aßmus agg::trans_perspective> Perspective; 23fb07ece0SStephan Aßmus 24fb07ece0SStephan Aßmus class PerspectiveTransformer : public Transformer, 25fb07ece0SStephan Aßmus public Perspective, 26fb07ece0SStephan Aßmus public agg::trans_perspective { 27fb07ece0SStephan Aßmus public: 28fb07ece0SStephan Aßmus enum { 29fb07ece0SStephan Aßmus archive_code = 'prsp', 30fb07ece0SStephan Aßmus }; 31fb07ece0SStephan Aßmus 32fb07ece0SStephan Aßmus PerspectiveTransformer( 33fb07ece0SStephan Aßmus VertexSource& source); 34fb07ece0SStephan Aßmus PerspectiveTransformer( 35fb07ece0SStephan Aßmus VertexSource& source, 36fb07ece0SStephan Aßmus BMessage* archive); 37*8b8d44bfSMichael Lotz 38fb07ece0SStephan Aßmus virtual ~PerspectiveTransformer(); 39fb07ece0SStephan Aßmus 40fb07ece0SStephan Aßmus // Transformer interface 41fb07ece0SStephan Aßmus virtual Transformer* Clone(VertexSource& source) const; 42fb07ece0SStephan Aßmus 43fb07ece0SStephan Aßmus virtual void rewind(unsigned path_id); 44fb07ece0SStephan Aßmus virtual unsigned vertex(double* x, double* y); 45fb07ece0SStephan Aßmus 46fb07ece0SStephan Aßmus virtual void SetSource(VertexSource& source); 47fb07ece0SStephan Aßmus 48fb07ece0SStephan Aßmus virtual double ApproximationScale() const; 49fb07ece0SStephan Aßmus 50fb07ece0SStephan Aßmus #ifdef ICON_O_MATIC 51fb07ece0SStephan Aßmus // IconObject interface 52fb07ece0SStephan Aßmus virtual status_t Archive(BMessage* into, 53fb07ece0SStephan Aßmus bool deep = true) const; 54fb07ece0SStephan Aßmus 55fb07ece0SStephan Aßmus #endif 56fb07ece0SStephan Aßmus }; 57fb07ece0SStephan Aßmus 58325a6253SAxel Dörfler } // namespace Icon 59325a6253SAxel Dörfler } // namespace BPrivate 60325a6253SAxel Dörfler 61fb07ece0SStephan Aßmus #endif // PERSPECTIVE_TRANSFORMER_H 62