vsgPoints: include/vsgPoints/Bricks.h Source File

vsgPoints 0.6.0 VulkanSceneGraph Point Cloud rendering.

Loading...
Searching...
No Matches
Bricks.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2023 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
13</editor-fold> */
14
15#include <vsg/nodes/Node.h>
16
17#include <vsgPoints/Brick.h>
18
19#include <list>
20
21namespace vsgPoints
22{
23 class VSGPOINTS_DECLSPEC Bricks : public vsg::Inherit<vsg::Object, Bricks>
24 {
25 public:
26 Bricks(vsg::ref_ptr<Settings> in_settings = {});
27
28 using BrickMap = std::map<Key, vsg::ref_ptr<Brick>>;
29 using key_type = BrickMap::key_type;
30 using mapped_type = BrickMap::mapped_type;
31 using value_type = BrickMap::value_type;
32 using iterator = BrickMap::iterator;
33 using const_iterator = BrickMap::const_iterator;
34
35 vsg::ref_ptr<Settings> settings;
36 BrickMap bricks;
37
38 void add(const vsg::dvec3& v, const vsg::ubvec4& c);
39
40 iterator find(Key key) { return bricks.find(key); }
41 const_iterator find(Key key) const { return bricks.find(key); }
42
43 mapped_type& operator[](Key key) { return bricks[key]; }
44
45 iterator begin() { return bricks.begin(); }
46 iterator end() { return bricks.end(); }
47
48 const_iterator begin() const { return bricks.begin(); }
49 const_iterator end() const { return bricks.end(); }
50
51 bool empty() const { return bricks.empty(); }
52
53 size_t size() const { return bricks.size(); }
54
55 // number of points
56 size_t count() const;
57 };
58
59 using Levels = std::list<vsg::ref_ptr<Bricks>>;
60
61} // namespace vsgPoints
62
63EVSG_type_name(vsgPoints::Bricks)
vsgPoints::Bricks
Definition Bricks.h:24