HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 class SOP_API SOP_HOM : public SOP_Node
17 {
18 public:
19  SOP_HOM(
20  OP_Network *network, const char *name, OP_Operator *script_op_type);
21 
22  // Returns whether or not this sop is currently cooking. It's used
23  // by HOM to decide if this node's geometry may be modified.
24  bool isCooking() const { return myIsCooking; }
25 
26  // When this sop cooks, it first duplicates its input geometry and then
27  // runs a Python script. This method is used by HOM to get the detail
28  // handle for this sop when it is cooking.
30 
31  virtual OP_ERROR cookMySop(OP_Context &context);
32 
33  // Call these methods from cookWithHOM() to set or clear the current point/
34  // primitive/vertex. This point/primitive/vertex determines the value of
35  // expressions inside parameters like $PT, $PR, hou.SopNode.curPoint, etc.
36  void setCurPoint(GA_Offset point)
37  { myCurPtOff[0] = point; }
38  void setCurPrim(const GEO_Primitive *prim)
39  { myCurPrimOff[0] = (prim ? prim->getMapOffset() : GA_INVALID_OFFSET); }
40  void setCurVertex(GA_Offset vertex, int vertex_num)
41  {
42  myCurVtxOff[0] = vertex;
43  myCurVtxNum[0] = vertex_num;
44  }
45 
46 protected:
47  virtual void cookWithHOM() = 0;
48 
49 private:
50  bool myIsCooking;
51 };
52 
53 #endif
bool isCooking() const
Definition: SOP_HOM.h:24
void setCurPrim(const GEO_Primitive *prim)
Definition: SOP_HOM.h:38
void setCurPoint(GA_Offset point)
Definition: SOP_HOM.h:36
GU_DetailHandle & getDetailHandle()
Definition: SOP_HOM.h:29
UT_ErrorSeverity
Definition: UT_Error.h:25
GU_DetailHandle myGdpHandle
Definition: SOP_Node.h:1593
void setCurVertex(GA_Offset vertex, int vertex_num)
Definition: SOP_HOM.h:40
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Size GA_Offset
Definition: GA_Types.h:617
GLuint const GLchar * name
Definition: glcorearb.h:785
SYS_FORCE_INLINE GA_Offset getMapOffset() const
Gets the offset of this primitive in the detail containing it.
Definition: GA_Primitive.h:137
#define SOP_API
Definition: SOP_API.h:10
virtual OP_ERROR cookMySop(OP_Context &context)=0