forked from mrkite/minutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeneratedstructure.h
36 lines (27 loc) · 1.02 KB
/
generatedstructure.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/** Copyright 2014 Rian Shelley */
#ifndef GENERATEDSTRUCTURE_H_
#define GENERATEDSTRUCTURE_H_
#include <QSharedPointer>
#include <QString>
#include "./overlayitem.h"
class Tag;
class QColor;
class GeneratedStructure: public OverlayItem {
public:
static QList<QSharedPointer<GeneratedStructure>> tryParseDatFile(const Tag* tag);
static QList<QSharedPointer<GeneratedStructure>> tryParseChunk(const Tag* tag);
static QList<QSharedPointer<GeneratedStructure>> tryParseFeatures(QVariant &maybeFeatureMap);
virtual bool intersects(const Point& min, const Point& max) const;
virtual void draw(double offsetX, double offsetZ, double scale,
QPainter *canvas) const;
virtual Point midpoint() const;
protected:
GeneratedStructure() {}
// these are used to draw a rounded rect. If you want to draw something
// else, override draw()
void setBounds(const Point& min, const Point& max) {p1 = min; p2 = max;}
static const int RADIUS = 10;
private:
Point p1, p2;
};
#endif // GENERATEDSTRUCTURE_H_