HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <UT/UT_Array.h>
19 
20 #include "GU_Detail.h"
21 
22 class UT_InfoTree;
23 
24 //////////////////////////////////////////////////////////////////////////////
25 //
26 // gu_NameValuePair
27 //
28 // A simple class to store name/value pairs, where both name and value
29 // are strings.
30 //
31 //////////////////////////////////////////////////////////////////////////////
32 
34 {
35 public:
36  gu_NameValuePair (const char *label, const char *value);
37  gu_NameValuePair (const char *label, int value);
39 
40  void setName(const char *label) { myLabel.harden(label); }
41  const UT_String &getName() const { return myLabel; }
42 
43  void setValue(const char *value) { myValue.harden(value); }
44  void setValue(int value);
45  const UT_String &getValue() const { return myValue; }
46 
47  static int compare(gu_NameValuePair **a, gu_NameValuePair **b);
48 
49 private:
50  UT_String myLabel;
51  UT_String myValue;
52 };
53 
54 //////////////////////////////////////////////////////////////////////////////
55 //
56 // GU_DetailInfo
57 //
58 //////////////////////////////////////////////////////////////////////////////
59 
61 {
62 public:
63  GU_DetailInfo();
64  ~GU_DetailInfo();
65 
66  /// Fill 'branch' with info taken from 'geo'. Note: This method calls
67  /// extractInfo(..)
68  void fillInfoTree(const GU_Detail &geo,
69  const UT_Set<const void *> *ignore_memory,
70  bool instanced,
71  bool debug,
72  UT_InfoTree &branch);
73 
74 private:
75  void addGroups(UT_InfoTree &branch,
78  const char *group_name,
79  bool debug);
80  void addGroups(UT_InfoTree &branch,
82  const char *group_name,
83  bool debug);
84 
85  void addAttribute(UT_InfoTree *tree,
86  const GA_Attribute *atr,
87  bool debug);
88  void addAllAttributesToTree(UT_InfoTree *tree,
89  const GA_AttributeDict &dict,
90  bool debug);
91 
92  // Clear all member variable data
93  void clearDetails();
94 
95  /// Delete all heap member data
96  void deleteHeapDataMembers();
97 
98  /// Clears old member data and extracts new data from 'geo' and
99  /// recalculates all stats
100  void extractInfo(const GU_Detail &geo,
101  const UT_Set<const void *> *ignore_memory,
102  bool instanced,
103  bool debug);
104 
105  // Attributes. Note: Ct stands for "Count"
106  GA_Size myNurbcRatCt;
107  GA_Size myNurbsRatCt;
108  GA_Size myRbezcRatCt;
109  GA_Size myRbezsRatCt;
110  GA_Size myVpartCt;
111  GA_Size myVolumeCt;
112  GA_Size myVDBCt;
113  GA_Size myProfCt;
114  GA_Size myVisProfCt;
115  GA_Size myPackHidden;
116  GA_Size myPackLoaded;
117  GA_Size myPackTotal;
118  GA_Size myPtGrpsCt;
119  GA_Size myPrimGrpsCt;
120  GA_Size myEdgeGrpsCt;
121  int64 myFullMemUseInBytes;
122  int64 myNewMemUseInBytes;
123  int64 myUniqueMemUseInBytes;
124  bool myInstancedMem;
125  bool myDegenerate;
126 
127  // Custom Variable Mappings
128  UT_Array<gu_NameValuePair *> myCustomVarMappings;
129 };
130 
131 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:189
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:45
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:43
long long int64
Definition: SYS_Types.h:100
#define GU_API
Definition: GU_API.h:11
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:40
const UT_String & getName() const
Definition: GU_DetailInfo.h:41