#include <fbxsdk.h>
#include <stdio.h>
#include <math.h>
#include "DisplayCommon.h"
#include <fbxfilesdk/fbxfilesdk_nsuse.h>
#include <fbxfilesdk/kfbxplugins/kfbxobject.h>
void DisplayMetaDataConnections(KFbxObject* pObject)
{
int nbMetaData = KFbxGetSrcCount<KFbxObjectMetaData>(pObject);
if (nbMetaData > 0)
DisplayString(" MetaData connections ");
for (int i = 0; i < nbMetaData; i++)
{
KFbxObjectMetaData* metaData = KFbxGetSrc<KFbxObjectMetaData>(pObject, i);
DisplayString(" Name: ", (char*)metaData->GetName());
}
}
void DisplayString(const char* pHeader, const char* pValue , const char* pSuffix )
{
KString lString;
lString = pHeader;
lString += pValue;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void DisplayBool(const char* pHeader, bool pValue, const char* pSuffix )
{
KString lString;
lString = pHeader;
lString += pValue ? "true" : "false";
lString += pSuffix;
lString += "\n";
printf(lString);
}
void DisplayInt(const char* pHeader, int pValue, const char* pSuffix )
{
KString lString;
lString = pHeader;
lString += pValue;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void DisplayDouble(const char* pHeader, double pValue, const char* pSuffix )
{
KString lString;
KString lFloatValue = (float) pValue;
lFloatValue = pValue <= -HUGE_VAL ? "-INFINITY" : lFloatValue.Buffer();
lFloatValue = pValue >= HUGE_VAL ? "INFINITY" : lFloatValue.Buffer();
lString = pHeader;
lString += lFloatValue;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void Display2DVector(const char* pHeader, KFbxVector2 pValue, const char* pSuffix )
{
KString lString;
KString lFloatValue1 = (float)pValue[0];
KString lFloatValue2 = (float)pValue[1];
lFloatValue1 = pValue[0] <= -HUGE_VAL ? "-INFINITY" : lFloatValue1.Buffer();
lFloatValue1 = pValue[0] >= HUGE_VAL ? "INFINITY" : lFloatValue1.Buffer();
lFloatValue2 = pValue[1] <= -HUGE_VAL ? "-INFINITY" : lFloatValue2.Buffer();
lFloatValue2 = pValue[1] >= HUGE_VAL ? "INFINITY" : lFloatValue2.Buffer();
lString = pHeader;
lString += lFloatValue1;
lString += ", ";
lString += lFloatValue2;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void Display3DVector(const char* pHeader, KFbxVector4 pValue, const char* pSuffix )
{
KString lString;
KString lFloatValue1 = (float)pValue[0];
KString lFloatValue2 = (float)pValue[1];
KString lFloatValue3 = (float)pValue[2];
lFloatValue1 = pValue[0] <= -HUGE_VAL ? "-INFINITY" : lFloatValue1.Buffer();
lFloatValue1 = pValue[0] >= HUGE_VAL ? "INFINITY" : lFloatValue1.Buffer();
lFloatValue2 = pValue[1] <= -HUGE_VAL ? "-INFINITY" : lFloatValue2.Buffer();
lFloatValue2 = pValue[1] >= HUGE_VAL ? "INFINITY" : lFloatValue2.Buffer();
lFloatValue3 = pValue[2] <= -HUGE_VAL ? "-INFINITY" : lFloatValue3.Buffer();
lFloatValue3 = pValue[2] >= HUGE_VAL ? "INFINITY" : lFloatValue3.Buffer();
lString = pHeader;
lString += lFloatValue1;
lString += ", ";
lString += lFloatValue2;
lString += ", ";
lString += lFloatValue3;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void Display4DVector(const char* pHeader, KFbxVector4 pValue, const char* pSuffix )
{
KString lString;
KString lFloatValue1 = (float)pValue[0];
KString lFloatValue2 = (float)pValue[1];
KString lFloatValue3 = (float)pValue[2];
KString lFloatValue4 = (float)pValue[3];
lFloatValue1 = pValue[0] <= -HUGE_VAL ? "-INFINITY" : lFloatValue1.Buffer();
lFloatValue1 = pValue[0] >= HUGE_VAL ? "INFINITY" : lFloatValue1.Buffer();
lFloatValue2 = pValue[1] <= -HUGE_VAL ? "-INFINITY" : lFloatValue2.Buffer();
lFloatValue2 = pValue[1] >= HUGE_VAL ? "INFINITY" : lFloatValue2.Buffer();
lFloatValue3 = pValue[2] <= -HUGE_VAL ? "-INFINITY" : lFloatValue3.Buffer();
lFloatValue3 = pValue[2] >= HUGE_VAL ? "INFINITY" : lFloatValue3.Buffer();
lFloatValue4 = pValue[3] <= -HUGE_VAL ? "-INFINITY" : lFloatValue4.Buffer();
lFloatValue4 = pValue[3] >= HUGE_VAL ? "INFINITY" : lFloatValue4.Buffer();
lString = pHeader;
lString += lFloatValue1;
lString += ", ";
lString += lFloatValue2;
lString += ", ";
lString += lFloatValue3;
lString += ", ";
lString += lFloatValue4;
lString += pSuffix;
lString += "\n";
printf(lString);
}
void DisplayColor(const char* pHeader, KFbxPropertyDouble3 pValue, const char* pSuffix )
{
KString lString;
lString = pHeader;
lString += " (red), ";
lString += " (green), ";
lString += " (blue)";
lString += pSuffix;
lString += "\n";
printf(lString);
}
void DisplayColor(const char* pHeader, KFbxColor pValue, const char* pSuffix )
{
KString lString;
lString = pHeader;
lString += (float) pValue.mRed;
lString += " (red), ";
lString += (float) pValue.mGreen;
lString += " (green), ";
lString += (float) pValue.mBlue;
lString += " (blue)";
lString += pSuffix;
lString += "\n";
printf(lString);
}