HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_EdgeVerifier.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_EdgeVerifier.h ( GU Library, C++)
7  *
8  */
9 
10 #ifndef __GU_EdgeVerifier__
11 #define __GU_EdgeVerifier__
12 
13 #include "GU_API.h"
14 
15 #include <GA/GA_Types.h>
16 
17 #include <UT/UT_Map.h>
18 #include <UT/UT_Set.h>
19 
20 class GA_Detail;
21 template<typename T, bool B> class GA_EdgeT;
23 
24 /// This is a utility class to verify, in an iterative fashion, whether an edge
25 /// is topologically valid for the given detail. The lifetime of this class
26 /// should not exceed the lifetime of the detail passed in.
27 /// Note also that if the topology of detail changes, the
29 {
30 public:
31  GU_EdgeVerifier(const GA_Detail &gdp);
32 
33  /// Check if the given edge forms a valid topological edge and return
34  /// \c true if so.
35  bool isValidEdge(const GA_Edge &e);
36 
37  /// Returns the list of primitive that share this edge.
38  GA_OffsetArray getEdgePrimitives(const GA_Edge &e);
39 
40  /// Reset the edge verifier internal state. This should be called in case
41  /// the topology changes, such as a point/primitive added, deleted, or
42  /// re-ordered.
43  void reset();
44 
45 private:
47  const PrimSet &getPrimitiveSetForPoint(GA_Offset p);
48  PrimSet getOverlappingPrimitives(const GA_Edge &e);
49  bool verifyEdge(const GA_Edge &e) const;
50 
51  const GA_Detail &m_gdp;
52  UT_Map<GA_Offset, PrimSet> m_pointPrimMap;
53 };
54 
55 #endif // __GU_EdgeVerifier__
Unsorted map container.
Definition: UT_Map.h:83
GA_Size GA_Offset
Definition: GA_Types.h:617
#define GU_API
Definition: GU_API.h:11
Container class for all geometry.
Definition: GA_Detail.h:96