55 std::vector<std::pair<size_t, size_t>>
edges;
85 void move(
size_t ind,
const glm::vec2 &mouse_pos);
99 void add(
const glm::vec2 &mouse_pos);
A piece of dirt for dirtying the caches.
Model of the high- and low-dimensional landmarks.
size_t n_landmarks() const
Reurns number of the 2D landmarks.
void duplicate(size_t ind)
Creates new landmark with the same two- and high-dimensional coordinates as the given landmark.
void move(size_t ind, const glm::vec2 &mouse_pos)
Sets two-dimensional position of the pressed landmark to mouse position.
void add(const glm::vec2 &mouse_pos)
Creates new landmark with the two- and high-dimensional coordinates as the closeset landmark.
std::vector< glm::vec2 > lodim_vertices
Array storing two-dimensional landmark coordinates.
std::vector< float > hidim_vertices
One-dimensional array storing d-dimensional landmark coordinates in row-major order.
std::vector< float > edge_lengths
Lengths of all edges.
size_t closest_landmark(const glm::vec2 &mouse_pos) const
Counts closest landmark to the given position.
LandmarkModel()
Creates empty landmarks with dimension 0.
void update_dim(size_t dim)
Updates current dimension and calls init_grid().
void remove(size_t ind)
Removes landmark and corresponding edges.
void init_grid(size_t side)
Creates squared landmarks layout, without edges.
std::vector< std::pair< size_t, size_t > > edges
Array of vertex ID pairs.