Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

GraphicResource.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2005 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 
00019 
00020 #ifndef _DWFTK_GRAPHIC_RESOURCE_H
00021 #define _DWFTK_GRAPHIC_RESOURCE_H
00022 
00027 
00028 
00029 #include "dwf/Toolkit.h"
00030 #include "dwf/package/Resource.h"
00031 
00032 namespace DWFToolkit
00033 {
00034 
00044 class DWFGraphicResource : public DWFResource
00045 {
00046 
00047 public:
00048 
00052     typedef enum
00053     {
00054         eNotSpecified,
00055 
00056         eAlwaysInSync,
00057         eAlwaysDifferent,
00058         eDecoupled
00059 
00060     } teOrientation;
00061 
00062 public:
00063 
00076     _DWFTK_API
00077     DWFGraphicResource( DWFPackageReader* pPackageReader )
00078         throw();
00079 
00097     _DWFTK_API
00098     DWFGraphicResource( const DWFString& zTitle,
00099                         const DWFString& zRole,
00100                         const DWFString& zMIME,
00101                         const DWFString& zAuthor = L"",
00102                         const DWFString& zDescription = L"",
00103                         const DWFString& zCreationTime = L"",
00104                         const DWFString& zModificationTime = L"" )
00105         throw();
00106 
00112     _DWFTK_API
00113     virtual ~DWFGraphicResource()
00114         throw();
00115 
00123     _DWFTK_API
00124     bool show() const
00125         throw()
00126     {
00127         return _bShow;
00128     }
00129 
00136     _DWFTK_API
00137     int zOrder() const
00138         throw()
00139     {
00140         return _nZOrder;
00141     }
00142 
00149     _DWFTK_API
00150     const double* const clip() const
00151         throw()
00152     {
00153         return (const double* const)_anClip;
00154     }
00155 
00162     _DWFTK_API
00163     const double* const extents() const
00164         throw()
00165     {
00166         return (const double* const)_anExtents;
00167     }
00168 
00176     _DWFTK_API
00177     const double* const transform() const
00178         throw()
00179     {
00180         return (const double* const)_anTransform;
00181     }
00182 
00186     _DWFTK_API
00187     int effectiveResolution() const
00188         throw()
00189     {
00190         return _nEffectiveResolution;
00191     }
00192 
00199     _DWFTK_API
00200     const DWFString& author() const
00201         throw()
00202     {
00203         return _zAuthor;
00204     }
00205 
00212     _DWFTK_API
00213     const DWFString& description() const
00214         throw()
00215     {
00216         return _zDescription;
00217     }
00218 
00225     _DWFTK_API
00226     const DWFString& creationTime() const
00227         throw()
00228     {
00229         return _zCreationTime;
00230     }
00231 
00238     _DWFTK_API
00239     const DWFString& modificationTime() const
00240         throw()
00241     {
00242         return _zModificationTime;
00243     }
00244 
00251     _DWFTK_API
00252     teOrientation orientation() const
00253         throw()
00254     {
00255         return _eOrientation;
00256     }
00257 
00275     _DWFTK_API
00276     void configureGraphic( const double*    anTransform,
00277                            const double*    anExtents = NULL,
00278                            const double*    anClip = NULL,
00279                            bool             bShow = true,
00280                            int              nZOrder = 0,
00281                            int              nEffectiveResolution = 0,
00282                            teOrientation    eOrientation = eNotSpecified )
00283         throw( DWFException );
00284 
00288     _DWFTK_API
00289     virtual void parseAttributeList( const char** ppAttributeList )
00290         throw( DWFException );
00291 
00292 #ifndef DWFTK_READ_ONLY
00293 
00297     _DWFTK_API
00298     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00299         throw( DWFException );
00300 
00301 #endif
00302 
00303 
00304 protected:
00305 
00306     bool    _bShow;
00307     int     _nZOrder;
00308     double  _anClip[4];
00309     double  _anExtents[4];
00310     double  _anTransform[4][4];
00311     int     _nEffectiveResolution;
00312     
00313     DWFString       _zAuthor;
00314     DWFString       _zDescription;
00315     DWFString       _zCreationTime;
00316     DWFString       _zModificationTime;
00317     teOrientation   _eOrientation;
00318 
00319 private:
00320 
00321     DWFGraphicResource( const DWFGraphicResource& );
00322     DWFGraphicResource& operator=( const DWFGraphicResource& );
00323 };
00324 
00332 class DWFImageResource : public DWFGraphicResource
00333 {
00334 
00335 public:
00336 
00349     _DWFTK_API
00350     DWFImageResource( DWFPackageReader* pPackageReader )
00351         throw();
00352 
00370     _DWFTK_API
00371     DWFImageResource( const DWFString& zTitle,
00372                       const DWFString& zRole,
00373                       const DWFString& zMIME,
00374                       const DWFString& zAuthor = L"",
00375                       const DWFString& zDescription = L"",
00376                       const DWFString& zCreationTime = L"",
00377                       const DWFString& zModificationTime = L"" )
00378         throw();
00379 
00385     _DWFTK_API
00386     virtual ~DWFImageResource()
00387         throw();
00388 
00395     _DWFTK_API
00396     bool scanned() const
00397         throw()
00398     {
00399         return _bScanned;
00400     }
00401 
00410     _DWFTK_API
00411     bool invertColors() const
00412         throw()
00413     {
00414         return _bInvertColors;
00415     }
00416 
00423     _DWFTK_API
00424     unsigned char colorDepth() const
00425         throw()
00426     {
00427         return _nColorDepth;
00428     }
00429 
00438     _DWFTK_API
00439     int scannedResolution() const
00440         throw()
00441     {
00442         return _nScannedResolution;
00443     }
00444 
00452     _DWFTK_API
00453     const double* const originalExtents() const
00454         throw()
00455     {
00456         return (const double* const)_anOriginalExtents;
00457     }
00458 
00473     _DWFTK_API
00474     void configureImage( unsigned char  nColorDepth,
00475                          bool           bInvertColors = false,
00476                          bool           bScannedImage = false,
00477                          int            nScannedResolution = 0,
00478                          const double*  anOriginalExtents = NULL )
00479         throw( DWFException );
00480 
00484     _DWFTK_API
00485     virtual void parseAttributeList( const char** ppAttributeList )
00486         throw( DWFException );
00487 
00488 #ifndef DWFTK_READ_ONLY
00489 
00493    _DWFTK_API
00494      void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00495         throw( DWFException );
00496 
00497 #endif
00498 
00499 
00500 private:
00501 
00502     bool            _bScanned;
00503     bool            _bInvertColors;
00504     unsigned char   _nColorDepth;
00505     int             _nScannedResolution;
00506     double          _anOriginalExtents[4];
00507 
00508 private:
00509 
00510     DWFImageResource( const DWFImageResource& );
00511     DWFImageResource& operator=( const DWFImageResource& );
00512 };
00513 
00514 }
00515 
00516 #endif

Generated on Tue May 17 12:38:50 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1