Merge branch 'fixPropertyDuplication' into 'master'

changed the way status propertzies are copied.

Closes #48

See merge request OpenMesh/OpenMesh!144
This commit is contained in:
Jan Möbius
2017-10-24 20:55:11 +02:00
2 changed files with 216 additions and 215 deletions

View File

@@ -84,21 +84,20 @@ void ArrayKernel::assign_connectivity(const ArrayKernel& _other)
eprops_resize(n_edges()); eprops_resize(n_edges());
fprops_resize(n_faces()); fprops_resize(n_faces());
#define COPY_STATUS_PROPERTY(ENTITY) \ //just copy status properties for now,
if (_other.ENTITY##_status_.is_valid()) \ //until a proper solution for refcounted
{ \ //properties is available
if (!ENTITY##_status_.is_valid()) \ vertex_status_ = _other.vertex_status_;
{ \ halfedge_status_ = _other.halfedge_status_;
request_##ENTITY##_status(); \ edge_status_ = _other.edge_status_;
} \ face_status_ = _other.face_status_;
property(ENTITY##_status_) = _other.property(_other.ENTITY##_status_); \
}
COPY_STATUS_PROPERTY(vertex)
COPY_STATUS_PROPERTY(halfedge)
COPY_STATUS_PROPERTY(edge)
COPY_STATUS_PROPERTY(face)
#undef COPY_STATUS_PROPERTY //initialize refcounter to 1 for the new mesh,
//if status is available.
refcount_estatus_ = _other.refcount_estatus_ > 0 ? 1 : 0;
refcount_vstatus_ = _other.refcount_vstatus_ > 0 ? 1 : 0;
refcount_hstatus_ = _other.refcount_hstatus_ > 0 ? 1 : 0;
refcount_fstatus_ = _other.refcount_fstatus_ > 0 ? 1 : 0;
} }
// --- handle -> item --- // --- handle -> item ---

View File

@@ -879,10 +879,7 @@ private:
void init_bit_masks(BitMaskContainer& _bmc); void init_bit_masks(BitMaskContainer& _bmc);
void init_bit_masks(); void init_bit_masks();
private: protected:
VertexContainer vertices_;
EdgeContainer edges_;
FaceContainer faces_;
VertexStatusPropertyHandle vertex_status_; VertexStatusPropertyHandle vertex_status_;
HalfedgeStatusPropertyHandle halfedge_status_; HalfedgeStatusPropertyHandle halfedge_status_;
@@ -894,6 +891,11 @@ private:
unsigned int refcount_estatus_; unsigned int refcount_estatus_;
unsigned int refcount_fstatus_; unsigned int refcount_fstatus_;
private:
VertexContainer vertices_;
EdgeContainer edges_;
FaceContainer faces_;
BitMaskContainer halfedge_bit_masks_; BitMaskContainer halfedge_bit_masks_;
BitMaskContainer edge_bit_masks_; BitMaskContainer edge_bit_masks_;
BitMaskContainer vertex_bit_masks_; BitMaskContainer vertex_bit_masks_;