CMS 3D CMS Logo

IgParticleChar.h

Go to the documentation of this file.
00001 #ifndef IG_OPEN_INVENTOR_IG_PARTICLE_CHAR_H
00002 # define IG_OPEN_INVENTOR_IG_PARTICLE_CHAR_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "Iguana/Inventor/interface/config.h"
00007 # include <Inventor/nodes/SoMaterial.h>
00008 # include <Inventor/nodes/SoDrawStyle.h>
00009 # include <map>
00010 
00011 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00012 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00013 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00014 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00015 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00016 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00017 
00018 class  IgParticleChar;
00019 
00041 class IG_OPEN_INVENTOR_API IgParticleChar
00042 {
00043 public:
00045     IgParticleChar (int geantCode, int pythiaCode, int isaCode, const char *name,
00046                     const char *label, float mass, float charge);
00047 
00049         void            setMaterial (SoMaterial* particleMaterial);
00051     void                setStyle (SoDrawStyle* particleStyle);
00052 
00054         const char *    getName () const;
00055     float               getMass () const;
00056     float               getCharge () const;
00057 
00058 
00059         int                     getGeantCode () const;
00060     int                 getIsajetCode () const;
00061     int                 getPythiaCode () const;
00062 
00064     SoMaterial *        getMaterial () const;
00065 
00067     SoDrawStyle *       getStyle () const;
00068 
00070         static void             initParticles ();
00072     static void         deleteParticles ();
00073 
00074     static IgParticleChar *getByName (const char* string);
00075 
00077     static IgParticleChar *getByGeantID (const int p_code);
00078     static IgParticleChar *getByPythiaID (const int p_code);
00079     static IgParticleChar *getByIsajetID (const int p_code);
00080 
00082     static void         dumpDB (std::ostream & os);
00083 
00085     friend std::ostream &operator<< (std::ostream &os, const IgParticleChar &pc);
00086 
00087 protected:
00088     void                print (std::ostream & os) const;
00089 
00090 private:
00091     typedef std::map< std::string, IgParticleChar*> CMapToParticleList;
00092     const int geantCode;
00093     const int pythiaCode;
00094     const int isajetCode; 
00095     SoMaterial* particleMaterial;
00096     SoDrawStyle* particleStyle;
00097     const SbString name;
00098     const SbString label;
00099     static CMapToParticleList* particleList;
00100     const float mass;
00101     const float charge;
00102     static SbBool inited; 
00103     ~IgParticleChar ();
00104 };
00105 
00106 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00107 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00108 
00109 inline int
00110 IgParticleChar::getGeantCode () const
00111 { return geantCode; }
00112 
00113 inline SoMaterial *
00114 IgParticleChar::getMaterial () const
00115 { return particleMaterial; }
00116 
00117 inline SoDrawStyle *
00118 IgParticleChar::getStyle () const
00119 { return particleStyle;         }
00120 
00121 inline std::ostream &
00122 operator<< (std::ostream & os, const IgParticleChar &pc)
00123 {
00124     pc.print (os);
00125     return os;
00126 }
00127 
00128 #endif // IG_OPEN_INVENTOR_IG_PARTICLE_CHAR_H

Generated on Tue Jun 9 17:38:42 2009 for CMSSW by  doxygen 1.5.4