Normalize whitespaces in the codebase

This commit is contained in:
Andrej730
2026-08-19 18:16:59 +05:00
parent 030e6e5bb4
commit 104591a80b
117 changed files with 636 additions and 638 deletions
+5 -5
View File
@@ -184,7 +184,7 @@ std::string taxonomy_item_repr(ifcopenshell::geom::taxonomy::item::ptr i) {
if (!result.empty() && result.back() == '\n') {
result.pop_back();
}
return result;
return result;
}
%}
@@ -849,7 +849,7 @@ struct shape_rtti : public boost::static_visitor<PyObject*>
polyhedral_faces_without_holes = property(polyhedral_faces_without_holes)
polyhedral_faces_with_holes = property(polyhedral_faces_with_holes)
def get_faces(self):
if self.faces_tri:
if self.faces_tri:
return self.faces_tri
elif self.polyhedral_faces_without_holes:
return self.polyhedral_faces_without_holes
@@ -1310,7 +1310,7 @@ ifcopenshell::geom::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type_inf
auto cgs = dynamic_cast<ifcopenshell::geom::cgal_shape*>($self);
if (cgs) {
write_to_obj(cgs->nef(), result, std::numeric_limits<size_t>::max());
}
}
return result.str();
}
@@ -1318,7 +1318,7 @@ ifcopenshell::geom::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type_inf
auto cgs = dynamic_cast<ifcopenshell::geom::cgal_shape*>($self);
if (cgs) {
cgs->convex_tag() = b;
}
}
}
std::string serialize() {
@@ -1368,7 +1368,7 @@ ifcopenshell::geom::taxonomy::item::ptr try_upcast(PyObject* obj0, swig_type_inf
return r;
} else {
throw std::runtime_error("Failed to read SVG");
}
}
}
std::vector<svgfill::polygon_2> arrange_polygons(svgfill::arrange_polygon_settings settings, const std::vector<svgfill::polygon_2>& polygons, ifcopenshell::logger* logger = nullptr) {
+14 -14
View File
@@ -443,7 +443,7 @@ private:
if (!$self->declaration().as_entity()) {
return name == "wrappedValue" ? 1 : 0;
}
{
const std::vector<const ifcopenshell::attribute*> attrs = $self->declaration().as_entity()->all_attributes();
std::vector<const ifcopenshell::attribute*>::const_iterator it = attrs.begin();
@@ -496,12 +496,12 @@ private:
if (!$self->declaration().as_entity()) {
return std::vector<std::string>(1, "wrappedValue");
}
const std::vector<const ifcopenshell::attribute*> attrs = $self->declaration().as_entity()->all_attributes();
std::vector<std::string> attr_names;
attr_names.reserve(attrs.size());
attr_names.reserve(attrs.size());
std::vector<const ifcopenshell::attribute*>::const_iterator it = attrs.begin();
for (; it != attrs.end(); ++it) {
attr_names.push_back((*it)->name());
@@ -516,10 +516,10 @@ private:
}
const std::vector<const ifcopenshell::inverse_attribute*> attrs = $self->declaration().as_entity()->all_inverse_attributes();
std::vector<std::string> attr_names;
attr_names.reserve(attrs.size());
attr_names.reserve(attrs.size());
std::vector<const ifcopenshell::inverse_attribute*>::const_iterator it = attrs.begin();
for (; it != attrs.end(); ++it) {
attr_names.push_back((*it)->name());
@@ -527,7 +527,7 @@ private:
return attr_names;
}
bool is_a(const std::string& s) {
return self->declaration().is(s);
}
@@ -901,7 +901,7 @@ private:
bits.push_back(boost::dynamic_bitset<>(v));
} else {
throw ifcopenshell::exception("String not a valid binary representation");
}
}
}
self->set_attribute_value(i, bits);
return;
@@ -1181,7 +1181,7 @@ from .entity_instance import entity_instance_mixin
%{
PyObject* get_info_cpp(const express::base& v, bool recursive, bool include_identifier);
// @todo refactor this to remove duplication with the typemap.
// @todo refactor this to remove duplication with the typemap.
// except this is calls the above function in case of instances.
PyObject* convert_cpp_attribute_to_python(const express::base& instance, size_t attribute_index, bool recursive, bool include_identifier) {
return instance.get_attribute_value(attribute_index).apply_visitor([recursive, include_identifier](const auto& v){
@@ -1193,7 +1193,7 @@ from .entity_instance import entity_instance_mixin
return SWIG_NewPointerObj(new attribute_value_derived, SWIGTYPE_p_attribute_value_derived, SWIG_POINTER_OWN);
} else {
Py_INCREF(Py_None);
return static_cast<PyObject*>(Py_None);
return static_cast<PyObject*>(Py_None);
}
} else if constexpr (std::is_same_v<u, express::base>) {
if (recursive) {
@@ -1230,7 +1230,7 @@ from .entity_instance import entity_instance_mixin
}
} else if constexpr (std::is_same_v<u, ifcopenshell::empty_aggregate> || std::is_same_v<u, ifcopenshell::empty_aggregate_of_aggregate> || std::is_same_v<u, ifcopenshell::blank>) {
Py_INCREF(Py_None);
return static_cast<PyObject*>(Py_None);
return static_cast<PyObject*>(Py_None);
} else if constexpr (is_std_vector_v<u>) {
// only for non-entity-instance vectors
return pythonize_vector(v);
@@ -1418,7 +1418,7 @@ from .entity_instance import entity_instance_mixin
std::visit([&](const auto& v) -> void {
PyObject* attribute_val_py = nullptr;
using t = std::decay_t<decltype(v)>;
if constexpr (std::is_same_v<t, ifcopenshell::reference_or_simple_type>) {
if (auto* inst = std::get_if<express::base>(&v)) {
// So this never happens?
+1 -1
View File
@@ -293,7 +293,7 @@
#include "../ifcparse/file.h"
#include "../ifcparse/schema.h"
#include "../ifcparse/utils.h"
#include "../ifcgeom/conversion_settings.h"
#include "../ifcgeom/conversion_result.h"
+3 -3
View File
@@ -82,7 +82,7 @@
return false;
}
}
return true;
return true;
}
bool check_aggregate_of_aggregate_of_type(PyObject* aggregate, void* type_obj) {
@@ -273,8 +273,8 @@
// PyObject* pythonize(const ifcopenshell::geom::conversion_result_shape* t) { return SWIG_NewPointerObj(SWIG_as_voidptr(t), SWIGTYPE_p_ifcopenshell__geom__conversion_result_shape, 0); }
// NB: This cannot be temporary as a Python object is constructed from a pointer to the address of this object
// PyObject* pythonize(const ifcopenshell::geom::Material& t) { return SWIG_NewPointerObj(SWIG_as_voidptr(&t), SWIGTYPE_p_ifcopenshell__geom__Material, 0); }
PyObject* pythonize(const boost::dynamic_bitset<>& t) {
PyObject* pythonize(const boost::dynamic_bitset<>& t) {
std::string bitstring;
boost::to_string(t, bitstring);
return pythonize(bitstring);
+4 -4
View File
@@ -235,7 +235,7 @@ CREATE_VECTOR_TYPEMAP_IN(express::base, ENTITY INSTANCE, entity instance)
if (ascii) {
$1 = strcmp(PyBytes_AS_STRING(ascii), "UNKNOWN") == 0;
Py_DECREF(ascii);
}
}
}
}
@@ -274,20 +274,20 @@ CREATE_OPTIONAL_TYPEMAP_IN(std::string, string, str)
if (!PySequence_Check(aggregate)) return false;
for(Py_ssize_t i = 0; i < PySequence_Size(aggregate); ++i) {
PyObject* element = PySequence_GetItem(aggregate, i);
bool b = true;
void* argp1 = nullptr;
auto res1 = SWIG_ConvertPtr(element, &argp1, type_obj, 0);
if (!SWIG_IsOK(res1)) {
b = false;
}
Py_DECREF(element);
if (!b) {
return false;
}
}
return true;
return true;
}
template <typename T>
+2 -2
View File
@@ -43,11 +43,11 @@
return SWIG_NewPointerObj(new attribute_value_derived, SWIGTYPE_p_attribute_value_derived, SWIG_POINTER_OWN);
} else {
Py_INCREF(Py_None);
return static_cast<PyObject*>(Py_None);
return static_cast<PyObject*>(Py_None);
}
} else if constexpr (std::is_same_v<u, ifcopenshell::empty_aggregate> || std::is_same_v<u, ifcopenshell::empty_aggregate_of_aggregate> || std::is_same_v<u, ifcopenshell::blank>) {
Py_INCREF(Py_None);
return static_cast<PyObject*>(Py_None);
return static_cast<PyObject*>(Py_None);
} else {
return pythonize(v);
}