HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_HOM.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  * COMMENTS:
7  * This is the base class for all SOPs that use HOM to cook.
8  */
9 
10 #ifndef __SOP_HOM_h__
11 #define __SOP_HOM_h__
12 
13 #include "SOP_API.h"
14 #include "SOP_Node.h"
15 
16 #include <OP/OP_NamedMicroNodes.h>
17 
19 {
20 public:
21  SOP_HOM(
22  OP_Network *network, const char *name, OP_Operator *script_op_type);
23 
24  // Returns whether or not this sop is currently cooking. It's used
25  // by HOM to decide if this node's geometry may be modified.
26  bool isCooking() const { return myIsCooking; }
27 
28  // When this sop cooks, it first duplicates its input geometry and then
29  // runs a Python script. This method is used by HOM to get the detail
30  // handle for this sop when it is cooking.
32 
33  OP_ERROR cookMySop(OP_Context &context) override;
34 
35  // Call these methods from cookWithHOM() to set or clear the current point/
36  // primitive/vertex. This point/primitive/vertex determines the value of
37  // expressions inside parameters like $PT, $PR, hou.SopNode.curPoint, etc.
38  void setCurPoint(GA_Offset point)
39  { myCurPtOff[0] = point; }
40  void setCurPrim(GA_Offset prim)
41  { myCurPrimOff[0] = prim; }
42  void setCurVertex(GA_Offset vertex, int vertex_num)
43  {
44  myCurVtxOff[0] = vertex;
45  myCurVtxNum[0] = vertex_num;
46  }
47 
48  // This is only meant to be used by HOMF_SopNode so that cookWithHOM()
49  // python code can enable data id management while cooking.
50  void setManagesDataIDs(bool flag)
51  {
52  mySopFlags.setManagesDataIDs(flag);
53  }
54 
55  // This will set the time dependent flag based on parms, inputs and/or
56  // extra (non-graph) inputs.
57  void checkTimeDependencies(int do_parms=1,
58  int do_inputs=1,
59  int do_extras=1) override;
60 
61  // Overload dataMicroNodeConst() to support secondary named data
62  // micronodes.
63  const OP_DataMicroNode &dataMicroNodeConst() const override;
64 
65 protected:
66  virtual void cookWithHOM() = 0;
67 
68 private:
69  bool myIsCooking;
70 };
71 
72 
73 #endif
SIM_API const UT_StringHolder vertex
bool isCooking() const
Definition: SOP_HOM.h:26
void setCurPoint(GA_Offset point)
Definition: SOP_HOM.h:38
GU_DetailHandle & getDetailHandle()
Definition: SOP_HOM.h:31
UT_ErrorSeverity
Definition: UT_Error.h:25
GU_DetailHandle myGdpHandle
Definition: SOP_Node.h:1617
void setCurVertex(GA_Offset vertex, int vertex_num)
Definition: SOP_HOM.h:42
GA_Size GA_Offset
Definition: GA_Types.h:641
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual const OP_DataMicroNode & dataMicroNodeConst() const
Definition: OP_Node.h:1594
void setManagesDataIDs(bool flag)
Definition: SOP_HOM.h:50
virtual void checkTimeDependencies(int do_parms=1, int do_inputs=1, int do_extras=1)
#define SOP_API
Definition: SOP_API.h:10
void setCurPrim(GA_Offset prim)
Definition: SOP_HOM.h:40
virtual OP_ERROR cookMySop(OP_Context &context)=0