本文整理汇总了C++中Cube::addCachingAlgorithm方法的典型用法代码示例。如果您正苦于以下问题:C++ Cube::addCachingAlgorithm方法的具体用法?C++ Cube::addCachingAlgorithm怎么用?C++ Cube::addCachingAlgorithm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cube
的用法示例。
在下文中一共展示了Cube::addCachingAlgorithm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileLab
/**
* Set the output cube to specified file name and specified input images
* and output attributes and lat,lons
*/
Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile,
double xmin, double xmax, double ymin, double ymax,
double slat, double elat, double slon, double elon, int nbands,
CubeAttributeOutput &oAtt, const QString &mosaicFile) {
Pvl fileLab(inputFile);
PvlGroup &mapping = fileLab.findGroup("Mapping", Pvl::Traverse);
mapping["UpperLeftCornerX"] = toString(xmin);
mapping["UpperLeftCornerY"] = toString(ymax);
mapping.addKeyword(PvlKeyword("MinimumLatitude", toString(slat)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MaximumLatitude", toString(elat)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MinimumLongitude", toString(slon)), Pvl::Replace);
mapping.addKeyword(PvlKeyword("MaximumLongitude", toString(elon)), Pvl::Replace);
Projection *firstProj = ProjectionFactory::CreateFromCube(fileLab);
int samps = (int)(ceil(firstProj->ToWorldX(xmax) - firstProj->ToWorldX(xmin)) + 0.5);
int lines = (int)(ceil(firstProj->ToWorldY(ymin) - firstProj->ToWorldY(ymax)) + 0.5);
delete firstProj;
if (p_createMosaic) {
Pvl newMap;
newMap.addGroup(mapping);
// Initialize the mosaic
CubeAttributeInput inAtt;
ProcessByLine p;
p.SetInputCube(inputFile, inAtt);
p.PropagateHistory(false);
p.PropagateLabels(false);
p.PropagateTables(false);
p.PropagatePolygons(false);
p.PropagateOriginalLabel(false);
// If track set, create the origin band
if (GetTrackFlag()) {
nbands += 1;
}
// For average priority, get the new band count
else if (GetImageOverlay() == AverageImageWithMosaic) {
nbands *= 2;
}
Cube *ocube = p.SetOutputCube(mosaicFile, oAtt, samps, lines, nbands);
p.Progress()->SetText("Initializing mosaic");
p.ClearInputCubes();
p.StartProcess(ProcessMapMosaic::FillNull);
// CreateForCube created some keywords in the mapping group that needs to be added
ocube->putGroup(newMap.findGroup("Mapping", Pvl::Traverse));
p.EndProcess();
}
Cube *mosaicCube = new Cube();
mosaicCube->open(mosaicFile, "rw");
mosaicCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2));
AddOutputCube(mosaicCube);
return mosaicCube;
}
示例2: IException
/**
* Set the output cube to specified file name and specified input images
* and output attributes and lat,lons
*/
Isis::Cube *ProcessMapMosaic::SetOutputCube(const QString &inputFile, PvlGroup mapping,
CubeAttributeOutput &oAtt, const QString &mosaicFile) {
if (OutputCubes.size() != 0) {
QString msg = "You can only specify one output cube and projection";
throw IException(IException::Programmer, msg, _FILEINFO_);
}
if (mapping.hasKeyword("UpperLeftCornerX"))
mapping.deleteKeyword("UpperLeftCornerX");
if (mapping.hasKeyword("UpperLeftCornerY"))
mapping.deleteKeyword("UpperLeftCornerY");
if (p_createMosaic) {
Pvl newMap;
newMap.addGroup(mapping);
int samps, lines, bands;
delete ProjectionFactory::CreateForCube(newMap, samps, lines, false);
// Initialize the mosaic
ProcessByLine p;
CubeAttributeInput inAtt(inputFile);
Cube *propCube = p.SetInputCube(inputFile, inAtt);
bands = propCube->bandCount();
// If track set, create the origin band
if (GetTrackFlag()) {
bands += 1;
}
// For average priority, get the new band count
else if (GetImageOverlay() == AverageImageWithMosaic) {
bands *= 2;
}
p.PropagateHistory(false);
p.PropagateLabels(false);
Cube *ocube = p.SetOutputCube(mosaicFile, oAtt, samps, lines, bands);
p.Progress()->SetText("Initializing mosaic");
p.ClearInputCubes();
p.StartProcess(ProcessMapMosaic::FillNull);
// CreateForCube created some keywords in the mapping group that needs to be added
ocube->putGroup(newMap.findGroup("Mapping", Pvl::Traverse));
p.EndProcess();
}
Cube *mosaicCube = new Cube();
AddOutputCube(mosaicCube);
mosaicCube->open(mosaicFile, "rw");
mosaicCube->addCachingAlgorithm(new UniqueIOCachingAlgorithm(2));
return mosaicCube;
}