-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewer.hpp
54 lines (43 loc) · 1.76 KB
/
Viewer.hpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
///////////////////////////////////////////////////////////////////////////////////////////////////
// A simple 3D viewer tailored for our data. This class handles mostly just the window and the
// basic setup while the classes in gl_render actually handle the 3D rendering.
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "GeometryTypes.hpp"
#include "Intersection.hpp"
#include <QGLViewer/qglviewer.h>
class Viewer : public QGLViewer
{
private:
Polyhedron3* P;
void* glP;
QColor edge_color, fill_color;
Skeleton3* S;
void* glS;
double line_weight;
QColor line_color;
Intersection intersection;
void* glI;
QColor i_color, ip_color;
Point3 pt;
double pt_radius = 0;
void* glPt;
QColor pt_color;
public:
static QColor DefaultPolyhedronFillColor;
static QColor DefaultPolyhedronEdgeColor;
static QColor DefaultSkeletonColor;
static QColor DefaultIntersectionColor;
static QColor DefaultIntersectionPlaneColor;
static QColor DefaultPointColor;
Viewer();
~Viewer();
void set_polyhedron(Polyhedron3* p, const QColor& fill_color = DefaultPolyhedronFillColor, const QColor& edge_color = DefaultPolyhedronEdgeColor);
void set_skeleton(Skeleton3* S, const double line_weight = 5.0, const QColor& line_color = DefaultSkeletonColor);
void set_intersection(const Intersection& intersection, const QColor& intersection_color = DefaultIntersectionColor, const QColor& plane_color = DefaultIntersectionPlaneColor);
void set_point(const Point3& pt, const double radius = 1.0, const QColor& color = DefaultPointColor);
protected:
virtual void draw();
virtual void init();
virtual void keyPressEvent(QKeyEvent *e);
};