/
ModelScaleManipulator.h
51 lines (37 loc) · 1.13 KB
/
ModelScaleManipulator.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
#pragma once
#include <list>
#include "ManipulatorBase.h"
#include "ManipulatorComponents.h"
#include "selection/Renderables.h"
#include "selection/ManipulationPivot.h"
#include "selection/Pivot2World.h"
#include "selection/BasicSelectable.h"
#include "entitylib.h"
class Entity;
namespace selection
{
class ModelScaleManipulator :
public ManipulatorBase
{
private:
ManipulationPivot& _pivot;
// Resize component
ModelScaleComponent _scaleComponent;
std::list<RenderableSolidAABB> _renderableAabbs;
RenderablePointVector _renderableCornerPoints;
scene::INodePtr _curManipulatable;
public:
static ShaderPtr _lineShader;
static ShaderPtr _pointShader;
ModelScaleManipulator(ManipulationPivot& pivot);
Type getType() const override;
Component* getActiveComponent() override;
void testSelect(SelectionTest& test, const Matrix4& pivot2world) override;
void setSelected(bool select) override;
bool isSelected() const override;
void render(RenderableCollector& collector, const VolumeTest& volume) override;
private:
void foreachSelectedTransformable(
const std::function<void(const scene::INodePtr&, Entity*)>& functor);
};
}