solstice-solver

Solver library of the solstice app
git clone git://git.meso-star.com/solstice-solver.git
Log | Files | Refs | README | LICENSE

commit 93d500d31334a78f3f2a65e794adf4c386665075
parent 431ccc7235788e45f4f18f8999fe604db65a41cb
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Mon, 11 Jul 2016 12:20:40 +0200

Rename a struct (ssol_ran_sun_dir => ssol_ranst_sun_dir).

This to be coherent whin StarSP naming scheme.
Distribution with state being named ssp_ranst_xxx.

Diffstat:
Msrc/ssol_distributions.c | 46+++++++++++++++++++++++-----------------------
Msrc/ssol_distributions_c.h | 30+++++++++++++++---------------
Msrc/ssol_solver.c | 8++++----
Msrc/ssol_solver_c.h | 4++--
4 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/src/ssol_distributions.c b/src/ssol_distributions.c @@ -54,8 +54,8 @@ struct ran_dirac_state /* one single type for all distributions * only the state type depends on the distribution type */ -struct ssol_ran_sun_dir { - double*(*get)(const struct ssol_ran_sun_dir* ran, struct ssp_rng* rng, double dir[3]); +struct ssol_ranst_sun_dir { + double*(*get)(const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]); ref_T ref; struct mem_allocator* allocator; union { @@ -72,24 +72,24 @@ struct ssol_ran_sun_dir { static void distrib_sun_release(ref_T* ref) { - struct ssol_ran_sun_dir* ran; + struct ssol_ranst_sun_dir* ran; ASSERT(ref); - ran = CONTAINER_OF(ref, struct ssol_ran_sun_dir, ref); + ran = CONTAINER_OF(ref, struct ssol_ranst_sun_dir, ref); MEM_RM(ran->allocator, ran); } res_T -ssol_ran_sun_dir_create +ssol_ranst_sun_dir_create (struct mem_allocator* allocator, - struct ssol_ran_sun_dir** out_ran) + struct ssol_ranst_sun_dir** out_ran) { - struct ssol_ran_sun_dir* ran = NULL; + struct ssol_ranst_sun_dir* ran = NULL; if (!out_ran) return RES_BAD_ARG; allocator = allocator ? allocator : &mem_default_allocator; - ran = MEM_CALLOC(allocator, 1, sizeof(struct ssol_ran_sun_dir)); + ran = MEM_CALLOC(allocator, 1, sizeof(struct ssol_ranst_sun_dir)); if (!ran) return RES_MEM_ERR; ref_init(&ran->ref); @@ -100,8 +100,8 @@ ssol_ran_sun_dir_create } res_T -ssol_ran_sun_dir_ref_get - (struct ssol_ran_sun_dir* ran) +ssol_ranst_sun_dir_ref_get + (struct ssol_ranst_sun_dir* ran) { if (!ran) return RES_BAD_ARG; ref_get(&ran->ref); @@ -109,8 +109,8 @@ ssol_ran_sun_dir_ref_get } res_T -ssol_ran_sun_dir_ref_put - (struct ssol_ran_sun_dir* ran) +ssol_ranst_sun_dir_ref_put + (struct ssol_ranst_sun_dir* ran) { if (!ran) return RES_BAD_ARG; ref_put(&ran->ref, distrib_sun_release); @@ -118,8 +118,8 @@ ssol_ran_sun_dir_ref_put } double* -ssol_ran_sun_dir_get - (const struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_get + (const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]) { @@ -238,7 +238,7 @@ void fill_buie_state(struct ran_buie_state* s, double p) { double* ssol_ran_buie_get - (const struct ssol_ran_sun_dir* ran, struct ssp_rng* rng, double dir[3]) + (const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]) { double phi, theta, sinTheta, cosTheta, cosPhi, sinPhi; ASSERT(ran->state.buie.thetaSD > 0); @@ -256,8 +256,8 @@ ssol_ran_buie_get } res_T -ssol_ran_sun_dir_buie_setup - (struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_buie_setup + (struct ssol_ranst_sun_dir* ran, double param, const double dir[3]) { @@ -278,7 +278,7 @@ ssol_ran_sun_dir_buie_setup double* ssol_ran_pillbox_get -(const struct ssol_ran_sun_dir* ran, +(const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]) { @@ -292,8 +292,8 @@ ssol_ran_pillbox_get } res_T -ssol_ran_sun_dir_pillbox_setup - (struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_pillbox_setup + (struct ssol_ranst_sun_dir* ran, double aperture, const double dir[3]) { @@ -313,7 +313,7 @@ ssol_ran_sun_dir_pillbox_setup double* ssol_ran_dirac_get -(const struct ssol_ran_sun_dir* ran, +(const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]) { @@ -324,8 +324,8 @@ ssol_ran_dirac_get } res_T -ssol_ran_sun_dir_dirac_setup - (struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_dirac_setup + (struct ssol_ranst_sun_dir* ran, const double dir[3]) { if (!ran || !dir) return RES_BAD_ARG; diff --git a/src/ssol_distributions_c.h b/src/ssol_distributions_c.h @@ -21,45 +21,45 @@ ******************************************************************************/ /* Forward declaration of opaque types */ -struct ssol_ran_sun_dir; +struct ssol_ranst_sun_dir; /* Forward declaration of external types */ struct ssp_rng; struct mem_allocator; res_T -ssol_ran_sun_dir_create +ssol_ranst_sun_dir_create (struct mem_allocator* allocator, - struct ssol_ran_sun_dir** ran); + struct ssol_ranst_sun_dir** ran); res_T -ssol_ran_sun_dir_buie_setup - (struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_buie_setup + (struct ssol_ranst_sun_dir* ran, double param, const double dir[3]); res_T -ssol_ran_sun_dir_pillbox_setup -(struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_pillbox_setup +(struct ssol_ranst_sun_dir* ran, double aperture, /* apparent size in radians */ const double dir[3]); res_T -ssol_ran_sun_dir_dirac_setup -(struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_dirac_setup +(struct ssol_ranst_sun_dir* ran, const double dir[3]); res_T -ssol_ran_sun_dir_ref_get - (struct ssol_ran_sun_dir* ran); +ssol_ranst_sun_dir_ref_get + (struct ssol_ranst_sun_dir* ran); res_T -ssol_ran_sun_dir_ref_put - (struct ssol_ran_sun_dir* ran); +ssol_ranst_sun_dir_ref_put + (struct ssol_ranst_sun_dir* ran); double* -ssol_ran_sun_dir_get - (const struct ssol_ran_sun_dir* ran, +ssol_ranst_sun_dir_get + (const struct ssol_ranst_sun_dir* ran, struct ssp_rng* rng, double dir[3]); diff --git a/src/ssol_solver.c b/src/ssol_solver.c @@ -148,7 +148,7 @@ init_solver_data darray_3dshape_init(dev->allocator, &data->shapes); res = ssp_ranst_piecewise_linear_create(dev->allocator, &data->sun_spectrum_ran); if (res != RES_OK) return res; - res = ssol_ran_sun_dir_create(dev->allocator, &data->sun_dir_ran); + res = ssol_ranst_sun_dir_create(dev->allocator, &data->sun_dir_ran); if (res != RES_OK) { SSP(ranst_piecewise_linear_ref_put(data->sun_spectrum_ran)); return res; @@ -181,13 +181,13 @@ set_sun_distributions /* then the direction distribution */ switch (sun->type) { case SUN_DIRECTIONAL: - res = ssol_ran_sun_dir_dirac_setup(data->sun_dir_ran, sun->direction); + res = ssol_ranst_sun_dir_dirac_setup(data->sun_dir_ran, sun->direction); break; case SUN_PILLBOX: - res = ssol_ran_sun_dir_pillbox_setup(data->sun_dir_ran, sun->data.pillbox.aperture, sun->direction); + res = ssol_ranst_sun_dir_pillbox_setup(data->sun_dir_ran, sun->data.pillbox.aperture, sun->direction); break; case SUN_CSR: - res = ssol_ran_sun_dir_buie_setup(data->sun_dir_ran, sun->data.csr.ratio, sun->direction); + res = ssol_ranst_sun_dir_buie_setup(data->sun_dir_ran, sun->data.csr.ratio, sun->direction); break; default: res = RES_OK; diff --git a/src/ssol_solver_c.h b/src/ssol_solver_c.h @@ -46,8 +46,8 @@ struct solver_data { struct darray_3dshape shapes; /* the 3D scene used for raytracing */ struct s3d_scene *scene; - /* the random distribution for sun sampling */ - struct ssol_ran_sun_dir* sun_dir_ran; + /* the random distributions for sun sampling */ + struct ssol_ranst_sun_dir* sun_dir_ran; struct ssp_ranst_piecewise_linear* sun_spectrum_ran; };