Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TWebPadPainter Class Reference

Implement TVirtualPadPainter which abstracts painting operations.

TWebPadPainter tries to support old Paint methods of the ROOT classes. Main classes (like histograms or graphs) should be painted on JavaScript side

Definition at line 26 of file TWebPadPainter.h.

Public Member Functions

 TWebPadPainter ()
 
void ClearDrawable () override
 
void CopyDrawable (Int_t, Int_t, Int_t) override
 
Int_t CreateDrawable (UInt_t, UInt_t) override
 
void DestroyDrawable (Int_t) override
 
void DrawBox (Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode) override
 Paint a simple box.
 
void DrawFillArea (Int_t n, const Double_t *x, const Double_t *y) override
 Paint filled area.
 
void DrawFillArea (Int_t n, const Float_t *x, const Float_t *y) override
 Paint filled area.
 
void DrawLine (Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
 Paint a simple line.
 
void DrawLineNDC (Double_t u1, Double_t v1, Double_t u2, Double_t v2) override
 Paint a simple line in normalized coordinates.
 
void DrawPixels (const unsigned char *pixelData, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY, Bool_t enableAlphaBlending) override
 Noop, for non-gl pad TASImage calls gVirtualX->CopyArea.
 
void DrawPolyLine (Int_t n, const Double_t *x, const Double_t *y) override
 Paint Polyline.
 
void DrawPolyLine (Int_t n, const Float_t *x, const Float_t *y) override
 Paint polyline.
 
void DrawPolyLineNDC (Int_t n, const Double_t *u, const Double_t *v) override
 Paint polyline in normalized coordinates.
 
void DrawPolyMarker (Int_t n, const Double_t *x, const Double_t *y) override
 Paint polymarker.
 
void DrawPolyMarker (Int_t n, const Float_t *x, const Float_t *y) override
 Paint polymarker.
 
void DrawText (Double_t x, Double_t y, const char *text, ETextMode mode) override
 Paint text.
 
void DrawText (Double_t x, Double_t y, const wchar_t *text, ETextMode mode) override
 Special version working with wchar_t and required by TMathText.
 
void DrawTextNDC (Double_t u, Double_t v, const char *text, ETextMode mode) override
 Paint text in normalized coordinates.
 
void DrawTextNDC (Double_t u, Double_t v, const wchar_t *text, ETextMode mode) override
 Paint text in normalized coordinates.
 
Color_t GetFillColor () const override
 
Style_t GetFillStyle () const override
 
Color_t GetLineColor () const override
 
Style_t GetLineStyle () const override
 
Width_t GetLineWidth () const override
 
Short_t GetTextAlign () const override
 
Float_t GetTextAngle () const override
 
Color_t GetTextColor () const override
 
Font_t GetTextFont () const override
 
Float_t GetTextMagnitude () const override
 
Float_t GetTextSize () const override
 
Bool_t IsTransparent () const override
 
void SaveImage (TVirtualPad *, const char *, Int_t) const override
 Produce image from WebPadPainter.
 
void SelectDrawable (Int_t) override
 
void SetFillColor (Color_t fcolor) override
 
void SetFillStyle (Style_t fstyle) override
 
void SetLineColor (Color_t lcolor) override
 
void SetLineStyle (Style_t lstyle) override
 
void SetLineWidth (Width_t lwidth) override
 
void SetOpacity (Int_t percent) override
 
void SetPainting (TWebPainting *p)
 
void SetTextAlign (Short_t align) override
 
void SetTextAngle (Float_t tangle) override
 
void SetTextColor (Color_t tcolor) override
 
void SetTextFont (Font_t tfont) override
 
void SetTextSize (Float_t tsize) override
 
void SetTextSizePixels (Int_t npixels) override
 
- Public Member Functions inherited from TVirtualPadPainter
virtual ~TVirtualPadPainter ()
 Virtual dtor.
 
virtual void InitPainter ()
 Empty definition.
 
virtual void InvalidateCS ()
 Empty definition.
 
virtual void LockPainter ()
 Empty definition.
 
- Public Member Functions inherited from TAttLine
 TAttLine ()
 AttLine default constructor.
 
 TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth)
 AttLine normal constructor.
 
virtual ~TAttLine ()
 AttLine destructor.
 
void Copy (TAttLine &attline) const
 Copy this line attributes to a new TAttLine.
 
