当前位置: 首页>>代码示例>>C++>>正文


C++ Accessor::getDouble方法代码示例

本文整理汇总了C++中Accessor::getDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ Accessor::getDouble方法的具体用法?C++ Accessor::getDouble怎么用?C++ Accessor::getDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Accessor的用法示例。


在下文中一共展示了Accessor::getDouble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: process


//.........这里部分代码省略.........
    targetAccessors[10] = &vgpTiePoint.getAccessor("VAA");
    targetAccessors[11] = &vgpTiePoint.getAccessor("VZA");

    const long firstTargetL = context.getFirstComputableL(vgp, *this);
    context.getLogging().debug("Segment [" + vgp.toString() + "]: firstComputableL = " + lexical_cast<string>(firstTargetL), getId());
    long lastTargetL = context.getLastComputableL(vgp, *this);
    context.getLogging().debug("Segment [" + vgp.toString() + "]: lastComputableL = " + lexical_cast<string>(lastTargetL), getId());

    double minSourceLat = 90.0;
    double maxSourceLat = -90.0;
    double minTargetLat = 90.0;
    double maxTargetLat = -90.0;

    getMinMaxSourceLat(minSourceLat, maxSourceLat);
    getMinMaxTargetLat(minTargetLat, maxTargetLat, firstTargetL, lastTargetL);

    // Is the target region north of the source region, without overlap?
    if (minTargetLat - DEGREES_PER_TARGET_PIXEL * 1.5 > maxSourceLat) {
        // Yes. Processing is completed.
        context.setLastComputedL(vgp, *this, lastTargetL);
        return;
    }

    // Is the target region south of the source region, without overlap?
    if (maxTargetLat + DEGREES_PER_TARGET_PIXEL * 1.5 < minSourceLat && context.getLastComputableL(syn, *this) < sourceGrid.getMaxL()) {
        // Yes. Processing will be completed later.
        return;
    }

    const long lastComputedSourceL = context.getLastComputableL(syn, *this);

    long sourceK = 0;
    long sourceL = 0;
    long sourceM = 0;
    long firstRequiredSourceL = 0;

    PixelFinder pixelFinder(*this, 0.7 * DEGREES_PER_TARGET_PIXEL);

    for (long l = firstTargetL; l <= lastTargetL; l++) {
        context.getLogging().progress("Processing line l = " + lexical_cast<string>(l), getId());

        firstRequiredSourceL = sourceGrid.getMaxInMemoryL() + 1;

        for (long k = targetGrid.getMinK(); k <= targetGrid.getMaxK(); k++) {
            for (long m = targetGrid.getMinM(); m <= targetGrid.getMaxM(); m++) {
                const double targetLat = getTargetLat(l);
                const double targetLon = getTargetLon(m);
                const bool sourcePixelFound = pixelFinder.findSourcePixel(targetLat, targetLon, sourceK, sourceL, sourceM);

                // 1. Is there a source pixel for the target pixel?
                if (!sourcePixelFound) {
                    continue;
                }

                // 2. Update first required sourceL
                firstRequiredSourceL = min(sourceL, firstRequiredSourceL);

                // 3. Is the current source line beyond the last computed source line?
                if (sourceL > lastComputedSourceL) {
                    // Yes.
                    lastTargetL = min(l - 1, lastTargetL);
                    continue;
                }

                const size_t sourceIndex = sourceGrid.getIndex(sourceK, sourceL, sourceM);

                // 4. Set the samples of the target pixel
                for (size_t i = 0; i < 5; i++) {
                    Accessor* sourceAccessor = sourceAccessors[i];
                    Accessor* targetAccessor = targetAccessors[i];

                    if (!sourceAccessor->isFillValue(sourceIndex)) {
                        setValue(sourceAccessor, targetAccessor, sourceIndex, targetGrid.getIndex(k, l, m));
                    }
                }
                // 5. Is the target pixel in the sub-sampled grid?
                if (l % 8 == 0 && m % 8 == 0) {
                    // Yes, set the samples of the sub-sampled target pixel
                    for (size_t i = 5; i < targetAccessors.size(); i++) {
                        const size_t targetIndex = subsampledTargetGrid.getIndex(k, l / 8, m / 8);

                        Accessor* sourceAccessor = sourceAccessors[i];
                        Accessor* targetAccessor = targetAccessors[i];

                        if (!sourceAccessor->isFillValue(sourceIndex)) {
                            targetAccessor->setDouble(targetIndex, sourceAccessor->getDouble(sourceIndex));
                        } else {
                            targetAccessor->setFillValue(targetIndex);
                        }
                    }
                }
            }
        }
    }

    context.setFirstRequiredL(syn, *this, firstRequiredSourceL);
    context.setFirstRequiredL(context.getSegment(Constants::SEGMENT_OLC), *this, firstRequiredSourceL);
    // TODO - needed for synchronizing OLC and SYN_COLLOCATED segments, better unite both segments into one
    context.setLastComputedL(vgp, *this, lastTargetL);
}
开发者ID:bcdev,项目名称:s3-synergy,代码行数:101,代码来源:Vpr.cpp


注:本文中的Accessor::getDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。