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