00001 #ifndef IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H
00002 # define IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H
00003
00004
00005
00006 # include "Iguana/Inventor/interface/IgSoShapeKit.h"
00007 # include <Inventor/fields/SoSFVec3f.h>
00008 # include <Inventor/fields/SoSFFloat.h>
00009 # include <Inventor/fields/SoSFString.h>
00010 # ifdef WIN32
00011 # include <SoWinLeaveScope.h>
00012 # endif
00013
00014
00015
00016
00017
00018 class IgParticleChar;
00019 class SbVec2f;
00020
00021
00022
00023
00024
00036 class IG_OPEN_INVENTOR_API IgSoIdealTrack : public IgSoShapeKit
00037 {
00038 SO_KIT_HEADER (IgSoIdealTrack);
00039 SO_KIT_CATALOG_ENTRY_HEADER (material);
00040 SO_KIT_CATALOG_ENTRY_HEADER (style);
00041 SO_KIT_CATALOG_ENTRY_HEADER (complexity);
00042 SO_KIT_CATALOG_ENTRY_HEADER (points);
00043 SO_KIT_CATALOG_ENTRY_HEADER (curve);
00044 SO_KIT_CATALOG_ENTRY_HEADER (debugStyle);
00045 SO_KIT_CATALOG_ENTRY_HEADER (debugPoints);
00046
00047 public:
00048 IgSoIdealTrack (void);
00049 static void initClass (void);
00050
00051
00052 SoSFFloat phi;
00053 SoSFFloat radius;
00054 SoSFFloat zeta;
00055 SoSFVec3f vertex;
00056 SoSFFloat tstart;
00057 SoSFFloat tend;
00058 SoSFString particleType;
00059
00060
00061 SoSFFloat t0;
00062 SoSFFloat dt;
00063
00064
00065
00066 void initialise (double *vx, double *vy, double *vz,
00067 double *px, double *py, double *pz,
00068 float *t0, IgParticleChar *pc);
00069 void initialise (double vx, double vy, double vz,
00070 double px, double py, double pz,
00071 float t0, IgParticleChar *pc);
00072 void initialise (double vx, double vy, double vz,
00073 double px, double py, double pz,
00074 float t0, int pid);
00075
00076 static void setBField (float val);
00077 static void setRMax (float val);
00078 static void setZMax (float val);
00079
00080 static float getBField (void);
00081 static float getRMax (void);
00082 static float getZMax (void);
00083
00084
00085 float ptot (void) const;
00086 float pt (void) const;
00087
00088 protected:
00089 virtual void refresh (void);
00090 virtual ~IgSoIdealTrack (void);
00091
00092 protected:
00093 void initEndPts (void);
00094 float timeToAngle (float time);
00095 float angleToTime (float angle);
00096 float zToTime (float z);
00097 float timeToZ (float time);
00098 SbVec2f timeToXY (float time);
00099
00100 IgParticleChar *m_particleChar;
00101 float m_ptot;
00102 float m_pt;
00103 float m_charge;
00104 private:
00105
00106 static float bfield;
00107 static float rmax;
00108 static float zmax;
00109
00110 };
00111
00112
00113 inline void IgSoIdealTrack::setBField (float val) { bfield = val; }
00114 inline void IgSoIdealTrack::setRMax (float val) { rmax = val; }
00115 inline void IgSoIdealTrack::setZMax (float val) { zmax = val; }
00116 inline float IgSoIdealTrack::ptot (void) const { return m_ptot; }
00117 inline float IgSoIdealTrack::pt (void) const { return m_pt; }
00118 inline float IgSoIdealTrack::getBField (void) { return bfield; }
00119 inline float IgSoIdealTrack::getRMax (void) { return rmax; }
00120 inline float IgSoIdealTrack::getZMax (void) { return zmax; }
00121
00122
00123 # ifdef WIN32
00124 # include <SoWinEnterScope.h>
00125 # endif
00126 #endif // IG_OPEN_INVENTOR_IG_SO_IDEAL_TRACK_H