Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVirtualPadPainter.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Timur Pocheptsov 6/5/2009
3
4/*************************************************************************
5 * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TVirtualPadPainter.h"
13#include "TPluginManager.h"
14
15
16/** \class TVirtualPadPainter
17\ingroup Base
18
19To make it possible to use GL for 2D graphic in a TPad/TCanvas.
20TVirtualPadPainter interface must be used instead of TVirtualX.
21Internally, non-GL implementation _should_ delegate all calls
22to gVirtualX, GL implementation will delegate part of calls
23to gVirtualX, and has to implement some of the calls from the scratch.
24*/
25
26////////////////////////////////////////////////////////////////////////////////
27///Virtual dtor.
28
32
33////////////////////////////////////////////////////////////////////////////////
34///Empty definition.
35
39
40////////////////////////////////////////////////////////////////////////////////
41///Empty definition.
42
46
47////////////////////////////////////////////////////////////////////////////////
48///Empty definition.
49
53
54////////////////////////////////////////////////////////////////////////////////
55/// Create a pad painter of specified type.
56
58{
59 TVirtualPadPainter *painter = nullptr;
60 TPluginHandler *h = gPluginMgr->FindHandler("TVirtualPadPainter", type);
61
62 if (h && h->LoadPlugin() != -1)
63 painter = (TVirtualPadPainter *) h->ExecPlugin(0);
64
65 return painter;
66}
67
68
69////////////////////////////////////////////////////////////////////////////////
70/// Draw N segments on the pad
71/// Exclude segments where both points match
72
74{
75 for(Int_t i = 0; i < 2*n; i += 2)
76 if ((x[i] != x[i+1]) || (y[i] != y[i + 1]))
77 DrawLine(x[i], y[i], x[i+1], y[i+1]);
78}
79
80////////////////////////////////////////////////////////////////////////////////
81/// Draw N segments in NDC coordinates on the pad
82/// Exclude segments where both points match
83
85{
86 for(Int_t i = 0; i < 2*n; i += 2)
87 if ((u[i] != u[i+1]) || (v[i] != v[i + 1]))
88 DrawLineNDC(u[i], v[i], u[i+1], v[i+1]);
89}
#define h(i)
Definition RSha256.hxx:106
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char DrawLine
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TPluginManager * gPluginMgr
TPluginHandler * FindHandler(const char *base, const char *uri=nullptr)
Returns the handler if there exists a handler for the specified URI.
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
virtual ~TVirtualPadPainter()
Virtual dtor.
virtual void DrawSegmentsNDC(Int_t n, const Double_t *u, const Double_t *v)
Draw N segments in NDC coordinates on the pad Exclude segments where both points match.
virtual void LockPainter()
Empty definition.
virtual void DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)=0
static TVirtualPadPainter * PadPainter(Option_t *opt="")
Create a pad painter of specified type.
virtual void DrawSegments(Int_t n, const Double_t *x, const Double_t *y)
Draw N segments on the pad Exclude segments where both points match.
virtual void InitPainter()
Empty definition.
virtual void InvalidateCS()
Empty definition.
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16