#ifndef LANDED_PROJECTION
#define LANDED_PROJECTION

#include <QObject>
#include <QWidget>
#include <QPixmap>

#include "viewerbase.hh"

#include <vector>

typedef std::vector<Shape> ShapeCollection;
typedef ShapeCollection::size_type ShapeIndex;

class Projection : public QWidget, public ViewerBase
{
Q_OBJECT

public:
  typedef int Type;
  const static Type XY=0;
  const static Type XZ=1;
  const static Type YZ=2;

public:
  Projection(QWidget*, Type);

 private:
  Type type_;
  ShapeCollection shapes_;
  QPixmap pixmap_;
  double hmin_, hmax_, hstep_;
  double vmin_, vmax_, vstep_;
  double scale_;
  QRect rect_;

 public:
  //manage shapes
  void addShape(const Shape&);
  const Shape& shape(std::vector<Shape>::size_type) const;
  std::vector<Shape>::size_type numShapes(void) const;
  void clearShapes(void);
  //update display
  void refresh(void);
  //auto scaling
  void autoScale(void);
  //zoom in
  void zoomIn(void);
  //and out
  void zoomOut(void);
  //move
  void move(int, int);

 private:
  //draw to pixmap
  void draw(void);
  //virtual function overrides
  void paintEvent(QPaintEvent*);
  void resizeEvent(QResizeEvent*);

};

#endif //ifndef LANDED_PROJECTION
