本文整理汇总了C++中Cube::copy_header方法的典型用法代码示例。如果您正苦于以下问题:C++ Cube::copy_header方法的具体用法?C++ Cube::copy_header怎么用?C++ Cube::copy_header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cube
的用法示例。
在下文中一共展示了Cube::copy_header方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc,char *argv[])
{
cerr << "\n#########" << endl;
cerr << "CUBE_ADD" << endl;
cerr << "#########\n" << endl;
// Check the number of commandi line arguments
if( argc < 3)
{
cerr << "ERROR: Invalid number of arguments." << endl;
cerr << " You should provide at least two cube files." << endl;
exit(-1);
}
// Load first cube file
string s(argv[1]);
cerr << "Loading... " << s;
Cube tmp(s);
cerr << " ...Loaded!" << endl;
// Declare output cube file
Cube out;
// Copy the header of tmp
out.copy_header(tmp); // Also resize data and fill it with zeros
for(int i(1); i < argc; i++)
{
out = out + tmp;
if( (i+1) != argc )
{
// Load successive cube file
s = argv[i+1];
cerr << "Loading... " << s;
tmp = Cube(s);
cerr << " ...Loaded!" << endl;
}
}
out.print(cout);
cerr << "\nCUBE_ADD ended succesfully!\n" << endl;
return 0;
}