HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_RingZero.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_RingZero.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_RINGZERO_H_INCLUDED__
12 #define __GU_RINGZERO_H_INCLUDED__
13 
14 #include "GU_API.h"
15 #include <SYS/SYS_Types.h>
16 
17 /// @file
18 /// Utilities for using the results of GU_Detail::buildRingZeroPoints().
19 
20 /// Given a ringzero and corresponding ringvalence, determine if the given
21 /// point is a "border" point which is true if,
22 /// - For closed faces, the point is on an unshared edge
23 /// - For open faces, the point is on the end of the curve
24 static inline bool
25 GUringZeroIsBorderPoint(exint ring_size, exint ring_valence)
26 {
27  // A boundary point is one which doesn't have a pair of each unique edge.
28  // As this is hard to find, we take the simpler, and usually correct,
29  // course of checking if the number of unique adjacent edges is one half
30  // the number of edges. However, we do an less than test for this to
31  // exclude points on non-manifold edges.
32  //
33  // The (ring_size < 2) test is to ensure that the end points of curves are
34  // treated as a border point.
35  //
36  return (ring_size < 2 || 2*ring_size > ring_valence);
37 }
38 
39 #endif // __GU_RINGZERO_H_INCLUDED__
int64 exint
Definition: SYS_Types.h:116