| 2467 | } |
| 2468 | |
| 2469 | void OriginProjectParser::loadCurve(const Origin::GraphCurve& originCurve, XYCurve* curve) const { |
| 2470 | DEBUG(Q_FUNC_INFO) |
| 2471 | |
| 2472 | // line properties |
| 2473 | if (originCurve.type == Origin::GraphCurve::Line || originCurve.type == Origin::GraphCurve::LineSymbol) { // TODO: what about *ErrorBar types? |
| 2474 | curve->setLineType(lineType(originCurve.lineConnect)); |
| 2475 | curve->line()->setStyle(penStyle(originCurve.lineStyle)); |
| 2476 | auto lineWidth = std::max(originCurve.lineWidth * elementScalingFactor, 1.); // minimum 1 px |
| 2477 | curve->line()->setWidth(Worksheet::convertToSceneUnits(lineWidth, Worksheet::Unit::Point)); |
| 2478 | curve->line()->setColor(color(originCurve.lineColor)); |
| 2479 | curve->line()->setOpacity(1 - originCurve.lineTransparency / 255); |
| 2480 | // TODO: handle unsigned char boxWidth of Origin::GraphCurve |
| 2481 | } else |
| 2482 | curve->line()->setStyle(Qt::NoPen); |
| 2483 | |
| 2484 | // symbol properties |
| 2485 | loadSymbol(originCurve, curve->symbol(), curve); |
| 2486 | |
| 2487 | // filling properties |
| 2488 | loadBackground(originCurve, curve->background()); |
| 2489 | } |
| 2490 | |
| 2491 | void OriginProjectParser::loadBackground(const Origin::GraphCurve& originCurve, Background* background) const { |
| 2492 | DEBUG(Q_FUNC_INFO << ", fill area? " << originCurve.fillArea) |
nothing calls this directly
no test coverage detected