ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapray.c
Revision: 2.7
Committed: Wed Nov 2 22:09:14 2016 UTC (7 years, 5 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R3, rad5R1
Changes since 2.6: +17 -2 lines
Log Message:
Fixed bug in ranimove introduced with photon map

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: pmapray.c,v 2.6 2016/05/17 17:39:47 rschregle Exp $";
3 #endif
4
5 /*
6 ==================================================================
7 Photon map interface to RADIANCE raycalls
8
9 Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
10 (c) Fraunhofer Institute for Solar Energy Systems,
11 (c) Lucerne University of Applied Sciences and Arts,
12 supported by the Swiss National Science Foundation (SNSF, #147053)
13 ==================================================================
14
15 $Id: pmapray.c,v 2.6 2016/05/17 17:39:47 rschregle Exp $
16 */
17
18
19 #include "pmapray.h"
20 #include "pmap.h"
21
22
23 void ray_init_pmap ()
24 /* Interface to ray_init(); init & load photon maps */
25 {
26 loadPmaps(photonMaps, pmapParams);
27 }
28
29
30 void ray_done_pmap ()
31 /* Interface to ray_done(); free photon maps */
32 {
33 cleanUpPmaps(photonMaps);
34 }
35
36
37 void ray_save_pmap (RAYPARAMS *rp)
38 /* Interface to ray_save(); save photon map params */
39 {
40 unsigned t;
41
42 for (t = 0; t < NUM_PMAP_TYPES; t++) {
43 if (pmapParams [t].fileName)
44 rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName);
45
46 else rp -> pmapParams [t].fileName = NULL;
47
48 rp -> pmapParams [t].minGather = pmapParams [t].minGather;
49 rp -> pmapParams [t].maxGather = pmapParams [t].maxGather;
50 rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget;
51 }
52 }
53
54
55 void ray_restore_pmap (RAYPARAMS *rp)
56 /* Interface to ray_restore(); restore photon mapping params */
57 {
58 unsigned t;
59
60 for (t = 0; t < NUM_PMAP_TYPES; t++) {
61 pmapParams [t].fileName = rp -> pmapParams [t].fileName;
62 pmapParams [t].minGather = rp -> pmapParams [t].minGather;
63 pmapParams [t].maxGather = rp -> pmapParams [t].maxGather;
64 pmapParams [t].distribTarget = rp -> pmapParams [t].distribTarget;
65 }
66 }
67
68 void ray_defaults_pmap (RAYPARAMS *rp)
69 /* Interface to ray_defaults(); set photon mapping defaults */
70 {
71 unsigned t;
72
73 for (t = 0; t < NUM_PMAP_TYPES; t++) {
74 rp -> pmapParams [t].fileName = NULL;
75 rp -> pmapParams [t].minGather = 0;
76 rp -> pmapParams [t].maxGather = 0;
77 rp -> pmapParams [t].distribTarget = 0;
78 }
79 }