HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_Sticky.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: OBJ_Sticky.h (Custom Library, C++)
7  *
8  * COMMENTS: An object to fetch it's transform from another object.
9  *
10  */
11 
12 #ifndef __OBJ_Sticky__
13 #define __OBJ_Sticky__
14 
15 #include "OBJ_API.h"
16 #include <UT/UT_Vector2.h>
17 #include <UT/UT_Vector3Array.h>
18 #include <GU/GU_DetailHandle.h>
19 #include "OBJ_StickyShared.h"
20 
22 {
26 
28 };
29 
30 class obj_UVCache;
31 class GEO_Vertex;
32 class GEO_Hull;
33 
35 {
36 public:
38  const char *name,
39  OP_Operator *op);
40 
41  ~OBJ_Sticky() override {}
42 
43  static OP_Node *myConstructor(OP_Network *net,
44  const char *name,
45  OP_Operator *entry);
46 
47  static PRM_Template *getTemplateList();
48 
49  // 2d transform code:
51  UT_DMatrix4 &mat,
52  OP_Context &context) override;
53 
54  OBJ_Sticky *castToOBJSticky() override { return this; }
55 
57  UT_String &str, fpreal t) override
58  {
59  evalString(str, "stickysop", 0, t);
60  }
61  void STICKYUV(UT_Vector2R &uv, fpreal t) override
62  {
63  uv.x() = evalFloat("stickyuv", 0, t);
64  uv.y() = evalFloat("stickyuv", 1, t);
65  }
67  {
68  return evalFloat("stickyrot", 0, t);
69  }
70 
72  CH_StringMeaning meaning, fpreal t)
73  {
74  setString(str, meaning, "stickysop", 0, t);
75  }
77  {
78  setFloat("stickyuv", 0, t, uv.x());
79  setFloat("stickyuv", 1, t, uv.y());
80  }
81 
82 protected:
83  void getUV(UT_Vector2R &uv,
84  OP_Context &context) override;
85 
86  // Used to get pointer to indirection indices for each object type
87  int *getIndirect() const override
88  { return stickyIndirect; }
89 
90  static int *stickyIndirect;
91 
92 };
93 #endif
94 
void STICKYUV(UT_Vector2R &uv, fpreal t) override
Definition: OBJ_Sticky.h:61
OBJ_StickyIndex
Definition: OBJ_Sticky.h:21
static PRM_Template * getTemplateList()
GA_API const UT_StringHolder uv
CH_StringMeaning
OBJ_Sticky * castToOBJSticky() override
Definition: OBJ_Sticky.h:54
fpreal evalFloat(int pi, int vi, fpreal t) const
void setString(const UT_StringRef &val, CH_StringMeaning meaning, int parmi, int vectori, fpreal t)
void setSTICKYGEOPATH(UT_String &str, CH_StringMeaning meaning, fpreal t)
Definition: OBJ_Sticky.h:71
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
fpreal STICKYROT(fpreal t) override
Definition: OBJ_Sticky.h:66
void evalString(UT_String &val, int pi, int vi, fpreal t) const
int * getIndirect() const override
Definition: OBJ_Sticky.h:87
static int * stickyIndirect
Definition: OBJ_Sticky.h:90
bool get2DWorldTransform(UT_DMatrix4 &mat, OP_Context &context) override
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
void setSTICKYUV(const UT_Vector2R &uv, fpreal t)
Definition: OBJ_Sticky.h:76
~OBJ_Sticky() override
Definition: OBJ_Sticky.h:41
void setFloat(int parmi, int vectori, fpreal t, fpreal value, PRM_AddKeyType add_key=PRM_AK_MARK_PENDING)
void STICKYGEOPATH(UT_String &str, fpreal t) override
Definition: OBJ_Sticky.h:56
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual void getUV(UT_Vector2R &uv, OP_Context &context)
#define OBJ_API
Definition: OBJ_API.h:10
static OP_Node * myConstructor(OP_Network *net, const char *name, OP_Operator *entry)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425