fbsdk/fbobjectpose.h Source File

fbobjectpose.h
Go to the documentation of this file.
1 #ifndef __FBOBJECTPOSE_H__
2 #define __FBOBJECTPOSE_H__
3 /**************************************************************************
4  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5  All Rights Reserved.
6 
7  The coded instructions, statements, computer programs, and/or related
8  material (collectively the "Data") in these files contain unpublished
9  information proprietary to Autodesk, Inc. and/or its licensors, which is
10  protected by Canada and United States of America federal copyright law
11  and by international treaties.
12 
13  The Data may not be disclosed or distributed to third parties, in whole
14  or in part, without the prior written consent of Autodesk, Inc.
15  ("Autodesk").
16 
17  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24  FREE.
25 
26  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48  #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbcomponent.h>
52 #include <fbsdk/fbpose.h>
53 
54 #ifdef FBSDKUseNamespace
55  namespace FBSDKNamespace {
56 #endif
57 
58 
61 {
67 };
68 
71 {
78 };
79 
82 {
88 };
89 
91 // FBObjectPoseOptions
93 FB_FORWARD( FBObjectPoseOptions );
94 
99 {
100  public:
101 
104 
107 
110 
113 
117 
122  void SetFlag( FBObjectPoseOptionsFlag pFlag, bool pValue );
123 
128  bool GetFlag( FBObjectPoseOptionsFlag pFlag );
129 
132  void ClearFlag();
133 
134  private:
135 
137 };
138 
140 // FBObjectPoseMirrorOptions
143 
148 {
149  public:
150 
158 
162 
167  void SetFlag( FBObjectPoseMirrorOptionsFlag pFlag, bool pValue );
168 
173  bool GetFlag( FBObjectPoseMirrorOptionsFlag pFlag );
174 
177  void ClearFlag();
178 
179  private:
180 
182 };
183 
185 // FBObjectPose
188 
193 {
194  //--- Open Reality declaration.
196 
197  public:
203  FBObjectPose( const char* pName, HIObject pObject=NULL );
204 
207  void ClearPose();
208 
212  bool IsPropertyPoseable( FBProperty &pProperty );
213 
219  void CopyObjectPose( const char* pObjectName, FBComponent& pObject );
220 
226  void CopyPropertyPose( const char* pObjectName, FBProperty& pProperty );
227 
234  void PasteObjectPose( const char* pObjectName, FBComponent& pObject );
235 
242  void PastePropertyPose( const char* pObjectName, FBProperty& pProperty );
243 
250  void SetPropertyValue( const char* pObjectName, const char* pPropertyName, double* pValue, int pSize );
251 
258  void GetPropertyValue( double* pValue, int pSize, const char* pObjectName, const char* pPropertyName );
259 
265  bool IsPropertyStored( const char* pObjectName, const char* pPropertyName );
266 
273  void CopyTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions );
274 
282  void PasteTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions, FBEvaluateInfo* pEvaluateInfo = NULL );
283 
291  void SetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
292 
301  bool GetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
302 
309  bool IsTransformStored( const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
310 
316  void MultTransformAllObjects( FBMatrix& pGX, FBModelTransformationType pTransformAttribute, FBPoseTransformType pPoseTransformType );
317 
324  void MultTransform( const char* pObjectName, FBMatrix& pGX, FBModelTransformationType pTransformAttribute, FBPoseTransformType pPoseTransformType );
325 
329  void MirrorPoseAllObjects( FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
330 
335  void MirrorPose( const char* pObjectName, FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
336 
343  void RemoveStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
344 
352  void RemoveStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
353 
360  void AddStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
361 
369  void AddStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
370 
380  static void MirrorRetargetPoseAllObjects
381  (
382  FBObjectPose& pDstPose,
383  FBObjectPose& pSrcPose,
384  FBObjectPose& pDstStancePose,
385  FBObjectPose& pSrcStancePose,
386  FBVector4<double>& pMirrorPlaneEquation
387  );
388 
400  static void MirrorRetargetPose
401  (
402  FBObjectPose& pDstPose,
403  FBObjectPose& pSrcPose,
404  FBObjectPose& pDstStancePose,
405  FBObjectPose& pSrcStancePose,
406  FBVector4<double>& pMirrorPlaneEquation,
407  const char* pDstObjectName,
408  const char* pSrcObjectName
409  );
410 
418  static void RetargetPose
419  (
420  FBObjectPose& pDstPose,
421  FBObjectPose& pSrcPose,
422  const char* pDstObjectName,
423  const char* pSrcObjectName
424  );
425 
430  void CopyFrom( FBObjectPose& pFromPose );
431 
436  void CopyPoseDataFrom( FBObjectPose& pFromPose );
437 
443  void CopyPoseAllObjectsTransformFrom( FBObjectPose& pFromPose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
444 
451  void CopyPoseTransformFrom( FBObjectPose& pFromPose, const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
452 
453  private:
454 
456 
460  FBObjectPose( const FBObjectPose& );
461  FBObjectPose& operator=( const FBObjectPose& );
463 };
464 
466 // Property List: ObjectPose
468 
471 {
472  public:
478  FBObjectPose* operator[]( int pIndex );
479 };
480 
482 // Useful functions
484 
490 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPlaneNormalVector, const FBTVector& pPointOnPlane );
491 
497 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPointOnPlane, const FBMatrix& pPlaneRM );
498 
503 FBSDK_DLL void GetPlaneRotation( FBMatrix& pPlaneRM, const FBVector4<double>& pPlaneEquation );
504 
509 FBSDK_DLL void NormalizePlaneEquation( FBVector4<double>& pNormalizedPlaneEquation, FBVector4<double>& pPlaneEquation );
510 
520 FBSDK_DLL void MirrorTransform( FBTVector& pMirrorT, FBMatrix& pMirrorRM, FBMatrix& pMirrorSM, const FBTVector& pT, const FBMatrix& pRM, const FBMatrix& pSM, const FBVector4<double>& pPlaneEquation );
521 
527 FBSDK_DLL void MirrorTransformT( FBTVector& pMirrorT, const FBTVector& pT, const FBVector4<double>& pPlaneEquation );
528 
534 FBSDK_DLL void MirrorTransformR( FBMatrix& pMirrorRM, const FBMatrix& pRM, const FBVector4<double>& pPlaneEquation );
535 
536 
537 #ifdef FBSDKUseNamespace
538  }
539 #endif
540 
541 #endif /* __FBOBJECTPOSE_H__ */
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBTVector mReferenceGT
Global translation vector of reference object.
Definition: fbobjectpose.h:106
void NormalizePlaneEquation(FBVector4< double > &pNormalizedPlaneEquation, FBVector4< double > &pPlaneEquation)
Normalize a plane equation.
void MirrorTransformR(FBMatrix &pMirrorRM, const FBMatrix &pRM, const FBVector4< double > &pPlaneEquation)
Mirror a rotation using the specified mirror plane.
FBObjectPoseMirrorOptions class.
Definition: fbobjectpose.h:147
Four x Four (double) Matrix.
Definition: fbtypes.h:289
#define NULL
Definition: kaydara.h:169
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbobjectpose.h:48
AnimationNodeNotify evaluation information.
FBModelTransformationType
Types of transformation vector/matrices possible.
Definition: fbmodel.h:167
FBVector4< double > mMirrorPlaneEquation
Equation of the mirror plane.
Definition: fbobjectpose.h:157
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
FBMatrix mReferenceGSM
Global scaling matrix of reference object.
Definition: fbobjectpose.h:112
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:553
FBPoseTransformType
Transform mode of pose.
Definition: fbobjectpose.h:60
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
void MirrorTransformT(FBTVector &pMirrorT, const FBTVector &pT, const FBVector4< double > &pPlaneEquation)
Mirror a translation using the specified mirror plane.
Property: Base property class.
Definition: fbproperties.h:192
FBObjectPoseOptions class.
Definition: fbobjectpose.h:98
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
FBObjectPoseMirrorOptionsFlag
ObjectPoseMirrorOptions flags.
Definition: fbobjectpose.h:81
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBMatrix mReferenceGRM
Global rotation matrix of reference object.
Definition: fbobjectpose.h:109
Access to poses.
void GetPlaneRotation(FBMatrix &pPlaneRM, const FBVector4< double > &pPlaneEquation)
Get the plane rotation matrix from a plane equation.
PropertyList: ObjectPose.
Definition: fbobjectpose.h:470
Pose class.
Definition: fbpose.h:75
FBPoseTransformType mPoseTransformType
Transform type (Local, Global or LocalRef).
Definition: fbobjectpose.h:103
FBObjectPose class.
Definition: fbobjectpose.h:192
FBObjectPoseOptionsFlag
ObjectPoseOptions flags.
Definition: fbobjectpose.h:70
void GetPlaneEquation(FBVector4< double > &pPlaneEquation, const FBTVector &pPointOnPlane, const FBMatrix &pPlaneRM)
Get a plane equation from a point on the plane and a rotation matrix relative to the plane XZ...
void MirrorTransform(FBTVector &pMirrorT, FBMatrix &pMirrorRM, FBMatrix &pMirrorSM, const FBTVector &pT, const FBMatrix &pRM, const FBMatrix &pSM, const FBVector4< double > &pPlaneEquation)
Mirror a transformation using the specified mirror plane.