exceptions.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdexcept>
4
5namespace visionx::voxelgrid
6{
8}
9
11{
12
13 /**
14 * @brief Base class for exceptions in this library.
15 */
16 class VoxelGridError : public std::runtime_error
17 {
18 public:
19 using std::runtime_error::runtime_error;
20 };
21
22 /**
23 * @brief Indicates that voxel data with an invalid number of voxels
24 * has been passed to a VoxelGrid.
25 */
27 {
28 public:
29 InvalidVoxelDataSize(std::size_t actual, std::size_t expected);
30
31 private:
32 std::string makeMsg(std::size_t actual, std::size_t expected);
33 };
34
35 /**
36 * @brief Indicates that a voxel grid structure should have matched
37 * another one, but did not.
38 */
40 {
41 public:
43 const VoxelGridStructure& actual,
44 const std::string& message = "Voxel grid structure does not match.");
45
46 private:
47 std::string makeMsg(const VoxelGridStructure& expected,
48 const VoxelGridStructure& actual,
49 const std::string& message);
50 };
51
52
53} // namespace visionx::voxelgrid::error
Geometric structure of a 3D voxel grid.
InvalidStructure(const VoxelGridStructure &expected, const VoxelGridStructure &actual, const std::string &message="Voxel grid structure does not match.")
InvalidVoxelDataSize(std::size_t actual, std::size_t expected)
Base class for exceptions in this library.
Definition exceptions.h:17