19 |
|
#include "fvect.h" */ |
20 |
|
#include "pmapdata.h" |
21 |
|
|
22 |
+ |
#ifdef __cplusplus |
23 |
+ |
extern "C" { |
24 |
+ |
#endif |
25 |
|
|
26 |
|
/* Forward declarations to break dependency loop with pmapdata.h */ |
27 |
|
struct PhotonMap; |
28 |
|
|
26 |
– |
|
29 |
|
/* k-d tree as linear array of photons */ |
30 |
|
typedef struct { |
31 |
|
Photon *nodes; /* k-d tree as linear array */ |
67 |
|
void kdT_InitFindPhotons (struct PhotonMap *pmap); |
68 |
|
/* Initialise NN search queue prior to calling kdT_FindPhotons() */ |
69 |
|
|
70 |
< |
void kdT_FindPhotons (struct PhotonMap* pmap, const FVECT pos, |
71 |
< |
const FVECT norm); |
70 |
> |
int kdT_FindPhotons (struct PhotonMap* pmap, const FVECT pos, |
71 |
> |
const FVECT norm); |
72 |
|
/* Locate pmap -> squeue.len nearest photons to pos with similar normal |
73 |
|
* (NULL for volume photons) and return in search queue pmap -> squeue, |
74 |
< |
* starting with the further photon at pmap -> squeue.node */ |
74 |
> |
* starting with the further photon at pmap -> squeue.node. Return -1 |
75 |
> |
* if none found, else 0. */ |
76 |
|
|
77 |
< |
void kdT_Find1Photon (struct PhotonMap* pmap, const FVECT pos, |
78 |
< |
const FVECT norm, Photon *photon); |
79 |
< |
/* Locate single nearest photon to pos with similar normal */ |
77 |
> |
int kdT_Find1Photon (struct PhotonMap* pmap, const FVECT pos, |
78 |
> |
const FVECT norm, Photon *photon); |
79 |
> |
/* Locate single nearest photon to pos with similar normal. Return -1 |
80 |
> |
* if none found, else 0. */ |
81 |
|
|
82 |
|
int kdT_GetPhoton (const struct PhotonMap *pmap, PhotonIdx idx, |
83 |
|
Photon *photon); |
84 |
< |
/* Retrieve photon referenced by idx from kd-tree and return 0 on |
85 |
< |
* success, else -1. */ |
84 |
> |
/* Retrieve photon referenced by idx from kd-tree and return -1 on |
85 |
> |
* error, else 0. */ |
86 |
|
|
87 |
|
Photon *kdT_GetNearestPhoton (const PhotonSearchQueue *squeue, |
88 |
|
PhotonIdx idx); |
93 |
|
|
94 |
|
void kdT_Delete (PhotonKdTree *kdt); |
95 |
|
/* Self-destruct */ |
96 |
+ |
|
97 |
+ |
#ifdef __cplusplus |
98 |
+ |
} |
99 |
+ |
#endif |
100 |
|
|
101 |
|
#endif |