city_generator2

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

commit bdc6ea4e418cc394a990437e3d9ce4b7a8e31ba4
parent 5a9995edc2d7ef3f37ac1fc5c0efbd26cee3364b
Author: Benjamin Piaud <benjamin.piaud@meso-star.com>
Date:   Thu,  6 Oct 2022 15:02:18 +0200

Split cg_building.h in 2 files to separate generic and specific data.
The specific functors are in cg_building_model0.c for model0.
To develop other building model, these 2 files can be considered as
template

Diffstat:
Mcmake/CMakeLists.txt | 3++-
Msrc/cg_building.h | 34++--------------------------------
Rsrc/cg_building.c -> src/cg_building_model0.c | 0
Asrc/cg_building_model0.h | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 63 insertions(+), 33 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -48,7 +48,7 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(CG2_FILES_SRC cg_main.c cg_city.c - cg_building.c + cg_building_model0.c cg_ground.c cg_args.c cg_parsing.c @@ -57,6 +57,7 @@ set(CG2_FILES_SRC set(CG2_FILES_INC cg_city.h cg_building.h + cg_building_model0.h cg_ground.h cg_args.h cg_parsing.h diff --git a/src/cg_building.h b/src/cg_building.h @@ -52,37 +52,7 @@ struct building { res_T (*release)(struct building* building); }; -/* specific data for model 0 */ -struct data_model0 { - double wall; /* wall thickness */ - double floor; /* floor thickness */ -}; - -struct data_cad_model0 { - struct scad_geometry* wall; - struct scad_geometry* roof; - struct scad_geometry* floor; - struct scad_geometry* cavity; - struct scad_geometry* ground; - struct scad_geometry* boundary; - struct scad_geometry** connection; - size_t n_connection; -}; - -res_T -build_cad_model0(struct building* building); - -res_T -build_footprint_model0 - (struct building* building, - struct scad_geometry** footprint); - -res_T -export_stl_model0 - (const struct building* building); - -res_T -release_model0 - (struct building* building); +/* the specific building model functors headers must be included here */ +#include "cg_building_model0.h" #endif /* BUILDING_H */ diff --git a/src/cg_building.c b/src/cg_building_model0.c diff --git a/src/cg_building_model0.h b/src/cg_building_model0.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2022 Université de Pau et des Pays de l'Adour UPPA + * Copyright (C) 2022 CNRS + * Copyright (C) 2022 Sorbonne Université + * Copyright (C) 2022 Université Paul Sabatier + * Copyright (C) 2022 |Meso|Star> (contact@meso-star.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <rsys/rsys.h> +#include <star/scad.h> + +#ifndef BUILDING_MODEL0_H +#define BUILDING_MODEL0_H + +/* specific data for model 0 */ +struct data_model0 { + double wall; /* wall thickness */ + double floor; /* floor thickness */ +}; + +struct data_cad_model0 { + struct scad_geometry* wall; + struct scad_geometry* roof; + struct scad_geometry* floor; + struct scad_geometry* cavity; + struct scad_geometry* ground; + struct scad_geometry* boundary; + struct scad_geometry** connection; + size_t n_connection; +}; + +res_T +build_cad_model0(struct building* building); + +res_T +build_footprint_model0 + (struct building* building, + struct scad_geometry** footprint); + +res_T +export_stl_model0 + (const struct building* building); + +res_T +release_model0 + (struct building* building); + +#endif /* BUILDING_MODEL0_H */