Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* SelectionBoundingBox.cpp
*
* Created on: May 17, 2017
* Author: Norbert Podhorszki pnorbert@ornl.gov
* William F Godoy godoywf@ornl.gov
*
*/
#include "SelectionBoundingBox.h"
/// \cond EXCLUDE_FROM_DOXYGEN
#include <stdexcept>
/// \endcond
#include "adios2/helper/adiosFunctions.h" //Uint64VectorToSizetVector
namespace adios
{
// SelectionBoundingBox::SelectionBoundingBox(const std::vector<uint64_t> start,
// const std::vector<uint64_t> count,
// const bool debugMode)
//: Selection(SelectionType::BoundingBox, debugMode),
// m_Start(Uint64VectorToSizetVector(start)),
// m_Count(Uint64VectorToSizetVector(count))
//{
// if (m_DebugMode == true)
// {
// CheckBoundingBox();
// }
//}
SelectionBoundingBox::SelectionBoundingBox(const Dims start, const Dims count,
const bool debugMode)
: Selection(SelectionType::BoundingBox, debugMode), m_Start(start),
m_Count(count)
{
}
void SelectionBoundingBox::CheckBoundingBox()
{
if (m_DebugMode == true)
{
auto lf_Throw = [](const std::string &message) {
throw std::invalid_argument(
"ERROR: " + message +
", in call to SelectionBoundingBox constructor\n");
};
if (m_Start.size() != m_Count.size())
{
lf_Throw("start and count must have the same size");
}
if (m_Start.empty())
{
lf_Throw("start is empty");
}
if (m_Count.empty())
{
lf_Throw("count is empty");
}
}
}
} // end namespace adios