-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSOP_DiamondSquare.h
46 lines (40 loc) · 1.69 KB
/
SOP_DiamondSquare.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <SOP/SOP_Node.h>
class SOP_DiamondSquare : public SOP_Node {
public:
static OP_Node *myConstructor(OP_Network* network,
const char* name,
OP_Operator* op_type);
static PRM_Template myTemplateList[];
static CH_LocalVariable myVariables[];
protected:
SOP_DiamondSquare(OP_Network* network,
const char* name,
OP_Operator* op_type);
virtual ~SOP_DiamondSquare();
virtual OP_ERROR cookMySop(OP_Context &context); // Meat of the plugin.
// This function is used to lookup local variables that you have
// defined specific to your SOP.
virtual bool evalVariableValue(fpreal &val, int index, int thread);
// Add virtual overload that delegates to the super class to avoid
// shadow warnings.
virtual bool evalVariableValue(UT_String &v, int i, int thread) {
return evalVariableValue(v, i, thread);
}
private:
static PRM_Name roughnessName;
static PRM_Default roughnessDefault;
static PRM_Range roughnessRange;
static PRM_Default sizeDefaults[];
static PRM_Default divDefault;
static PRM_Range divRange;
static PRM_Default seedDefault;
static PRM_Range seedRange;
int SEED() { return evalInt (PRMseedName.getToken(), 0, 0); }
float HEIGHT(fpreal t) { return evalFloat(PRMsizeName.getToken(), 1, t); }
float WIDTH(fpreal t) { return evalFloat(PRMsizeName.getToken(), 0, t); }
float LENGTH(fpreal t) { return evalFloat(PRMsizeName.getToken(), 2, t); }
float ROUGH(fpreal t) { return evalFloat(roughnessName.getToken(), 0, t); }
int DIV() { return evalInt (PRMdivName.getToken(), 0, 0); }
int curPointIdx;
int totalPointCount;
};