forked from ScanNet/ScanNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisualizer.h
More file actions
55 lines (43 loc) · 1.36 KB
/
Visualizer.h
File metadata and controls
55 lines (43 loc) · 1.36 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
47
48
49
50
51
52
53
54
55
#pragma once
#include "../common/json.h"
#include "../common/Segmentation.h"
#include "../common/Aggregation.h"
struct ConstantBuffer
{
mat4f worldViewProj;
ml::vec4f modelColor;
};
class Visualizer : public ApplicationCallback
{
public:
void init(ApplicationData &app);
void render(ApplicationData &app);
void keyDown(ApplicationData &app, UINT key);
void keyPressed(ApplicationData &app, UINT key);
void mouseDown(ApplicationData &app, MouseButtonType button);
void mouseMove(ApplicationData &app);
void mouseWheel(ApplicationData &app, int wheelDelta);
void resize(ApplicationData &app);
private:
//returns #unique objects/colors
unsigned int computeObjectIdsAndColorsPerVertex(const Aggregation& aggregation, const Segmentation& segmentation, MeshDataf& meshData, const MeshDataf& meshHi);
static inline float gaussD(float sigma, int x, int y)
{
return exp(-((x*x + y*y) / (2.0f*sigma*sigma)));
}
static inline float gaussR(float sigma, float dist)
{
return exp(-(dist*dist) / (2.0f*sigma*sigma));
}
void propagateAnnotations(const MeshDataf& meshSrc, MeshDataf& meshDst);
ml::D3D11TriMesh m_mesh;
ml::D3D11ShaderManager m_shaderManager;
D3D11RenderTarget m_renderTarget;
FrameTimer m_timer;
D3D11ConstantBuffer<ConstantBuffer> m_constants;
Cameraf m_camera;
//scan data
SensorData m_sensorData;
std::string m_sensorName;
float m_fieldOfView;
};