Toponaming: Bring in composite shapes for findSubshapesWithSharedVertex ( searchSubShape )

This commit is contained in:
Zheng, Lei
2024-07-18 17:09:48 -04:00
committed by bgbsww
parent 3fa339e9eb
commit f6494bdf05
8 changed files with 181 additions and 49 deletions

View File

@@ -113,7 +113,7 @@ class Flags {
Enum i;
public:
constexpr inline Flags(Enum f) : i(f) {}
constexpr inline Flags(Enum f = Enum()) : i(f) {}
constexpr bool testFlag(Enum f) const {
using u = typename std::underlying_type<Enum>::type;
return (i & f) == f && (static_cast<u>(f) != 0 || i == f);
@@ -125,6 +125,48 @@ public:
using u = typename std::underlying_type<Enum>::type;
return static_cast<u>(i) == static_cast<u>(f.i);
}
constexpr Enum getFlags() const {
return i;
}
constexpr Flags<Enum> &operator|=(const Flags<Enum> &other) {
i |= other.i;
return *this;
}
constexpr Flags<Enum> &operator|=(const Enum &f) {
i |= f;
return *this;
}
constexpr Flags<Enum> operator|(const Flags<Enum> &other) const {
return i | other.i;
}
constexpr Flags<Enum> operator|(const Enum &f) const {
return i | f;
}
constexpr Flags<Enum> &operator&=(const Flags<Enum> &other) {
i &= other.i;
return *this;
}
constexpr Flags<Enum> &operator&=(const Enum &f) {
i &= f;
return *this;
}
constexpr Flags<Enum> operator&(const Flags<Enum> &other) const {
return i & other.i;
}
constexpr Flags<Enum> operator&(const Enum &f) const {
return i & f;
}
constexpr Flags<Enum> operator~() const {
return ~i;
}
constexpr bool operator!() const {
return !i;
}
explicit operator bool() const {
return toUnderlyingType() != 0;
}
typename std::underlying_type<Enum>::type toUnderlyingType() const {
return static_cast<typename std::underlying_type<Enum>::type>(i);
}