Int_t DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
 Compute distance from point px,py to a line.
 
virtual void Modify ()
 Change current line attributes if necessary.
 
virtual void ResetAttLine (Option_t *option="")
 Reset this line attributes to default values.
 
virtual void SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
 Save line attributes as C++ statement(s) on output stream out.
 
virtual void SetLineAttributes ()
 Invoke the DialogCanvas Line attributes.
 
virtual void SetLineColorAlpha (Color_t lcolor, Float_t lalpha)
 Set a transparent line color.
 
- Public Member Functions inherited from TAttFill
 TAttFill ()
 AttFill default constructor.
 
 TAttFill (Color_t fcolor, Style_t fstyle)
 AttFill normal constructor.
 
virtual ~TAttFill ()
 AttFill destructor.
 
void Copy (TAttFill &attfill) const
 Copy this fill attributes to a new TAttFill.
 
virtual void Modify ()
 Change current fill area attributes if necessary.
 
virtual void ResetAttFill (Option_t *option="")
 Reset this fill attributes to default values.
 
virtual void SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
 Save fill attributes as C++ statement(s) on output stream out.
 
virtual void SetFillAttributes ()
 Invoke the DialogCanvas Fill attributes.
 
virtual void SetFillColorAlpha (Color_t fcolor, Float_t falpha)
 Set a transparent fill color.
 
- Public Member Functions inherited from TAttText
 TAttText ()
 AttText default constructor.
 
 TAttText (Int_t align, Float_t angle, Color_t color, Style_t font, Float_t tsize)
 AttText normal constructor.
 
virtual ~TAttText ()
 AttText destructor.
 
void Copy (TAttText &atttext) const
 Copy this text attributes to a new TAttText.
 
virtual Float_t GetTextSizePercent (Float_t size)
 Return the text in percent of the pad size.
 
virtual void Modify ()
 Change current text attributes if necessary.
 
virtual void ResetAttText (Option_t *toption="")
 Reset this text attributes to default values.
 
virtual void SaveTextAttributes (std::ostream &out, const char *name, Int_t alidef=12, Float_t angdef=0, Int_t coldef=1, Int_t fondef=61, Float_t sizdef=1)
 Save text attributes as C++ statement(s) on output stream out.
 
virtual void SetTextAttributes ()
 Invoke the DialogCanvas Text attributes.
 
virtual void SetTextColorAlpha (Color_t tcolor, Float_t talpha)
 Set a transparent marker color.
 
- Public Member Functions inherited from TAttMarker
 TAttMarker ()
 TAttMarker default constructor.
 
 TAttMarker (Color_t color, Style_t style, Size_t msize)
 TAttMarker normal constructor.
 
virtual ~TAttMarker ()
 TAttMarker destructor.
 
void Copy (TAttMarker &attmarker) const
 Copy this marker attributes to a new TAttMarker.
 
virtual Color_t GetMarkerColor () const
 Return the marker color.
 
virtual Size_t GetMarkerSize () const
 Return the marker size.
 
virtual Style_t GetMarkerStyle () const
 Return the marker style.
 
virtual void Modify ()
 Change current marker attributes if necessary.
 
virtual void ResetAttMarker (Option_t *toption="")
 Reset this marker attributes to the default values.
 
virtual void SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
 Save line attributes as C++ statement(s) on output stream out.
 
virtual void SetMarkerAttributes ()
 Invoke the DialogCanvas Marker attributes.
 
virtual void SetMarkerColor (Color_t mcolor=1)
 Set the marker color.
 
virtual void SetMarkerColorAlpha (Color_t mcolor, Float_t malpha)
 Set a transparent marker color.
 
virtual void SetMarkerSize (Size_t msize=1)
 Set the marker size.
 
virtual void SetMarkerStyle (Style_t mstyle=1)
 Set the marker style.
 

Protected Types

enum  {
  attrLine = 0x1 , attrFill = 0x2 , attrMarker = 0x4 , attrText = 0x8 ,
  attrAll = 0xf
}
 !< object to store all painting, owned by TWebPS object More...
 

Protected Member Functions

Float_tStoreOperation (const std::string &oper, unsigned attrkind, int opersize=0)
 Store operation identifier with appropriate attributes.
 

Protected Attributes

TWebPaintingfPainting {nullptr}
 
- Protected Attributes inherited from TAttLine
Color_t fLineColor
 Line color.
 
