CMS 3D CMS Logo

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

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