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

#include <fbxusernotification.h>

Class Description

This class accumulates user notifications and sends them to any device opened by the derived classes.

If this class is not derived, the data can only be sent to a log file. To send data to a log file, it must be opened before attempting to send data, otherwise, the messages will be lost.

Definition at line 111 of file fbxusernotification.h.

Classes

class  AESequence
 Identify one detail in all accumulator entries by record the entry object and its detail id. More...
 

Public Types

enum  EEntryID {
  eBindPoseInvalidObject, eBindPoseInvalidRoot, eBindPoseNotAllAncestorsNodes, eBindPoseNotAllDeformingNodes,
  eBindPoseNotAllAncestorsDefinitionNodes, eBindPoseRelativeMatrix, eEmbedMediaNotify, eFileIONotify,
  eFileIONotifyMaterial, eFileIONotifyDXFNotSupportNurbs, eEntryStartID
}
 IDs for pre-defined message entries. More...
 

Public Member Functions

 FbxUserNotification (FbxManager *pManager, FbxString const &pLogFileName, FbxString const &pSessionDescription)
 Instantiate a FbxUserNotification but leave it uninitialized. More...
 
virtual ~FbxUserNotification ()
 Destructor. More...
 
void InitAccumulator ()
 Accumulator is to hold the notification entries. More...
 
void ClearAccumulator ()
 This method must be called when the Accumulator is no longer needed. More...
 
Accumulator Management
int AddEntry (const int pID, const FbxString &pName, const FbxString &pDescr, FbxAccumulatorEntry::EClass pClass=FbxAccumulatorEntry::eWarning)
 Adds one entry into the accumulator. More...
 
int AddDetail (int pEntryId)
 Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events. More...
 
int AddDetail (int pEntryId, FbxString pString)
 Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events. More...
 
int AddDetail (int pEntryId, FbxNode *pNode)
 Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events. More...
 
int GetNbEntries () const
 Returns the number of AccumulatorEntries currently stored in this accumulator. More...
 
const FbxAccumulatorEntryGetEntry (int pEntryId)
 Get the specified FbxAccumulatorEntry. More...
 
const FbxAccumulatorEntryGetEntryAt (int pEntryIndex) const
 Get the FbxAccumulatorEntry at the specified index. More...
 
int GetNbDetails () const
 Returns the number of Details recorded so far in this accumulator. More...
 
int GetDetail (int pDetailId, const FbxAccumulatorEntry *&pAE) const
 Get the specified detail. More...
 
Utilities
virtual void GetLogFilePath (FbxString &pPath)
 Returns the absolute path to the log file. More...
 
FbxString GetLogFileName ()
 Returns the log file name. More...
 

Static Public Member Functions

static FbxUserNotificationCreate (FbxManager *pManager, const FbxString &pLogFileName, const FbxString &pSessionDescription)
 Create and initialize user notification object for the SDK manager. More...
 
static void Destroy (FbxManager *pManager)
 Destroy the global user notification object owned by the SDK manager. More...
 

Protected Member Functions

virtual bool PostTerminate ()
 Allow a derived class to finalize processing AFTER the log file handle has been deleted. More...
 
virtual void AccumulatorInit ()
 Allow the implementation class to perform accumulator initializations before the Extra devices are opened. More...
 
virtual void AccumulatorClear ()
 Allow the implementation class to perform accumulator clear after the Extra devices are closed. More...
 
virtual void OpenExtraDevices ()
 Allow the implementation class to opens its output devices (called by InitAccumulator). More...
 
virtual bool SendToExtraDevices (bool pOutputNow, FbxArray< FbxAccumulatorEntry *> &pEntries)
 Allow the implementation class to send all the accumulator entries to the devices. More...
 
virtual bool SendToExtraDevices (bool pOutputNow, FbxArray< AESequence *> &pAESequence)
 Allow the implementation class to send all the accumulator entries to the devices. More...
 
virtual bool SendToExtraDevices (bool pOutputNow, const FbxAccumulatorEntry *pAccEntry, int pDetailId=-1)
 Allow the implementation class to send one accumulator entry to the devices. More...
 
virtual void CloseExtraDevices ()
 Allow the implementation class to close it's output devices (called in the ClearAccumulator) By default this method does nothing. More...
 
void ResetAccumulator ()
 Clears the Accumulator list, remove all user notification entries.. More...
 
void ResetSequence ()
 Clears the Sequence list. More...
 
void SendToLog (EOutputSource pOutSrc, int pId)
 Send the pIdth element of the accumulator or sequence list to the log file. More...
 
void SendToLog (const FbxAccumulatorEntry *pAccEntry, int pDetailId=-1)
 Send the accumulator entry to the log file. More...
 

Friends

class FbxUserNotificationFilteredIterator
 

Accumulator Output

