예제 #1
0
void GraphModel::copyPropertiesFromGraph(const GraphModel *graph)
{
    using namespace global;
    if (graph) {
        QPen pen = graph->getPen();
        if (gIsLineWidthCopyable)
            setWidth(pen.widthF());
        if (gIsLineColorCopyable)
            setColor(pen.color());
        if (gIsLineStyleCopyable)
            setLineStyle(pen.style());
        if (gIsInterpolationCopyable)
            setLineInterpolation(graph->getLineInterpolation());

    //    if (gIsLineColorCopyable)
    //        setPenBrush(pen.brush());
        if (gIsDimensionCopyable)
            setUnit(graph->unit());


        QBrush brush = graph->brush();
        if (gIsBrushColorCopyable)
            setBrushColor(brush.color());
        if (gIsBrushStyleCopyable)
            setBrushStyle(brush.style());
        if (gIsBrushBasisCopyable)
            setFillBasis(graph->basisFillType());

        QCPScatterStyle scatterStyle = graph->getScatterStyle();
        if (gIsScatterShapeCopyable)
            setScatterShape(scatterStyle.shape());
        if (gIsScatterSizeCopyable)
            setScatterSize(scatterStyle.size());
        if (gIsScatterDecimationCopyable)
            setScatterDecimation(scatterStyle.decimation());

        if (gIsTransformationCopyable)
            setAffineConverter(graph->getAffineConverter());

        if (gIsStringRepresentationCopyable)
            setStringRepresentation(graph->stringRepresentation());

        if (gIsFiltersCopyable) {
            mFilterVector.clear();
            for(const auto& filter : graph->mFilterVector) {
                mFilterVector.push_back(filter->clone());
            }
        }
        updateOutputData();

    }


}
예제 #2
0
void GraphModel::setScatterStyle(const QCPScatterStyle &newScatterStyle)
{
   // if (!(scatterStyle == const_cast<QCPScatterStyle &>(newScatterStyle))) {
    if (scatterStyle.pen() != newScatterStyle.pen()
            || scatterStyle.brush() != newScatterStyle.brush()
            || scatterStyle.decimation() != newScatterStyle.decimation()
            || scatterStyle.shape() != newScatterStyle.shape()
            || scatterStyle.size() != newScatterStyle.size()) {
                scatterStyle = newScatterStyle;
                emit appearanceChanged();
    }
        // TODO operator == is not defined for QCPScatterStyle  !!!
    //}
}