Commit 29cbe820 authored by Martin Schultz's avatar Martin Schultz

changed the way status propertzies are copied.

refcount is set to 1 if it was > 0 in the original mesh
fixes #48
parent 64947924
Pipeline #5834 passed with stage
in 43 minutes and 20 seconds
...@@ -84,21 +84,20 @@ void ArrayKernel::assign_connectivity(const ArrayKernel& _other) ...@@ -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_); \
} //initialize refcounter to 1 for the new mesh,
COPY_STATUS_PROPERTY(vertex) //if status is available.
COPY_STATUS_PROPERTY(halfedge) refcount_estatus_ = _other.refcount_estatus_ > 0 ? 1 : 0;
COPY_STATUS_PROPERTY(edge) refcount_vstatus_ = _other.refcount_vstatus_ > 0 ? 1 : 0;
COPY_STATUS_PROPERTY(face) refcount_hstatus_ = _other.refcount_hstatus_ > 0 ? 1 : 0;
refcount_fstatus_ = _other.refcount_fstatus_ > 0 ? 1 : 0;
#undef COPY_STATUS_PROPERTY
} }
// --- handle -> item --- // --- handle -> item ---
......
...@@ -879,10 +879,7 @@ private: ...@@ -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: ...@@ -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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment