TVirtualGraphPainter.cxx

Go to the documentation of this file.
00001 // @(#)root/hist:$Id: TVirtualGraphPainter.cxx 24084 2008-06-01 15:34:01Z brun $
00002 // Author: Olivier Couet 20/05/08
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include "TROOT.h"
00013 #include "TVirtualGraphPainter.h"
00014 #include "TPluginManager.h"
00015 #include "TClass.h"
00016 
00017 TVirtualGraphPainter *TVirtualGraphPainter::fgPainter = 0;
00018 
00019 ClassImp(TVirtualGraphPainter)
00020 
00021 //______________________________________________________________________________
00022 //
00023 //  TVirtualGraphPainter is an abstract interface to a histogram painter.
00024 //
00025 
00026 
00027 //______________________________________________________________________________
00028 TVirtualGraphPainter *TVirtualGraphPainter::GetPainter()
00029 {
00030    // Static function returning a pointer to the current graph painter.
00031    // If the graph painter does not exist a default painter (singleton) is created.
00032 
00033    // if no painter set yet, create a default painter via the PluginManager
00034    if (!fgPainter) {
00035       TPluginHandler *h;
00036       if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualGraphPainter"))) {
00037          if (h->LoadPlugin() == -1) return 0;
00038          fgPainter = (TVirtualGraphPainter*)gROOT->GetClass("TGraphPainter")->New();
00039       }
00040    }
00041 
00042    // Create an instance of the graph painter
00043    return fgPainter;
00044 }
00045 
00046 //______________________________________________________________________________
00047 void TVirtualGraphPainter::SetPainter(TVirtualGraphPainter *painter)
00048 {
00049    // Static function to set an alternative histogram painter.
00050 
00051    fgPainter = painter;
00052 }

Generated on Tue Jul 5 14:24:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1