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 fbxsemanticentryview.h
13#ifndef _FBXSDK_SCENE_SHADING_SEMANTIC_ENTRY_VIEW_H_
14#define _FBXSDK_SCENE_SHADING_SEMANTIC_ENTRY_VIEW_H_
15
16#include <fbxsdk/fbxsdk_def.h>
17
18#include <fbxsdk/scene/shading/fbxentryview.h>
19#include <fbxsdk/scene/shading/fbxbindingtableentry.h>
20
21#include <fbxsdk/fbxsdk_nsbegin.h>
22
23/** FbxSemanticEntryView stores a binding corresponding to
24 * a semantic within a shader file.
25 * A shader semantic is a parameter, a constant or an operator.
26 * So a shader semantic could bind with FbxProperty ( parameter, constant) and FbxBindingOperator (operator).
27 *
28 * Here is a code snippet to show how it used.
29 * \code
30 * FbxProperty lProp;
31 * FbxBindingTable lTable;
32 * FbxBindingTableEntry& lEntry = lBindingTable.AddNewEntry();
33 * FbxPropertyEntryView lSrcView( lEntry, true, true);
34 * lSrcView.SetProperty( lProp.GetHierarchicalName());
35 * FbxSemanticEntryView lDstView( &pEntry, false, true );
36 * lDstView.SetSemantic( lProp.Getname());
37 * \endcode
38 *
39 * \see FbxBindingTableEntry and FbxBindingTable.
40 * \nosubgrouping
41 */
42class FBXSDK_DLL FbxSemanticEntryView : public FbxEntryView
43{
44public:
45
46 /** Name of the entry type used in the binding entry.
47 * It should be "FbxSemanticEntry" in this case.
48 */
49 static const char* sEntryType;
50
51 /**
52 * \name Constructor and Destructor.
53 */
54 //@{
55 /** Constructor.
56 * \param pEntry The binding table entry to create the entry view for.
57 * \param pAsSource \c true to create the entry view as source, \c false as destination.
58 * \param pCreate \c true to create the entry view, \c false otherwise.
59 */
60 FbxSemanticEntryView (FbxBindingTableEntry* pEntry, bool pAsSource, bool pCreate = false);
61
62 //! Destructor.
63 virtual ~FbxSemanticEntryView();
64 //@}
65
66 /** Set the semantic to the binding entry.
67 * \param pSemantic The semantic string to set.
68 */
69 void SetSemantic( const char* pSemantic );
70
71 /** Get the semantic from the binding entry.
72 * \param pAppendIndex \c true if the returned semantic append a index, \c false otherwise.
73 * \return The semantic.
74 */
75 FbxString GetSemantic(bool pAppendIndex = true) const;
76
77 /** Get the semantic index suffix.
78 * \return Semantic index suffix.
79 */
80 int GetIndex() const;
81
82 /** Get the entry type.
83 * \return Entry type as string "FbxSemanticEntry".
84 * \remarks Always use EntryType() to get the right entry type.
85 */
86 virtual const char* EntryType() const;
87};
88
89#include <fbxsdk/fbxsdk_nsend.h>
90
91#endif /* _FBXSDK_SCENE_SHADING_SEMANTIC_ENTRY_VIEW_H_ */
92