Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVirtualGeoConverter.cxx
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Mihaela Gheata 30/03/16
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/** \class TVirtualGeoConverter
13\ingroup Geometry_classes
14
15Abstract class for geometry converters
16*/
17
19
20#include "TError.h"
21#include "TROOT.h"
22#include "TPluginManager.h"
23#include "TGeoManager.h"
24
26
27
28////////////////////////////////////////////////////////////////////////////////
29/// Geometry converter default constructor
30
32
33////////////////////////////////////////////////////////////////////////////////
34/// Geometry converter default destructor
35
40
41////////////////////////////////////////////////////////////////////////////////
42/// Static function returning a pointer to the current geometry converter.
43/// The converter implements the ConvertGeometry function.
44/// If the geometry converter does not exist a default converter is created.
45
47{
48 // if no converter set yet, create a default converter via the PluginManager
50 if (!mgr)
52 if (!fgGeoConverter) {
54 if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualGeoConverter"))) {
55 if (h->LoadPlugin() == -1) {
56 ::Error("TVirtualGeoConverter::Instance()",
57 "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
58 "It appears that you are missing or having outdated support for VecGeom package. "
59 "To enable it, configure ROOT with:\n"
60 " -Dvecgeom -DCMAKE_PREFIX_PATH=<vecgeom_prefix_path>/lib/CMake/VecGeom"
61 "\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
62 return nullptr;
63 }
64 fgGeoConverter = (TVirtualGeoConverter *)h->ExecPlugin(1, mgr);
65 }
66 }
68 fgGeoConverter->SetGeometry(mgr);
69 return fgGeoConverter;
70}
71
72////////////////////////////////////////////////////////////////////////////////
73/// Static function to set an alternative converter.
74
#define h(i)
Definition RSha256.hxx:106
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TGeoManager * gGeoManager
#define gROOT
Definition TROOT.h:411
The manager class for any TGeo geometry.
Definition TGeoManager.h:45
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
Abstract class for geometry converters.
static TVirtualGeoConverter * fgGeoConverter
static TVirtualGeoConverter * Instance(TGeoManager *geom=nullptr)
Static function returning a pointer to the current geometry converter.
TVirtualGeoConverter(TGeoManager *geom)
Geometry converter default constructor.
~TVirtualGeoConverter() override
Geometry converter default destructor.
static void SetConverter(const TVirtualGeoConverter *conv)
Static function to set an alternative converter.