76 :
TCanvas(
"inspect",
"ROOT Object Inspector",ww,wh)
107 UInt_t *cdatime =
nullptr;
110 const Int_t kname = 1;
111 const Int_t kvalue = 25;
112 const Int_t ktitle = 37;
113 const Int_t kline = 1024;
134 if (nreal == 0)
return;
137 if (nreal+7 > nrows) nrows = nreal+7;
145 canvas->
Range(0,-3,20,nreal+4);
153 if (tsize < 0.02) tsize = 0.02;
154 if (tsize > 0.03) tsize = 0.03;
157 TText tname, tvalue, ttitle;
185 fBackward =
new TButton(
"backward",
"TInspectCanvas::GoBackward();",.01,btop-db,.15,btop);
187 fBackward->SetToolTipText(
"Inspect previous object");
188 fForward =
new TButton(
"forward",
"TInspectCanvas::GoForward();", .21,btop-db,.35,btop);
190 fForward->SetToolTipText(
"Inspect next object");
203 frame.
DrawLine(xvalue, y1, xvalue, y3);
204 frame.
DrawLine(xtitle, y1, xtitle, y3);
207 ttitle.
DrawText(0.5*(x1+xvalue), y2+0.1,
"Member Name");
208 ttitle.
DrawText(0.5*(xvalue+xtitle), y2+0.1,
"Value");
209 ttitle.
DrawText(0.5*(xtitle+x2), y2+0.1,
"Title");
225 ttitle.
DrawText(xtitle+2, y3+0.1,
"no title given");
235 for (
Int_t pass = 0; pass < 3; pass++) {
240 if (!member)
continue;
252 pname = &
line[kname];
253 for (
Int_t i=0;i<kline;i++)
line[i] =
' ';
255 strlcpy(pname,rd->
GetName(),kline-kname);
256 if (strstr(member->
GetFullTypeName(),
"**")) strlcat(pname,
"**",kline-kname);
261 char *pointer = (
char*)obj + offset;
262 char **ppointer = (
char**)(pointer);
263 TLink *tlink =
nullptr;
271 char **p3pointer = (
char**)(*ppointer);
279 }
else if (!member->
IsBasic()) {
281 tlink =
new TLink(xvalue+0.1, ytext, p3pointer);
283 }
else if (membertype) {
285 strlcpy(&
line[kvalue], *ppointer,kline-kvalue);
287 strlcpy(&
line[kvalue], membertype->
AsString(p3pointer),kline-kvalue);
290 strlcpy(&
line[kvalue], *ppointer,kline-kvalue);
292 if (pass == 1) tlink =
new TLink(xvalue+0.1, ytext, p3pointer);
294 }
else if (membertype)
296 cdatime = (
UInt_t*)pointer;
298 snprintf(&
line[kvalue],kline-kvalue,
"%d/%d",cdate,ctime);
302 strlcpy(&
line[kvalue], membertype->
AsString(pointer),kline-kvalue);
305 snprintf(&
line[kvalue],kline-kvalue,
"->%zx ", (
size_t)pointer);
312 if (lentit >= kline-ktitle) lentit = kline-ktitle-1;
314 line[ktitle+lentit] = 0;
319 if (pass == 0)tname.
DrawText( x1+0.1, ytext, &
line[kname]);
335 if (pass == 2 && ltit) ttitle.
DrawText(xtitle+0.3, ytext, &
line[ltit]);
350 if (!inspect)
return;
362 if (!inspect)
return;
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
externTGuiFactory * gGuiFactory
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
virtual void SetTextAngle(Float_t tangle=0)
Set the text angle.
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
TCanvas(const TCanvas &canvas)=delete
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
void Update() override
Update canvas pad buffers.
UInt_t GetWh() const override
TClass instances represent classes, structs and namespaces in the ROOT type system.
Bool_t IsStartingWithTObject() const
Returns true if this class inherits from TObject and if the start of the TObject parts is at the very...
void BuildRealData(void *pointer=nullptr, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
TList * GetListOfRealData() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
All ROOT classes may have RTTI (run time type identification) support added.
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Bool_t IsaPointer() const
Return true if data member is a pointer.
TDataType * GetDataType() const
const char * GetTypeName() const
Get the decayed type name of this data member, removing const and volatile qualifiers,...
const char * GetFullTypeName() const
Get the concrete type name of this data member, including const and volatile qualifiers.
TClass * GetClass() const
Basic data type descriptor (datatype information is obtained from CINT).
const char * AsString(void *buf) const
Return string containing value in buffer formatted according to the basic data type.
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
static void GetDateTime(UInt_t datetime, Int_t &date, Int_t &time)
Static function that returns the date and time.
TButton * fBackward
Pointer to the Backward button.
~TInspectCanvas() override
InspectCanvas default destructor.
TInspectCanvas()
InspectCanvas default constructor.
static void Inspector(TObject *obj)
static function , interface to InspectObject.
TList * fObjects
List of objects inspected.
TObject * fCurObject
Pointer to object being inspected.
TList * GetObjects() const
void RecursiveRemove(TObject *obj) override
Recursively remove object from the list of objects.
TObject * GetCurObject() const
static void GoBackward()
static function , inspect previous object
TButton * fForward
Pointer to the Forward button.
static void GoForward()
static function , inspect next object
virtual void InspectObject(TObject *obj)
Dump contents of obj in a graphics canvas.
This class is designed to wrap a Foreign object in order to inject it into the Browse sub-system.
TClass * IsA() const override
~TInspectorObject() override
TInspectorObject(void *obj, TClass *cl)
void Inspect() const override
Dump contents of this object in a graphics canvas.
void * fObj
! pointer to the foreign object
TClass * fClass
! pointer to class of the foreign object
Use the TLine constructor to create a simple line.
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Special TText object used to show hyperlinks.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
TObject * Before(const TObject *obj) const override
Returns the object before object obj.
void Add(TObject *obj) override
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual const char * GetTitle() const
Returns title of object.
virtual TClass * IsA() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
TObject()
TObject constructor.
@ kCanDelete
if object in a list can be deleted
void SetEditable(Bool_t mode=kTRUE) override
Set pad editable yes/no If a pad is not editable:
void RecursiveRemove(TObject *obj) override
Recursively remove object from a pad and its sub-pads.
TVirtualPad * GetVirtCanvas() const override
Get virtual canvas.
Int_t fLogx
(=0 if X linear scale, =1 if log scale)
Int_t fLogy
(=0 if Y linear scale, =1 if log scale)
The TRealData class manages the effective list of all data members for a given class.
const char * GetName() const override
Returns name of object.
TDataMember * GetDataMember() const
Long_t GetThisOffset() const
virtual TText * DrawText(Double_t x, Double_t y, const char *text)
small helper class to store/restore gPad context in TPad methods
virtual void SetCanvasSize(UInt_t ww, UInt_t wh)=0
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)=0
TVirtualPad()
VirtualPad default constructor.
void Clear(Option_t *option="") override=0