/
SceneSelectionTesters.h
88 lines (74 loc) · 2.19 KB
/
SceneSelectionTesters.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#include <vector>
#include "iselectiontest.h"
namespace selection
{
class SelectionTesterBase :
public ISceneSelectionTester
{
private:
std::vector<ISelectable*> _selectables;
public:
bool hasSelectables() const override;
void foreachSelectable(const std::function<void(ISelectable*)>& functor) override;
void testSelectScene(const VolumeTest& view, SelectionTest& test) override;
protected:
void storeSelectable(ISelectable* selectable);
void storeSelectablesInPool(Selector& selector, const std::function<bool(ISelectable*)>& predicate);
};
/**
* Tests entities and worldspawn primitives in the scene
*/
class PrimitiveSelectionTester :
public SelectionTesterBase
{
public:
void testSelectSceneWithFilter(const VolumeTest& view, SelectionTest& test,
const std::function<bool(ISelectable*)>& predicate) override;
private:
bool higherEntitySelectionPriority() const;
};
/**
* Tests just the entities in the scene, all other nodes are skipped
*/
class EntitySelectionTester :
public SelectionTesterBase
{
public:
void testSelectSceneWithFilter(const VolumeTest& view, SelectionTest& test,
const std::function<bool(ISelectable*)>& predicate) override;
};
/**
* Tests child primitives of group nodes only, non-worldspawn
*/
class GroupChildPrimitiveSelectionTester :
public SelectionTesterBase
{
public:
void testSelectSceneWithFilter(const VolumeTest& view, SelectionTest& test,
const std::function<bool(ISelectable*)>& predicate) override;
};
/**
* This tester is looking for merge action nodes only
*/
class MergeActionSelectionTester :
public SelectionTesterBase
{
public:
void testSelectSceneWithFilter(const VolumeTest& view, SelectionTest& test,
const std::function<bool(ISelectable*)>& predicate) override;
};
/**
* Tests components of selected scene elements
*/
class ComponentSelectionTester :
public SelectionTesterBase
{
private:
SelectionSystem& _selectionSystem;
public:
ComponentSelectionTester(SelectionSystem& selectionSystem);
void testSelectSceneWithFilter(const VolumeTest& view, SelectionTest& test,
const std::function<bool(ISelectable*)>& predicate) override;
};
}