fbxbindingoperator.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. /****************************************************************************************
  2. Copyright (C) 2015 Autodesk, Inc.
  3. All rights reserved.
  4. Use of this software is subject to the terms of the Autodesk license agreement
  5. provided at the time of installation or download, or which otherwise accompanies
  6. this software in either electronic or hard copy form.
  7. ****************************************************************************************/
  8. //! \file fbxbindingoperator.h
  9. #ifndef _FBXSDK_SCENE_SHADING_BINDING_OPERATOR_H_
  10. #define _FBXSDK_SCENE_SHADING_BINDING_OPERATOR_H_
  11. #include <fbxsdk/fbxsdk_def.h>
  12. #include <fbxsdk/scene/shading/fbxbindingtablebase.h>
  13. #include <fbxsdk/fbxsdk_nsbegin.h>
  14. /** This object represents a binding operation on a FbxObject or FbxProperty.
  15. * For example, FbxBindingOperator can be used to bind a light object
  16. * to a parameter of shader via FbxNodeDirectionBOF or FbxNodePositionBOF.
  17. * \code
  18. * //Create an entry lEntry of binding table lTable.
  19. * FbxBindingTableEntry& lEntry = lTable->AddNewEntry();
  20. *
  21. * //Create a NodePositionConvert binding operator and add it as source of the lEntry.
  22. * FbxOperatorEntryView lSrc(&lEntry, true, true);
  23. * lSrc.SetOperatorName( "NodePositionConvert");
  24. * FbxBindingOperator* lOp = pImpl.AddNewBindingOperator( "NodePositionConvert", FbxNodePositionBOF::FunctionName);
  25. *
  26. * //Add a property entry to the binding operator.
  27. * FbxBindingTableEntry& lEntryPropParam = lOp->AddNewEntry();
  28. * FbxPropertyEntryView lPropSrc(&lEntryPropParam, true, true);
  29. * //Set the shader parameter (the property's name) as source of the lEntryPropParam.
  30. * lPropSrc.SetProperty(lProp.GetHierarchicalName());
  31. * //Set the operator function FbxNodePositionBOF as destination of the lEntryPropParam.
  32. * lEntryPropParam.SetDestination( FbxNodePositionBOF::FunctionName );
  33. *
  34. * //Set the shader parameter as destination of the lEntry.
  35. * FbxSemanticEntryView lDst( &lEntry, false, true );
  36. * lDst.SetSemantic( lProp.GetName() );
  37. * \endcode
  38. * \nosubgrouping
  39. * \see FbxOperatorEntryView, FbxBindingTableEntry, FbxPropertyEntryView
  40. */
  41. class FBXSDK_DLL FbxBindingOperator : public FbxBindingTableBase
  42. {
  43. FBXSDK_OBJECT_DECLARE(FbxBindingOperator, FbxBindingTableBase);
  44. public:
  45. /** Run the operator on the given object.
  46. * \param pObject The object that will be evaluated.
  47. * \param pResult A pointer to a buffer to hold the result.
  48. * \return \c true on success, \c false otherwise.
  49. */
  50. template <class FBXTYPE>
  51. bool Evaluate(const FbxObject* pObject, FBXTYPE* pResult) const
  52. {
  53. EFbxType lResultType;
  54. void* lResult = NULL;
  55. bool lSuccess = Evaluate(pObject, &lResultType, &lResult);
  56. if (lSuccess)
  57. {
  58. FbxTypeCopy(*pResult, lResult, lResultType);
  59. }
  60. FreeEvaluationResult(lResultType, lResult);
  61. return lSuccess;
  62. }
  63. /** Run the inverse operator on the given object,
  64. * assigning the result directly to the object.
  65. * \param pObject The object that will be evaluated.
  66. * \param pInOut Type of value being reversed.
  67. * \param setObj Control to set the property (only to query by the default ).
  68. * \param index Used only in FbxMultiplyDistBOF.
  69. * \return \c true on success, \c false otherwise.
  70. */
  71. template <class FBXTYPE>
  72. bool ReverseEvaluation(const FbxObject* pObject, FBXTYPE * pInOut,
  73. bool setObj=false, int index=0) const
  74. {
  75. const void* lIn = pInOut;
  76. void* lOut = NULL;
  77. EFbxType lOutType;
  78. bool lSuccess = ReverseEvaluate(pObject, lIn, &lOut, &lOutType, setObj, index);
  79. if (lSuccess)
  80. {
  81. FbxTypeCopy(*pInOut, lOut, lOutType);
  82. }
  83. FreeEvaluationResult(lOutType, lOut);
  84. return lSuccess;
  85. }
  86. /** Evaluate the value of an operator parameter.
  87. * \param pObject The object that will be evaluated.
  88. * \param pEntryDestinationName The name of the parameter.
  89. * This is used to get the property or operator that is related to this parameter,
  90. * then to evaluate the property or operator.
  91. * \param pResult A pointer to the result.
  92. * \return \c true on success, \c false otherwise.
  93. * \remarks This method can handle different types of entries. For property entry and constant entry,
  94. * this method will find out the property via the pEntryDestinationName and then evaluate its value;
  95. * for operator entry, this method will find out the operator via the pEntryDestinationName and
  96. * evaluate the operator function to get the property's value; for any other types of entry, this method
  97. * is meaningless.
  98. */
  99. template <class FBXTYPE>
  100. bool EvaluateEntry(const FbxObject* pObject, const char* pEntryDestinationName, FBXTYPE* pResult) const
  101. {
  102. EFbxType lResultType;
  103. void* lResult = NULL;
  104. bool lSuccess = EvaluateEntry(pObject, pEntryDestinationName, &lResultType, &lResult);
  105. if (lSuccess)
  106. {
  107. FbxTypeCopy(*pResult, lResult, lResultType);
  108. }
  109. FreeEvaluationResult(lResultType, lResult);
  110. return lSuccess;
  111. }
  112. /** This property stores the name of function.
  113. *
  114. * Default value is "".
  115. */
  116. FbxPropertyT<FbxString> FunctionName;
  117. /** This property stores the name of target.
  118. *
  119. * Default value is "".
  120. */
  121. FbxPropertyT<FbxString> TargetName;
  122. //////////////////////////////////////////////////////////////////////////
  123. // Static values
  124. //////////////////////////////////////////////////////////////////////////
  125. //! Function name.
  126. static const char* sFunctionName;
  127. //! Target name.
  128. static const char* sTargetName;
  129. //! Default value for function name.
  130. static const char* sDefaultFunctionName;
  131. //! Default value for target name.
  132. static const char* sDefaultTargetName;
  133. //////////////////////////////////////////////////////////////////////////
  134. // Functions
  135. //////////////////////////////////////////////////////////////////////////
  136. /** \internal
  137. *
  138. */
  139. static void RegisterFunctions();
  140. /** \internal
  141. *
  142. */
  143. static void UnregisterFunctions();
  144. /** It represents a binding relationship between current object and the target.
  145. * Any binding operation need to specify a certain kind of binding function.
  146. * \nosubgrouping
  147. */
  148. class FBXSDK_DLL Function
  149. {
  150. public:
  151. //!Destructor.
  152. virtual ~Function() {}
  153. /** Run the operator on the given object.
  154. * \param pOperator The operator that will be applied.
  155. * \param pObject The object that will be evaluated.
  156. * \param pResultType Will be filled by the type of the result.
  157. * \param pResult Will be filled by a pointer to a buffer that hold the result.
  158. * The caller must call FreeEvaluationResult() when it is done with this pointer.
  159. * \return \c true on success, \c false otherwise.
  160. */
  161. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const = 0;
  162. /** Run the inverse operator on the given object,
  163. * assigning the result directly to the object.
  164. * \param pOperator The operator that will be applied.
  165. * \param pTarget The object that will be evaluated.
  166. * \param pIn
  167. * \param pOut
  168. * \param pOutType Type of value being reversed.
  169. * \param setObj Control to set the property (only to query by the default ).
  170. * \param index Used only in FbxMultiplyDistBOF.
  171. * \return \c true on success, \c false otherwise.
  172. */
  173. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const = 0;
  174. };
  175. /** The abstract factory class for binding function.
  176. * \nosubgrouping
  177. */
  178. class FBXSDK_DLL FunctionCreatorBase
  179. {
  180. public:
  181. //!Destructor.
  182. virtual ~FunctionCreatorBase() {}
  183. /** Get name of the function.
  184. * \return The name of the function.
  185. */
  186. virtual const char* GetFunctionName() const = 0;
  187. /** Create the function.
  188. */
  189. virtual Function* CreateFunction() const = 0;
  190. };
  191. /** The concrete factory class for binding function.
  192. * \nosubgrouping
  193. */
  194. template <class FUNCTION>
  195. class FunctionCreator : public FunctionCreatorBase
  196. {
  197. public:
  198. /** Get Name of the operation function.
  199. * \return The Name of the operation function.
  200. */
  201. virtual const char* GetFunctionName() const
  202. {
  203. return FUNCTION::FunctionName;
  204. }
  205. /** Create the operation function.
  206. */
  207. virtual Function* CreateFunction() const
  208. {
  209. return FbxNew< FUNCTION >();
  210. }
  211. };
  212. /** This utility class is used to register and unregister the binding function creators.
  213. * \nosubgrouping
  214. */
  215. class FBXSDK_DLL FunctionRegistry
  216. {
  217. public:
  218. /** To register the binding function creator.
  219. * \param pCreator The binding function creator to register.
  220. */
  221. static void RegisterFunctionCreator(FunctionCreatorBase const& pCreator)
  222. {
  223. sRegistry.Insert(pCreator.GetFunctionName(), &pCreator);
  224. }
  225. /** To unregister the binding function creator.
  226. * \param pCreator The binding function creator to unregister.
  227. */
  228. static void UnregisterFunctionCreator(FunctionCreatorBase const& pCreator)
  229. {
  230. sRegistry.Remove(pCreator.GetFunctionName());
  231. }
  232. /** To find the binding function creator by name.
  233. * \param pName The name of the operation function creator to find.
  234. */
  235. static const FunctionCreatorBase* FindCreator(const char* pName)
  236. {
  237. RegistryType::RecordType* lRecord = sRegistry.Find(pName);
  238. if (lRecord)
  239. {
  240. return lRecord->GetValue();
  241. }
  242. else
  243. {
  244. return NULL;
  245. }
  246. }
  247. private:
  248. typedef FbxMap<const char*, const FunctionCreatorBase*, FbxCharPtrCompare> RegistryType;
  249. static RegistryType sRegistry;
  250. };
  251. /*****************************************************************************************************************************
  252. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  253. *****************************************************************************************************************************/
  254. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  255. bool EvaluateEntry(const FbxObject* pObject, const char* pEntryDestinationName, EFbxType* pResultType, void** pResult) const;
  256. bool GetEntryProperty(const FbxObject* pObject, const char* pEntryDestinationName, FbxProperty & pProp) const;
  257. protected:
  258. virtual void Construct(const FbxObject* pFrom);
  259. virtual void Destruct(bool pRecursive);
  260. virtual void ConstructProperties(bool pForceSet);
  261. void InstantiateFunction();
  262. bool Evaluate(const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  263. bool ReverseEvaluate(const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  264. void FreeEvaluationResult(EFbxType pResultType, void* pResult) const;
  265. Function* mFunction;
  266. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  267. };
  268. /** An evaluation operator to get the position of the node that is bound with this operator via a certain property.
  269. * The position of the node is represented by translation.
  270. */
  271. class FbxNodePositionBOF : public FbxBindingOperator::Function
  272. {
  273. public:
  274. //! Name of the operation function.
  275. static const char* FunctionName;
  276. /** Evaluate the position of the node that is bound with this operator via a certain property.
  277. * The position of the node is represented by translation.
  278. *
  279. * \param pOperator Operator running on the object.
  280. * \param pObject The object that will be evaluated.
  281. * \param pResultType The type of the result to be returned, eFbxDouble4 in this case.
  282. * \param pResult A pointer to a buffer that can hold the result.
  283. * \return \c true on success, \c false otherwise.
  284. */
  285. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  286. //! Inverse evaluation for this binding function is not implemented yet.
  287. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  288. /*****************************************************************************************************************************
  289. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  290. *****************************************************************************************************************************/
  291. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  292. FbxNodePositionBOF();
  293. virtual ~FbxNodePositionBOF();
  294. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  295. };
  296. /** An evaluation operator to get the direction of the node that is bound with this operator via a certain property.
  297. * The direction of the node is represented by Euler rotation.
  298. */
  299. class FbxNodeDirectionBOF : public FbxBindingOperator::Function
  300. {
  301. public:
  302. //! Name of the operation function.
  303. static const char* FunctionName;
  304. /** Evaluate the direction of the node that is bound with this operator via a certain property.
  305. * The direction of the node is represented by Euler rotation.
  306. *
  307. * \param pOperator Operator running on the object.
  308. * \param pObject The object that will be evaluated.
  309. * \param pResultType The type of the result to be returned, eFbxDouble4 in this case.
  310. * \param pResult A pointer to a buffer that can hold the result.
  311. * \return \c true on success, \c false otherwise.
  312. */
  313. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  314. //! Inverse evaluation for this binding function is not implemented yet.
  315. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  316. /*****************************************************************************************************************************
  317. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  318. *****************************************************************************************************************************/
  319. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  320. FbxNodeDirectionBOF();
  321. virtual ~FbxNodeDirectionBOF();
  322. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  323. };
  324. /** A pass through operator used to assign constants to parameters.
  325. */
  326. class FbxAssignBOF : public FbxBindingOperator::Function
  327. {
  328. public:
  329. //! Name of the operation function.
  330. static const char* FunctionName;
  331. /** Evaluates the object property specified by "X" and returns it.
  332. * \param pOperator Operator running on the object.
  333. * \param pObject The object that will be evaluated.
  334. * \param pResultType Will be filled by the type of the result.
  335. * \param pResult Will be filled by a pointer to a buffer that hold the result.
  336. */
  337. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  338. //! Inverse evaluation for this binding function is not implemented yet.
  339. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  340. /*****************************************************************************************************************************
  341. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  342. *****************************************************************************************************************************/
  343. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  344. FbxAssignBOF();
  345. virtual ~FbxAssignBOF();
  346. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  347. };
  348. /** A conditional operator that outputs one out of two properties, based on
  349. * the value of a predicate property.
  350. */
  351. class FbxConditionalBOF : public FbxBindingOperator::Function
  352. {
  353. public:
  354. //! Name of the operation function.
  355. static const char* FunctionName;
  356. /** Evaluates the object property specified by "predicate".
  357. * If the property value is true (!= 0, != ""), returns the value of the
  358. * property specified by "ifTrue", else returns the value of the property
  359. * specified by "ifFalse".
  360. *
  361. * Currently the data types supported for the input property are
  362. * limited to "integer", "boolean", "float", "double" and "string".
  363. * \param pOperator Operator running on the object.
  364. * \param pObject The object that will be evaluated.
  365. * \param pResultType The type of the result to be returned.
  366. * \param pResult A pointer to a buffer that can hold the result.
  367. * \return \c true on success, \c false otherwise.
  368. */
  369. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  370. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  371. /*****************************************************************************************************************************
  372. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  373. *****************************************************************************************************************************/
  374. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  375. FbxConditionalBOF();
  376. virtual ~FbxConditionalBOF();
  377. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  378. };
  379. /** A switch operator that outputs one out of n properties, based on
  380. * the value of a predicate property.
  381. */
  382. class FbxSwitchBOF : public FbxBindingOperator::Function
  383. {
  384. public:
  385. //! Name of the operation function.
  386. static const char* FunctionName;
  387. /** Evaluates the object property specified by "predicate".
  388. * Returns the value of the property specified by "case_n", where n
  389. * is the value of "predicate". If there is no case_n entry, returns
  390. * the value of the property specified by "default".
  391. *
  392. * Currently the data types supported for the predicate property are
  393. * limited to "integer" and "boolean".
  394. * \param pOperator Operator running on the object.
  395. * \param pObject The object that will be evaluated.
  396. * \param pResultType The type of the result to be returned.
  397. * \param pResult A pointer to a buffer that can hold the result.
  398. * \return \c true on success, \c false otherwise.
  399. */
  400. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  401. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  402. /*****************************************************************************************************************************
  403. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  404. *****************************************************************************************************************************/
  405. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  406. FbxSwitchBOF();
  407. virtual ~FbxSwitchBOF();
  408. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  409. };
  410. class FbxTRSToMatrixBOF : public FbxBindingOperator::Function
  411. {
  412. public:
  413. //! Name of the operation function.
  414. static const char* FunctionName;
  415. /** Evaluates the object properties specified by "T", "R" and "S" and
  416. * return a transform matrix.
  417. *
  418. * \param pOperator Operator running on the object.
  419. * \param pObject The object that will be evaluated.
  420. * \param pResultType The type of the result to be returned.
  421. * \param pResult A pointer to a buffer that can hold the result.
  422. * \return \c true on success, \c false otherwise.
  423. */
  424. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  425. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  426. /*****************************************************************************************************************************
  427. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  428. *****************************************************************************************************************************/
  429. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  430. FbxTRSToMatrixBOF();
  431. virtual ~FbxTRSToMatrixBOF();
  432. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  433. };
  434. class FbxAddBOF : public FbxBindingOperator::Function
  435. {
  436. public:
  437. //! Name of the operation function.
  438. static const char* FunctionName;
  439. /** Evaluates the object properties specified by "X" and "Y"
  440. * return X+Y as a float.
  441. *
  442. * \param pOperator Operator running on the object.
  443. * \param pObject The object that will be evaluated.
  444. * \param pResultType The type of the result to be returned.
  445. * \param pResult A pointer to a buffer that can hold the result.
  446. * \return \c true on success, \c false otherwise.
  447. */
  448. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  449. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  450. /*****************************************************************************************************************************
  451. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  452. *****************************************************************************************************************************/
  453. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  454. FbxAddBOF();
  455. virtual ~FbxAddBOF();
  456. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  457. };
  458. class FbxSubstractBOF : public FbxBindingOperator::Function
  459. {
  460. public:
  461. //! Name of the operation function.
  462. static const char* FunctionName;
  463. /** Evaluates the object properties specified by "X" and "Y"
  464. * return X-Y as a float.
  465. *
  466. * \param pOperator Operator running on the object.
  467. * \param pObject The object that will be evaluated.
  468. * \param pResultType The type of the result to be returned.
  469. * \param pResult A pointer to a buffer that can hold the result.
  470. * \return \c true on success, \c false otherwise.
  471. */
  472. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  473. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  474. /*****************************************************************************************************************************
  475. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  476. *****************************************************************************************************************************/
  477. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  478. FbxSubstractBOF();
  479. virtual ~FbxSubstractBOF();
  480. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  481. };
  482. class FbxMultiplyBOF : public FbxBindingOperator::Function
  483. {
  484. public:
  485. //! Name of the operation function.
  486. static const char* FunctionName;
  487. /** Evaluates the object properties specified by "X" and "Y"
  488. * return X*Y as a float.
  489. *
  490. * \param pOperator Operator running on the object.
  491. * \param pObject The object that will be evaluated.
  492. * \param pResultType The type of the result to be returned.
  493. * \param pResult A pointer to a buffer that can hold the result.
  494. * \return \c true on success, \c false otherwise.
  495. */
  496. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  497. //Set index to 1 to get realWorldScale.
  498. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  499. /*****************************************************************************************************************************
  500. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  501. *****************************************************************************************************************************/
  502. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  503. FbxMultiplyBOF();
  504. virtual ~FbxMultiplyBOF();
  505. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  506. };
  507. class FbxMultiplyDistBOF : public FbxBindingOperator::Function
  508. {
  509. public:
  510. //! Name of the operation function.
  511. static const char* FunctionName;
  512. /** Evaluates the object properties specified by "X" and "Y"
  513. * return X*Y as a float.
  514. *
  515. * \param pOperator Operator running on the object.
  516. * \param pObject The object that will be evaluated.
  517. * \param pResultType The type of the result to be returned.
  518. * \param pResult A pointer to a buffer that can hold the result.
  519. * \return \c true on success, \c false otherwise.
  520. */
  521. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  522. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  523. /*****************************************************************************************************************************
  524. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  525. *****************************************************************************************************************************/
  526. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  527. FbxMultiplyDistBOF();
  528. virtual ~FbxMultiplyDistBOF();
  529. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  530. };
  531. class FbxOneOverXBOF : public FbxBindingOperator::Function
  532. {
  533. public:
  534. //! Name of the operation function.
  535. static const char* FunctionName;
  536. /** Evaluates the object properties specified by "X"
  537. * return 1/X as a float.
  538. *
  539. * \param pOperator Operator running on the object.
  540. * \param pObject The object that will be evaluated.
  541. * \param pResultType The type of the result to be returned.
  542. * \param pResult A pointer to a buffer that can hold the result.
  543. * \return \c true on success, \c false otherwise.
  544. */
  545. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  546. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  547. /*****************************************************************************************************************************
  548. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  549. *****************************************************************************************************************************/
  550. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  551. FbxOneOverXBOF();
  552. virtual ~FbxOneOverXBOF();
  553. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  554. };
  555. class FbxPowerBOF : public FbxBindingOperator::Function
  556. {
  557. public:
  558. //! Name of the operation function.
  559. static const char* FunctionName;
  560. /** Evaluates the object properties specified by "X" and "Y"
  561. * return X^Y as a float.
  562. *
  563. * \param pOperator Operator running on the object.
  564. * \param pObject The object that will be evaluated.
  565. * \param pResultType The type of the result to be returned.
  566. * \param pResult A pointer to a buffer that can hold the result.
  567. * \return \c true on success, \c false otherwise.
  568. */
  569. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  570. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  571. /*****************************************************************************************************************************
  572. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  573. *****************************************************************************************************************************/
  574. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  575. FbxPowerBOF();
  576. virtual ~FbxPowerBOF();
  577. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  578. };
  579. class FbxDegreeToRadianBOF : public FbxBindingOperator::Function
  580. {
  581. public:
  582. //! Name of the operation function.
  583. static const char* FunctionName;
  584. /** Evaluates the object property specified by "X"
  585. * return X converted to radian as a float.
  586. *
  587. * \param pOperator Operator running on the object.
  588. * \param pObject The object that will be evaluated.
  589. * \param pResultType The type of the result to be returned.
  590. * \param pResult A pointer to a buffer that can hold the result.
  591. * \return \c true on success, \c false otherwise.
  592. */
  593. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  594. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  595. /*****************************************************************************************************************************
  596. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  597. *****************************************************************************************************************************/
  598. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  599. FbxDegreeToRadianBOF();
  600. virtual ~FbxDegreeToRadianBOF();
  601. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  602. };
  603. class FbxVectorDegreeToVectorRadianBOF : public FbxBindingOperator::Function
  604. {
  605. public:
  606. //! Name of the operation function.
  607. static const char* FunctionName;
  608. /** Evaluates the object property specified by "X"
  609. * return X converted to radian as a vector3.
  610. *
  611. * \param pOperator Operator running on the object.
  612. * \param pObject The object that will be evaluated.
  613. * \param pResultType The type of the result to be returned.
  614. * \param pResult A pointer to a buffer that can hold the result.
  615. * \return \c true on success, \c false otherwise.
  616. */
  617. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  618. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  619. /*****************************************************************************************************************************
  620. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  621. *****************************************************************************************************************************/
  622. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  623. FbxVectorDegreeToVectorRadianBOF();
  624. virtual ~FbxVectorDegreeToVectorRadianBOF();
  625. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  626. };
  627. class FbxSphericalToCartesianBOF : public FbxBindingOperator::Function
  628. {
  629. public:
  630. //! Name of the operation function.
  631. static const char* FunctionName;
  632. /** Evaluates the object property specified by "rho", "theta" and "phi"
  633. * return the converted Cartesian coordinates as a double3.
  634. *
  635. * \param pOperator Operator running on the object.
  636. * \param pObject The object that will be evaluated.
  637. * \param pResultType The type of the result to be returned.
  638. * \param pResult A pointer to a buffer that can hold the result.
  639. * \return \c true on success, \c false otherwise.
  640. */
  641. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  642. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  643. /*****************************************************************************************************************************
  644. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  645. *****************************************************************************************************************************/
  646. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  647. FbxSphericalToCartesianBOF();
  648. virtual ~FbxSphericalToCartesianBOF();
  649. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  650. };
  651. class FbxIsYupBOF : public FbxBindingOperator::Function
  652. {
  653. public:
  654. //! Name of the operation function.
  655. static const char* FunctionName;
  656. /** Check if the scene coordinate system is y-up
  657. * return a bool.
  658. *
  659. * \param pOperator Operator running on the object.
  660. * \param pObject The object that will be evaluated.
  661. * \param pResultType The type of the result to be returned.
  662. * \param pResult A pointer to a buffer that can hold the result.
  663. * \return \c true on success, \c false otherwise.
  664. */
  665. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  666. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  667. /*****************************************************************************************************************************
  668. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  669. *****************************************************************************************************************************/
  670. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  671. FbxIsYupBOF();
  672. virtual ~FbxIsYupBOF();
  673. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  674. };
  675. /** A symbol(string) operator that search the string table and return its corresponding unique id, based on
  676. * the value of a predicate property.
  677. */
  678. class FbxSymbolIDBOF : public FbxBindingOperator::Function
  679. {
  680. public:
  681. //! Name of the operation function.
  682. static const char* FunctionName;
  683. /** Check in the symbol table the string and returns its unique ID as an integer
  684. *
  685. * \param pOperator Operator running on the object.
  686. * \param pObject The object that will be evaluated.
  687. * \param pResultType The type of the result to be returned.
  688. * \param pResult A pointer to a buffer that can hold the result.
  689. * \return \c true on success, \c false otherwise.
  690. */
  691. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  692. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  693. /*****************************************************************************************************************************
  694. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  695. *****************************************************************************************************************************/
  696. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  697. FbxSymbolIDBOF();
  698. virtual ~FbxSymbolIDBOF();
  699. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  700. };
  701. /** A chooser operator that check spot distribution and returns the correct value, based on
  702. * the value of a predicate property.
  703. */
  704. class FbxSpotDistributionChooserBOF : public FbxBindingOperator::Function
  705. {
  706. public:
  707. //! Name of the operation function.
  708. static const char* FunctionName;
  709. /** Check the enum of the spot distribution and returns the correct value
  710. * as an int.
  711. *
  712. * \param pOperator Operator running on the object.
  713. * \param pObject The object that will be evaluated.
  714. * \param pResultType The type of the result to be returned.
  715. * \param pResult A pointer to a buffer that can hold the result.
  716. * \return \c true on success, \c false otherwise.
  717. */
  718. virtual bool Evaluate(const FbxBindingOperator* pOperator, const FbxObject* pObject, EFbxType* pResultType, void** pResult) const;
  719. //! Inverse evaluation for this binding function is not implemented yet.
  720. virtual bool ReverseEvaluate(const FbxBindingOperator* pOperator, const FbxObject* pTarget, const void* pIn, void** pOut, EFbxType* pOutType, bool setObj, int index) const;
  721. /*****************************************************************************************************************************
  722. ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
  723. *****************************************************************************************************************************/
  724. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  725. FbxSpotDistributionChooserBOF();
  726. virtual ~FbxSpotDistributionChooserBOF();
  727. #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
  728. };
  729. #include <fbxsdk/fbxsdk_nsend.h>
  730. #endif /* _FBXSDK_SCENE_SHADING_BINDING_OPERATOR_H_ */