-
Notifications
You must be signed in to change notification settings - Fork 46
/
LayerUsageBreakdown.h
41 lines (34 loc) · 1.04 KB
/
LayerUsageBreakdown.h
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
#pragma once
#include <vector>
namespace scene
{
/**
* This object contains the information about how many
* nodes are present in each layer.
* It's implemented by means of a vector, indexable by layer ID.
*
* Use the static methods to populate this class from the
* selection or from all scene objects.
*
* Retrieve the object count for a given layer like this:
* breakdown[<layerID>] = <count>
*/
class LayerUsageBreakdown :
public std::vector<std::size_t>
{
private:
LayerUsageBreakdown()
{}
public:
// Creates the layer summary based on the current selection
static LayerUsageBreakdown CreateFromSelection();
// Creates the layer summary based on the nodes in the GlobalScenegraph
// NOTE: only primitives and entities are considered.
// If includeHidden is set to true, currently invisible items are added
static LayerUsageBreakdown CreateFromScene(bool includeHidden);
private:
// Makes sure the vector is large enough to host all layer IDs
// Sets all counts back to 0
static void InitialiseVector(LayerUsageBreakdown& bd);
};
}