00001 #ifndef IG_OPEN_INVENTOR_IG_SO_RECT_HIST_H
00002 # define IG_OPEN_INVENTOR_IG_SO_RECT_HIST_H
00003
00004
00005
00006 # include "Iguana/Inventor/interface/IgSoShapeKit.h"
00007 # include <Inventor/fields/SoSFFloat.h>
00008 # include <Inventor/fields/SoSFInt32.h>
00009 # include <Inventor/fields/SoSFBool.h>
00010 # include <Inventor/fields/SoMFFloat.h>
00011 # include <Inventor/SbVec3f.h>
00012
00013 # include "Iguana/Utilities/classlib/utils/DebugAids.h"
00014
00015
00016 # include <iostream>
00017 # include <vector>
00018 # ifdef WIN32
00019 # include <SoWinLeaveScope.h>
00020 # endif
00021
00022
00023
00024
00025
00026
00027
00028 class IG_OPEN_INVENTOR_API IgSoRectHist: public IgSoShapeKit
00029 {
00030
00031 SO_KIT_HEADER (IgSoRectHist);
00032 SO_KIT_CATALOG_ENTRY_HEADER (shapeHints);
00033 SO_KIT_CATALOG_ENTRY_HEADER (faceSet);
00034 SO_KIT_CATALOG_ENTRY_HEADER (negativeShapeHints);
00035 SO_KIT_CATALOG_ENTRY_HEADER (negativeMaterial);
00036 SO_KIT_CATALOG_ENTRY_HEADER (negativeFaceSet);
00037
00038 SO_KIT_CATALOG_ENTRY_HEADER (soAnnotation);
00039
00040 public:
00041 IgSoRectHist ();
00042 static void initClass (void);
00043
00044 SoSFFloat Rr;
00045 SoSFFloat Rz;
00046 SoSFFloat offsetR;
00047 SoSFFloat offsetZ;
00048 SoSFFloat nr;
00049 SoSFFloat nz;
00050 SoMFFloat energies;
00051 SoSFFloat layer;
00052
00053
00054 SoSFBool logScale;
00055 SoSFFloat scaleFactor;
00056 SoSFFloat maxRr;
00057 SoSFFloat maxRz;
00058
00059
00060 SoSFBool showAnnotations;
00061
00062 enum n_lowerUpper {LOWER, UPPER};
00063 enum n_leftRight {LEFT, RIGHT};
00064 enum n_barrelEndcap {BARREL, ENDCAP};
00065
00066 void setLineColor ( const float & red,
00067 const float & green,
00068 const float & blue);
00069
00070 protected:
00071 virtual void refresh (void);
00072
00073 private:
00074
00075
00076 float lineColor_[3];
00077
00078 SbVec3f CMStoIgBarrel (const float & deltaTheta,
00079 const float & thetaRight,
00080 const float & thetaIndex,
00081 const float & energy,
00082 const n_lowerUpper upperBarrel);
00083
00084 SbVec3f CMStoIgEndcap (const float & deltaTheta,
00085 const float & thetaRight,
00086 const float & thetaIndex,
00087 const float & energy,
00088 const n_leftRight leftRight);
00089
00090 std::vector<float> getNegativeEnergies (std::vector<float> & localEnergies) ;
00091
00092 std::vector<SbVec3f> generateVertexData (std::vector<float> & localEnergies,
00093 const int nOfBins,
00094 const float & deltaThetaEndcap,
00095 const float & deltaThetaBarrel,
00096 const float & thetaRightEndcap,
00097 const float & thetaRightBarrel,
00098 const float & thetaOffset,
00099 const float & scale);
00100
00101 SbVec3f generateLabelCoords (const int binNo,
00102 const float & deltaThetaEndcap,
00103 const float & deltaThetaBarrel,
00104 const float & thetaRightEndcap,
00105 const float & thetaRightBarrel,
00106 const float & energy);
00107
00108 std::vector<int> generateFaceIndices (const std::vector<float> & localEnergies,
00109 const int nr,
00110 const int nz);
00111 void checkNumberOfBins ();
00112 };
00113
00114
00115
00116
00117 # ifdef WIN32
00118 # include <SoWinEnterScope.h>
00119 # endif
00120
00121 #endif // IG_OPEN_INVENTOR_IG_SO_RECT_HIST_H
00122