PageRenderTime 35ms CodeModel.GetById 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.0, BSD-3-Clause
  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. ** This file is automatically generated. **
  42. ** **
  43. ** Any changes made to this file WILL be lost when it is **
  44. ** regenerated, which can become necessary at any time. **
  45. ** **
  46. ** Do not change this file, changes should be done in the derived **
  47. ** class Image
  48. ** **
  49. *****************************************************************************
  50. \*****************************************************************************/
  51. #ifndef _OSGIMAGEBASE_H_
  52. #define _OSGIMAGEBASE_H_
  53. #ifdef __sgi
  54. #pragma once
  55. #endif
  56. #include "OSGConfig.h"
  57. #include "OSGSystemDef.h"
  58. //#include "OSGBaseTypes.h"
  59. #include "OSGAttachmentContainer.h" // Parent
  60. #include "OSGParentFieldContainerFields.h" // Parents type
  61. #include "OSGSysFields.h" // Dimension type
  62. #include "OSGBaseFields.h" // FrameDelay type
  63. #include "OSGImageFields.h"
  64. OSG_BEGIN_NAMESPACE
  65. class Image;
  66. //! \brief Image Base Class.
  67. class OSG_SYSTEM_DLLMAPPING ImageBase : public AttachmentContainer
  68. {
  69. public:
  70. typedef AttachmentContainer Inherited;
  71. typedef AttachmentContainer ParentContainer;
  72. typedef Inherited::TypeObject TypeObject;
  73. typedef TypeObject::InitPhase InitPhase;
  74. OSG_GEN_INTERNALPTR(Image);
  75. /*========================== PUBLIC =================================*/
  76. public:
  77. enum
  78. {
  79. ParentsFieldId = Inherited::NextFieldId,
  80. DimensionFieldId = ParentsFieldId + 1,
  81. WidthFieldId = DimensionFieldId + 1,
  82. HeightFieldId = WidthFieldId + 1,
  83. DepthFieldId = HeightFieldId + 1,
  84. BppFieldId = DepthFieldId + 1,
  85. MipMapCountFieldId = BppFieldId + 1,
  86. FrameCountFieldId = MipMapCountFieldId + 1,
  87. FrameDelayFieldId = FrameCountFieldId + 1,
  88. PixelFormatFieldId = FrameDelayFieldId + 1,
  89. PixelFieldId = PixelFormatFieldId + 1,
  90. FrameSizeFieldId = PixelFieldId + 1,
  91. NameFieldId = FrameSizeFieldId + 1,
  92. DataTypeFieldId = NameFieldId + 1,
  93. ComponentSizeFieldId = DataTypeFieldId + 1,
  94. SideCountFieldId = ComponentSizeFieldId + 1,
  95. SideSizeFieldId = SideCountFieldId + 1,
  96. ForceCompressedDataFieldId = SideSizeFieldId + 1,
  97. ForceAlphaChannelFieldId = ForceCompressedDataFieldId + 1,
  98. ForceColorChannelFieldId = ForceAlphaChannelFieldId + 1,
  99. ForceAlphaBinaryFieldId = ForceColorChannelFieldId + 1,
  100. NextFieldId = ForceAlphaBinaryFieldId + 1
  101. };
  102. static const OSG::BitVector ParentsFieldMask =
  103. (TypeTraits<BitVector>::One << ParentsFieldId);
  104. static const OSG::BitVector DimensionFieldMask =
  105. (TypeTraits<BitVector>::One << DimensionFieldId);
  106. static const OSG::BitVector WidthFieldMask =
  107. (TypeTraits<BitVector>::One << WidthFieldId);
  108. static const OSG::BitVector HeightFieldMask =
  109. (TypeTraits<BitVector>::One << HeightFieldId);
  110. static const OSG::BitVector DepthFieldMask =
  111. (TypeTraits<BitVector>::One << DepthFieldId);
  112. static const OSG::BitVector BppFieldMask =
  113. (TypeTraits<BitVector>::One << BppFieldId);
  114. static const OSG::BitVector MipMapCountFieldMask =
  115. (TypeTraits<BitVector>::One << MipMapCountFieldId);
  116. static const OSG::BitVector FrameCountFieldMask =
  117. (TypeTraits<BitVector>::One << FrameCountFieldId);
  118. static const OSG::BitVector FrameDelayFieldMask =
  119. (TypeTraits<BitVector>::One << FrameDelayFieldId);
  120. static const OSG::BitVector PixelFormatFieldMask =
  121. (TypeTraits<BitVector>::One << PixelFormatFieldId);
  122. static const OSG::BitVector PixelFieldMask =
  123. (TypeTraits<BitVector>::One << PixelFieldId);
  124. static const OSG::BitVector FrameSizeFieldMask =
  125. (TypeTraits<BitVector>::One << FrameSizeFieldId);
  126. static const OSG::BitVector NameFieldMask =
  127. (TypeTraits<BitVector>::One << NameFieldId);
  128. static const OSG::BitVector DataTypeFieldMask =
  129. (TypeTraits<BitVector>::One << DataTypeFieldId);
  130. static const OSG::BitVector ComponentSizeFieldMask =
  131. (TypeTraits<BitVector>::One << ComponentSizeFieldId);
  132. static const OSG::BitVector SideCountFieldMask =
  133. (TypeTraits<BitVector>::One << SideCountFieldId);
  134. static const OSG::BitVector SideSizeFieldMask =
  135. (TypeTraits<BitVector>::One << SideSizeFieldId);
  136. static const OSG::BitVector ForceCompressedDataFieldMask =
  137. (TypeTraits<BitVector>::One << ForceCompressedDataFieldId);
  138. static const OSG::BitVector ForceAlphaChannelFieldMask =
  139. (TypeTraits<BitVector>::One << ForceAlphaChannelFieldId);
  140. static const OSG::BitVector ForceColorChannelFieldMask =
  141. (TypeTraits<BitVector>::One << ForceColorChannelFieldId);
  142. static const OSG::BitVector ForceAlphaBinaryFieldMask =
  143. (TypeTraits<BitVector>::One << ForceAlphaBinaryFieldId);
  144. static const OSG::BitVector NextFieldMask =
  145. (TypeTraits<BitVector>::One << NextFieldId);
  146. typedef MFUnrecParentFieldContainerPtr MFParentsType;
  147. typedef SFInt32 SFDimensionType;
  148. typedef SFInt32 SFWidthType;
  149. typedef SFInt32 SFHeightType;
  150. typedef SFInt32 SFDepthType;
  151. typedef SFInt32 SFBppType;
  152. typedef SFInt32 SFMipMapCountType;
  153. typedef SFInt32 SFFrameCountType;
  154. typedef SFTime SFFrameDelayType;
  155. typedef SFUInt32 SFPixelFormatType;
  156. typedef MFUInt8 MFPixelType;
  157. typedef SFInt32 SFFrameSizeType;
  158. typedef SFString SFNameType;
  159. typedef SFInt32 SFDataTypeType;
  160. typedef SFInt32 SFComponentSizeType;
  161. typedef SFInt32 SFSideCountType;
  162. typedef SFInt32 SFSideSizeType;
  163. typedef SFBool SFForceCompressedDataType;
  164. typedef SFBool SFForceAlphaChannelType;
  165. typedef SFBool SFForceColorChannelType;
  166. typedef SFBool SFForceAlphaBinaryType;
  167. /*---------------------------------------------------------------------*/
  168. /*! \name Class Get */
  169. /*! \{ */
  170. static FieldContainerType &getClassType (void);
  171. static UInt32 getClassTypeId (void);
  172. static UInt16 getClassGroupId(void);
  173. /*! \} */
  174. /*---------------------------------------------------------------------*/
  175. /*! \name FieldContainer Get */
  176. /*! \{ */
  177. virtual FieldContainerType &getType (void);
  178. virtual const FieldContainerType &getType (void) const;
  179. virtual UInt32 getContainerSize(void) const;
  180. /*! \} */
  181. /*---------------------------------------------------------------------*/
  182. /*! \name Field Get */
  183. /*! \{ */
  184. SFInt32 *editSFDimension (void);
  185. const SFInt32 *getSFDimension (void) const;
  186. SFInt32 *editSFWidth (void);
  187. const SFInt32 *getSFWidth (void) const;
  188. SFInt32 *editSFHeight (void);
  189. const SFInt32 *getSFHeight (void) const;
  190. SFInt32 *editSFDepth (void);
  191. const SFInt32 *getSFDepth (void) const;
  192. SFInt32 *editSFBpp (void);
  193. const SFInt32 *getSFBpp (void) const;
  194. SFInt32 *editSFMipMapCount (void);
  195. const SFInt32 *getSFMipMapCount (void) const;
  196. SFInt32 *editSFFrameCount (void);
  197. const SFInt32 *getSFFrameCount (void) const;
  198. SFTime *editSFFrameDelay (void);
  199. const SFTime *getSFFrameDelay (void) const;
  200. SFUInt32 *editSFPixelFormat (void);
  201. const SFUInt32 *getSFPixelFormat (void) const;
  202. MFUInt8 *editMFPixel (void);
  203. const MFUInt8 *getMFPixel (void) const;
  204. SFInt32 *editSFFrameSize (void);
  205. const SFInt32 *getSFFrameSize (void) const;
  206. SFString *editSFName (void);
  207. const SFString *getSFName (void) const;
  208. SFInt32 *editSFDataType (void);
  209. const SFInt32 *getSFDataType (void) const;
  210. SFInt32 *editSFSideCount (void);
  211. const SFInt32 *getSFSideCount (void) const;
  212. SFInt32 *editSFSideSize (void);
  213. const SFInt32 *getSFSideSize (void) const;
  214. SFBool *editSFForceCompressedData(void);
  215. const SFBool *getSFForceCompressedData (void) const;
  216. SFBool *editSFForceAlphaChannel(void);
  217. const SFBool *getSFForceAlphaChannel (void) const;
  218. SFBool *editSFForceColorChannel(void);
  219. const SFBool *getSFForceColorChannel (void) const;
  220. SFBool *editSFForceAlphaBinary(void);
  221. const SFBool *getSFForceAlphaBinary (void) const;
  222. Int32 &editDimension (void);
  223. Int32 getDimension (void) const;
  224. Int32 &editWidth (void);
  225. Int32 getWidth (void) const;
  226. Int32 &editHeight (void);
  227. Int32 getHeight (void) const;
  228. Int32 &editDepth (void);
  229. Int32 getDepth (void) const;
  230. Int32 &editBpp (void);
  231. Int32 getBpp (void) const;
  232. Int32 &editMipMapCount (void);
  233. Int32 getMipMapCount (void) const;
  234. Int32 &editFrameCount (void);
  235. Int32 getFrameCount (void) const;
  236. Time &editFrameDelay (void);
  237. const Time &getFrameDelay (void) const;
  238. UInt32 &editPixelFormat (void);
  239. UInt32 getPixelFormat (void) const;
  240. UInt8 &editPixel (const UInt32 index);
  241. UInt8 getPixel (const UInt32 index) const;
  242. Int32 &editFrameSize (void);
  243. Int32 getFrameSize (void) const;
  244. std::string &editName (void);
  245. const std::string &getName (void) const;
  246. Int32 &editDataType (void);
  247. Int32 getDataType (void) const;
  248. Int32 &editSideCount (void);
  249. Int32 getSideCount (void) const;
  250. Int32 &editSideSize (void);
  251. Int32 getSideSize (void) const;
  252. bool &editForceCompressedData(void);
  253. bool getForceCompressedData (void) const;
  254. bool &editForceAlphaChannel(void);
  255. bool getForceAlphaChannel (void) const;
  256. bool &editForceColorChannel(void);
  257. bool getForceColorChannel (void) const;
  258. bool &editForceAlphaBinary(void);
  259. bool getForceAlphaBinary (void) const;
  260. /*! \} */
  261. /*---------------------------------------------------------------------*/
  262. /*! \name Field Set */
  263. /*! \{ */
  264. void setDimension (const Int32 value);
  265. void setWidth (const Int32 value);
  266. void setHeight (const Int32 value);
  267. void setDepth (const Int32 value);
  268. void setBpp (const Int32 value);
  269. void setMipMapCount (const Int32 value);
  270. void setFrameCount (const Int32 value);
  271. void setFrameDelay (const Time &value);
  272. void setPixelFormat (const UInt32 value);
  273. void setFrameSize (const Int32 value);
  274. void setName (const std::string &value);
  275. void setDataType (const Int32 value);
  276. void setSideCount (const Int32 value);
  277. void setSideSize (const Int32 value);
  278. void setForceCompressedData(const bool value);
  279. void setForceAlphaChannel(const bool value);
  280. void setForceColorChannel(const bool value);
  281. void setForceAlphaBinary(const bool value);
  282. /*! \} */
  283. /*---------------------------------------------------------------------*/
  284. /*! \name Ptr MField Set */
  285. /*! \{ */
  286. /*! \} */
  287. /*---------------------------------------------------------------------*/
  288. /*! \name Binary Access */
  289. /*! \{ */
  290. virtual UInt32 getBinSize (ConstFieldMaskArg whichField);
  291. virtual void copyToBin (BinaryDataHandler &pMem,
  292. ConstFieldMaskArg whichField);
  293. virtual void copyFromBin(BinaryDataHandler &pMem,
  294. ConstFieldMaskArg whichField);
  295. /*! \} */
  296. /*---------------------------------------------------------------------*/
  297. /*! \name Construction */
  298. /*! \{ */
  299. static ImageTransitPtr create (void);
  300. static Image *createEmpty (void);
  301. static ImageTransitPtr createLocal (
  302. BitVector bFlags = FCLocal::All);
  303. static Image *createEmptyLocal(
  304. BitVector bFlags = FCLocal::All);
  305. static ImageTransitPtr createDependent (BitVector bFlags);
  306. /*! \} */
  307. /*---------------------------------------------------------------------*/
  308. /*! \name Copy */
  309. /*! \{ */
  310. virtual FieldContainerTransitPtr shallowCopy (void) const;
  311. virtual FieldContainerTransitPtr shallowCopyLocal(
  312. BitVector bFlags = FCLocal::All) const;
  313. virtual FieldContainerTransitPtr shallowCopyDependent(
  314. BitVector bFlags) const;
  315. /*! \} */
  316. /*========================= PROTECTED ===============================*/
  317. protected:
  318. static TypeObject _type;
  319. static void classDescInserter(TypeObject &oType);
  320. static const Char8 *getClassname (void );
  321. /*---------------------------------------------------------------------*/
  322. /*! \name Fields */
  323. /*! \{ */
  324. MFUnrecParentFieldContainerPtr _mfParents;
  325. SFInt32 _sfDimension;
  326. SFInt32 _sfWidth;
  327. SFInt32 _sfHeight;
  328. SFInt32 _sfDepth;
  329. SFInt32 _sfBpp;
  330. SFInt32 _sfMipMapCount;
  331. SFInt32 _sfFrameCount;
  332. SFTime _sfFrameDelay;
  333. SFUInt32 _sfPixelFormat;
  334. MFUInt8 _mfPixel;
  335. SFInt32 _sfFrameSize;
  336. SFString _sfName;
  337. SFInt32 _sfDataType;
  338. SFInt32 _sfComponentSize;
  339. SFInt32 _sfSideCount;
  340. SFInt32 _sfSideSize;
  341. SFBool _sfForceCompressedData;
  342. SFBool _sfForceAlphaChannel;
  343. SFBool _sfForceColorChannel;
  344. SFBool _sfForceAlphaBinary;
  345. /*! \} */
  346. /*---------------------------------------------------------------------*/
  347. /*! \name Constructors */
  348. /*! \{ */
  349. ImageBase(void);
  350. ImageBase(const ImageBase &source);
  351. /*! \} */
  352. /*---------------------------------------------------------------------*/
  353. /*! \name Destructors */
  354. /*! \{ */
  355. virtual ~ImageBase(void);
  356. /*! \} */
  357. /*---------------------------------------------------------------------*/
  358. /*! \name onCreate */
  359. /*! \{ */
  360. /*! \} */
  361. /*---------------------------------------------------------------------*/
  362. /*! \name Generic Field Access */
  363. /*! \{ */
  364. GetFieldHandlePtr getHandleParents (void) const;
  365. EditFieldHandlePtr editHandleParents (void);
  366. GetFieldHandlePtr getHandleDimension (void) const;
  367. EditFieldHandlePtr editHandleDimension (void);
  368. GetFieldHandlePtr getHandleWidth (void) const;
  369. EditFieldHandlePtr editHandleWidth (void);
  370. GetFieldHandlePtr getHandleHeight (void) const;
  371. EditFieldHandlePtr editHandleHeight (void);
  372. GetFieldHandlePtr getHandleDepth (void) const;
  373. EditFieldHandlePtr editHandleDepth (void);
  374. GetFieldHandlePtr getHandleBpp (void) const;
  375. EditFieldHandlePtr editHandleBpp (void);
  376. GetFieldHandlePtr getHandleMipMapCount (void) const;
  377. EditFieldHandlePtr editHandleMipMapCount (void);
  378. GetFieldHandlePtr getHandleFrameCount (void) const;
  379. EditFieldHandlePtr editHandleFrameCount (void);
  380. GetFieldHandlePtr getHandleFrameDelay (void) const;
  381. EditFieldHandlePtr editHandleFrameDelay (void);
  382. GetFieldHandlePtr getHandlePixelFormat (void) const;
  383. EditFieldHandlePtr editHandlePixelFormat (void);
  384. GetFieldHandlePtr getHandlePixel (void) const;
  385. EditFieldHandlePtr editHandlePixel (void);
  386. GetFieldHandlePtr getHandleFrameSize (void) const;
  387. EditFieldHandlePtr editHandleFrameSize (void);
  388. GetFieldHandlePtr getHandleName (void) const;
  389. EditFieldHandlePtr editHandleName (void);
  390. GetFieldHandlePtr getHandleDataType (void) const;
  391. EditFieldHandlePtr editHandleDataType (void);
  392. GetFieldHandlePtr getHandleComponentSize (void) const;
  393. EditFieldHandlePtr editHandleComponentSize (void);
  394. GetFieldHandlePtr getHandleSideCount (void) const;
  395. EditFieldHandlePtr editHandleSideCount (void);
  396. GetFieldHandlePtr getHandleSideSize (void) const;
  397. EditFieldHandlePtr editHandleSideSize (void);
  398. GetFieldHandlePtr getHandleForceCompressedData (void) const;
  399. EditFieldHandlePtr editHandleForceCompressedData(void);
  400. GetFieldHandlePtr getHandleForceAlphaChannel (void) const;
  401. EditFieldHandlePtr editHandleForceAlphaChannel(void);
  402. GetFieldHandlePtr getHandleForceColorChannel (void) const;
  403. EditFieldHandlePtr editHandleForceColorChannel(void);
  404. GetFieldHandlePtr getHandleForceAlphaBinary (void) const;
  405. EditFieldHandlePtr editHandleForceAlphaBinary(void);
  406. /*! \} */
  407. /*---------------------------------------------------------------------*/
  408. /*! \name Field Get */
  409. /*! \{ */
  410. SFInt32 *editSFComponentSize (void);
  411. const SFInt32 *getSFComponentSize (void) const;
  412. Int32 &editComponentSize (void);
  413. Int32 getComponentSize (void) const;
  414. /*! \} */
  415. /*---------------------------------------------------------------------*/
  416. /*! \name Field Set */
  417. /*! \{ */
  418. void setComponentSize (const Int32 value);
  419. /*! \} */
  420. /*---------------------------------------------------------------------*/
  421. /*! \name Ptr MField Set */
  422. /*! \{ */
  423. /*! \} */
  424. /*---------------------------------------------------------------------*/
  425. /*! \name Sync */
  426. /*! \{ */
  427. #ifdef OSG_MT_CPTR_ASPECT
  428. virtual void execSyncV( FieldContainer &oFrom,
  429. ConstFieldMaskArg whichField,
  430. AspectOffsetStore &oOffsets,
  431. ConstFieldMaskArg syncMode ,
  432. const UInt32 uiSyncInfo);
  433. void execSync ( ImageBase *pFrom,
  434. ConstFieldMaskArg whichField,
  435. AspectOffsetStore &oOffsets,
  436. ConstFieldMaskArg syncMode ,
  437. const UInt32 uiSyncInfo);
  438. #endif
  439. /*! \} */
  440. /*---------------------------------------------------------------------*/
  441. /*! \name Edit */
  442. /*! \{ */
  443. /*! \} */
  444. /*---------------------------------------------------------------------*/
  445. /*! \name Aspect Create */
  446. /*! \{ */
  447. #ifdef OSG_MT_CPTR_ASPECT
  448. virtual FieldContainer *createAspectCopy(
  449. const FieldContainer *pRefAspect) const;
  450. #endif
  451. /*! \} */
  452. /*---------------------------------------------------------------------*/
  453. /*! \name Edit */
  454. /*! \{ */
  455. /*! \} */
  456. /*---------------------------------------------------------------------*/
  457. /*! \name Sync */
  458. /*! \{ */
  459. virtual void resolveLinks(void);
  460. /*! \} */
  461. /*========================== PRIVATE ================================*/
  462. private:
  463. /*---------------------------------------------------------------------*/
  464. // prohibit default functions (move to 'public' if you need one)
  465. void operator =(const ImageBase &source);
  466. };
  467. typedef ImageBase *ImageBaseP;
  468. OSG_END_NAMESPACE
  469. #endif /* _OSGIMAGEBASE_H_ */