#include
<
limits.h
>
#include
<
UT
/
UT_DSOVersion.h
>
#include
<
UT
/
UT_Math.h
>
#include
<
UT
/
UT_Interrupt.h
>
#include
<
GU
/
GU_Detail.h
>
#include
<
GU
/
GU_PrimPoly.h
>
#include
<
CH
/
CH_LocalVariable.h
>
#include
<
PRM
/
PRM_Include.h
>
#include
<
OP
/
OP_Operator.h
>
#include
<
OP
/
OP_OperatorTable.h
>
#include
<
SOP
/
SOP_Node.h
>
namespace
HDK_Sample {
class
SOP_Star :
public
SOP_Node
{
public
:
static
OP_Node
*
myConstructor(OP_Network
*
,
const
char
*
,
OP_Operator
*
);
static
PRM_Template myTemplateList[];
static
CH_LocalVariable myVariables[];
protected
:
SOP_Star(OP_Network
*
net,
const
char
*
name, OP_Operator
*
op): SOP_Node(net, name, op){}
virtual
~
SOP_Star(){}
virtual
unsigned disableParms(){
return
0
;}
virtual
OP_ERROR cookMySop(OP_Context
&
context);
};
}
using
namespace
HDK_Sample;
void
newSopOperator(OP_OperatorTable
*
table)
{
table
->
addOperator(
new
OP_Operator(
"
hdk_star
"
,
//
Internal name
"
Star
"
,
//
UI name
SOP_Star::myConstructor,
//
How to build the SOP
SOP_Star::myTemplateList,
//
My parameters
0
,
//
Min # of sources
0
,
//
Max # of sources
SOP_Star::myVariables,
//
Local variables
OP_FLAG_GENERATOR)
//
Flag it as generator
);
}
PRM_Template
SOP_Star::myTemplateList[]
=
{PRM_Template()};
enum
{ VAR_PT, VAR_NPT };
CH_LocalVariable
SOP_Star::myVariables[]
=
{
{
"
PT
"
, VAR_PT,
0
},
//
The table provides a mapping
{
"
NPT
"
, VAR_NPT,
0
},
//
from text string to integer token
{
0
,
0
,
0
},
};
OP_Node
*
SOP_Star::myConstructor(OP_Network
*
net,
const
char
*
name, OP_Operator
*
op)
{
return
new
SOP_Star(net, name, op);}
OP_ERROR
SOP_Star::cookMySop(OP_Context
&
context){
return
error();}