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
|
#pragma once
#include <vector>
#include "irender.h"
#include "imap.h"
#include "icommandsystem.h"
#include "math/Vector3.h"
#include "render/VertexCb.h"
#include "RenderablePointFile.h"
namespace map
{
/// Renderable point trace to identify leak positions
class PointFile
{
// Vector of point coordinates
std::vector<VertexCb> _points;
// Holds the current position in the point file chain
std::size_t _curPos;
RenderablePointFile _renderable;
public:
// Constructor
PointFile();
// Destructor
virtual ~PointFile();
// Query whether the point path is currently visible
bool isVisible() const;
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
|