MeshLib
 
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
11{
12 const Mesh & mesh;
13 const FaceBitSet * region = nullptr; // nullptr here means whole mesh
14
15 MeshPart( const Mesh & m, const FaceBitSet * bs = nullptr ) noexcept : mesh( m ), region( bs ) { }
16
17 // Make this assignable. A better idea would be to rewrite the class to not use references, but doing this instead preserves API compatibility.
18 MeshPart(const MeshPart &other) noexcept = default;
19 MeshPart &operator=(const MeshPart &other) noexcept
20 {
21 if (this != &other)
22 {
23 // In modern C++ the result doesn't need to be `std::launder`ed, right?
24 this->~MeshPart();
25 ::new((void *)this) MeshPart(other);
26 }
27 return *this;
28 }
29};
30
31} // namespace MR
Definition MRDotNet/MRBitSet.h:39
Definition MRCameraOrientationPlugin.h:7
struct MRMESH_CLASS MeshPart
Definition MRMesh/MRMeshFwd.h:466
Definition MRMesh/MRMeshPart.h:11
MeshPart & operator=(const MeshPart &other) noexcept
Definition MRMesh/MRMeshPart.h:19
MeshPart(const MeshPart &other) noexcept=default
const FaceBitSet * region
Definition MRMesh/MRMeshPart.h:13
const Mesh & mesh
Definition MRMesh/MRMeshPart.h:12
MeshPart(const Mesh &m, const FaceBitSet *bs=nullptr) noexcept
Definition MRMesh/MRMeshPart.h:15
Definition MRMesh/MRMesh.h:23