HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_DetailInfo.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_DetailInfo.h (C++)
7  *
8  * COMMENTS: This class takes in a GU_Detail object and calculates/stores a
9  * bunch of stats based on info extracted from that object. This
10  * code used to be repeated in a few different place elsewhere, but
11  * has now been encapsulated here because we're better than that!
12  */
13 
14 #ifndef __GU_DetailInfo_h__
15 #define __GU_DetailInfo_h__
16 
17 #include "GU_API.h"
18 #include "GU_Detail.h"
19 
20 #include <UT/UT_Array.h>
21 #include <UT/UT_ArraySet.h>
22 
23 class UT_InfoTree;
24 
25 //////////////////////////////////////////////////////////////////////////////
26 //
27 // gu_NameValuePair
28 //
29 // A simple class to store name/value pairs, where both name and value
30 // are strings.
31 //
32 //////////////////////////////////////////////////////////////////////////////
33 
35 {
36 public:
37  gu_NameValuePair (const char *label, const char *value);
38  gu_NameValuePair (const char *label, int value);
40 
41  void setName(const char *label) { myLabel.harden(label); }
42  const UT_String &getName() const { return myLabel; }
43 
44  void setValue(const char *value) { myValue.harden(value); }
45  void setValue(int value);
46  const UT_String &getValue() const { return myValue; }
47 
48  static int compare(gu_NameValuePair **a, gu_NameValuePair **b);
49 
50 private:
51  UT_String myLabel;
52  UT_String myValue;
53 };
54 
55 //////////////////////////////////////////////////////////////////////////////
56 //
57 // GU_DetailInfo
58 //
59 //////////////////////////////////////////////////////////////////////////////
60 
62 {
63 public:
64  GU_DetailInfo();
65  ~GU_DetailInfo();
66 
67  /// Fill 'branch' with info taken from 'geo'. Note: This method calls
68  /// extractInfo(..)
69  void fillInfoTree(const GU_Detail &geo,
70  const UT::ArraySet<const void *> *ignore_memory,
71  bool instanced,
72  bool debug,
73  UT_InfoTree &branch);
74 
75 private:
76  void addGroups(UT_InfoTree &branch,
79  const char *group_name,
80  bool debug);
81  void addGroups(UT_InfoTree &branch,
83  const char *group_name,
84  bool debug);
85 
86  void addAttribute(UT_InfoTree *tree,
87  const GA_Attribute *atr,
88  bool debug);
89  void addAllAttributesToTree(UT_InfoTree *tree,
90  const GA_AttributeDict &dict,
91  bool debug);
92 
93  // Clear all member variable data
94  void clearDetails();
95 
96  /// Delete all heap member data
97  void deleteHeapDataMembers();
98 
99  /// Clears old member data and extracts new data from 'geo' and
100  /// recalculates all stats
101  void extractInfo(const GU_Detail &geo,
102  const UT::ArraySet<const void *> *ignore_memory,
103  bool instanced,
104  bool debug);
105 
106  // Attributes. Note: Ct stands for "Count"
107  GA_Size myNurbcRatCt;
108  GA_Size myNurbsRatCt;
109  GA_Size myRbezcRatCt;
110  GA_Size myRbezsRatCt;
111  GA_Size myVpartCt;
112  GA_Size myVolumeCt;
113  GA_Size myVDBCt;
114  GA_Size myProfCt;
115  GA_Size myVisProfCt;
116  GA_Size myPackHidden;
117  GA_Size myPackLoaded;
118  GA_Size myPackTotal;
119  GA_Size myPtGrpsCt;
120  GA_Size myPrimGrpsCt;
121  GA_Size myEdgeGrpsCt;
122  int64 myFullMemUseInBytes;
123  int64 myNewMemUseInBytes;
124  int64 myUniqueMemUseInBytes;
125  bool myInstancedMem;
126  bool myDegenerate;
127 
128  // Custom Variable Mappings
129  UT_Array<gu_NameValuePair *> myCustomVarMappings;
130 };
131 
132 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:190
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
const UT_String & getValue() const
Definition: GU_DetailInfo.h:46
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
A string map of attributes to ease backward compatibility In the GB/GEO/GU library code would often p...
void setValue(const char *value)
Definition: GU_DetailInfo.h:44
long long int64
Definition: SYS_Types.h:107
#define GU_API
Definition: GU_API.h:12
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
GLsizei const GLfloat * value
Definition: glcorearb.h:823
void setName(const char *label)
Definition: GU_DetailInfo.h:41
const UT_String & getName() const
Definition: GU_DetailInfo.h:42