GraphicResource.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 1996-2006 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 #include "dwf/package/CoordinateSystem.h"
00032 
00033 namespace DWFToolkit
00034 {
00035 
00045 class DWFGraphicResource : public DWFResource
00046                            _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00047 {
00048 
00049 public:
00050 
00054     typedef DWFOrderedVector<DWFGraphicResource*>                                   tList;
00058     typedef DWFIterator<DWFGraphicResource*>                                        tIterator;
00062     typedef DWFConstIterator<DWFGraphicResource*>                                   tConstIterator;
00066     typedef DWFCachingIterator<DWFGraphicResource*>                                 tCachingIterator;
00067 
00072     typedef enum teOrientation
00073     {
00074         eNotSpecified,
00075 
00076         eAlwaysInSync,
00077         eAlwaysDifferent,
00078         eDecoupled
00079 
00080     } teOrientation;
00081 
00082 public:
00083 
00096     _DWFTK_API
00097     DWFGraphicResource( DWFPackageReader* pPackageReader )
00098         throw();
00099 
00117     _DWFTK_API
00118     DWFGraphicResource( const DWFString& zTitle,
00119                         const DWFString& zRole,
00120                         const DWFString& zMIME,
00121                         const DWFString& zAuthor = /*NOXLATE*/L"",
00122                         const DWFString& zDescription = /*NOXLATE*/L"",
00123                         const DWFString& zCreationTime = /*NOXLATE*/L"",
00124                         const DWFString& zModificationTime = /*NOXLATE*/L"" )
00125         throw();
00126 
00132     _DWFTK_API
00133     virtual ~DWFGraphicResource()
00134         throw();
00135 
00143     _DWFTK_API
00144     bool show() const
00145         throw()
00146     {
00147         return _bShow;
00148     }
00149 
00156     _DWFTK_API
00157     int zOrder() const
00158         throw()
00159     {
00160         return _nZOrder;
00161     }
00162 
00169     _DWFTK_API
00170     const double* const clip() const
00171         throw()
00172     {
00173         return (const double* const)_anClip;
00174     }
00175 
00182     _DWFTK_API
00183     const double* const extents() const
00184         throw()
00185     {
00186         return (const double* const)_anExtents;
00187     }
00188 
00196     _DWFTK_API
00197     const double* const transform() const
00198         throw()
00199     {
00200         return (const double* const)_anTransform;
00201     }
00202 
00206     _DWFTK_API
00207     int effectiveResolution() const
00208         throw()
00209     {
00210         return _nEffectiveResolution;
00211     }
00212 
00219     _DWFTK_API
00220     const DWFString& author() const
00221         throw()
00222     {
00223         return _zAuthor;
00224     }
00225 
00231     _DWFTK_API
00232     void setAuthor(const DWFString& zAuthor)
00233         throw()
00234     {
00235         _zAuthor = zAuthor;
00236     }
00237 
00244     _DWFTK_API
00245     const DWFString& description() const
00246         throw()
00247     {
00248         return _zDescription;
00249     }
00250 
00256     _DWFTK_API
00257     void setDescription(const DWFString& zDescription)
00258         throw()
00259     {
00260         _zDescription = zDescription;
00261     }
00262 
00269     _DWFTK_API
00270     const DWFString& creationTime() const
00271         throw()
00272     {
00273         return _zCreationTime;
00274     }
00275 
00281     _DWFTK_API
00282     void setCreationTime(const DWFString& zCreationTime)
00283         throw()
00284     {
00285         _zCreationTime = zCreationTime;
00286     }
00287 
00294     _DWFTK_API
00295     const DWFString& modificationTime() const
00296         throw()
00297     {
00298         return _zModificationTime;
00299     }
00300 
00306     _DWFTK_API
00307     void setModificationTime(const DWFString& zModificationTime)
00308         throw()
00309     {
00310         _zModificationTime = zModificationTime;
00311     }
00312 
00322     _DWFTK_API
00323     void addCoordinateSystem(DWFCoordinateSystem* pCS)
00324         throw()
00325     {
00326         _oCSs.insert( pCS );
00327     }
00328 
00339     _DWFTK_API
00340     virtual DWFCoordinateSystem::tList::Iterator* getCoordinateSystems( )
00341         throw()
00342     {
00343         return _oCSs.iterator();
00344     }
00345 
00354     _DWFTK_API
00355     virtual void removeCoordinateSystem( DWFCoordinateSystem* pCS,
00356                              bool                               bDelete )
00357         throw( DWFException )
00358     {
00359         _oCSs.erase(pCS);
00360         
00361         if (bDelete)
00362         {
00363             DWFCORE_FREE_OBJECT(pCS);
00364         }
00365     }
00366 
00373     _DWFTK_API
00374     teOrientation orientation() const
00375         throw()
00376     {
00377         return _eOrientation;
00378     }
00379 
00397     _DWFTK_API
00398     void configureGraphic( const double*    anTransform,
00399                            const double*    anExtents = NULL,
00400                            const double*    anClip = NULL,
00401                            bool             bShow = true,
00402                            int              nZOrder = 0,
00403                            int              nEffectiveResolution = 0,
00404                            teOrientation    eOrientation = eNotSpecified )
00405         throw( DWFException );
00406 
00410     _DWFTK_API
00411     virtual void parseAttributeList( const char** ppAttributeList )
00412         throw( DWFException );
00413 
00414 #ifndef DWFTK_READ_ONLY
00415 
00419     _DWFTK_API
00420     virtual void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00421         throw( DWFException );
00422 
00423 #endif
00424 
00425 
00426 protected:
00427 
00428     bool    _bShow;
00429     int     _nZOrder;
00430     double  _anClip[4];
00431     double  _anExtents[4];
00432     double  _anTransform[4][4];
00433     int     _nEffectiveResolution;
00434     
00435     DWFString                       _zAuthor;
00436     DWFString                       _zDescription;
00437     DWFString                       _zCreationTime;
00438     DWFString                       _zModificationTime;
00439     teOrientation                   _eOrientation;
00440     DWFCoordinateSystem::tList      _oCSs;
00441 
00442 private:
00443 
00444     DWFGraphicResource( const DWFGraphicResource& );
00445     DWFGraphicResource& operator=( const DWFGraphicResource& );
00446 };
00447 
00455 class DWFImageResource : public DWFGraphicResource
00456                          _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00457 {
00458 
00459 public:
00460 
00473     _DWFTK_API
00474     DWFImageResource( DWFPackageReader* pPackageReader )
00475         throw();
00476 
00494     _DWFTK_API
00495     DWFImageResource( const DWFString& zTitle,
00496                       const DWFString& zRole,
00497                       const DWFString& zMIME,
00498                       const DWFString& zAuthor = /*NOXLATE*/L"",
00499                       const DWFString& zDescription = /*NOXLATE*/L"",
00500                       const DWFString& zCreationTime = /*NOXLATE*/L"",
00501                       const DWFString& zModificationTime = /*NOXLATE*/L"" )
00502         throw();
00503 
00509     _DWFTK_API
00510     virtual ~DWFImageResource()
00511         throw();
00512 
00519     _DWFTK_API
00520     bool scanned() const
00521         throw()
00522     {
00523         return _bScanned;
00524     }
00525 
00534     _DWFTK_API
00535     bool invertColors() const
00536         throw()
00537     {
00538         return _bInvertColors;
00539     }
00540 
00547     _DWFTK_API
00548     unsigned char colorDepth() const
00549         throw()
00550     {
00551         return _nColorDepth;
00552     }
00553 
00562     _DWFTK_API
00563     int scannedResolution() const
00564         throw()
00565     {
00566         return _nScannedResolution;
00567     }
00568 
00576     _DWFTK_API
00577     const double* const originalExtents() const
00578         throw()
00579     {
00580         return (const double* const)_anOriginalExtents;
00581     }
00582 
00597     _DWFTK_API
00598     void configureImage( unsigned char  nColorDepth,
00599                          bool           bInvertColors = false,
00600                          bool           bScannedImage = false,
00601                          int            nScannedResolution = 0,
00602                          const double*  anOriginalExtents = NULL )
00603         throw( DWFException );
00604 
00608     _DWFTK_API
00609     virtual void parseAttributeList( const char** ppAttributeList )
00610         throw( DWFException );
00611 
00612 #ifndef DWFTK_READ_ONLY
00613 
00617    _DWFTK_API
00618      void serializeXML( DWFXMLSerializer& rSerializer, unsigned int nFlags )
00619         throw( DWFException );
00620 
00621 #endif
00622 
00623 
00624 private:
00625 
00626     bool            _bScanned;
00627     bool            _bInvertColors;
00628     unsigned char   _nColorDepth;
00629     int             _nScannedResolution;
00630     double          _anOriginalExtents[4];
00631 
00632 private:
00633 
00634     DWFImageResource( const DWFImageResource& );
00635     DWFImageResource& operator=( const DWFImageResource& );
00636 };
00637 
00638 }
00639 
00640 #endif

Generated on Tue Jan 6 22:40:03 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5