HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_MDD.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_MDD.h (SOP Library, C++)
7  *
8  * COMMENTS:
9  * This SOP accepts as input an MDD file specifying a sequence of point clouds
10  * and a geometry with an equal number of points. At each time t, the SOP
11  * assigns the position of each point to its position in the point cloud.
12  */
13 
14 #ifndef __SOP_MDD__
15 #define __SOP_MDD__
16 
17 #include "SOP_API.h"
18 #include <sys/types.h>
19 
20 #include <UT/UT_Vector3Array.h>
21 
22 #include "SOP_Node.h"
23 
24 class sopMDDFile;
25 
26 class SOP_API SOP_MDD : public SOP_Node
27 {
28 public:
29  SOP_MDD(OP_Network *net, const char *name, OP_Operator *entry);
30  virtual ~SOP_MDD();
31 
32  virtual void getNodeSpecificInfoText(OP_Context &context,
33  OP_NodeInfoParms &iparms);
34 
35  virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,
36  const OP_NodeInfoTreeParms &parms);
37 
38  virtual bool evalVariableValue(
39  fpreal &v,
40  int index,
41  int thread);
42  // create overload that delegates to super class to avoid shadow warnings
43  virtual bool evalVariableValue(
44  UT_String &v,
45  int i,
46  int thread)
47  {
49  v, i, thread);
50  }
51 
52  static OP_Node *myConstructor(OP_Network *net,
53  const char *name,
54  OP_Operator *entry);
55 
56  static PRM_Template myTemplateList[];
57  static CH_LocalVariable myVariables[];
58 
59  enum CoordSysType {
60  COORDSYS_LEFT, // left-handed coordinate system (Houdini)
61  COORDSYS_RIGHT // right-handed coordinate system (Lightwave)
62  };
63 
64 protected:
65  virtual OP_ERROR cookMySop(OP_Context &context);
66  virtual int reloadNewFiles(fpreal now);
67 
68  /// Reload the MDD file forcibly
69  static int reloadMDDStatic(void *op, int idx,
70  fpreal t, const PRM_Template *);
71 private:
72  bool evaluateMDD(fpreal t, UT_Vector3Array *&);
73 
74  void FNAME(UT_String &str, fpreal t)
75  { evalString(str, 0, 0, t); }
76  int INTERP(fpreal t)
77  { return evalInt("interp", 0, t); }
78  fpreal FRAME(fpreal t)
79  { return evalFloat("frame", 0, t); }
80  CoordSysType COORDSYS(fpreal t)
81  { return (CoordSysType)
82  evalInt("coordsys", 0, t); }
83  bool SHIFT_START(fpreal t)
84  { return evalInt("shiftstart", 0, t); }
85 
86  time_t myLastModified;
87  UT_String myLastFilename;
88  sopMDDFile *myFile;
89 };
90 
91 #endif
virtual bool evalVariableValue(UT_String &v, int i, int thread)
Definition: SOP_MDD.h:43
CoordSysType
Definition: SOP_MDD.h:59
virtual int reloadNewFiles(fpreal time_now)
const GLdouble * v
Definition: glcorearb.h:836
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
virtual bool evalVariableValue(fpreal &val, int index, int thread) override
png_uint_32 i
Definition: png.h:2877
void evalString(UT_String &val, int pi, int vi, fpreal t) const
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:270
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &iparms) override
GLuint index
Definition: glcorearb.h:785
#define SOP_API
Definition: SOP_API.h:10
exint evalInt(int pi, int vi, fpreal t) const
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms) override
Fill in tree with this SOP's details.
virtual OP_ERROR cookMySop(OP_Context &context)=0