FBX C++ API Reference
fbxwriter.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_FILEIO_WRITER_H_
14 #define _FBXSDK_FILEIO_WRITER_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
22 class FbxStatus;
23 class FbxManager;
24 class FbxFile;
25 class FbxStream;
26 class FbxObject;
27 class FbxDocument;
28 class FbxScene;
29 class FbxExporter;
30 class FbxIO;
31 class FbxIOSettings;
32 class FbxProgress;
33 
34 #define IOSP GetIOSettings()
35 
59 {
60 public:
66  FbxWriter(FbxManager& pManager, int pID, FbxStatus& pStatus);
67 
69  virtual ~FbxWriter();
70 
75  {
81  eReserved1 = 0xFBFB,
82  };
83 
85  typedef FbxWriter* (*CreateFuncType)(FbxManager& pManager, FbxExporter& pExporter, int pSubID, int pPluginID);
86 
88  typedef void (*IOSettingsFillerFuncType)(FbxIOSettings& pIOS);
89 
91  typedef void* (*GetInfoFuncType)(EInfoRequest pRequest, int pWriterTypeId);
92 
96  virtual bool FileCreate(char* pFileName) = 0;
97 
102  virtual bool FileCreate(FbxStream* pStream, void* pStreamData);
103 
106  virtual bool FileClose() = 0;
107 
110  virtual bool IsFileOpen() = 0;
111 
114  virtual void GetWriteOptions() = 0;
115 
119  virtual bool Write(FbxDocument* pDocument) = 0;
120 
124  virtual bool PreprocessScene(FbxScene &pScene) = 0;
125 
129  virtual bool PostprocessScene(FbxScene &pScene) = 0;
130 
131 #ifndef FBXSDK_ENV_WINSTORE
132 
140  virtual void PluginWriteParameters(FbxObject& pParams);
141 #endif /* !FBXSDK_ENV_WINSTORE */
142 
147  virtual FbxNode* FindRootNode(FbxScene& pScene);
148 
156  virtual bool CheckSpaceInNodeNameRecursive(FbxNode* pNode, FbxString& pNodeNameList);
157 
161  bool SetFileExportVersion(FbxString pVersion);
162 
166  void SetRenamingMode(FbxSceneRenamer::ERenamingMode pRenamingMode){mRenamingMode = pRenamingMode;}
167 
171  inline void SetResamplingRate(double pResamplingRate){mResamplingRate = pResamplingRate;}
172 
177  bool IsGenuine();
178 
183  virtual FbxIOSettings * GetIOSettings();
184 
188  virtual void SetIOSettings(FbxIOSettings * pIOSettings);
189 
193  virtual void SetProgressHandler(FbxProgress* /*pProgress*/){}
194 
196  virtual bool SupportsStreams() const;
197 
198 protected:
199 #ifndef FBXSDK_ENV_WINSTORE
200  void PluginsWriteBegin(FbxScene& pScene);
207  void PluginsWrite(FbxIO& pFbx, bool pWriteObjectId);
209  void PluginsWriteEnd(FbxScene& pScene);
210 #endif /* !FBXSDK_ENV_WINSTORE */
211 
212 /*****************************************************************************************************************************
213 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
214 *****************************************************************************************************************************/
215 public:
216 #ifndef DOXYGEN_SHOULD_SKIP_THIS
217  FbxStatus& GetStatus() { return mStatus; }
218 
219 protected:
220 
221  FbxWriter& operator=(FbxWriter const&) { return *this; }
222 
223  FbxStatus& mStatus;
224  FbxManager& mManager;
225  FbxString mFileVersion;
227  double mResamplingRate;
229  FbxSceneRenamer::ERenamingMode mRenamingMode;
230 
231 private:
232  int mInternalID;
233  FbxIOSettings * mIOSettings;
234 
235  friend struct FbxWriterFbx7_Impl;
236 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
237 };
238 
240 #define IOS_REF (*GetIOSettings())
241 
242 #include <fbxsdk/fbxsdk_nsend.h>
243 
244 #endif /* _FBXSDK_FILEIO_WRITER_H_ */
FBX SDK environment definition.
SDK object manager.
Definition: fbxmanager.h:56
EInfoRequest
Information type to request.
Definition: fbxwriter.h:74
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxDocument is a base class for FbxScene and FbxLibrary classes.
Definition: fbxdocument.h:46
To get the file version for a writer ex: 7100.
Definition: fbxwriter.h:78
This class facilitates the testing/reporting of errors.
Definition: fbxstatus.h:26
FbxIOSettings is a collection of properties, arranged as a tree, that can be used by FBX file readers...
void SetRenamingMode(FbxSceneRenamer::ERenamingMode pRenamingMode)
Sets the renaming mode as specified.
Definition: fbxwriter.h:166
The base class of most FBX objects.
Definition: fbxobject.h:157
void SetResamplingRate(double pResamplingRate)
Sets the resampling rate as specified.
Definition: fbxwriter.h:171
To get the file description for a writer ex:"Autodesk FBX (*.fbx)".
Definition: fbxwriter.h:77
Represents an element in the scene graph.
Definition: fbxnode.h:72
Class to export SDK objects into an FBX file.
Definition: fbxexporter.h:89
This class contains the description of a 3D scene.
Definition: fbxscene.h:61
Base class of other writers used internally.
Definition: fbxwriter.h:58
To get the file compatible description for a writer.
Definition: fbxwriter.h:79
Class for progress reporting.
Definition: fbxprogress.h:31
To get the file ext for a writer ex: "FBX".
Definition: fbxwriter.h:76
FbxIO represents an FBX file.
Definition: fbxio.h:325
#define FBXSDK_DLL
Definition: fbxarch.h:173
To get the file UI label to show for a writer ex: file labels shown in "Open file dialog"...
Definition: fbxwriter.h:80
virtual void SetProgressHandler(FbxProgress *)
Pass a progress handler to the writer.
Definition: fbxwriter.h:193
Class for interfacing with files, providing a similar interface for files independant of the OS or fi...
Definition: fbxfile.h:27
ERenamingMode
The Mode describing from which format to which format.