solstice-solver

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

ssol_scene_c.h (2284B)


      1 /* Copyright (C) 2018-2026 |Meso|Star> (contact@meso-star.com)
      2  * Copyright (C) 2016, 2018 CNRS
      3  *
      4  * This program is free software: you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License as published by
      6  * the Free Software Foundation, either version 3 of the License, or
      7  * (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     16 
     17 #ifndef SSOL_SCENE_C_H
     18 #define SSOL_SCENE_C_H
     19 
     20 #include <rsys/hash_table.h>
     21 #include <rsys/ref_count.h>
     22 #include <rsys/rsys.h>
     23 
     24 struct ssol_instance;
     25 
     26 /* Define the htable_instance data structure */
     27 #define HTABLE_NAME instance
     28 #define HTABLE_KEY unsigned /* S3D object instance identifier */
     29 #define HTABLE_DATA struct ssol_instance*
     30 #include <rsys/hash_table.h>
     31 
     32 /* Forward declarations */
     33 struct s3d_hit;
     34 struct s3d_scene;
     35 struct ssol_device;
     36 struct ssol_scene;
     37 struct ssol_sun;
     38 
     39 struct ssol_scene {
     40   /* Map the instantiated RT/Samp S3D shape id to its SSOL instance */
     41   struct htable_instance instances_rt;
     42   struct htable_instance instances_samp;
     43 
     44   struct s3d_scene* scn_rt; /* S3D scene to ray trace */
     45   struct s3d_scene* scn_samp; /* S3D scene to sample */
     46 
     47   double sampled_area; /* area of the geometry in scn_rt */
     48   double sampled_area_proxy; /* area of the geometry in scn_samp */
     49 
     50   struct ssol_sun* sun; /* Sun of the scene */
     51   struct ssol_atmosphere* atmosphere; /* Atmosphere of the scene */
     52   struct ssol_medium air; /* Defined according to atmosphere's properties */
     53 
     54   struct ssol_device* dev;
     55   ref_T ref;
     56 };
     57 
     58 /* Create the Star-3D views of the RT, sampling, and primary items scenes.
     59  * Return an error if the sampling scene is empty. */
     60 extern LOCAL_SYM res_T
     61 scene_create_s3d_views
     62   (struct ssol_scene* scn,
     63    struct s3d_scene_view** view_rt,
     64    struct s3d_scene_view** view_samp);
     65 
     66 extern LOCAL_SYM res_T
     67 scene_check
     68   (const struct ssol_scene* scene,
     69    const char* caller);
     70 
     71 #endif /* SSOL_SCENE_C_H */
     72