HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimClassifier.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: GEO_PrimClassifier.h ( GEO Library, C++)
7  *
8  * COMMENTS: This routine classifies primitives according to what
9  * meta-primitive they belong to. The exact definition of a
10  * meta-primitive depends on the classification done.
11  */
12 
13 #ifndef __GEO_PrimClassifier__
14 #define __GEO_PrimClassifier__
15 
16 #include "GEO_API.h"
17 #include <UT/UT_IntArray.h>
18 #include <GA/GA_Handle.h>
19 
20 class GEO_Detail;
22 class GA_PrimitiveGroup;
23 class GA_EdgeGroup;
24 
26 {
27 public:
29  : myNumClass(0)
30  {}
31 
32  void classifyByVertexUV(const GEO_Detail &gdp,
33  const GA_ROHandleV3 &attrib,
34  const GA_PrimitiveGroup *exclude_prims=NULL);
35  void classifyBySharedPoints(const GEO_Detail &gdp,
36  const GA_PrimitiveGroup *exclude_prims=NULL);
37  void classifyByEdgeCuts(const GEO_Detail &gdp,
39  const GA_EdgeGroup *cuts=NULL,
40  const GA_PrimitiveGroup *exclude_prims=NULL);
41 
42  int getClass(int idx) const
43  { return myClasses((unsigned)idx); }
44  int getNumClass() const
45  { return myNumClass; }
46  const UT_IntArray &getClassArray() const
47  { return myClasses; }
48 
49  int64 getMemoryUsage(bool inclusive) const
50  {
51  int64 mem = inclusive ? sizeof(*this) : 0;
52  mem += myClasses.getMemoryUsage(false);
53  return mem;
54  }
55 
56 protected:
57  // Methods which collapse & search for classes...
58  int findClass(int idx);
59 
62 };
63 
64 #endif
65 
int getNumClass() const
#define GEO_API
Definition: GEO_API.h:14
long long int64
Definition: SYS_Types.h:116
const UT_IntArray & getClassArray() const
int getClass(int idx) const
int64 getMemoryUsage(bool inclusive) const