PageRenderTime 845ms CodeModel.GetById 51ms app.highlight 131ms RepoModel.GetById 39ms app.codeStats 619ms

/Source/System/Image/ES/OSGImageBase.h

https://github.com/msteners/OpenSGDevMaster_Toolbox
C++ Header | 585 lines | 328 code | 116 blank | 141 comment | 0 complexity | d71c09460fc90fe4d77aca98017ef2a6 MD5 | raw file
  1/*---------------------------------------------------------------------------*\
  2 *                                OpenSG                                     *
  3 *                                                                           *
  4 *                                                                           *
  5 *               Copyright (C) 2000-2006 by the OpenSG Forum                 *
  6 *                                                                           *
  7 *                            www.opensg.org                                 *
  8 *                                                                           *
  9 *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
 10 *                                                                           *
 11\*---------------------------------------------------------------------------*/
 12/*---------------------------------------------------------------------------*\
 13 *                                License                                    *
 14 *                                                                           *
 15 * This library is free software; you can redistribute it and/or modify it   *
 16 * under the terms of the GNU Library General Public License as published    *
 17 * by the Free Software Foundation, version 2.                               *
 18 *                                                                           *
 19 * This library is distributed in the hope that it will be useful, but       *
 20 * WITHOUT ANY WARRANTY; without even the implied warranty of                *
 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
 22 * Library General Public License for more details.                          *
 23 *                                                                           *
 24 * You should have received a copy of the GNU Library General Public         *
 25 * License along with this library; if not, write to the Free Software       *
 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
 27 *                                                                           *
 28\*---------------------------------------------------------------------------*/
 29/*---------------------------------------------------------------------------*\
 30 *                                Changes                                    *
 31 *                                                                           *
 32 *                                                                           *
 33 *                                                                           *
 34 *                                                                           *
 35 *                                                                           *
 36 *                                                                           *
 37\*---------------------------------------------------------------------------*/
 38
 39/*****************************************************************************\
 40 *****************************************************************************
 41 **                                                                         **
 42 **                  This file is automatically generated.                  **
 43 **                                                                         **
 44 **          Any changes made to this file WILL be lost when it is          **
 45 **           regenerated, which can become necessary at any time.          **
 46 **                                                                         **
 47 **     Do not change this file, changes should be done in the derived      **
 48 **     class Image
 49 **                                                                         **
 50 *****************************************************************************
 51\*****************************************************************************/
 52
 53
 54#ifndef _OSGIMAGEBASE_H_
 55#define _OSGIMAGEBASE_H_
 56#ifdef __sgi
 57#pragma once
 58#endif
 59
 60
 61#include "OSGConfig.h"
 62#include "OSGSystemDef.h"
 63
 64//#include "OSGBaseTypes.h"
 65
 66#include "OSGAttachmentContainer.h" // Parent
 67
 68#include "OSGParentFieldContainerFields.h" // Parents type
 69#include "OSGSysFields.h"               // Dimension type
 70#include "OSGBaseFields.h"              // FrameDelay type
 71
 72#include "OSGImageFields.h"
 73
 74OSG_BEGIN_NAMESPACE
 75
 76class Image;
 77
 78//! \brief Image Base Class.
 79
 80class OSG_SYSTEM_DLLMAPPING ImageBase : public AttachmentContainer
 81{
 82  public:
 83
 84    typedef AttachmentContainer Inherited;
 85    typedef AttachmentContainer ParentContainer;
 86
 87    typedef Inherited::TypeObject TypeObject;
 88    typedef TypeObject::InitPhase InitPhase;
 89
 90    OSG_GEN_INTERNALPTR(Image);
 91
 92    /*==========================  PUBLIC  =================================*/
 93
 94  public:
 95
 96    enum
 97    {
 98        ParentsFieldId = Inherited::NextFieldId,
 99        DimensionFieldId = ParentsFieldId + 1,
100        WidthFieldId = DimensionFieldId + 1,
101        HeightFieldId = WidthFieldId + 1,
102        DepthFieldId = HeightFieldId + 1,
103        BppFieldId = DepthFieldId + 1,
104        MipMapCountFieldId = BppFieldId + 1,
105        FrameCountFieldId = MipMapCountFieldId + 1,
106        FrameDelayFieldId = FrameCountFieldId + 1,
107        PixelFormatFieldId = FrameDelayFieldId + 1,
108        PixelFieldId = PixelFormatFieldId + 1,
109        FrameSizeFieldId = PixelFieldId + 1,
110        NameFieldId = FrameSizeFieldId + 1,
111        DataTypeFieldId = NameFieldId + 1,
112        ComponentSizeFieldId = DataTypeFieldId + 1,
113        SideCountFieldId = ComponentSizeFieldId + 1,
114        SideSizeFieldId = SideCountFieldId + 1,
115        ForceCompressedDataFieldId = SideSizeFieldId + 1,
116        ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1,
117        ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1,
118        ForceAlphaBinaryFieldId = ForceColorChannelFieldId + 1,
119        NextFieldId = ForceAlphaBinaryFieldId + 1
120    };
121
122    static const OSG::BitVector ParentsFieldMask =
123        (TypeTraits<BitVector>::One << ParentsFieldId);
124    static const OSG::BitVector DimensionFieldMask =
125        (TypeTraits<BitVector>::One << DimensionFieldId);
126    static const OSG::BitVector WidthFieldMask =
127        (TypeTraits<BitVector>::One << WidthFieldId);
128    static const OSG::BitVector HeightFieldMask =
129        (TypeTraits<BitVector>::One << HeightFieldId);
130    static const OSG::BitVector DepthFieldMask =
131        (TypeTraits<BitVector>::One << DepthFieldId);
132    static const OSG::BitVector BppFieldMask =
133        (TypeTraits<BitVector>::One << BppFieldId);
134    static const OSG::BitVector MipMapCountFieldMask =
135        (TypeTraits<BitVector>::One << MipMapCountFieldId);
136    static const OSG::BitVector FrameCountFieldMask =
137        (TypeTraits<BitVector>::One << FrameCountFieldId);
138    static const OSG::BitVector FrameDelayFieldMask =
139        (TypeTraits<BitVector>::One << FrameDelayFieldId);
140    static const OSG::BitVector PixelFormatFieldMask =
141        (TypeTraits<BitVector>::One << PixelFormatFieldId);
142    static const OSG::BitVector PixelFieldMask =
143        (TypeTraits<BitVector>::One << PixelFieldId);
144    static const OSG::BitVector FrameSizeFieldMask =
145        (TypeTraits<BitVector>::One << FrameSizeFieldId);
146    static const OSG::BitVector NameFieldMask =
147        (TypeTraits<BitVector>::One << NameFieldId);
148    static const OSG::BitVector DataTypeFieldMask =
149        (TypeTraits<BitVector>::One << DataTypeFieldId);
150    static const OSG::BitVector ComponentSizeFieldMask =
151        (TypeTraits<BitVector>::One << ComponentSizeFieldId);
152    static const OSG::BitVector SideCountFieldMask =
153        (TypeTraits<BitVector>::One << SideCountFieldId);
154    static const OSG::BitVector SideSizeFieldMask =
155        (TypeTraits<BitVector>::One << SideSizeFieldId);
156    static const OSG::BitVector ForceCompressedDataFieldMask =
157        (TypeTraits<BitVector>::One << ForceCompressedDataFieldId);
158    static const OSG::BitVector ForceAlphaChannelFieldMask =
159        (TypeTraits<BitVector>::One << ForceAlphaChannelFieldId);
160    static const OSG::BitVector ForceColorChannelFieldMask =
161        (TypeTraits<BitVector>::One << ForceColorChannelFieldId);
162    static const OSG::BitVector ForceAlphaBinaryFieldMask =
163        (TypeTraits<BitVector>::One << ForceAlphaBinaryFieldId);
164    static const OSG::BitVector NextFieldMask =
165        (TypeTraits<BitVector>::One << NextFieldId);
166        
167    typedef MFUnrecParentFieldContainerPtr MFParentsType;
168    typedef SFInt32           SFDimensionType;
169    typedef SFInt32           SFWidthType;
170    typedef SFInt32           SFHeightType;
171    typedef SFInt32           SFDepthType;
172    typedef SFInt32           SFBppType;
173    typedef SFInt32           SFMipMapCountType;
174    typedef SFInt32           SFFrameCountType;
175    typedef SFTime            SFFrameDelayType;
176    typedef SFUInt32          SFPixelFormatType;
177    typedef MFUInt8           MFPixelType;
178    typedef SFInt32           SFFrameSizeType;
179    typedef SFString          SFNameType;
180    typedef SFInt32           SFDataTypeType;
181    typedef SFInt32           SFComponentSizeType;
182    typedef SFInt32           SFSideCountType;
183    typedef SFInt32           SFSideSizeType;
184    typedef SFBool            SFForceCompressedDataType;
185    typedef SFBool            SFForceAlphaChannelType;
186    typedef SFBool            SFForceColorChannelType;
187    typedef SFBool            SFForceAlphaBinaryType;
188
189    /*---------------------------------------------------------------------*/
190    /*! \name                    Class Get                                 */
191    /*! \{                                                                 */
192
193    static FieldContainerType &getClassType   (void);
194    static UInt32              getClassTypeId (void);
195    static UInt16              getClassGroupId(void);
196
197    /*! \}                                                                 */
198    /*---------------------------------------------------------------------*/
199    /*! \name                FieldContainer Get                            */
200    /*! \{                                                                 */
201
202    virtual       FieldContainerType &getType         (void);
203    virtual const FieldContainerType &getType         (void) const;
204
205    virtual       UInt32              getContainerSize(void) const;
206
207    /*! \}                                                                 */
208    /*---------------------------------------------------------------------*/
209    /*! \name                    Field Get                                 */
210    /*! \{                                                                 */
211
212
213                  SFInt32             *editSFDimension      (void);
214            const SFInt32             *getSFDimension       (void) const;
215
216                  SFInt32             *editSFWidth          (void);
217            const SFInt32             *getSFWidth           (void) const;
218
219                  SFInt32             *editSFHeight         (void);
220            const SFInt32             *getSFHeight          (void) const;
221
222                  SFInt32             *editSFDepth          (void);
223            const SFInt32             *getSFDepth           (void) const;
224
225                  SFInt32             *editSFBpp            (void);
226            const SFInt32             *getSFBpp             (void) const;
227
228                  SFInt32             *editSFMipMapCount    (void);
229            const SFInt32             *getSFMipMapCount     (void) const;
230
231                  SFInt32             *editSFFrameCount     (void);
232            const SFInt32             *getSFFrameCount      (void) const;
233
234                  SFTime              *editSFFrameDelay     (void);
235            const SFTime              *getSFFrameDelay      (void) const;
236
237                  SFUInt32            *editSFPixelFormat    (void);
238            const SFUInt32            *getSFPixelFormat     (void) const;
239
240                  MFUInt8             *editMFPixel          (void);
241            const MFUInt8             *getMFPixel           (void) const;
242
243                  SFInt32             *editSFFrameSize      (void);
244            const SFInt32             *getSFFrameSize       (void) const;
245
246                  SFString            *editSFName           (void);
247            const SFString            *getSFName            (void) const;
248
249                  SFInt32             *editSFDataType       (void);
250            const SFInt32             *getSFDataType        (void) const;
251
252                  SFInt32             *editSFSideCount      (void);
253            const SFInt32             *getSFSideCount       (void) const;
254
255                  SFInt32             *editSFSideSize       (void);
256            const SFInt32             *getSFSideSize        (void) const;
257
258                  SFBool              *editSFForceCompressedData(void);
259            const SFBool              *getSFForceCompressedData (void) const;
260
261                  SFBool              *editSFForceAlphaChannel(void);
262            const SFBool              *getSFForceAlphaChannel (void) const;
263
264                  SFBool              *editSFForceColorChannel(void);
265            const SFBool              *getSFForceColorChannel (void) const;
266
267                  SFBool              *editSFForceAlphaBinary(void);
268            const SFBool              *getSFForceAlphaBinary (void) const;
269
270
271                  Int32               &editDimension      (void);
272                  Int32                getDimension       (void) const;
273
274                  Int32               &editWidth          (void);
275                  Int32                getWidth           (void) const;
276
277                  Int32               &editHeight         (void);
278                  Int32                getHeight          (void) const;
279
280                  Int32               &editDepth          (void);
281                  Int32                getDepth           (void) const;
282
283                  Int32               &editBpp            (void);
284                  Int32                getBpp             (void) const;
285
286                  Int32               &editMipMapCount    (void);
287                  Int32                getMipMapCount     (void) const;
288
289                  Int32               &editFrameCount     (void);
290                  Int32                getFrameCount      (void) const;
291
292                  Time                &editFrameDelay     (void);
293            const Time                &getFrameDelay      (void) const;
294
295                  UInt32              &editPixelFormat    (void);
296                  UInt32               getPixelFormat     (void) const;
297
298                  UInt8               &editPixel          (const UInt32 index);
299                  UInt8                getPixel           (const UInt32 index) const;
300
301                  Int32               &editFrameSize      (void);
302                  Int32                getFrameSize       (void) const;
303
304                  std::string         &editName           (void);
305            const std::string         &getName            (void) const;
306
307                  Int32               &editDataType       (void);
308                  Int32                getDataType        (void) const;
309
310                  Int32               &editSideCount      (void);
311                  Int32                getSideCount       (void) const;
312
313                  Int32               &editSideSize       (void);
314                  Int32                getSideSize        (void) const;
315
316                  bool                &editForceCompressedData(void);
317                  bool                 getForceCompressedData (void) const;
318
319                  bool                &editForceAlphaChannel(void);
320                  bool                 getForceAlphaChannel (void) const;
321
322                  bool                &editForceColorChannel(void);
323                  bool                 getForceColorChannel (void) const;
324
325                  bool                &editForceAlphaBinary(void);
326                  bool                 getForceAlphaBinary (void) const;
327
328    /*! \}                                                                 */
329    /*---------------------------------------------------------------------*/
330    /*! \name                    Field Set                                 */
331    /*! \{                                                                 */
332
333            void setDimension      (const Int32 value);
334            void setWidth          (const Int32 value);
335            void setHeight         (const Int32 value);
336            void setDepth          (const Int32 value);
337            void setBpp            (const Int32 value);
338            void setMipMapCount    (const Int32 value);
339            void setFrameCount     (const Int32 value);
340            void setFrameDelay     (const Time &value);
341            void setPixelFormat    (const UInt32 value);
342            void setFrameSize      (const Int32 value);
343            void setName           (const std::string &value);
344            void setDataType       (const Int32 value);
345            void setSideCount      (const Int32 value);
346            void setSideSize       (const Int32 value);
347            void setForceCompressedData(const bool value);
348            void setForceAlphaChannel(const bool value);
349            void setForceColorChannel(const bool value);
350            void setForceAlphaBinary(const bool value);
351
352    /*! \}                                                                 */
353    /*---------------------------------------------------------------------*/
354    /*! \name                Ptr MField Set                                */
355    /*! \{                                                                 */
356
357    /*! \}                                                                 */
358    /*---------------------------------------------------------------------*/
359    /*! \name                   Binary Access                              */
360    /*! \{                                                                 */
361
362    virtual UInt32 getBinSize (ConstFieldMaskArg  whichField);
363    virtual void   copyToBin  (BinaryDataHandler &pMem,
364                               ConstFieldMaskArg  whichField);
365    virtual void   copyFromBin(BinaryDataHandler &pMem,
366                               ConstFieldMaskArg  whichField);
367
368
369    /*! \}                                                                 */
370    /*---------------------------------------------------------------------*/
371    /*! \name                   Construction                               */
372    /*! \{                                                                 */
373
374    static  ImageTransitPtr  create          (void);
375    static  Image           *createEmpty     (void);
376
377    static  ImageTransitPtr  createLocal     (
378                                               BitVector bFlags = FCLocal::All);
379
380    static  Image            *createEmptyLocal(
381                                              BitVector bFlags = FCLocal::All);
382
383    static  ImageTransitPtr  createDependent  (BitVector bFlags);
384
385    /*! \}                                                                 */
386    /*---------------------------------------------------------------------*/
387    /*! \name                       Copy                                   */
388    /*! \{                                                                 */
389
390    virtual FieldContainerTransitPtr shallowCopy     (void) const;
391    virtual FieldContainerTransitPtr shallowCopyLocal(
392                                       BitVector bFlags = FCLocal::All) const;
393    virtual FieldContainerTransitPtr shallowCopyDependent(
394                                                      BitVector bFlags) const;
395
396    /*! \}                                                                 */
397    /*=========================  PROTECTED  ===============================*/
398
399  protected:
400
401    static TypeObject _type;
402
403    static       void   classDescInserter(TypeObject &oType);
404    static const Char8 *getClassname     (void             );
405
406    /*---------------------------------------------------------------------*/
407    /*! \name                      Fields                                  */
408    /*! \{                                                                 */
409
410    MFUnrecParentFieldContainerPtr _mfParents;
411    SFInt32           _sfDimension;
412    SFInt32           _sfWidth;
413    SFInt32           _sfHeight;
414    SFInt32           _sfDepth;
415    SFInt32           _sfBpp;
416    SFInt32           _sfMipMapCount;
417    SFInt32           _sfFrameCount;
418    SFTime            _sfFrameDelay;
419    SFUInt32          _sfPixelFormat;
420    MFUInt8           _mfPixel;
421    SFInt32           _sfFrameSize;
422    SFString          _sfName;
423    SFInt32           _sfDataType;
424    SFInt32           _sfComponentSize;
425    SFInt32           _sfSideCount;
426    SFInt32           _sfSideSize;
427    SFBool            _sfForceCompressedData;
428    SFBool            _sfForceAlphaChannel;
429    SFBool            _sfForceColorChannel;
430    SFBool            _sfForceAlphaBinary;
431
432    /*! \}                                                                 */
433    /*---------------------------------------------------------------------*/
434    /*! \name                   Constructors                               */
435    /*! \{                                                                 */
436
437    ImageBase(void);
438    ImageBase(const ImageBase &source);
439
440    /*! \}                                                                 */
441    /*---------------------------------------------------------------------*/
442    /*! \name                   Destructors                                */
443    /*! \{                                                                 */
444
445    virtual ~ImageBase(void);
446
447    /*! \}                                                                 */
448    /*---------------------------------------------------------------------*/
449    /*! \name                     onCreate                                */
450    /*! \{                                                                 */
451
452
453    /*! \}                                                                 */
454    /*---------------------------------------------------------------------*/
455    /*! \name                    Generic Field Access                      */
456    /*! \{                                                                 */
457
458    GetFieldHandlePtr  getHandleParents         (void) const;
459    EditFieldHandlePtr editHandleParents        (void);
460    GetFieldHandlePtr  getHandleDimension       (void) const;
461    EditFieldHandlePtr editHandleDimension      (void);
462    GetFieldHandlePtr  getHandleWidth           (void) const;
463    EditFieldHandlePtr editHandleWidth          (void);
464    GetFieldHandlePtr  getHandleHeight          (void) const;
465    EditFieldHandlePtr editHandleHeight         (void);
466    GetFieldHandlePtr  getHandleDepth           (void) const;
467    EditFieldHandlePtr editHandleDepth          (void);
468    GetFieldHandlePtr  getHandleBpp             (void) const;
469    EditFieldHandlePtr editHandleBpp            (void);
470    GetFieldHandlePtr  getHandleMipMapCount     (void) const;
471    EditFieldHandlePtr editHandleMipMapCount    (void);
472    GetFieldHandlePtr  getHandleFrameCount      (void) const;
473    EditFieldHandlePtr editHandleFrameCount     (void);
474    GetFieldHandlePtr  getHandleFrameDelay      (void) const;
475    EditFieldHandlePtr editHandleFrameDelay     (void);
476    GetFieldHandlePtr  getHandlePixelFormat     (void) const;
477    EditFieldHandlePtr editHandlePixelFormat    (void);
478    GetFieldHandlePtr  getHandlePixel           (void) const;
479    EditFieldHandlePtr editHandlePixel          (void);
480    GetFieldHandlePtr  getHandleFrameSize       (void) const;
481    EditFieldHandlePtr editHandleFrameSize      (void);
482    GetFieldHandlePtr  getHandleName            (void) const;
483    EditFieldHandlePtr editHandleName           (void);
484    GetFieldHandlePtr  getHandleDataType        (void) const;
485    EditFieldHandlePtr editHandleDataType       (void);
486    GetFieldHandlePtr  getHandleComponentSize   (void) const;
487    EditFieldHandlePtr editHandleComponentSize  (void);
488    GetFieldHandlePtr  getHandleSideCount       (void) const;
489    EditFieldHandlePtr editHandleSideCount      (void);
490    GetFieldHandlePtr  getHandleSideSize        (void) const;
491    EditFieldHandlePtr editHandleSideSize       (void);
492    GetFieldHandlePtr  getHandleForceCompressedData (void) const;
493    EditFieldHandlePtr editHandleForceCompressedData(void);
494    GetFieldHandlePtr  getHandleForceAlphaChannel (void) const;
495    EditFieldHandlePtr editHandleForceAlphaChannel(void);
496    GetFieldHandlePtr  getHandleForceColorChannel (void) const;
497    EditFieldHandlePtr editHandleForceColorChannel(void);
498    GetFieldHandlePtr  getHandleForceAlphaBinary (void) const;
499    EditFieldHandlePtr editHandleForceAlphaBinary(void);
500
501    /*! \}                                                                 */
502    /*---------------------------------------------------------------------*/
503    /*! \name                    Field Get                                 */
504    /*! \{                                                                 */
505
506
507                  SFInt32             *editSFComponentSize  (void);
508            const SFInt32             *getSFComponentSize   (void) const;
509
510
511                  Int32               &editComponentSize  (void);
512                  Int32                getComponentSize   (void) const;
513
514    /*! \}                                                                 */
515    /*---------------------------------------------------------------------*/
516    /*! \name                    Field Set                                 */
517    /*! \{                                                                 */
518
519            void setComponentSize  (const Int32 value);
520
521    /*! \}                                                                 */
522    /*---------------------------------------------------------------------*/
523    /*! \name                Ptr MField Set                                */
524    /*! \{                                                                 */
525
526    /*! \}                                                                 */
527    /*---------------------------------------------------------------------*/
528    /*! \name                       Sync                                   */
529    /*! \{                                                                 */
530
531#ifdef OSG_MT_CPTR_ASPECT
532    virtual void execSyncV(      FieldContainer    &oFrom,
533                                 ConstFieldMaskArg  whichField,
534                                 AspectOffsetStore &oOffsets,
535                                 ConstFieldMaskArg  syncMode  ,
536                           const UInt32             uiSyncInfo);
537
538            void execSync (      ImageBase *pFrom,
539                                 ConstFieldMaskArg  whichField,
540                                 AspectOffsetStore &oOffsets,
541                                 ConstFieldMaskArg  syncMode  ,
542                           const UInt32             uiSyncInfo);
543#endif
544
545    /*! \}                                                                 */
546    /*---------------------------------------------------------------------*/
547    /*! \name                       Edit                                   */
548    /*! \{                                                                 */
549
550    /*! \}                                                                 */
551    /*---------------------------------------------------------------------*/
552    /*! \name                     Aspect Create                            */
553    /*! \{                                                                 */
554
555#ifdef OSG_MT_CPTR_ASPECT
556    virtual FieldContainer *createAspectCopy(
557                                    const FieldContainer *pRefAspect) const;
558#endif
559
560    /*! \}                                                                 */
561    /*---------------------------------------------------------------------*/
562    /*! \name                       Edit                                   */
563    /*! \{                                                                 */
564    /*! \}                                                                 */
565    /*---------------------------------------------------------------------*/
566    /*! \name                       Sync                                   */
567    /*! \{                                                                 */
568
569    virtual void resolveLinks(void);
570
571    /*! \}                                                                 */
572    /*==========================  PRIVATE  ================================*/
573
574  private:
575    /*---------------------------------------------------------------------*/
576
577    // prohibit default functions (move to 'public' if you need one)
578    void operator =(const ImageBase &source);
579};
580
581typedef ImageBase *ImageBaseP;
582
583OSG_END_NAMESPACE
584
585#endif /* _OSGIMAGEBASE_H_ */