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
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGIMAGEBASE_H_
00055 #define _OSGIMAGEBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGAttachmentContainer.h>
00069
00070 #include <OSGFieldContainerFields.h>
00071 #include <OSGInt32Fields.h>
00072 #include <OSGInt32Fields.h>
00073 #include <OSGInt32Fields.h>
00074 #include <OSGInt32Fields.h>
00075 #include <OSGInt32Fields.h>
00076 #include <OSGInt32Fields.h>
00077 #include <OSGInt32Fields.h>
00078 #include <OSGTimeFields.h>
00079 #include <OSGUInt32Fields.h>
00080 #include <OSGUInt8Fields.h>
00081 #include <OSGInt32Fields.h>
00082 #include <OSGStringFields.h>
00083 #include <OSGInt32Fields.h>
00084 #include <OSGInt32Fields.h>
00085 #include <OSGInt32Fields.h>
00086 #include <OSGInt32Fields.h>
00087 #include <OSGBoolFields.h>
00088 #include <OSGBoolFields.h>
00089 #include <OSGBoolFields.h>
00090
00091 #include <OSGImageFields.h>
00092
00093 OSG_BEGIN_NAMESPACE
00094
00095 class Image;
00096 class BinaryDataHandler;
00097
00099
00100 class OSG_SYSTEMLIB_DLLMAPPING ImageBase : public AttachmentContainer
00101 {
00102 private:
00103
00104 typedef AttachmentContainer Inherited;
00105
00106
00107 public:
00108
00109 typedef ImagePtr Ptr;
00110
00111 enum
00112 {
00113 ParentsFieldId = Inherited::NextFieldId,
00114 DimensionFieldId = ParentsFieldId + 1,
00115 WidthFieldId = DimensionFieldId + 1,
00116 HeightFieldId = WidthFieldId + 1,
00117 DepthFieldId = HeightFieldId + 1,
00118 BppFieldId = DepthFieldId + 1,
00119 MipMapCountFieldId = BppFieldId + 1,
00120 FrameCountFieldId = MipMapCountFieldId + 1,
00121 FrameDelayFieldId = FrameCountFieldId + 1,
00122 PixelFormatFieldId = FrameDelayFieldId + 1,
00123 PixelFieldId = PixelFormatFieldId + 1,
00124 FrameSizeFieldId = PixelFieldId + 1,
00125 NameFieldId = FrameSizeFieldId + 1,
00126 DataTypeFieldId = NameFieldId + 1,
00127 ComponentSizeFieldId = DataTypeFieldId + 1,
00128 SideCountFieldId = ComponentSizeFieldId + 1,
00129 SideSizeFieldId = SideCountFieldId + 1,
00130 ForceCompressedDataFieldId = SideSizeFieldId + 1,
00131 ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1,
00132 ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1,
00133 NextFieldId = ForceColorChannelFieldId + 1
00134 };
00135
00136 static const OSG::BitVector ParentsFieldMask;
00137 static const OSG::BitVector DimensionFieldMask;
00138 static const OSG::BitVector WidthFieldMask;
00139 static const OSG::BitVector HeightFieldMask;
00140 static const OSG::BitVector DepthFieldMask;
00141 static const OSG::BitVector BppFieldMask;
00142 static const OSG::BitVector MipMapCountFieldMask;
00143 static const OSG::BitVector FrameCountFieldMask;
00144 static const OSG::BitVector FrameDelayFieldMask;
00145 static const OSG::BitVector PixelFormatFieldMask;
00146 static const OSG::BitVector PixelFieldMask;
00147 static const OSG::BitVector FrameSizeFieldMask;
00148 static const OSG::BitVector NameFieldMask;
00149 static const OSG::BitVector DataTypeFieldMask;
00150 static const OSG::BitVector ComponentSizeFieldMask;
00151 static const OSG::BitVector SideCountFieldMask;
00152 static const OSG::BitVector SideSizeFieldMask;
00153 static const OSG::BitVector ForceCompressedDataFieldMask;
00154 static const OSG::BitVector ForceAlphaChannelFieldMask;
00155 static const OSG::BitVector ForceColorChannelFieldMask;
00156
00157
00158 static const OSG::BitVector MTInfluenceMask;
00159
00160
00164 static FieldContainerType &getClassType (void);
00165 static UInt32 getClassTypeId (void);
00166
00168
00172 virtual FieldContainerType &getType (void);
00173 virtual const FieldContainerType &getType (void) const;
00174
00175 virtual UInt32 getContainerSize(void) const;
00176
00178
00182 MFFieldContainerPtr *getMFParents (void);
00183 SFInt32 *getSFDimension (void);
00184 SFInt32 *getSFWidth (void);
00185 SFInt32 *getSFHeight (void);
00186 SFInt32 *getSFDepth (void);
00187 SFInt32 *getSFBpp (void);
00188 SFInt32 *getSFMipMapCount (void);
00189 SFInt32 *getSFFrameCount (void);
00190 SFTime *getSFFrameDelay (void);
00191 SFUInt32 *getSFPixelFormat (void);
00192 MFUInt8 *getMFPixel (void);
00193 SFInt32 *getSFFrameSize (void);
00194 SFString *getSFName (void);
00195 SFInt32 *getSFDataType (void);
00196 SFInt32 *getSFSideCount (void);
00197 SFInt32 *getSFSideSize (void);
00198 SFBool *getSFForceCompressedData(void);
00199 SFBool *getSFForceAlphaChannel(void);
00200 SFBool *getSFForceColorChannel(void);
00201
00202 Int32 &getDimension (void);
00203 const Int32 &getDimension (void) const;
00204 Int32 &getWidth (void);
00205 const Int32 &getWidth (void) const;
00206 Int32 &getHeight (void);
00207 const Int32 &getHeight (void) const;
00208 Int32 &getDepth (void);
00209 const Int32 &getDepth (void) const;
00210 Int32 &getBpp (void);
00211 const Int32 &getBpp (void) const;
00212 Int32 &getMipMapCount (void);
00213 const Int32 &getMipMapCount (void) const;
00214 Int32 &getFrameCount (void);
00215 const Int32 &getFrameCount (void) const;
00216 Time &getFrameDelay (void);
00217 const Time &getFrameDelay (void) const;
00218 UInt32 &getPixelFormat (void);
00219 const UInt32 &getPixelFormat (void) const;
00220 Int32 &getFrameSize (void);
00221 const Int32 &getFrameSize (void) const;
00222 std::string &getName (void);
00223 const std::string &getName (void) const;
00224 Int32 &getDataType (void);
00225 const Int32 &getDataType (void) const;
00226 Int32 &getSideCount (void);
00227 const Int32 &getSideCount (void) const;
00228 Int32 &getSideSize (void);
00229 const Int32 &getSideSize (void) const;
00230 bool &getForceCompressedData(void);
00231 const bool &getForceCompressedData(void) const;
00232 bool &getForceAlphaChannel(void);
00233 const bool &getForceAlphaChannel(void) const;
00234 bool &getForceColorChannel(void);
00235 const bool &getForceColorChannel(void) const;
00236 FieldContainerPtr &getParents (const UInt32 index);
00237 MFFieldContainerPtr &getParents (void);
00238 const MFFieldContainerPtr &getParents (void) const;
00239 UInt8 &getPixel (const UInt32 index);
00240 MFUInt8 &getPixel (void);
00241 const MFUInt8 &getPixel (void) const;
00242
00244
00248 void setDimension ( const Int32 &value );
00249 void setWidth ( const Int32 &value );
00250 void setHeight ( const Int32 &value );
00251 void setDepth ( const Int32 &value );
00252 void setBpp ( const Int32 &value );
00253 void setMipMapCount ( const Int32 &value );
00254 void setFrameCount ( const Int32 &value );
00255 void setFrameDelay ( const Time &value );
00256 void setPixelFormat ( const UInt32 &value );
00257 void setFrameSize ( const Int32 &value );
00258 void setName ( const std::string &value );
00259 void setDataType ( const Int32 &value );
00260 void setSideCount ( const Int32 &value );
00261 void setSideSize ( const Int32 &value );
00262 void setForceCompressedData( const bool &value );
00263 void setForceAlphaChannel( const bool &value );
00264 void setForceColorChannel( const bool &value );
00265
00267
00272
00276 virtual UInt32 getBinSize (const BitVector &whichField);
00277 virtual void copyToBin ( BinaryDataHandler &pMem,
00278 const BitVector &whichField);
00279 virtual void copyFromBin( BinaryDataHandler &pMem,
00280 const BitVector &whichField);
00281
00282
00284
00288 static ImagePtr create (void);
00289 static ImagePtr createEmpty (void);
00290
00293
00297 virtual FieldContainerPtr shallowCopy (void) const;
00298
00300
00301 protected:
00302
00303
00307 MFFieldContainerPtr _mfParents;
00308 SFInt32 _sfDimension;
00309 SFInt32 _sfWidth;
00310 SFInt32 _sfHeight;
00311 SFInt32 _sfDepth;
00312 SFInt32 _sfBpp;
00313 SFInt32 _sfMipMapCount;
00314 SFInt32 _sfFrameCount;
00315 SFTime _sfFrameDelay;
00316 SFUInt32 _sfPixelFormat;
00317 MFUInt8 _mfPixel;
00318 SFInt32 _sfFrameSize;
00319 SFString _sfName;
00320 SFInt32 _sfDataType;
00321 SFInt32 _sfComponentSize;
00322 SFInt32 _sfSideCount;
00323 SFInt32 _sfSideSize;
00324 SFBool _sfForceCompressedData;
00325 SFBool _sfForceAlphaChannel;
00326 SFBool _sfForceColorChannel;
00327
00329
00333 ImageBase(void);
00334 ImageBase(const ImageBase &source);
00335
00337
00341 virtual ~ImageBase(void);
00342
00344
00348 SFInt32 *getSFComponentSize (void);
00349
00350 Int32 &getComponentSize (void);
00351 const Int32 &getComponentSize (void) const;
00352
00354
00358 void setComponentSize (const Int32 &value);
00359
00361
00365 #if !defined(OSG_FIXED_MFIELDSYNC)
00366 void executeSyncImpl( ImageBase *pOther,
00367 const BitVector &whichField);
00368
00369 virtual void executeSync( FieldContainer &other,
00370 const BitVector &whichField);
00371 #else
00372 void executeSyncImpl( ImageBase *pOther,
00373 const BitVector &whichField,
00374 const SyncInfo &sInfo );
00375
00376 virtual void executeSync( FieldContainer &other,
00377 const BitVector &whichField,
00378 const SyncInfo &sInfo);
00379
00380 virtual void execBeginEdit (const BitVector &whichField,
00381 UInt32 uiAspect,
00382 UInt32 uiContainerSize);
00383
00384 void execBeginEditImpl (const BitVector &whichField,
00385 UInt32 uiAspect,
00386 UInt32 uiContainerSize);
00387
00388 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00389 #endif
00390
00392
00393 private:
00394
00395 friend class FieldContainer;
00396
00397 static FieldDescription *_desc[];
00398 static FieldContainerType _type;
00399
00400
00401
00402 void operator =(const ImageBase &source);
00403 };
00404
00405
00406
00407
00408
00409
00410 typedef ImageBase *ImageBaseP;
00411
00412 typedef osgIF<ImageBase::isNodeCore,
00413 CoredNodePtr<Image>,
00414 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00415 >::_IRet ImageNodePtr;
00416
00417 typedef RefPtr<ImagePtr> ImageRefPtr;
00418
00419 OSG_END_NAMESPACE
00420
00421 #define OSGIMAGEBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00422
00423 #endif