本文整理汇总了C++中DataNode::AsIntArray方法的典型用法代码示例。如果您正苦于以下问题:C++ DataNode::AsIntArray方法的具体用法?C++ DataNode::AsIntArray怎么用?C++ DataNode::AsIntArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataNode
的用法示例。
在下文中一共展示了DataNode::AsIntArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPosition
void
SaveSubWindowAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("SaveSubWindowAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("position")) != 0)
SetPosition(node->AsIntArray());
if((node = searchNode->GetNode("size")) != 0)
SetSize(node->AsIntArray());
if((node = searchNode->GetNode("layer")) != 0)
SetLayer(node->AsInt());
if((node = searchNode->GetNode("transparency")) != 0)
SetTransparency(node->AsDouble());
if((node = searchNode->GetNode("omitWindow")) != 0)
SetOmitWindow(node->AsBool());
}
示例2: if
void
PeaksOverThresholdAttributes::SetFromNode(DataNode *parentNode)
{
if(parentNode == 0)
return;
DataNode *searchNode = parentNode->GetNode("PeaksOverThresholdAttributes");
if(searchNode == 0)
return;
DataNode *node;
if((node = searchNode->GetNode("dataYearBegin")) != 0)
SetDataYearBegin(node->AsInt());
if((node = searchNode->GetNode("dataAnalysisYearRangeEnabled")) != 0)
SetDataAnalysisYearRangeEnabled(node->AsBool());
if((node = searchNode->GetNode("dataAnalysisYearRange")) != 0)
SetDataAnalysisYearRange(node->AsIntArray());
if((node = searchNode->GetNode("aggregation")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 3)
SetAggregation(AggregationType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
AggregationType value;
if(AggregationType_FromString(node->AsString(), value))
SetAggregation(value);
}
}
if((node = searchNode->GetNode("annualPercentile")) != 0)
SetAnnualPercentile(node->AsDouble());
if((node = searchNode->GetNode("seasonalPercentile")) != 0)
SetSeasonalPercentile(node->AsDoubleArray());
if((node = searchNode->GetNode("monthlyPercentile")) != 0)
SetMonthlyPercentile(node->AsDoubleArray());
if((node = searchNode->GetNode("displaySeason")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 4)
SetDisplaySeason(SeasonType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
SeasonType value;
if(SeasonType_FromString(node->AsString(), value))
SetDisplaySeason(value);
}
}
if((node = searchNode->GetNode("displayMonth")) != 0)
{
// Allow enums to be int or string in the config file
if(node->GetNodeType() == INT_NODE)
{
int ival = node->AsInt();
if(ival >= 0 && ival < 12)
SetDisplayMonth(MonthType(ival));
}
else if(node->GetNodeType() == STRING_NODE)
{
MonthType value;
if(MonthType_FromString(node->AsString(), value))
SetDisplayMonth(value);
}
}
if((node = searchNode->GetNode("cutoff")) != 0)
SetCutoff(node->AsFloat());
if((node = searchNode->GetNode("computeParamValues")) != 0)
SetComputeParamValues(node->AsBool());
if((node = searchNode->GetNode("computeCovariates")) != 0)
SetComputeCovariates(node->AsBool());
if((node = searchNode->GetNode("covariateReturnYears")) != 0)
SetCovariateReturnYears(node->AsIntVector());
if((node = searchNode->GetNode("covariateModelLocation")) != 0)
SetCovariateModelLocation(node->AsBool());
if((node = searchNode->GetNode("covariateModelShape")) != 0)
SetCovariateModelShape(node->AsBool());
if((node = searchNode->GetNode("covariateModelScale")) != 0)
SetCovariateModelScale(node->AsBool());
if((node = searchNode->GetNode("computeRVDifferences")) != 0)
SetComputeRVDifferences(node->AsBool());
if((node = searchNode->GetNode("rvDifferences")) != 0)
SetRvDifferences(node->AsIntArray());
if((node = searchNode->GetNode("dataScaling")) != 0)
SetDataScaling(node->AsDouble());
if((node = searchNode->GetNode("dumpData")) != 0)
SetDumpData(node->AsBool());
}