12 #ifndef ROOT_TGLPadUtils
13 #define ROOT_TGLPadUtils
38 class PolygonStippleSet {
39 friend class ::TGLPadPainter;
40 friend class FillAttribSet;
42 std::vector<unsigned char> fStipples;
44 static const UInt_t fgBitSwap[];
45 static UInt_t SwapBits(UInt_t bits);
50 kStippleSize = kNRows * kRowSize
69 FillAttribSet(
const PolygonStippleSet & set, Bool_t ignoreStipple);
77 extern const UShort_t gLineStipples[];
78 extern const UInt_t gMaxStipple;
90 LineAttribSet(Bool_t smooth, UInt_t stipple, Double_t maxWidth, Bool_t setWidth);
104 class MarkerPainter {
107 mutable TPoint fStar[8];
108 mutable TPoint fCross[4];
110 mutable std::vector<TPoint> fCircle;
113 kSmallCirclePts = 80,
114 kLargeCirclePts = 150
119 void DrawDot(UInt_t n,
const TPoint *xy)
const;
120 void DrawPlus(UInt_t n,
const TPoint *xy)
const;
121 void DrawStar(UInt_t n,
const TPoint *xy)
const;
122 void DrawX(UInt_t n,
const TPoint *xy)
const;
123 void DrawFullDotSmall(UInt_t n,
const TPoint *xy)
const;
124 void DrawFullDotMedium(UInt_t n,
const TPoint *xy)
const;
126 void DrawCircle(UInt_t n,
const TPoint *xy)
const;
127 void DrawFullDotLarge(UInt_t n,
const TPoint *xy)
const;
129 void DrawFullSquare(UInt_t n,
const TPoint *xy)
const;
130 void DrawFullTrianlgeUp(UInt_t n,
const TPoint *xy)
const;
131 void DrawFullTrianlgeDown(UInt_t n,
const TPoint *xy)
const;
132 void DrawDiamond(UInt_t n,
const TPoint *xy)
const;
133 void DrawFullDiamond(UInt_t n,
const TPoint *xy)
const;
134 void DrawOpenTrianlgeDown(UInt_t n,
const TPoint *xy)
const;
135 void DrawFullCross(UInt_t n,
const TPoint *xy)
const;
136 void DrawOpenCross(UInt_t n,
const TPoint *xy)
const;
137 void DrawFullStar(UInt_t n,
const TPoint *xy)
const;
138 void DrawOpenStar(UInt_t n,
const TPoint *xy)
const;
139 void DrawOpenSquareDiagonal(UInt_t n,
const TPoint *xy)
const;
140 void DrawOpenDiamondCross(UInt_t n,
const TPoint *xy)
const;
141 void DrawOpenThreeTriangles(UInt_t n,
const TPoint *xy)
const;
142 void DrawOctagonCross(UInt_t n,
const TPoint *xy)
const;
143 void DrawFullThreeTriangles(UInt_t n,
const TPoint *xy)
const;
144 void DrawOpenFourTrianglesX(UInt_t n,
const TPoint *xy)
const;
145 void DrawFullFourTrianglesX(UInt_t n,
const TPoint *xy)
const;
146 void DrawOpenDoubleDiamond(UInt_t n,
const TPoint *xy)
const;
147 void DrawFullDoubleDiamond(UInt_t n,
const TPoint *xy)
const;
148 void DrawOpenFourTrianglesPlus(UInt_t n,
const TPoint *xy)
const;
149 void DrawFullFourTrianglesPlus(UInt_t n,
const TPoint *xy)
const;
150 void DrawOpenCrossX(UInt_t n,
const TPoint *xy)
const;
151 void DrawFullCrossX(UInt_t n,
const TPoint *xy)
const;
152 void DrawFourSquaresX(UInt_t n,
const TPoint *xy)
const;
153 void DrawFourSquaresPlus(UInt_t n,
const TPoint *xy)
const;
163 MeshPatch_t(Int_t type) : fPatchType(type)
167 std::vector<Double_t> fPatch;
170 typedef std::list<MeshPatch_t> Tesselation_t;
176 Tesselator(Bool_t dump = kFALSE);
185 static void SetDump(Tesselation_t *t)
190 static Tesselation_t *GetDump()
199 static Tesselation_t *fVs;
206 class OffScreenDevice {
207 friend class ::TGLPadPainter;
209 OffScreenDevice(UInt_t w, UInt_t h, UInt_t x, UInt_t y, Bool_t top);
219 void ExtractRGBA(Color_t colorIndex, Float_t *rgba);
225 Double_t GetMaxLineWidth()
const;
226 Double_t GetMaxPointSize()
const;
228 mutable Double_t fMaxLineWidth;
229 mutable Double_t fMaxPointSize;
235 template<
class ValueType>
236 struct BoundingRect {
237 ValueType fXMin = ValueType();
238 ValueType fYMin = ValueType();
239 ValueType fWidth = ValueType();
240 ValueType fHeight = ValueType();
242 ValueType fXMax = ValueType();
243 ValueType fYMax = ValueType();
247 template<
class ValueType>
248 BoundingRect<ValueType> FindBoundingRect(Int_t nPoints,
const ValueType *xs,
const ValueType *ys);