00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SO_IMAGE_
00026 #define _SO_IMAGE_
00027
00028 #include <Inventor/SbPImpl.h>
00029 #include <Inventor/nodes/SoShape.h>
00030
00031 #include <Inventor/fields/SoSFFilePathString.h>
00032 #include <Inventor/fields/SoSFImage.h>
00033 #include <Inventor/fields/SoSFEnum.h>
00034 #include <Inventor/fields/SoSFInt32.h>
00035 #include <Inventor/nodes/SoNode.h>
00036 #include <Inventor/nodes/SoTexture.h>
00037 #include <Inventor/image/SbRasterImage.h>
00038
00039 #include <Inventor/sys/SoGLType.h>
00040
00041
00042 class SoGetPrimitiveCountAction;
00043 class SoGLRenderAction;
00044
00045 SO_PIMPL_PUBLIC_DECLARATION(SoImage)
00046
00047
00122 class SoImage : public SoShape {
00123
00124 SO_PIMPL_PUBLIC_HEADER(SoImage)
00125 SO_NODE_HEADER(SoImage);
00126
00127 public:
00128
00130 enum HorAlignment {
00134 LEFT,
00138 CENTER,
00142 RIGHT
00143 };
00144
00146 enum VertAlignment {
00150 BOTTOM,
00154 HALF,
00158 TOP
00159 };
00160
00162 enum FileType {
00166 UNKNOWN = SoTexture::UNKNOWN,
00170 RGB = SoTexture::RGB,
00174 SGI = SoTexture::SGI,
00178 TIFF = SoTexture::TIFF,
00182 GIF = SoTexture::GIF,
00186 JPEG = SoTexture::JPEG,
00190 BMP = SoTexture::BMP,
00194 PNG = SoTexture::PNG,
00198 JPEG2000 = SoTexture::JPEG2000,
00202 PGX = SoTexture::PGX,
00206 PNM = SoTexture::PNM,
00210 RAS = SoTexture::RAS,
00214 DDS = SoTexture::DDS,
00218 HDRI = SoTexture::HDRI,
00220 NUM_FILETYPES
00221 };
00222
00223
00224
00236 SoSFFilePathString filename;
00237
00244 SoSFImage image;
00252 SoSFEnum horAlignment;
00259 SoSFEnum vertAlignment;
00260
00268 SoSFInt32 width;
00269
00277 SoSFInt32 height;
00278
00282 SoImage();
00283
00284
00285
00286 private:
00287 virtual void GLRender(SoGLRenderAction *action);
00288 virtual void rayPick(SoRayPickAction *action);
00289 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00290
00291 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er);
00292
00293 private:
00294 static void initClass();
00295 static void exitClass();
00296
00298 virtual void notify( SoNotList *list );
00299
00300 private:
00301 virtual void generatePrimitives(SoAction *action);
00302
00303
00304 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00305
00306
00307 virtual ~SoImage();
00308
00309 private:
00310 void commonConstructor();
00311 };
00312
00313
00314 #endif
00315
00316