diff --git a/lib/jkqtcommon/jkqtpdrawingtools.h b/lib/jkqtcommon/jkqtpdrawingtools.h index 4d8c533f75..5be405e2ff 100644 --- a/lib/jkqtcommon/jkqtpdrawingtools.h +++ b/lib/jkqtcommon/jkqtpdrawingtools.h @@ -675,8 +675,8 @@ inline void JKQTPPlotSymbol(TPainter& painter, double x, double y, JKQTPGraphSym static std::vector all_paths = []() { // this functor is called the the static variable symbolData is initialized, but only once per runtimme (guaranteed by C++) - std::vector all_paths; - all_paths.resize(JKQTPSymbolCount); + std::vector paths; + paths.resize(JKQTPSymbolCount); // calculate star cordinates as static values const double s45=fabs(cos(45.0/180.0*JKQTPSTATISTICS_PI)); @@ -684,180 +684,180 @@ inline void JKQTPPlotSymbol(TPainter& painter, double x, double y, JKQTPGraphSym const auto star6cords=JKQTPGetStarCoordinates<6>(0.5); const auto star8cords=JKQTPGetStarCoordinates<8>(0.5); - all_paths[JKQTPCross].paths.moveTo(-0.5,-0.5); - all_paths[JKQTPCross].paths.lineTo(0.5,0.5); - all_paths[JKQTPCross].paths.moveTo(-0.5,+0.5); - all_paths[JKQTPCross].paths.lineTo(+0.5,-0.5); - all_paths[JKQTPPlus].paths.moveTo(-0.5,0); - all_paths[JKQTPPlus].paths.lineTo(0.5,0); - all_paths[JKQTPPlus].paths.moveTo(0,+0.5); - all_paths[JKQTPPlus].paths.lineTo(0,-0.5); - all_paths[JKQTPCircle].paths.addEllipse(QPointF(0,0), 0.5, 0.5); - all_paths[JKQTPFilledCircle].filledpaths=all_paths[JKQTPCircle].paths; - all_paths[JKQTPCircleCross].paths.addEllipse(QPointF(0,0), 0.5, 0.5); - all_paths[JKQTPCircleCross].paths.moveTo(-0.5*s45,-0.5*s45); - all_paths[JKQTPCircleCross].paths.lineTo(0.5*s45,0.5*s45); - all_paths[JKQTPCircleCross].paths.moveTo(-0.5*s45,+0.5*s45); - all_paths[JKQTPCircleCross].paths.lineTo(+0.5*s45,-0.5*s45); - all_paths[JKQTPCirclePlus].paths.addEllipse(QPointF(0,0), 0.5, 0.5); - all_paths[JKQTPCirclePlus].paths.moveTo(-0.5,0); - all_paths[JKQTPCirclePlus].paths.lineTo(0.5,0); - all_paths[JKQTPCirclePlus].paths.moveTo(0,+0.5); - all_paths[JKQTPCirclePlus].paths.lineTo(0,-0.5); - all_paths[JKQTPCirclePeace].paths.addEllipse(QPointF(0,0), 0.5, 0.5); - all_paths[JKQTPCirclePeace].paths.moveTo(0,-0.5); - all_paths[JKQTPCirclePeace].paths.lineTo(0, 0.5); - all_paths[JKQTPCirclePeace].paths.moveTo(0,0); - all_paths[JKQTPCirclePeace].paths.lineTo(0.5*s45,0.5*s45); - all_paths[JKQTPCirclePeace].paths.moveTo(0,0); - all_paths[JKQTPCirclePeace].paths.lineTo(-0.5*s45,0.5*s45); - all_paths[JKQTPPeace].paths.moveTo(0,-0.5); - all_paths[JKQTPPeace].paths.lineTo(0, 0.5); - all_paths[JKQTPPeace].paths.moveTo(0,0); - all_paths[JKQTPPeace].paths.lineTo(0.5*s45,0.5*s45); - all_paths[JKQTPPeace].paths.moveTo(0,0); - all_paths[JKQTPPeace].paths.lineTo(-0.5*s45,0.5*s45); - all_paths[JKQTPTarget].paths.addEllipse(QPointF(0,0), 0.33333, 0.33333); - all_paths[JKQTPTarget].paths.moveTo(QPointF(0,-0.5)); - all_paths[JKQTPTarget].paths.lineTo(QPointF(0,0.5)); - all_paths[JKQTPTarget].paths.moveTo(QPointF(-0.5,0)); - all_paths[JKQTPTarget].paths.lineTo(QPointF(0.5,0)); - all_paths[JKQTPFemale].paths.addEllipse(-0.25,-0.5,0.5,0.5); - all_paths[JKQTPFemale].paths.moveTo(0,0); - all_paths[JKQTPFemale].paths.lineTo(0,0.5); - all_paths[JKQTPFemale].paths.moveTo(-0.5/3.0,0.5/2.0); - all_paths[JKQTPFemale].paths.lineTo(0.5/3.0,0.5/2.0); - all_paths[JKQTPMale].paths.addEllipse(QRectF(-0.5/2.0, -0.5/2.0, 0.5, 0.5)); - all_paths[JKQTPMale].paths.moveTo(QPointF(+0.5/2.0*cos(45.0/180.0*JKQTPSTATISTICS_PI),-0.5/2.0*cos(45.0/180.0*JKQTPSTATISTICS_PI))); - all_paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5)); - all_paths[JKQTPMale].paths.moveTo(QPointF(+0.5-0.5/2.0,-0.5)); - all_paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5)); - all_paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5+0.5/2.0)); - all_paths[JKQTPRect].paths.addRect(-0.5,-0.5, 1,1); - all_paths[JKQTPFilledRect].filledpaths=all_paths[JKQTPRect].paths; - all_paths[JKQTPRectCross].paths.addRect(-0.5,-0.5, 1,1); - all_paths[JKQTPRectCross].paths.moveTo(-0.5,-0.5); - all_paths[JKQTPRectCross].paths.lineTo(0.5,0.5); - all_paths[JKQTPRectCross].paths.moveTo(-0.5,+0.5); - all_paths[JKQTPRectCross].paths.lineTo(+0.5,-0.5); - all_paths[JKQTPRectPlus].paths.addRect(-0.5,-0.5, 1,1); - all_paths[JKQTPRectPlus].paths.moveTo(-0.5,0); - all_paths[JKQTPRectPlus].paths.lineTo(0.5,0); - all_paths[JKQTPRectPlus].paths.moveTo(0,+0.5); - all_paths[JKQTPRectPlus].paths.lineTo(0,-0.5); - all_paths[JKQTPCurvedTriangle].paths.moveTo(0,0-0.5); - all_paths[JKQTPCurvedTriangle].paths.quadTo(0-1.0/10.0,0+1.0/4.0, 0-0.5,0+0.5); - all_paths[JKQTPCurvedTriangle].paths.quadTo(0,0+1.0/4.0, 0+0.5,0+0.5); - all_paths[JKQTPCurvedTriangle].paths.quadTo(0+1.0/10.0,0+1.0/4.0, 0,0-0.5); - all_paths[JKQTPFilledCurvedTriangle].filledpaths=all_paths[JKQTPCurvedTriangle].paths; + paths[JKQTPCross].paths.moveTo(-0.5,-0.5); + paths[JKQTPCross].paths.lineTo(0.5,0.5); + paths[JKQTPCross].paths.moveTo(-0.5,+0.5); + paths[JKQTPCross].paths.lineTo(+0.5,-0.5); + paths[JKQTPPlus].paths.moveTo(-0.5,0); + paths[JKQTPPlus].paths.lineTo(0.5,0); + paths[JKQTPPlus].paths.moveTo(0,+0.5); + paths[JKQTPPlus].paths.lineTo(0,-0.5); + paths[JKQTPCircle].paths.addEllipse(QPointF(0,0), 0.5, 0.5); + paths[JKQTPFilledCircle].filledpaths=paths[JKQTPCircle].paths; + paths[JKQTPCircleCross].paths.addEllipse(QPointF(0,0), 0.5, 0.5); + paths[JKQTPCircleCross].paths.moveTo(-0.5*s45,-0.5*s45); + paths[JKQTPCircleCross].paths.lineTo(0.5*s45,0.5*s45); + paths[JKQTPCircleCross].paths.moveTo(-0.5*s45,+0.5*s45); + paths[JKQTPCircleCross].paths.lineTo(+0.5*s45,-0.5*s45); + paths[JKQTPCirclePlus].paths.addEllipse(QPointF(0,0), 0.5, 0.5); + paths[JKQTPCirclePlus].paths.moveTo(-0.5,0); + paths[JKQTPCirclePlus].paths.lineTo(0.5,0); + paths[JKQTPCirclePlus].paths.moveTo(0,+0.5); + paths[JKQTPCirclePlus].paths.lineTo(0,-0.5); + paths[JKQTPCirclePeace].paths.addEllipse(QPointF(0,0), 0.5, 0.5); + paths[JKQTPCirclePeace].paths.moveTo(0,-0.5); + paths[JKQTPCirclePeace].paths.lineTo(0, 0.5); + paths[JKQTPCirclePeace].paths.moveTo(0,0); + paths[JKQTPCirclePeace].paths.lineTo(0.5*s45,0.5*s45); + paths[JKQTPCirclePeace].paths.moveTo(0,0); + paths[JKQTPCirclePeace].paths.lineTo(-0.5*s45,0.5*s45); + paths[JKQTPPeace].paths.moveTo(0,-0.5); + paths[JKQTPPeace].paths.lineTo(0, 0.5); + paths[JKQTPPeace].paths.moveTo(0,0); + paths[JKQTPPeace].paths.lineTo(0.5*s45,0.5*s45); + paths[JKQTPPeace].paths.moveTo(0,0); + paths[JKQTPPeace].paths.lineTo(-0.5*s45,0.5*s45); + paths[JKQTPTarget].paths.addEllipse(QPointF(0,0), 0.33333, 0.33333); + paths[JKQTPTarget].paths.moveTo(QPointF(0,-0.5)); + paths[JKQTPTarget].paths.lineTo(QPointF(0,0.5)); + paths[JKQTPTarget].paths.moveTo(QPointF(-0.5,0)); + paths[JKQTPTarget].paths.lineTo(QPointF(0.5,0)); + paths[JKQTPFemale].paths.addEllipse(-0.25,-0.5,0.5,0.5); + paths[JKQTPFemale].paths.moveTo(0,0); + paths[JKQTPFemale].paths.lineTo(0,0.5); + paths[JKQTPFemale].paths.moveTo(-0.5/3.0,0.5/2.0); + paths[JKQTPFemale].paths.lineTo(0.5/3.0,0.5/2.0); + paths[JKQTPMale].paths.addEllipse(QRectF(-0.5/2.0, -0.5/2.0, 0.5, 0.5)); + paths[JKQTPMale].paths.moveTo(QPointF(+0.5/2.0*cos(45.0/180.0*JKQTPSTATISTICS_PI),-0.5/2.0*cos(45.0/180.0*JKQTPSTATISTICS_PI))); + paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5)); + paths[JKQTPMale].paths.moveTo(QPointF(+0.5-0.5/2.0,-0.5)); + paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5)); + paths[JKQTPMale].paths.lineTo(QPointF(+0.5,-0.5+0.5/2.0)); + paths[JKQTPRect].paths.addRect(-0.5,-0.5, 1,1); + paths[JKQTPFilledRect].filledpaths=paths[JKQTPRect].paths; + paths[JKQTPRectCross].paths.addRect(-0.5,-0.5, 1,1); + paths[JKQTPRectCross].paths.moveTo(-0.5,-0.5); + paths[JKQTPRectCross].paths.lineTo(0.5,0.5); + paths[JKQTPRectCross].paths.moveTo(-0.5,+0.5); + paths[JKQTPRectCross].paths.lineTo(+0.5,-0.5); + paths[JKQTPRectPlus].paths.addRect(-0.5,-0.5, 1,1); + paths[JKQTPRectPlus].paths.moveTo(-0.5,0); + paths[JKQTPRectPlus].paths.lineTo(0.5,0); + paths[JKQTPRectPlus].paths.moveTo(0,+0.5); + paths[JKQTPRectPlus].paths.lineTo(0,-0.5); + paths[JKQTPCurvedTriangle].paths.moveTo(0,0-0.5); + paths[JKQTPCurvedTriangle].paths.quadTo(0-1.0/10.0,0+1.0/4.0, 0-0.5,0+0.5); + paths[JKQTPCurvedTriangle].paths.quadTo(0,0+1.0/4.0, 0+0.5,0+0.5); + paths[JKQTPCurvedTriangle].paths.quadTo(0+1.0/10.0,0+1.0/4.0, 0,0-0.5); + paths[JKQTPFilledCurvedTriangle].filledpaths=paths[JKQTPCurvedTriangle].paths; - all_paths[JKQTPDownCurvedTriangle].paths=all_paths[JKQTPCurvedTriangle].paths; - all_paths[JKQTPDownCurvedTriangle].pathsrotation=180.0; - all_paths[JKQTPFilledDownCurvedTriangle].filledpaths=all_paths[JKQTPDownCurvedTriangle].paths; - all_paths[JKQTPFilledDownCurvedTriangle].pathsrotation=180.0; + paths[JKQTPDownCurvedTriangle].paths=paths[JKQTPCurvedTriangle].paths; + paths[JKQTPDownCurvedTriangle].pathsrotation=180.0; + paths[JKQTPFilledDownCurvedTriangle].filledpaths=paths[JKQTPDownCurvedTriangle].paths; + paths[JKQTPFilledDownCurvedTriangle].pathsrotation=180.0; - all_paths[JKQTPLeftCurvedTriangle].paths=all_paths[JKQTPCurvedTriangle].paths; - all_paths[JKQTPLeftCurvedTriangle].pathsrotation=-90.0; - all_paths[JKQTPFilledLeftCurvedTriangle].filledpaths=all_paths[JKQTPLeftCurvedTriangle].paths; - all_paths[JKQTPFilledLeftCurvedTriangle].pathsrotation=-90.0; + paths[JKQTPLeftCurvedTriangle].paths=paths[JKQTPCurvedTriangle].paths; + paths[JKQTPLeftCurvedTriangle].pathsrotation=-90.0; + paths[JKQTPFilledLeftCurvedTriangle].filledpaths=paths[JKQTPLeftCurvedTriangle].paths; + paths[JKQTPFilledLeftCurvedTriangle].pathsrotation=-90.0; - all_paths[JKQTPRightCurvedTriangle].paths=all_paths[JKQTPCurvedTriangle].paths; - all_paths[JKQTPRightCurvedTriangle].pathsrotation=90.0; - all_paths[JKQTPFilledRightCurvedTriangle].filledpaths=all_paths[JKQTPRightCurvedTriangle].paths; - all_paths[JKQTPFilledRightCurvedTriangle].pathsrotation=90.0; + paths[JKQTPRightCurvedTriangle].paths=paths[JKQTPCurvedTriangle].paths; + paths[JKQTPRightCurvedTriangle].pathsrotation=90.0; + paths[JKQTPFilledRightCurvedTriangle].filledpaths=paths[JKQTPRightCurvedTriangle].paths; + paths[JKQTPFilledRightCurvedTriangle].pathsrotation=90.0; { QPolygonF poly; poly<