city_generator2

Generated conformal 3D meshes representing a city
git clone git://git.meso-star.fr/city_generator2.git
Log | Files | Refs | README | LICENSE

cg_construction_mode_0.h (3231B)


      1 /* Copyright (C) 2022 Université de Pau et des Pays de l'Adour UPPA
      2  * Copyright (C) 2022 CNRS
      3  * Copyright (C) 2022 Sorbonne Université
      4  * Copyright (C) 2022 Université Paul Sabatier
      5  * Copyright (C) 2022 |Meso|Star> (contact@meso-star.com)
      6  *
      7  * This program is free software: you can redistribute it and/or modify
      8  * it under the terms of the GNU General Public License as published by
      9  * the Free Software Foundation, either version 3 of the License, or
     10  * (at your option) any later version.
     11  *
     12  * This program is distributed in the hope that it will be useful,
     13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     15  * GNU General Public License for more details.
     16  *
     17  * You should have received a copy of the GNU General Public License
     18  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     19 
     20 #ifndef Construction_MODE_0_H
     21 #define Construction_MODE_0_H
     22 
     23 #include "cg_construction_mode.h"
     24 
     25 #include <rsys/rsys.h>
     26 #include <rsys/str.h>
     27 #include <rsys/dynamic_array.h>
     28 #include <rsys/hash_table.h>
     29 
     30 struct scad_geometry;
     31 struct building;
     32 struct parsed_city_building;
     33 struct catalog;
     34 struct city;
     35 struct darray_double;
     36 struct darray_adjoining_data;
     37 
     38 /* specific data for construction mode 0 */
     39 struct dataset_cmode_0 {
     40   double wall_thickness;
     41   double floor_thickness;
     42 };
     43 
     44 #define HTABLE_NAME dataset_cmode_0
     45 #define HTABLE_DATA struct dataset_cmode_0
     46 #define HTABLE_KEY struct str
     47 #define HTABLE_KEY_FUNCTOR_INIT str_init
     48 #define HTABLE_KEY_FUNCTOR_RELEASE str_release
     49 #define HTABLE_KEY_FUNCTOR_COPY str_copy
     50 #define HTABLE_KEY_FUNCTOR_COPY_AND_RELEASE str_copy_and_release
     51 #define HTABLE_KEY_FUNCTOR_COPY_AND_CLEAR str_copy_and_clear
     52 #define HTABLE_KEY_FUNCTOR_EQ str_eq
     53 #define HTABLE_KEY_FUNCTOR_HASH str_hash
     54 #include <rsys/hash_table.h>
     55 
     56 struct data_cad_cmode_0 {
     57   struct darray_common_trg common_trg;
     58   struct darray_geometries adj_walls;
     59   struct building* building;
     60   struct scad_geometry* wall;
     61   struct scad_geometry* roof;
     62   struct scad_geometry* floor;
     63   struct scad_geometry* cavity;
     64   struct scad_geometry* fake_ground;
     65   struct scad_geometry* boundary_wall;
     66   struct scad_geometry* boundary_roof;
     67   struct scad_geometry** connection;
     68   struct scad_geometry* ground_connection;
     69   size_t n_connection;
     70 };
     71 
     72 res_T
     73 init_cmode_0
     74   (struct building* building,
     75    struct city* city,
     76    struct parsed_city_building* parsed_data,
     77    struct catalog* catalog,
     78    const double lower[2],
     79    const double upper[2]);
     80 
     81 res_T
     82 release_cmode_0
     83   (struct building* building);
     84 
     85 res_T
     86 build_cad_cmode_0
     87   (struct building* building,
     88    int dump_footprints_on_error,
     89    int keep_running_on_errors,
     90    struct darray_adjoining_data* adjoining_data,
     91    struct darray_geometries* current_cad,
     92    void** cad);
     93 
     94 res_T
     95 build_footprint_cmode_0
     96   (struct building* building,
     97    struct scad_geometry** footprint);
     98 
     99 res_T
    100 get_ground_connection_0
    101   (struct building* building,
    102    struct scad_geometry** connection);
    103 
    104 res_T save_ground_connection_triangles_0
    105   (void* cad,
    106    struct darray_double* triangles);
    107 
    108 res_T
    109 export_stl_cmode_0
    110   (void* cad,
    111    const int binary);
    112 
    113 res_T
    114 release_cad_cmode_0
    115   (void* cad);
    116 
    117 #endif /* Construction_MODE_0_H */