本文整理汇总了C++中PTree::WriteTreeText方法的典型用法代码示例。如果您正苦于以下问题:C++ PTree::WriteTreeText方法的具体用法?C++ PTree::WriteTreeText怎么用?C++ PTree::WriteTreeText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PTree
的用法示例。
在下文中一共展示了PTree::WriteTreeText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Export
//
// Export
//
// Export this footprint to the given file name
//
Bool Type::Export(const char *fileName)
{
PTree tree;
FScope *root, *cellInfo;
// Add the top level scope
root = tree.GetGlobalScope()->AddFunction("ConfigureFootPrint");
// Get the layer used for zipping
Layer &layer = GetLayer(LAYER_LOWER);
// Save out the grid
for (S32 z = 0; z <= size.z; z++)
{
for (S32 x = 0; x <= size.x; x++)
{
// Write out cell info
cellInfo = root->AddFunction("SetupCell");
cellInfo->AddArgInteger(x);
cellInfo->AddArgInteger(z);
// Is this cell on the footprint
if (x < size.x && z < size.z)
{
Cell &cell = GetCell(x, z);
StdSave::TypeU32(cellInfo, "Hide", cell.GetFlag(HIDE));
StdSave::TypeU32(cellInfo, "SetBase", cell.GetFlag(SETBASE));
StdSave::TypeU32(cellInfo, "Second", cell.GetFlag(SECOND));
StdSave::TypeU32(cellInfo, "Dirs", cell.dirs);
StdSave::TypeU32(cellInfo, "ClaimLo", cell.GetFlag(CLAIMLO));
StdSave::TypeU32(cellInfo, "ClaimHi", cell.GetFlag(CLAIMHI));
StdSave::TypeU32(cellInfo, "BlockLOS", cell.GetFlag(BLOCKLOS));
if (cell.GetFlag(SURFACE))
{
MoveTable::KeyInfo *info = MoveTable::FindSurfaceInfo(cell.surface);
if (info)
{
StdSave::TypeString(cellInfo, "Surface", info->ident.str);
}
}
}
Layer::Cell &cell = layer.GetCell(x, z);
StdSave::TypeU32(cellInfo, "Zip", cell.GetFlag(Layer::ZIP));
}
}
// Save out to disk
return (tree.WriteTreeText(fileName));
}