ContentPresentationReader.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 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_CONTENT_PRESENTATION_READER_H
00021 #define _DWFTK_CONTENT_PRESENTATION_READER_H
00022 
00023 
00028 
00029 #include "dwfcore/Core.h"
00030 #include "dwfcore/STL.h"
00031 #include "dwfcore/XML.h"
00032 using namespace DWFCore;
00033 
00034 #include "dwf/package/XML.h"
00035 #include "dwf/package/reader/PackageReader.h"
00036 #include "dwf/presentation/utility/ContentPresentationContainer.h"
00037 #include "dwf/presentation/ContentPresentationModelViewNode.h"
00038 
00039 
00040 namespace DWFToolkit
00041 {
00042 
00058 class DWFContentPresentationReader : public DWFCore::DWFXMLCallback
00059                                     _DWFTK_EXPORT_API_MEMORY_CONTROL_BASE_MEMBER
00060 {
00061 public:
00069     typedef enum
00070     {
00074         eProvideNone                =   0x00,
00075 
00079         eProvideVersion             =   0x01,
00080 
00084         eProvidePresentations       =   0x02,
00088         eProvideViews               =   0x04,
00092         eProvidePropertyReferences  =   0x08,
00096         eProvideNodes               =   0x10,
00100         eProvideRefereceNodes       =   0x20,
00104         eProvideModelViewNodes      =   0x40,
00105 
00109         eProvideAttributes          =   0x01,
00113         eProvideElements            =   0x7E,
00114 
00118         eProvideAll                 =   0xFF
00119 
00120     } teProviderType;
00121 
00129     _DWFTK_API
00130     DWFContentPresentationReader( DWFPackageReader* pPackageReader = NULL,
00131                                   unsigned char     nProviderFlags = eProvideAll )
00132         throw();
00133 
00139     _DWFTK_API
00140     virtual ~DWFContentPresentationReader()
00141         throw();
00142 
00143         //
00144         //
00145         // Provider callbacks for known attributes of the Manifest
00146         //
00147         //
00148 
00149     //
00150     //
00151     //
00152     _DWFTK_API
00153     DWFContentPresentationReader* filter() const
00154         throw();
00155 
00156     //
00157     //
00158     //
00159     _DWFTK_API
00160     void setFilter( DWFContentPresentationReader* pFilter )
00161         throw();
00162 
00170     _DWFTK_API
00171     virtual double provideVersion( double nVersion)
00172         throw();
00173 
00182     _DWFTK_API
00183     virtual DWFContentPresentation* providePresentation( DWFContentPresentation* pPresentation )
00184         throw();
00185 
00194     _DWFTK_API
00195     virtual DWFContentPresentationView* provideView( DWFContentPresentationView* pView )
00196         throw();
00197 
00206     _DWFTK_API
00207     virtual DWFPropertyReference* providePropertyReference( DWFPropertyReference* pPropertyReference )
00208         throw();
00209 
00218     _DWFTK_API
00219     virtual DWFContentPresentationNode* provideNode( DWFContentPresentationNode* pNode )
00220         throw();
00221 
00230     _DWFTK_API
00231     virtual DWFContentPresentationReferenceNode* provideReferenceNode( DWFContentPresentationReferenceNode* pReferenceNode )
00232         throw();
00233 
00242     _DWFTK_API
00243     virtual DWFContentPresentationModelViewNode* provideModelViewNode( DWFContentPresentationModelViewNode* pModelViewNode )
00244         throw();
00245 
00249     _DWFTK_API
00250     void notifyStartElement( const char*   zName,
00251                              const char**  ppAttributeList )
00252         throw();
00253 
00257     _DWFTK_API
00258     void notifyEndElement( const char*     zName )
00259         throw();
00260 
00264     _DWFTK_API
00265     void notifyStartNamespace( const char* zPrefix,
00266                                const char* zURI )
00267         throw();
00268 
00272     _DWFTK_API
00273     void notifyEndNamespace( const char*   zPrefix )
00274         throw();
00275 
00279     _DWFTK_API
00280     void notifyCharacterData( const char* zCData, 
00281                               int         nLength ) 
00282         throw();
00283 
00284 protected:
00285 
00289     DWFPackageReader* _pPackageReader;
00290 
00295     DWFXMLElementBuilder        _oDefaultElementBuilder;
00296 
00302     DWFXMLElementBuilder*       _pElementBuilder;
00303 
00304 private:
00305 
00306     unsigned char _nProviderFlags;
00307     unsigned char _nCurrentCollectionProvider;
00308 
00309     DWFContentPresentationReader* _pReaderFilter;
00310 
00311     DWFContentPresentation*                             _pCurrentPresentation;
00312 
00313     DWFContentPresentationView*                         _pCurrentPresentationView;
00314 
00315     DWFPropertyReference*                               _pCurrentPropertyReference;
00316 
00317     DWFContentPresentationNodeContainer*                _pCurrentNodeContainer;
00318     _DWFTK_STD_VECTOR(DWFContentPresentationNodeContainer*) _oNodeContainerStack;
00319 
00320     DWFContentPresentationNode*                         _pCurrentNode;
00321 
00322     int                                                 _nCurrentCuttingPlanesCount;
00323     float *                                             _pCurrentCuttingPlanes;
00324     float *                                             _pCurrentCuttingPlanesInteriorPointer;
00325 
00326     DWFModelSceneChangeHandler*                         _pCurrentHandler;
00327 private:
00328 
00329     void _provideVersion( double nVersion)
00330         throw();
00331 
00332     void _providePresentation( DWFContentPresentation* pPresentation )
00333         throw();
00334 
00335     DWFContentPresentationView* _provideView( DWFContentPresentationView* pView )
00336         throw();
00337 
00338     DWFPropertyReference* _providePropertyReference( DWFPropertyReference* pPropertyReference )
00339         throw();
00340 
00341     DWFContentPresentationNode* _provideNode( DWFContentPresentationNode* pNode )
00342         throw();
00343 
00344     DWFContentPresentationReferenceNode* _provideReferenceNode( DWFContentPresentationReferenceNode* pReferenceNode )
00345         throw();
00346 
00347     DWFContentPresentationModelViewNode* _provideModelViewNode( DWFContentPresentationModelViewNode* pModelViewNode )
00348         throw();
00349 
00350     void _getAttribute( const char**  ppAttributeList, const char * pAttrName, const char * &rpAttrValue );
00351 
00352     //
00353     // Not implemented
00354     //
00355 
00356     DWFContentPresentationReader( const DWFContentPresentationReader& );
00357     DWFContentPresentationReader& operator=( const DWFContentPresentationReader& );
00358 };
00359 
00360 }
00361 
00362 #endif

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