star-gs

Literate program for a geometric sensitivity calculation
git clone git://git.meso-star.fr/star-gs.git
Log | Files | Refs | README | LICENSE

commit 3cfa90f7822b98c68b202d5c72363da08623e3c5
parent 0fb7b007917583eb7aa41f18b5fe6918092a5192
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  3 May 2021 16:26:54 +0200

Add the sgs_geometry_compute_<sampling_area|volume> functions

Diffstat:
Msrc/sgs_geometry.c | 18++++++++++++++++++
Msrc/sgs_geometry.h | 8++++++++
2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/sgs_geometry.c b/src/sgs_geometry.c @@ -232,6 +232,24 @@ sgs_geometry_get_sampling_mask(const struct sgs_geometry* geom) return geom->sampling_mask; } +double +sgs_geometry_compute_volume(const struct sgs_geometry* geom) +{ + float volume; + ASSERT(geom); + S3D(scene_view_compute_volume(geom->view_rt, &volume)); + return volume; +} + +double +sgs_geometry_compute_sampling_area(const struct sgs_geometry* geom) +{ + float area; + ASSERT(geom); + S3D(scene_view_compute_area(geom->view_sp, &area)); + return area; +} + void sgs_geometry_trace_ray (const struct sgs_geometry* geom, diff --git a/src/sgs_geometry.h b/src/sgs_geometry.h @@ -189,6 +189,14 @@ extern LOCAL_SYM int sgs_geometry_get_sampling_mask (const struct sgs_geometry* geom); +extern LOCAL_SYM double +sgs_geometry_compute_volume + (const struct sgs_geometry* geom); + +extern LOCAL_SYM double +sgs_geometry_compute_sampling_area + (const struct sgs_geometry* geom); + extern LOCAL_SYM void sgs_geometry_trace_ray (const struct sgs_geometry* geom,