Remove _t suffixes from public types

Rename header-scope aliases, enums, and helper types while retaining descriptive names where dropping the suffix would create a collision.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Thomas Krijnen
2026-08-08 14:58:15 +02:00
parent 2859c1ef17
commit 4597929df9
41 changed files with 418 additions and 418 deletions
+4 -4
View File
@@ -247,7 +247,7 @@ struct exclusion_traverse_filter : public geom_filter { exclusion_traverse_filte
size_t read_filters_from_file(const std::string&, inclusion_filter&, inclusion_traverse_filter&, exclusion_filter&, exclusion_traverse_filter&);
void parse_filter(geom_filter &, const std::vector<std::string>&);
std::vector<ifcopenshell::geom::filter_t> setup_filters(const std::vector<geom_filter>&, const std::string&);
std::vector<ifcopenshell::geom::filter_function> setup_filters(const std::vector<geom_filter>&, const std::string&);
bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file, bool no_progress, bool mmap, bool bypass_properties=false, ifcopenshell::logger& logger = ifcopenshell::logger::root());
@@ -694,7 +694,7 @@ int main(int argc, char** argv) {
if (exclude_filter.type != geom_filter::UNUSED) { used_filters.push_back(exclude_filter); }
if (exclude_traverse_filter.type != geom_filter::UNUSED) { used_filters.push_back(exclude_traverse_filter); }
std::vector<ifcopenshell::geom::filter_t> filter_funcs = setup_filters(used_filters, ifcopenshell::path::to_utf8(output_extension));
std::vector<ifcopenshell::geom::filter_function> filter_funcs = setup_filters(used_filters, ifcopenshell::path::to_utf8(output_extension));
if (filter_funcs.empty()) {
cerr_ << "[error] Failed to set up geometry filters\n";
return EXIT_FAILURE;
@@ -1260,9 +1260,9 @@ void validate(boost::any& v, const std::vector<std::string>& values, exclusion_t
/// @todo Clean up this filter initialization code further.
/// @return References to the used filter functors, if none an error occurred.
std::vector<ifcopenshell::geom::filter_t> setup_filters(const std::vector<geom_filter>& filters, const std::string& output_extension)
std::vector<ifcopenshell::geom::filter_function> setup_filters(const std::vector<geom_filter>& filters, const std::string& output_extension)
{
std::vector<ifcopenshell::geom::filter_t> filter_funcs;
std::vector<ifcopenshell::geom::filter_function> filter_funcs;
for(auto& f: filters) {
if (f.type == geom_filter::ENTITY_TYPE) {
entity_filter.include = f.include;
+1 -1
View File
@@ -112,7 +112,7 @@ void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bo
guid_pairs_visited.insert({ Aguid, Bguid });
cgal_shape_t x_poly;
cgal_polyhedron x_poly;
x.convert_to_polyhedron(x_poly);
{
@@ -19,7 +19,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
settings.get<ifcopenshell::geom::settings::IteratorOutput>().value = ifcopenshell::geom::settings::NATIVE;
settings.get<ifcopenshell::geom::settings::DisableOpeningSubtractions>().value = true;
std::vector<ifcopenshell::geom::filter_t> no_openings_and_spaces = {
std::vector<ifcopenshell::geom::filter_function> no_openings_and_spaces = {
ifcopenshell::geom::entity_filter(false, false, {"IfcOpeningElement", "IfcSpace"})
};
@@ -138,12 +138,12 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
const auto& m = g.Placement()->ccomponents();
const auto& n = geom_object->transformation().data()->ccomponents();
const cgal_placement_t trsf(
const cgal_placement trsf(
m(0, 0), m(0, 1), m(0, 2), m(0, 3),
m(1, 0), m(1, 1), m(1, 2), m(1, 3),
m(2, 0), m(2, 1), m(2, 2), m(2, 3));
const cgal_placement_t trsf2(
const cgal_placement trsf2(
n(0, 0), n(0, 1), n(0, 2), n(0, 3),
n(1, 0), n(1, 1), n(1, 2), n(1, 3),
n(2, 0), n(2, 1), n(2, 2), n(2, 3));
@@ -90,7 +90,7 @@ void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, b
}
std::clock_t poly_begin = std::clock();
cgal_shape_t x_poly;
cgal_polyhedron x_poly;
x.convert_to_polyhedron(x_poly);
std::clock_t poly_end = std::clock();
conversion_to_poly += (poly_end - poly_begin) / (double)CLOCKS_PER_SEC;
@@ -136,7 +136,7 @@ void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, b
std::vector<Kernel_::FT> parameters;
std::transform(vertices(x_poly).begin(), vertices(x_poly).end(), std::back_inserter(parameters), [&P0, D](cgal_vertex_descriptor_t& v) {
std::transform(vertices(x_poly).begin(), vertices(x_poly).end(), std::back_inserter(parameters), [&P0, D](cgal_vertex_descriptor& v) {
return (v->point() - P0) * D;
});
+2 -2
View File
@@ -2,14 +2,14 @@
#include "validation_utils.h"
double facet_area(const cgal_shape_t::Facet_handle& f) {
double facet_area(const cgal_polyhedron::Facet_handle& f) {
auto p0 = f->facet_begin()->vertex()->point();
auto p1 = f->facet_begin()->next()->vertex()->point();
auto p2 = f->facet_begin()->next()->next()->vertex()->point();
return std::sqrt(CGAL::to_double(CGAL::cross_product(p0 - p1, p2 - p1).squared_length()));
}
void dump_facet(const cgal_shape_t::Facet_handle& f) {
void dump_facet(const cgal_polyhedron::Facet_handle& f) {
auto p0 = f->facet_begin()->vertex()->point();
auto p1 = f->facet_begin()->next()->vertex()->point();
auto p2 = f->facet_begin()->next()->next()->vertex()->point();
+34 -34
View File
@@ -39,7 +39,7 @@ T enlarge(const T& t, double d = 1.e-5) {
template <class HDS>
struct Build_Offset : public CGAL::Modifier_base<HDS> {
std::list<cgal_shape_t::Facet_handle> input;
std::list<cgal_polyhedron::Facet_handle> input;
void operator()(HDS& hds) {
// Postcondition: hds is a valid polyhedral surface.
@@ -81,12 +81,12 @@ struct Build_Offset : public CGAL::Modifier_base<HDS> {
};
template <typename Ts>
std::list<cgal_shape_t::Facet_handle> connected_faces(cgal_shape_t::Facet_handle f, const Ts& excluded) {
std::set<cgal_shape_t::Facet_handle> fs = { f };
std::list<cgal_polyhedron::Facet_handle> connected_faces(cgal_polyhedron::Facet_handle f, const Ts& excluded) {
std::set<cgal_polyhedron::Facet_handle> fs = { f };
std::function<void(cgal_shape_t::Facet_handle& f)> process;
process = [&fs, &process, &excluded](cgal_shape_t::Facet_handle& f) {
cgal_shape_t::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
std::function<void(cgal_polyhedron::Facet_handle& f)> process;
process = [&fs, &process, &excluded](cgal_polyhedron::Facet_handle& f) {
cgal_polyhedron::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
do {
auto ff = circ->opposite()->facet();
if (excluded.find(ff) == excluded.end()) {
@@ -99,12 +99,12 @@ std::list<cgal_shape_t::Facet_handle> connected_faces(cgal_shape_t::Facet_handle
};
process(f);
return std::list<cgal_shape_t::Facet_handle>(fs.begin(), fs.end());
return std::list<cgal_polyhedron::Facet_handle>(fs.begin(), fs.end());
}
template <class HDS>
struct Builder_With_Map : public CGAL::Modifier_base<HDS> {
std::list<cgal_shape_t::Facet_handle> input;
std::list<cgal_polyhedron::Facet_handle> input;
std::map<Kernel_::Point_3, Kernel_::Point_3> mapping;
void operator()(HDS& hds) {
@@ -114,7 +114,7 @@ struct Builder_With_Map : public CGAL::Modifier_base<HDS> {
std::set<Kernel_::Point_3> used_points;
for (auto& f : input) {
cgal_shape_t::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
cgal_polyhedron::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
do {
auto P = circ->vertex()->point();
auto it = mapping.find(P);
@@ -135,7 +135,7 @@ struct Builder_With_Map : public CGAL::Modifier_base<HDS> {
for (auto& f : input) {
B.begin_facet();
cgal_shape_t::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
cgal_polyhedron::Halfedge_around_facet_circulator circ = f->facet_begin(), end(circ);
do {
auto P = circ->vertex()->point();
auto it = mapping.find(P);
@@ -161,9 +161,9 @@ struct Builder_With_Map : public CGAL::Modifier_base<HDS> {
}
};
double facet_area(const cgal_shape_t::Facet_handle& f);
double facet_area(const cgal_polyhedron::Facet_handle& f);
void dump_facet(const cgal_shape_t::Facet_handle& f);
void dump_facet(const cgal_polyhedron::Facet_handle& f);
struct remove_thickness {
typedef Kernel_::Point_3 Point;
@@ -182,17 +182,17 @@ struct remove_thickness {
typedef CGAL::AABB_tree<AAbbTraits> Tree;
typedef boost::optional<Tree::Intersection_and_primitive_id<Ray>::Type> Ray_intersection;
cgal_shape_t polyhedron, polyhedron2, flattened;
cgal_polyhedron polyhedron, polyhedron2, flattened;
remove_thickness(const cgal_shape_t& p)
remove_thickness(const cgal_polyhedron& p)
// edge_collapse(p) still does not work :(
: polyhedron(p)
, polyhedron2(p) {
CGAL::Polygon_mesh_processing::triangulate_faces(polyhedron);
CGAL::Polygon_mesh_processing::triangulate_faces(polyhedron2);
std::list<cgal_shape_t::Facet_handle> non_degenerate, degenerate, longitudinal;
std::set<cgal_shape_t::Facet_iterator> thin_sides;
std::list<cgal_polyhedron::Facet_handle> non_degenerate, degenerate, longitudinal;
std::set<cgal_polyhedron::Facet_iterator> thin_sides;
std::wcout << "ALL FACES:" << std::endl;
@@ -211,8 +211,8 @@ struct remove_thickness {
dump_facet(f);
}
cgal_shape_t enlarged_non_degenerate_triangles;
Build_Offset<cgal_shape_t::HDS> bo;
cgal_polyhedron enlarged_non_degenerate_triangles;
Build_Offset<cgal_polyhedron::HDS> bo;
bo.input = non_degenerate;
enlarged_non_degenerate_triangles.delegate(bo);
@@ -220,8 +220,8 @@ struct remove_thickness {
Tree tree(faces(enlarged_non_degenerate_triangles).first, faces(enlarged_non_degenerate_triangles).second, enlarged_non_degenerate_triangles);
std::map<cgal_face_descriptor_t, Kernel_::Vector_3> face_normals;
boost::associative_property_map<std::map<cgal_face_descriptor_t, Kernel_::Vector_3>> face_normals_map(face_normals);
std::map<cgal_face_descriptor, Kernel_::Vector_3> face_normals;
boost::associative_property_map<std::map<cgal_face_descriptor, Kernel_::Vector_3>> face_normals_map(face_normals);
CGAL::Polygon_mesh_processing::compute_face_normals(polyhedron, face_normals_map);
for (auto& f : non_degenerate) {
@@ -269,8 +269,8 @@ struct remove_thickness {
std::wcout << "faces " << faces(polyhedron).size() << "long " << longitudinal.size() << "thin " << thin_sides.size() << "non-degen " << non_degenerate.size() << std::endl;
cgal_shape_t enlarged_indiv_triangles;
Build_Offset<cgal_shape_t::HDS> bo2;
cgal_polyhedron enlarged_indiv_triangles;
Build_Offset<cgal_polyhedron::HDS> bo2;
bo2.input = longitudinal;
enlarged_indiv_triangles.delegate(bo2);
@@ -301,9 +301,9 @@ struct remove_thickness {
Kernel_::Vector_3 norm;
Kernel_::Vector_3 accum;
int count = 0;
CGAL::Face_around_target_circulator<cgal_shape_t> it(v->halfedge(), polyhedron), end(it);
CGAL::Face_around_target_circulator<cgal_polyhedron> it(v->halfedge(), polyhedron), end(it);
do {
cgal_shape_t::Facet_handle fh = (*it)->halfedge()->facet();
cgal_polyhedron::Facet_handle fh = (*it)->halfedge()->facet();
auto jt = std::find(non_degenerate.begin(), non_degenerate.end(), fh);
std::wcout << "non degen: " << (jt != non_degenerate.end()) << std::endl;
@@ -408,8 +408,8 @@ struct remove_thickness {
if (std::find(connected.begin(), connected.end(), f) == connected.end()) {
connected_opposing = connected_faces(f, thin_sides_degenerate);
std::set<cgal_shape_t::Facet_handle> longi(longitudinal.begin(), longitudinal.end());
std::set<cgal_shape_t::Facet_handle> both_sides(connected.begin(), connected.end());
std::set<cgal_polyhedron::Facet_handle> longi(longitudinal.begin(), longitudinal.end());
std::set<cgal_polyhedron::Facet_handle> both_sides(connected.begin(), connected.end());
both_sides.insert(connected_opposing.begin(), connected_opposing.end());
if (longi == both_sides) {
@@ -422,7 +422,7 @@ struct remove_thickness {
}
}
Builder_With_Map<cgal_shape_t::HDS> b2;
Builder_With_Map<cgal_polyhedron::HDS> b2;
b2.input = connected;
b2.mapping = new_points;
@@ -432,11 +432,11 @@ struct remove_thickness {
struct intersection_validator {
typedef std::list<std::pair<const ifcopenshell::IfcBaseEntity*, CGAL::Nef_polyhedron_3<Kernel_>> > nefs_t;
typedef CGAL::Box_intersection_d::Box_with_handle_d<double, 3, nefs_t::value_type*> Box;
typedef std::list<std::pair<const ifcopenshell::IfcBaseEntity*, CGAL::Nef_polyhedron_3<Kernel_>> > nef_list;
typedef CGAL::Box_intersection_d::Box_with_handle_d<double, 3, nef_list::value_type*> Box;
std::vector<Box> boxes;
nefs_t nefs;
nef_list nefs;
double total_map_time = 0.;
double total_geom_time = 0.;
@@ -456,7 +456,7 @@ struct intersection_validator {
settings.get<ifcopenshell::geom::settings::IteratorOutput>().value = ifcopenshell::geom::settings::NATIVE;
settings.get<ifcopenshell::geom::settings::DisableOpeningSubtractions>().value = true;
std::vector<ifcopenshell::geom::filter_t> spaces_and_walls = {
std::vector<ifcopenshell::geom::filter_function> spaces_and_walls = {
ifcopenshell::geom::entity_filter(true, false, entities)
};
@@ -491,16 +491,16 @@ struct intersection_validator {
std::wcout << sss.c_str() << std::endl;
for (auto& g : geom_object->geometry()) {
cgal_shape_t s = *std::static_pointer_cast<ifcopenshell::geom::cgal_shape>(g.Shape());
cgal_polyhedron s = *std::static_pointer_cast<ifcopenshell::geom::cgal_shape>(g.Shape());
const auto& m = g.Placement()->ccomponents();
const auto& n = geom_object->transformation().data()->ccomponents();
const cgal_placement_t trsf(
const cgal_placement trsf(
m(0, 0), m(0, 1), m(0, 2), m(0, 3),
m(1, 0), m(1, 1), m(1, 2), m(1, 3),
m(2, 0), m(2, 1), m(2, 2), m(2, 3));
const cgal_placement_t trsf2(
const cgal_placement trsf2(
n(0, 0), n(0, 1), n(0, 2), n(0, 3),
n(1, 0), n(1, 1), n(1, 2), n(1, 3),
n(2, 0), n(2, 1), n(2, 2), n(2, 3));