Maze Builder Docs 7.5.6
Loading...
Searching...
No Matches
grid_operations.h
Go to the documentation of this file.
1#ifndef GRID_OPERATIONS_H
2#define GRID_OPERATIONS_H
3
4#include <MazeBuilder/cell.h>
5#include <MazeBuilder/enums.h>
6
7#include <memory>
8#include <tuple>
9#include <vector>
10
11namespace mazes
12{
13
18 {
19
20 public:
22 virtual ~grid_operations() = default;
23
26 virtual std::tuple<unsigned int, unsigned int, unsigned int> get_dimensions() const noexcept = 0;
27
32 virtual std::shared_ptr<cell> get_neighbor(std::shared_ptr<cell> const &c, Direction dir) const noexcept = 0;
33
37 virtual std::vector<std::shared_ptr<cell>> get_neighbors(std::shared_ptr<cell> const &c) const noexcept = 0;
38
44 virtual void set_neighbor(const std::shared_ptr<cell> &c, Direction dir, std::shared_ptr<cell> const &neighbor) noexcept = 0;
45
46 // Convenience methods for accessing neighbors
47 virtual std::shared_ptr<cell> get_north(const std::shared_ptr<cell> &c) const noexcept = 0;
48 virtual std::shared_ptr<cell> get_south(const std::shared_ptr<cell> &c) const noexcept = 0;
49 virtual std::shared_ptr<cell> get_east(const std::shared_ptr<cell> &c) const noexcept = 0;
50 virtual std::shared_ptr<cell> get_west(const std::shared_ptr<cell> &c) const noexcept = 0;
51
55 virtual std::shared_ptr<cell> search(int index) const noexcept = 0;
56
59 virtual int num_cells() const noexcept = 0;
60
62 virtual void clear_cells() noexcept = 0;
63
64 virtual void set_str(std::string const &str) noexcept = 0;
65
66 virtual std::string get_str() const noexcept = 0;
67
70 virtual std::vector<std::tuple<int, int, int, int>> get_vertices() const noexcept = 0;
71
74 virtual void set_vertices(const std::vector<std::tuple<int, int, int, int>> &vertices) noexcept = 0;
75
78 virtual std::vector<std::vector<std::uint32_t>> get_faces() const noexcept = 0;
79
82 virtual void set_faces(const std::vector<std::vector<std::uint32_t>> &faces) noexcept = 0;
83 };
84
85} // namespace mazes
86
87#endif // GRID_OPERATIONS_H
Cell class with links to other cells.
Definition cell.h:19
Interface for grid navigation and manipulation operations.
Definition grid_operations.h:18
virtual std::shared_ptr< cell > get_neighbor(std::shared_ptr< cell > const &c, Direction dir) const noexcept=0
Get neighbor by the cell's respective location.
virtual int num_cells() const noexcept=0
Get the count of cells in the grid.
virtual std::vector< std::shared_ptr< cell > > get_neighbors(std::shared_ptr< cell > const &c) const noexcept=0
Get all the neighbors by the cell.
virtual std::vector< std::tuple< int, int, int, int > > get_vertices() const noexcept=0
Get the vertices for wavefront object file generation.
virtual std::tuple< unsigned int, unsigned int, unsigned int > get_dimensions() const noexcept=0
Retrieves the dimensions as a tuple of three unsigned integers.
virtual std::vector< std::vector< std::uint32_t > > get_faces() const noexcept=0
Get the faces for wavefront object file generation.
virtual void clear_cells() noexcept=0
Cleanup cells by cleaning up links within cells.
virtual void set_vertices(const std::vector< std::tuple< int, int, int, int > > &vertices) noexcept=0
Set the vertices for wavefront object file generation.
virtual ~grid_operations()=default
Destroys the grid_operations object and releases any associated resources.
virtual void set_neighbor(const std::shared_ptr< cell > &c, Direction dir, std::shared_ptr< cell > const &neighbor) noexcept=0
Set neighbor for a cell in a given direction.
virtual std::shared_ptr< cell > search(int index) const noexcept=0
Search for a cell by index.
virtual void set_faces(const std::vector< std::vector< std::uint32_t > > &faces) noexcept=0
Set the faces for wavefront object file generation.
Enumerations and utilities for the maze builder program.
Namespace for the maze builder.
Definition algo_interface.h:6
Direction
Directional neighbors for grid topology.
Definition enums.h:183