FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxStatistics Class Reference

#include <fbxstatistics.h>

Class Description

This class is a basic class to get the quantity of items.

User processes the statistics raw data by deriving FbxStatistics class and overrides AddItem method. When overriding AddItem method, User must store item's name and item's count by pair which means The index of one item's name in array mItemName is the same as the index of this item's count in array mItemCount.

Here is a code snippet to show how it used.
//Define my own statistics class.
class MyStatistics : public FbxStatistics
{
public:
virtual bool AddItem(FbxString& pItemName, int pItemCount)
{
mItemName.Add( FbxSdkNew< FbxString >(pItemName) );
mItemCount.Add( pItemCount);
return true;
};
};
FbxManager* lSdkManager = FbxManager::Create();
FbxScene* lScene = FbxScene::Create( lSdkManager, "Scene");
FbxNode* lNode1 = FbxNode::Create(lScene, "Node1");
FbxNode* lNode2 = FbxNode::Create(lScene, "Node2");
FbxNode* lNode3 = FbxNode::Create(lScene, "Node3");
FbxNode* lNode4 = FbxNode::Create(lScene, "Node4");
lScene.AddNode(lNode1);
lScene.AddNode(lNode2);
lScene.AddNode(lNode3);
MyStatistics lStatistics;
lStatistics.AddItem("Node_Count", lScene.GetNodeCount() );
FbxString lItemName;
int lItemCount;
if( lStatistics.GetItemPair( 0, lItemName, lItemCount))
{
//do something
}

Definition at line 62 of file fbxstatistics.h.

Public Member Functions

void Reset ()
 Reset the statistics. More...
 
int GetNbItems () const
 Get the number of items. More...
 
bool GetItemPair (int pNum, FbxString &pItemName, int &pItemCount) const
 Get the statistics information by pair. More...
 
FbxStatisticsoperator= (const FbxStatistics &pStatistics)
 Assignment operator. More...
 

Protected Member Functions

virtual bool AddItem (FbxString &, int)
 virtual function to define the process of the incoming statistics data. More...
 

Protected Attributes

FbxArray< FbxString * > mItemName
 An array to store item's name. More...
 
FbxArray< int > mItemCount
 An array to store item's count. More...
 

Constructor and Destructor.

 FbxStatistics ()
 
virtual ~FbxStatistics ()
 

Constructor & Destructor Documentation

◆ FbxStatistics()

◆ ~FbxStatistics()

virtual ~FbxStatistics ( )
virtual

Member Function Documentation

◆ Reset()

void Reset ( )

Reset the statistics.

◆ GetNbItems()

int GetNbItems ( ) const

Get the number of items.

◆ GetItemPair()

bool GetItemPair ( int  pNum,
FbxString pItemName,
int &  pItemCount 
) const

Get the statistics information by pair.

Parameters
pNumThe index of statistics data to be got.
pItemNameOutput the item's name.
pItemCountOutput the item's count.
Returns
True if successful, False otherwise.

◆ operator=()

FbxStatistics& operator= ( const FbxStatistics pStatistics)

Assignment operator.

Parameters
pStatisticsFbxStatistics assigned to this one.

◆ AddItem()

virtual bool AddItem ( FbxString ,
int   
)
inlineprotectedvirtual

virtual function to define the process of the incoming statistics data.

Parameters
pItemNameThe item's name
pItemCountThe item's count.
Returns
False.

Definition at line 96 of file fbxstatistics.h.

96 { return false; };

Member Data Documentation

◆ mItemName

FbxArray<FbxString*> mItemName
protected

An array to store item's name.

Definition at line 96 of file fbxstatistics.h.

◆ mItemCount

FbxArray<int> mItemCount
protected

An array to store item's count.

Definition at line 102 of file fbxstatistics.h.


The documentation for this class was generated from the following file: