-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSceneManager.cpp
More file actions
46 lines (44 loc) · 1.76 KB
/
Copy pathSceneManager.cpp
File metadata and controls
46 lines (44 loc) · 1.76 KB
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
//
// A very simple class for rudimentary scene management
//
// (c) Georg Umlauf, 2021+2022
//
#include "SceneManager.h"
using enum SceneObjectType;
//
// iterates all objects under its control and has them drawn by the renderer
//
void SceneManager::draw(const RenderCamera& renderer, const QColor& color) const
{
for (auto obj : *this) if (obj) {
switch (obj->getType()) {
case ST_AXES:
obj->draw(renderer,COLOR_AXES,2.0f);
break;
case ST_PLANE:
obj->draw(renderer,COLOR_PLANE,0.3f);
break;
case ST_CUBE:
case ST_HEXAHEDRON:
obj->draw(renderer,color,2.0f);
break;
case ST_POINT_CLOUD:
obj->draw(renderer,COLOR_POINT_CLOUD,3.0f); // last argument unused
break;
case ST_PERSPECTIVE_CAMERA:
// TODO: Assignement 1, Part 3
// This is the place to invoke the perspective camera's projection method and draw the projected objects.
obj->draw(renderer,QColor(QColorConstants::Red), 0.2); //float for line width and colour currently not used by persCam
break;
case ST_STEREO_CAMERA:
// TODO: Assignement 2, Part 1 - 3
// Part 1: This is the place to invoke the stereo camera's projection method and draw the projected objects.
// Part 2: This is the place to invoke the stereo camera's reconstruction method.
// Part 3: This is the place to invoke the stereo camera's reconstruction method using misaligned stereo cameras.
break;
case ST_RECONSTRUCTOR:
//our name for ST_STEREO_CAMERA
obj->draw(renderer,QColor(QColorConstants::Blue), 0.2); //line width and colour currently not used
}
}
}