diff --git a/core/base/inc/TAttMarker.h b/core/base/inc/TAttMarker.h index 765cf574975da..b34c637302868 100644 --- a/core/base/inc/TAttMarker.h +++ b/core/base/inc/TAttMarker.h @@ -2,7 +2,7 @@ // Author: Rene Brun 12/05/95 /************************************************************************* - * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * @@ -12,11 +12,12 @@ #ifndef ROOT_TAttMarker #define ROOT_TAttMarker - #include "Rtypes.h" +#include class TColorNumber; class TVirtualPad; +class TPoint; class TAttMarker { @@ -30,45 +31,70 @@ class TAttMarker { TAttMarker(Color_t color, Style_t style, Size_t msize); virtual ~TAttMarker(); void Copy(TAttMarker &attmarker) const; - virtual Color_t GetMarkerColor() const {return fMarkerColor;} ///< Return the marker color - virtual Style_t GetMarkerStyle() const {return fMarkerStyle;} ///< Return the marker style - virtual Size_t GetMarkerSize() const {return fMarkerSize;} ///< Return the marker size + virtual Color_t GetMarkerColor() const { return fMarkerColor; } ///< Return the marker color + virtual Style_t GetMarkerStyle() const { return fMarkerStyle; } ///< Return the marker style + virtual Size_t GetMarkerSize() const { return fMarkerSize; } ///< Return the marker size virtual void Modify(); virtual void ModifyOn(TVirtualPad &pad); virtual void ResetAttMarker(Option_t *toption=""); - virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1); + virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef = 1, Int_t stydef = 1, Int_t sizdef = 1); virtual void SetMarkerAttributes(); // *MENU* - virtual void SetMarkerColor(Color_t mcolor=1) { fMarkerColor = mcolor;} ///< Set the marker color + virtual void SetMarkerColor(Color_t mcolor = 1); + void SetMarkerColor(TColorNumber lcolor); virtual void SetMarkerColorAlpha(Color_t mcolor, Float_t malpha); - virtual void SetMarkerStyle(Style_t mstyle=1) { fMarkerStyle = mstyle;} ///< Set the marker style - /// Set the marker size. - /// Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. - /// They are meant to be very fast to draw and are always drawn with the same number of pixels; - /// therefore this method does not apply on them. - virtual void SetMarkerSize(Size_t msize=1) { fMarkerSize = msize;} + virtual void SetMarkerStyle(Style_t mstyle = 1); + virtual void SetMarkerSize(Size_t msize = 1); + + enum EMarkerShape { kShapeDot, kShapeCircle, kShapeFilledCircle, kShapePolyLine, kShapeFilledArea, kShapeSegments }; - static Style_t GetMarkerStyleBase(Style_t style); - static Width_t GetMarkerLineWidth(Style_t style); + EMarkerShape GetMarkerShape(Int_t &sz, std::vector &points) const; - void SetMarkerColor(TColorNumber lcolor); + static Style_t GetMarkerStyleBase(Style_t style); + static Width_t GetMarkerLineWidth(Style_t style); ClassDef(TAttMarker,3); //Marker attributes }; - enum EMarkerStyle {kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, - kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, - kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, - kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, - kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, - kFullStar=29, kOpenStar=30, kOpenTriangleDown=32, - kFullDiamond=33, kFullCross=34, kOpenDiamondCross=35, - kOpenSquareDiagonal=36, kOpenThreeTriangles=37, - kOctagonCross=38, kFullThreeTriangles=39, - kOpenFourTrianglesX=40, kFullFourTrianglesX=41, - kOpenDoubleDiamond=42, kFullDoubleDiamond=43, - kOpenFourTrianglesPlus=44, kFullFourTrianglesPlus=45, - kOpenCrossX=46, kFullCrossX=47, kFourSquaresX=48, - kFourSquaresPlus=49 }; +enum EMarkerStyle { + kDot = 1, + kPlus = 2, + kStar = 3, + kCircle = 4, + kMultiply = 5, + kFullDotSmall = 6, + kFullDotMedium = 7, + kFullDotLarge = 8, + kFullCircle = 20, + kFullSquare = 21, + kFullTriangleUp = 22, + kFullTriangleDown = 23, + kOpenCircle = 24, + kOpenSquare = 25, + kOpenTriangleUp = 26, + kOpenDiamond = 27, + kOpenCross = 28, + kFullStar = 29, + kOpenStar = 30, + kStar2 = 31, + kOpenTriangleDown = 32, + kFullDiamond = 33, + kFullCross = 34, + kOpenDiamondCross = 35, + kOpenSquareDiagonal = 36, + kOpenThreeTriangles = 37, + kOctagonCross = 38, + kFullThreeTriangles = 39, + kOpenFourTrianglesX = 40, + kFullFourTrianglesX = 41, + kOpenDoubleDiamond = 42, + kFullDoubleDiamond = 43, + kOpenFourTrianglesPlus = 44, + kFullFourTrianglesPlus = 45, + kOpenCrossX = 46, + kFullCrossX = 47, + kFourSquaresX = 48, + kFourSquaresPlus = 49 +}; #endif diff --git a/core/base/src/TAttMarker.cxx b/core/base/src/TAttMarker.cxx index 97b85c36aa3bd..77bbaf429c88b 100644 --- a/core/base/src/TAttMarker.cxx +++ b/core/base/src/TAttMarker.cxx @@ -2,21 +2,23 @@ // Author: Rene Brun 12/05/95 /************************************************************************* - * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#include -#include "Strlen.h" #include "TAttMarker.h" + +#include +#include #include "TVirtualPad.h" #include "TVirtualPadPainter.h" #include "TVirtualPadEditor.h" #include "TStyle.h" #include "TColor.h" +#include "TPoint.h" /** \class TAttMarker @@ -107,7 +109,7 @@ accessed via a global name (third column). 28 open cross kOpenCross 29 full star kFullStar 30 open star kOpenStar - 31 * + 31 * kStar2 32 open triangle down kOpenTriangleDown 33 full diamond kFullDiamond 34 full cross kFullCross @@ -131,8 +133,7 @@ accessed via a global name (third column). Begin_Macro { TCanvas *c = new TCanvas("c","Marker types",0,0,500,200); - TMarker marker; - marker.DisplayMarkerTypes(); + TMarker::DisplayMarkerTypes(); } End_Macro @@ -158,8 +159,7 @@ starting from 50: Begin_Macro { TCanvas *c = new TCanvas("c","Marker line widths",0,0,600,266); - TMarker marker; - marker.DisplayMarkerLineWidths(); + TMarker::DisplayMarkerLineWidths(); } End_Macro @@ -209,10 +209,15 @@ style used is 1. That's the most common one to draw scatter plots. TAttMarker::TAttMarker() { - if (!gStyle) {fMarkerColor=1; fMarkerStyle=1; fMarkerSize=1; return;} - fMarkerColor = gStyle->GetMarkerColor(); - fMarkerStyle = gStyle->GetMarkerStyle(); - fMarkerSize = gStyle->GetMarkerSize(); + if (!gStyle) { + fMarkerColor = 1; + fMarkerStyle = kDot; + fMarkerSize = 1; + } else { + fMarkerColor = gStyle->GetMarkerColor(); + fMarkerStyle = gStyle->GetMarkerStyle(); + fMarkerSize = gStyle->GetMarkerSize(); + } } //////////////////////////////////////////////////////////////////////////////// @@ -253,49 +258,31 @@ void TAttMarker::Copy(TAttMarker &attmarker) const Style_t TAttMarker::GetMarkerStyleBase(Style_t style) { - if (style <= 49) + if (style <= kFourSquaresPlus) return style; switch ((style - 50) % 18) { - case 0: - return 2; - case 1: - return 3; - case 2: - return 5; - case 3: - return 24; - case 4: - return 25; - case 5: - return 26; - case 6: - return 27; - case 7: - return 28; - case 8: - return 30; - case 9: - return 32; - case 10: - return 35; - case 11: - return 36; - case 12: - return 37; - case 13: - return 38; - case 14: - return 40; - case 15: - return 42; - case 16: - return 44; - case 17: - return 46; - default: - return style; + case 0: return kPlus; + case 1: return kStar; + case 2: return kMultiply; + case 3: return kOpenCircle; + case 4: return kOpenSquare; + case 5: return kOpenTriangleUp; + case 6: return kOpenDiamond; + case 7: return kOpenCross; + case 8: return kOpenStar; + case 9: return kOpenTriangleDown; + case 10: return kOpenDiamondCross; + case 11: return kOpenSquareDiagonal; + case 12: return kOpenThreeTriangles; + case 13: return kOctagonCross; + case 14: return kOpenFourTrianglesX; + case 15: return kOpenDoubleDiamond; + case 16: return kOpenFourTrianglesPlus; + case 17: return kOpenCrossX; } + + return kDot; } //////////////////////////////////////////////////////////////////////////////// @@ -306,14 +293,15 @@ Width_t TAttMarker::GetMarkerLineWidth(Style_t style) { if (style >= 50) return ((style - 50) / 18) + 2; - else if (style == 2 || style == 3 || style == 4 || style == 5 - || style == 24 || style == 25 || style == 26 || style == 27 - || style == 28 || style == 30 || style == 31 || style == 32 - || style == 35 || style == 36 || style == 37 || style == 38 - || style == 40 || style == 42 || style == 44 || style == 46) + if (style == kPlus || style == kStar || style == kCircle || style == kMultiply || style == kOpenCircle || + style == kOpenSquare || style == kOpenTriangleUp || style == kOpenDiamond || style == kOpenCross || + style == kOpenStar || style == kStar2 || style == kOpenTriangleDown || style == kOpenDiamondCross || + style == kOpenSquareDiagonal || style == kOpenThreeTriangles || style == kOctagonCross || + style == kOpenFourTrianglesX || style == kOpenDoubleDiamond || style == kOpenFourTrianglesPlus || + style == kOpenCrossX) return 1; - else - return 0; + + return 0; } //////////////////////////////////////////////////////////////////////////////// @@ -342,7 +330,7 @@ void TAttMarker::ModifyOn(TVirtualPad &pad) void TAttMarker::ResetAttMarker(Option_t *) { fMarkerColor = 1; - fMarkerStyle = 1; + fMarkerStyle = kDot; fMarkerSize = 1; } @@ -364,7 +352,7 @@ void TAttMarker::SaveMarkerAttributes(std::ostream &out, const char *name, Int_t void TAttMarker::SetMarkerAttributes() { - TVirtualPadEditor::UpdateMarkerAttributes(fMarkerColor,fMarkerStyle,fMarkerSize); + TVirtualPadEditor::UpdateMarkerAttributes(fMarkerColor, fMarkerStyle, fMarkerSize); } //////////////////////////////////////////////////////////////////////////////// @@ -378,7 +366,398 @@ void TAttMarker::SetMarkerColorAlpha(Color_t mcolor, Float_t malpha) fMarkerColor = TColor::GetColorTransparent(mcolor, malpha); } +//////////////////////////////////////////////////////////////////////////////// +/// Set the marker color. + +void TAttMarker::SetMarkerColor(Color_t mcolor) +{ + fMarkerColor = mcolor; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Set the marker color. + void TAttMarker::SetMarkerColor(TColorNumber lcolor) { SetMarkerColor(lcolor.number()); } + +//////////////////////////////////////////////////////////////////////////////// +/// Set the marker style. + +void TAttMarker::SetMarkerStyle(Style_t mstyle) +{ + fMarkerStyle = mstyle; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Set the marker size. +/// Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. +/// They are meant to be very fast to draw and are always drawn with the same number of pixels; +/// therefore this method does not apply on them. + +void TAttMarker::SetMarkerSize(Size_t msize) +{ + fMarkerSize = msize; +} + +//////////////////////////////////////////////////////////////////////////////// +/// Return marker shape. +/// Depending from configured marker style different marker shapes are returned +/// For simple shape like circle just size is assigned, for other points vector is filled as well + +TAttMarker::EMarkerShape TAttMarker::GetMarkerShape(Int_t &sz, std::vector &shape) const +{ + Int_t markerStyle = GetMarkerStyleBase(GetMarkerStyle()); + Int_t markerLineWidth = GetMarkerLineWidth(GetMarkerStyle()); + + Float_t markerSizeReduced = GetMarkerSize() - std::floor(markerLineWidth/2.)/4.; + Int_t im = Int_t(4*markerSizeReduced + 0.5); + + sz = 0; + + switch (markerStyle) { + case kDot: + return kShapeDot; + case kPlus: + shape.resize(4); + shape[0].fX = -im; shape[0].fY = 0; + shape[1].fX = im; shape[1].fY = 0; + shape[2].fX = 0; shape[2].fY = -im; + shape[3].fX = 0; shape[3].fY = im; + return kShapeSegments; + case kStar: + case kStar2: + shape.resize(8); + shape[0].fX = -im; shape[0].fY = 0; + shape[1].fX = im; shape[1].fY = 0; + shape[2].fX = 0 ; shape[2].fY = -im; + shape[3].fX = 0 ; shape[3].fY = im; + im = Int_t(0.707*im + 0.5); + shape[4].fX = -im; shape[4].fY = -im; + shape[5].fX = im; shape[5].fY = im; + shape[6].fX = -im; shape[6].fY = im; + shape[7].fX = im; shape[7].fY = -im; + return kShapeSegments; + case kCircle: + case kOpenCircle: + sz = im * 2; + return kShapeCircle; + case kMultiply: + shape.resize(4); + im = Int_t(0.707*im + 0.5); + shape[0].fX = -im; shape[0].fY = -im; + shape[1].fX = im; shape[1].fY = im; + shape[2].fX = -im; shape[2].fY = im; + shape[3].fX = im; shape[3].fY = -im; + return kShapeSegments; + case kFullDotSmall: + shape.resize(4); + shape[0].fX = -1; shape[0].fY = 0; + shape[1].fX = 1; shape[1].fY = 0; + shape[2].fX = 0; shape[2].fY = -1; + shape[3].fX = 0; shape[3].fY = 1; + return kShapeSegments; + case kFullDotMedium: + shape.resize(6); + shape[0].fX = -1; shape[0].fY = 1; + shape[1].fX = 1; shape[1].fY = 1; + shape[2].fX = -1; shape[2].fY = 0; + shape[3].fX = 1; shape[3].fY = 0; + shape[4].fX = -1; shape[4].fY = -1; + shape[5].fX = 1; shape[5].fY = -1; + return kShapeSegments; + case kFullDotLarge: + case kFullCircle: + sz = im * 2; + return kShapeFilledCircle; + case kFullSquare: + shape.resize(5); + shape[0].fX = -im; shape[0].fY = -im; + shape[1].fX = im; shape[1].fY = -im; + shape[2].fX = im; shape[2].fY = im; + shape[3].fX = -im; shape[3].fY = im; + shape[4].fX = -im; shape[4].fY = -im; + return kShapeFilledArea; + case kFullTriangleUp: + case kOpenTriangleUp: + shape.resize(4); + shape[0].fX = -im; shape[0].fY = im; + shape[1].fX = im; shape[1].fY = im; + shape[2].fX = 0; shape[2].fY = -im; + shape[3].fX = -im; shape[3].fY = im; + return markerStyle == kFullTriangleUp ? kShapeFilledArea : kShapePolyLine; + case kFullTriangleDown: + case kOpenTriangleDown: + shape.resize(4); + shape[0].fX = 0; shape[0].fY = im; + shape[1].fX = im; shape[1].fY = -im; + shape[2].fX = -im; shape[2].fY = -im; + shape[3].fX = 0; shape[3].fY = im; + return markerStyle == kFullTriangleDown ? kShapeFilledArea : kShapePolyLine; + case kOpenSquare: + shape.resize(5); + shape[0].fX = -im; shape[0].fY = -im; + shape[1].fX = im; shape[1].fY = -im; + shape[2].fX = im; shape[2].fY = im; + shape[3].fX = -im; shape[3].fY = im; + shape[4].fX = -im; shape[4].fY = -im; + return kShapePolyLine; + case kOpenDiamond: + case kFullDiamond: { + shape.resize(5); + Int_t imx = Int_t(2.66*markerSizeReduced + 0.5); + shape[0].fX =-imx; shape[0].fY = 0; + shape[1].fX = 0; shape[1].fY = -im; + shape[2].fX = imx; shape[2].fY = 0; + shape[3].fX = 0; shape[3].fY = im; + shape[4].fX =-imx; shape[4].fY = 0; + return markerStyle == kFullDiamond ? kShapeFilledArea : kShapePolyLine; + } + case kOpenCross: + case kFullCross: { + shape.resize(13); + Int_t imx = Int_t(1.33*markerSizeReduced + 0.5); + shape[0].fX = -im; shape[0].fY =-imx; + shape[1].fX =-imx; shape[1].fY =-imx; + shape[2].fX =-imx; shape[2].fY = -im; + shape[3].fX = imx; shape[3].fY = -im; + shape[4].fX = imx; shape[4].fY =-imx; + shape[5].fX = im; shape[5].fY =-imx; + shape[6].fX = im; shape[6].fY = imx; + shape[7].fX = imx; shape[7].fY = imx; + shape[8].fX = imx; shape[8].fY = im; + shape[9].fX =-imx; shape[9].fY = im; + shape[10].fX=-imx; shape[10].fY= imx; + shape[11].fX= -im; shape[11].fY= imx; + shape[12].fX= -im; shape[12].fY=-imx; + return markerStyle == kFullCross ? kShapeFilledArea : kShapePolyLine; + } + case kFullStar: + case kOpenStar: { + shape.resize(11); + Int_t im1 = Int_t(0.66*markerSizeReduced + 0.5); + Int_t im2 = Int_t(2.00*markerSizeReduced + 0.5); + Int_t im3 = Int_t(2.66*markerSizeReduced + 0.5); + Int_t im4 = Int_t(1.33*markerSizeReduced + 0.5); + shape[0].fX = -im; shape[0].fY = im4; + shape[1].fX =-im2; shape[1].fY =-im1; + shape[2].fX =-im3; shape[2].fY = -im; + shape[3].fX = 0; shape[3].fY =-im2; + shape[4].fX = im3; shape[4].fY = -im; + shape[5].fX = im2; shape[5].fY =-im1; + shape[6].fX = im; shape[6].fY = im4; + shape[7].fX = im4; shape[7].fY = im4; + shape[8].fX = 0; shape[8].fY = im; + shape[9].fX =-im4; shape[9].fY = im4; + shape[10].fX= -im; shape[10].fY= im4; + return markerStyle == kFullStar ? kShapeFilledArea : kShapePolyLine; + } + case kOpenDiamondCross: + shape.resize(8); + shape[0].fX =-im; shape[0].fY = 0; + shape[1].fX = 0; shape[1].fY = -im; + shape[2].fX = im; shape[2].fY = 0; + shape[3].fX = 0; shape[3].fY = im; + shape[4].fX =-im; shape[4].fY = 0; + shape[5].fX = im; shape[5].fY = 0; + shape[6].fX = 0; shape[6].fY = im; + shape[7].fX = 0; shape[7].fY =-im; + return kShapePolyLine; + case kOpenSquareDiagonal: + shape.resize(8); + shape[0].fX = -im; shape[0].fY = -im; + shape[1].fX = im; shape[1].fY = -im; + shape[2].fX = im; shape[2].fY = im; + shape[3].fX = -im; shape[3].fY = im; + shape[4].fX = -im; shape[4].fY = -im; + shape[5].fX = im; shape[5].fY = im; + shape[6].fX = -im; shape[6].fY = im; + shape[7].fX = im; shape[7].fY = -im; + return kShapePolyLine; + case kOpenThreeTriangles: { + shape.resize(10); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = 0; + shape[1].fX =-im2; shape[1].fY = im; + shape[2].fX = im2; shape[2].fY = im; + shape[3].fX = 0; shape[3].fY = 0; + shape[4].fX =-im2; shape[4].fY = -im; + shape[5].fX = -im; shape[5].fY = 0; + shape[6].fX = 0; shape[6].fY = 0; + shape[7].fX = im; shape[7].fY = 0; + shape[8].fX = im2; shape[8].fY = -im; + shape[9].fX = 0; shape[9].fY = 0; + return kShapePolyLine; + } + case kOctagonCross: { + shape.resize(15); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = -im; shape[0].fY = 0; + shape[1].fX = -im; shape[1].fY =-im2; + shape[2].fX =-im2; shape[2].fY = -im; + shape[3].fX = im2; shape[3].fY = -im; + shape[4].fX = im; shape[4].fY =-im2; + shape[5].fX = im; shape[5].fY = im2; + shape[6].fX = im2; shape[6].fY = im; + shape[7].fX =-im2; shape[7].fY = im; + shape[8].fX = -im; shape[8].fY = im2; + shape[9].fX = -im; shape[9].fY = 0; + shape[10].fX = im; shape[10].fY = 0; + shape[11].fX = 0; shape[11].fY = 0; + shape[12].fX = 0; shape[12].fY = -im; + shape[13].fX = 0; shape[13].fY = im; + shape[14].fX = 0; shape[14].fY = 0; + return kShapePolyLine; + } + case kFullThreeTriangles: { + // FIXME: check why first and last point do not match + shape.resize(9); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = 0; + shape[1].fX =-im2; shape[1].fY = im; + shape[2].fX = im2; shape[2].fY = im; + shape[3].fX = 0; shape[3].fY = 0; + shape[4].fX =-im2; shape[4].fY = -im; + shape[5].fX = -im; shape[5].fY = 0; + shape[6].fX = 0; shape[6].fY = 0; + shape[7].fX = im; shape[7].fY = 0; + shape[8].fX = im2; shape[8].fY = -im; + return kShapeFilledArea; + } + case kOpenFourTrianglesX: + case kFullFourTrianglesX: { + shape.resize(13); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = 0; + shape[1].fX = im2; shape[1].fY = im; + shape[2].fX = im; shape[2].fY = im2; + shape[3].fX = 0; shape[3].fY = 0; + shape[4].fX = im; shape[4].fY = -im2; + shape[5].fX = im2; shape[5].fY = -im; + shape[6].fX = 0; shape[6].fY = 0; + shape[7].fX = -im2; shape[7].fY = -im; + shape[8].fX = -im; shape[8].fY = -im2; + shape[9].fX = 0; shape[9].fY = 0; + shape[10].fX = -im; shape[10].fY = im2; + shape[11].fX = -im2; shape[11].fY = im; + shape[12].fX = 0; shape[12].fY = 0; + return markerStyle == kFullFourTrianglesX ? kShapeFilledArea : kShapePolyLine; + } + case kOpenDoubleDiamond: + case kFullDoubleDiamond: { + shape.resize(9); + Int_t imx = Int_t(markerSizeReduced + 0.5); + shape[0].fX= 0; shape[0].fY= im; + shape[1].fX= -imx; shape[1].fY= imx; + shape[2].fX = -im; shape[2].fY = 0; + shape[3].fX = -imx; shape[3].fY = -imx; + shape[4].fX = 0; shape[4].fY = -im; + shape[5].fX = imx; shape[5].fY = -imx; + shape[6].fX = im; shape[6].fY = 0; + shape[7].fX= imx; shape[7].fY= imx; + shape[8].fX= 0; shape[8].fY= im; + return markerStyle == kFullDoubleDiamond ? kShapeFilledArea : kShapePolyLine; + } + case kOpenFourTrianglesPlus: { + shape.resize(11); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = 0; + shape[1].fX = im2; shape[1].fY = im; + shape[2].fX = -im2; shape[2].fY = im; + shape[3].fX = im2; shape[3].fY = -im; + shape[4].fX = -im2; shape[4].fY = -im; + shape[5].fX = 0; shape[5].fY = 0; + shape[6].fX = im; shape[6].fY = im2; + shape[7].fX = im; shape[7].fY = -im2; + shape[8].fX = -im; shape[8].fY = im2; + shape[9].fX = -im; shape[9].fY = -im2; + shape[10].fX = 0; shape[10].fY = 0; + return kShapePolyLine; + } + case kFullFourTrianglesPlus: { + shape.resize(13); + Int_t im0 = Int_t(0.4*markerSizeReduced + 0.5); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = im0; shape[0].fY = im0; + shape[1].fX = im2; shape[1].fY = im; + shape[2].fX = -im2; shape[2].fY = im; + shape[3].fX = -im0; shape[3].fY = im0; + shape[4].fX = -im; shape[4].fY = im2; + shape[5].fX = -im; shape[5].fY = -im2; + shape[6].fX = -im0; shape[6].fY = -im0; + shape[7].fX = -im2; shape[7].fY = -im; + shape[8].fX = im2; shape[8].fY = -im; + shape[9].fX = im0; shape[9].fY = -im0; + shape[10].fX = im; shape[10].fY = -im2; + shape[11].fX = im; shape[11].fY = im2; + shape[12].fX = im0; shape[12].fY = im0; + return kShapeFilledArea; + } + case kOpenCrossX: + case kFullCrossX: { + shape.resize(13); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = im2; + shape[1].fX = -im2; shape[1].fY = im; + shape[2].fX = -im; shape[2].fY = im2; + shape[3].fX = -im2; shape[3].fY = 0; + shape[4].fX = -im; shape[4].fY = -im2; + shape[5].fX = -im2; shape[5].fY = -im; + shape[6].fX = 0; shape[6].fY = -im2; + shape[7].fX = im2; shape[7].fY = -im; + shape[8].fX = im; shape[8].fY = -im2; + shape[9].fX = im2; shape[9].fY = 0; + shape[10].fX = im; shape[10].fY = im2; + shape[11].fX = im2; shape[11].fY = im; + shape[12].fX = 0; shape[12].fY = im2; + return markerStyle == kFullCrossX ? kShapeFilledArea : kShapePolyLine; + } + case kFourSquaresX: { + shape.resize(17); + Int_t im2 = Int_t(2.0*markerSizeReduced + 0.5); + shape[0].fX = 0; shape[0].fY = im2*1.005; + shape[1].fX = -im2; shape[1].fY = im; + shape[2].fX = -im; shape[2].fY = im2; + shape[3].fX = -im2; shape[3].fY = 0; + shape[4].fX = -im; shape[4].fY = -im2; + shape[5].fX = -im2; shape[5].fY = -im; + shape[6].fX = 0; shape[6].fY = -im2; + shape[7].fX = im2; shape[7].fY = -im; + shape[8].fX = im; shape[8].fY = -im2; + shape[9].fX = im2; shape[9].fY = 0; + shape[10].fX = im; shape[10].fY = im2; + shape[11].fX = im2; shape[11].fY = im; + shape[12].fX = 0; shape[12].fY = im2*0.995; + shape[13].fX = im2*0.995; shape[13].fY = 0; + shape[14].fX = 0; shape[14].fY = -im2*0.995; + shape[15].fX = -im2*0.995; shape[15].fY = 0; + shape[16].fX = 0; shape[16].fY = im2*0.995; + return kShapeFilledArea; + } + case kFourSquaresPlus: { + shape.resize(17); + Int_t imx = Int_t(1.33*markerSizeReduced + 0.5); + shape[0].fX =-imx; shape[0].fY =-imx*1.005; + shape[1].fX =-imx; shape[1].fY = -im; + shape[2].fX = imx; shape[2].fY = -im; + shape[3].fX = imx; shape[3].fY =-imx; + shape[4].fX = im; shape[4].fY =-imx; + shape[5].fX = im; shape[5].fY = imx; + shape[6].fX = imx; shape[6].fY = imx; + shape[7].fX = imx; shape[7].fY = im; + shape[8].fX =-imx; shape[8].fY = im; + shape[9].fX =-imx; shape[9].fY = imx; + shape[10].fX = -im; shape[10].fY = imx; + shape[11].fX = -im; shape[11].fY =-imx; + shape[12].fX =-imx; shape[12].fY =-imx*0.995; + shape[13].fX =-imx; shape[13].fY = imx; + shape[14].fX = imx; shape[14].fY = imx; + shape[15].fX = imx; shape[15].fY =-imx; + shape[16].fX =-imx; shape[16].fY =-imx*1.005; + return kShapeFilledArea; + } + } + + return kShapeDot; +} diff --git a/graf2d/x11/src/TGX11.cxx b/graf2d/x11/src/TGX11.cxx index 58625acb27407..d2c22ba6840ac 100644 --- a/graf2d/x11/src/TGX11.cxx +++ b/graf2d/x11/src/TGX11.cxx @@ -121,9 +121,9 @@ struct XWindow_t { Int_t fillFasi = 0; ///< selected fasi pattern Pixmap fillPattern = 0; ///< current initialized fill pattern TAttMarker fAttMarker = { -1, -1, -1 }; ///< current marker attribute - Int_t markerType = 0; ///< 4 differen kinds of marker + TAttMarker::EMarkerShape markerType = TAttMarker::kShapeDot; ///< 5 differen kinds of marker Int_t markerSize = 0; ///< size of simple markers - std::vector markerShape; ///< marker shape points + std::vector markerShape; ///< marker shape points Int_t markerLineWidth = 0; ///< line width used for marker TAttText fAttText; ///< current text attribute TGX11::EAlign textAlign = TGX11::kAlignNone; ///< selected text align @@ -737,10 +737,10 @@ void TGX11::DrawPolyMarkerW(WinContext_t wctxt, Int_t n, TPoint *xy) auto ctxt = (XWindow_t *) wctxt; XPoint *xyp = (XPoint *) xy; - if ((ctxt->markerShape.size() == 0) && (ctxt->markerSize <= 0)) { + if (ctxt->markerType == TAttMarker::kShapeDot) { const int kNMAX = 1000000; int nt = n/kNMAX; - for (int it=0;it<=nt;it++) { + for (int it = 0; it <= nt; it++) { if (it < nt) { XDrawPoints((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], &xyp[it*kNMAX], kNMAX, CoordModeOrigin); } else { @@ -752,39 +752,35 @@ void TGX11::DrawPolyMarkerW(WinContext_t wctxt, Int_t n, TPoint *xy) auto &shape = ctxt->markerShape; for (int m = 0; m < n; m++) { - if (ctxt->markerType == 0) { + if (ctxt->markerType == TAttMarker::kShapeCircle) { // hollow circle XDrawArc((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], xyp[m].x - r, xyp[m].y - r, ctxt->markerSize, ctxt->markerSize, 0, 360*64); - } else if (ctxt->markerType == 1) { + } else if (ctxt->markerType == TAttMarker::kShapeFilledCircle) { // filled circle XFillArc((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], xyp[m].x - r, xyp[m].y - r, ctxt->markerSize, ctxt->markerSize, 0, 360*64); } else { - for (size_t i = 0; i < shape.size(); i++) { - shape[i].x += xyp[m].x; - shape[i].y += xyp[m].y; + for (auto &pnt : shape) { + pnt.fX += xyp[m].x; + pnt.fY += xyp[m].y; } - switch(ctxt->markerType) { - case 2: - // hollow polygon - XDrawLines((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], - shape.data(), shape.size(), CoordModeOrigin); - break; - case 3: - // filled polygon - XFillPolygon((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], - shape.data(), shape.size(), Nonconvex, CoordModeOrigin); - break; - case 4: - // segmented line - XDrawSegments((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], - (XSegment *) shape.data(), shape.size()/2); - break; + if (ctxt->markerType == TAttMarker::kShapePolyLine) { + // hollow polygon + XDrawLines((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], + (XPoint *) shape.data(), shape.size(), CoordModeOrigin); + } else if (ctxt->markerType == TAttMarker::kShapeFilledArea) { + // filled polygon + XFillPolygon((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], + (XPoint *) shape.data(), shape.size(), Nonconvex, CoordModeOrigin); + } else if (ctxt->markerType == TAttMarker::kShapeSegments) { + // segmented line + XDrawSegments((Display*)fDisplay, ctxt->fDrawing, ctxt->fGClist[kGCmark], + (XSegment *) shape.data(), shape.size()/2); } - for (size_t i = 0; i < shape.size(); i++) { - shape[i].x -= xyp[m].x; - shape[i].y -= xyp[m].y; + for (auto &pnt : shape) { + pnt.fX -= xyp[m].x; + pnt.fY -= xyp[m].y; } } } @@ -3354,482 +3350,16 @@ void TGX11::SetAttMarker(WinContext_t wctxt, const TAttMarker &att) if (!changed) return; - Int_t markerstyle = TAttMarker::GetMarkerStyleBase(att.GetMarkerStyle()); ctxt->markerLineWidth = TAttMarker::GetMarkerLineWidth(att.GetMarkerStyle()); + ctxt->markerType = att.GetMarkerShape(ctxt->markerSize, ctxt->markerShape); - // The fast pixel markers need to be treated separately - if (markerstyle == 1 || markerstyle == 6 || markerstyle == 7) { - XSetLineAttributes((Display*)fDisplay, ctxt->fGClist[kGCmark], 0, LineSolid, CapButt, JoinMiter); + // The fast dots and simple lines do not need join properties + if (ctxt->markerType == TAttMarker::kShapeSegments) { + XSetLineAttributes((Display*)fDisplay, ctxt->fGClist[kGCmark], ctxt->markerLineWidth, LineSolid, CapButt, JoinMiter); } else { XSetLineAttributes((Display*)fDisplay, ctxt->fGClist[kGCmark], ctxt->markerLineWidth, gMarkerLineStyle, gMarkerCapStyle, gMarkerJoinStyle); } - - Float_t MarkerSizeReduced = att.GetMarkerSize() - TMath::Floor(ctxt->markerLineWidth/2.)/4.; - Int_t im = Int_t(4*MarkerSizeReduced + 0.5); - auto &shape = ctxt->markerShape; - ctxt->markerSize = 0; - ctxt->markerType = 0; - if (markerstyle == 2) { - // + shaped marker - shape.resize(4); - shape[0].x = -im; shape[0].y = 0; - shape[1].x = im; shape[1].y = 0; - shape[2].x = 0 ; shape[2].y = -im; - shape[3].x = 0 ; shape[3].y = im; - ctxt->markerType = 4; - } else if (markerstyle == 3 || markerstyle == 31) { - // * shaped marker - shape.resize(8); - shape[0].x = -im; shape[0].y = 0; - shape[1].x = im; shape[1].y = 0; - shape[2].x = 0 ; shape[2].y = -im; - shape[3].x = 0 ; shape[3].y = im; - im = Int_t(0.707*Float_t(im) + 0.5); - shape[4].x = -im; shape[4].y = -im; - shape[5].x = im; shape[5].y = im; - shape[6].x = -im; shape[6].y = im; - shape[7].x = im; shape[7].y = -im; - ctxt->markerType = 4; - } else if (markerstyle == 4 || markerstyle == 24) { - // O shaped marker - shape.resize(0); - ctxt->markerType = 0; - ctxt->markerSize = im*2; - } else if (markerstyle == 5) { - // X shaped marker - shape.resize(4); - im = Int_t(0.707*Float_t(im) + 0.5); - shape[0].x = -im; shape[0].y = -im; - shape[1].x = im; shape[1].y = im; - shape[2].x = -im; shape[2].y = im; - shape[3].x = im; shape[3].y = -im; - ctxt->markerType = 4; - } else if (markerstyle == 6) { - // + shaped marker (with 1 pixel) - shape.resize(4); - shape[0].x = -1 ; shape[0].y = 0; - shape[1].x = 1 ; shape[1].y = 0; - shape[2].x = 0 ; shape[2].y = -1; - shape[3].x = 0 ; shape[3].y = 1; - ctxt->markerType = 4; - } else if (markerstyle == 7) { - // . shaped marker (with 9 pixel) - shape.resize(6); - shape[0].x = -1 ; shape[0].y = 1; - shape[1].x = 1 ; shape[1].y = 1; - shape[2].x = -1 ; shape[2].y = 0; - shape[3].x = 1 ; shape[3].y = 0; - shape[4].x = -1 ; shape[4].y = -1; - shape[5].x = 1 ; shape[5].y = -1; - ctxt->markerType = 4; - } else if (markerstyle == 8 || markerstyle == 20) { - // O shaped marker (filled) - shape.resize(0); - ctxt->markerType = 1; - ctxt->markerSize = im*2; - } else if (markerstyle == 21) { - // full square - shape.resize(5); - shape[0].x = -im; shape[0].y = -im; - shape[1].x = im; shape[1].y = -im; - shape[2].x = im; shape[2].y = im; - shape[3].x = -im; shape[3].y = im; - shape[4].x = -im; shape[4].y = -im; - ctxt->markerType = 3; - } else if (markerstyle == 22) { - // full triangle up - shape.resize(4); - shape[0].x = -im; shape[0].y = im; - shape[1].x = im; shape[1].y = im; - shape[2].x = 0; shape[2].y = -im; - shape[3].x = -im; shape[3].y = im; - ctxt->markerType = 3; - } else if (markerstyle == 23) { - // full triangle down - shape.resize(4); - shape[0].x = 0; shape[0].y = im; - shape[1].x = im; shape[1].y = -im; - shape[2].x = -im; shape[2].y = -im; - shape[3].x = 0; shape[3].y = im; - ctxt->markerType = 3; - } else if (markerstyle == 25) { - // open square - shape.resize(5); - shape[0].x = -im; shape[0].y = -im; - shape[1].x = im; shape[1].y = -im; - shape[2].x = im; shape[2].y = im; - shape[3].x = -im; shape[3].y = im; - shape[4].x = -im; shape[4].y = -im; - ctxt->markerType = 2; - } else if (markerstyle == 26) { - // open triangle up - shape.resize(4); - shape[0].x = -im; shape[0].y = im; - shape[1].x = im; shape[1].y = im; - shape[2].x = 0; shape[2].y = -im; - shape[3].x = -im; shape[3].y = im; - ctxt->markerType = 2; - } else if (markerstyle == 27) { - // open losange - shape.resize(5); - Int_t imx = Int_t(2.66*MarkerSizeReduced + 0.5); - shape[0].x =-imx; shape[0].y = 0; - shape[1].x = 0; shape[1].y = -im; - shape[2].x = imx; shape[2].y = 0; - shape[3].x = 0; shape[3].y = im; - shape[4].x =-imx; shape[4].y = 0; - ctxt->markerType = 2; - } else if (markerstyle == 28) { - // open cross - shape.resize(13); - Int_t imx = Int_t(1.33*MarkerSizeReduced + 0.5); - shape[0].x = -im; shape[0].y =-imx; - shape[1].x =-imx; shape[1].y =-imx; - shape[2].x =-imx; shape[2].y = -im; - shape[3].x = imx; shape[3].y = -im; - shape[4].x = imx; shape[4].y =-imx; - shape[5].x = im; shape[5].y =-imx; - shape[6].x = im; shape[6].y = imx; - shape[7].x = imx; shape[7].y = imx; - shape[8].x = imx; shape[8].y = im; - shape[9].x =-imx; shape[9].y = im; - shape[10].x=-imx; shape[10].y= imx; - shape[11].x= -im; shape[11].y= imx; - shape[12].x= -im; shape[12].y=-imx; - ctxt->markerType = 2; - } else if (markerstyle == 29) { - // full star pentagone - shape.resize(11); - Int_t im1 = Int_t(0.66*MarkerSizeReduced + 0.5); - Int_t im2 = Int_t(2.00*MarkerSizeReduced + 0.5); - Int_t im3 = Int_t(2.66*MarkerSizeReduced + 0.5); - Int_t im4 = Int_t(1.33*MarkerSizeReduced + 0.5); - shape[0].x = -im; shape[0].y = im4; - shape[1].x =-im2; shape[1].y =-im1; - shape[2].x =-im3; shape[2].y = -im; - shape[3].x = 0; shape[3].y =-im2; - shape[4].x = im3; shape[4].y = -im; - shape[5].x = im2; shape[5].y =-im1; - shape[6].x = im; shape[6].y = im4; - shape[7].x = im4; shape[7].y = im4; - shape[8].x = 0; shape[8].y = im; - shape[9].x =-im4; shape[9].y = im4; - shape[10].x= -im; shape[10].y= im4; - ctxt->markerType = 3; - } else if (markerstyle == 30) { - // open star pentagone - shape.resize(11); - Int_t im1 = Int_t(0.66*MarkerSizeReduced + 0.5); - Int_t im2 = Int_t(2.00*MarkerSizeReduced + 0.5); - Int_t im3 = Int_t(2.66*MarkerSizeReduced + 0.5); - Int_t im4 = Int_t(1.33*MarkerSizeReduced + 0.5); - shape[0].x = -im; shape[0].y = im4; - shape[1].x =-im2; shape[1].y =-im1; - shape[2].x =-im3; shape[2].y = -im; - shape[3].x = 0; shape[3].y =-im2; - shape[4].x = im3; shape[4].y = -im; - shape[5].x = im2; shape[5].y =-im1; - shape[6].x = im; shape[6].y = im4; - shape[7].x = im4; shape[7].y = im4; - shape[8].x = 0; shape[8].y = im; - shape[9].x =-im4; shape[9].y = im4; - shape[10].x= -im; shape[10].y= im4; - ctxt->markerType = 2; - } else if (markerstyle == 32) { - // open triangle down - shape.resize(4); - shape[0].x = 0; shape[0].y = im; - shape[1].x = im; shape[1].y = -im; - shape[2].x = -im; shape[2].y = -im; - shape[3].x = 0; shape[3].y = im; - ctxt->markerType = 2; - } else if (markerstyle == 33) { - // full losange - shape.resize(5); - Int_t imx = Int_t(2.66*MarkerSizeReduced + 0.5); - shape[0].x =-imx; shape[0].y = 0; - shape[1].x = 0; shape[1].y = -im; - shape[2].x = imx; shape[2].y = 0; - shape[3].x = 0; shape[3].y = im; - shape[4].x =-imx; shape[4].y = 0; - ctxt->markerType = 3; - } else if (markerstyle == 34) { - // full cross - shape.resize(13); - Int_t imx = Int_t(1.33*MarkerSizeReduced + 0.5); - shape[0].x = -im; shape[0].y =-imx; - shape[1].x =-imx; shape[1].y =-imx; - shape[2].x =-imx; shape[2].y = -im; - shape[3].x = imx; shape[3].y = -im; - shape[4].x = imx; shape[4].y =-imx; - shape[5].x = im; shape[5].y =-imx; - shape[6].x = im; shape[6].y = imx; - shape[7].x = imx; shape[7].y = imx; - shape[8].x = imx; shape[8].y = im; - shape[9].x =-imx; shape[9].y = im; - shape[10].x=-imx; shape[10].y= imx; - shape[11].x= -im; shape[11].y= imx; - shape[12].x= -im; shape[12].y=-imx; - ctxt->markerType = 3; - } else if (markerstyle == 35) { - // diamond with cross - shape.resize(8); - shape[0].x =-im; shape[0].y = 0; - shape[1].x = 0; shape[1].y = -im; - shape[2].x = im; shape[2].y = 0; - shape[3].x = 0; shape[3].y = im; - shape[4].x =-im; shape[4].y = 0; - shape[5].x = im; shape[5].y = 0; - shape[6].x = 0; shape[6].y = im; - shape[7].x = 0; shape[7].y =-im; - ctxt->markerType = 2; - } else if (markerstyle == 36) { - // square with diagonal cross - shape.resize(8); - shape[0].x = -im; shape[0].y = -im; - shape[1].x = im; shape[1].y = -im; - shape[2].x = im; shape[2].y = im; - shape[3].x = -im; shape[3].y = im; - shape[4].x = -im; shape[4].y = -im; - shape[5].x = im; shape[5].y = im; - shape[6].x = -im; shape[6].y = im; - shape[7].x = im; shape[7].y = -im; - ctxt->markerType = 2; - } else if (markerstyle == 37) { - // open three triangles - shape.resize(10); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = 0; - shape[1].x =-im2; shape[1].y = im; - shape[2].x = im2; shape[2].y = im; - shape[3].x = 0; shape[3].y = 0; - shape[4].x =-im2; shape[4].y = -im; - shape[5].x = -im; shape[5].y = 0; - shape[6].x = 0; shape[6].y = 0; - shape[7].x = im; shape[7].y = 0; - shape[8].x = im2; shape[8].y = -im; - shape[9].x = 0; shape[9].y = 0; - ctxt->markerType = 2; - } else if (markerstyle == 38) { - // + shaped marker with octagon - shape.resize(15); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = -im; shape[0].y = 0; - shape[1].x = -im; shape[1].y =-im2; - shape[2].x =-im2; shape[2].y = -im; - shape[3].x = im2; shape[3].y = -im; - shape[4].x = im; shape[4].y =-im2; - shape[5].x = im; shape[5].y = im2; - shape[6].x = im2; shape[6].y = im; - shape[7].x =-im2; shape[7].y = im; - shape[8].x = -im; shape[8].y = im2; - shape[9].x = -im; shape[9].y = 0; - shape[10].x = im; shape[10].y = 0; - shape[11].x = 0; shape[11].y = 0; - shape[12].x = 0; shape[12].y = -im; - shape[13].x = 0; shape[13].y = im; - shape[14].x = 0; shape[14].y = 0; - ctxt->markerType = 2; - } else if (markerstyle == 39) { - // filled three triangles - shape.resize(9); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = 0; - shape[1].x =-im2; shape[1].y = im; - shape[2].x = im2; shape[2].y = im; - shape[3].x = 0; shape[3].y = 0; - shape[4].x =-im2; shape[4].y = -im; - shape[5].x = -im; shape[5].y = 0; - shape[6].x = 0; shape[6].y = 0; - shape[7].x = im; shape[7].y = 0; - shape[8].x = im2; shape[8].y = -im; - ctxt->markerType = 3; - } else if (markerstyle == 40) { - // four open triangles X - shape.resize(13); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = 0; - shape[1].x = im2; shape[1].y = im; - shape[2].x = im; shape[2].y = im2; - shape[3].x = 0; shape[3].y = 0; - shape[4].x = im; shape[4].y = -im2; - shape[5].x = im2; shape[5].y = -im; - shape[6].x = 0; shape[6].y = 0; - shape[7].x = -im2; shape[7].y = -im; - shape[8].x = -im; shape[8].y = -im2; - shape[9].x = 0; shape[9].y = 0; - shape[10].x = -im; shape[10].y = im2; - shape[11].x = -im2; shape[11].y = im; - shape[12].x = 0; shape[12].y = 0; - ctxt->markerType = 2; - } else if (markerstyle == 41) { - // four filled triangles X - shape.resize(13); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = 0; - shape[1].x = im2; shape[1].y = im; - shape[2].x = im; shape[2].y = im2; - shape[3].x = 0; shape[3].y = 0; - shape[4].x = im; shape[4].y = -im2; - shape[5].x = im2; shape[5].y = -im; - shape[6].x = 0; shape[6].y = 0; - shape[7].x = -im2; shape[7].y = -im; - shape[8].x = -im; shape[8].y = -im2; - shape[9].x = 0; shape[9].y = 0; - shape[10].x = -im; shape[10].y = im2; - shape[11].x = -im2; shape[11].y = im; - shape[12].x = 0; shape[12].y = 0; - ctxt->markerType = 3; - } else if (markerstyle == 42) { - // open double diamonds - shape.resize(9); - Int_t imx = Int_t(MarkerSizeReduced + 0.5); - shape[0].x= 0; shape[0].y= im; - shape[1].x= -imx; shape[1].y= imx; - shape[2].x = -im; shape[2].y = 0; - shape[3].x = -imx; shape[3].y = -imx; - shape[4].x = 0; shape[4].y = -im; - shape[5].x = imx; shape[5].y = -imx; - shape[6].x = im; shape[6].y = 0; - shape[7].x= imx; shape[7].y= imx; - shape[8].x= 0; shape[8].y= im; - ctxt->markerType = 2; - } else if (markerstyle == 43) { - // filled double diamonds - shape.resize(9); - Int_t imx = Int_t(MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = im; - shape[1].x = -imx; shape[1].y = imx; - shape[2].x = -im; shape[2].y = 0; - shape[3].x = -imx; shape[3].y = -imx; - shape[4].x = 0; shape[4].y = -im; - shape[5].x = imx; shape[5].y = -imx; - shape[6].x = im; shape[6].y = 0; - shape[7].x = imx; shape[7].y = imx; - shape[8].x = 0; shape[8].y = im; - ctxt->markerType = 3; - } else if (markerstyle == 44) { - // open four triangles plus - shape.resize(11); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = 0; - shape[1].x = im2; shape[1].y = im; - shape[2].x = -im2; shape[2].y = im; - shape[3].x = im2; shape[3].y = -im; - shape[4].x = -im2; shape[4].y = -im; - shape[5].x = 0; shape[5].y = 0; - shape[6].x = im; shape[6].y = im2; - shape[7].x = im; shape[7].y = -im2; - shape[8].x = -im; shape[8].y = im2; - shape[9].x = -im; shape[9].y = -im2; - shape[10].x = 0; shape[10].y = 0; - ctxt->markerType = 2; - } else if (markerstyle == 45) { - // filled four triangles plus - shape.resize(13); - Int_t im0 = Int_t(0.4*MarkerSizeReduced + 0.5); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = im0; shape[0].y = im0; - shape[1].x = im2; shape[1].y = im; - shape[2].x = -im2; shape[2].y = im; - shape[3].x = -im0; shape[3].y = im0; - shape[4].x = -im; shape[4].y = im2; - shape[5].x = -im; shape[5].y = -im2; - shape[6].x = -im0; shape[6].y = -im0; - shape[7].x = -im2; shape[7].y = -im; - shape[8].x = im2; shape[8].y = -im; - shape[9].x = im0; shape[9].y = -im0; - shape[10].x = im; shape[10].y = -im2; - shape[11].x = im; shape[11].y = im2; - shape[12].x = im0; shape[12].y = im0; - ctxt->markerType = 3; - } else if (markerstyle == 46) { - // open four triangles X - shape.resize(13); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = im2; - shape[1].x = -im2; shape[1].y = im; - shape[2].x = -im; shape[2].y = im2; - shape[3].x = -im2; shape[3].y = 0; - shape[4].x = -im; shape[4].y = -im2; - shape[5].x = -im2; shape[5].y = -im; - shape[6].x = 0; shape[6].y = -im2; - shape[7].x = im2; shape[7].y = -im; - shape[8].x = im; shape[8].y = -im2; - shape[9].x = im2; shape[9].y = 0; - shape[10].x = im; shape[10].y = im2; - shape[11].x = im2; shape[11].y = im; - shape[12].x = 0; shape[12].y = im2; - ctxt->markerType = 2; - } else if (markerstyle == 47) { - // filled four triangles X - shape.resize(13); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = im2; - shape[1].x = -im2; shape[1].y = im; - shape[2].x = -im; shape[2].y = im2; - shape[3].x = -im2; shape[3].y = 0; - shape[4].x = -im; shape[4].y = -im2; - shape[5].x = -im2; shape[5].y = -im; - shape[6].x = 0; shape[6].y = -im2; - shape[7].x = im2; shape[7].y = -im; - shape[8].x = im; shape[8].y = -im2; - shape[9].x = im2; shape[9].y = 0; - shape[10].x = im; shape[10].y = im2; - shape[11].x = im2; shape[11].y = im; - shape[12].x = 0; shape[12].y = im2; - ctxt->markerType = 3; - } else if (markerstyle == 48) { - // four filled squares X - shape.resize(17); - Int_t im2 = Int_t(2.0*MarkerSizeReduced + 0.5); - shape[0].x = 0; shape[0].y = im2*1.005; - shape[1].x = -im2; shape[1].y = im; - shape[2].x = -im; shape[2].y = im2; - shape[3].x = -im2; shape[3].y = 0; - shape[4].x = -im; shape[4].y = -im2; - shape[5].x = -im2; shape[5].y = -im; - shape[6].x = 0; shape[6].y = -im2; - shape[7].x = im2; shape[7].y = -im; - shape[8].x = im; shape[8].y = -im2; - shape[9].x = im2; shape[9].y = 0; - shape[10].x = im; shape[10].y = im2; - shape[11].x = im2; shape[11].y = im; - shape[12].x = 0; shape[12].y = im2*0.995; - shape[13].x = im2*0.995; shape[13].y = 0; - shape[14].x = 0; shape[14].y = -im2*0.995; - shape[15].x = -im2*0.995; shape[15].y = 0; - shape[16].x = 0; shape[16].y = im2*0.995; - ctxt->markerType = 3; - } else if (markerstyle == 49) { - // four filled squares plus - shape.resize(17); - Int_t imx = Int_t(1.33*MarkerSizeReduced + 0.5); - shape[0].x =-imx; shape[0].y =-imx*1.005; - shape[1].x =-imx; shape[1].y = -im; - shape[2].x = imx; shape[2].y = -im; - shape[3].x = imx; shape[3].y =-imx; - shape[4].x = im; shape[4].y =-imx; - shape[5].x = im; shape[5].y = imx; - shape[6].x = imx; shape[6].y = imx; - shape[7].x = imx; shape[7].y = im; - shape[8].x =-imx; shape[8].y = im; - shape[9].x =-imx; shape[9].y = imx; - shape[10].x = -im; shape[10].y = imx; - shape[11].x = -im; shape[11].y =-imx; - shape[12].x =-imx; shape[12].y =-imx*0.995; - shape[13].x =-imx; shape[13].y = imx; - shape[14].x = imx; shape[14].y = imx; - shape[15].x = imx; shape[15].y =-imx; - shape[16].x =-imx; shape[16].y =-imx*1.005; - ctxt->markerType = 3; - } else { - // single dot - shape.resize(0); - ctxt->markerType = 0; - ctxt->markerSize = 0; - } } //////////////////////////////////////////////////////////////////////////////// diff --git a/roottest/root/meta/MemberComments.ref b/roottest/root/meta/MemberComments.ref index d9b09d36a0c80..3bcf59833aaf2 100644 --- a/roottest/root/meta/MemberComments.ref +++ b/roottest/root/meta/MemberComments.ref @@ -45,6 +45,12 @@ OBJ: TViewPubDataMembers TViewPubDataMembers : 0 OBJ: TDataMember kSingleKey : 0 OBJ: TDataMember kOverwrite : 0 OBJ: TDataMember kWriteDelete : 0 + OBJ: TDataMember kShapeDot : 0 + OBJ: TDataMember kShapeCircle : 0 + OBJ: TDataMember kShapeFilledCircle : 0 + OBJ: TDataMember kShapePolyLine : 0 + OBJ: TDataMember kShapeFilledArea : 0 + OBJ: TDataMember kShapeSegments : 0 OBJ: TDataMember fArray [fN] Array of fN floats : 0 OBJ: TDataMember fN Number of array elements : 0 @@ -643,11 +649,11 @@ OBJ: TList TList Doubly linked list : 0 void TAttMarker::SetMarkerAttributes() childCl::Class()->GetListOfAllPublicMethods(): -childCl::childCl() // -childCl::childCl(const childCl&) // +childCl::childCl() // +childCl::childCl(const childCl&) // childCl::fGetIndex(Int_t aIndex) // Title Derived -childCl::~childCl() // -baseCl::baseCl() // -baseCl::baseCl(const baseCl&) // +childCl::~childCl() // +baseCl::baseCl() // +baseCl::baseCl(const baseCl&) // baseCl::fGetIndex(Int_t aIndex = 0) // Title Base -baseCl::~baseCl() // +baseCl::~baseCl() //