///////////////////////////////////// // get_visibility() ///////////////////////////////////// void HatchingGroupFixed::get_visibility(TAGformat &d) { err_mesg(ERR_LEV_SPAM, "HatchingGroupFixed::get_visibility()"); BMESH *m = _patch->mesh(); if (LMESH::isa(m)) m = ((LMESH*)m)->cur_mesh(); int k, ctr=0; ARRAY<int> indices; CBface_list& faces = m->faces(); *d >> indices; for (k=0; k<indices.num(); k++) { HatchingSimplexDataFixed *hsdf = HatchingSimplexDataFixed::find(faces[indices[k]]); if (!hsdf) { hsdf = new HatchingSimplexDataFixed(faces[indices[k]]); ctr++; } hsdf->add(this); } err_mesg(ERR_LEV_SPAM, "HatchingGroupFixed::get_visibility() - Flagged %d tris and added %d new simplex data.", indices.num(), ctr); }
///////////////////////////////////// // put_visibility() ///////////////////////////////////// void HatchingGroupFixed::put_visibility(TAGformat &d) const { err_mesg(ERR_LEV_SPAM, "HatchingGroupFixed::put_visibility()"); BMESH *m = _patch->mesh(); if (LMESH::isa(m)) m = ((LMESH*)m)->cur_mesh(); int k; ARRAY<int> indices; CBface_list& faces = m->faces(); for (k=0; k< faces.num(); k++) { HatchingSimplexDataFixed *hsdf = HatchingSimplexDataFixed::find(faces[k]); if (hsdf) { if(hsdf->hack_exists(this)) indices += faces[k]->index(); } } err_mesg(ERR_LEV_SPAM, "HatchingGroupFixed::put_visibility() - Stored %d tri indices.", indices.num()); d.id(); *d << indices; d.end_id(); }