本文整理汇总了C++中DataItem::getDataPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ DataItem::getDataPointer方法的具体用法?C++ DataItem::getDataPointer怎么用?C++ DataItem::getDataPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataItem
的用法示例。
在下文中一共展示了DataItem::getDataPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
/**
* call CUDA function of the wind node, calculate wind
*/
void NodePointsWind::run()
{
//get input data
DataItem *pointsInput = get_dataitem("PointsInput", true, DATAITEM_POINTSVECTORS_GPU_VECTOR);
std::vector<PointArray> *points = (std::vector<PointArray> *) pointsInput->getDataPointer();
//////Hard code wind variable
int length = 20; //length of the cylinder
Hamtrans::Point center = Hamtrans::Point();
center.x = -5;
center.y = -5;
center.z = -5;
Hamtrans::Point vector = Hamtrans::Point();
vector.x = 1;
vector.y = 1;
vector.z = 1;
Hamtrans::Point end = Hamtrans::Point();
end.x = vector.x * length + center.x;
end.y = vector.y * length + center.y;
end.z = vector.z * length + center.z;
double radius = 10.0;
double speed = 0.0008;
std::vector<PointArray> *resultPoints = NodePointsWindCUDA(points, center, radius, vector, speed, end);
//get output data
DataItem *pointsOutput = get_dataitem("PointsOutput");
pointsOutput->setDataType(DATAITEM_POINTSVECTORS_GPU_VECTOR);
pointsOutput->setDataPointer(resultPoints);
pointsOutput->setInitialised();
}