本文整理汇总了C++中PvlGroup::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ PvlGroup::setName方法的具体用法?C++ PvlGroup::setName怎么用?C++ PvlGroup::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PvlGroup
的用法示例。
在下文中一共展示了PvlGroup::setName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsisMain
//.........这里部分代码省略.........
transx -= lineExpansion / 2.*pixPitch * expandFlag;
}
else {
transy -= lineExpansion / 2.*pixPitch * expandFlag;
}
}
// Get the start time for parent line 1
AlphaCube alpha(*icube);
double sample = alpha.BetaSample(.5);
double line = alpha.BetaLine(.5);
incam->SetImage(sample, line);
double et = incam->time().Et();
// Get the output file name and set its attributes
CubeAttributeOutput cao;
// Can we do a regular label? Didn't work on 12-15-2006
cao.setLabelAttachment(Isis::DetachedLabel);
// Determine the output image size from
// 1) the idealInstrument pvl if there or
// 2) the input size expanded by user specified percentage
Cube *ocube = p.SetOutputCube("match.cub", cao, 1, 1, 1);
// Extract the times and the target from the instrument group
QString startTime = inst["StartTime"];
QString stopTime;
if(inst.hasKeyword("StopTime")) stopTime = (QString) inst["StopTime"];
QString target = inst["TargetName"];
// rename the instrument groups
inst.setName("OriginalInstrument");
fromInst.setName("OriginalInstrument");
// add it back to the IsisCube object under a new group name
ocube->putGroup(inst);
// and remove the version from the IsisCube Object
ocube->deleteGroup("Instrument");
// Now rename the group back to the Instrument group and clear out old keywords
inst.setName("Instrument");
inst.clear();
// Add keywords for the "Ideal" instrument
Isis::PvlKeyword key("SpacecraftName", "IdealSpacecraft");
inst.addKeyword(key);
key.setName("InstrumentId");
key.setValue("IdealCamera");
inst.addKeyword(key);
key.setName("TargetName");
key.setValue(target);
inst.addKeyword(key);
key.setName("SampleDetectors");
key.setValue(Isis::toString(detectorSamples));
inst.addKeyword(key);
key.setName("LineDetectors");
key.setValue(Isis::toString(detectorLines));
inst.addKeyword(key);
示例2: IsisMain
//.........这里部分代码省略.........
}
}
Statistics sections[numSections][2];
Statistics leftTotal, rightTotal;
int sectionStarts[numSections];
sectionStarts[0] = 0;
for(int i = 1 ; i < numSections - 1 ; i ++) {
sectionStarts[i] = (totalLines / numSections) * i;
}
if(numSections > 0) {
sectionStarts[numSections -1] = totalLines - sectionLength;
}
int currentSection = 0;
Buffer leftFringeBuf(leftFringe, 1, 1, lineManager.PixelType());
Buffer rightFringeBuf(leftFringe, 1, 1, lineManager.PixelType());
//Walk down the cube
for(int lineCount = 0 ; lineCount < totalLines ; lineCount++) {
inputCube.read(lineManager);
//Read the edges into the fringe buffers
for(int i = 0 ; i < leftFringe ; i++) {
leftFringeBuf[i] = lineManager[i];
}
for(int i = rightFringe ; i < totalSamples ; i++) {
rightFringeBuf[i - rightFringe] = lineManager[i];
}
//No matter what, add the fringe buffers to the totals for that side
leftTotal.AddData(leftFringeBuf.DoubleBuffer(), leftFringeBuf.size());
rightTotal.AddData(rightFringeBuf.DoubleBuffer(), rightFringeBuf.size());
if(numSections == 0) {
continue;
}
//Index is not too large for this fringe section
if(lineCount < sectionStarts[currentSection] + sectionLength) {
//Index is not too small for this fringe section
if(lineCount >= sectionStarts[currentSection]) {
sections[currentSection][0].AddData(leftFringeBuf.DoubleBuffer(),
leftFringeBuf.size());
sections[currentSection][1].AddData(rightFringeBuf.DoubleBuffer(),
rightFringeBuf.size());
}
}
else {
currentSection++;
//Since sections may butt up against each other, it is possible that
// we have to add this data to the next section.
if(lineCount >= sectionStarts[currentSection]) {
sections[currentSection][0].AddData(leftFringeBuf.DoubleBuffer(),
leftFringeBuf.size());
sections[currentSection][1].AddData(rightFringeBuf.DoubleBuffer(),
rightFringeBuf.size());
}
}
}
// Write the results to the output file if the user specified one
PvlObject leftSide("LeftSide"), rightSide("RightSide");
for(int i = 0 ; i < numSections ; i++) {
QString sectionName = "Section" + toString(i + 1);
pvlOut(sections[i][0], //Stats to add to the left Object
sections[i][1], //Stats to add to the right Object
sectionName, //Name for the new groups
sectionStarts[i], //start line
sectionStarts[i] + sectionLength, //end line
&leftSide, //Object to add left group to
&rightSide //Object to add right group to
);
}
pvlOut(leftTotal, //Stats to add to the left Object
rightTotal, //Stats to add to the right Object
"Total", //Name for the new groups
0, //start line
totalLines, //end line
&leftSide, //Object to add left group to
&rightSide //Object to add right group to
);
Pvl outputPvl;
PvlGroup sourceInfo("SourceInfo");
sourceInfo += PvlKeyword("From", fromFile.expanded());
sourceInfo += icube->group("Archive")["ProductId"];
outputPvl.addGroup(sourceInfo);
if(numSections > 0) {
outputPvl.addObject(leftSide);
outputPvl.addObject(rightSide);
}
else {
PvlGroup leftGroup = leftSide.findGroup("Total");
PvlGroup rightGroup = rightSide.findGroup("Total");
leftGroup.setName("LeftSide");
rightGroup.setName("RightSide");
outputPvl.addGroup(leftGroup);
outputPvl.addGroup(rightGroup);
}
outputPvl.write(ui.GetFileName("TO"));
}