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

DWFPackagePublisher.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 #ifndef _DWFTK_DWF_PACKAGE_PUBLISHER_H
00020 #define _DWFTK_DWF_PACKAGE_PUBLISHER_H
00021 
00022 
00027 
00028 
00029 #ifndef DWFTK_READ_ONLY
00030 
00031 
00032 #include "dwfcore/File.h"
00033 using namespace DWFCore;
00034 
00035 #include "dwf/Toolkit.h"
00036 #include "dwf/package/Section.h"
00037 #include "dwf/package/ObjectDefinitionResource.h"
00038 #include "dwf/package/writer/PackageWriter.h"
00039 #include "dwf/publisher/Image.h"
00040 #include "dwf/publisher/Publisher.h"
00041 #include "dwf/publisher/model/Model.h"
00042 
00043 
00044 namespace DWFToolkit
00045 {
00046 
00063 class DWFPackagePublisher : public DWFToolkitMemory
00064                           , public DWFPublisher
00065                           , public DWFPublishedObject::Visitor
00066                           , public DWFPropertyVisitor
00067                           , public DWFEmbeddedFontVisitor
00068 {
00069 
00070 public:
00071 
00075     static const wchar_t* const kz_NamedView_Default;
00079     static const wchar_t* const kz_PropName_PolygonHandedness;
00083     static const wchar_t* const kz_PropName_UseDefaultLighting;
00087     static const wchar_t* const kz_PropName_UseSilhouetteEdges;
00091     static const wchar_t* const kz_PropName_EdgeColor;
00092 
00096     static const wchar_t* const kz_PropSetName_DefaultView;
00100     static const wchar_t* const kz_PropName_CameraProjection;
00104     static const wchar_t* const kz_PropName_CameraPosition;
00108     static const wchar_t* const kz_PropName_CameraTarget;
00112     static const wchar_t* const kz_PropName_CameraUpVector;
00116     static const wchar_t* const kz_PropName_CameraField;
00117 
00121     static const wchar_t* const kz_PropName_Published_Object;
00125     static const wchar_t* const kz_PropCategory_Hidden;
00126 
00127 public:
00128 
00169     _DWFTK_API
00170     DWFPackagePublisher( const DWFFile&   rDWFFile,
00171                          const DWFString& zPassword                = L"",
00172                          const DWFString& zSourceProductVendor     = L"",
00173                          const DWFString& zSourceProductName       = L"",
00174                          const DWFString& zSourceProductVersion    = L"",
00175                          const DWFString& zPublisherProductVendor  = L"",
00176                          const DWFString& zPublisherProductVersion = L"" )
00177         throw();
00178 
00184     _DWFTK_API
00185     virtual ~DWFPackagePublisher()
00186         throw();
00187 
00194     _DWFTK_API
00195     void publish()
00196         throw( DWFException );
00197 
00201     _DWFTK_API
00202     DWFPublishedObject::Visitor* getPublishedObjectVisitor()
00203         throw( DWFException )
00204     {
00205         return this;
00206     }
00207 
00211     _DWFTK_API
00212     DWFPropertyVisitor* getPropertyVisitor()
00213         throw( DWFException )
00214     {
00215         return this;
00216     }
00217 
00221     _DWFTK_API
00222     DWFEmbeddedFontVisitor* getEmbeddedFontVisitor()
00223         throw( DWFException )
00224     {
00225         return this;
00226     }
00227 
00231     _DWFTK_API
00232     void visitPublishedObject( DWFPublishedObject& rObject )
00233         throw( DWFException );
00234 
00238     _DWFTK_API
00239     void visitProperty( DWFProperty& rProperty )
00240         throw( DWFException );
00241 
00245     _DWFTK_API
00246     void visitPropertyContainer( DWFPropertyContainer& rPropertyContainer )
00247         throw( DWFException );
00248 
00252     _DWFTK_API
00253     void visitEmbeddedFont( const DWFEmbeddedFont& rFont )
00254         throw( DWFException );
00255 
00259     _DWFTK_API
00260     void preprocess( DWFPublishable* pPublishable )
00261         throw( DWFException );
00262 
00263 
00267     _DWFTK_API
00268     void postprocess( DWFPublishable* pPublishable )
00269         throw( DWFException );
00270 
00271 private:
00272 
00273     void _preprocessModel( DWFModel* pW3DModel )
00274         throw( DWFException );
00275 
00276     void _postprocessModel( DWFModel* pW3DModel )
00277         throw( DWFException );
00278 
00279     /***********************************************
00280     void _preprocessGeneric( DWFGeneric* pGeneric )
00281         throw( DWFException );
00282 
00283     void _postprocessGeneric( DWFGeneric* pGeneric )
00284         throw( DWFException );
00285     ***********************************************/
00286 
00287     void _definePublishedObject( DWFPublishedObject&        rPublishedObject,
00288                                  DWFDefinedObject**         ppDefinedObject,
00289                                  DWFDefinedObjectInstance** ppDefinedInstance )
00290         throw( DWFException );
00291 
00292     DWFDefinedObject* _findDefinedObject( DWFPublishedObject& rPublishedObject ) const
00293         throw();
00294 
00295 private:
00296 
00297     unsigned int                        _nModels;
00298 
00299     DWFString                           _zSourceProductVendor;
00300     DWFString                           _zSourceProductName;
00301     DWFString                           _zSourceProductVersion;
00302     DWFString                           _zPublisherProductVendor;
00303     DWFString                           _zPublisherProductVersion;
00304     DWFPackageWriter                    _oPackageWriter;
00305     DWFEmbeddedFont::tList              _oEmbeddedFonts;
00306 
00307     DWFSection*                         _pCurrentSection;
00308     DWFObjectDefinitionResource*        _pCurrentObjectDefinition;
00309 
00310 private:
00311 
00312     DWFPackagePublisher( const DWFPackagePublisher& );
00313     DWFPackagePublisher& operator=( const DWFPackagePublisher& );
00314 };
00315 
00316     //
00317     // required for win32 dll external linkage
00318     //
00319 #ifdef  _DWFCORE_WIN32_SYSTEM
00320 #ifndef DWFTK_STATIC
00321 
00322 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_PolygonHandedness =   L"_PolygonHandedness";
00323 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_UseDefaultLighting =  L"_UseDefaultLighting";
00324 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_UseSilhouetteEdges =  L"_UseSilhouetteEdges";
00325 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_EdgeColor =           L"_EdgeColor";
00326 
00327 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_NamedView_Default =            L"default";
00328 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropSetName_DefaultView =      L"_DefaultView";
00329 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_CameraProjection =    L"_CameraProjection";
00330 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_CameraPosition =      L"_CameraPosition";
00331 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_CameraTarget =        L"_CameraTarget";
00332 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_CameraUpVector =      L"_CameraUpVector";
00333 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_CameraField =         L"_CameraField";
00334 
00335 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropName_Published_Object =    L"_name";
00336 _declspec(selectany) const wchar_t* const DWFPackagePublisher::kz_PropCategory_Hidden =          L"hidden";
00337 
00338 #endif
00339 #endif
00340 
00341 }
00342 
00343 
00344 
00345 #endif
00346 #endif
00347 

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