MCPcopy Create free account
hub / github.com/ImageEngine/cortex / faceDirection

Function faceDirection

src/IECoreScene/MeshAlgoReorder.cpp:115–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115int faceDirection( FaceToVerticesMap &faceToVerticesMap, FaceId face, Edge edge )
116{
117 FaceToVerticesMap::const_iterator vit = faceToVerticesMap.find( face );
118 assert( vit != faceToVerticesMap.end() );
119 const VertexList &faceVertices = vit->second;
120
121 int numFaceVertices = faceVertices.size();
122
123 VertexList::const_iterator it = std::find( faceVertices.begin(), faceVertices.end(), edge.first );
124 assert( it != faceVertices.end() );
125
126 int edgeVertexOrigin = std::distance( faceVertices.begin(), it );
127
128 assert( faceVertices[ index( edgeVertexOrigin, numFaceVertices )] == edge.first );
129
130 int direction = 0;
131 if ( faceVertices[ index( edgeVertexOrigin+1, numFaceVertices )] == edge.second )
132 {
133 direction = 1;
134 }
135 else
136 {
137 assert( faceVertices[ index( edgeVertexOrigin-1, numFaceVertices )] == edge.second ) ;
138 direction = -1;
139 }
140
141 assert( direction == 1 || direction == -1 );
142 return direction;
143}
144
145void visitFace(
146 const MeshPrimitive * mesh,

Callers 1

visitFaceFunction · 0.85

Calls 6

findFunction · 0.85
indexFunction · 0.70
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected