Mudbox/importexport.h Source File

importexport.h
Go to the documentation of this file.
1 
2 //**************************************************************************/
3 // Copyright (c) 2008 Autodesk, Inc.
4 // All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Autodesk license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 //
10 //**************************************************************************/
11 // DESCRIPTION:
12 // CREATED: October 2008
13 //**************************************************************************/
14 
15 namespace mudbox {
16 
19 {
20 public:
21  enum Flags
22  {
23  flagNoTextureCoordinates = 1,
24  flagNoVertexColors = 2,
25  flagNoVertexNormals = 4
26  };
27 
28 private:
29  QString m_sExtension;
30  QString m_sDescription;
31  enum Image::Format m_eImageFormat;
32  enum Flags m_eFlags;
33 
34 public:
35  FileExtension( void ) {};
36  FileExtension( const QString & sExtension, const QString & sDescription, enum Image::Format eImageFormat = Image::eUnknown );
37  FileExtension( const QString & sExtension, const QString & sDescription, enum Flags eFlags );
38  FileExtension( const FileExtension & );
39  QString Extension( void ) const { return m_sExtension; }
40  QString Description( void ) const { return m_sDescription; }
41  enum Image::Format ImageFormat( void ) const { return m_eImageFormat; }
42  enum Flags Flags( void ) { return m_eFlags; };
43 };
44 
58 class MBDLL_DECL Importer : public Node
59 {
61 
65  virtual ~Importer();
66 
71  virtual QString Extension( void ) const;
72 
77  virtual QString Description( void ) const;
78 
82  virtual QVector<FileExtension> SupportedExtensions( void ) const;
83 
85  virtual bool IsSupported( const QString & sExtension ) const;
86 
92  virtual void Import(
93  const QString &sFileName,
94  Scene::LoadData &cData
95  );
96 
103  virtual Scene* SceneCreatedByImporter();
104 
108  void AddMesh( Mesh* pMesh );
109 
110 protected:
111 
115  Importer();
116 
120  aptr<Scene> m_pScene;
121 };
122 
133 class MBDLL_DECL Exporter : public Node
134 {
136 
141  virtual QString Extension( void ) const;
142 
147  virtual QString Description( void ) const;
148 
152  virtual QVector<FileExtension> SupportedExtensions( void ) const;
153 
155  virtual bool IsSupported( const QString & sExtension ) const;
156 
161  virtual void Export(
162  const QString &sFileName,
163  const QString &sFormat = QString()
164  );
165 
167  virtual void SetMeshCount(
168  unsigned int iMeshCount
169  );
170 
175  virtual void SetMesh(
176  unsigned int iIndex,
177  const Mesh *pMesh
178  );
179 };
180 
186 {
188 
189 public:
191  const QString &ImageName( void );
193  const QString &ImageDescription( void );
194 
197  virtual mudbox::Image *Import(const QString &sFileName);
200  virtual bool Import(const QString &sFileName, mudbox::Image *pImage);
203  virtual bool Export(const QString &sFileName, mudbox::Image *pImage);
204 
207  const QList<FileExtension> &SupportedExtensions( void );
209  const QList<mudbox::PixelDescriptor> &SupportedFormats( void );
210 
211 protected:
214 
217 
220 
223 };
224 
230 {
232 
234  virtual QVector<FileExtension> SupportedExtensions( void ) const;
235 
237  virtual bool Prepare(
238  const QString &sFileName,
239  Mesh *pMesh,
240  bool bAsMask = false,
241  bool bSilentMode = false
242  );
244  virtual bool Import(
245  const QString &sFileName,
246  int iFileTypeIndex,
247  Mesh *pMesh,
248  TexturePool *pTarget
249  );
250 };
251 
258 {
260 
262  virtual QVector<FileExtension> SupportedExtensions( void ) const;
264  virtual void Export(
265  const QString &sFileName,
266  int iFileTypeIndex,
267  const Mesh *pSourceSurface,
268  TexturePool *pSource
269  );
270 };
271 
272 }; // end of namespace mudbox
A Mesh is a collection of vertices organized into faces, and optional Texture Coordinate information...
Definition: mesh.h:452
The Scene class is the container object for all the data in a Mudbox scene.
Definition: scene.h:53
This is a container class for simple textures.
Definition: material.h:467
Format
Image channel datatype type.
Definition: image.h:1522
This is the base class for most classes in the Mudbox SDK.
Definition: node.h:740
This class is the base class for external Image handlers.
Definition: importexport.h:185
This class is the base class for plugins that import geometry into Mudbox.
Definition: importexport.h:58
aptr< Scene > m_pScene
Do not access this variable directly.
Definition: importexport.h:120
This class is the base class for plugins that export mesh geometry from Mudbox.
Definition: importexport.h:133
This class encapsulates the file extension information for importers & exporeters.
Definition: importexport.h:18
QString Extension(void) const
Definition: importexport.h:39
QList< class mudbox::PixelDescriptor > m_aFormats
List of formats supported by this image type. To be set by derived class.
Definition: importexport.h:222
Class: ConvolutionKernel.
Definition: array.h:15
This class is the base class for paint layer importers.
Definition: importexport.h:229
QString m_sImageDescription
Short one sentence description of the image. To be set by derived class.
Definition: importexport.h:216
QString Description(void) const
Definition: importexport.h:40
Data structure to hold file import/load options, and diagnostic data.
Definition: scene.h:71
#define DECLARE_CLASS
This macro should be used in declaration of classes which are inherited from the Node class (or any d...
Definition: node.h:91
This is the base image type defining the interface to images.
Definition: image.h:1504
QList< FileExtension > m_aExtensions
List of extensions used by this image type. To be set by derived class.
Definition: importexport.h:219
#define MBDLL_DECL
Definition: dllinterface.h:35
This class is the base class for exporting paint layers.
Definition: importexport.h:257
QString m_sImageName
Name of the image. To be set by derived class.
Definition: importexport.h:213