- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# importexport.h

Go to the documentation of this file.

    00001
    00002 //**************************************************************************/
    00003 // Copyright (c) 2008 Autodesk, Inc.
    00004 // All rights reserved.
    00005 //
    00006 // Use of this software is subject to the terms of the Autodesk license
    00007 // agreement provided at the time of installation or download, or which
    00008 // otherwise accompanies this software in either electronic or hard copy form.
    00009 //
    00010 //**************************************************************************/
    00011 // DESCRIPTION:
    00012 // CREATED: October 2008
    00013 //**************************************************************************/
    00014
    00015 namespace mudbox {
    00016
    00018 class MBDLL_DECL FileExtension
    00019 {
    00020 public:
    00021     enum Flags
    00022     {
    00023         flagNoTextureCoordinates = 1,
    00024         flagNoVertexColors = 2,
    00025         flagNoVertexNormals = 4
    00026     };
    00027
    00028 private:
    00029     QString m_sExtension;
    00030     QString m_sDescription;
    00031     enum Image::Format m_eImageFormat;
    00032     enum Flags m_eFlags;
    00033
    00034 public:
    00035     FileExtension( void ) {};
    00036     FileExtension( const QString & sExtension, const QString & sDescription, enum Image::Format eImageFormat = Image::eUnknown );
    00037     FileExtension( const QString & sExtension, const QString & sDescription, enum Flags eFlags );
    00038     FileExtension( const FileExtension & );
    00039     QString Extension( void ) const { return m_sExtension; }
    00040     QString Description( void ) const { return m_sDescription; }
    00041     enum Image::Format ImageFormat( void ) const { return m_eImageFormat; }
    00042     enum Flags Flags( void ) { return m_eFlags; };
    00043 };
    00044
    00058 class MBDLL_DECL Importer : public Node
    00059 {
    00060     DECLARE_CLASS;
    00061
    00065     virtual ~Importer();
    00066
    00071     virtual QString Extension( void ) const;
    00072
    00077     virtual QString Description( void ) const;
    00078
    00082     virtual QVector<FileExtension> SupportedExtensions( void ) const;
    00083
    00085     virtual bool IsSupported( const QString & sExtension ) const;
    00086
    00092     virtual void Import(
    00093         const QString &sFileName,
    00094         Scene::LoadData &cData
    00095         );
    00096
    00103     virtual Scene* SceneCreatedByImporter();
    00104
    00108     void AddMesh( Mesh* pMesh );
    00109
    00110 protected:
    00111
    00115     Importer();
    00116
    00120     aptr<Scene> m_pScene;
    00121 };
    00122
    00133 class MBDLL_DECL Exporter : public Node
    00134 {
    00135     DECLARE_CLASS;
    00136
    00141     virtual QString Extension( void ) const;
    00142
    00147     virtual QString Description( void ) const;
    00148
    00152     virtual QVector<FileExtension> SupportedExtensions( void ) const;
    00153
    00155     virtual bool IsSupported( const QString & sExtension ) const;
    00156
    00161     virtual void Export(
    00162         const QString &sFileName,
    00163         const QString &sFormat = QString()
    00164         );
    00165
    00167     virtual void SetMeshCount(
    00168         unsigned int iMeshCount
    00169         );
    00170
    00175     virtual void SetMesh(
    00176         unsigned int iIndex,
    00177         const Mesh *pMesh
    00178         );
    00179 };
    00180
    00185 class MBDLL_DECL ImageIOHandler : public Node
    00186 {
    00187     DECLARE_CLASS;
    00188
    00189 public:
    00191     const QString &ImageName( void );
    00193     const QString &ImageDescription( void );
    00194
    00197     virtual bool Import(const QString &sFileName, mudbox::Image *pImage);
    00200     virtual bool Export(const QString &sFileName, mudbox::Image *pImage);
    00201
    00204     const QList<FileExtension> &SupportedExtensions( void );
    00206     const QList<mudbox::PixelDescriptor> &SupportedFormats( void );
    00207
    00208 protected:
    00210     QString m_sImageName;
    00211
    00213     QString m_sImageDescription;
    00214
    00216     QList<FileExtension> m_aExtensions;
    00217
    00219     QList<class mudbox::PixelDescriptor> m_aFormats;
    00220 };
    00221
    00226 class MBDLL_DECL PaintLayerImporter : public Node
    00227 {
    00228     DECLARE_CLASS;
    00229
    00231     virtual QVector<FileExtension> SupportedExtensions( void ) const;
    00232
    00234     virtual bool Prepare(
    00235         const QString &sFileName,
    00236         Mesh *pMesh,
    00237         bool bAsMask = false,
    00238         bool bSilentMode = false
    00239         );
    00241     virtual bool Import(
    00242         const QString &sFileName,
    00243         int iFileTypeIndex,
    00244         Mesh *pMesh,
    00245         TexturePool *pTarget
    00246         );
    00247 };
    00248
    00254 class MBDLL_DECL PaintLayerExporter : public Node
    00255 {
    00256     DECLARE_CLASS;
    00257
    00259     virtual QVector<FileExtension> SupportedExtensions( void ) const;
    00261     virtual void Export(
    00262         const QString &sFileName,
    00263         int iFileTypeIndex,
    00264         const Mesh *pSourceSurface,
    00265         TexturePool *pSource
    00266         );
    00267 };
    00268
    00269 }; // end of namespace mudbox