#include <stddef.h>
namespace HDK_Sample {
class SOP_UndoCustomBrushData :
public UT_Undo
{
public:
private:
int mySopId;
};
}
using namespace HDK_Sample;
mySopId(sop->getUniqueId()),
myOldNumPts(oldnumpts),
myNumPts(numpts),
myOldData(olddata),
myData(data)
{
}
void
SOP_UndoCustomBrushData::undo()
{
}
void
{
}
void
{
1, 1));
}
static PRM_Name sopOriginName(
"origin",
"Origin");
static PRM_Name sopDirectionName(
"direction",
"Direction");
static PRM_Name sopRadiusName(
"radius",
"Radius");
static PRM_Name sopColorName(
"color",
"Color");
static PRM_Name sopAlphaName(
"alpha",
"Alpha");
static PRM_Name sopOperationName(
"operation",
"Operation");
static PRM_Name sopEventName(
"event",
"Event");
static PRM_Name sopClearAllName(
"clearall",
"Clear All");
{
};
static PRM_Name sopOperationMenuNames[] =
{
};
{
};
{
};
&sopOperationMenu),
};
{
}
myGroup(0),
myNumPts(0),
myOldNumPts(0)
{
mySopFlags.setManagesDataIDs(true);
}
SOP_CustomBrush::~SOP_CustomBrush()
{
}
{
context,
myGroup,
alone,
true,
0,
-1,
true,
false,
true,
0
);
}
{
int changed_input;
if(myData.size() == 0)
{
myNumPts = npts;
}
else if(myNumPts != npts)
{
}
int event = getEvent(t);
{
myOldData.setSize(0);
myOldNumPts = myNumPts;
}
{
fpreal radius2 = radius * radius;
int operation = getOperation(t);
for(
exint i = 0; i < myData.size(); ++i)
table[myData(i).myPtNum] = i;
for(
exint i = 0; i < myOldData.size(); ++i)
oldtable[myOldData(i).myPtNum] = i;
{
if (dot_p_dir <= 0)
continue;
fpreal parlen2 = dot_p_dir * dot_p_dir;
if (parlen2 <= 0 || perp.
length2() >= radius2 * parlen2)
continue;
auto it = table.find(ptnum);
if (it == table.end())
{
table[ptnum] = index;
}
else
index = it->second;
auto oldit = oldtable.find(ptnum);
if (oldit == oldtable.end())
{
index = myOldData.append(d);
oldtable[ptnum] = index;
}
switch(operation)
{
d.
myRed = alpha * color.
x() + one_minus_alpha * d.
myRed;
break;
d.
myRed *= one_minus_alpha;
break;
}
}
}
{
{
myOldData.setSize(0);
}
}
{
}
for (
exint i = 0; i < myData.size(); ++i)
{
if (input_handle.isValid())
{
r += one_minus_alpha * f.
x();
g += one_minus_alpha * f.
y();
b += one_minus_alpha * f.
z();
}
}
if (myData.size() > 0)
}
std::ostream &os,
const char *path_prefix,
{
const char *ext = saveflags.
getBinary() ?
"bpaint" :
"paint";
{
out.
write(&myNumPts, 1,
true);
out.write(&n, 1, true);
{
}
}
}
bool
{
if(strcmp(ext, "bpaint") == 0 || strcmp(ext, "paint") == 0)
{
myNumPts = 0;
myData.setSize(0);
myOldData.setSize(0);
return false;
return false;
{
return false;
return false;
return false;
return false;
return false;
}
return true;
}
}
void
{
myNumPts = numpts;
if (myNumPts == 0)
{
myData.setSize(0);
}
else
{
for (
exint i = 0; i < myData.size(); ++i)
table[myData(i).myPtNum] = i;
{
if(it != table.end())
{
myData(it->second) = d;
}
else
{
exint index = myData.append(d);
}
}
}
}
int
{
return 1;
}
void
{
myNumPts = 0;
myOldData = myData;
myData.setSize(0);
{
myOldData.setSize(0);
}
}