15 constexpr Id() noexcept : id_( -1 ) { }
17 explicit constexpr Id(
int i ) noexcept : id_( i ) { }
18 explicit constexpr Id(
unsigned int i ) noexcept : id_( i ) { }
19 explicit constexpr Id(
size_t i ) noexcept : id_(
int( i ) ) { }
20 template <
typename U>
Id(
Id<U> ) =
delete;
22 constexpr operator int()
const {
return id_; }
23 constexpr bool valid()
const {
return id_ >= 0; }
24 explicit constexpr operator bool()
const {
return id_ >= 0; }
25 constexpr int &
get() noexcept {
return id_; }
41 constexpr Id operator --(
int ) {
auto res = *
this; --id_;
return res; }
42 constexpr Id operator ++(
int ) {
auto res = *
this; ++id_;
return res; }
55 constexpr Id() noexcept : id_( -1 ) { }
57 constexpr Id( UndirectedEdgeId u ) noexcept : id_( (
int)u << 1 ) { assert( u.valid() ); }
58 explicit constexpr Id(
int i ) noexcept : id_( i ) { }
59 explicit constexpr Id(
unsigned int i ) noexcept : id_( i ) { }
60 explicit constexpr Id(
size_t i ) noexcept : id_(
int( i ) ) { }
61 constexpr operator int()
const {
return id_; }
62 constexpr bool valid()
const {
return id_ >= 0; }
63 explicit constexpr operator bool()
const {
return id_ >= 0; }
64 constexpr int &
get() noexcept {
return id_; }
67 constexpr Id sym()
const { assert(
valid() );
return Id(id_ ^ 1); }
69 constexpr bool even()
const { assert(
valid() );
return (id_ & 1) == 0; }
70 constexpr bool odd()
const { assert(
valid() );
return (id_ & 1) == 1; }
72 constexpr UndirectedEdgeId
undirected()
const { assert(
valid() );
return UndirectedEdgeId( id_ >> 1 ); }
73 constexpr operator UndirectedEdgeId()
const {
return undirected(); }
89 constexpr Id operator --(
int ) {
auto res = *
this; --id_;
return res; }
90 constexpr Id operator ++(
int ) {
auto res = *
this; ++id_;
return res; }
103 constexpr Id() noexcept : id_( ~
size_t( 0 ) ) { }
105 explicit constexpr Id(
size_t i ) noexcept : id_( i ) { }
106 explicit constexpr Id(
int )
noexcept =
delete;
107 constexpr operator size_t()
const {
return id_; }
108 constexpr bool valid()
const {
return id_ != ~size_t( 0 ); }
109 explicit constexpr operator bool()
const {
return id_ != ~size_t( 0 ); }
110 constexpr size_t&
get() noexcept {
return id_; }
116 template <
typename U>
118 template <
typename U>
120 template <
typename U>
150inline constexpr FaceId operator "" _f(
unsigned long long i )
noexcept {
return FaceId{ (int)i }; }
151inline constexpr VertId operator "" _v(
unsigned long long i )
noexcept {
return VertId{ (int)i }; }
152inline constexpr EdgeId operator "" _e(
unsigned long long i )
noexcept {
return EdgeId{ (int)i }; }
153inline constexpr UndirectedEdgeId
operator "" _ue(
unsigned long long i )
noexcept {
return UndirectedEdgeId{ (int)i }; }
154inline constexpr VoxelId
operator "" _vox(
unsigned long long i )
noexcept {
return VoxelId{ size_t( i ) }; }
int VertId
Definition MRDotNet/MRMeshFwd.h:51
int FaceId
Definition MRDotNet/MRMeshFwd.h:53
int EdgeId
Definition MRDotNet/MRMeshFwd.h:52
constexpr bool valid() const
Definition MRMesh/MRId.h:62
constexpr bool odd() const
Definition MRMesh/MRId.h:70
constexpr UndirectedEdgeId undirected() const
Definition MRMesh/MRId.h:72
constexpr Id sym() const
Definition MRMesh/MRId.h:67
Id(NoInit) noexcept
Definition MRMesh/MRId.h:56
constexpr Id(size_t i) noexcept
Definition MRMesh/MRId.h:60
constexpr Id(unsigned int i) noexcept
Definition MRMesh/MRId.h:59
constexpr Id(UndirectedEdgeId u) noexcept
Definition MRMesh/MRId.h:57
constexpr Id() noexcept
Definition MRMesh/MRId.h:55
constexpr bool even() const
Definition MRMesh/MRId.h:69
constexpr Id(int i) noexcept
Definition MRMesh/MRId.h:58
constexpr int & get() noexcept
Definition MRMesh/MRId.h:64
constexpr bool valid() const
Definition MRMesh/MRId.h:108
constexpr Id(size_t i) noexcept
Definition MRMesh/MRId.h:105
constexpr Id() noexcept
Definition MRMesh/MRId.h:103
constexpr size_t & get() noexcept
Definition MRMesh/MRId.h:110
Id(NoInit) noexcept
Definition MRMesh/MRId.h:104
constexpr Id(int) noexcept=delete
Definition MRMesh/MRId.h:13
constexpr Id(int i) noexcept
Definition MRMesh/MRId.h:17
constexpr bool operator!=(Id b) const
Definition MRMesh/MRId.h:28
constexpr Id & operator++()
Definition MRMesh/MRId.h:39
Id(NoInit) noexcept
Definition MRMesh/MRId.h:16
constexpr bool operator==(Id b) const
Definition MRMesh/MRId.h:27
constexpr Id(unsigned int i) noexcept
Definition MRMesh/MRId.h:18
constexpr bool valid() const
Definition MRMesh/MRId.h:23
constexpr Id(size_t i) noexcept
Definition MRMesh/MRId.h:19
constexpr Id & operator--()
Definition MRMesh/MRId.h:38
constexpr Id() noexcept
Definition MRMesh/MRId.h:15
constexpr bool operator<(Id b) const
Definition MRMesh/MRId.h:29
constexpr int & get() noexcept
Definition MRMesh/MRId.h:25
constexpr Id & operator-=(int a)
Definition MRMesh/MRId.h:44
constexpr Id & operator+=(int a)
Definition MRMesh/MRId.h:45
BitSet operator-(const BitSet &a, const BitSet &b)
Definition MRMesh/MRBitSet.h:325
Definition MRCameraOrientationPlugin.h:7
class MRMESH_CLASS VoxelTag
Definition MRMesh/MRMeshFwd.h:65
class MRMESH_CLASS EdgeTag
Definition MRMesh/MRMeshFwd.h:60
Color operator+(const Color &a, const Color &b)
Definition MRColor.h:108
Definition MRMesh/MRMeshFwd.h:56