ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapray.c
Revision: 2.6
Committed: Tue May 17 17:39:47 2016 UTC (7 years, 11 months ago) by rschregle
Content type: text/plain
Branch: MAIN
Changes since 2.5: +2 -0 lines
Log Message:
Initial import of ooC photon map

File Contents

# User Rev Content
1 greg 2.4 #ifndef lint
2 greg 2.5 static const char RCSid[] = "$Id: pmapray.c,v 2.4 2015/08/18 18:45:55 greg Exp $";
3 greg 2.4 #endif
4 rschregle 2.6
5 greg 2.1 /*
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 rschregle 2.2 (c) Lucerne University of Applied Sciences and Arts,
12     supported by the Swiss National Science Foundation (SNSF, #147053)
13 greg 2.1 ==================================================================
14    
15 rschregle 2.6 $Id: pmapray.c,v 2.3 2015/05/22 14:09:01 greg Exp $
16 greg 2.1 */
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 greg 2.3 if (pmapParams [t].fileName)
44     rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName);
45    
46 greg 2.1 else rp -> pmapParams [t].fileName = NULL;
47    
48     rp -> pmapParams [t].minGather = pmapParams [t].minGather;
49     rp -> pmapParams [t].maxGather = pmapParams [t].maxGather;
50     }
51     }
52    
53    
54     void ray_restore_pmap (RAYPARAMS *rp)
55     /* Interface to ray_restore(); restore photon mapping params */
56     {
57     unsigned t;
58    
59     for (t = 0; t < NUM_PMAP_TYPES; t++) {
60     pmapParams [t].fileName = rp -> pmapParams [t].fileName;
61     pmapParams [t].minGather = rp -> pmapParams [t].minGather;
62     pmapParams [t].maxGather = rp -> pmapParams [t].maxGather;
63     }
64     }