MeVisLabToolboxReference
MeVisLab/Standard/Sources/Inventor/SoView2D/extensions/SoView2DVoxelView.h
Go to the documentation of this file.
00001 // **InsertLicense** code
00002 //----------------------------------------------------------------------------------
00004 
00009 //----------------------------------------------------------------------------------
00010 #ifndef __SoView2DVoxelView_H
00011 #define __SoView2DVoxelView_H
00012 
00014 #ifndef __SoView2DSystem_H
00015 #include "SoView2DSystem.h"
00016 #endif
00017 
00019 #ifndef __SoView2DExtension_H
00020 #include "SoView2DExtension.h"
00021 #endif
00022 
00023 #include <Inventor/fields/SoFields.h>
00024 
00025 #ifndef __mlLUTData_H
00026 #include "mlLUTData.h"
00027 #endif
00028 #ifndef __SoSFMLBase_H
00029 #include "SoSFMLBase.h"
00030 #endif
00031 #ifndef __SoSFMLImage_H
00032 #include "SoSFMLImage.h"
00033 #endif
00034 
00035 // Forward declaration.
00036 class View2DFont;
00037 
00038 //----------------------------------------------------------------------------------
00040 //----------------------------------------------------------------------------------
00041 class SOVIEW2D_API SoView2DVoxelView : public SoView2DExtension
00042 {
00046   SO_NODE_HEADER(SoView2DVoxelView);
00047 
00048 public:
00049 
00054   static void initClass(void);
00055 
00057   SoView2DVoxelView(void);
00058 
00063   virtual void draw(View2DSliceList *dsl, View2DSlice *dslice, int slice);
00064 
00065 
00067 
00068 
00069   SoSFBool   drawVoxelValues;
00070 
00074   SoSFString defaultFitString;
00075 
00077   SoSFBool   drawCenterDots;
00078 
00080   SoSFBool   drawCornerDots;
00081 
00084   SoSFBool   useCommas;
00085 
00087   SoSFBool   outLineVoxels;
00088 
00092   SoSFBool   useLut;
00093 
00095   SoSFFloat  defaultAlpha;
00096 
00098   SoSFFloat  fontSize;
00099 
00101   SoSFInt32  numCoordinateComponents;
00102 
00105   SoSFInt32  numRowComponents;
00106 
00111   SoSFInt32  numPrecisionDigits;
00112 
00115   SoSFMLBase inputLut;
00117 
00118 
00119 protected:
00120 
00138   virtual void _drawCellInformation(View2DSliceList   * /*dsl        */,
00139                                     View2DSlice       * /*dslice     */,
00140                                     int                 /*slice      */,
00141                                     bool                /*drawTexts  */,
00142                                     int                 /*numRowComps*/,
00143                                     const MLTypeInfos & /*dtInfo     */,
00144                                     MLDataType          /*dType      */,
00145                                     MLTypeData        * /*vBuf1      */,
00146                                     int                 /*numDTComps */,
00147                                     GLfloat             /*rgba       */[4],
00148                                     float               /*xPos       */,
00149                                     float               /*yPos       */,
00150                                     View2DFont        & /*font       */,
00151                                     float               /*fSize      */) { }
00152 
00154   ML_NAMESPACE::LUTData<MLfloat> _lutData;
00155 
00158   void _getGLColor(double dblVoxVal, GLfloat rgba[4]);
00159 
00167   float _drawVoxelValue(bool        drawTexts,
00168                         int         numRowComps,
00169                         MLDataType  dType,
00170                         MLTypeData *vBuf1,
00171                         int         numDTComponents,
00172                         GLfloat     rgba[4],
00173                         float       xPos,
00174                         float       yPos,
00175                         View2DFont &font,
00176                         float       fSize);
00177 
00186   float _drawStringVoxelValue(bool        drawTexts,
00187                               MLDataType  dType,
00188                               MLTypeData *vBuf1,
00189                               int         numDTComponents,
00190                               GLfloat     rgba[4],
00191                               float       xPos,
00192                               float       yPos,
00193                               View2DFont &font,
00194                               float       fSize);
00195 
00200   void _drawCoordinateComponents(bool         drawTexts,
00201                                  int          numComps,
00202                                  XVImageSize &pos,
00203                                  GLfloat      rgba[4],
00204                                  float        xPos,
00205                                  float        yPos,
00206                                  View2DFont  &font,
00207                                  float        fSize);
00208 
00213   void _updateLutData(SoSFMLImage &inImg);
00214 
00215 private:
00217   bool   _lutIsValid;
00218 
00220   double _lutShift;
00221 
00223   double _lutScale;
00224 };
00225 
00226 #endif  // __SoView2DVoxelView_H