Re: [ROOT] SetPainter

From: Axel Naumann (axel-naumann@gmx.de)
Date: Sat Jun 14 2003 - 14:08:23 MEST


Hi Aldo,

you have to create a dictionary for your TMyHistoPainter.

SetPainter takes the name of the class (let TMyHistoPainter simply derive
from TVirtualHistPainter, no TNamed involved). ROOT needs to know about
the class (that's what the dictionary is for) to translate this class name
into a real class.

See rootcint for help on how to create a dictionary or let your file be
compiled and loaded by Aclic (.L TMyHistPainter.cxx++), which will create
the dictionary on-the-fly.

Cheers, Axel.

> Hi,
>
> I was wondering if someone could help me with the
> following. I found you could set your own
> painting class using SetPainter function.
>
> So in my code I have included the following:
> TVirtualHistPainter::SetPainter("TMyHistoPainter");
>
> The TMyHistoPainter class is derived from
> THistPainter as shown in the code below.
>
> The problem is that I had not being able
> to set the name to TMyHistoPainter class
> to "TMyHistoPainter" .
>
> One tactic that I tried was
> to let TMyHistoPainter
> inherit TNamed which contains functions
> that allow you to set the classname.
> But during the compilation I had
> the message that the delete function
> was ambiguous. I think both functions
> had the implemented the function.
>
> So my question is how to name TMyHistoPainter
> class "TMyHistoPainter".
>
> At the moment I'm using 3.05/05 in windows.
>
> Any ideas would be greatly appreciated.
>
>
> // a bit of the code
> // definition of the class
> #include "THistPainter.h"
> #include "Rtypes.h"
>
> class TMyHistoPainter: public THistPainter
> {
>
>   public:
>   TMyHistoPainter();
>
>   ClassDef(TMyHistoPainter,0)
>
> };
>
> // implementation of the class
>
> ClassImp(TMyHistoPainter)
>
>
> TMyHistoPainter::TMyHistoPainter():THistPainter()
> {// the constructor
>
> }
>
>
>
>
>
> ***********************************************************
>  Aldo F. Saavedra
>  ATLAS Collaboration - Pixel Group (Physics Division)
>  Lawrence Berkeley National Laboratory
>
>  Email: AFSaavedra@lbl.gov
>  Phone: 1 510 486 4690
>  Fax:   1 510 486 5101
>  Postal Address: Lawrence Berkeley National Laboratory
>  1 Cyclotron Rd Mailstop 50B-62222
>  Berkeley, CA 94720
>  USA
> ***********************************************************
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET