fbxsdk/core/fbxpropertypage.h Source File

fbxpropertypage.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2014 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_PROPERTY_PAGE_H_
14 #define _FBXSDK_CORE_PROPERTY_PAGE_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 #include <fbxsdk/core/fbxobject.h>
20 #include <fbxsdk/core/fbxsymbol.h>
22 
23 #include <fbxsdk/fbxsdk_nsbegin.h>
24 
26 
28 {
29  inline int operator()(const FbxNameMapKey& pKeyA, const FbxNameMapKey& pKeyB) const
30  {
31  if( pKeyA.mFirst < pKeyB.mFirst ) return -1;
32  else if( pKeyA.mFirst > pKeyB.mFirst ) return 1;
33  return strcmp(pKeyA.mSecond, pKeyB.mSecond);
34  }
35 };
36 
38 {
39 public:
41  static FbxPropertyInfo* Create(const char* pName, FbxPropertyPage* pTypeInfo) { return FbxNew< FbxPropertyInfo >(pName,pTypeInfo); }
42  static FbxPropertyInfo* Create(const char* pName, EFbxType pType=eFbxUndefined) { return FbxNew< FbxPropertyInfo >(pName,pType); }
43  void Destroy() { FbxDelete(this); }
45  {
46  // @@@@@ Filter is missing
47  // @@@@@ Clone is incomplete
48  if (mTypeInfo)
49  {
50  return FbxNew< FbxPropertyInfo >(mName,mTypeInfo);
51  }
52  else
53  {
54  return FbxNew< FbxPropertyInfo >(mName,mType);
55  }
56  }
57 
58  inline void IncRef() { mRef++; }
59  inline void DecRef() { mRef--; if (mRef==0) FbxDelete(this); }
60  inline int GetRef() { return mRef; }
61 
62  // Labels and Types
63 
64  inline FbxStringSymbol GetName() const { return mName; }
65  EFbxType GetType() const;
66  FbxPropertyPage* GetTypeInfo() const { return mTypeInfo; }
67 
68  inline void SetLabel(const char* pLabel) { mLabel=pLabel; }
69  inline const char* GetLabel() const { return mLabel.IsEmpty() ? "" : ((const char*)mLabel); }
70 
71  inline void SetUserTag(int pUserTag) { mUserTag=pUserTag; }
72  inline int GetUserTag() const { return mUserTag; }
73 
74  inline void SetUserData(const void* pUserData) { mUserData=(void*)pUserData; }
75  inline void* GetUserData() const { return mUserData; }
76 
77  // Enum list
78  int AddEnumValue(const char* pStringValue)
79  {
80  if (GetType() == eFbxEnum)
81  {
82  if (!mEnumList)
83  mEnumList.Reset(FbxNew< FbxStringList >());
84 
85  if( mEnumList->FindIndex( pStringValue ) == -1 )
86  return mEnumList->Add((char*)pStringValue);
87  }
88  return -1;
89  }
90 
91  void InsertEnumValue(int pIndex, const char* pStringValue)
92  {
93  if (GetType() == eFbxEnum)
94  {
95  if (!mEnumList)
96  mEnumList.Reset(FbxNew< FbxStringList >());
97 
98  mEnumList->InsertAt(pIndex,(char*)pStringValue);
99  }
100  }
101 
103  {
104  return mEnumList ? mEnumList->GetCount() : 0;
105  }
106 
107  void SetEnumValue(int pIndex, const char* pStringValue)
108  {
109  if (GetType() == eFbxEnum)
110  {
111  if (!mEnumList)
112  mEnumList.Reset(FbxNew< FbxStringList >());
113 
114  mEnumList->SetStringAt(pIndex,(char*)pStringValue);
115  }
116  }
117 
118  void RemoveEnumValue(int pIndex)
119  {
120  if (GetType() == eFbxEnum)
121  {
122  if (!mEnumList)
123  mEnumList.Reset(FbxNew< FbxStringList >());
124 
125  mEnumList->RemoveAt(pIndex);
126  }
127  }
128 
129  char* GetEnumValue(int pIndex)
130  {
131  char* lValue = NULL;
132  if (GetType() == eFbxEnum) {
133  lValue = mEnumList ? mEnumList->GetStringAt(pIndex) : 0;
134  }
135  return lValue;
136  }
137 
138 
139  // Min and Max values
140  enum EValueIndex {eValueMin, eValueSoftMin, eValueMax, eValueSoftMax, eValueCount};
141 
142  bool HasMinMax(EValueIndex pId) const
143  {
144  return mMinMaxValue[pId] != NULL;
145  }
146 
147  bool GetMinMax(EValueIndex pId, void* pValue, EFbxType pValueType) const
148  {
149  if (mMinMaxValue[pId]) {
150  return FbxTypeCopy(pValue, pValueType, mMinMaxValue[pId], GetType());
151  }
152  return false;
153  }
154 
155  bool SetMinMax(EValueIndex pId, const void* pValue, EFbxType pValueType)
156  {
157  if (!mMinMaxValue[pId]) {
158  size_t lSize = FbxTypeSizeOf(GetType());
159  if (lSize) {
160  mMinMaxValue[pId] = FbxMalloc(lSize);
161  }
162  }
163  if (mMinMaxValue[pId]) {
164  return FbxTypeCopy(mMinMaxValue[pId], GetType(), pValue, pValueType);
165  }
166  return false;
167  }
168 
169 private:
170  FbxPropertyInfo(const char* pName, FbxPropertyPage* pTypeInfo)
171  : mRef(0)
172  , mName(pName)
173  , mType(eFbxUndefined)
174  , mTypeInfo(pTypeInfo)
175  , mUserTag(0)
176  , mUserData(0)
177  , mFilter(0)
178  {
179  for (int i=0; i<eValueCount; i++) {
180  mMinMaxValue[i] = 0;
181  }
182  }
183 
185  : mRef(0)
186  , mName(pName)
187  , mType(eFbxUndefined)
188  , mTypeInfo(pTypeInfo)
189  , mUserTag(0)
190  , mUserData(0)
191  , mFilter(0)
192  {
193  for (int i=0; i<eValueCount; i++) {
194  mMinMaxValue[i] = 0;
195  }
196  }
197 
198  FbxPropertyInfo(const char* pName, EFbxType pType)
199  : mRef(0)
200  , mName(pName)
201  , mType(pType)
202  , mTypeInfo(0)
203  , mUserTag(0)
204  , mUserData(0)
205  , mFilter(0)
206  {
207  for (int i=0; i<eValueCount; i++) {
208  mMinMaxValue[i] = 0;
209  }
210  }
211  ~FbxPropertyInfo()
212  {
213  for (int i=eValueMin; i<eValueCount; i++) {
214  FbxFree(mMinMaxValue[i]);
215  }
216  }
217 
218  int mRef;
219  FbxStringSymbol mName;
220  FbxStringSymbol mLabel;
221  EFbxType mType;
222  FbxPropertyPage* mTypeInfo;
223  int mUserTag;
224  void* mMinMaxValue[eValueCount];
225  void* mUserData;
226  FbxConnectionPointFilter* mFilter;
228 };
229 
230 #if defined(FBXSDK_COMPILER_MSC)
231  #pragma warning (push)
232  #pragma warning (disable: 4355)
233 #endif
234 
236 {
237 public:
239  static FbxPropertyConnect* Create(FbxPropertyPage* pPage,FbxInt pId) { return FbxNew< FbxPropertyConnect >(pPage,pId); }
240  void Destroy() { FbxDelete(this); }
242  {
243  return FbxNew< FbxPropertyConnect >(pPage,mId);
244  }
245 
246  inline void IncRef() { mRef++; }
247  inline void DecRef() { mRef--; if (mRef==0) FbxDelete(this); }
248  inline int GetRef() { return mRef; }
249 
250 // Properties
251  FbxPropertyPage* GetPage() { return mPage; }
252  FbxInt GetPropertyId() { return mId; }
253 
254 // ClearConnectCache()
255 // ------------------------------------------------------
256  inline void ClearConnectCache()
257  {
258  mConnectionPoint.SubConnectRemoveAll();
259  }
260 
262  inline void WipeAllConnections()
263  {
264  mConnectionPoint.WipeConnectionList();
265  }
266 
267 // Properties
269  {
270  return mConnectionPoint.ConnectSrc(&pSrc->mConnectionPoint,pType);
271  }
273  {
274  return mConnectionPoint.DisconnectSrc(&pSrc->mConnectionPoint);
275  }
277  {
278  return mConnectionPoint.IsConnectedSrc(&pSrc->mConnectionPoint);
279  }
281  {
282  return mConnectionPoint.GetSrcCount(pFilter);
283  }
284  inline FbxPropertyConnect* GetSrc(FbxConnectionPointFilter* pFilter, int pIndex)
285  {
286  FbxConnectionPoint *lCP = mConnectionPoint.GetSrc(pIndex,pFilter);
287  return lCP ? (FbxPropertyConnect * )lCP->GetData() : 0;
288  }
290  {
291  return mConnectionPoint.ConnectDst(&pDst->mConnectionPoint,pType);
292  }
294  {
295  return mConnectionPoint.IsConnectedSrc(&pSrc->mConnectionPoint);
296  }
298  {
299  return mConnectionPoint.DisconnectDst(&pDst->mConnectionPoint);
300  }
302  {
303  return mConnectionPoint.GetDstCount(pFilter);
304  }
305  inline FbxPropertyConnect* GetDst(FbxConnectionPointFilter* pFilter, int pIndex)
306  {
307  FbxConnectionPoint *lCP = mConnectionPoint.GetDst(pIndex,pFilter);
308  return lCP ? (FbxPropertyConnect * )lCP->GetData() : 0;
309  }
310 
311  int mRef;
315 
316 private:
318  mRef(0),
319  mConnectionPoint(this),
320  mPage(pPage),
321  mId(pId)
322  {
323  }
324 
325  ~FbxPropertyConnect(){ if( FbxObject::GetWipeMode() ) mConnectionPoint.WipeConnectionList(); }
326 };
327 
328 #if defined(FBXSDK_COMPILER_MSC)
329  #pragma warning (pop)
330 #endif
331 
333 {
334 public:
335  static FbxPropertyEntry* Create(FbxInt pParentId, FbxPropertyInfo* pInfo, FbxPropertyValue* pValue, FbxPropertyConnect* pConnect){ return FbxNew<FbxPropertyEntry>(pParentId, pInfo, pValue, pConnect); }
336 
337  void Destroy() { FbxDelete(this); }
338 
339  inline FbxInt GetParentId(){ return mParentId; }
340  inline bool IsEmpty(){ return (mInfo || mValue || mConnect || mFlags.GetMask() != 0) ? false : true; }
341 
342  inline FbxPropertyInfo* Get(const FbxPropertyInfo* /*pType*/){ return mInfo; }
343 
344  void Set(FbxPropertyInfo* pInfo)
345  {
346  FbxPropertyInfo* lInfo = mInfo;
347  if( pInfo ) pInfo->IncRef();
348  mInfo = pInfo;
349  if( lInfo ) lInfo->DecRef();
350  }
351 
352  inline FbxPropertyValue* Get(const FbxPropertyValue* /*pType*/){ return mValue; }
353 
354  void Set(FbxPropertyValue* pValue)
355  {
356  FbxPropertyValue* lValue = mValue;
357  if( pValue ) pValue->IncRef();
358  mValue = pValue;
359  if( lValue ) lValue->DecRef();
360  }
361 
362  inline FbxPropertyConnect* Get(const FbxPropertyConnect* /*pType*/){ return mConnect; }
363 
364  void Set(FbxPropertyConnect* pConnect)
365  {
366  FbxPropertyConnect* lConnect = mConnect;
367  if( pConnect ) pConnect->IncRef();
368  mConnect = pConnect;
369  if( lConnect ) lConnect->DecRef();
370  }
371 
372  inline FbxPropertyFlags* Get(const FbxPropertyFlags* /*pType*/){ return &mFlags; }
373  inline void Set(FbxPropertyFlags pType){ mFlags = pType; }
374  inline void Set(FbxPropertyFlags* pType){ mFlags = pType ? *pType : FbxPropertyFlags(FbxPropertyFlags::eNone); }
375 
376 private:
377  FbxPropertyEntry(FbxInt pParentId,FbxPropertyInfo *pInfo,FbxPropertyValue *pValue,FbxPropertyConnect *pConnect) :
378  mInfo(pInfo),
379  mValue(pValue),
380  mConnect(pConnect),
381  mParentId(pParentId),
382  mFlags(FbxPropertyFlags::eNone)
383  {
384  if( mInfo ) mInfo->IncRef();
385  if( mValue ) mValue->IncRef();
386  if( mConnect ) mConnect->IncRef();
387  }
388 
390  {
391  if( mInfo ) mInfo->DecRef();
392  if( mValue ) mValue->DecRef();
393  if( mConnect ) mConnect->DecRef();
394  }
395 
396  FbxPropertyInfo* mInfo;
397  FbxPropertyValue* mValue;
398  FbxPropertyConnect* mConnect;
399  FbxInt mParentId;
400  FbxPropertyFlags mFlags;
401 
403  friend class FbxPropertyPage;
404 };
405 
407 {
408 public:
409  FbxPropertyIdGenerator() : mRef(0), mNextId(0) {}
410 
411  inline FbxInt GetNextId() const { return mNextId; }
412  inline FbxInt GetNextIdAndInc() { return mNextId++; }
413 
414  inline void IncRef() { mRef++; }
415  inline void DecRef() { mRef--; if( mRef == 0 ) FbxDelete(this); }
416 
417 private:
418  FbxInt mRef, mNextId;
419 };
420 
422 {
423 
424 public:
426  static FbxPropertyPage* Create (FbxPropertyPage* pInstanceOf=0) { return FbxNew< FbxPropertyPage >(pInstanceOf); }
427  static FbxPropertyPage* Create (const char* pName, FbxPropertyPage* pTypeInfo) { return FbxNew< FbxPropertyPage >(pName,pTypeInfo); }
428  static FbxPropertyPage* Create (const char* pName, EFbxType pType=eFbxUndefined) { return FbxNew< FbxPropertyPage >(pName,pType); }
429  void Destroy() { FbxDelete(this); }
430 
431  template<class T> inline T* GetPropertyItem(const T* pItemType,FbxInt pIndex,FbxPropertyPage **pFoundIn=0) const
432  {
433  FbxPropertyPage* lReferencePage = 0;
434  FbxPropertyEntry* lReferenceEntry = GetPropertyEntry(pIndex,&lReferencePage);
435  if (pFoundIn) *pFoundIn = 0;
436  if (lReferenceEntry) {
437  T* lItem = lReferenceEntry->Get( FBX_TYPE(T) );
438  if (lItem) {
439  if (pFoundIn) *pFoundIn = lReferencePage;
440  return lItem;
441  } else {
442  return lReferencePage->mInstanceOf ? lReferencePage->mInstanceOf->GetPropertyItem(pItemType,pIndex,pFoundIn) : 0 ;
443  }
444  }
445  return 0;
446  }
447 
448  template<class T> inline T* ChangePropertyItemState(const T* pItemType, FbxInt pIndex, FbxPropertyFlags::EInheritType pInheritType)
449  {
450  FbxPropertyPage* lReferencePage = NULL;
451  T* lItem = GetPropertyItem(pItemType, pIndex, &lReferencePage);
452  if( pInheritType == FbxPropertyFlags::eOverride )
453  {
454  if( lReferencePage == this )
455  {
456  return lItem;
457  }
458  else if( lItem )
459  {
460  FbxPropertyEntry* lEntry = ChangePropertyEntryState(pIndex, FbxPropertyFlags::eOverride);
461  lEntry->Set(lItem->Clone(this));
462  return lEntry->Get(FBX_TYPE(T));
463  }
464  }
465  else
466  {
467  // can't inherit entries that were created on our page.
468  bool lOwnEntry = !mInstanceOf || (mInstanceOf->GetPropertyItem(pItemType, pIndex) == NULL);
469  if( lOwnEntry && FbxPropertyFlags::eInherit == pInheritType) return 0;
470 
471  if( lItem && (lReferencePage == this) )
472  {
473  FbxPropertyEntry* lEntry = GetPropertyEntry(pIndex);
474  lEntry->Set((T*)0);
475  if( lEntry->IsEmpty() )
476  {
477  ChangePropertyEntryState(pIndex, FbxPropertyFlags::eInherit);
478  }
479  }
480  return 0;
481  }
482  return 0;
483  }
484 
485  template<class T> FbxPropertyPage* GetFirstPropertyItem(FbxInt pId, const T* pItem) const
486  {
487  FbxPropertyPage* lReferencePage = NULL;
488  GetPropertyItem(FBX_TYPE(T), pId, &lReferencePage);
489  if( lReferencePage && lReferencePage->mInstanceOf )
490  {
491  FbxPropertyPage* lReferencePage2 = lReferencePage->mInstanceOf->GetFirstPropertyItem(pId, pItem);
492  return lReferencePage2 ? lReferencePage2 : lReferencePage;
493  }
494  return lReferencePage;
495  }
496 
498  {
499  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
500  return lPropertyInfo ? ((const char*)lPropertyInfo->GetName()) : "";
501  }
502 
504  {
505  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
506  return lPropertyInfo ? ((const char*)lPropertyInfo->GetLabel()) : "";
507  }
508 
509  bool SetLabel(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, const char* pLabel="")
510  {
511  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
512  // Don't make it writeable (Keep it shared)
513  if (lPropertyInfo) {
514  lPropertyInfo->SetLabel(pLabel);
515  return true;
516  } else {
517  return false;
518  }
519  }
520 
522  {
523  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
524  return lPropertyInfo ? lPropertyInfo->GetUserData() : 0;
525  }
526 
527  bool SetUserData(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, const void* pUserData=0)
528  {
529  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
530  // Don't make it writeable (Keep it shared)
531  if (lPropertyInfo) {
532  lPropertyInfo->SetUserData(pUserData);
533  return true;
534  } else {
535  return false;
536  }
537  }
538 
540  {
541  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
542  return lPropertyInfo ? lPropertyInfo->GetUserTag() : 0;
543  }
544 
545  bool SetUserTag(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT,int pUserTag=0)
546  {
547  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
548  // Don't make it writeable (Keep it shared)
549  if (lPropertyInfo) {
550  lPropertyInfo->SetUserTag(pUserTag);
551  return true;
552  } else {
553  return false;
554  }
555  }
556 
558  {
559  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
560  return lPropertyInfo ? lPropertyInfo->GetType() : eFbxUndefined;
561  }
562 
564  {
565  FbxPropertyEntry* lPropertyEntry = GetPropertyEntry( pId );
566  return lPropertyEntry ? lPropertyEntry->GetParentId() : FBXSDK_PROPERTY_ID_NULL;
567  }
568 
570  {
571  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
572  return lPropertyInfo ? lPropertyInfo->GetTypeInfo() : 0;
573  }
574  FbxInt Add(FbxInt pParentId, const char* pName, EFbxType pType)
575  {
576  return Add(pParentId,FbxPropertyInfo::Create(pName,pType),FbxPropertyValue::Create(0,pType),0);
577  }
578  FbxInt Add(FbxInt pParentId, const char* pName, FbxPropertyPage* pTypeInfo)
579  {
580  return Add(pParentId,FbxPropertyInfo::Create(pName,pTypeInfo),FbxPropertyValue::Create(0,pTypeInfo->GetType()),0);
581  }
582 
583  inline bool Reparent( FbxInt /*pChildId*/, FbxInt /*pNewParentId*/ )
584  {
585  // Not implemented.
586  /*
587  if( GetParent(pChildId) != pNewParentId && pChildId < mEntries.GetCount() )
588  {
589  FbxPropertyEntry* lChildEntry = mEntries[pChildId];
590  lChildEntry->mParentId = pNewParentId;
591 
592  //@@@@@ TODO: propagate to instances
593 
594  return true;
595  }
596  */
597  return false;
598  }
599 
600  inline bool IsChildOf(FbxInt pId,FbxInt pParentId) const
601  {
602  return GetParent(pId)==pParentId;
603 
604  }
605 
606  inline bool IsDescendentOf(FbxInt pId,FbxInt pAncestorId) const
607  {
608  if (pAncestorId>0) {
609  FbxInt lParentId = GetParent(pId);
610  while (lParentId != FBXSDK_PROPERTY_ID_NULL ) {
611  if (lParentId==pAncestorId) {
612  return true;
613  }
614  lParentId = GetParent(lParentId);
615  }
616  return false;
617  } else {
618  return true;
619  }
620 
621  }
622 
623  //#define PROPERTY_PAGE_SANITY_CHECK // Debug purpose only. Never enable it in a production release.
624 
630  {
631  #ifdef PROPERTY_PAGE_SANITY_CHECK
633  if (pParentId!=FBXSDK_PROPERTY_ID_NULL) {
634  FbxInt lId = GetMinimumPropertyId(pParentId);
635  FbxInt lParentId = GetParent(lId);
636  const FbxInt lLastId = GetPropertyEntryCount();
637 
638  while (lId<lLastId && lParentId!=pParentId) lParentId=GetParent(++lId);
639  ret0 = lId<lLastId ? lId : FBXSDK_PROPERTY_ID_NULL;
640  } else {
642  }
643  #endif
645  if (pParentId != FBXSDK_PROPERTY_ID_NULL)
646  {
647  FbxPropertyEntry* lEntry;
648  FbxInt lId = pParentId;
649  do
650  {
651  lId = GetMinimumPropertyIdAndEntry(lId, &lEntry);
652  } while (lId != FBXSDK_PROPERTY_ID_NULL && lEntry->GetParentId() != pParentId);
653  ret1 = lId;
654  }
655  #ifdef PROPERTY_PAGE_SANITY_CHECK
656  FBX_ASSERT(ret0==ret1);
657  #endif
658  return ret1;
659  }
660 
666  {
667  #ifdef PROPERTY_PAGE_SANITY_CHECK
668  FbxInt pIdBackup = pId;
670  if (pId!=FBXSDK_PROPERTY_ID_NULL) {
671  FbxInt lReferenceParentId = GetParent(pId);
672  FbxInt lParentId = GetParent(++pId);
673  const FbxInt lLastId = GetPropertyEntryCount();
674 
675  while (pId<lLastId && lReferenceParentId!=FBXSDK_PROPERTY_ID_NULL && lParentId!=lReferenceParentId)
676  lParentId=GetParent(++pId);
677  ret0 = pId<lLastId ? pId : FBXSDK_PROPERTY_ID_NULL;
678  } else {
680  }
681  pId = pIdBackup;
682  #endif
684  if (pId != FBXSDK_PROPERTY_ID_NULL)
685  {
686  FbxInt lReferenceParentId = GetParent(pId);
687 
688  if (lReferenceParentId != FBXSDK_PROPERTY_ID_NULL)
689  {
690  FbxPropertyEntry *lEntry;
691  do
692  {
693  pId = GetMinimumPropertyIdAndEntry(pId, &lEntry);
694  } while (pId != FBXSDK_PROPERTY_ID_NULL && lEntry->GetParentId() != lReferenceParentId);
695 
696  ret1 = pId;
697  }
698  }
699 
700  #ifdef PROPERTY_PAGE_SANITY_CHECK
701  FBX_ASSERT(ret0==ret1);
702  #endif
703  return ret1;
704  }
705 
711  {
712  #ifdef PROPERTY_PAGE_SANITY_CHECK
714  if (pAnscestorId!=FBXSDK_PROPERTY_ID_NULL) {
715  FbxInt lId = GetMinimumPropertyId(pAnscestorId);
716  FbxInt lParentId = GetParent(lId);
717  const FbxInt lLastId = GetPropertyEntryCount();
718 
719  while (lId<lLastId) {
720  if( lParentId!=FBXSDK_PROPERTY_ID_NULL && IsDescendentOf(lId,pAnscestorId) )
721  {
722  ret0 = lId;
723  break;
724  }
725  lParentId = GetParent(++lId);
726  }
727  }
728  #endif
730  FbxInt lId = pAnscestorId;
731  FbxPropertyEntry* lEntry;
732  if (pAnscestorId != FBXSDK_PROPERTY_ID_NULL)
733  {
734  for(;;)
735  {
736  lId = GetMinimumPropertyIdAndEntry(lId, &lEntry);
737  if (lId == FBXSDK_PROPERTY_ID_NULL)
738  break;
739  if(lEntry->GetParentId() != FBXSDK_PROPERTY_ID_NULL && IsDescendentOf(lId, pAnscestorId))
740  {
741  ret1 = lId;
742  break;
743  }
744  }
745  }
746 
747  #ifdef PROPERTY_PAGE_SANITY_CHECK
748  FBX_ASSERT(ret0==ret1);
749  #endif
750  return ret1;
751  }
752 
758  FbxInt GetNextDescendent(FbxInt pAnscestorId, FbxInt pId) const
759  {
760  #ifdef PROPERTY_PAGE_SANITY_CHECK
761  FbxInt pIdBackup = pId;
763  if (pId!=FBXSDK_PROPERTY_ID_NULL) {
764  FbxInt lParentId = GetParent(++pId);
765  const FbxInt lLastId = GetPropertyEntryCount();
766 
767  while (pId<lLastId) {
768  // GetParent returns null when the given id isn't in our page,
769  // or our ancestor's page.
770  if( lParentId != FBXSDK_PROPERTY_ID_NULL && IsDescendentOf(pId, pAnscestorId) )
771  {
772  ret0 = pId;
773  break;
774  }
775 
776  lParentId = GetParent(++pId);
777  }
778  }
779 
780  pId = pIdBackup;
781  #endif
783  if (pId != FBXSDK_PROPERTY_ID_NULL)
784  {
785  FbxPropertyEntry* lEntry;
786  for(;;)
787  {
788  pId = GetMinimumPropertyIdAndEntry(pId, &lEntry);
789  if (pId == FBXSDK_PROPERTY_ID_NULL)
790  break;
791  if(lEntry->GetParentId() != FBXSDK_PROPERTY_ID_NULL && IsDescendentOf(pId, pAnscestorId) )
792  {
793  ret1 = pId;
794  break;
795  }
796  }
797 
798  }
799  #ifdef PROPERTY_PAGE_SANITY_CHECK
800  FBX_ASSERT(ret0==ret1);
801  #endif
802  return ret1;
803 
804  }
805 
806  FbxInt FastFind (FbxInt pId, const char* pName, FbxPropertyPage* pTypeInfo, bool pCaseSensitive)
807  {
809 
810  bool lSlowQuery = true;
811  if( mNameMap.mSecond.GetSize() > 0 )
812  {
813  lSlowQuery = false;
814  // try to use the map if we've got it
815  NameMap::RecordType* lIterator = mNameMap.mSecond.Find( FbxNameMapKey( pId, pName ) );
816  if( !lIterator )
817  {
819  }
820  else
821  {
822  lId = lIterator->GetValue();
823  if (lId != FBXSDK_PROPERTY_ID_NULL && pTypeInfo)
824  {
825  lSlowQuery = true;
826 
827  // Try to match types.
828  // If they are mismatched, fall back to the slow query,
829  // since we might have multiple property with the same name but different types
830  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo), lId );
831  if (lPropertyInfo)
832  {
833  FbxPropertyPage* lTypeInfo2 = lPropertyInfo->GetTypeInfo();
834  if ( lTypeInfo2 && lTypeInfo2->Is(pTypeInfo) )
835  {
836  lSlowQuery = false;
837  }
838  }
839  }
840  }
841  }
842 
843  if (!lSlowQuery)
844  return lId;
845 
846  // fall back if there's no map or we got one with a different type
847 
848  lId = GetChild(pId);
849  FbxStringSymbol lSearchSymbol( pName );
850  while( lId != FBXSDK_PROPERTY_ID_NULL ) {
851  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo), lId );
852  if ( (!pTypeInfo || lPropertyInfo->GetTypeInfo()->Is(pTypeInfo)) &&
853  ((!pCaseSensitive && FBXSDK_stricmp(lPropertyInfo->GetName(),pName)==0) ||
854  (pCaseSensitive && lPropertyInfo->GetName() == lSearchSymbol)) ) {
855  return lId;
856  }
857  lId = GetSibling(lId);
858  }
859 
861  }
862 
863  FbxInt Find (FbxInt pId, const char* pName, FbxPropertyPage* pTypeInfo, bool pCaseSensitive, const char* pChildrenSeparators )
864  {
865  if (pChildrenSeparators)
866  {
867  FbxInt lId;
868  size_t lFoundIndex = strcspn(pName,pChildrenSeparators);
869 
870  // Strip the first part of the name and search
871  if (lFoundIndex<strlen(pName))
872  {
873  FbxString pRootName;
874  pRootName.Append(pName,lFoundIndex);
875  lId = FastFind(pId,pRootName.Buffer(),NULL,pCaseSensitive);
876  return lId != FBXSDK_PROPERTY_ID_NULL ? Find(lId,pName+lFoundIndex+1,pTypeInfo,pCaseSensitive,pChildrenSeparators) : lId;
877  } else {
878  return FastFind(pId,pName,pTypeInfo,pCaseSensitive);
879  }
880  } else {
881  return FastFind(pId,pName,pTypeInfo,pCaseSensitive);
882  }
883  }
884 
885 // Enum list
886  int AddEnumValue(FbxInt pId, const char* pStringValue)
887  {
888  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
889  // Don't make it writeable (Keep it shared)
890  return lPropertyInfo ? lPropertyInfo->AddEnumValue(pStringValue) : - 1;
891  }
892 
893  void InsertEnumValue(FbxInt pId, int pIndex, const char* pStringValue)
894  {
895  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
896  // Don't make it writeable (Keep it shared)
897  if (lPropertyInfo) lPropertyInfo->InsertEnumValue(pIndex,pStringValue);
898  }
899 
901  {
902  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
903  // Don't make it writeable (Keep it shared)
904  return lPropertyInfo ? lPropertyInfo->GetEnumCount() : 0;
905  }
906 
907  void SetEnumValue(FbxInt pId, int pIndex, const char* pStringValue)
908  {
909  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
910  // Don't make it writeable (Keep it shared)
911  if (lPropertyInfo) lPropertyInfo->SetEnumValue(pIndex,pStringValue);
912  }
913 
914  void RemoveEnumValue(FbxInt pId, int pIndex)
915  {
916  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
917  // Don't make it writeable (Keep it shared)
918  if (lPropertyInfo) lPropertyInfo->RemoveEnumValue(pIndex);
919  }
920 
921  char* GetEnumValue(FbxInt pId,int pIndex)
922  {
923  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
924  return lPropertyInfo ? lPropertyInfo->GetEnumValue(pIndex) : (char*)"";
925  }
926 
927  // Connection
928  // ---------------------------------
930  {
931  FbxPropertyPage* lReferencePage = 0;
932  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
933 
934  // Connections are not considered propagated so
935  // make sure that we own the FbxPropertyConnect objects
936  if (lPropertyConnect) {
937  lPropertyConnect->ClearConnectCache();
938  }
939  }
940 
942  {
943  FbxPropertyPage* lReferencePage = 0;
944  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
945 
946  if (lPropertyConnect) {
947  lPropertyConnect->WipeAllConnections();
948  }
949  }
950 
951  bool ConnectSrc(FbxInt pDstId, FbxPropertyPage* pSrcPage, FbxInt pSrcId, FbxConnection::EType pType)
952  {
953  FbxPropertyEntry* lDstEntry = ChangePropertyEntryState(pDstId,FbxPropertyFlags::eOverride);
954  FbxPropertyEntry* lSrcEntry = pSrcPage->ChangePropertyEntryState(pSrcId,FbxPropertyFlags::eOverride);
955  FbxPropertyConnect* lDstConnect= lDstEntry->Get( FBX_TYPE(FbxPropertyConnect) );
956  FbxPropertyConnect* lSrcConnect= lSrcEntry->Get( FBX_TYPE(FbxPropertyConnect) );
957 
958  // Make sure we have a connection point on both sides of the connection
959  if (!lDstConnect) {
960  lDstConnect = FbxPropertyConnect::Create( this,pDstId );
961  lDstEntry->Set( lDstConnect );
962  }
963  if (!lSrcConnect) {
964  lSrcConnect = FbxPropertyConnect::Create( pSrcPage,pSrcId );
965  lSrcEntry->Set( lSrcConnect );
966  }
967 
968  // Must @@@@@@@ Propagate to inherited children
969  return lDstConnect->ConnectSrc(lSrcConnect,pType);
970 
971  }
972 
973  bool DisconnectSrc(FbxInt pDstId,FbxPropertyPage* pSrcPage,FbxInt pSrcId)
974  {
975  FbxPropertyPage* lDstReferencePage = 0;
976  FbxPropertyConnect* lDstConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pDstId,&lDstReferencePage );
977  FbxPropertyPage* lSrcReferencePage = 0;
978  FbxPropertyConnect* lSrcConnect = pSrcPage->GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pSrcId,&lSrcReferencePage );
979 
980  // Make sure we have a connection point on both sides of the connection
981  if (lDstConnect && lSrcConnect && lDstReferencePage==this && lSrcReferencePage==pSrcPage) {
982  // Must @@@@@@@ Remove unused connections
983  return lDstConnect->DisconnectSrc(lSrcConnect);
984  }
985  return false;
986  }
987 
988  bool IsConnectedSrc(FbxInt pDstId, FbxPropertyPage* pSrcPage, FbxInt pSrcId)
989  {
990  FbxPropertyPage* lDstReferencePage = 0;
991  FbxPropertyConnect* lDstConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pDstId,&lDstReferencePage );
992  FbxPropertyPage* lSrcReferencePage = 0;
993  FbxPropertyConnect* lSrcConnect = pSrcPage->GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pSrcId,&lSrcReferencePage );
994 
995  // Make sure we have a connection point on both sides of the connection
996  if (lDstConnect && lSrcConnect && lDstReferencePage==this && lSrcReferencePage==pSrcPage) {
997  // Must @@@@@@@ Remove unused connections
998  return lDstConnect->IsConnectedSrc(lSrcConnect);
999  }
1000  return false;
1001  }
1002 
1004  {
1005  FbxPropertyPage* lReferencePage = 0;
1006  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
1007 
1008  // Connections are not considered propagated so
1009  // make sure that we own the FbxPropertyConnect objects
1010  return (lPropertyConnect && lReferencePage==this) ? lPropertyConnect->GetSrcCount(pFilter) : 0;
1011  }
1012 
1013  bool GetSrc(FbxInt pId, int pIndex, FbxConnectionPointFilter* pFilter, FbxPropertyPage** pSrcPage, FbxInt* pSrcId)
1014  {
1015  FbxPropertyPage* lReferencePage = 0;
1016  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
1017 
1018  // Connections are always overridden
1019  // make sure that we own the FbxPropertyConnect Item
1020  if (lPropertyConnect && lReferencePage==this)
1021  {
1022  FbxPropertyConnect* lSrc = lPropertyConnect->GetSrc(pFilter,pIndex);
1023  if (lSrc)
1024  {
1025  if (pSrcPage) *pSrcPage = lSrc->GetPage();
1026  if (pSrcId) *pSrcId = lSrc->GetPropertyId();
1027  return true;
1028  }
1029  }
1030  return false;
1031  }
1032 
1033  bool ConnectDst(FbxInt pSrcId, FbxPropertyPage* pDstPage, FbxInt pDstId, FbxConnection::EType pType)
1034  {
1035  return pDstPage->ConnectSrc(pDstId,this,pSrcId,pType);
1036  }
1037 
1038  bool DisconnectDst(FbxInt pSrcId, FbxPropertyPage* pDstPage, FbxInt pDstId)
1039  {
1040  return pDstPage->DisconnectSrc(pDstId,this,pSrcId);
1041  }
1042 
1043  bool IsConnectedDst(FbxInt pSrcId, FbxPropertyPage* pDstPage, FbxInt pDstId)
1044  {
1045  return pDstPage->IsConnectedSrc(pDstId,this,pSrcId);
1046  }
1047 
1049  {
1050  FbxPropertyPage* lReferencePage = 0;
1051  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
1052 
1053  // Connections are not considered propagated so
1054  // make sure that we own the FbxPropertyConnect objects
1055  return (lPropertyConnect && lReferencePage==this) ? lPropertyConnect->GetDstCount(pFilter) : 0;
1056  }
1057 
1058  bool GetDst(FbxInt pId, int pIndex, FbxConnectionPointFilter* pFilter, FbxPropertyPage** pDstPage, FbxInt* pDstId)
1059  {
1060  FbxPropertyPage* lReferencePage = 0;
1061  FbxPropertyConnect* lPropertyConnect = GetPropertyItem( FBX_TYPE(FbxPropertyConnect),pId,&lReferencePage );
1062 
1063  // Connections are always overridden
1064  // make sure that we own the FbxPropertyConnect Item
1065  if (lPropertyConnect && lReferencePage==this)
1066  {
1067  FbxPropertyConnect* lDst = lPropertyConnect->GetDst(pFilter,pIndex);
1068  if (lDst)
1069  {
1070  if (pDstPage) *pDstPage = lDst->GetPage();
1071  if (pDstId) *pDstId = lDst->GetPropertyId();
1072  return true;
1073  }
1074  }
1075  return false;
1076  }
1077 
1078  // Min and Max
1079  // ---------------------------------
1080  enum EValueIndex { eValueMin,eValueSoftMin,eValueMax,eValueSoftMax,eValueCount };
1081 
1083  {
1084  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
1085 
1086  return lPropertyInfo ? lPropertyInfo->HasMinMax(pValueId) : false;
1087  }
1088 
1089  bool GetMinMax(FbxInt pId, FbxPropertyInfo::EValueIndex pValueId, void* pValue, EFbxType pValueType)
1090  {
1091  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
1092  // Don't make it writeable (Keep it shared)
1093  return lPropertyInfo ? lPropertyInfo->GetMinMax(pValueId,pValue,pValueType) : false;
1094  }
1095 
1096  bool SetMinMax(FbxInt pId, FbxPropertyInfo::EValueIndex pValueId, const void* pValue, EFbxType pValueType)
1097  {
1098  FbxPropertyInfo* lPropertyInfo = GetPropertyItem( FBX_TYPE(FbxPropertyInfo),pId );
1099  // Don't make it writeable (Keep it shared)
1100  return lPropertyInfo ? lPropertyInfo->SetMinMax(pValueId,pValue,pValueType) : false;
1101  }
1102 
1103  // Value
1104  // ---------------------------------
1105  bool Get(FbxInt pId, void* pValue, EFbxType pValueType)
1106  {
1107  FbxPropertyValue* lPropertyValue = GetPropertyItem( FBX_TYPE(FbxPropertyValue),pId );
1108  return lPropertyValue ? lPropertyValue->Get(pValue,pValueType) : 0;
1109  }
1110 
1111  bool Set(FbxInt pId, const void* pValue, EFbxType pValueType, bool pCheckValueEquality)
1112  {
1113  if( pCheckValueEquality )
1114  {
1115  FbxPropertyPage* lReferencePage = NULL;
1116  FbxPropertyValue* lPropertyValue = GetPropertyItem( FBX_TYPE(FbxPropertyValue),pId,&lReferencePage );
1117  void* lCurrentValue = FbxTypeAllocate( pValueType );
1118  bool lValuesEqual = false;
1119  bool lValueChanged = false;
1120  if( lReferencePage && lReferencePage != this )
1121  {
1122  // this page inherits, so check if we have to override the value.
1123  if( lPropertyValue )
1124  {
1125  lPropertyValue->Get( lCurrentValue, pValueType );
1126  lValuesEqual = FbxTypeCompare( pValue, lCurrentValue, pValueType );
1127  }
1128  }
1129  else
1130  {
1131  FbxPropertyPage* lReferencePage2 = NULL;
1132  FbxPropertyValue* lPropertyValue2 = mInstanceOf ? mInstanceOf->GetPropertyItem( FBX_TYPE(FbxPropertyValue),pId,&lReferencePage2 ) : NULL;
1133  if( lReferencePage2 && lPropertyValue2 )
1134  {
1135  // this page is an override, but there is another page before us that overrides the value
1136  lPropertyValue2->Get( lCurrentValue, pValueType );
1137  lValuesEqual = FbxTypeCompare( pValue, lCurrentValue, pValueType );
1138 
1139  if( lValuesEqual )
1140  {
1141  ChangePropertyItemState( FBX_TYPE(FbxPropertyValue), pId, FbxPropertyFlags::eInherit );
1142  lValueChanged = true;
1143  }
1144 
1145  }
1146  // else this page is the originator of the property, so no need to check,
1147  }
1148 
1149  FbxTypeDeallocate(pValueType, lCurrentValue);
1150  lCurrentValue = NULL;
1151 
1152  if( lValuesEqual )
1153  return lValueChanged;
1154  }
1155 
1156  FbxPropertyValue* lPropertyValue = ChangePropertyItemState( FBX_TYPE(FbxPropertyValue),pId,FbxPropertyFlags::eOverride );
1157  return lPropertyValue ? lPropertyValue->Set(pValue,pValueType) : false;
1158  }
1159 
1160  inline FbxPropertyFlags::EInheritType GetValueInherit(FbxInt pId, bool pCheckInstanceOf) const
1161  {
1162  FbxPropertyPage* lReferencePage = NULL;
1163  GetPropertyItem(FBX_TYPE(FbxPropertyValue), pId, &lReferencePage);
1164 
1165  // check one level
1166  if( !pCheckInstanceOf )
1167  {
1168  return lReferencePage == this ? FbxPropertyFlags::eOverride : FbxPropertyFlags::eInherit;
1169  }
1170  else
1171  {
1172  if( lReferencePage == this ) return FbxPropertyFlags::eOverride; // this page is either an override, or the originator
1173  else if( !lReferencePage->mInstanceOf ) return FbxPropertyFlags::eInherit; // the reference is the class root, so we must be inheriting
1174 
1175  // The reference page is not the class root, might be another override, or the originator.
1176  FbxPropertyValue* lPropertyValue = lReferencePage->mInstanceOf->GetPropertyItem( FBX_TYPE(FbxPropertyValue), pId );
1177 
1178  // if lReferencePage->mInstanceOf has the property value,
1179  // lReferencePage is an override
1180  // else
1181  // its the originator, so this page inherits from it.
1182  return lPropertyValue ? FbxPropertyFlags::eOverride : FbxPropertyFlags::eInherit;
1183  }
1184  }
1185 
1187  {
1188  // no support for this mode yet
1189  if( FbxPropertyFlags::eDeleted == pType )
1190  return false;
1191 
1192  ChangePropertyItemState( FBX_TYPE(FbxPropertyValue), pId, pType );
1193 
1194  // Above call doesn't return error codes, so just check that we match types.
1195  return GetValueInherit(pId, false) == pType;
1196  }
1197 
1198  inline bool GetDefaultValue(FbxInt pId, void* pValue, EFbxType pValueType) const
1199  {
1200  FbxPropertyPage* lReferencePage = GetFirstPropertyItem( pId, FBX_TYPE(FbxPropertyValue) );
1201  FbxPropertyValue* lPropertyValue = lReferencePage ? lReferencePage->GetPropertyItem( FBX_TYPE(FbxPropertyValue), pId ) : NULL;
1202 
1203  return lPropertyValue ? lPropertyValue->Get( pValue, pValueType ) : false;
1204  }
1205 
1206 
1207  // useful set and get functions
1208  template <class T> inline bool Set( FbxInt pId, const T& pValue ) { return Set( pId,&pValue,FbxTypeOf(pValue),true ); }
1209  template <class T> inline T Get( FbxInt pId, const T* pFBX_TYPE) { T lValue; Get( pId,&lValue,FbxTypeOf(lValue) ); return lValue; }
1210 
1211 
1212  void SetDataPtr(void* pDataPtr) { mDataPtr = pDataPtr; }
1213  void* GetDataPtr() const { return mDataPtr; }
1214 
1215  // Instance and override management
1216  // ------------------------------------------
1218  {
1219  if (mInstanceOf) {
1220  const int lCount = GetPropertyEntryCount();
1221  // push the existing properties into the parent
1222  // ----------------------------------------------
1223  for( int i = 0; i < lCount; ++i )
1224  {
1225  FbxPropertyEntry* lParentEntry = mInstanceOf->ChangePropertyEntryState( (FbxInt)i,FbxPropertyFlags::eOverride );
1226  FbxPropertyEntry* lEntry = GetPropertyEntry( (FbxInt)i );
1227 
1228  if( !lParentEntry )
1229  {
1230  lParentEntry = FbxPropertyEntry::Create( lEntry->GetParentId(), 0, 0, 0 );
1231  mInstanceOf->mEntryMap.Insert( i, lParentEntry );
1232 
1233  //mInstanceOf->AddChild(i);
1234 
1235  }
1236 
1237  FBX_ASSERT( lParentEntry );
1238 
1239  // Add it to the parent
1240  // Don't touch the connections
1241  // -----------------------------------------
1242  if (lParentEntry) {
1243  lParentEntry->Set( lEntry->Get(FBX_TYPE(FbxPropertyInfo)) );
1244  lParentEntry->Set( lEntry->Get(FBX_TYPE(FbxPropertyValue)) );
1245  lParentEntry->Set( lEntry->Get(FBX_TYPE(FbxPropertyFlags)) );
1246  }
1247 
1248  /*
1249  else {
1250  mInstanceOf->Add(
1251  lEntry->GetParentId(),
1252  lEntry->Get(FBX_TYPE(FbxPropertyInfo)), // The info
1253  lEntry->Get(FBX_TYPE(FbxPropertyValue)), // The Value
1254  0, // The connections
1255  false,
1256  false
1257  );
1258  }
1259  */
1260 
1261  // Empty the current entry
1262  // Don't touch the connections
1263  // -----------------------------------------
1264  ChangePropertyItemState(FBX_TYPE(FbxPropertyInfo), i,FbxPropertyFlags::eInherit);
1265  ChangePropertyItemState(FBX_TYPE(FbxPropertyValue), i,FbxPropertyFlags::eInherit);
1266  ChangePropertyItemState(FBX_TYPE(FbxPropertyFlags), i,FbxPropertyFlags::eInherit);
1267  }
1268  }
1269  }
1270 
1271  inline const FbxPropertyPage* GetInstanceOf() const { return mInstanceOf; }
1272  inline FbxPropertyPage* GetInstanceOf() { return mInstanceOf; }
1273 
1274  inline const FbxArray<FbxPropertyPage*>& GetInstances() const { return mInstances; }
1275  inline FbxArray<FbxPropertyPage*>& GetInstances() { return mInstances; }
1276 
1277 
1278  // Flags
1279  // ------------------------------------------
1281  {
1282  FbxPropertyPage* lFoundIn = NULL;
1283  FbxPropertyFlags* lPropertyFlags = GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId, &lFoundIn );
1285 
1286  if( lPropertyFlags )
1287  {
1288  if( !mInstanceOf ) // no inheritance.
1289  lFlags = lPropertyFlags->GetFlags();
1290  else
1291  {
1292  lFlags = mInstanceOf->GetFlags(pId);
1293  lFlags = lPropertyFlags->GetMergedFlags(lFlags);
1294  }
1295  }
1296  return lFlags;
1297  }
1298 
1299  bool ModifyFlags(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT,FbxPropertyFlags::EFlags pFlags=FbxPropertyFlags::eNone,bool pValue=true,bool pCheckFlagEquality=true)
1300  {
1301  if( pCheckFlagEquality )
1302  {
1303  FbxPropertyPage* lFoundIn = NULL;
1304  FbxPropertyFlags* lFlag = GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId, &lFoundIn );
1305 
1306  if( lFlag )
1307  {
1308  if( lFoundIn == this )
1309  {
1310  // set them in us.
1311  lFlag->ModifyFlags( pFlags, pValue );
1312 
1313  // we override this entry, check if we need to revert
1314  FbxPropertyFlags* lInheritedFlags = mInstanceOf ? mInstanceOf->GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId ) : NULL;
1315  if( lInheritedFlags && lInheritedFlags->Equal( *lFlag, pFlags ) )
1316  {
1317  lFlag->UnsetMask( pFlags );
1318 
1319  if( lFlag->GetMask() == 0 )
1320  ChangePropertyItemState( FBX_TYPE(FbxPropertyFlags), pId, FbxPropertyFlags::eInherit );
1321 
1322  return true;
1323  }
1324  }
1325  else
1326  {
1327  // its not us. Just check if we need to set.
1328  FbxPropertyFlags lNewValues( pFlags );
1329  if( lFlag->Equal( lNewValues, pFlags ) )
1330  return true;
1331  }
1332  }
1333  }
1334 
1335  FbxPropertyFlags* lPropertyFlags = ChangePropertyItemState(FBX_TYPE(FbxPropertyFlags), pId, FbxPropertyFlags::eOverride);
1336  return lPropertyFlags ? lPropertyFlags->ModifyFlags( pFlags, pValue ) : false;
1337  }
1338 
1340  {
1341  FbxPropertyPage* lFoundIn = NULL;
1342  FbxPropertyFlags* lPropertyFlags = GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId, &lFoundIn );
1343 
1344  if( !pCheckInstanceOf )
1345  return lFoundIn != this ? FbxPropertyFlags::eInherit : ( lPropertyFlags ? lPropertyFlags->GetFlagsInheritType(pFlags) : FbxPropertyFlags::eInherit );
1346  else
1347  {
1348  // This code basically counts the number of overrides for the
1349  // given flags. The original entry is always considered an override.
1350  // so if we see more than one, something overrode the original.
1351  // and thus we are an override.
1352  FbxPropertyPage* lRefPage = lFoundIn;
1353  bool lFoundOverride = false;
1354  while( lRefPage )
1355  {
1356  lPropertyFlags = lRefPage->GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId );
1357 
1358  if( !lPropertyFlags )
1359  break; // gone too far, break.
1360 
1361  if( lPropertyFlags->GetFlagsInheritType( pFlags ) == FbxPropertyFlags::eOverride )
1362  {
1363  if( this == lRefPage || lFoundOverride )
1364  return FbxPropertyFlags::eOverride; // found two overrides or this page is the override.
1365  else
1366  lFoundOverride = true; // signal that we found the first override.
1367  }
1368  lRefPage = lRefPage->mInstanceOf;
1369  }
1370 
1372  }
1373  }
1374 
1376  {
1377  FbxPropertyPage* lFoundIn = NULL;
1378  FbxPropertyFlags* lPropertyFlags = NULL;
1379 
1380  if( FbxPropertyFlags::eOverride == pInheritType )
1381  {
1382  lPropertyFlags = ChangePropertyItemState( FBX_TYPE(FbxPropertyFlags), pId, FbxPropertyFlags::eOverride );
1383 
1384  // we should initialize our flag to the inherited value, if any.
1385  FbxPropertyFlags* lParentFlags = mInstanceOf ? mInstanceOf->GetPropertyItem( FBX_TYPE(FbxPropertyFlags), pId ) : NULL;
1386  if( lParentFlags && lPropertyFlags )
1387  {
1388  FbxPropertyFlags::EFlags lParentValues = lParentFlags->GetFlags();
1389  lPropertyFlags->SetFlags( pFlags, lParentValues );
1390  return lPropertyFlags->SetMask( pFlags );
1391  }
1392 
1393  return false;
1394  }
1395  else if( FbxPropertyFlags::eInherit == pInheritType )
1396  {
1397  lPropertyFlags = GetPropertyItem(FBX_TYPE(FbxPropertyFlags), pId, &lFoundIn);
1398  if( !lPropertyFlags ) return false;
1399  if( lFoundIn != this ) return true; // not us
1400  lPropertyFlags->UnsetMask( pFlags );
1401  if( lPropertyFlags->GetMask() == 0 ) // revert
1402  ChangePropertyItemState( FBX_TYPE(FbxPropertyFlags), pId, FbxPropertyFlags::eInherit );
1403 
1404  return true;
1405  }
1406  return false;
1407  }
1408 
1410  {
1411  if( 0 == mNameMap.mFirst )
1412  {
1413  mNameMap.mSecond.Reserve(20);
1414 
1415  // push the existing properties into the map. Note: this includes the root property!
1416  FbxInt lFoundId = FBXSDK_PROPERTY_ID_ROOT;
1417  FbxPropertyEntry* lEntry = GetPropertyEntry(lFoundId);
1418  while(lFoundId != FBXSDK_PROPERTY_ID_NULL)
1419  {
1420  FbxPropertyInfo* lInfo = lEntry->Get(FBX_TYPE(FbxPropertyInfo));
1421  //FBX_ASSERT( lInfo );
1422  if (lInfo)
1423  {
1424  mNameMap.mSecond.Insert(FbxNameMapKey(lEntry->GetParentId(), lInfo->GetName()), lFoundId);
1425  }
1426  lFoundId = GetMinimumPropertyIdAndEntry(lFoundId, &lEntry);
1427  }
1428  mNameMap.mFirst++;
1429  }
1430  }
1431 
1433  {
1434  if( mNameMap.mFirst > 0 )
1435  {
1436  if( --(mNameMap.mFirst) == 0 )
1437  mNameMap.mSecond.Clear();
1438  }
1439  }
1440 
1441 protected:
1443  : mInstanceOf(0)
1444  , mDataPtr(0)
1445  , mPropNextId(0)
1446  {
1447  mEntryMap.Reserve(32);
1448  mNameMap.mFirst = 0;
1449 
1450  // instances don't need to create a root property
1451  if( !pInstanceOf )
1452  {
1453  mPropNextId = FbxNew< FbxPropertyIdGenerator >();
1454  mPropNextId->IncRef();
1455 
1456  // First item is the root information
1458  }
1459 
1460  // Hook the instances
1461  // ------------------------
1462  mInstanceOf = pInstanceOf;
1463  if (mInstanceOf) {
1464  mInstanceOf->mInstances.Add(this);
1465 
1466  mPropNextId = mInstanceOf->mPropNextId;
1467  mPropNextId->IncRef();
1468  }
1469  }
1470  FbxPropertyPage(const char* pName, EFbxType pType)
1471  : mInstanceOf(0)
1472  , mDataPtr(0)
1473  , mPropNextId(0)
1474  {
1475  mEntryMap.Reserve(32);
1476  mNameMap.mFirst = 0;
1477 
1478  mPropNextId = FbxNew< FbxPropertyIdGenerator >();
1479  mPropNextId->IncRef();
1480 
1481  // First item is the root information
1482  Add(FBXSDK_PROPERTY_ID_NULL,pName,pType);
1483  }
1484  FbxPropertyPage(const char* pName, FbxPropertyPage* pTypeInfo)
1485  : mInstanceOf(0)
1486  , mDataPtr(0)
1487  , mPropNextId(0)
1488  {
1489  mEntryMap.Reserve(32);
1490  mNameMap.mFirst = 0;
1491 
1492  mPropNextId = FbxNew< FbxPropertyIdGenerator >();
1493  mPropNextId->IncRef();
1494 
1495  // First item is the root information
1496  Add(FBXSDK_PROPERTY_ID_NULL,pName,pTypeInfo);
1497  }
1499  {
1500  // Propagate our property entries.
1501  int i = 0, j = 0;
1502  for( i = 0; i < mInstances.GetCount(); ++i )
1503  {
1504  for( j = 0; j < GetPropertyEntryCount(); ++j )
1505  {
1506  if( mInstances[i]->ChangePropertyEntryState((FbxInt)j, FbxPropertyFlags::eOverride) )
1507  {
1508  // Clone the info and values. Don't clone the connections,
1509  // since they aren't propagated.
1510  mInstances[i]->ChangePropertyItemState( FBX_TYPE(FbxPropertyInfo), (FbxInt)j, FbxPropertyFlags::eOverride );
1511  mInstances[i]->ChangePropertyItemState( FBX_TYPE(FbxPropertyValue), (FbxInt)j, FbxPropertyFlags::eOverride );
1512 
1513  // Since all entries have their own flags, just override the ones in the instance.
1514  mInstances[i]->SetFlagsInheritType(FbxPropertyFlags::eOverride, FbxPropertyFlags::eAllFlags, (FbxInt)j );
1515  }
1516  }
1517 
1518  // Instances become their own copies.
1519  mInstances[i]->mInstanceOf = NULL;
1520  }
1521 
1522  FbxMapDestroy(mEntryMap);
1523 
1524  if (mInstanceOf) {
1525  int lIndex = mInstanceOf->mInstances.Find(this);
1526  mInstanceOf->mInstances.SetAt(lIndex, mInstanceOf->mInstances[mInstanceOf->mInstances.GetCount()-1]);
1527  mInstanceOf->mInstances.RemoveAt(mInstanceOf->mInstances.GetCount()-1);
1528 
1529  //mInstanceOf->mInstances.RemoveIt(this);
1530  }
1531 
1532  mPropNextId->DecRef();
1533  mPropNextId = NULL;
1534 
1535  mInstanceOf = NULL;
1536  mInstances.Clear();
1537  }
1538 
1539  inline bool Is(FbxPropertyPage* pPage)
1540  {
1541  // @@@@@@@@@@@@@@@ Must complete for sub types
1542  return this==pPage;
1543  }
1544 
1545 // Internal entry management
1546 private:
1547 
1553  FbxInt GetMinimumPropertyId(FbxInt pId, bool pIncrementIfNone = true) const
1554  {
1555  if( pId == FBXSDK_PROPERTY_ID_NULL )
1557 
1559  const EntryMap::RecordType* lElement = mEntryMap.UpperBound(pId);
1560  if (NULL != lElement)
1561  {
1562  lMin = lElement->GetKey();
1563  }
1564 
1565  FbxInt lParentMin = mInstanceOf ? mInstanceOf->GetMinimumPropertyId(pId,false) : FBXSDK_PROPERTY_ID_NULL;
1566 
1567  bool lParentNull = lParentMin == FBXSDK_PROPERTY_ID_NULL;
1568  bool lMinNull = lMin == FBXSDK_PROPERTY_ID_NULL;
1569 
1570  if( lParentNull && lMinNull ) return pIncrementIfNone ? pId+1 : FBXSDK_PROPERTY_ID_NULL;
1571  else if( lMinNull ) lMin = lParentMin;
1572  else if( !lParentNull ) lMin = lMin < lParentMin ? lMin : lParentMin;
1573 
1574  return lMin;
1575  }
1576 
1582  FbxInt GetMinimumPropertyIdAndEntry(FbxInt pId, FbxPropertyEntry** pEntry) const
1583  {
1584  FbxInt lFoundId = FBXSDK_PROPERTY_ID_NULL;
1585  FbxPropertyEntry* lFoundEntry = NULL;
1586  if( pId == FBXSDK_PROPERTY_ID_NULL )
1588 
1589  const EntryMap::RecordType* lElement = mEntryMap.UpperBound(pId);
1590  if (NULL != lElement)
1591  {
1592  lFoundId = lElement->GetKey();
1593  lFoundEntry = lElement->GetValue();
1594  }
1595 
1596  FbxPropertyEntry* lParentEntry = NULL;
1597  FbxInt lParentMin = mInstanceOf ? mInstanceOf->GetMinimumPropertyIdAndEntry(pId, &lParentEntry) : FBXSDK_PROPERTY_ID_NULL;
1598 
1599  bool lParentNull = lParentMin == FBXSDK_PROPERTY_ID_NULL;
1600  bool lMinNull = lFoundId == FBXSDK_PROPERTY_ID_NULL;
1601 
1602  if( lMinNull && !lParentNull )
1603  {
1604  lFoundId = lParentMin;
1605  lFoundEntry = lParentEntry;
1606  }
1607  else if( !lMinNull && !lParentNull )
1608  {
1609  lFoundId = lFoundId < lParentMin ? lFoundId : lParentMin;
1610  lFoundEntry = lFoundId < lParentMin ? lFoundEntry : lParentEntry;
1611  }
1612 
1613  if (pEntry)
1614  *pEntry = lFoundEntry;
1615  return lFoundId;
1616  }
1617 
1618  int GetPropertyEntryCount() const
1619  {
1620  int lCount = 0;
1621  const EntryMap::RecordType* lElement = mEntryMap.Maximum();
1622 
1623  if (NULL != lElement)
1624  {
1625  lCount = lElement->GetKey() + 1;
1626  }
1627 
1628  int lParentCount = mInstanceOf ? mInstanceOf->GetPropertyEntryCount() : 0;
1629  return lParentCount > lCount ? lParentCount : lCount;
1630  }
1631 
1632  FbxPropertyEntry* GetPropertyEntry(FbxInt pIndex,FbxPropertyPage **pFoundIn=0) const
1633  {
1634  const EntryMap::RecordType* lElement = mEntryMap.Find(pIndex);
1635  if (NULL != lElement)
1636  {
1637  if( pFoundIn )
1638  {
1639  *pFoundIn = const_cast<FbxPropertyPage*>(this);
1640  }
1641  return lElement->GetValue();
1642  }
1643 
1644  if( pFoundIn )
1645  {
1646  *pFoundIn = 0;
1647  }
1648 
1649  return mInstanceOf ? mInstanceOf->GetPropertyEntry(pIndex,pFoundIn) : 0;
1650  }
1651 
1652  FbxPropertyEntry* ChangePropertyEntryState(FbxInt pIndex,FbxPropertyFlags::EInheritType pInheritType)
1653  {
1654  FbxPropertyPage* lReferencePage = 0;
1655  FbxPropertyEntry* lReferenceEntry = GetPropertyEntry(pIndex,&lReferencePage);
1656 
1657  if (pInheritType==FbxPropertyFlags::eOverride) {
1658  if (lReferencePage==this) {
1659  return lReferenceEntry;
1660  } else if (lReferenceEntry) {
1661  // must create an entry
1662  FbxPropertyEntry* lEntry = FbxPropertyEntry::Create(lReferenceEntry->GetParentId(),0,0,0);
1663  mEntryMap.Insert( pIndex, lEntry );
1664 
1665  return lEntry;
1666  }
1667  } else {
1668  if (lReferenceEntry && (lReferencePage==this)) {
1669  mEntryMap.Remove(pIndex);
1670  lReferenceEntry->Destroy();
1671  }
1672  }
1673  return 0;
1674  }
1675 
1676  FbxInt Add(FbxInt pParentId,FbxPropertyInfo* pInfo,FbxPropertyValue* pValue,FbxPropertyConnect* pConnect,bool pRecursive=true)
1677  {
1678  FbxInt lId = mPropNextId->GetNextIdAndInc();
1679  FbxPropertyEntry* lEntry = FbxPropertyEntry::Create(pParentId,pInfo,pValue,pConnect);
1680 
1681  // entries created through Add() are not overrides of another entry.
1682  // Thus, set all of their flags by default.
1683  FbxPropertyFlags* lFlags = lEntry->Get( FBX_TYPE(FbxPropertyFlags) );
1684  if( lFlags ) lFlags->ModifyFlags( FbxPropertyFlags::eAllFlags, false );
1685 
1686  mEntryMap.Insert( lId, lEntry );
1687 
1688  // We only add to the map if this Add is called after BeginCreateOrFindProperty()
1689  // in which case the size is always > 0 because it includes the root property
1690  if( mNameMap.mSecond.GetSize() > 0 )
1691  mNameMap.mSecond.Insert( FbxNameMapKey( pParentId, pInfo->GetName()), lId );
1692 
1693  // If the entry has multiple children(Struct Datatype)
1694  // Recurse for the entries and create an entry in this structure
1695  if (pRecursive) {
1696  FbxPropertyPage* lTypeInfo = pInfo->GetTypeInfo();
1697  if (lTypeInfo) {
1698  FbxInt lChildId;
1699  lChildId = lTypeInfo->GetChild();
1700  while (lChildId!=FBXSDK_PROPERTY_ID_NULL) {
1701  FbxPropertyInfo* lPropertyInfo = lTypeInfo->GetPropertyItem( FBX_TYPE(FbxPropertyInfo),lChildId );
1702  FbxPropertyValue* lPropertyValue = lTypeInfo->GetPropertyItem( FBX_TYPE(FbxPropertyValue),lChildId );
1703  FbxPropertyConnect* lPropertyConnect = lTypeInfo->GetPropertyItem( FBX_TYPE(FbxPropertyConnect),lChildId );
1704 
1705  Add ( lId, lPropertyInfo ? lPropertyInfo->Clone(this) : 0 , lPropertyValue ? lPropertyValue->Clone(this) : 0,
1706  lPropertyConnect ? lPropertyConnect->Clone(this) : 0 );
1707  lChildId = lTypeInfo->GetSibling(lChildId );
1708  }
1709  }
1710  }
1711  return lId;
1712  }
1713 
1714  // Property management
1716  EntryMap mEntryMap;
1717 
1718  // instance management
1719  FbxPropertyPage* mInstanceOf;
1720  FbxArray<FbxPropertyPage*> mInstances;
1721 
1722  void* mDataPtr;
1723 
1724  // speed up structure
1726  typedef FbxPair<unsigned int, NameMap > NameLookupPair;
1727  NameLookupPair mNameMap;
1728 
1729  FbxPropertyIdGenerator* mPropNextId;
1730 
1731  friend class FbxPropertyHandle;
1732 };
1733 
1734 #include <fbxsdk/fbxsdk_nsend.h>
1735 
1736 #endif /* _FBXSDK_CORE_PROPERTY_PAGE_H_ */
FbxInt Add(FbxInt pParentId, const char *pName, EFbxType pType)
int GetUserTag() const
FbxConnectionPoint mConnectionPoint
void PushPropertiesToParentInstance()
bool ConnectDst(FbxPropertyConnect *pDst, FbxConnection::EType pType)
FbxPropertyPage * GetInstanceOf()
Class to manage property handle.
bool UnsetMask(FbxPropertyFlags::EFlags pFlags)
FBX SDK environment definition.
bool Get(FbxInt pId, void *pValue, EFbxType pValueType)
int GetSrcCount(FbxInt pId, FbxConnectionPointFilter *pFilter)
#define FBXSDK_PROPERTY_ID_NULL
#define FBXSDK_FRIEND_NEW()
Definition: fbxnew.h:397
void SetLabel(const char *pLabel)
FbxPropertyConnect * GetSrc(FbxConnectionPointFilter *pFilter, int pIndex)
FbxPropertyPage * GetTypeInfo() const
bool ConnectSrc(FbxInt pDstId, FbxPropertyPage *pSrcPage, FbxInt pSrcId, FbxConnection::EType pType)
void FbxMapDestroy(FbxMap< K, V, C, A > &pMap)
Call Destroy on each element of the map, and then clear it.
Definition: fbxmap.h:394
void SetUserTag(int pUserTag)
Unidentified.
FbxPropertyFlags::EFlags GetFlags() const
FbxPropertyInfo * Get(const FbxPropertyInfo *)
EFlags
Property flags that affect their behaviors.
FbxStringSymbol GetName() const
bool HasMinMax(EValueIndex pId) const
bool Set(const void *pValue, EFbxType pValueType)
bool DisconnectSrc(FbxInt pDstId, FbxPropertyPage *pSrcPage, FbxInt pSrcId)
void InsertEnumValue(FbxInt pId, int pIndex, const char *pStringValue)
#define NULL
Definition: fbxarch.h:207
FbxPropertyPage * GetPage()
FBXSDK_DLL bool FbxTypeDeallocate(const EFbxType pType, void *pData)
Destroys an fbx primitive type.
This class is to mark a string as symbol.
Definition: fbxsymbol.h:81
bool ModifyFlags(FbxPropertyFlags::EFlags pFlags, bool pValue)
Utility class to manipulate strings.
Definition: fbxstring.h:66
FbxConnectionPoint * GetSrc(int pIndex) const
FbxConnectionPoint * GetDst(int pIndex) const
FbxPropertyPage(const char *pName, EFbxType pType)
FbxPropertyFlags::EInheritType GetValueInherit(FbxInt pId, bool pCheckInstanceOf) const
FbxPropertyPage * mPage
void InsertEnumValue(int pIndex, const char *pStringValue)
void WipeAllConnections()
Clear all connect without sending any notification (Internal use ONLY)
bool Set(FbxInt pId, const T &pValue)
T Get(FbxInt pId, const T *pFBX_TYPE)
char * GetEnumValue(FbxInt pId, int pIndex)
FbxInt GetChild(FbxInt pParentId=FBXSDK_PROPERTY_ID_ROOT) const
Retrieves the first child property id of a specified property id.
void Set(FbxPropertyInfo *pInfo)
bool SetFlagsInheritType(FbxPropertyFlags::EInheritType pInheritType, FbxPropertyFlags::EFlags pFlags, FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
FbxPropertyConnect * Get(const FbxPropertyConnect *)
bool SetMask(FbxPropertyFlags::EFlags pFlags)
FbxPropertyFlags * Get(const FbxPropertyFlags *)
FbxPair< FbxInt, const char * > FbxNameMapKey
FbxPropertyPage(const char *pName, FbxPropertyPage *pTypeInfo)
void SetEnumValue(FbxInt pId, int pIndex, const char *pStringValue)
This allocator only frees the allocated memory when it is deleted.
void Set(FbxPropertyConnect *pConnect)
int GetDstCount(FbxConnectionPointFilter *pFilter)
bool IsDescendentOf(FbxInt pId, FbxInt pAncestorId) const
bool IsConnectedSrc(FbxInt pDstId, FbxPropertyPage *pSrcPage, FbxInt pSrcId)
Property override this flag from its reference property.
static FbxPropertyConnect * Create(FbxPropertyPage *pPage, FbxInt pId)
static FbxPropertyEntry * Create(FbxInt pParentId, FbxPropertyInfo *pInfo, FbxPropertyValue *pValue, FbxPropertyConnect *pConnect)
int GetSrcCount(FbxConnectionPointFilter *pFilter)
bool Reparent(FbxInt, FbxInt)
Property inherit this flag from its reference property.
static FbxPropertyPage * Create(const char *pName, EFbxType pType=eFbxUndefined)
static FbxPropertyInfo * Create(const char *pName, FbxPropertyPage *pTypeInfo)
void Set(FbxPropertyFlags *pType)
void BeginCreateOrFindProperty()
bool GetMinMax(FbxInt pId, FbxPropertyInfo::EValueIndex pValueId, void *pValue, EFbxType pValueType)
bool ModifyFlags(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, FbxPropertyFlags::EFlags pFlags=FbxPropertyFlags::eNone, bool pValue=true, bool pCheckFlagEquality=true)
const FbxArray< FbxPropertyPage * > & GetInstances() const
bool ConnectDst(FbxInt pSrcId, FbxPropertyPage *pDstPage, FbxInt pDstId, FbxConnection::EType pType)
This class implements an efficient map based on key comparison, which stores key-value pairs...
Definition: fbxmap.h:68
bool GetMinMax(EValueIndex pId, void *pValue, EFbxType pValueType) const
EFbxType
Type identifier constants.
FbxInt GetParent(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT) const
bool IsConnectedSrc(FbxPropertyConnect *pSrc)
bool SetUserData(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, const void *pUserData=0)
FbxPropertyFlags::EInheritType GetFlagsInheritType(FbxPropertyFlags::EFlags pFlags) const
void EndCreateOrFindProperty()
bool IsEmpty()
FbxPropertyFlags::EFlags GetMergedFlags(FbxPropertyFlags::EFlags pFlags) const
bool SetFlags(FbxPropertyFlags::EFlags pMask, FbxPropertyFlags::EFlags pFlags)
bool IsChildOf(FbxInt pId, FbxInt pParentId) const
void SetUserData(const void *pUserData)
FbxInt GetSibling(FbxInt pId) const
Retrieves the next sibling property id of a specified property id.
static FbxPropertyInfo * Create(const char *pName, EFbxType pType=eFbxUndefined)
const FbxPropertyPage * GetInstanceOf() const
FbxInt GetFirstDescendent(FbxInt pAnscestorId=FBXSDK_PROPERTY_ID_ROOT) const
Retrieves the first descendent property id of a specified property id.
T * GetPropertyItem(const T *pItemType, FbxInt pIndex, FbxPropertyPage **pFoundIn=0) const
FbxPropertyInfo * Clone(FbxPropertyPage *)
This class template holds a pair of objects.
Definition: fbxpair.h:22
T * ChangePropertyItemState(const T *pItemType, FbxInt pIndex, FbxPropertyFlags::EInheritType pInheritType)
const char * GetName(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
bool IsConnectedDst(FbxInt pSrcId, FbxPropertyPage *pDstPage, FbxInt pDstId)
void Set(FbxPropertyValue *pValue)
EFbxType FbxTypeOf(const FbxChar &)
FBXSDK_DLL const size_t FbxTypeSizeOf(const EFbxType pType)
Retrieve a type enumeration memory footprint size.
void * GetDataPtr() const
FbxPropertyValue * Get(const FbxPropertyValue *)
FbxPropertyConnect * Clone(FbxPropertyPage *pPage)
bool Set(FbxInt pId, const void *pValue, EFbxType pValueType, bool pCheckValueEquality)
FbxPropertyValue * Clone(FbxPropertyPage *)
FbxInt GetParentId()
void Set(FbxPropertyFlags pType)
char * Buffer()
Non-const buffer access.
bool SetMinMax(EValueIndex pId, const void *pValue, EFbxType pValueType)
#define FBX_TYPE(class)
Convert the class type parameter into a C class parameter for other function inputs.
Definition: fbxobject.h:1531
Class to manage Connect Filter.
bool IsConnectedDst(FbxPropertyConnect *pSrc)
const char * GetLabel(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
const FbxString & Append(const char *pString, size_t pLength)
Append as "C" strncat().
FbxArray< FbxPropertyPage * > & GetInstances()
FbxPropertyPage * GetTypeInfo(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
#define FBXSDK_PROPERTY_ID_ROOT
int operator()(const FbxNameMapKey &pKeyA, const FbxNameMapKey &pKeyB) const
FbxInt GetNextDescendent(FbxInt pAnscestorId, FbxInt pId) const
Retrieves the next descendent property id of a specified property id, with given a descendent propert...
bool SetUserTag(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, int pUserTag=0)
Enumeration.
EFbxType GetType() const
void RemoveEnumValue(FbxInt pId, int pIndex)
Second mSecond
The second object in the pair.
Definition: fbxpair.h:57
FbxInt GetNextId() const
void ClearConnectCache(FbxInt pId)
FBXSDK_DLL bool FbxTypeCompare(const void *pA, const void *pB, const EFbxType pType)
Compare two values of the same type.
FbxPropertyConnect * GetDst(FbxConnectionPointFilter *pFilter, int pIndex)
bool FbxTypeCopy(T1 &, const T2 &)
FbxPropertyPage(FbxPropertyPage *pInstanceOf=0)
FbxInt FastFind(FbxInt pId, const char *pName, FbxPropertyPage *pTypeInfo, bool pCaseSensitive)
void * GetUserData(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
FbxPropertyFlags::EFlags GetFlags(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT) const
bool HasMinMax(FbxInt pId, FbxPropertyInfo::EValueIndex pValueId) const
int GetUserTag(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT)
#define FBXSDK_DLL
Definition: fbxarch.h:170
FbxPropertyFlags::EFlags GetMask() const
bool GetDst(FbxInt pId, int pIndex, FbxConnectionPointFilter *pFilter, FbxPropertyPage **pDstPage, FbxInt *pDstId)
const char * GetLabel() const
bool SetValueInherit(FbxInt pId, FbxPropertyFlags::EInheritType pType)
bool DisconnectDst(FbxInt pSrcId, FbxPropertyPage *pDstPage, FbxInt pDstId)
signed int FbxInt
Definition: fbxtypes.h:39
void FbxDelete(T *p)
Definition: fbxnew.h:341
bool DisconnectSrc(FbxPropertyConnect *pSrc)
FBXSDK_DLL void * FbxTypeAllocate(const EFbxType pType)
Creates a fbx primitive type and initializes its memory.
void * GetUserData() const
void SetDataPtr(void *pDataPtr)
First mFirst
The first object in the pair.
Definition: fbxpair.h:56
static FbxPropertyValue * Create(void *pData, EFbxType pType)
static FbxPropertyPage * Create(FbxPropertyPage *pInstanceOf=0)
int AddEnumValue(const char *pStringValue)
int AddEnumValue(FbxInt pId, const char *pStringValue)
FbxPropertyFlags::EInheritType GetFlagsInheritType(FbxPropertyFlags::EFlags pFlags, bool pCheckInstanceOf, FbxInt pId=FBXSDK_PROPERTY_ID_ROOT) const
bool SetLabel(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT, const char *pLabel="")
char * GetEnumValue(int pIndex)
bool GetDefaultValue(FbxInt pId, void *pValue, EFbxType pValueType) const
bool ConnectSrc(FbxPropertyConnect *pSrc, FbxConnection::EType pType)
bool Equal(const FbxPropertyFlags &pOther, FbxPropertyFlags::EFlags pFlags) const
void WipeAllConnections(FbxInt pId)
EFbxType GetType(FbxInt pId=FBXSDK_PROPERTY_ID_ROOT) const
bool GetSrc(FbxInt pId, int pIndex, FbxConnectionPointFilter *pFilter, FbxPropertyPage **pSrcPage, FbxInt *pSrcId)
FbxInt Add(FbxInt pParentId, const char *pName, FbxPropertyPage *pTypeInfo)
bool SetMinMax(FbxInt pId, FbxPropertyInfo::EValueIndex pValueId, const void *pValue, EFbxType pValueType)
FbxPropertyPage * GetFirstPropertyItem(FbxInt pId, const T *pItem) const
void RemoveEnumValue(int pIndex)
Property has been deleted, so inheritance is invalid.
void SetEnumValue(int pIndex, const char *pStringValue)
EInheritType
Property inherit types.
int GetEnumCount(FbxInt pId)
static FbxPropertyPage * Create(const char *pName, FbxPropertyPage *pTypeInfo)
bool Is(FbxPropertyPage *pPage)
FbxInt Find(FbxInt pId, const char *pName, FbxPropertyPage *pTypeInfo, bool pCaseSensitive, const char *pChildrenSeparators)
bool DisconnectDst(FbxPropertyConnect *pDst)
StorageType::RecordType RecordType
Definition: fbxmap.h:98
bool Get(void *pValue, EFbxType pValueType)
void Destroy()
int GetDstCount(FbxInt pId, FbxConnectionPointFilter *pFilter)