Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVirtualPad.cxx
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun 05/12/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, 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 "TVirtualPad.h"
13#include "TBuffer.h"
14#include "TThreadSlots.h"
15
16/** \class TVirtualPad
17\ingroup Base
18
19TVirtualPad is an abstract base class for the Pad and Canvas classes.
20*/
21
22Int_t (*gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret) = nullptr;
23
24////////////////////////////////////////////////////////////////////////////////
25/// Return the current pad for the current thread.
26
28{
29 static TVirtualPad *currentPad = nullptr;
30 if (!gThreadTsd)
31 return currentPad;
32 else
33 return *(TVirtualPad**)(*gThreadTsd)(&currentPad,ROOT::kPadThreadSlot);
34}
35
37
38////////////////////////////////////////////////////////////////////////////////
39/// VirtualPad default constructor
40
42{
44}
45
46////////////////////////////////////////////////////////////////////////////////
47/// VirtualPad constructor
48
49TVirtualPad::TVirtualPad(const char *, const char *, Double_t,
51 : TAttPad()
52{
54
55 SetFillColor(color);
56 SetFillStyle(1001);
57}
58
59////////////////////////////////////////////////////////////////////////////////
60/// VirtualPad destructor
61
63{
64}
65
66////////////////////////////////////////////////////////////////////////////////
67/// Stream an object of class TVirtualPad.
68
69void TVirtualPad::Streamer(TBuffer &R__b)
70{
71 if (R__b.IsReading()) {
72 UInt_t R__s, R__c;
73 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
74 if (R__v > 1) {
75 R__b.ReadClassBuffer(TVirtualPad::Class(), this, R__v, R__s, R__c);
76 return;
77 }
78 //====process old versions before automatic schema evolution
79 TObject::Streamer(R__b);
80 TAttLine::Streamer(R__b);
81 TAttFill::Streamer(R__b);
82 TAttPad::Streamer(R__b);
83 //====end of old versions
84
85 } else {
86 R__b.WriteClassBuffer(TVirtualPad::Class(),this);
87 }
88}
89
90////////////////////////////////////////////////////////////////////////////////
91/// Should always return false unless you have non-standard picking.
92
94{
95 return kFALSE;
96}
97
98////////////////////////////////////////////////////////////////////////////////
99/// Should always return false, unless you can highlight selected object in pad.
100
102{
103 return kFALSE;
104}
105
106////////////////////////////////////////////////////////////////////////////////
107/// Does nothing, unless you implement your own picking.
108/// When complex object containing sub-objects (which can be picked)
109/// is painted in a pad, this "top-level" object is pushed into
110/// the selectables stack.
111
113{
114}
115
116////////////////////////////////////////////////////////////////////////////////
117/// Does nothing, unless you implement your own picking.
118/// "Complete" object, or part of complex object, which
119/// can be picked.
120
122{
123}
124
125////////////////////////////////////////////////////////////////////////////////
126/// Does nothing, unless you implement your own picking.
127/// Remove top level selectable and all its' children.
128
130{
131}
132
133////////////////////////////////////////////////////////////////////////////////
134/// Scope-guards ctor, pushe the object on stack.
135
137{
138 gPad->PushTopLevelSelectable(obj);
139}
140
141////////////////////////////////////////////////////////////////////////////////
142/// Guard does out of scope, pop object from stack.
143
145{
146 gPad->PopTopLevelSelectable();
147}
int Int_t
Definition RtypesCore.h:45
short Version_t
Definition RtypesCore.h:65
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:101
short Short_t
Definition RtypesCore.h:39
double Double_t
Definition RtypesCore.h:59
short Color_t
Definition RtypesCore.h:92
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
#define gPad
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
Definition TAttFill.h:39
Manages default Pad attributes.
Definition TAttPad.h:19
Buffer base class used for serializing objects.
Definition TBuffer.h:43
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
Bool_t IsReading() const
Definition TBuffer.h:86
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Mother of all ROOT objects.
Definition TObject.h:41
~TPickerStackGuard()
Guard does out of scope, pop object from stack.
TPickerStackGuard(TObject *obj)
Scope-guards ctor, pushe the object on stack.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
virtual Bool_t PadInHighlightMode() const
Should always return false, unless you can highlight selected object in pad.
virtual ~TVirtualPad()
VirtualPad destructor.
virtual Bool_t PadInSelectionMode() const
Should always return false unless you have non-standard picking.
virtual void PushTopLevelSelectable(TObject *top)
Does nothing, unless you implement your own picking.
virtual void PushSelectableObject(TObject *obj)
Does nothing, unless you implement your own picking.
TVirtualPad()
VirtualPad default constructor.
static TVirtualPad *& Pad()
Return the current pad for the current thread.
Bool_t fResizing
Definition TVirtualPad.h:54
virtual void PopTopLevelSelectable()
Does nothing, unless you implement your own picking.
@ kPadThreadSlot