htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

htrdr_rectangle.h (2704B)


      1 /* Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique
      2  * Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux
      3  * Copyright (C) 2022-2025 Institut Pierre-Simon Laplace
      4  * Copyright (C) 2022-2025 Institut de Physique du Globe de Paris
      5  * Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com)
      6  * Copyright (C) 2022-2025 Observatoire de Paris
      7  * Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne
      8  * Copyright (C) 2022-2025 Université de Versaille Saint-Quentin
      9  * Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier
     10  *
     11  * This program is free software: you can redistribute it and/or modify
     12  * it under the terms of the GNU General Public License as published by
     13  * the Free Software Foundation, either version 3 of the License, or
     14  * (at your option) any later version.
     15  *
     16  * This program is distributed in the hope that it will be useful,
     17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     19  * GNU General Public License for more details.
     20  *
     21  * You should have received a copy of the GNU General Public License
     22  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     23 
     24 #ifndef HTRDR_RECTANGLE_H
     25 #define HTRDR_RECTANGLE_H
     26 
     27 #include "core/htrdr.h"
     28 #include <rsys/rsys.h>
     29 
     30 /* Forwar declarations */
     31 struct htrdr;
     32 struct htrdr_rectangle; /* 2D rectangle transformed in 3D */
     33 
     34 BEGIN_DECLS
     35 
     36 HTRDR_API res_T
     37 htrdr_rectangle_create
     38   (struct htrdr* htrdr,
     39    const double sz[2], /* Size of the rectangle along its local X and Y axis */
     40    const double pos[3], /* World space position of the rectangle center */
     41    const double tgt[3], /* Targeted point */
     42    const double up[3], /* vector orthogonal to the rectangle X axis */
     43    struct htrdr_rectangle** rect);
     44 
     45 HTRDR_API void
     46 htrdr_rectangle_ref_get
     47   (struct htrdr_rectangle* rect);
     48 
     49 HTRDR_API void
     50 htrdr_rectangle_ref_put
     51   (struct htrdr_rectangle* rect);
     52 
     53 HTRDR_API void
     54 htrdr_rectangle_sample_pos
     55   (const struct htrdr_rectangle* rect,
     56    const double sample[2], /* In [0, 1[ */
     57    double pos[3]);
     58 
     59 HTRDR_API void
     60 htrdr_rectangle_get_normal
     61   (const struct htrdr_rectangle* rect,
     62    double normal[3]);
     63 
     64 HTRDR_API void
     65 htrdr_rectangle_get_center
     66   (const struct htrdr_rectangle* rect,
     67    double center[3]);
     68 
     69 HTRDR_API double*
     70 htrdr_rectangle_get_transform
     71   (const struct htrdr_rectangle* rect,
     72    double transform[12]);
     73 
     74 HTRDR_API double*
     75 htrdr_rectangle_get_transform_inverse
     76   (const struct htrdr_rectangle* rect,
     77    double transform_inverse[12]);
     78 
     79 HTRDR_API void
     80 htrdr_rectangle_get_size
     81   (const struct htrdr_rectangle* rect,
     82    double size[2]);
     83 
     84 END_DECLS
     85 
     86 #endif /* HTRDR_RECTANGLE_H */
     87