本文整理汇总了C++中NcAtt::as_ncbyte方法的典型用法代码示例。如果您正苦于以下问题:C++ NcAtt::as_ncbyte方法的具体用法?C++ NcAtt::as_ncbyte怎么用?C++ NcAtt::as_ncbyte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NcAtt
的用法示例。
在下文中一共展示了NcAtt::as_ncbyte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: err
//.........这里部分代码省略.........
QString("%1 is not a valid preprocessed volume file").arg(volfile));
return false;
}
int i;
NcAtt *att;
char *attval;
QString pvalue;
att = pvlFile.get_att("description");
if (att)
{
attval = att->as_string(0);
description = attval;
delete [] attval;
}
att = pvlFile.get_att("voxeltype");
if (att)
{
attval = att->as_string(0);
pvalue = attval;
if (pvalue == "unsigned char")
voxelType = Raw2Pvl::_UChar;
if (pvalue == "char")
voxelType = Raw2Pvl::_Char;
if (pvalue == "unsigned short")
voxelType = Raw2Pvl::_UShort;
if (pvalue == "short")
voxelType = Raw2Pvl::_Short;
if (pvalue == "int")
voxelType = Raw2Pvl::_Int;
if (pvalue == "float")
voxelType = Raw2Pvl::_Float;
delete [] attval;
}
att = pvlFile.get_att("voxelunit");
if (att)
{
attval = att->as_string(0);
pvalue = attval;
voxelUnit = Raw2Pvl::_Nounit;
if (pvalue == "angstrom")
voxelUnit = Raw2Pvl::_Angstrom;
else if (pvalue == "nanometer")
voxelUnit = Raw2Pvl::_Nanometer;
else if (pvalue == "micron")
voxelUnit = Raw2Pvl::_Micron;
else if (pvalue == "millimeter")
voxelUnit = Raw2Pvl::_Millimeter;
else if (pvalue == "centimeter")
voxelUnit = Raw2Pvl::_Centimeter;
else if (pvalue == "meter")
voxelUnit = Raw2Pvl::_Meter;
else if (pvalue == "kilometer")
voxelUnit = Raw2Pvl::_Kilometer;
else if (pvalue == "parsec")
voxelUnit = Raw2Pvl::_Parsec;
else if (pvalue == "kiloparsec")
voxelUnit = Raw2Pvl::_Kiloparsec;
delete [] attval;
}
att = pvlFile.get_att("gridsize");
if (att)
{
depth = att->as_int(0);
width = att->as_int(1);
height = att->as_int(2);
}
att = pvlFile.get_att("voxelsize");
if (att)
{
vx = att->as_float(0);
vy = att->as_float(1);
vz = att->as_float(2);
}
att = pvlFile.get_att("skipheaderbytes");
if (att)
skipheaderbytes = att->as_int(0);
att = pvlFile.get_att("mapraw");
if (att)
{
for(i=0; i<att->num_vals(); i++)
rawMap.append(att->as_float(i));
att = pvlFile.get_att("mappvl");
for(i=0; i<att->num_vals(); i++)
pvlMap.append(att->as_ncbyte(i));
}
pvlFile.close();
return true;
}