當前位置: 首頁>>代碼示例>>C++>>正文


C++ Interval::getRight方法代碼示例

本文整理匯總了C++中Interval::getRight方法的典型用法代碼示例。如果您正苦於以下問題:C++ Interval::getRight方法的具體用法?C++ Interval::getRight怎麽用?C++ Interval::getRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Interval的用法示例。


在下文中一共展示了Interval::getRight方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: calcDomains

void BarPlot::calcDomains() {
    if (plotEntitiesProp_.dataValid()) {
        //the x domain is simply [0,number of rows-1]
        Interval<plot_t> xDomain = Interval<plot_t>(0,data_.getRowsCount()-1,false,false);
        //get y domain
        Interval<plot_t> yDomain;
        std::vector<PlotEntitySettings>::const_iterator it = plotEntitiesProp_.get().begin();
        if (barMode_.getValue() == PlotLibrary::GROUPED || barMode_.getValue() == PlotLibrary::MERGED) {
            for (; it < plotEntitiesProp_.get().end(); ++it) {
                Interval<plot_t> lineDomain = data_.getInterval(it->getMainColumnIndex());
                yDomain.unionWith(lineDomain);
            }
        }
        else {
            std::vector<int> columns;
            for (; it < plotEntitiesProp_.get().end(); ++it)
                columns.push_back(it->getMainColumnIndex());
            yDomain = data_.getSumInterval(columns);
        }
        xDomain = Interval<plot_t>(xDomain.getLeft()-0.5, xDomain.getRight()+0.5, false, false);
        yDomain = Interval<plot_t>(std::min(0.0, yDomain.getLeft()), std::max(0.0, yDomain.getRight()), true, true);
        plotLib_.setDomain(xDomain, PlotLibrary::X_AXIS);
        plotLib_.setDomain(yDomain, PlotLibrary::Y_AXIS);
    }
}
開發者ID:alvatar,項目名稱:smartmatter,代碼行數:25,代碼來源:barplot.cpp

示例2: calcDomains

void LinePlot::calcDomains() {
    if (plotEntitiesProp_.dataValid() && !inportHasPlotFunction_) {
        Interval<plot_t> xDomain = data_.getInterval(plotEntitiesProp_.getXColumnIndex());
        Interval<plot_t> yDomain = Interval<plot_t>();
        std::vector<PlotEntitySettings>::const_iterator it = plotEntitiesProp_.get().begin();
        for (; it < plotEntitiesProp_.get().end(); ++it) {
            if (!it->getCandleStickFlag()) {
                Interval<plot_t> lineDomain = data_.getInterval(it->getMainColumnIndex());
                if (it->getOptionalColumnIndex() != -1) {
                    Interval<plot_t> errorDomain = data_.getInterval(it->getOptionalColumnIndex());
                    plot_t error = std::max(abs(errorDomain.getLeft()), abs(errorDomain.getRight()));
                    lineDomain = Interval<plot_t>(lineDomain.getLeft()-error, lineDomain.getRight()+error);
                }
                yDomain.unionWith(lineDomain);
            }
            else {
                yDomain.unionWith(data_.getInterval(it->getStickTopColumnIndex()));
                yDomain.unionWith(data_.getInterval(it->getStickBottomColumnIndex()));
                yDomain.unionWith(data_.getInterval(it->getCandleTopColumnIndex()));
                yDomain.unionWith(data_.getInterval(it->getCandleBottomColumnIndex()));
            }
        }
        yDomain.enlarge(1.1);
        selectionProp_.setBaseZoomState(PlotZoomState(xDomain, yDomain));
    }
}
開發者ID:alvatar,項目名稱:smartmatter,代碼行數:26,代碼來源:lineplot.cpp


注:本文中的Interval::getRight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。