- Main Page
- Classes
- Files
- Directories
- Examples

- File List
- File Members

# fbxusernotification.h

Go to the documentation of this file.

    00001 /****************************************************************************************
    00002
    00003    Copyright (C) 2012 Autodesk, Inc.
    00004    All rights reserved.
    00005
    00006    Use of this software is subject to the terms of the Autodesk license agreement
    00007    provided at the time of installation or download, or which otherwise accompanies
    00008    this software in either electronic or hard copy form.
    00009
    00010 ****************************************************************************************/
    00011
    00013 #ifndef _FBXSDK_UTILS_USER_NOTIFICATION_H_
    00014 #define _FBXSDK_UTILS_USER_NOTIFICATION_H_
    00015
    00016 #include <fbxsdk/fbxsdk_def.h>
    00017
    00018 #include <fbxsdk/core/base/fbxarray.h>
    00019 #include <fbxsdk/core/base/fbxstring.h>
    00020 #include <fbxsdk/core/base/fbxset.h>
    00021
    00022 #include <fbxsdk/fbxsdk_nsbegin.h>
    00023
    00024 class FbxMessageEmitter;
    00025 class FbxNode;
    00026 class FbxUserNotificationFilteredIterator;
    00027 class FbxManager;
    00028 class FbxLogFile;
    00029
    00036 class FBXSDK_DLL FbxAccumulatorEntry
    00037 {
    00038 public:
    00041     enum EClass
    00042     {
    00043         eError=1,
    00044         eWarning=2,
    00045         eInformation=4,
    00046         eAny=7
    00047     };
    00048
    00060     FbxAccumulatorEntry(EClass pAEClass, const FbxString& pName, const FbxString& pDescr,
    00061                      FbxString pDetail="", bool pMuteState=true);
    00062
    00067     FbxAccumulatorEntry(const FbxAccumulatorEntry& pAE, bool pSkipDetails);
    00068
    00070     ~FbxAccumulatorEntry();
    00071
    00073     EClass GetClass() const;
    00074
    00076     FbxString GetName() const;
    00077
    00079     FbxString    GetDescription() const;
    00080
    00082     int GetDetailsCount() const;
    00083
    00090     const FbxString* GetDetail(int id) const;
    00091
    00093     bool IsMuted() const;
    00094
    00095 private:
    00096     friend class FbxUserNotification;
    00097     FbxArray<FbxString*>& GetDetails();
    00098     void Mute(bool pState);
    00099
    00100     bool    mMute;
    00101     EClass mAEClass;
    00102     FbxString mName;
    00103     FbxString mDescr;
    00104     FbxArray<FbxString*> mDetails;
    00105 };
    00106
    00107
    00112 class FBXSDK_DLL FbxUserNotification
    00113 {
    00114 public:
    00126     static FbxUserNotification* Create(FbxManager* pManager,
    00127                                         const FbxString& pLogFileName,
    00128                                         const FbxString& pSessionDescription);
    00129
    00133     static void Destroy(FbxManager* pManager);
    00134
    00150     FbxUserNotification(FbxManager* pManager,
    00151                          FbxString const& pLogFileName,
    00152                          FbxString const& pSessionDescription);
    00153
    00155     virtual ~FbxUserNotification();
    00156
    00163     void InitAccumulator();
    00164
    00168     void ClearAccumulator();
    00169
    00172     enum EEntryID
    00173     {
    00174         eBindPoseInvalidObject,
    00175         eBindPoseInvalidRoot,
    00176         eBindPoseNotAllAncestorsNodes,
    00177         eBindPoseNotAllDeformingNodes,
    00178         eBindPoseNotAllAncestorsDefinitionNodes,
    00179         eBindPoseRelativeMatrix,
    00180         eEmbedMediaNotify,
    00181         eFileIONotify,
    00182         eFileIONotifyMaterial,
    00183         eFileIONotifyDXFNotSupportNurbs,
    00184         eEntryStartID
    00185     };
    00186
    00198     int AddEntry(const int pID, const FbxString& pName, const FbxString& pDescr, FbxAccumulatorEntry::EClass pClass=FbxAccumulatorEntry::eWarning);
    00199
    00208     int AddDetail(int pEntryId);
    00209
    00219     int AddDetail(int pEntryId, FbxString pString);
    00220
    00230     int AddDetail(int pEntryId, FbxNode* pNode);
    00231
    00233     int  GetNbEntries() const;
    00234
    00240     const FbxAccumulatorEntry* GetEntry(int pEntryId) const;
    00241
    00247     const FbxAccumulatorEntry* GetEntryAt(int pEntryIndex) const;
    00248
    00250     int GetNbDetails() const;
    00251
    00261     int GetDetail(int pDetailId, const FbxAccumulatorEntry*& pAE) const;
    00262
    00264
    00271     enum EOutputSource
    00272     {
    00273         eAccumulatorEntry,
    00274         eSequencedDetails
    00275     };
    00276
    00288     bool Output(EOutputSource pOutSrc=eAccumulatorEntry, int pIndex = -1, bool pExtraDevicesOnly = false);
    00289
    00298     bool OutputById(EEntryID pId, EOutputSource pOutSrc=eAccumulatorEntry, bool pExtraDevicesOnly = false);
    00299
    00309     bool Output(const FbxString& pName, const FbxString& pDescr, FbxAccumulatorEntry::EClass pClass, bool pExtraDevicesOnly = false);
    00310
    00318     bool Output(FbxUserNotificationFilteredIterator& pAEFIter, bool pExtraDevicesOnly = false);
    00319
    00323     void SetLogMessageEmitter(FbxMessageEmitter * pLogMessageEmitter);
    00324
    00333     virtual void GetLogFilePath(FbxString& pPath);
    00334
    00336     inline FbxString GetLogFileName() { return mLogFileName; }
    00338
    00339 protected:
    00343     class AESequence
    00344     {
    00345     public:
    00346         AESequence(FbxAccumulatorEntry* pAE, int pDetailId) :
    00347             mAE(pAE),
    00348             mDetailId(pDetailId)
    00349             {
    00350             };
    00351
    00353         FbxAccumulatorEntry* AE() { return mAE; }
    00355         int DetailId() { return mDetailId; }
    00356
    00357     private:
    00358         FbxAccumulatorEntry* mAE;
    00359         int mDetailId;
    00360     };
    00361
    00362     friend class FbxUserNotificationFilteredIterator;
    00363
    00368     virtual bool PostTerminate();
    00369
    00373     virtual void AccumulatorInit();
    00374
    00378     virtual void AccumulatorClear();
    00379
    00383     virtual void OpenExtraDevices();
    00384
    00392     virtual bool SendToExtraDevices(bool pOutputNow, FbxArray<FbxAccumulatorEntry*>& pEntries);
    00393
    00401     virtual bool SendToExtraDevices(bool pOutputNow, FbxArray<AESequence*>& pAESequence);
    00402
    00412     virtual bool SendToExtraDevices(bool pOutputNow, const FbxAccumulatorEntry* pAccEntry, int pDetailId = -1);
    00413
    00414
    00418     virtual void CloseExtraDevices();
    00419
    00421     void ResetAccumulator();
    00422
    00424     void ResetSequence();
    00425
    00430     void SendToLog(EOutputSource pOutSrc, int pId);
    00431
    00436     void SendToLog(const FbxAccumulatorEntry* pAccEntry, int pDetailId = -1);
    00437
    00438 private:
    00439     FbxString mLogFileName;
    00440     FbxString* mLog;
    00441     FbxLogFile* mLogFile;
    00442     FbxMessageEmitter* mLogMessageEmitter;
    00443
    00444     bool mProperlyInitialized;
    00445     FbxString mSessionDescription;
    00446     bool mProperlyCleaned;
    00447
    00448     FbxSet mAccuHT;                             // The set establish a relationship between an FbxAccumulatorEntry and it's ID
    00449     FbxArray<FbxAccumulatorEntry*> mAccu;  // The array defines the order the FbxAccumulatorEntry objects have been
    00450                                               // added to the accumulator (calls to AddEntry)
    00451                                               // Both structures share the same pointers.
    00452     FbxArray<AESequence*> mAESequence;
    00453     FbxManager*             mSdkManager;
    00454 };
    00455
    00460 class FBXSDK_DLL FbxUserNotificationFilteredIterator
    00461 {
    00462 public:
    00475     FbxUserNotificationFilteredIterator(FbxUserNotification& pAccumulator,
    00476             int pFilterClass,
    00477             FbxUserNotification::EOutputSource pSrc = FbxUserNotification::eSequencedDetails,
    00478             bool pNoDetail = true);
    00479
    00480     virtual ~FbxUserNotificationFilteredIterator();
    00481
    00483     int  GetNbItems() const;
    00484
    00486     void Reset();
    00487
    00491     FbxAccumulatorEntry* const First();
    00492
    00500     FbxAccumulatorEntry* const Previous();
    00501
    00509     FbxAccumulatorEntry* const Next();
    00510
    00511 protected:
    00512     // Called in the constructor.
    00513     virtual void BuildFilteredList(FbxUserNotification& pAccumulator);
    00514
    00515     int                                    mIterator;
    00516     int                                    mFilterClass;
    00517     bool                                mNoDetail;
    00518     FbxUserNotification::EOutputSource    mAccuSrcData;
    00519     FbxArray<FbxAccumulatorEntry*>    mFilteredAE;
    00520 };
    00521
    00522 #include <fbxsdk/fbxsdk_nsend.h>
    00523
    00524 #endif /* _FBXSDK_UTILS_USER_NOTIFICATION_H_ */