本文整理汇总了C++中OP_Node::castToDOPParent方法的典型用法代码示例。如果您正苦于以下问题:C++ OP_Node::castToDOPParent方法的具体用法?C++ OP_Node::castToDOPParent怎么用?C++ OP_Node::castToDOPParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OP_Node
的用法示例。
在下文中一共展示了OP_Node::castToDOPParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DOPPATH
ROP_RENDER_CODE
ROP_DopField::renderFrame(fpreal time, UT_Interrupt *)
{
OP_Node *op;
DOP_Parent *dopparent;
UT_String doppath, savepath;
UT_String dopobject, dopdata;
if( !executePreFrameScript(time) )
return ROP_ABORT_RENDER;
DOPPATH(doppath, time);
if( !doppath.isstring() )
{
addError(ROP_MESSAGE, "Invalid DOP path");
return ROP_ABORT_RENDER;
}
op = findNode(doppath);
if (!op)
{
addError(ROP_COOK_ERROR, (const char *)doppath);
return ROP_ABORT_RENDER;
}
dopparent = op ? op->castToDOPParent() : 0;
if( !dopparent )
{
addError(ROP_COOK_ERROR, (const char *)doppath);
return ROP_ABORT_RENDER;
}
DOPOBJECT(dopobject, time);
DOPDATA(dopdata, time);
OUTPUT(savepath, time);
time = DOPsetBestTime(dopparent, time);
OP_Context context(time);
const SIM_Object *object;
object = dopparent->findObjectFromString(dopobject, 0, 0, time);
if (!object)
{
addError(ROP_COOK_ERROR, (const char *)dopobject);
return ROP_ABORT_RENDER;
}
const SIM_Data *data;
data = object->getConstNamedSubData(dopdata);
if (!data)
{
addError(ROP_COOK_ERROR, (const char *) dopdata);
return ROP_ABORT_RENDER;
}
// Create our GDP.
GU_Detail *gdp = new GU_Detail();
const SIM_ScalarField *scalarfield = SIM_DATA_CASTCONST(data, SIM_ScalarField);
if (scalarfield)
{
addField(gdp, scalarfield->getField());
}
const SIM_VectorField *vectorfield = SIM_DATA_CASTCONST(data, SIM_VectorField);
if (vectorfield)
{
for (int i = 0; i < 3; i++)
{
addField(gdp, vectorfield->getField(i));
}
}
const SIM_MatrixField *matrixfield = SIM_DATA_CASTCONST(data, SIM_MatrixField);
if (matrixfield)
{
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
{
addField(gdp, matrixfield->getField(i, j));
}
}
if (!gdp->save((const char *)savepath, 0, 0).success())
{
addError(ROP_SAVE_ERROR, (const char *)savepath);
return ROP_ABORT_RENDER;
}
// DO NOT delete gdp if we are stealing the voxels!
// delete gdp;
if (ALFPROGRESS() && (myEndTime != myStartTime))
{
fpreal fpercent = (time - myStartTime) / (myEndTime - myStartTime);
int percent = (int)SYSrint(fpercent * 100);
//.........这里部分代码省略.........