Style_t fLineStyle
 Line style.
 
Width_t fLineWidth
 Line width.
 
- Protected Attributes inherited from TAttFill
Color_t fFillColor
 Fill area color.
 
Style_t fFillStyle
 Fill area style.
 
- Protected Attributes inherited from TAttText
Short_t fTextAlign
 Text alignment.
 
Float_t fTextAngle
 Text angle.
 
Color_t fTextColor
 Text color.
 
Font_t fTextFont
 Text font.
 
Float_t fTextSize
 Text size.
 
- Protected Attributes inherited from TAttMarker
Color_t fMarkerColor
 Marker color.
 
Size_t fMarkerSize
 Marker size.
 
Style_t fMarkerStyle
 Marker style.
 

Private Member Functions

 TWebPadPainter (const TWebPadPainter &rhs)=delete
 
 TWebPadPainter (TWebPadPainter &&rhs)=delete
 
TWebPadPainteroperator= (const TWebPadPainter &rhs)=delete
 
TWebPadPainteroperator= (TWebPadPainter &&rhs)=delete
 

Friends

class TWebCanvas
 

Additional Inherited Members

- Public Types inherited from TVirtualPadPainter
enum  EBoxMode { kHollow , kFilled }
 
enum  ETextMode { kClear , kOpaque }
 
- Static Public Member Functions inherited from TVirtualPadPainter
static TVirtualPadPainterPadPainter (Option_t *opt="")
 Create a pad painter of specified type.
 
- Static Public Member Functions inherited from TAttMarker
static Width_t GetMarkerLineWidth (Style_t style)
 Internal helper function that returns the line width of the given marker style (0 = filled marker)
 
static Style_t GetMarkerStyleBase (Style_t style)
 Internal helper function that returns the corresponding marker style with line width 1 for the given style.
 

#include <TWebPadPainter.h>

Inheritance diagram for TWebPadPainter:
[legend]

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

!< object to store all painting, owned by TWebPS object

Enumerator
attrLine 
attrFill 
attrMarker 
attrText 
attrAll 

Definition at line 34 of file TWebPadPainter.h.

Constructor & Destructor Documentation

◆ TWebPadPainter() [1/3]

TWebPadPainter::TWebPadPainter ( )
inline

Definition at line 40 of file TWebPadPainter.h.

◆ TWebPadPainter() [2/3]

TWebPadPainter::TWebPadPainter ( const TWebPadPainter rhs)
privatedelete

◆ TWebPadPainter() [3/3]

TWebPadPainter::TWebPadPainter ( TWebPadPainter &&  rhs)
privatedelete

Member Function Documentation

◆ ClearDrawable()

void TWebPadPainter::ClearDrawable ( )
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 81 of file TWebPadPainter.h.

◆ CopyDrawable()

void TWebPadPainter::CopyDrawable ( Int_t  ,
Int_t  ,
Int_t   
)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 82 of file TWebPadPainter.h.

◆ CreateDrawable()

Int_t TWebPadPainter::CreateDrawable ( UInt_t  ,
UInt_t   
)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 80 of file TWebPadPainter.h.

◆ DestroyDrawable()

void TWebPadPainter::DestroyDrawable ( Int_t  )
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 83 of file TWebPadPainter.h.

◆ DrawBox()

void TWebPadPainter::DrawBox ( Double_t  x1,
Double_t  y1,
Double_t  x2,
Double_t  y2,
EBoxMode  mode 
)
overridevirtual

Paint a simple box.

Implements TVirtualPadPainter.

Definition at line 103 of file TWebPadPainter.cxx.

◆ DrawFillArea() [1/2]

void TWebPadPainter::DrawFillArea ( Int_t  n,
const Double_t x,
const Double_t y 
)
overridevirtual

Paint filled area.

Implements TVirtualPadPainter.

Definition at line 125 of file TWebPadPainter.cxx.

◆ DrawFillArea() [2/2]

void TWebPadPainter::DrawFillArea ( Int_t  n,
const Float_t x,
const Float_t y 
)
overridevirtual

Paint filled area.

Implements TVirtualPadPainter.

Definition at line 141 of file TWebPadPainter.cxx.

◆ DrawLine()

void TWebPadPainter::DrawLine ( Double_t  x1,
Double_t  y1,
Double_t  x2,
Double_t  y2 
)
overridevirtual

