本文整理汇总了C++中idataarray::Pointer::getXdmfTypeAndSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::getXdmfTypeAndSize方法的具体用法?C++ Pointer::getXdmfTypeAndSize怎么用?C++ Pointer::getXdmfTypeAndSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idataarray::Pointer
的用法示例。
在下文中一共展示了Pointer::getXdmfTypeAndSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeXdmfAttributeData
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
QString AttributeMatrix::writeXdmfAttributeData(IDataArray::Pointer array, const QString& centering, const QString& dataContainerName, const QString& hdfFileName, const uint8_t gridType)
{
QString xdmfText;
QTextStream out(&xdmfText);
int precision = 0;
QString xdmfTypeName;
array->getXdmfTypeAndSize(xdmfTypeName, precision);
if (0 == precision)
{
out << "<!-- " << array->getName() << " has unkown type or unsupported type or precision for XDMF to understand" << " -->" << "\n";
return xdmfText;
}
int numComp = array->getNumberOfComponents();
QString attrType = "";
if(numComp == 1)
{
attrType = "Scalar";
}
//we are assuming a component of 2 is for scalars on either side of a single object (ie faceIds)
if(numComp == 2)
{
attrType = "Scalar";
}
if(numComp == 3)
{
attrType = "Vector";
}
if(numComp == 6)
{
attrType = "Vector";
}
// if(numComp == 6) { attrType = "Tensor6"; }
if(numComp == 9)
{
attrType = "Tensor";
}
QString block = writeXdmfAttributeDataHelper(numComp, attrType, dataContainerName, array, centering, precision, xdmfTypeName, hdfFileName, gridType);
out << block;
return xdmfText;
}