00001
00002
00003
00004
00005 #ifndef BALL_VIEW_RENDERING_TILINGRENDERER_H
00006 #define BALL_VIEW_RENDERING_TILINGRENDERER_H
00007
00008 #ifndef BALL_VIEW_RENDERING_RENDERER_H
00009 # include <BALL/VIEW/RENDERING/renderer.h>
00010 #endif
00011
00012 #ifndef BALL_VIEW_RENDERING_RENDERTARGET_H
00013 # include <BALL/VIEW/RENDERING/renderTarget.h>
00014 #endif
00015
00016 namespace BALL
00017 {
00018 namespace VIEW
00019 {
00031 class BALL_VIEW_EXPORT TilingRenderer
00032 : public Renderer
00033 {
00034 public:
00035
00039
00048 TilingRenderer(Renderer* real_renderer, Size final_width, Size final_height, Size border = 0);
00049
00052 TilingRenderer(const TilingRenderer& renderer);
00053
00056 virtual ~TilingRenderer() {}
00057
00059 virtual void setLights(bool reset_all = false);
00060
00063 virtual void updateCamera(const Camera* camera = 0);
00064
00066 virtual void updateBackgroundColor();
00067
00069 virtual bool finish();
00070
00074 virtual Vector3 mapViewportTo3D(Position x, Position y);
00075
00079 virtual Vector2 map3DToViewport(const Vector3& vec);
00080
00082
00085
00088 virtual bool renderOneRepresentation(const Representation& representation);
00089
00092 virtual void bufferRepresentation(const Representation& rep);
00093
00096 virtual void removeRepresentation(const Representation& rep);
00097
00099 virtual void setSize(float width, float height);
00100
00108 virtual void renderRuler();
00109
00111
00114
00116 virtual void renderToBuffer(RenderTarget* target);
00117
00119 virtual void render_(const GeometricObject* object);
00120
00121 protected:
00122 void computeTilingSetup_();
00123
00125 Renderer* real_renderer_;
00126
00128 Size final_width_;
00129
00131 Size final_height_;
00132
00134 Size border_;
00135
00136 Size num_cols_;
00137 Size num_rows_;
00138 };
00139 }
00140 }
00141 #endif // BALL_VIEW_RENDERING_TILINGRENDERER_H
00142