Warning, file /include/root/TGLPadUtils.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TGLPadUtils
0013 #define ROOT_TGLPadUtils
0014
0015 #include <vector>
0016 #include <list>
0017
0018 #include "RStipples.h"
0019 #include "TPoint.h"
0020 #include "RtypesCore.h"
0021
0022 class TGLPadPainter;
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 namespace Rgl {
0033 namespace Pad {
0034
0035
0036
0037
0038 class PolygonStippleSet {
0039 friend class ::TGLPadPainter;
0040 friend class FillAttribSet;
0041 private:
0042 std::vector<unsigned char> fStipples;
0043
0044 static const UInt_t fgBitSwap[];
0045 static UInt_t SwapBits(UInt_t bits);
0046
0047 enum EGeometry {
0048 kRowSize = 4,
0049 kNRows = 32,
0050 kStippleSize = kNRows * kRowSize
0051 };
0052
0053 enum EBitMasks {
0054 kLow4 = 0xf,
0055 kUp4 = 0xf0,
0056 k16Bits = 0xff
0057 };
0058 public:
0059 PolygonStippleSet();
0060 };
0061
0062
0063
0064
0065 class FillAttribSet {
0066 UInt_t fStipple;
0067 Float_t fAlpha;
0068 public:
0069 FillAttribSet(const PolygonStippleSet & set, Bool_t ignoreStipple);
0070 ~FillAttribSet();
0071 };
0072
0073
0074
0075
0076
0077 extern const UShort_t gLineStipples[];
0078 extern const UInt_t gMaxStipple;
0079
0080
0081
0082
0083 class LineAttribSet {
0084 private:
0085 Bool_t fSmooth;
0086 UInt_t fStipple;
0087 Bool_t fSetWidth;
0088 Float_t fAlpha;
0089 public:
0090 LineAttribSet(Bool_t smooth, UInt_t stipple, Double_t maxWidth, Bool_t setWidth);
0091 ~LineAttribSet();
0092 };
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104 class MarkerPainter {
0105 private:
0106
0107 mutable TPoint fStar[8];
0108 mutable TPoint fCross[4];
0109
0110 mutable std::vector<TPoint> fCircle;
0111
0112 enum {
0113 kSmallCirclePts = 80,
0114 kLargeCirclePts = 150
0115 };
0116
0117 public:
0118
0119 void DrawDot(UInt_t n, const TPoint *xy)const;
0120 void DrawPlus(UInt_t n, const TPoint *xy)const;
0121 void DrawStar(UInt_t n, const TPoint *xy)const;
0122 void DrawX(UInt_t n, const TPoint *xy)const;
0123 void DrawFullDotSmall(UInt_t n, const TPoint *xy)const;
0124 void DrawFullDotMedium(UInt_t n, const TPoint *xy)const;
0125
0126 void DrawCircle(UInt_t n, const TPoint *xy)const;
0127 void DrawFullDotLarge(UInt_t n, const TPoint *xy)const;
0128
0129 void DrawFullSquare(UInt_t n, const TPoint *xy)const;
0130 void DrawFullTrianlgeUp(UInt_t n, const TPoint *xy)const;
0131 void DrawFullTrianlgeDown(UInt_t n, const TPoint *xy)const;
0132 void DrawDiamond(UInt_t n, const TPoint *xy)const;
0133 void DrawFullDiamond(UInt_t n, const TPoint *xy)const;
0134 void DrawOpenTrianlgeDown(UInt_t n, const TPoint *xy)const;
0135 void DrawFullCross(UInt_t n, const TPoint *xy)const;
0136 void DrawOpenCross(UInt_t n, const TPoint *xy)const;
0137 void DrawFullStar(UInt_t n, const TPoint *xy)const;
0138 void DrawOpenStar(UInt_t n, const TPoint *xy)const;
0139 void DrawOpenSquareDiagonal(UInt_t n, const TPoint *xy)const;
0140 void DrawOpenDiamondCross(UInt_t n, const TPoint *xy)const;
0141 void DrawOpenThreeTriangles(UInt_t n, const TPoint *xy)const;
0142 void DrawOctagonCross(UInt_t n, const TPoint *xy)const;
0143 void DrawFullThreeTriangles(UInt_t n, const TPoint *xy)const;
0144 void DrawOpenFourTrianglesX(UInt_t n, const TPoint *xy)const;
0145 void DrawFullFourTrianglesX(UInt_t n, const TPoint *xy)const;
0146 void DrawOpenDoubleDiamond(UInt_t n, const TPoint *xy)const;
0147 void DrawFullDoubleDiamond(UInt_t n, const TPoint *xy)const;
0148 void DrawOpenFourTrianglesPlus(UInt_t n, const TPoint *xy)const;
0149 void DrawFullFourTrianglesPlus(UInt_t n, const TPoint *xy)const;
0150 void DrawOpenCrossX(UInt_t n, const TPoint *xy)const;
0151 void DrawFullCrossX(UInt_t n, const TPoint *xy)const;
0152 void DrawFourSquaresX(UInt_t n, const TPoint *xy)const;
0153 void DrawFourSquaresPlus(UInt_t n, const TPoint *xy)const;
0154 };
0155
0156
0157
0158
0159
0160
0161
0162 struct MeshPatch_t {
0163 MeshPatch_t(Int_t type) : fPatchType(type)
0164 {}
0165
0166 Int_t fPatchType;
0167 std::vector<Double_t> fPatch;
0168 };
0169
0170 typedef std::list<MeshPatch_t> Tesselation_t;
0171
0172 class Tesselator {
0173
0174
0175 public:
0176 Tesselator(Bool_t dump = kFALSE);
0177
0178 ~Tesselator();
0179
0180 void *GetTess()const
0181 {
0182 return fTess;
0183 }
0184
0185 static void SetDump(Tesselation_t *t)
0186 {
0187 fVs = t;
0188 }
0189
0190 static Tesselation_t *GetDump()
0191 {
0192 return fVs;
0193 }
0194
0195 private:
0196
0197 void *fTess;
0198
0199 static Tesselation_t *fVs;
0200 };
0201
0202
0203
0204
0205
0206 class OffScreenDevice {
0207 friend class ::TGLPadPainter;
0208 public:
0209 OffScreenDevice(UInt_t w, UInt_t h, UInt_t x, UInt_t y, Bool_t top);
0210
0211 private:
0212 UInt_t fW;
0213 UInt_t fH;
0214 UInt_t fX;
0215 UInt_t fY;
0216 Bool_t fTop;
0217 };
0218
0219 void ExtractRGBA(Color_t colorIndex, Float_t *rgba);
0220
0221 class GLLimits {
0222 public:
0223 GLLimits();
0224
0225 Double_t GetMaxLineWidth()const;
0226 Double_t GetMaxPointSize()const;
0227 private:
0228 mutable Double_t fMaxLineWidth;
0229 mutable Double_t fMaxPointSize;
0230 };
0231
0232
0233
0234
0235 template<class ValueType>
0236 struct BoundingRect {
0237 ValueType fXMin = ValueType();
0238 ValueType fYMin = ValueType();
0239 ValueType fWidth = ValueType();
0240 ValueType fHeight = ValueType();
0241
0242 ValueType fXMax = ValueType();
0243 ValueType fYMax = ValueType();
0244 };
0245
0246
0247 template<class ValueType>
0248 BoundingRect<ValueType> FindBoundingRect(Int_t nPoints, const ValueType *xs, const ValueType *ys);
0249
0250
0251 }
0252 }
0253
0254 #endif