Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TWebPainting.h
Go to the documentation of this file.
1// Author: Sergey Linev, GSI 10/04/2017
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_TWebPainting
12#define ROOT_TWebPainting
13
14#include "TObject.h"
15#include "TAttLine.h"
16#include "TAttFill.h"
17#include "TAttText.h"
18#include "TAttMarker.h"
19#include "TArrayF.h"
20
21class TColor;
22
23#include <string>
24
25class TWebPainting : public TObject {
26
27 protected:
28 std::string fOper; ///< list of operations, separated by semicolons
29 Int_t fSize{0}; ///<! filled buffer size
30 TArrayF fBuf; ///< array of points for all operations
31 TAttLine fLastLine; ///<! last line attributes
32 TAttFill fLastFill; ///<! last fill attributes
33 TAttMarker fLastMarker; ///<! last marker attributes
34
35 public:
36
38 ~TWebPainting() override = default;
39
40 Bool_t IsEmpty() const { return fOper.empty() && (fBuf.GetSize() == 0); }
41
42 void AddOper(const std::string &oper);
43
44 void AddLineAttr(const TAttLine &attr);
45 void AddFillAttr(const TAttFill &attr);
46 void AddTextAttr(const TAttText &attr);
47 void AddMarkerAttr(const TAttMarker &attr);
48
50
51 void AddColor(Int_t indx, TColor *col);
52
53 // Set actual filled size
54 void FixSize() { fBuf.Set(fSize); }
55
56 static std::string MakeTextOper(const char *str);
57
58
59 ClassDefOverride(TWebPainting, 1) // store for all paint operation of TVirtualPadPainter
60};
61
62#endif
int Int_t
Definition RtypesCore.h:45
float Float_t
Definition RtypesCore.h:57
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Array of floats (32 bits per element).
Definition TArrayF.h:27
void Set(Int_t n) override
Set size of this array to n floats.
Definition TArrayF.cxx:105
Int_t GetSize() const
Definition TArray.h:47
Fill Area Attributes class.
Definition TAttFill.h:19
Line Attributes class.
Definition TAttLine.h:18
Marker Attributes class.
Definition TAttMarker.h:19
Text Attributes class.
Definition TAttText.h:18
The color creation and management class.
Definition TColor.h:21
Mother of all ROOT objects.
Definition TObject.h:41
Object used to store paint operations and deliver them to JSROOT.
void AddColor(Int_t indx, TColor *col)
Add custom color to operations.
TWebPainting()
Constructor.
void AddTextAttr(const TAttText &attr)
Store text attributes If attributes were not changed - ignore operation.
TAttMarker fLastMarker
! last marker attributes
void AddMarkerAttr(const TAttMarker &attr)
Store marker attributes If attributes were not changed - ignore operation.
~TWebPainting() override=default
void AddLineAttr(const TAttLine &attr)
Store line attributes If attributes were not changed - ignore operation.
static std::string MakeTextOper(const char *str)
Create text operation If text include special symbols - use simple hex coding.
Int_t fSize
! filled buffer size
TAttFill fLastFill
! last fill attributes
std::string fOper
list of operations, separated by semicolons
void AddOper(const std::string &oper)
Add next custom operator to painting Operations are separated by semicolons Following operations are ...
Float_t * Reserve(Int_t sz)
Reserve place in the float buffer Returns pointer on first element in reserved area.
TArrayF fBuf
array of points for all operations
TAttLine fLastLine
! last line attributes
void AddFillAttr(const TAttFill &attr)
Store fill attributes If attributes were not changed - ignore operation.
Bool_t IsEmpty() const