Blob Blame Raw
#ifndef PERSPECTIVESANDBOXVIEW_H
#define PERSPECTIVESANDBOXVIEW_H

#include "view.h"


class PerspectiveSandBoxView: public View {
public:
	View::PointPtr
		persp_p0,
		persp_px,
		persp_py,
		persp_p1,
		bounds_p0,
		bounds_p1;
	
	Cairo::RefPtr<Cairo::ImageSurface> background;

	PerspectiveSandBoxView();
	
	void update_background(
		const Matrix3 &matrix,
		int width,
		int height );

	void draw_grid(
		const Cairo::RefPtr<Cairo::Context> &context,
		const Matrix &matrix,
		const Color &color );

	void draw_line(
		const Cairo::RefPtr<Cairo::Context> &context,
		const Pair2 &bounds,
		Real a,
		Real b,
		Real c,
		const Color &color );

	void draw_subdivisions(
		const Cairo::RefPtr<Cairo::Context> &context,
		const Matrix &matrix,
		const Pair2 &bounds,
		const Color &color );

	void on_draw_view(const Cairo::RefPtr<Cairo::Context> &context);
};


#endif