exceptions.cpp
Go to the documentation of this file.
1 #include "exceptions.h"
2 
3 #include <sstream>
4 
5 #include "VoxelGridStructure.h"
6 
7 
9 {
10 
11  InvalidVoxelDataSize::InvalidVoxelDataSize(std::size_t actual, std::size_t expected) :
12  VoxelGridError(makeMsg(actual, expected))
13  {}
14 
15  std::string InvalidVoxelDataSize::makeMsg(std::size_t actual, std::size_t expected)
16  {
17  std::stringstream ss;
18  ss << "Provided voxel data (" << actual << " voxels) "
19  << "does not match structure (" << expected << " voxels).";
20  return ss.str();
21  }
22 
23 
25  const VoxelGridStructure& expected, const VoxelGridStructure& actual,
26  const std::string& message) :
27  VoxelGridError(makeMsg(expected, actual, message))
28  {}
29 
30  std::string InvalidStructure::makeMsg(
31  const VoxelGridStructure& expected, const VoxelGridStructure& actual,
32  const std::string& message)
33  {
34  std::stringstream ss;
35  ss << message << "\n"
36  << " Expected: \n" << expected << "\n"
37  << " but was : \n" << actual;
38  return ss.str();
39  }
40 
41 }
42 
43 
exceptions.h
visionx::voxelgrid::error::InvalidStructure::InvalidStructure
InvalidStructure(const VoxelGridStructure &expected, const VoxelGridStructure &actual, const std::string &message="Voxel grid structure does not match.")
Definition: exceptions.cpp:24
VoxelGridStructure.h
visionx::voxelgrid::error
Definition: exceptions.cpp:8
message
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
Definition: CMakeLists.txt:8
visionx::voxelgrid::error::InvalidVoxelDataSize::InvalidVoxelDataSize
InvalidVoxelDataSize(std::size_t actual, std::size_t expected)
Definition: exceptions.cpp:11
visionx::voxelgrid::VoxelGridStructure
Geometric structure of a 3D voxel grid.
Definition: VoxelGridStructure.h:96
visionx::voxelgrid::error::VoxelGridError
Base class for exceptions in this library.
Definition: exceptions.h:18