Added Vtr::FVarLevel method to merge FVar edge tags with Vtr::Level::Etags

This commit is contained in:
barfowl 2015-02-17 14:16:35 -08:00
parent cc6a89b373
commit 588c3060b3
2 changed files with 34 additions and 1 deletions

View File

@ -932,7 +932,6 @@ FVarLevel::getFaceCompositeValueAndVTag(ConstIndexArray & faceValues,
typedef Level::VTag VertTag;
typedef Level::VTag::VTagSize VertTagSize;
typedef ValueTag::ValueTagSize ValueTagSize;
//
// Create a composite VTag for the face that augments the vertex corners' VTag's with
@ -967,6 +966,37 @@ FVarLevel::getFaceCompositeValueAndVTag(ConstIndexArray & faceValues,
return compVTag;
}
Level::ETag
FVarLevel::getFaceCompositeCombinedEdgeTag(ConstIndexArray & faceEdges,
Level::ETag * fvarETags) const {
typedef Level::ETag FaceETag;
typedef Level::ETag::ETagSize FaceETagSize;
//
// Create a composite ETag for the face that augments the edges ETag's with
// topological information about the FVar values at each corner. Only when there is
// a mismatch does the FVar value need to be inspected further:
//
FaceETag compETag;
FaceETagSize & compInt = *(reinterpret_cast<FaceETagSize *>(&compETag));
compInt = 0;
for (int i = 0; i < faceEdges.size(); ++i) {
FaceETag & srcETag = fvarETags[i];
FaceETagSize & srcInt = *(reinterpret_cast<FaceETagSize *>(&srcETag));
srcETag = _level._edgeTags[faceEdges[i]];
FVarLevel::ETag const & fvarETag = _edgeTags[faceEdges[i]];
if (fvarETag._mismatch) {
srcETag._boundary = true;
}
compInt |= srcInt;
}
return compETag;
}
} // end namespace Vtr
} // end namespace OPENSUBDIV_VERSION

View File

@ -147,6 +147,9 @@ protected:
ConstIndexArray & faceVerts,
Level::VTag * fvarVTags) const;
Level::ETag getFaceCompositeCombinedEdgeTag(ConstIndexArray & faceEdges,
Level::ETag * fvarETags) const;
//
// Simple struct containing the "end faces" of a crease, i.e. the faces which
// contain the FVar values to be used when interpolating the crease. (Prefer