#ifndef rdo_scene_H #define rdo_scene_H /* Data about the scene's geometry, surface finish, sampling sites, and derived data. */ #define rdo_scene_H_COPYRIGHT "Copyright © 2008 Danillo Pereira and J. Stolfi, UNICAMP" /* Last edited on 2024-12-21 11:51:34 by stolfi */ #include #include #include #include #include #include #include #include typedef struct scene_t { solid_vec_t sds; /* Solid objects in scene. */ finish_vec_t fns; /* Surface finishes for those objects. */ /* Derived data: */ site_vec_t smp; /* Sampling sites. */ /* !!! Add: sampling site nominal area (or radius) for {T}'s benefit. */ dspmat_t T; /* Finish-independent radiance transfer matrix for the sampling sites. */ approx_basis_t bas; /* Approximation basis. */ dspmat_t M; /* Basis value matrix at the sampling sites. */ } scene_t; void rdo_scene_write(char *outDir, char *name, scene_t *scn); /* Writes the components of {scn} to the following files: "{outDir}/{name}.sds" -- {scn->sds}; "{outDir}/{name}.smp" -- {scn->smp,scn->rds}; "{outDir}/{name}.T" -- {scn->T}; "{outDir}/{name}.bas" -- {scn->bas}; "{outDir}/{name}.M" -- {scn->M}; "{outDir}/{name}.fns" -- {scn->fns}. */ scene_t *rdo_scene_read ( char *solids_filename, char *sites_filename, char *transferMatrix_filename, char *approxBasis_filename, char *basisMatrix_filename, char *finishes_filename ); /* Reads from the given files the components of a {scene_t}. If a file name is {NULL}, the corresponding component is set to a null obect ({NULL} pointer, empty matrix, etc.). */ void rdo_scene_associate_finishes(solid_vec_t *sds, finish_vec_t *fns); /* Uses the {name} fields to match each solid object {sd} in the list {sds} with a finish {fn} in {fns}, and sets the field {sd.ifn} accordingly. Aborts with error message if it fails to find the {name} of some solid in the {fns} list. */ void rdo_scene_free(scene_t *scn); /* Reclaims the storage used by {scn} (EXCEPT the record {*scn} itself). */ #endif