enum  EOutputSource { eAccumulatorEntry, eSequencedDetails }
 Specify send what kind of data to output device. More...
 
bool Output (EOutputSource pOutSrc=eAccumulatorEntry, int pIndex=-1, bool pExtraDevicesOnly=false)
 Send the accumulator entries to the output devices. More...
 
bool OutputById (EEntryID pId, EOutputSource pOutSrc=eAccumulatorEntry, bool pExtraDevicesOnly=false)
 Send the accumulator entry to the output devices. More...
 
bool Output (const FbxString &pName, const FbxString &pDescr, FbxAccumulatorEntry::EClass pClass, bool pExtraDevicesOnly=false)
 Send an immediate entry to the output devices. More...
 
bool Output (FbxUserNotificationFilteredIterator &pAEFIter, bool pExtraDevicesOnly=false)
 Sends the content of the iterator to the output devices. More...
 
void SetLogMessageEmitter (FbxMessageEmitter *pLogMessageEmitter)
 Set log message emitter. More...
 

Member Enumeration Documentation

◆ EEntryID

enum EEntryID

IDs for pre-defined message entries.

Enumerator
eBindPoseInvalidObject 
eBindPoseInvalidRoot 
eBindPoseNotAllAncestorsNodes 
eBindPoseNotAllDeformingNodes 
eBindPoseNotAllAncestorsDefinitionNodes 
eBindPoseRelativeMatrix 
eEmbedMediaNotify 
eFileIONotify 

this is generic for reader and writer to log notifications.

eFileIONotifyMaterial 
eFileIONotifyDXFNotSupportNurbs 
eEntryStartID 

Starting ID for any Accumulator entry added by derived classes.

Definition at line 171 of file fbxusernotification.h.

◆ EOutputSource

Specify send what kind of data to output device.

Enumerator
eAccumulatorEntry 

Entry with its details.

eSequencedDetails 

Details in the recorded order.

Definition at line 270 of file fbxusernotification.h.

271  {
274  };
Details in the recorded order.

Constructor & Destructor Documentation

◆ FbxUserNotification()

FbxUserNotification ( FbxManager pManager,
FbxString const &  pLogFileName,
FbxString const &  pSessionDescription 
)

Instantiate a FbxUserNotification but leave it uninitialized.

The caller must explicitly call InitAccumulator to initialize it and ClearAccumulator when finished using it.

Parameters
pManager
pLogFileNameName of the log file that will be open in the directory defined by the GetLogFilePath method.
Remarks
If pLogFileName is an empty string the log file does not get created and any output sent to it is lost.
Parameters
pSessionDescriptionThis string is used to separate session logs in the file.
Remarks
If the specified log file already exists, messages are appended to it. This class never deletes the log file. Derived classes may delete the log file before opening (it must be done in the constructor because the log file is opened in the InitAccumulator) or at the end of the processing in the PostTerminate method.

◆ ~FbxUserNotification()

virtual ~FbxUserNotification ( )
virtual

Destructor.

Member Function Documentation

◆ Create()

static FbxUserNotification* Create ( FbxManager pManager,
const FbxString pLogFileName,
const FbxString pSessionDescription 
)
static

Create and initialize user notification object for the SDK manager.

One SDK manager has one global user notification object. If the SDK manager already has global user notification object, the function will do nothing.

Parameters
pManager
pLogFileNameName of the log file that will be open in the directory defined by the GetLogFilePath method.
pSessionDescriptionThis string is used to separate session logs in the file.
Returns
the global user notification object owned by the SDK manager.

◆ Destroy()

static void Destroy ( FbxManager pManager)
static

Destroy the global user notification object owned by the SDK manager.

◆ InitAccumulator()

void InitAccumulator ( )

Accumulator is to hold the notification entries.

User can add entries to it. This method must be called before using the Accumulator. It opens the log file and calls AccumulatorInit followed by OpenExtraDevices. Failing to call this method will prevent other actions except ClearAccumulator, GetLogFileName and GetLogFilePath.

◆ ClearAccumulator()

void ClearAccumulator ( )

This method must be called when the Accumulator is no longer needed.

It calls CloseExtraDevices, followed by the AccumulatorClear, and then closes the log file.

◆ AddEntry()

int AddEntry ( const int  pID,
const FbxString pName,
const FbxString pDescr,
FbxAccumulatorEntry::EClass  pClass = FbxAccumulatorEntry::eWarning 
)

Adds one entry into the accumulator.

Parameters
pIDThis entry unique ID.
pNameThis entry name.
pDescrThe description of this entry.
pClassThe category of this entry.
Returns
The ID of the newly allocated entry. This ID is pEntryId.

◆ AddDetail() [1/3]

int AddDetail ( int  pEntryId)

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted FbxAccumulatorEntry objects are not processed).

