Skip to content

Conversation

@gostefan
Copy link
Contributor

Currently the CityObjectsType enum is a 64 bit integer and 53 of these bits are already in use with many city object types not yet assigned a number.
Having a limit of 64 (or even 128) values is not an option to cover the full CityGML specification. Therefore we need to move to a version that doesn't have such a limit.

This PR:

  • fixes the ParserParams::objectsMask filtering which was broken.
  • Moves the CityObjectsTypeMask to use an std::bitset because its size is unbounded.
  • Does as much legacy handling as possible so library users hopefully can keep their code unchanged.

Since quite some of my PRs aren't merged yet, some are also included in this PR because I find it hard to develop with so many warnings popping up and without tests.

This prohibits the calling code from compiling methods that
weren't used in the main library code.
E.g. the copy constructor doesn't get generated.

Without this any test ussing the enum type bitmask cannot
link correctly.
These tests don't all pass yet - specifically
the FilterBuilding tests fail.

At this point the tests don't even compile.
The next commit will fix this.
Currently this will lead to a stack overflow
as the Bitmask operators are implemented by
the binary operations on the types.

But this prepares for the move away from
operations on the underlying type of the
CityObjectType enum.
The interface of the two is almost identical and
there is no reason to maintain a custom implementation.
Using only PoT values had a hard limit of 64 (or maximum 128)
entries in the enum.
The CityGML spec has for sure more than 64 CityObject types.
Possibly even more than 128.
Without this change existing code like the following will
not compile anymore:
ParserParams params;
params.objectsMask = CityObject::CityObjectsType::COT_All;
This makes sure that legacy code can compile as before again.
This can be seen as a guide on how to transition existing
client code to the new interface.
Most probably there is no such code because the filtering
doesn't work currently.
@gostefan
Copy link
Contributor Author

gostefan commented Sep 6, 2025

Rebased the branch on current master.

@jklimke jklimke merged commit 6721479 into jklimke:master Sep 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants