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  ~SOP_MDD() override;
31 
33  OP_NodeInfoParms &iparms) override;
34 
36  const OP_NodeInfoTreeParms &parms) override;
37 
38  bool evalVariableValue(
39  fpreal &v,
40  int index,
41  int thread) override;
42  // create overload that delegates to super class to avoid shadow warnings
44  UT_String &v,
45  int i,
46  int thread) override
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  OP_ERROR cookMySop(OP_Context &context) override;
66  int reloadNewFiles(fpreal now) override;
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
CoordSysType
Definition: SOP_MDD.h:59
bool evalVariableValue(fpreal &val, int index, int thread) override
GLuint const GLchar * name
Definition: glew.h:1814
virtual int reloadNewFiles(fpreal time_now)
GLuint index
Definition: glew.h:1814
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
const GLdouble * v
Definition: glew.h:1391
void evalString(UT_String &val, int pi, int vi, fpreal t) const
*Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
fpreal64 fpreal
Definition: SYS_Types.h:277
#define SOP_API
Definition: SOP_API.h:10
exint evalInt(int pi, int vi, fpreal t) const
virtual OP_ERROR cookMySop(OP_Context &context)=0
void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &iparms) override
bool evalVariableValue(UT_String &v, int i, int thread) override
Definition: SOP_MDD.h:43
GLdouble GLdouble t
Definition: glew.h:1398
void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms) override
Fill in tree with this SOP's details.