MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshPart.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4
5namespace MR
6{
7
10template<typename RegionTag>
12{
13 const Mesh& mesh;
14 const TaggedBitSet<RegionTag>* region = nullptr; // nullptr here means whole mesh
15
16 MeshRegion( const Mesh& m, const TaggedBitSet<RegionTag>* bs = nullptr ) noexcept : mesh( m ), region( bs )
17 {}
18
19 // Make this assignable. A better idea would be to rewrite the class to not use references, but doing this instead preserves API compatibility.
20 MeshRegion( const MeshRegion& other ) noexcept = default;
22 {
23 if ( this != &other )
24 {
25 // In modern C++ the result doesn't need to be `std::launder`ed, right?
26 this->~MeshRegion();
27 ::new( ( void* )this ) MeshRegion( other );
28 }
29 return *this;
30 }
31};
32
33} // namespace MR
container of bits representing specific indices (faces, verts or edges)
Definition MRMesh/MRBitSet.h:127
Definition MRCameraOrientationPlugin.h:8
Definition MRMesh/MRMeshPart.h:12
const TaggedBitSet< RegionTag > * region
Definition MRMesh/MRMeshPart.h:14
MeshRegion(const Mesh &m, const TaggedBitSet< RegionTag > *bs=nullptr) noexcept
Definition MRMesh/MRMeshPart.h:16
MeshRegion & operator=(const MeshRegion &other) noexcept
Definition MRMesh/MRMeshPart.h:21
const Mesh & mesh
Definition MRMesh/MRMeshPart.h:13
MeshRegion(const MeshRegion &other) noexcept=default
Definition MRMesh/MRMesh.h:23