diff -r 180072db4a83 -r a39f454a3d7f src/inputvertices.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/inputvertices.h Sun Jul 03 20:18:34 2022 +0300 @@ -0,0 +1,39 @@ +#pragma once +#include "src/basics.h" + +class InputVertices +{ + std::vector polygon = {origin}; + std::size_t numpoints = 1; +public: + bool currentPointOnExistingPoint() const; + std::size_t calcNumPoints() const; + void updateCurrentPoint(const glm::vec3& p); + void removeLastPoint(); + void finishCurrentPoint(); + void clear(); + const glm::vec3& operator[](std::size_t i) const + { + return this->polygon[i]; + } + std::size_t bufferSize() const + { + return this->polygon.size(); + } + std::size_t polygonSize() const + { + return this->numpoints; + } + auto begin() const + { + return std::begin(this->polygon); + } + auto end() const + { + return std::end(this->polygon); + } + auto polygonEnd() const + { + return std::begin(this->polygon) + static_cast(this->numpoints); + } +};