-
Notifications
You must be signed in to change notification settings - Fork 2
/
PhotonMap.h
41 lines (31 loc) · 712 Bytes
/
PhotonMap.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
//
// Created by lazycal on 2017/6/20.
//
#ifndef RAY_TRACING_PHOTONMAP_H
#define RAY_TRACING_PHOTONMAP_H
#include <vector>
#include "Photon.h"
#include "RtHitPoint.h"
#include <algorithm>
struct Info {
int l, r, num, id;
Info() {}
};
class PhotonMap {
public:
PhotonMap();
void update(RtHitPoint &hitPoint) const;
void query(int u, int dim, std::vector<int> &res, const Vector3 &P, double R) const;
void addPhoton(const Photon &photon);
void build();
int build(int l, int r, int dim);
void clear();
int size();
private:
int n;
bool builded;
std::vector<Photon> photons;
std::vector<Info> nodes;
int root;
};
#endif //RAY_TRACING_PHOTONMAP_H