ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "X3DBuffer.h"
15 #include "TClass.h"
16 #include "TThreadSlots.h"
17 
18 /** \class TVirtualPad
19 TVirtualPad is an abstract base class for the Pad and Canvas classes.
20 */
21 
24 
25 Int_t (*gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret) = 0;
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 /// Return the current pad for the current thread.
29 
31 {
32  static TVirtualPad *currentPad = 0;
33  if (!gThreadTsd)
34  return currentPad;
35  else
36  return *(TVirtualPad**)(*gThreadTsd)(&currentPad,ROOT::kPadThreadSlot);
37 }
38 
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// VirtualPad default constructor
43 
45 {
46  fResizing = kFALSE;
47 }
48 
49 ////////////////////////////////////////////////////////////////////////////////
50 /// VirtualPad constructor
51 
52 TVirtualPad::TVirtualPad(const char *, const char *, Double_t,
54  : TAttPad()
55 {
56  fResizing = kFALSE;
57 
58  SetFillColor(color);
59  SetFillStyle(1001);
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// VirtualPad destructor
64 
66 {
67 }
68 
69 ////////////////////////////////////////////////////////////////////////////////
70 /// Stream an object of class TVirtualPad.
71 
72 void TVirtualPad::Streamer(TBuffer &R__b)
73 {
74  if (R__b.IsReading()) {
75  UInt_t R__s, R__c;
76  Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
77  if (R__v > 1) {
78  R__b.ReadClassBuffer(TVirtualPad::Class(), this, R__v, R__s, R__c);
79  return;
80  }
81  //====process old versions before automatic schema evolution
82  TObject::Streamer(R__b);
83  TAttLine::Streamer(R__b);
84  TAttFill::Streamer(R__b);
85  TAttPad::Streamer(R__b);
86  //====end of old versions
87 
88  } else {
90  }
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Should always return false unless you have non-standard picking.
95 
97 {
98  return kFALSE;
99 }
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// Should always return false, unless you can highlight selected object in pad.
103 
105 {
106  return kFALSE;
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Does nothing, unless you implement your own picking.
111 /// When complex object containing sub-objects (which can be picked)
112 /// is painted in a pad, this "top-level" object is pushed into
113 /// the selectables stack.
114 
116 {
117 }
118 
119 ////////////////////////////////////////////////////////////////////////////////
120 /// Does nothing, unless you implement your own picking.
121 /// "Complete" object, or part of complex object, which
122 /// can be picked.
123 
125 {
126 }
127 
128 ////////////////////////////////////////////////////////////////////////////////
129 /// Does nothing, unless you implement your own picking.
130 /// Remove top level selectable and all its' children.
131 
133 {
134 }
135 
136 ////////////////////////////////////////////////////////////////////////////////
137 /// Scope-guards ctor, pushe the object on stack.
138 
140 {
141  gPad->PushTopLevelSelectable(obj);
142 }
143 
144 ////////////////////////////////////////////////////////////////////////////////
145 /// Guard does out of scope, pop object from stack.
146 
148 {
149  gPad->PopTopLevelSelectable();
150 }
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
Definition: TThreadSlots.h:42
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Bool_t IsReading() const
Definition: TBuffer.h:83
short Version_t
Definition: RtypesCore.h:61
virtual Bool_t PadInHighlightMode() const
Should always return false, unless you can highlight selected object in pad.
virtual void PushSelectableObject(TObject *obj)
Does nothing, unless you implement your own picking.
Manages default Pad attributes.
Definition: TAttPad.h:29
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
Size3D * gFuncSize3D()
Definition: TVirtualPad.cxx:23
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual void SetFillStyle(Style_t fstyle)
Definition: TAttFill.h:52
static TVirtualPad *& Pad()
Return the current pad for the current thread.
Definition: TVirtualPad.cxx:30
void Class()
Definition: Class.C:29
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
short Color_t
Definition: RtypesCore.h:79
ClassImp(TVirtualPad) TVirtualPad
VirtualPad default constructor.
Definition: TVirtualPad.cxx:39
virtual void SetFillColor(Color_t fcolor)
Definition: TAttFill.h:50
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual Bool_t PadInSelectionMode() const
Should always return false unless you have non-standard picking.
Definition: TVirtualPad.cxx:96
short Short_t
Definition: RtypesCore.h:35
Int_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)=0
Definition: TVirtualPad.cxx:25
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual void PopTopLevelSelectable()
Does nothing, unless you implement your own picking.
double Double_t
Definition: RtypesCore.h:55
TPickerStackGuard(TObject *obj)
Scope-guards ctor, pushe the object on stack.
Mother of all ROOT objects.
Definition: TObject.h:58
Size3D gVarSize3D
Definition: TVirtualPad.cxx:22
virtual ~TVirtualPad()
VirtualPad destructor.
Definition: TVirtualPad.cxx:65
~TPickerStackGuard()
Guard does out of scope, pop object from stack.
Bool_t fResizing
Definition: TVirtualPad.h:63
#define gPad
Definition: TVirtualPad.h:288
TArrow ar(9, 23, 9, 21.6, 0.015,"|>")
TObject * obj
virtual void PushTopLevelSelectable(TObject *top)
Does nothing, unless you implement your own picking.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0