/
PointFile.h
76 lines (57 loc) · 1.73 KB
/
PointFile.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <vector>
#include "irender.h"
#include "imap.h"
#include "icommandsystem.h"
#include "irenderable.h"
#include "math/Vector3.h"
#include "render.h"
namespace map
{
/// Renderable point trace to identify leak positions
class PointFile: public Renderable
{
// Vector of point coordinates
RenderablePointVector _points;
// Holds the current position in the point file chain
std::size_t _curPos;
// The shader for rendering the line
ShaderPtr _shader;
public:
// Constructor
PointFile();
// Destructor
virtual ~PointFile();
// Query whether the point path is currently visible
bool isVisible() const;
/*
* Solid renderable submission function (front-end)
*/
void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override;
/*
* Wireframe renderable submission function (front-end).
*/
void renderWireframe(RenderableCollector& collector, const VolumeTest& volume) const override;
void setRenderSystem(const RenderSystemPtr& renderSystem) override
{}
std::size_t getHighlightFlags() override
{
return Highlight::NoHighlight;
}
void onMapEvent(IMap::MapEvent ev);
/// Show the specified pointfile, or hide if the path is empty
void show(const fs::path& pointfile);
private:
/**
* greebo: This sets the camera position to the next/prev leak spot.
* @forward: pass true to set to the next leak spot, false for the previous
*/
void advance(bool forward);
// command targets
// Toggles visibility of the point file line
void nextLeakSpot(const cmd::ArgumentList& args);
void prevLeakSpot(const cmd::ArgumentList& args);
// Parse the specified pointfile and read the vectors into the point list
void parse(const fs::path& pointfile);
};
} // namespace map