solstice-solver

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

ssol_sun_c.h (1695B)


      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_SUN_C_H
     18 #define SSOL_SUN_C_H
     19 
     20 #include <rsys/ref_count.h>
     21 #include <rsys/list.h>
     22 
     23 /* Forward declaration */
     24 struct ranst_sun_dir;
     25 struct ranst_sun_wl;
     26 
     27 enum sun_type {
     28   SUN_DIRECTIONAL,
     29   SUN_PILLBOX,
     30   SUN_GAUSSIAN,
     31   SUN_BUIE,
     32   SUN_TYPES_COUNT__
     33 };
     34 
     35 struct pillbox {
     36   double half_angle;
     37 };
     38 
     39 struct gaussian {
     40   double std_dev;
     41 };
     42 
     43 struct buie {
     44   double ratio;
     45 };
     46 
     47 struct ssol_sun {
     48   double direction[3];
     49   double dni;
     50   struct ssol_spectrum* spectrum;
     51   struct ssol_scene* scene_attachment;
     52   enum sun_type type;
     53   union {
     54     struct pillbox pillbox;
     55     struct gaussian gaussian;
     56     struct buie csr;
     57   } data;
     58 
     59   struct ssol_device* dev;
     60   ref_T ref;
     61 };
     62 
     63 extern LOCAL_SYM res_T
     64 sun_create_direction_distribution
     65   (struct ssol_sun* sun,
     66    struct ranst_sun_dir** out_ran_dir);
     67 
     68 extern LOCAL_SYM res_T
     69 sun_create_wavelength_distribution
     70   (struct ssol_sun* sun,
     71    struct ranst_sun_wl** out_ran_wl);
     72 
     73 #endif /* SSOL_SUN_C_H */