Paint a simple line.

Implements TVirtualPadPainter.

Definition at line 66 of file TWebPadPainter.cxx.

◆ DrawLineNDC()

void TWebPadPainter::DrawLineNDC ( Double_t  u1,
Double_t  v1,
Double_t  u2,
Double_t  v2 
)
overridevirtual

Paint a simple line in normalized coordinates.

Implements TVirtualPadPainter.

Definition at line 84 of file TWebPadPainter.cxx.

◆ DrawPixels()

void TWebPadPainter::DrawPixels ( const unsigned char *  pixelData,
UInt_t  width,
UInt_t  height,
Int_t  dstX,
Int_t  dstY,
Bool_t  enableAlphaBlending 
)
overridevirtual

Noop, for non-gl pad TASImage calls gVirtualX->CopyArea.

Implements TVirtualPadPainter.

Definition at line 56 of file TWebPadPainter.cxx.

◆ DrawPolyLine() [1/2]

void TWebPadPainter::DrawPolyLine ( Int_t  n,
const Double_t x,
const Double_t y 
)
overridevirtual

Paint Polyline.

Implements TVirtualPadPainter.

Definition at line 157 of file TWebPadPainter.cxx.

◆ DrawPolyLine() [2/2]

void TWebPadPainter::DrawPolyLine ( Int_t  n,
const Float_t x,
const Float_t y 
)
overridevirtual

Paint polyline.

Implements TVirtualPadPainter.

Definition at line 173 of file TWebPadPainter.cxx.

◆ DrawPolyLineNDC()

void TWebPadPainter::DrawPolyLineNDC ( Int_t  n,
const Double_t u,
const Double_t v 
)
overridevirtual

Paint polyline in normalized coordinates.

Implements TVirtualPadPainter.

Definition at line 189 of file TWebPadPainter.cxx.

◆ DrawPolyMarker() [1/2]

void TWebPadPainter::DrawPolyMarker ( Int_t  n,
const Double_t x,
const Double_t y 
)
overridevirtual

Paint polymarker.

Implements TVirtualPadPainter.

Definition at line 207 of file TWebPadPainter.cxx.

◆ DrawPolyMarker() [2/2]

void TWebPadPainter::DrawPolyMarker ( Int_t  n,
const Float_t x,
const Float_t y 
)
overridevirtual

Paint polymarker.

Implements TVirtualPadPainter.

Definition at line 224 of file TWebPadPainter.cxx.

◆ DrawText() [1/2]

void TWebPadPainter::DrawText ( Double_t  x,
Double_t  y,
const char *  text,
ETextMode  mode 
)
overridevirtual

Paint text.

Implements TVirtualPadPainter.

Definition at line 241 of file TWebPadPainter.cxx.

◆ DrawText() [2/2]

void TWebPadPainter::DrawText ( Double_t  x,
Double_t  y,
const wchar_t *  text,
ETextMode  mode 
)
overridevirtual

Special version working with wchar_t and required by TMathText.

Implements TVirtualPadPainter.

Definition at line 253 of file TWebPadPainter.cxx.

◆ DrawTextNDC() [1/2]

void TWebPadPainter::DrawTextNDC ( Double_t  u,
Double_t  v,
const char *  text,
ETextMode  mode 
)
overridevirtual

Paint text in normalized coordinates.

Implements TVirtualPadPainter.

Definition at line 265 of file TWebPadPainter.cxx.

◆ DrawTextNDC() [2/2]

void TWebPadPainter::DrawTextNDC ( Double_t  u,
Double_t  v,
const wchar_t *  text,
ETextMode  mode 
)
overridevirtual

Paint text in normalized coordinates.

Implements TVirtualPadPainter.

Definition at line 280 of file TWebPadPainter.cxx.

◆ GetFillColor()

Color_t TWebPadPainter::GetFillColor ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 56 of file TWebPadPainter.h.

◆ GetFillStyle()

Style_t TWebPadPainter::GetFillStyle ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 57 of file TWebPadPainter.h.

◆ GetLineColor()

Color_t TWebPadPainter::GetLineColor ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 47 of file TWebPadPainter.h.

◆ GetLineStyle()

Style_t TWebPadPainter::GetLineStyle ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 48 of file TWebPadPainter.h.

◆ GetLineWidth()