Parameters
pEntryIdThe entry index (as returned by AddEntry).
Returns
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSequencedDetails set as a source. If an error occurs, the returned value is -1

◆ AddDetail() [2/3]

int AddDetail ( int  pEntryId,
FbxString  pString 
)

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted FbxAccumulatorEntry objects are not processed).

Parameters
pEntryIdThe entry index (as returned by AddEntry).
pStringThe detail string to add to the entry.
Returns
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSequencedDetails set as a source. If an error occurs, the returned value is -1

◆ AddDetail() [3/3]

int AddDetail ( int  pEntryId,
FbxNode pNode 
)

Completes the accumulator entry (there can be more that one detail for each entry) and implicitly defines the sequence of events.

Each call to this method is internally recorded, making it possible to output each notification in the order they have been defined. Also, when a detail is added to an entry, it is automatically unmuted so it can be sent to the devices (muted FbxAccumulatorEntry objects are not processed).

Parameters
pEntryIdThe entry index (as returned by AddEntry).
pNodeThe node to add to the entry.
Returns
The id of the detail in the recorded sequence of events. This Id should be used when the call to Output has the eSequencedDetails set as a source. If an error occurs, the returned value is -1

◆ GetNbEntries()

int GetNbEntries ( ) const

Returns the number of AccumulatorEntries currently stored in this accumulator.

◆ GetEntry()

const FbxAccumulatorEntry* GetEntry ( int  pEntryId)

Get the specified FbxAccumulatorEntry.

Parameters
pEntryIdID of the entry to retrieve.
Returns
Pointer to the specified entry, otherwise NULL if either the id is invalid or the Accumulator is not properly initialized.

◆ GetEntryAt()

const FbxAccumulatorEntry* GetEntryAt ( int  pEntryIndex) const

Get the FbxAccumulatorEntry at the specified index.

Parameters
pEntryIndexindex of the entry to retrieve.
Returns
Pointer to the specified entry, otherwise NULL if either the index is invalid or the Accumulator is not properly initialized..

◆ GetNbDetails()

int GetNbDetails ( ) const

Returns the number of Details recorded so far in this accumulator.

◆ GetDetail()

int GetDetail ( int  pDetailId,
const FbxAccumulatorEntry *&  pAE 
) const

Get the specified detail.

Parameters
pDetailIdIndex of the detail. This is the id-th detail of type pClass as inserted when the AddDetail
pAEPointer to the FbxAccumulatorEntry object that contains the requested detail. The returned valued can be NULL if an error occurred.
Returns
The index of the detail to be used when calling the GetDetail of the FbxAccumulatorEntry.
Remarks
A value of -1 is acceptable and means that the FbxAccumulatorEntry has no details. However, if pAE is NULL, the return value is meaningless.

◆ Output() [1/3]

bool Output ( EOutputSource  pOutSrc = eAccumulatorEntry,
int  pIndex = -1,
bool  pExtraDevicesOnly = false 
)

Send the accumulator entries to the output devices.

This method needs to be explicitly called by the program that uses this class.

Parameters
pOutSrcSpecify which data has to be sent to the output devices. Set to SEQUENCED_DETAILS to send the Details in the recorded order. Set to ACCUMULATOR_ENTRY to send each entry with its details regardless of the order in which the events occurred.
pIndexIf this parameter >= 0, only send the specified entry/detail index to the output devices. Otherwise send all of them.
pExtraDevicesOnlyIf this parameter is True, the output is not sent to the log file.
Remarks
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

◆ OutputById()

bool OutputById ( EEntryID  pId,
EOutputSource  pOutSrc = eAccumulatorEntry,
bool  pExtraDevicesOnly = false 
)

Send the accumulator entry to the output devices.

Parameters
pIdSend the entry/detail that matching pIdx to the output devices, otherwise send all of them.
pOutSrcSpecify which data has to be sent to the output devices. Set to SEQUENCED_DETAILS to send the Details in the recorded order. Set to ACCUMULATOR_ENTRY to send each entry with its details regardless of the order in which the events occurred..
pExtraDevicesOnlyIf this parameter is True, the output is not sent to the log file.

◆ Output() [2/3]

bool Output ( const FbxString pName,
const FbxString pDescr,
FbxAccumulatorEntry::EClass  pClass,
bool  pExtraDevicesOnly = false 
)

Send an immediate entry to the output devices.

This method bypasses the accumulator by sending the entry directly to the output devices and discarding it right after. The internal accumulator lists are left unchanged by this call.

Parameters
pNameThis entry name.
pDescrThe description of this entry.
pClassThe category of this entry.
pExtraDevicesOnlyIf this parameter is True, the output is not sent to the log file.
Remarks
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

◆ Output() [3/3]

