コード例 #1
0
void PlotEntitiesProperty::setPlotEntitySettings(PlotEntitySettings settings, int index) {
    if (entities_ == settings.getEntity()) {
        if (!dataEmpty()) {
            //new entity
            if (static_cast<size_t>(index) >= value_.size())
                value_.push_back(settings);
            else {
                value_.erase(value_.begin()+index);
                value_.insert(value_.begin()+index, settings);
            }
            notifyAll();
        }
    }
    else
        throw VoreenException("PlotEntitiesProperty::setPlotEntity: entities do not fit");
}
コード例 #2
0
bool PlotEntitySettings::operator==(const PlotEntitySettings& rhs) const {
    if (entity_ != rhs.getEntity())
        return false;

    if (entity_ == NONE)
        return true;
    else if (entity_ == LINE) {
        if (mainColumnIndex_ == rhs.getMainColumnIndex() &&
            candleTopColumnIndex_ == rhs.getCandleTopColumnIndex() &&
            candleBottomColumnIndex_ == rhs.getCandleBottomColumnIndex() &&
            stickTopColumnIndex_ == rhs.getStickTopColumnIndex() &&
            stickBottomColumnIndex_ == rhs.getStickBottomColumnIndex() &&
            firstColor_ == rhs.getFirstColor() &&
            secondColor_ == rhs.getSecondColor() &&
            lineStyle_ == rhs.getLineStyle() &&
            splineFlag_ == rhs.getSplineFlag() &&
            errorbarFlag_ == rhs.getErrorbarFlag() &&
            candleStickFlag_ == rhs.getCandleStickFlag())
            return true;
    }
    else if (entity_ == BAR) {
        if (mainColumnIndex_ == rhs.getMainColumnIndex() &&
            firstColor_ == rhs.getFirstColor())
            return true;
    }
    else if (entity_ == SURFACE) {
        if (mainColumnIndex_ == rhs.getMainColumnIndex() &&
            optionalColumnIndex_ == rhs.getOptionalColumnIndex() &&
            firstColor_ == rhs.getFirstColor() &&
            secondColor_ == rhs.getSecondColor() &&
            wireOnlyFlag_ == rhs.getWireOnlyFlag() &&
            heightmapFlag_ == rhs.getHeightmapFlag() &&
            colorMap_ == rhs.getColorMap())
            return true;
    }
    else if (entity_ == SCATTER) {
        if (mainColumnIndex_ == rhs.getMainColumnIndex() &&
            optionalColumnIndex_ == rhs.getOptionalColumnIndex() &&
            secondOptionalColumnIndex_ == rhs.getSecondOptionalColumnIndex() &&
            firstColor_ == rhs.getFirstColor() &&
            colorMap_ == rhs.getColorMap() &&
            minGlyphSize_ == rhs.getMinGlyphSize() &&
            maxGlyphSize_ == rhs.getMaxGlyphSize() &&
            glyphStyle_ == rhs.getGlyphStyle() &&
            texturePath_ == rhs.getTexturePath() &&
            useTextureFlag_ == rhs.getUseTextureFlag())
            return true;
    }
    return false;

}