本文整理汇总了C++中AMDataSource::axisInfoAt方法的典型用法代码示例。如果您正苦于以下问题:C++ AMDataSource::axisInfoAt方法的具体用法?C++ AMDataSource::axisInfoAt怎么用?C++ AMDataSource::axisInfoAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMDataSource
的用法示例。
在下文中一共展示了AMDataSource::axisInfoAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeSeparateSections
void AMExporterGeneralAscii::writeSeparateSections()
{
QTextStream ts(file_);
if (option_->higherDimensionsInRows()){
for(int s=0; s<separateSectionDataSources_.count(); s++) {
ts << option_->newlineDelimiter();
setCurrentDataSource(separateSectionDataSources_.at(s)); // sets currentDataSourceIndex_
AMDataSource* ds = currentScan_->dataSourceAt(currentDataSourceIndex_);
int precision = option_->exportPrecision(ds->name());
// section header?
if(option_->sectionHeaderIncluded()) {
ts << parseKeywordString(option_->sectionHeader());
ts << option_->newlineDelimiter();
}
// column header?
if(option_->columnHeaderIncluded()) {
// 1D data sources:
if(ds->rank() == 0) {
ts << parseKeywordString(option_->columnHeader()) << option_->columnDelimiter();
}
else if(ds->rank() == 1) {
if(separateSectionIncludeX_.at(s))
ts << parseKeywordString(option_->columnHeader()) << ".X" << option_->columnDelimiter();
ts << parseKeywordString(option_->columnHeader()) << option_->columnDelimiter();
}
else if(ds->rank() == 2) { // 2D
if(separateSectionIncludeX_.at(s))
ts << parseKeywordString(option_->columnHeader()) << ".X" << option_->columnDelimiter();
// need a loop over the second axis columns
for(int cc=0; cc<ds->size(1); cc++) {
setCurrentColumnIndex(cc);
ts << parseKeywordString(option_->columnHeader()) << "[" << ds->axisValue(1, cc).toString(precision) << ds->axisInfoAt(1).units << "]" << option_->columnDelimiter();
}
}
ts << option_->newlineDelimiter() << option_->columnHeaderDelimiter() << option_->newlineDelimiter();
}
// table
switch(ds->rank()) {
case 0:
ts << ds->value(AMnDIndex()).toString(precision) << option_->columnDelimiter() << option_->newlineDelimiter();
break;
case 1: {
int maxTableRows = ds->size(0);
for(int r=0; r<maxTableRows; r++) {
if(separateSectionIncludeX_.at(s)) {
ts << ds->axisValue(0,r).toString(precision) << option_->columnDelimiter();
}
ts << ds->value(r).toString(precision) << option_->columnDelimiter() << option_->newlineDelimiter();
}
}
break;
case 2: {
int maxTableRows = ds->size(0);
for(int r=0; r<maxTableRows; r++) {
if(separateSectionIncludeX_.at(s))
ts << ds->axisValue(0,r).toString(precision) << option_->columnDelimiter();
// need a loop over the second axis columns
for(int cc=0; cc<ds->size(1); cc++) {
ts << ds->value(AMnDIndex(r,cc)).toString(precision) << option_->columnDelimiter();
}
ts << option_->newlineDelimiter();
}
}
break;
default:
/// \todo Implement 3D
break;
}
}
}
// For writing out in columns. Essentially transposing the file.
else{
for(int s=0; s<separateSectionDataSources_.count(); s++) {
setCurrentDataSource(separateSectionDataSources_.at(s)); // sets currentDataSourceIndex_
AMDataSource* ds = currentScan_->dataSourceAt(currentDataSourceIndex_);
int precision = option_->exportPrecision(ds->name());
// section header?
if(option_->sectionHeaderIncluded()) {
ts << parseKeywordString(option_->sectionHeader());
ts << option_->newlineDelimiter();
}
// If including the X values.
if (separateSectionIncludeX_.at(s)){
switch(ds->rank()){
case 0:
break;
//.........这里部分代码省略.........