#include "BRAY_HdBox.h"
using namespace UT::Literal;
using namespace HDK_Sample;
namespace
{
getFactory()
{
static BRAY_HdBox theFactory;
return theFactory;
}
class ParamListBuilder
{
public:
ParamListBuilder()
{
Params parms[] = {
{
theBoxPos.asHolder(),
3,
},
{
theBoxSize.asHolder(),
1,
},
};
myParms = UTmakeUnique<BRAY_AttribList>(
parms, SYSarraySize(parms), false);
}
};
{
public:
BoxSceneProc()
: myBox()
, myInstance()
, myDisplayColor(1, 1, 1)
, myBoxPos(0, 0, 0)
, myBoxSize(1)
{}
bool updateScene() override
{
corner /= 2;
uint seed = SYSpointerHash(
this);
while (myDisplayColor.maxComponent() < .7)
{
SYSfastRandom(seed),
SYSfastRandom(seed));
}
myDisplayColor.data());
if (!prim)
{
return false;
}
if (!myBox)
{
return false;
}
if (!myInstance)
{
return false;
}
myInstance.setInstanceTransforms(scene, xforms);
return true;
}
{
}
void doSetParameter(
{
}
void doSetParameter(
int n) override
{
}
void doSetParameter(
int n) override
{
if (key == theBoxPos && n == 3)
{
myBoxPos.x() = values[0];
myBoxPos.y() = values[1];
myBoxPos.z() = values[2];
}
else if (key == theBoxSize && n == 1)
{
myBoxSize = values[0];
}
}
void doSetParameter(
int n) override
{
if (key == theBoxPos && n == 3)
{
myBoxPos.x() = values[0];
myBoxPos.y() = values[1];
myBoxPos.z() = values[2];
}
else if (key == theBoxSize && n == 1)
{
myBoxSize = values[0];
}
}
void doSetParameter(
int n) override
{
}
private:
};
}
BRAY_HdBox::BRAY_HdBox()
{
}
BRAY_HdBox::~BRAY_HdBox()
{
}
BRAY_HdBox::create() const
{
return new BoxSceneProc;
}
BRAY_HdBox::paramList() const
{
static ParamListBuilder builder;
return builder.myParms.get();
}
void
{
getFactory();
}