本文整理汇总了C++中POVMS_Object::SetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ POVMS_Object::SetInt方法的具体用法?C++ POVMS_Object::SetInt怎么用?C++ POVMS_Object::SetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POVMS_Object
的用法示例。
在下文中一共展示了POVMS_Object::SetInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendStatistics
void Scene::SendStatistics(TaskQueue&)
{
POVMS_Message parserStats(kPOVObjectClass_ParserStatistics, kPOVMsgClass_SceneOutput, kPOVMsgIdent_ParserStatistics);
GetStatistics(parserStats);
parserStats.SetInt(kPOVAttrib_SceneId, sceneData->sceneId);
parserStats.SetSourceAddress(sceneData->backendAddress);
parserStats.SetDestinationAddress(sceneData->frontendAddress);
POVMS_SendMessage(parserStats);
for(std::vector<TraceThreadData*>::iterator i(sceneThreadData.begin()); i != sceneThreadData.end(); i++)
delete (*i);
sceneThreadData.clear();
}
示例2: GetStatistics
void Scene::GetStatistics(POVMS_Object& parserStats)
{
struct TimeData final
{
POV_LONG cpuTime;
POV_LONG realTime;
size_t samples;
TimeData() : cpuTime(0), realTime(0), samples(0) { }
};
TimeData timeData[TraceThreadData::kMaxTimeType];
for(std::vector<TraceThreadData*>::iterator i(sceneThreadData.begin()); i != sceneThreadData.end(); i++)
{
timeData[(*i)->timeType].realTime = max(timeData[(*i)->timeType].realTime, (*i)->realTime);
if ((*i)->cpuTime >= 0)
timeData[(*i)->timeType].cpuTime += (*i)->cpuTime;
else
timeData[(*i)->timeType].cpuTime = -1;
timeData[(*i)->timeType].samples++;
}
for(size_t i = TraceThreadData::kUnknownTime; i < TraceThreadData::kMaxTimeType; i++)
{
if(timeData[i].samples > 0)
{
POVMS_Object elapsedTime(kPOVObjectClass_ElapsedTime);
elapsedTime.SetLong(kPOVAttrib_RealTime, timeData[i].realTime);
if (timeData[i].cpuTime >= 0)
elapsedTime.SetLong(kPOVAttrib_CPUTime, timeData[i].cpuTime);
elapsedTime.SetInt(kPOVAttrib_TimeSamples, POVMSInt(timeData[i].samples));
switch(i)
{
case TraceThreadData::kParseTime:
parserStats.Set(kPOVAttrib_ParseTime, elapsedTime);
break;
case TraceThreadData::kBoundingTime:
parserStats.Set(kPOVAttrib_BoundingTime, elapsedTime);
break;
}
}
}
parserStats.SetInt(kPOVAttrib_FiniteObjects, sceneData->numberOfFiniteObjects);
parserStats.SetInt(kPOVAttrib_InfiniteObjects, sceneData->numberOfInfiniteObjects);
parserStats.SetInt(kPOVAttrib_LightSources, POVMSInt(sceneData->lightSources.size()));
parserStats.SetInt(kPOVAttrib_Cameras, POVMSInt(sceneData->cameras.size()));
if(sceneData->boundingMethod == 2)
{
parserStats.SetInt(kPOVAttrib_BSPNodes, sceneData->nodes);
parserStats.SetInt(kPOVAttrib_BSPSplitNodes, sceneData->splitNodes);
parserStats.SetInt(kPOVAttrib_BSPObjectNodes, sceneData->objectNodes);
parserStats.SetInt(kPOVAttrib_BSPEmptyNodes, sceneData->emptyNodes);
parserStats.SetInt(kPOVAttrib_BSPMaxObjects, sceneData->maxObjects);
parserStats.SetFloat(kPOVAttrib_BSPAverageObjects, sceneData->averageObjects);
parserStats.SetInt(kPOVAttrib_BSPMaxDepth, sceneData->maxDepth);
parserStats.SetFloat(kPOVAttrib_BSPAverageDepth, sceneData->averageDepth);
parserStats.SetInt(kPOVAttrib_BSPAborts, sceneData->aborts);
parserStats.SetFloat(kPOVAttrib_BSPAverageAborts, sceneData->averageAborts);
parserStats.SetFloat(kPOVAttrib_BSPAverageAbortObjects, sceneData->averageAbortObjects);
}
}