HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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, const GU_Detail *skel_input_gdp );
39  bool updateRegionColors( OP_Context &context )
40  {
41  return updateRegionColors(context, nullptr);
42  }
43 
44  bool updateRegionSOPPaths();
45 
47  getRegionColors( OP_Context &context, const GU_Detail *skel_input_gdp )
48  {
49  if( myColorsDirtyFlag )
50  (void) updateRegionColors( context, skel_input_gdp );
51  return myRegionColors;
52  }
55  {
56  return getRegionColors(context, nullptr);
57  }
58 
59  const char *
60  getRegionPath( int path_index )
61  {
62  if( myRegionsDirtyFlag )
63  (void) updateRegions();
64  return myRegionPaths(path_index);
65  }
66  int
68  {
69  if( myRegionsDirtyFlag )
70  (void) updateRegions();
71  return myRegionPaths.entries();
72  }
73 
74  const char *
75  getSOPPath( int path_index )
76  {
77  if( mySOPPathsDirtyFlag )
78  (void) updateRegionSOPPaths();
79  return myRegionSOPPaths(path_index);
80  }
81 
82 private: // methods
83  bool updateRegions();
84  GU_DetailHandle getRegionHandle(UT_String path,
85  OP_Context &context);
86  int getRegionPrimNumber(int region_idx,
87  OP_Context &context);
88 
89 private: // data
90  int myOpId;
91  const GU_Detail *myGdp;
92  UT_Vector3Array myRegionColorData;
93  UT_ValArray<const UT_Vector3 *> myRegionColors;
94  UT_ValArray<const char *> myRegionPaths;
95  UT_ValArray<const char *> myRegionPrims;
96  UT_ValArray<char *> myRegionSOPPaths;
97  UT_String myRegionRootPath;
98  bool myColorsDirtyFlag : 1,
99  myRegionsDirtyFlag : 1,
100  mySOPPathsDirtyFlag : 1;
101  GEO_Detail::CaptureType myCaptureType;
102 };
103 
104 SOP_API bool SOPgetCaptureRegion(OP_Node *me, char *cregion,
105  UT_Matrix4 &parent_xform,
106  GU_DetailHandle &tube_gdh);
107 
109  GU_Detail *gdp, const char *root_path,
110  const char *cregion_name,
111  GEO_Detail::CaptureType capture_type);
112 
114  GU_Detail *gdp, const char *root_path,
115  const char *cregion_name,
116  GEO_Detail::CaptureType capture_type,
117  const GU_Detail *skel_input_gdp);
118 
119 
120 #endif // __SOP_CaptureData_h__
121 
SOP_API int SOPaddCaptureRegion(OP_Node *me, GU_Detail *gdp, const char *root_path, const char *cregion_name, GEO_Detail::CaptureType capture_type)
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:982
void
Definition: png.h:1083
OPENVDB_API void initialize()
Global registration of basic types.
Definition: logging.h:291
bool updateRegionColors(OP_Context &context)
const UT_ValArray< const UT_Vector3 * > & getRegionColors(OP_Context &context)
GLsizei const GLchar *const * path
Definition: glew.h:6461
#define SOP_API
Definition: SOP_API.h:10
GLdouble GLdouble t
Definition: glew.h:1398
const UT_ValArray< const UT_Vector3 * > & getRegionColors(OP_Context &context, const GU_Detail *skel_input_gdp)