fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Image / OSGImageBase.h
blob0938cc7c41da50d7b73cf7ea9afa5a7aa2fa861e
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 \*---------------------------------------------------------------------------*/
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 \*****************************************************************************/
54 #ifndef _OSGIMAGEBASE_H_
55 #define _OSGIMAGEBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGAttachmentContainer.h" // Parent
68 #include "OSGFieldContainerFields.h" // Parents type
69 #include "OSGSysFields.h" // Dimension type
70 #include "OSGBaseFields.h" // FrameDelay type
72 #include "OSGImageFields.h"
74 OSG_BEGIN_NAMESPACE
77 class Image;
79 //! \brief Image Base Class.
81 class OSG_SYSTEM_DLLMAPPING ImageBase : public AttachmentContainer
83 public:
85 typedef AttachmentContainer Inherited;
86 typedef AttachmentContainer ParentContainer;
88 typedef Inherited::TypeObject TypeObject;
89 typedef TypeObject::InitPhase InitPhase;
91 OSG_GEN_INTERNALPTR(Image);
93 /*========================== PUBLIC =================================*/
95 public:
97 enum
99 ParentsFieldId = Inherited::NextFieldId,
100 DimensionFieldId = ParentsFieldId + 1,
101 WidthFieldId = DimensionFieldId + 1,
102 HeightFieldId = WidthFieldId + 1,
103 DepthFieldId = HeightFieldId + 1,
104 BppFieldId = DepthFieldId + 1,
105 MipMapCountFieldId = BppFieldId + 1,
106 FrameCountFieldId = MipMapCountFieldId + 1,
107 FrameDelayFieldId = FrameCountFieldId + 1,
108 PixelFormatFieldId = FrameDelayFieldId + 1,
109 PixelFieldId = PixelFormatFieldId + 1,
110 FrameSizeFieldId = PixelFieldId + 1,
111 NameFieldId = FrameSizeFieldId + 1,
112 DataTypeFieldId = NameFieldId + 1,
113 ComponentSizeFieldId = DataTypeFieldId + 1,
114 SideCountFieldId = ComponentSizeFieldId + 1,
115 SideSizeFieldId = SideCountFieldId + 1,
116 ForceCompressedDataFieldId = SideSizeFieldId + 1,
117 ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1,
118 ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1,
119 ForceAlphaBinaryFieldId = ForceColorChannelFieldId + 1,
120 ResXFieldId = ForceAlphaBinaryFieldId + 1,
121 ResYFieldId = ResXFieldId + 1,
122 ResUnitFieldId = ResYFieldId + 1,
123 ClearOnLoadFieldId = ResUnitFieldId + 1,
124 NextFieldId = ClearOnLoadFieldId + 1
127 static const OSG::BitVector ParentsFieldMask =
128 (TypeTraits<BitVector>::One << ParentsFieldId);
129 static const OSG::BitVector DimensionFieldMask =
130 (TypeTraits<BitVector>::One << DimensionFieldId);
131 static const OSG::BitVector WidthFieldMask =
132 (TypeTraits<BitVector>::One << WidthFieldId);
133 static const OSG::BitVector HeightFieldMask =
134 (TypeTraits<BitVector>::One << HeightFieldId);
135 static const OSG::BitVector DepthFieldMask =
136 (TypeTraits<BitVector>::One << DepthFieldId);
137 static const OSG::BitVector BppFieldMask =
138 (TypeTraits<BitVector>::One << BppFieldId);
139 static const OSG::BitVector MipMapCountFieldMask =
140 (TypeTraits<BitVector>::One << MipMapCountFieldId);
141 static const OSG::BitVector FrameCountFieldMask =
142 (TypeTraits<BitVector>::One << FrameCountFieldId);
143 static const OSG::BitVector FrameDelayFieldMask =
144 (TypeTraits<BitVector>::One << FrameDelayFieldId);
145 static const OSG::BitVector PixelFormatFieldMask =
146 (TypeTraits<BitVector>::One << PixelFormatFieldId);
147 static const OSG::BitVector PixelFieldMask =
148 (TypeTraits<BitVector>::One << PixelFieldId);
149 static const OSG::BitVector FrameSizeFieldMask =
150 (TypeTraits<BitVector>::One << FrameSizeFieldId);
151 static const OSG::BitVector NameFieldMask =
152 (TypeTraits<BitVector>::One << NameFieldId);
153 static const OSG::BitVector DataTypeFieldMask =
154 (TypeTraits<BitVector>::One << DataTypeFieldId);
155 static const OSG::BitVector ComponentSizeFieldMask =
156 (TypeTraits<BitVector>::One << ComponentSizeFieldId);
157 static const OSG::BitVector SideCountFieldMask =
158 (TypeTraits<BitVector>::One << SideCountFieldId);
159 static const OSG::BitVector SideSizeFieldMask =
160 (TypeTraits<BitVector>::One << SideSizeFieldId);
161 static const OSG::BitVector ForceCompressedDataFieldMask =
162 (TypeTraits<BitVector>::One << ForceCompressedDataFieldId);
163 static const OSG::BitVector ForceAlphaChannelFieldMask =
164 (TypeTraits<BitVector>::One << ForceAlphaChannelFieldId);
165 static const OSG::BitVector ForceColorChannelFieldMask =
166 (TypeTraits<BitVector>::One << ForceColorChannelFieldId);
167 static const OSG::BitVector ForceAlphaBinaryFieldMask =
168 (TypeTraits<BitVector>::One << ForceAlphaBinaryFieldId);
169 static const OSG::BitVector ResXFieldMask =
170 (TypeTraits<BitVector>::One << ResXFieldId);
171 static const OSG::BitVector ResYFieldMask =
172 (TypeTraits<BitVector>::One << ResYFieldId);
173 static const OSG::BitVector ResUnitFieldMask =
174 (TypeTraits<BitVector>::One << ResUnitFieldId);
175 static const OSG::BitVector ClearOnLoadFieldMask =
176 (TypeTraits<BitVector>::One << ClearOnLoadFieldId);
177 static const OSG::BitVector NextFieldMask =
178 (TypeTraits<BitVector>::One << NextFieldId);
180 typedef MFParentFieldContainerPtr MFParentsType;
181 typedef SFInt32 SFDimensionType;
182 typedef SFInt32 SFWidthType;
183 typedef SFInt32 SFHeightType;
184 typedef SFInt32 SFDepthType;
185 typedef SFInt32 SFBppType;
186 typedef SFInt32 SFMipMapCountType;
187 typedef SFInt32 SFFrameCountType;
188 typedef SFTime SFFrameDelayType;
189 typedef SFUInt32 SFPixelFormatType;
190 typedef MFUInt8 MFPixelType;
191 typedef SFInt32 SFFrameSizeType;
192 typedef SFString SFNameType;
193 typedef SFInt32 SFDataTypeType;
194 typedef SFInt32 SFComponentSizeType;
195 typedef SFInt32 SFSideCountType;
196 typedef SFInt32 SFSideSizeType;
197 typedef SFBool SFForceCompressedDataType;
198 typedef SFBool SFForceAlphaChannelType;
199 typedef SFBool SFForceColorChannelType;
200 typedef SFBool SFForceAlphaBinaryType;
201 typedef SFReal32 SFResXType;
202 typedef SFReal32 SFResYType;
203 typedef SFUInt16 SFResUnitType;
204 typedef SFBool SFClearOnLoadType;
206 /*---------------------------------------------------------------------*/
207 /*! \name Class Get */
208 /*! \{ */
210 static FieldContainerType &getClassType (void);
211 static UInt32 getClassTypeId (void);
212 static UInt16 getClassGroupId(void);
214 /*! \} */
215 /*---------------------------------------------------------------------*/
216 /*! \name FieldContainer Get */
217 /*! \{ */
219 virtual FieldContainerType &getType (void);
220 virtual const FieldContainerType &getType (void) const;
222 virtual UInt32 getContainerSize(void) const;
224 /*! \} */
225 /*---------------------------------------------------------------------*/
226 /*! \name Field Get */
227 /*! \{ */
230 SFInt32 *editSFDimension (void);
231 const SFInt32 *getSFDimension (void) const;
233 SFInt32 *editSFWidth (void);
234 const SFInt32 *getSFWidth (void) const;
236 SFInt32 *editSFHeight (void);
237 const SFInt32 *getSFHeight (void) const;
239 SFInt32 *editSFDepth (void);
240 const SFInt32 *getSFDepth (void) const;
242 SFInt32 *editSFBpp (void);
243 const SFInt32 *getSFBpp (void) const;
245 SFInt32 *editSFMipMapCount (void);
246 const SFInt32 *getSFMipMapCount (void) const;
248 SFInt32 *editSFFrameCount (void);
249 const SFInt32 *getSFFrameCount (void) const;
251 SFTime *editSFFrameDelay (void);
252 const SFTime *getSFFrameDelay (void) const;
254 SFUInt32 *editSFPixelFormat (void);
255 const SFUInt32 *getSFPixelFormat (void) const;
257 MFUInt8 *editMFPixel (void);
258 const MFUInt8 *getMFPixel (void) const;
260 SFInt32 *editSFFrameSize (void);
261 const SFInt32 *getSFFrameSize (void) const;
263 SFString *editSFName (void);
264 const SFString *getSFName (void) const;
266 SFInt32 *editSFDataType (void);
267 const SFInt32 *getSFDataType (void) const;
269 SFInt32 *editSFSideCount (void);
270 const SFInt32 *getSFSideCount (void) const;
272 SFInt32 *editSFSideSize (void);
273 const SFInt32 *getSFSideSize (void) const;
275 SFBool *editSFForceCompressedData(void);
276 const SFBool *getSFForceCompressedData (void) const;
278 SFBool *editSFForceAlphaChannel(void);
279 const SFBool *getSFForceAlphaChannel (void) const;
281 SFBool *editSFForceColorChannel(void);
282 const SFBool *getSFForceColorChannel (void) const;
284 SFBool *editSFForceAlphaBinary(void);
285 const SFBool *getSFForceAlphaBinary (void) const;
287 SFReal32 *editSFResX (void);
288 const SFReal32 *getSFResX (void) const;
290 SFReal32 *editSFResY (void);
291 const SFReal32 *getSFResY (void) const;
293 SFUInt16 *editSFResUnit (void);
294 const SFUInt16 *getSFResUnit (void) const;
296 SFBool *editSFClearOnLoad (void);
297 const SFBool *getSFClearOnLoad (void) const;
300 Int32 &editDimension (void);
301 Int32 getDimension (void) const;
303 Int32 &editWidth (void);
304 Int32 getWidth (void) const;
306 Int32 &editHeight (void);
307 Int32 getHeight (void) const;
309 Int32 &editDepth (void);
310 Int32 getDepth (void) const;
312 Int32 &editBpp (void);
313 Int32 getBpp (void) const;
315 Int32 &editMipMapCount (void);
316 Int32 getMipMapCount (void) const;
318 Int32 &editFrameCount (void);
319 Int32 getFrameCount (void) const;
321 Time &editFrameDelay (void);
322 const Time &getFrameDelay (void) const;
324 UInt32 &editPixelFormat (void);
325 UInt32 getPixelFormat (void) const;
327 MFUInt8 ::reference editPixel (const UInt32 index);
328 UInt8 getPixel (const UInt32 index) const;
330 Int32 &editFrameSize (void);
331 Int32 getFrameSize (void) const;
333 std::string &editName (void);
334 const std::string &getName (void) const;
336 Int32 &editDataType (void);
337 Int32 getDataType (void) const;
339 Int32 &editSideCount (void);
340 Int32 getSideCount (void) const;
342 Int32 &editSideSize (void);
343 Int32 getSideSize (void) const;
345 bool &editForceCompressedData(void);
346 bool getForceCompressedData (void) const;
348 bool &editForceAlphaChannel(void);
349 bool getForceAlphaChannel (void) const;
351 bool &editForceColorChannel(void);
352 bool getForceColorChannel (void) const;
354 bool &editForceAlphaBinary(void);
355 bool getForceAlphaBinary (void) const;
357 Real32 &editResX (void);
358 Real32 getResX (void) const;
360 Real32 &editResY (void);
361 Real32 getResY (void) const;
363 UInt16 &editResUnit (void);
364 UInt16 getResUnit (void) const;
366 bool &editClearOnLoad (void);
367 bool getClearOnLoad (void) const;
369 /*! \} */
370 /*---------------------------------------------------------------------*/
371 /*! \name Field Set */
372 /*! \{ */
374 void setDimension (const Int32 value);
375 void setWidth (const Int32 value);
376 void setHeight (const Int32 value);
377 void setDepth (const Int32 value);
378 void setBpp (const Int32 value);
379 void setMipMapCount (const Int32 value);
380 void setFrameCount (const Int32 value);
381 void setFrameDelay (const Time &value);
382 void setPixelFormat (const UInt32 value);
383 void setFrameSize (const Int32 value);
384 void setName (const std::string &value);
385 void setDataType (const Int32 value);
386 void setSideCount (const Int32 value);
387 void setSideSize (const Int32 value);
388 void setForceCompressedData(const bool value);
389 void setForceAlphaChannel(const bool value);
390 void setForceColorChannel(const bool value);
391 void setForceAlphaBinary(const bool value);
392 void setResX (const Real32 value);
393 void setResY (const Real32 value);
394 void setResUnit (const UInt16 value);
395 void setClearOnLoad (const bool value);
397 /*! \} */
398 /*---------------------------------------------------------------------*/
399 /*! \name Ptr MField Set */
400 /*! \{ */
402 /*! \} */
403 /*---------------------------------------------------------------------*/
404 /*! \name Binary Access */
405 /*! \{ */
407 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
408 virtual void copyToBin (BinaryDataHandler &pMem,
409 ConstFieldMaskArg whichField);
410 virtual void copyFromBin(BinaryDataHandler &pMem,
411 ConstFieldMaskArg whichField);
414 /*! \} */
415 /*---------------------------------------------------------------------*/
416 /*! \name Construction */
417 /*! \{ */
419 static ImageTransitPtr create (void);
420 static Image *createEmpty (void);
422 static ImageTransitPtr createLocal (
423 BitVector bFlags = FCLocal::All);
425 static Image *createEmptyLocal(
426 BitVector bFlags = FCLocal::All);
428 static ImageTransitPtr createDependent (BitVector bFlags);
430 /*! \} */
431 /*---------------------------------------------------------------------*/
432 /*! \name Copy */
433 /*! \{ */
435 virtual FieldContainerTransitPtr shallowCopy (void) const;
436 virtual FieldContainerTransitPtr shallowCopyLocal(
437 BitVector bFlags = FCLocal::All) const;
438 virtual FieldContainerTransitPtr shallowCopyDependent(
439 BitVector bFlags) const;
441 /*! \} */
442 /*========================= PROTECTED ===============================*/
444 protected:
446 static TypeObject _type;
448 static void classDescInserter(TypeObject &oType);
449 static const Char8 *getClassname (void );
451 /*---------------------------------------------------------------------*/
452 /*! \name Fields */
453 /*! \{ */
455 MFParentFieldContainerPtr _mfParents;
456 SFInt32 _sfDimension;
457 SFInt32 _sfWidth;
458 SFInt32 _sfHeight;
459 SFInt32 _sfDepth;
460 SFInt32 _sfBpp;
461 SFInt32 _sfMipMapCount;
462 SFInt32 _sfFrameCount;
463 SFTime _sfFrameDelay;
464 SFUInt32 _sfPixelFormat;
465 MFUInt8 _mfPixel;
466 SFInt32 _sfFrameSize;
467 SFString _sfName;
468 SFInt32 _sfDataType;
469 SFInt32 _sfComponentSize;
470 SFInt32 _sfSideCount;
471 SFInt32 _sfSideSize;
472 SFBool _sfForceCompressedData;
473 SFBool _sfForceAlphaChannel;
474 SFBool _sfForceColorChannel;
475 SFBool _sfForceAlphaBinary;
476 SFReal32 _sfResX;
477 SFReal32 _sfResY;
478 SFUInt16 _sfResUnit;
479 SFBool _sfClearOnLoad;
481 /*! \} */
482 /*---------------------------------------------------------------------*/
483 /*! \name Constructors */
484 /*! \{ */
486 ImageBase(void);
487 ImageBase(const ImageBase &source);
489 /*! \} */
490 /*---------------------------------------------------------------------*/
491 /*! \name Destructors */
492 /*! \{ */
494 virtual ~ImageBase(void);
496 /*! \} */
497 /*---------------------------------------------------------------------*/
498 /*! \name onCreate */
499 /*! \{ */
502 /*! \} */
503 /*---------------------------------------------------------------------*/
504 /*! \name Parent linking */
505 /*! \{ */
507 virtual bool linkParent (FieldContainer * const pParent,
508 UInt16 const childFieldId,
509 UInt16 const parentFieldId);
510 virtual bool unlinkParent(FieldContainer * const pParent,
511 UInt16 const parentFieldId);
513 /*! \} */
514 /*---------------------------------------------------------------------*/
515 /*! \name Generic Field Access */
516 /*! \{ */
518 GetFieldHandlePtr getHandleParents (void) const;
519 EditFieldHandlePtr editHandleParents (void);
520 GetFieldHandlePtr getHandleDimension (void) const;
521 EditFieldHandlePtr editHandleDimension (void);
522 GetFieldHandlePtr getHandleWidth (void) const;
523 EditFieldHandlePtr editHandleWidth (void);
524 GetFieldHandlePtr getHandleHeight (void) const;
525 EditFieldHandlePtr editHandleHeight (void);
526 GetFieldHandlePtr getHandleDepth (void) const;
527 EditFieldHandlePtr editHandleDepth (void);
528 GetFieldHandlePtr getHandleBpp (void) const;
529 EditFieldHandlePtr editHandleBpp (void);
530 GetFieldHandlePtr getHandleMipMapCount (void) const;
531 EditFieldHandlePtr editHandleMipMapCount (void);
532 GetFieldHandlePtr getHandleFrameCount (void) const;
533 EditFieldHandlePtr editHandleFrameCount (void);
534 GetFieldHandlePtr getHandleFrameDelay (void) const;
535 EditFieldHandlePtr editHandleFrameDelay (void);
536 GetFieldHandlePtr getHandlePixelFormat (void) const;
537 EditFieldHandlePtr editHandlePixelFormat (void);
538 GetFieldHandlePtr getHandlePixel (void) const;
539 EditFieldHandlePtr editHandlePixel (void);
540 GetFieldHandlePtr getHandleFrameSize (void) const;
541 EditFieldHandlePtr editHandleFrameSize (void);
542 GetFieldHandlePtr getHandleName (void) const;
543 EditFieldHandlePtr editHandleName (void);
544 GetFieldHandlePtr getHandleDataType (void) const;
545 EditFieldHandlePtr editHandleDataType (void);
546 GetFieldHandlePtr getHandleComponentSize (void) const;
547 EditFieldHandlePtr editHandleComponentSize (void);
548 GetFieldHandlePtr getHandleSideCount (void) const;
549 EditFieldHandlePtr editHandleSideCount (void);
550 GetFieldHandlePtr getHandleSideSize (void) const;
551 EditFieldHandlePtr editHandleSideSize (void);
552 GetFieldHandlePtr getHandleForceCompressedData (void) const;
553 EditFieldHandlePtr editHandleForceCompressedData(void);
554 GetFieldHandlePtr getHandleForceAlphaChannel (void) const;
555 EditFieldHandlePtr editHandleForceAlphaChannel(void);
556 GetFieldHandlePtr getHandleForceColorChannel (void) const;
557 EditFieldHandlePtr editHandleForceColorChannel(void);
558 GetFieldHandlePtr getHandleForceAlphaBinary (void) const;
559 EditFieldHandlePtr editHandleForceAlphaBinary(void);
560 GetFieldHandlePtr getHandleResX (void) const;
561 EditFieldHandlePtr editHandleResX (void);
562 GetFieldHandlePtr getHandleResY (void) const;
563 EditFieldHandlePtr editHandleResY (void);
564 GetFieldHandlePtr getHandleResUnit (void) const;
565 EditFieldHandlePtr editHandleResUnit (void);
566 GetFieldHandlePtr getHandleClearOnLoad (void) const;
567 EditFieldHandlePtr editHandleClearOnLoad (void);
569 /*! \} */
570 /*---------------------------------------------------------------------*/
571 /*! \name Field Get */
572 /*! \{ */
575 SFInt32 *editSFComponentSize (void);
576 const SFInt32 *getSFComponentSize (void) const;
579 Int32 &editComponentSize (void);
580 Int32 getComponentSize (void) const;
582 /*! \} */
583 /*---------------------------------------------------------------------*/
584 /*! \name Field Set */
585 /*! \{ */
587 void setComponentSize (const Int32 value);
589 /*! \} */
590 /*---------------------------------------------------------------------*/
591 /*! \name Ptr MField Set */
592 /*! \{ */
594 /*! \} */
595 /*---------------------------------------------------------------------*/
596 /*! \name Sync */
597 /*! \{ */
599 #ifdef OSG_MT_CPTR_ASPECT
600 virtual void execSyncV( FieldContainer &oFrom,
601 ConstFieldMaskArg whichField,
602 AspectOffsetStore &oOffsets,
603 ConstFieldMaskArg syncMode ,
604 const UInt32 uiSyncInfo);
606 void execSync ( ImageBase *pFrom,
607 ConstFieldMaskArg whichField,
608 AspectOffsetStore &oOffsets,
609 ConstFieldMaskArg syncMode ,
610 const UInt32 uiSyncInfo);
611 #endif
613 /*! \} */
614 /*---------------------------------------------------------------------*/
615 /*! \name Edit */
616 /*! \{ */
618 /*! \} */
619 /*---------------------------------------------------------------------*/
620 /*! \name Aspect Create */
621 /*! \{ */
623 #ifdef OSG_MT_CPTR_ASPECT
624 virtual FieldContainer *createAspectCopy(
625 const FieldContainer *pRefAspect) const;
626 #endif
628 /*! \} */
629 /*---------------------------------------------------------------------*/
630 /*! \name Edit */
631 /*! \{ */
632 /*! \} */
633 /*---------------------------------------------------------------------*/
634 /*! \name Sync */
635 /*! \{ */
637 virtual void resolveLinks(void);
639 /*! \} */
640 /*========================== PRIVATE ================================*/
642 private:
643 /*---------------------------------------------------------------------*/
645 // prohibit default functions (move to 'public' if you need one)
646 void operator =(const ImageBase &source);
649 typedef ImageBase *ImageBaseP;
651 OSG_END_NAMESPACE
653 #endif /* _OSGIMAGEBASE_H_ */