1/****************************************************************************************
2
3 Copyright (C) 2015 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
12//! \file fbxbindingtablebase.h
13#ifndef _FBXSDK_SCENE_SHADING_BINDING_TABLE_BASE_H_
14#define _FBXSDK_SCENE_SHADING_BINDING_TABLE_BASE_H_
15
16#include <fbxsdk/fbxsdk_def.h>
17
18#include <fbxsdk/core/fbxobject.h>
19#include <fbxsdk/scene/shading/fbxbindingtableentry.h>
20#include <fbxsdk/core/base/fbxdynamicarray.h>
21
22#include <fbxsdk/fbxsdk_nsbegin.h>
23
24/** A binding table represents a collection of bindings
25 * from source types such as FbxObject, or FbxLayerElements
26 * to destinations which can be of similar types.
27 * \see FbxBindingTableEntry.
28 * \nosubgrouping
29 */
30class FBXSDK_DLL FbxBindingTableBase : public FbxObject
31{
32 FBXSDK_ABSTRACT_OBJECT_DECLARE(FbxBindingTableBase,FbxObject);
33
34public:
35 /** Adds a new entry to the binding table.
36 * \return The new entry.
37 */
38 FbxBindingTableEntry& AddNewEntry();
39
40 /** Query the number of table entries.
41 * \return The number of entries.
42 */
43 size_t GetEntryCount() const;
44
45 /** Access a table entry.
46 * \param pIndex Valid range is [0, GetEntryCount()-1].
47 * \return A valid table entry if pIndex is valid. Otherwise the value is undefined.
48 */
49 FbxBindingTableEntry const& GetEntry( size_t pIndex ) const;
50
51 /** Access a table entry.
52 * \param pIndex Valid range is [0, GetEntryCount()-1].
53 * \return A valid table entry if pIndex is valid. Otherwise the value is undefined.
54 */
55 FbxBindingTableEntry& GetEntry( size_t pIndex );
56
57 /** Retrieve the table entry for the given source value.
58 * \param pSrcName The source value to query.
59 * \return The corresponding entry, or NULL if no entry in
60 * the table has a source equal in value to pSrcName.
61 */
62 const FbxBindingTableEntry* GetEntryForSource(const char* pSrcName) const;
63
64 /** Retrieve the table entry for the given destination value.
65 * \param pDestName The destination value to query.
66 * \return The corresponding entry, or NULL if no entry in
67 * the table has a destination equal in value to pDestName.
68 */
69 const FbxBindingTableEntry* GetEntryForDestination(const char* pDestName) const;
70
71/*****************************************************************************************************************************
72** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
73*****************************************************************************************************************************/
74#ifndef DOXYGEN_SHOULD_SKIP_THIS
75 // Remark: This method copies the mEntries table AND clears the UserData on the resulting copy to prevent shared memory
76 // data between clones/copies.
77 virtual FbxObject& Copy(const FbxObject& pObject);
78
79private:
80 FbxDynamicArray<FbxBindingTableEntry> mEntries;
81#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
82};
83
84#include <fbxsdk/fbxsdk_nsend.h>
85
86#endif /* _FBXSDK_SCENE_SHADING_BINDING_TABLE_BASE_H_ */
87