VAPOR3 3.9.4
QuadTreeRectangleP.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <iostream>
5#pragma once
6
7#include <cstdint>
8#include <vapor/VAssert.h>
9#include <vapor/Grid.h>
10#include <vapor/QuadTreeRectangle.hpp>
11
12using UInt32_tArr2 = std::array<uint32_t, 2>;
14
15namespace VAPoR {
16
17//
22//
24public:
26 //
27 QuadTreeRectangleP(float left, float top, float right, float bottom, size_t max_depth = 12, size_t reserve_size = 1000);
28
30 //
31 QuadTreeRectangleP(size_t max_depth = 12, size_t reserve_size = 1000);
32
34 //
36
38 //
40
42
44 //
45 bool Insert(float left, float top, float right, float bottom, DimsType payload);
46
52 //
53 bool Insert(std::vector<class QuadTreeRectangle<float, pType>::rectangle_t> rectangles, std::vector<pType> payloads);
54
66 bool Insert(const Grid *grid, size_t ncells = 0);
67
69 //
70 void GetPayloadContained(float x, float y, std::vector<DimsType> &payloads) const;
71
73 //
74 void GetStats(std::vector<size_t> &payload_histo, std::vector<size_t> &level_histo) const;
75
76 friend std::ostream &operator<<(std::ostream &os, const QuadTreeRectangleP &q)
77 {
78 for (int i = 0; i < q._qtrs.size(); i++) {
79 os << "Bin " << i << std::endl;
80 os << q._qtrs[i] << std::endl;
81 }
82 return (os);
83 }
84
85private:
86 float _left;
87 float _right;
88 std::vector<QuadTreeRectangle<float, pType> *> _qtrs;
89};
90}; // namespace VAPoR
UInt32_tArr2 pType
std::array< uint32_t, 2 > UInt32_tArr2
Abstract base class for a 2D or 3D structured or unstructured grid.
Definition: Grid.h:56
This class wraps QuadTreeRectangleP with parallel tree construction.
QuadTreeRectangleP & operator=(const QuadTreeRectangleP &rhs)
bool Insert(const Grid *grid, size_t ncells=0)
bool Insert(std::vector< class QuadTreeRectangle< float, pType >::rectangle_t > rectangles, std::vector< pType > payloads)
QuadTreeRectangleP(size_t max_depth=12, size_t reserve_size=1000)
void GetPayloadContained(float x, float y, std::vector< DimsType > &payloads) const
QuadTreeRectangleP(const QuadTreeRectangleP &rhs)
QuadTreeRectangleP(float left, float top, float right, float bottom, size_t max_depth=12, size_t reserve_size=1000)
bool Insert(float left, float top, float right, float bottom, DimsType payload)
void GetStats(std::vector< size_t > &payload_histo, std::vector< size_t > &level_histo) const
friend std::ostream & operator<<(std::ostream &os, const QuadTreeRectangleP &q)
std::array< size_t, 3 > DimsType
Type for specifying integer indices.
Definition: Grid.h:26