HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_CaptureData.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: SOP_CaptureData.h (SOP Library, C++)
7  *
8  * COMMENTS: Utility class for dealing with capture atttributes
9  */
10 
11 #ifndef __SOP_CaptureData_h__
12 #define __SOP_CaptureData_h__
13 
14 #include "SOP_API.h"
15 #include <OP/OP_Context.h>
16 #include <GEO/GEO_Detail.h>
17 #include <GU/GU_DetailHandle.h>
18 #include <UT/UT_IntArray.h>
19 #include <UT/UT_ValArray.h>
20 #include <UT/UT_String.h>
21 #include <UT/UT_VectorTypes.h>
22 
23 class GU_Detail;
24 class OP_Node;
25 class SOP_Node;
26 
28 {
29 public:
31  virtual ~SOP_CaptureData();
32 
33  void initialize(const OP_Node *node, const GU_Detail *gudp,
35  void destroy();
36  void dirtyCache();
37 
38  bool updateRegionColors( OP_Context &context );
39  bool updateRegionSOPPaths();
40 
43  {
44  if( myColorsDirtyFlag )
45  (void) updateRegionColors( context );
46  return myRegionColors;
47  }
48 
49  const char *
50  getRegionPath( int path_index )
51  {
52  if( myRegionsDirtyFlag )
53  (void) updateRegions();
54  return myRegionPaths(path_index);
55  }
56  int
58  {
59  if( myRegionsDirtyFlag )
60  (void) updateRegions();
61  return myRegionPaths.entries();
62  }
63 
64  const char *
65  getSOPPath( int path_index )
66  {
67  if( mySOPPathsDirtyFlag )
68  (void) updateRegionSOPPaths();
69  return myRegionSOPPaths(path_index);
70  }
71 
72 private: // methods
73  bool updateRegions();
74  GU_DetailHandle getRegionHandle(UT_String path,
75  OP_Context &context);
76  int getRegionPrimNumber(int region_idx,
77  OP_Context &context);
78 
79 private: // data
80  int myOpId;
81  const GU_Detail *myGdp;
82  UT_Vector3Array myRegionColorData;
83  UT_ValArray<const UT_Vector3 *> myRegionColors;
84  UT_ValArray<const char *> myRegionPaths;
85  UT_ValArray<const char *> myRegionPrims;
86  UT_ValArray<char *> myRegionSOPPaths;
87  UT_String myRegionRootPath;
88  bool myColorsDirtyFlag : 1,
89  myRegionsDirtyFlag : 1,
90  mySOPPathsDirtyFlag : 1;
91  GEO_Detail::CaptureType myCaptureType;
92 };
93 
94 SOP_API bool SOPgetCaptureRegion(OP_Node *me, char *cregion,
95  UT_Matrix4 &parent_xform,
96  GU_DetailHandle &tube_gdh);
97 
99  GU_Detail *gdp, const char *root_path,
100  const char *cregion_name,
101  GEO_Detail::CaptureType capture_type);
102 
103 #endif // __SOP_CaptureData_h__
104 
SOP_API int SOPaddCaptureRegion(OP_Node *me, GU_Detail *gdp, const char *root_path, const char *cregion_name, GEO_Detail::CaptureType capture_type)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
const char * getSOPPath(int path_index)
SOP_API bool SOPgetCaptureRegion(OP_Node *me, char *cregion, UT_Matrix4 &parent_xform, GU_DetailHandle &tube_gdh)
const char * getRegionPath(int path_index)
CaptureType
Methods for manipulating capture weights (GEO_CaptureWeight.C)
Definition: GEO_Detail.h:915
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:316
const UT_ValArray< const UT_Vector3 * > & getRegionColors(OP_Context &context)
#define SOP_API
Definition: SOP_API.h:10