bool Output ( FbxUserNotificationFilteredIterator pAEFIter,
bool  pExtraDevicesOnly = false 
)

Sends the content of the iterator to the output devices.

This method bypasses the accumulator by sending each entry in the iterator directly to the output devices. The internal accumulator lists are left unchanged by this call.

Parameters
pAEFIterThe Filtered FbxAccumulatorEntry iterator object.
pExtraDevicesOnlyIf this parameter is True, the output is not sent to the log file.
Remarks
The pExtraDevicesOnly parameter is ignored if the log file has been disabled.

◆ SetLogMessageEmitter()

void SetLogMessageEmitter ( FbxMessageEmitter *  pLogMessageEmitter)

Set log message emitter.

Parameters
pLogMessageEmitterThe new log message emitter.

◆ GetLogFilePath()

virtual void GetLogFilePath ( FbxString pPath)
virtual

Returns the absolute path to the log file.

If this method is not overridden in a derived class, it returns the TEMP directory.

Parameters
pPathThe returned path.

◆ GetLogFileName()

FbxString GetLogFileName ( )
inline

Returns the log file name.

Definition at line 335 of file fbxusernotification.h.

335 { return mLogFileName; }

◆ PostTerminate()

virtual bool PostTerminate ( )
protectedvirtual

Allow a derived class to finalize processing AFTER the log file handle has been deleted.

This may be required if the log file needs to be moved or shown.

Returns
True if the object is properly cleaned.

◆ AccumulatorInit()

virtual void AccumulatorInit ( )
protectedvirtual

Allow the implementation class to perform accumulator initializations before the Extra devices are opened.

By default this method does nothing.

◆ AccumulatorClear()

virtual void AccumulatorClear ( )
protectedvirtual

Allow the implementation class to perform accumulator clear after the Extra devices are closed.

By default this method does nothing.

◆ OpenExtraDevices()

virtual void OpenExtraDevices ( )
protectedvirtual

Allow the implementation class to opens its output devices (called by InitAccumulator).

By default this method does nothing.

◆ SendToExtraDevices() [1/3]

virtual bool SendToExtraDevices ( bool  pOutputNow,
FbxArray< FbxAccumulatorEntry *> &  pEntries 
)
protectedvirtual

Allow the implementation class to send all the accumulator entries to the devices.

By default this method loop trough all the elements of the received array and call the SendToExtraDevices method with the appropriate FbxAccumulatorEntry element and id.

Parameters
pOutputNowFlag indicates whether to output now.
pEntriesAccumulator entries to output.
Returns
true if successful, false otherwise.

◆ SendToExtraDevices() [2/3]

virtual bool SendToExtraDevices ( bool  pOutputNow,
FbxArray< AESequence *> &  pAESequence 
)
protectedvirtual

Allow the implementation class to send all the accumulator entries to the devices.

By default this method loop trough all the elements of the received array and call the SendToExtraDevices method with the appropriate FbxAccumulatorEntry element and id.

Parameters
pOutputNowFlag indicates whether to output now.
pAESequenceAccumulator entries to output.
Returns
true if successful, false otherwise.

◆ SendToExtraDevices() [3/3]

virtual bool SendToExtraDevices ( bool  pOutputNow,
const FbxAccumulatorEntry pAccEntry,
int  pDetailId = -1 
)
protectedvirtual

Allow the implementation class to send one accumulator entry to the devices.

By default this method does nothing.

Parameters
pOutputNowFlag indicates whether to output now.
pAccEntryAccumulator entry to output.
pDetailIdDetail id.
Returns
true if successful, false otherwise.
Remarks
Derived methods should check for the IsMuted() state to decide if the accumulator entry should get through or get discarded. See AddDetail for more details.

◆ CloseExtraDevices()

virtual void CloseExtraDevices ( )
protectedvirtual

Allow the implementation class to close it's output devices (called in the ClearAccumulator) By default this method does nothing.

◆ ResetAccumulator()

void ResetAccumulator ( )
protected

Clears the Accumulator list, remove all user notification entries..

◆ ResetSequence()

void ResetSequence ( )
protected

Clears the Sequence list.

◆ SendToLog() [1/2]

void SendToLog ( EOutputSource  pOutSrc,
int  pId 
)
protected

Send the pIdth element of the accumulator or sequence list to the log file.

Parameters
pOutSrcThe output source, accumulator or sequence list.
pIdElement id.

◆ SendToLog() [2/2]

void SendToLog ( const FbxAccumulatorEntry pAccEntry,
int  pDetailId = -1 
)
protected

Send the accumulator entry to the log file.

Parameters
pAccEntryThe accumulator entry.
pDetailIdDetail id.

Friends And Related Function Documentation

◆ FbxUserNotificationFilteredIterator

Definition at line 361 of file fbxusernotification.h.


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