Width_t TWebPadPainter::GetLineWidth ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 49 of file TWebPadPainter.h.

◆ GetTextAlign()

Short_t TWebPadPainter::GetTextAlign ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 65 of file TWebPadPainter.h.

◆ GetTextAngle()

Float_t TWebPadPainter::GetTextAngle ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 66 of file TWebPadPainter.h.

◆ GetTextColor()

Color_t TWebPadPainter::GetTextColor ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 67 of file TWebPadPainter.h.

◆ GetTextFont()

Font_t TWebPadPainter::GetTextFont ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 68 of file TWebPadPainter.h.

◆ GetTextMagnitude()

Float_t TWebPadPainter::GetTextMagnitude ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 70 of file TWebPadPainter.h.

◆ GetTextSize()

Float_t TWebPadPainter::GetTextSize ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 69 of file TWebPadPainter.h.

◆ IsTransparent()

Bool_t TWebPadPainter::IsTransparent ( ) const
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 58 of file TWebPadPainter.h.

◆ operator=() [1/2]

TWebPadPainter & TWebPadPainter::operator= ( const TWebPadPainter rhs)
privatedelete

◆ operator=() [2/2]

TWebPadPainter & TWebPadPainter::operator= ( TWebPadPainter &&  rhs)
privatedelete

◆ SaveImage()

void TWebPadPainter::SaveImage ( TVirtualPad pad,
const char *  fileName,
Int_t  gtype 
) const
overridevirtual

Produce image from WebPadPainter.

Implements TVirtualPadPainter.

Definition at line 295 of file TWebPadPainter.cxx.

◆ SelectDrawable()

void TWebPadPainter::SelectDrawable ( Int_t  )
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 84 of file TWebPadPainter.h.

◆ SetFillColor()

void TWebPadPainter::SetFillColor ( Color_t  fcolor)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 60 of file TWebPadPainter.h.

◆ SetFillStyle()

void TWebPadPainter::SetFillStyle ( Style_t  fstyle)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 61 of file TWebPadPainter.h.

◆ SetLineColor()

void TWebPadPainter::SetLineColor ( Color_t  lcolor)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 51 of file TWebPadPainter.h.

◆ SetLineStyle()

void TWebPadPainter::SetLineStyle ( Style_t  lstyle)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 52 of file TWebPadPainter.h.

◆ SetLineWidth()

void TWebPadPainter::SetLineWidth ( Width_t  lwidth)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 53 of file TWebPadPainter.h.

◆ SetOpacity()

void TWebPadPainter::SetOpacity ( Int_t  percent)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 62 of file TWebPadPainter.h.

◆ SetPainting()

void TWebPadPainter::SetPainting ( TWebPainting p)
inline

Definition at line 42 of file TWebPadPainter.h.

◆ SetTextAlign()

void TWebPadPainter::SetTextAlign ( Short_t  align)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 72 of file TWebPadPainter.h.

◆ SetTextAngle()

void TWebPadPainter::SetTextAngle ( Float_t  tangle)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 73 of file TWebPadPainter.h.

◆ SetTextColor()

void TWebPadPainter::SetTextColor ( Color_t  tcolor)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 74 of file TWebPadPainter.h.

◆ SetTextFont()

void TWebPadPainter::SetTextFont ( Font_t  tfont)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 75 of file TWebPadPainter.h.

◆ SetTextSize()

void TWebPadPainter::SetTextSize ( Float_t  tsize)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 76 of file TWebPadPainter.h.

◆ SetTextSizePixels()

void TWebPadPainter::SetTextSizePixels ( Int_t  npixels)
inlineoverridevirtual

Implements TVirtualPadPainter.

Definition at line 77 of file TWebPadPainter.h.

◆ StoreOperation()

Float_t * TWebPadPainter::StoreOperation ( const std::string &  oper,
unsigned  attrkind,
int  opersize = 0 
)
protected

Store operation identifier with appropriate attributes.

Definition at line 32 of file TWebPadPainter.cxx.

Friends And Related Symbol Documentation

◆ TWebCanvas

friend class TWebCanvas
friend

Definition at line 28 of file TWebPadPainter.h.

Member Data Documentation

◆ fPainting

TWebPainting* TWebPadPainter::fPainting {nullptr}
protected

Definition at line 32 of file TWebPadPainter.h.

Libraries for TWebPadPainter:

The documentation for this class was generated from the following files: