UIExamples/CubeCreator/SDK_Utility.h

/**************************************************************************************

 Copyright (C) 2001 - 2010 Autodesk, Inc. and/or its licensors.
 All Rights Reserved.

 The coded instructions, statements, computer programs, and/or related material 
 (collectively the "Data") in these files contain unpublished information 
 proprietary to Autodesk, Inc. and/or its licensors, which is protected by 
 Canada and United States of America federal copyright law and by international 
 treaties. 
 
 The Data may not be disclosed or distributed to third parties, in whole or in
 part, without the prior written consent of Autodesk, Inc. ("Autodesk").

 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR ARISING
 BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES OF TITLE, 
 NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR USE. 
 WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT WARRANT THAT THE OPERATION
 OF THE DATA WILL BE UNINTERRUPTED OR ERROR FREE. 
 
 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR EXPENSES
 OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE DAMAGES OR OTHER
 SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS OF PROFITS, REVENUE
 OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR DAMAGES OF ANY KIND),
 HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF LIABILITY, WHETHER DERIVED
 FROM CONTRACT, TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE), OR OTHERWISE,
 ARISING OUT OF OR RELATING TO THE DATA OR ITS USE OR ANY OTHER PERFORMANCE,
 WHETHER OR NOT AUTODESK HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS
 OR DAMAGE. 

**************************************************************************************/

// use the fbxsdk.h
#include <fbxsdk.h>

//use FBX namespace
#include <fbxfilesdk/fbxfilesdk_nsuse.h>

// to create a basic scene
bool CreateScene();

// to save a scene to a FBX file
bool Export(    
                const char* pFilename, 
                int pFileFormat 
            );

// to save a scene to a FBX file
bool SaveScene(
                KFbxSdkManager* pSdkManager, 
                KFbxDocument* pScene, 
                const char* pFilename, 
                int pFileFormat, 
                bool pEmbedMedia
              );

// to get filters for the <Save file> dialog (description + file extention)
const char *GetWriterSFNFilters();

// to get a file extention for a WriteFileFormat
const char *GetFileFormatExt(
                                const int pWriteFileFormat
                            );

// to create an instance of the SDK manager
bool InitializeSdkObjects(
                            KFbxSdkManager*& pSdkManager, 
                            KFbxScene*& pScene
                         );


// to destroy an instance of the SDK manager
void DestroySdkObjects(
                        KFbxSdkManager* pSdkManager
                      );

// to get the root node
const KFbxNode* GetRootNode();

// to get the root node name
const char * GetRootNodeName();

// create a new cube under the root node
void CreateCube(bool pWithMaterial, bool pWithTexture, bool pAnimate);

// remove all cubes from the scene
void RemoveCubes();

// to get a string from the node name and attribute type
KString GetNodeNameAndAttributeTypeName(
                                         const KFbxNode* pNode
                                       );

// to get a string from the node default translation values
KString GetDefaultTranslationInfo(
                                   const KFbxNode* pNode
                                 );

// to get a string with info about material, texture, animation
KString GetNodeInfo(
                     const KFbxNode* pNode
                   );


// Create a marker to use a point of interest for the camera. 
KFbxNode* CreateMarker(
                        KFbxScene* pScene, 
                        char* pName
                      );

// Create a camera
KFbxNode* CreateCamera(
                        KFbxScene* pScene, 
                        char* pName
                      );

// Create a cube mesh
KFbxNode* CreateCubeMesh(
                          KFbxScene* pScene, 
                          char* pName
                        );

// Create texture
void CreateTexture(
                    KFbxScene* pScene
                  );

// Create material
void CreateMaterial(
                      KFbxScene* pScene 
                    );

// Add materials to a mesh
void AddMaterials(
                   KFbxMesh* pMesh
                 );

void SetCameraPointOfInterest(
                               KFbxNode* pCamera, 
                               KFbxNode* pPointOfInterest
                             );

void SetMarkerDefaultPosition(
                               KFbxNode* pMarker
                             );

void SetCameraDefaultPosition(
                               KFbxNode* pCamera
                             );

void AnimateCamera(
                    KFbxNode* pCamera, 
                    KFbxAnimLayer* pAnimLayer
                  );

void AnimateCube(
                  KFbxNode* pCube, 
                  KFbxAnimLayer* pAnimLayer, 
                  int pRotAxe
                );

void CreateCubeDetailed(
                         char* pCubeName, 
                         double pX, 
                         double pY, 
                         double pZ, 
                         int pRotateAxe,
                         bool pWithMaterial, 
                         bool pWithTexture, 
                         bool pAnim
                       );

void SetInitialCubeData();