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 
217  FBStringList GetStoredObjectNames();
218 
224  void CopyObjectPose( const char* pObjectName, FBComponent& pObject );
225 
231  void CopyPropertyPose( const char* pObjectName, FBProperty& pProperty );
232 
239  void PasteObjectPose( const char* pObjectName, FBComponent& pObject );
240 
247  void PastePropertyPose( const char* pObjectName, FBProperty& pProperty );
248 
255  void SetPropertyValue( const char* pObjectName, const char* pPropertyName, double* pValue, int pSize );
256 
263  void GetPropertyValue( double* pValue, int pSize, const char* pObjectName, const char* pPropertyName );
264 
270  bool IsPropertyStored( const char* pObjectName, const char* pPropertyName );
271 
278  void CopyTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions );
279 
287  void PasteTransform( const char* pObjectName, FBComponent& pObject, FBObjectPoseOptions& pObjectPoseOptions, FBEvaluateInfo* pEvaluateInfo = NULL );
288 
296  void SetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
297 
306  bool GetTransform( FBTVector& pT, FBMatrix& pRM, FBMatrix& pSM, const char* pObjectName, FBPoseTransformType pPoseTransformType );
307 
314  bool IsTransformStored( const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
315 
321  void MultTransformAllObjects( FBMatrix& pGX, FBModelTransformationType pTransformAttribute, FBPoseTransformType pPoseTransformType );
322 
329  void MultTransform( const char* pObjectName, FBMatrix& pGX, FBModelTransformationType pTransformAttribute, FBPoseTransformType pPoseTransformType );
330 
334  void MirrorPoseAllObjects( FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
335 
340  void MirrorPose( const char* pObjectName, FBObjectPoseMirrorOptions& pObjectPoseMirrorOptions );
341 
348  void RemoveStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
349 
357  void RemoveStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
358 
365  void AddStanceOffsetAllObjects( FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
366 
374  void AddStanceOffset( const char* pObjectName, FBObjectPose& pStancePose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
375 
385  static void MirrorRetargetPoseAllObjects
386  (
387  FBObjectPose& pDstPose,
388  FBObjectPose& pSrcPose,
389  FBObjectPose& pDstStancePose,
390  FBObjectPose& pSrcStancePose,
391  FBVector4<double>& pMirrorPlaneEquation
392  );
393 
405  static void MirrorRetargetPose
406  (
407  FBObjectPose& pDstPose,
408  FBObjectPose& pSrcPose,
409  FBObjectPose& pDstStancePose,
410  FBObjectPose& pSrcStancePose,
411  FBVector4<double>& pMirrorPlaneEquation,
412  const char* pDstObjectName,
413  const char* pSrcObjectName
414  );
415 
423  static void RetargetPose
424  (
425  FBObjectPose& pDstPose,
426  FBObjectPose& pSrcPose,
427  const char* pDstObjectName,
428  const char* pSrcObjectName
429  );
430 
435  void CopyFrom( FBObjectPose& pFromPose );
436 
441  void CopyPoseDataFrom( FBObjectPose& pFromPose );
442 
448  void CopyPoseAllObjectsTransformFrom( FBObjectPose& pFromPose, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
449 
456  void CopyPoseTransformFrom( FBObjectPose& pFromPose, const char* pObjectName, FBPoseTransformType pPoseTransformType = kFBPoseTransformInvalid );
457 
458  private:
459 
461 
465  FBObjectPose( const FBObjectPose& );
466  FBObjectPose& operator=( const FBObjectPose& );
468 };
469 
471 // Property List: ObjectPose
473 
476 {
477  public:
483  FBObjectPose* operator[]( int pIndex );
484 };
485 
487 // Useful functions
489 
495 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPlaneNormalVector, const FBTVector& pPointOnPlane );
496 
502 FBSDK_DLL void GetPlaneEquation( FBVector4<double>& pPlaneEquation, const FBTVector& pPointOnPlane, const FBMatrix& pPlaneRM );
503 
508 FBSDK_DLL void GetPlaneRotation( FBMatrix& pPlaneRM, const FBVector4<double>& pPlaneEquation );
509 
514 FBSDK_DLL void NormalizePlaneEquation( FBVector4<double>& pNormalizedPlaneEquation, FBVector4<double>& pPlaneEquation );
515 
525 FBSDK_DLL void MirrorTransform( FBTVector& pMirrorT, FBMatrix& pMirrorRM, FBMatrix& pMirrorSM, const FBTVector& pT, const FBMatrix& pRM, const FBMatrix& pSM, const FBVector4<double>& pPlaneEquation );
526 
532 FBSDK_DLL void MirrorTransformT( FBTVector& pMirrorT, const FBTVector& pT, const FBVector4<double>& pPlaneEquation );
533 
539 FBSDK_DLL void MirrorTransformR( FBMatrix& pMirrorRM, const FBMatrix& pRM, const FBVector4<double>& pPlaneEquation );
540 
541 
542 #ifdef FBSDKUseNamespace
543  }
544 #endif
545 
546 #endif /* __FBOBJECTPOSE_H__ */
Property: Base property class.
Definition: fbproperties.h:192
#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 MirrorTransformT(FBTVector &pMirrorT, const FBTVector &pT, const FBVector4< double > &pPlaneEquation)
Mirror a translation using the specified mirror plane.
Four x Four (double) Matrix.
Definition: fbtypes.h:289
FBObjectPoseOptions class.
Definition: fbobjectpose.h:98
#define NULL
Definition: kaydara.h:179
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbobjectpose.h:48
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...
FBVector4< double > mMirrorPlaneEquation
Equation of the mirror plane.
Definition: fbobjectpose.h:157
FBObjectPoseMirrorOptionsFlag
ObjectPoseMirrorOptions flags.
Definition: fbobjectpose.h:81
PropertyList: ObjectPose.
Definition: fbobjectpose.h:475
void MirrorTransformR(FBMatrix &pMirrorRM, const FBMatrix &pRM, const FBVector4< double > &pPlaneEquation)
Mirror a rotation using the specified mirror plane.
Pose class.
Definition: fbpose.h:75
FBObjectPoseOptionsFlag
ObjectPoseOptions flags.
Definition: fbobjectpose.h:70
FBMatrix mReferenceGSM
Global scaling matrix of reference object.
Definition: fbobjectpose.h:112
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
void GetPlaneRotation(FBMatrix &pPlaneRM, const FBVector4< double > &pPlaneEquation)
Get the plane rotation matrix from a plane equation.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
FBModelTransformationType
Types of transformation vector/matrices possible.
Definition: fbmodel.h:167
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
String list.
Definition: fbstring.h:201
FBObjectPoseMirrorOptions class.
Definition: fbobjectpose.h:147
FBMatrix mReferenceGRM
Global rotation matrix of reference object.
Definition: fbobjectpose.h:109
Access to poses.
FBPoseTransformType mPoseTransformType
Transform type (Local, Global or LocalRef).
Definition: fbobjectpose.h:103
AnimationNodeNotify evaluation information.
const char void * pValue
Definition: fbcontrols.h:2116
FBObjectPose class.
Definition: fbobjectpose.h:192
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.
FBPoseTransformType
Transform mode of pose.
Definition: fbobjectpose.h:60
void NormalizePlaneEquation(FBVector4< double > &pNormalizedPlaneEquation, FBVector4< double > &pPlaneEquation)
Normalize a plane equation.