00001 #ifndef __FBOPTICAL_H__
00002 #define __FBOPTICAL_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045
00048 #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050
00051 #ifndef FB_KERNEL
00052
00053 #include <fbsdk/fbcomponent.h>
00054 #include <fbsdk/fbmodel.h>
00055
00056 #ifdef FBSDKUseNamespace
00057 namespace FBSDKNamespace {
00058 #endif
00059
00060 __FB_FORWARD( FBModelOptical );
00061
00062 FB_DEFINE_COMPONENT( FBSDK_DLL, ModelOptical );
00063 FB_DEFINE_COMPONENT( FBSDK_DLL, ModelMarkerOptical );
00064 FB_DEFINE_COMPONENT( FBSDK_DLL, RigidBody );
00065 FB_DEFINE_COMPONENT( FBSDK_DLL, Take );
00066
00068
00070 __FB_FORWARD( FBOpticalSegment );
00072 class FBSDK_DLL FBOpticalSegment : public FBComponent
00073 {
00074 __FBClassDeclare( FBOpticalSegment, FBComponent );
00075 public:
00079 FBOpticalSegment(HFBModelOptical pOptical=NULL);
00080
00084 FBOpticalSegment( const FBOpticalSegment &pSegment );
00085
00090 bool operator==(const FBOpticalSegment &pValue) const;
00091
00096 FBOpticalSegment& operator=(const FBOpticalSegment& pValue);
00097
00100 virtual void Reset();
00101
00105 virtual void Cut( FBTime& pTime );
00106
00110 virtual bool IsValid();
00111
00112
00113 FBPropertyTimeSpan OriginalTimeSpan;
00114 FBPropertyTimeSpan TimeSpan;
00115 FBPropertyAnimationNode Data;
00116 FBPropertyBool Used;
00117
00118
00119 FBPropertyModelMarkerOptical Marker;
00120 FBPropertyTimeSpan MarkerTimeSpan;
00121
00122 friend class FBPropertyListOpticalSegment;
00123 friend class FBPropertyListMarkerSegment;
00124
00125 private:
00126 void FBOpticalSegmentInitProperties();
00127 };
00128 FB_DEFINE_COMPONENT ( FBSDK_DLL, OpticalSegment );
00129 FB_DEFINE_ARRAY ( FBSDK_DLL, OpticalSegment );
00130 FB_DEFINE_LIST ( FBSDK_DLL, OpticalSegment );
00131
00133
00135 FB_FORWARD( FBPropertyListMarkerSegment );
00136
00138 class FBSDK_DLL FBPropertyListMarkerSegment : public FBPropertyBaseList< FBOpticalSegment >
00139 {
00140 private:
00141 FBArrayTemplate< HFBOpticalSegment > mItems;
00142 virtual int Add( FBOpticalSegment pItem );
00143 virtual void Refresh();
00144 public:
00145 FBPropertyListMarkerSegment();
00146 virtual ~FBPropertyListMarkerSegment();
00150 virtual void RemoveAt ( int pIndex );
00151
00156 virtual FBOpticalSegment operator[]( int pIndex );
00157
00161 virtual int GetCount();
00162
00167 virtual int GetIndexAt( FBTime& pTime );
00168 };
00169
00171
00173 FB_FORWARD( FBPropertyListOpticalSegment );
00174 FB_DEFINE_LIST( FBSDK_DLL, OpticalSegment );
00175
00177 class FBSDK_DLL FBPropertyListOpticalSegment : public FBPropertyBaseList< FBOpticalSegment >
00178 {
00179 private:
00180 FBArrayTemplate< HFBOpticalSegment > mItems;
00181 virtual int Add( FBOpticalSegment pItem );
00182 virtual void Refresh();
00183 public:
00184 FBPropertyListOpticalSegment();
00185 virtual ~FBPropertyListOpticalSegment();
00189 virtual void RemoveAt( int pIndex );
00190
00195 virtual FBOpticalSegment operator[]( int pIndex );
00196
00200 virtual int GetCount();
00201
00206 virtual int Add( HFBAnimationNode pData );
00207 };
00208
00210
00213 enum FBGapMode {
00214 kFBGapRigidBody,
00215 kFBGapConstant,
00216 kFBGapLinear,
00217 kFBGapBezier,
00218 kFBGapCurve,
00219 kFBGapSample
00220 };
00221 FB_DEFINE_ENUM( FBSDK_DLL, GapMode );
00222
00224
00226 __FB_FORWARD( FBOpticalGap );
00228 class FBSDK_DLL FBOpticalGap : public FBComponent
00229 {
00230 __FBClassDeclare( FBOpticalGap, FBComponent );
00231 public:
00235 FBOpticalGap(HFBModelMarkerOptical pMarker=NULL);
00236
00240 FBOpticalGap(const FBOpticalGap& pGap);
00241
00246 bool operator==(const FBOpticalGap &pValue) const;
00247
00252 FBOpticalGap& operator=(const FBOpticalGap& pValue);
00253
00257 virtual void InsertControlKey( FBTime& pTime );
00258
00262 virtual bool IsValid();
00263
00264 FBPropertyTimeSpan TimeSpan;
00265 FBPropertyGapMode Interpolation;
00266 FBPropertyAnimationNode Data;
00267
00268 friend class FBPropertyListOpticalGap;
00269
00270 private:
00271 void FBOpticalGapInitProperties();
00272 };
00273 FB_DEFINE_COMPONENT ( FBSDK_DLL, OpticalGap );
00274 FB_DEFINE_ARRAY ( FBSDK_DLL, OpticalGap );
00275 FB_DEFINE_LIST ( FBSDK_DLL, OpticalGap );
00276
00278
00280 FB_FORWARD( FBPropertyListOpticalGap );
00281
00283 class FBSDK_DLL FBPropertyListOpticalGap : public FBPropertyBaseList< FBOpticalGap >
00284 {
00285 private:
00286 FBArrayTemplate< HFBOpticalGap > mItems;
00287 virtual int Add( FBOpticalGap pItem );
00288 virtual void RemoveAt( int pIndex );
00289 virtual void Refresh();
00290 public:
00291 FBPropertyListOpticalGap();
00292 virtual ~FBPropertyListOpticalGap();
00297 virtual FBOpticalGap operator[]( int pIndex );
00298
00302 virtual int GetCount();
00303 };
00304
00306
00308 __FB_FORWARD( FBModelMarkerOptical);
00310 class FBSDK_DLL FBModelMarkerOptical : public FBModelMarker
00311 {
00312 __FBClassDeclare( FBModelMarkerOptical,FBModelMarker );
00313 public:
00320 FBModelMarkerOptical(char *pName = NULL, HFBModelOptical pOptical=NULL, HIObject pObject=NULL );
00321
00327 virtual int ImportBegin();
00328
00336 virtual bool ImportKey( double pX, double pY, double pZ=0.0, double pOcclusion=0.0 );
00337
00342 virtual bool ImportEnd();
00343
00349 virtual int ExportBegin();
00350
00358 virtual bool ExportKey( double *pX, double *pY, double *pZ=NULL, double *pOcclusion=NULL );
00359
00363 virtual bool ExportEnd();
00364
00368 virtual void SetModelOptical( HFBModelOptical pOptical );
00369
00374 virtual void InsertSegmentedData( HFBAnimationNode pTData, HFBAnimationNode pOData );
00375
00379 virtual FBRigidBody GetRigidBody();
00380
00381 FBPropertyModelOptical Optical;
00382 FBPropertyListMarkerSegment Segments;
00383 FBPropertyListOpticalGap Gaps;
00384 FBPropertyColor Color;
00385 FBPropertyBool Done;
00386 FBPropertyAnimationNode Data;
00387 private:
00388 void FBModelMarkerOpticalInitProperties();
00389 };
00390 FB_DEFINE_ARRAY ( FBSDK_DLL, ModelMarkerOptical );
00391 FB_DEFINE_LIST ( FBSDK_DLL, ModelMarkerOptical );
00392
00394
00396 FB_FORWARD( FBPropertyListModelMarkerOptical );
00397
00399 class FBSDK_DLL FBPropertyListModelMarkerOptical : public FBPropertyBaseList< HFBModelMarkerOptical >
00400 {
00401 private:
00402 FBArrayTemplate< HFBModelMarkerOptical > mItems;
00403 public:
00404 FBPropertyListModelMarkerOptical();
00405 virtual ~FBPropertyListModelMarkerOptical();
00407 virtual void Refresh ();
00408
00412 virtual void RemoveAt( int pIndex );
00413
00418 virtual HFBModelMarkerOptical operator[]( int pIndex );
00419
00423 virtual int GetCount ();
00424
00428 virtual int Add( char* pName = NULL );
00429
00433 virtual int Add( HFBModelMarkerOptical pItem );
00434 };
00435
00437
00439 FB_FORWARD( FBPropertyListRigidBodyMarkers );
00440 FB_DEFINE_LIST( FBSDK_DLL, ModelMarkerOptical );
00441
00443 class FBSDK_DLL FBPropertyListRigidBodyMarkers : public FBPropertyBaseList< HFBModelMarkerOptical >
00444 {
00445 private:
00446 FBArrayTemplate< HFBModelMarkerOptical > mItems;
00447 public:
00448 FBPropertyListRigidBodyMarkers();
00449 virtual ~FBPropertyListRigidBodyMarkers();
00451 virtual void Refresh();
00452
00456 virtual void RemoveAt( int pIndex );
00457
00462 virtual HFBModelMarkerOptical operator[]( int pIndex );
00463
00467 virtual int GetCount ();
00468
00469 public:
00473 virtual int Add( char* pName = NULL );
00478 virtual int Add( HFBModelMarkerOptical pItem );
00479 };
00480
00482
00485 enum FBRigidBodyMode {
00486 kFBRigidBodyFast,
00487 kFBRigidBodyBest
00488 };
00489 FB_DEFINE_ENUM( FBSDK_DLL, RigidBodyMode );
00490
00492
00494 __FB_FORWARD( FBRigidBody );
00496 class FBSDK_DLL FBRigidBody : public FBComponent
00497 {
00498 __FBClassDeclare( FBRigidBody, FBComponent );
00499 public:
00503 FBRigidBody(HFBModelOptical pOptical=NULL);
00504
00508 FBRigidBody( const FBRigidBody &pRigidBody );
00509
00514 bool operator==(const FBRigidBody &pValue) const;
00515
00520 FBRigidBody& operator=(const FBRigidBody& pValue);
00521
00524 virtual void Snap();
00525
00528 virtual void ComputeAnimation();
00529
00533 virtual bool IsValid();
00534
00535 FBPropertyListRigidBodyMarkers Markers;
00536 FBPropertyModel Model;
00537 FBPropertyAnimationNode QualityData;
00538 FBPropertyBool Done;
00539 FBPropertyRigidBodyMode Mode;
00540 FBPropertyInt SmoothWidth;
00541
00542 friend class FBPropertyListRigidBody;
00543 private:
00544 void FBRigidBodyInitProperties();
00545
00546 };
00547 FB_DEFINE_ARRAY ( FBSDK_DLL, RigidBody );
00548 FB_DEFINE_LIST ( FBSDK_DLL, RigidBody );
00549
00551
00553 FB_FORWARD( FBPropertyListRigidBody );
00554
00556 class FBSDK_DLL FBPropertyListRigidBody : public FBPropertyBaseList< FBRigidBody >
00557 {
00558 private:
00559 FBArrayTemplate< HFBRigidBody > mItems;
00560 virtual int Add ( FBRigidBody pItem );
00561 virtual void Refresh ();
00562 public:
00563 FBPropertyListRigidBody();
00564 virtual ~FBPropertyListRigidBody();
00568 virtual void RemoveAt( int pIndex );
00569
00574 virtual FBRigidBody operator[]( int pIndex );
00575
00579 virtual int GetCount();
00580
00586 virtual int Add( FBModelList& pList, char* pName=NULL);
00587 };
00588
00590
00592 __FB_FORWARD( FBModelOptical );
00594 class FBSDK_DLL FBModelOptical : public FBModel
00595 {
00596 __FBClassDeclare( FBModelOptical,FBModel );
00597 public:
00602 FBModelOptical(char * pName, HIObject pObject=NULL);
00603
00607 virtual bool ImportSetup();
00608
00612 virtual bool ExportSetup();
00613
00617 virtual void ClearSegments( bool pUnUsedOnly = true );
00618
00619 FBPropertyDouble MarkerSize;
00620 FBPropertyTime SamplingStart;
00621 FBPropertyTime SamplingStop;
00622 FBPropertyTime SamplingPeriod;
00623
00624 FBPropertyListModelMarkerOptical Markers;
00625 FBPropertyListOpticalSegment Segments;
00626 FBPropertyListRigidBody RigidBodies;
00627 };
00628
00630
00633 enum FBGenerationMode {
00634 kFBGenerationNone,
00635 kFBGenerationFast
00636 };
00637 FB_DEFINE_ENUM( FBSDK_DLL, GenerationMode );
00638
00640
00643 enum FBControllerMode {
00644 kFBControllerNone,
00645 kFBControllerLabelling,
00646 kFBControllerSegment,
00647 kFBControllerRigidBody
00648 };
00649 FB_DEFINE_ENUM( FBSDK_DLL, ControllerMode );
00650
00652
00655 enum FBSegmentMode {
00656 kFBSegmentMarker,
00657 kFBSegmentRigidBody,
00658 kFBSegmentAll
00659 };
00660 FB_DEFINE_ENUM( FBSDK_DLL, SegmentMode );
00661
00663
00666 enum FBInsertSegmentMode {
00667 kFBInsertSegmentWhole,
00668 kFBInsertSegmentToEnd,
00669 kFBInsertSegmentFromStart
00670 };
00671 FB_DEFINE_ENUM( FBSDK_DLL, InsertSegmentMode );
00672
00674
00676 __FB_FORWARD( FBModelOpticalAdvanced );
00678 class FBSDK_DLL FBModelOpticalAdvanced : public FBComponent
00679 {
00680 __FBClassDeclare( FBModelOpticalAdvanced,FBComponent );
00681 public:
00685 FBModelOpticalAdvanced( HFBModelOptical pOptical );
00686
00688 virtual void AcceptAllSegments();
00689
00691 virtual void AcceptSegment();
00692
00694 virtual void SkipSegment();
00695
00697 virtual void AutomaticBuild();
00698
00700 virtual void CropSegmentsAnimation();
00701
00702 FBPropertyAnimationNode Quality;
00703 FBPropertyBool ShowRigidQuality;
00704 FBPropertyGenerationMode GenerationMode;
00705 FBPropertyControllerMode ControllerMode;
00706 FBPropertySegmentMode SegmentMode;
00707 FBPropertyInsertSegmentMode InsertSegmentMode;
00708 FBPropertyBool PlayToNextSegment;
00709 FBPropertyBool AutoPlayToNextSegment;
00710 FBPropertyDouble MaxMatchDistance;
00711 FBPropertyBool Active;
00712 FBPropertyTake UsedTake;
00713 };
00714
00716
00718 __FB_FORWARD( FBDeviceOpticalMarker );
00724 class FBSDK_DLL FBDeviceOpticalMarker : public FBComponent {
00725 __FBClassDeclare( FBDeviceOpticalMarker,FBComponent );
00726 public:
00730 FBDeviceOpticalMarker(char *pName);
00731
00738 void SetData(double pX, double pY, double pZ=0.0, double pOcclusion=0.0);
00739
00740 FBPropertyBool IsUsed;
00741 FBPropertyVector3d Position;
00742 FBPropertyDouble Occlusion;
00743 FBPropertyModel Model;
00744 };
00745 FB_DEFINE_ARRAY ( FBSDK_DLL, DeviceOpticalMarker );
00746 FB_DEFINE_LIST ( FBSDK_DLL, DeviceOpticalMarker );
00747
00749
00751 FB_FORWARD( FBPropertyListDeviceOpticalMarker );
00752
00754 class FBSDK_DLL FBPropertyListDeviceOpticalMarker : public FBPropertyBaseList< HFBDeviceOpticalMarker >
00755 {
00756 FBArrayTemplate<HFBDeviceOpticalMarker> mItems;
00757 virtual int Add ( HFBDeviceOpticalMarker pItem );
00758 public:
00759 FBPropertyListDeviceOpticalMarker();
00760 virtual ~FBPropertyListDeviceOpticalMarker();
00764 virtual void RemoveAt( int pIndex );
00769 virtual HFBDeviceOpticalMarker operator[](int pIndex);
00773 virtual int GetCount();
00774
00779 virtual int Add( char *pName=NULL );
00780 };
00781
00783
00785 __FB_FORWARD( FBDeviceOptical );
00787 class FBSDK_DLL FBDeviceOptical : public FBDevice
00788 {
00789 __FBClassDeclare( FBDeviceOptical,FBDevice );
00790 public:
00791 friend class FBDeviceOpticalLayout;
00792
00797 FBDeviceOptical(char *pName, HIObject pObject=NULL);
00798
00799 FBPropertyListDeviceOpticalMarker Markers;
00800 FBPropertyBool SupportOcclusion;
00801 FBPropertyBool AutoAntialiasing;
00802 FBPropertyDouble DampingTime;
00803 FBPropertyModel ModelOptical;
00804
00805 FBPropertyBool ForceOpticalSamplingRate;
00806 FBPropertyDouble OpticalSamplingRate;
00807 FBPropertyBool UseMarkerTimeStamp;
00808
00809 FBPropertyBool SkipFrame;
00810 FBPropertyTime MarkerTimeStamp;
00811
00812
00814 void DeviceOpticalBeginSetup();
00816 void DeviceOpticalEndSetup();
00817
00823 virtual void DeviceOpticalEvalAllMarkers(FBDeviceNotifyInfo &pDeviceNotifyInfo);
00824
00830 virtual void DeviceOpticalRecordFrame(FBTime &pTime,FBDeviceNotifyInfo &pDeviceNotifyInfo);
00831
00832
00833
00834
00835 virtual bool FbxStore(HFBFbxObject pFbxObject,kFbxObjectStore pStoreWhat);
00836 virtual bool FbxRetrieve(HFBFbxObject pFbxObject,kFbxObjectStore pStoreWhat);
00837
00838
00839 virtual bool FBCreate();
00840 virtual void FBDestroy();
00841
00842
00843 virtual bool DeviceOperation( kDeviceOperations pOperation );
00844
00845
00846 virtual bool AnimationNodeNotify(HFBAnimationNode pAnimationNode,HFBEvaluateInfo pEvaluateInfo);
00847 virtual void DeviceIONotify(kDeviceIOs pAction,FBDeviceNotifyInfo &pDeviceNotifyInfo);
00848
00849
00850 virtual void RecordingInitAnimation(HFBAnimationNode pAnimationNode);
00851 virtual void RecordingDoneAnimation(HFBAnimationNode pAnimationNode);
00852 };
00853
00854 #ifdef FBSDKUseNamespace
00855 }
00856 #endif
00857
00858 #endif
00859 #endif