CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DetectorDescription/Core/interface/DDSolidShapes.h

Go to the documentation of this file.
00001 #ifndef DDSolidShapes_h
00002 #define DDSolidShapes_h
00003 
00004 #include "FWCore/Utilities/interface/Exception.h"
00005 
00006 enum DDSolidShape { dd_not_init,
00007                     ddbox, ddtubs, ddtrap, ddcons,
00008                     ddpolycone_rz, ddpolyhedra_rz,
00009                     ddpolycone_rrz, ddpolyhedra_rrz,
00010                     ddtorus,
00011                     ddunion, ddsubtraction, ddintersection,
00012                     ddreflected,
00013                     ddshapeless,
00014                     ddpseudotrap, ddtrunctubs, ddsphere,
00015                     ddorb, ddellipticaltube, ddellipsoid,
00016                     ddparallelepiped
00017                    };
00018                    
00019 struct DDSolidShapesName {
00020 
00021   static const char * name(DDSolidShape s) 
00022   {
00023     static const char* c[] = { 
00024       "Solid not initialized",
00025       "Box", "Tube(section)", "Trapezoid", "Cone(section)",
00026       "Polycone_rz", "Polyhedra_rz",
00027       "Polycone_rrz", "Polyhedra_rrz",
00028       "Torus",
00029       "UnionSolid", "SubtractionSolid", "IntersectionSolid",
00030       "ReflectedSolid", 
00031       "ShapelessSolid",
00032       "PseudoTrapezoid","TruncatedTube(section)",
00033       "Sphere(section)", "Orb", "EllipticalTube", "Ellipsoid",
00034       "Parallelepiped"
00035     };
00036     return c[s];                          
00037   }
00038   
00039   static DDSolidShape index( const int& ind ) {
00040     switch (ind) {
00041     case 0:
00042       return dd_not_init;
00043       break;
00044     case 1:
00045       return ddbox;
00046       break;
00047     case 2:
00048       return ddtubs;
00049       break;
00050     case 3:
00051       return ddtrap;
00052       break;
00053     case 4:
00054       return ddcons;
00055       break;
00056     case 5:
00057       return ddpolycone_rz;
00058       break;
00059     case 6:
00060       return ddpolyhedra_rz;
00061       break;
00062     case 7:
00063       return ddpolycone_rrz;
00064       break;
00065     case 8:
00066       return ddpolyhedra_rrz;
00067       break;
00068     case 9:
00069       return ddtorus;
00070       break;
00071     case 10:
00072       return ddunion;
00073       break;
00074     case 11:
00075       return ddsubtraction;
00076       break;
00077     case 12:
00078       return ddintersection;
00079       break;
00080     case 13:
00081       return ddreflected;
00082       break;
00083     case 14:
00084       return ddshapeless;
00085       break;
00086     case 15:
00087       return ddpseudotrap;
00088       break;
00089     case 16:
00090       return ddtrunctubs;
00091       break;
00092     case 17:
00093       return ddsphere;
00094       break;
00095     case 18: 
00096       return ddorb;
00097       break;
00098     case 19:
00099       return ddellipticaltube;
00100       break;
00101     case 20:
00102       return ddellipsoid;
00103       break;
00104     case 21:
00105       return ddparallelepiped;
00106       break;
00107     default:
00108       throw cms::Exception("DDException") << "DDSolidShapes:index wrong shape";   
00109       break;
00110     }
00111   }
00112 
00113 };
00114 
00115                    
00116 
00117 #endif