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