fbsdk/fbtracker.h Source File

fbtracker.h
Go to the documentation of this file.
1 #ifndef __FBTRACKER_H__
2 #define __FBTRACKER_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 
42 #include <kaydaradef.h>
43 #ifndef FBSDK_DLL
44 
47  #define FBSDK_DLL K_DLLIMPORT
48 #endif
49 
50 #include <fbsdk/fbcomponent.h>
51 #include <fbsdk/fbcore.h>
52 
53 #ifdef FBSDKUseNamespace
54  namespace FBSDKNamespace {
55 #endif
56 
57 /**************************************************************************
58  **************************************************************************/
61 
62 /**************************************************************************
63  **************************************************************************/
64 __FB_FORWARD( FBDeviceSyncPacket );
71 {
73  public:
75 
76  public:
80 };
81 
82 /**************************************************************************
83  **************************************************************************/
90 {
92  public:
97  FBDeviceSync(const char* pName, HIObject pObject=NULL);
103  virtual void PrintDebugAnimInfo ( int pSync, FBDeviceSyncPacket* pSyncPacket, FBEvaluateInfo* pEvaluateInfo );
108  virtual void PrintDebugIOInfo ( FBDeviceSyncPacket* pSyncPacket, FBDeviceNotifyInfo& pDeviceNotifyInfo );
113  virtual void PrintDebugIONotifyInfo ( FBDeviceNotifyInfo& pInfo, int pPacketCount );
114 
115  // Standard device virtual functions creation/destruction
116  virtual bool FBCreate ();
117  virtual void FBDestroy ();
118 
119  // Overloaded FBDevice functions
120  virtual bool AnimationNodeNotify( FBAnimationNode* pAnimationNode, FBEvaluateInfo* pEvaluateInfo );
121  virtual bool FbxStore ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat );
122  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat );
123 
130  virtual bool DeviceSyncAnimationNodeNotify( FBAnimationNode* pAnimationNode, FBEvaluateInfo* pEvaluateInfo, int pCorrectedSync ) = 0;
131 
132  //--- Packet registration
139  virtual void PacketRegister( FBDeviceSyncPacket* pPacket );
140 
141  //--- DeviceIONotify() calls
147  virtual FBDeviceSyncPacket* PacketLock ();
156  virtual void PacketUnlock ( FBDeviceSyncPacket* pPacket, bool pValidPacket );
157 
158  //--- AnimationNodeNotify() calls
168  virtual FBDeviceSyncPacket* PacketFetch( int pRequestedSync );
174  virtual void PacketRelease( FBDeviceSyncPacket* pPacket );
175 
176  //--- Queue management
181  virtual FBDeviceSyncPacket* PacketRemove( int pPacketIndex );
185  virtual int PacketGetCount();
186 
187  public:
191 };
192 
193 /**************************************************************************
194  **************************************************************************/
200 {
202 public:
204 
213 };
214 FB_DEFINE_COMPONENT( FBSDK_DLL, DeviceCameraPacket );
215 
216 /**************************************************************************
217  **************************************************************************/
228 {
230  public:
235 
240  virtual bool LoadLensTables( const char* pFilename );
247  virtual void ProcessLensData( FBDeviceCameraPacket* pDataPacket );
248 
249  // See parent class.
250  virtual bool InstrumentWriteData( FBEvaluateInfo* pEvaluateInfo ) override;
251  virtual void InstrumentRecordFrame( FBTime pRecordTime, FBDeviceNotifyInfo& pNotifyInfo ) override;
252  virtual bool FbxStore( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
253  virtual bool FbxRetrieve( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
254 
255  // Packet of information
258  // Lens options
261 
276 };
277 
278 /**************************************************************************
279  **************************************************************************/
287 {
289  public:
294  FBDeviceCamera(const char* pName, HIObject pObject=NULL);
295 
296  // Standard device virtual functions creation/destruction
297  virtual bool FBCreate ();
298  virtual void FBDestroy ();
299 
300  // Overloaded parent functions
301  virtual bool DeviceSyncAnimationNodeNotify ( FBAnimationNode* pAnimationNode, FBEvaluateInfo* pEvaluateInfo, int pCorrectedSync );
302  virtual void DeviceIONotify ( kDeviceIOs pAction, FBDeviceNotifyInfo& pDeviceNotifyInfo );
303  virtual bool ModelTemplateBindNotify( FBModel* pModel,int pIndex, FBModelTemplate* pModelTemplate );
304  virtual bool FbxStore ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat );
305  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat );
306  virtual void RecordingInitAnimation ( FBAnimationNode* pAnimationNode );
307  virtual void RecordingDoneAnimation ( FBAnimationNode* pAnimationNode );
308 
315  virtual bool DeviceCameraAnimationNodeNotify( FBEvaluateInfo* pEvaluateInfo, FBDeviceCameraPacket* pDstPacket, FBDeviceSyncPacket* pSrcPacket );
322  virtual void DeviceCameraEvalData( FBDeviceNotifyInfo& pNotifyInfo );
327  virtual void DeviceCameraRecordFrame( FBTime &pRecordTime, FBDeviceNotifyInfo& pNotifyInfo );
332  virtual bool DeviceCameraWriteData( FBEvaluateInfo* pEvaluateInfo );
337  virtual bool LoadLensTables( const char* pFilename );
344  virtual void ProcessLensData( FBDeviceCameraPacket* pDataPacket );
345 
346  public:
350 };
351 
352 #ifdef FBSDKUseNamespace
353 }
354 #endif
355 #endif
FBTimeMode FBGetSyncTimeMode()
Returns the time mode for the current system sync.
FBPropertyVector3d TranslationOffset
Property(RW): Translation offset;
Definition: fbtracker.h:273
FBPropertyBool InvertFocus
Property(RW): Invert the focus encoder values?
Definition: fbtracker.h:270
Model class.
Definition: fbmodel.h:273
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
class FBPropertyBase< FBVector2d, kFBPT_Vector2D > FBPropertyVector2d
FBPropertyVector2d type definition.
FBTimeMode
Different time modes available.
Definition: fbtime.h:63
FBPropertyInt CorrectedSync
Property: Corrected sync count (from Sync queue).
Definition: fbtracker.h:78
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
FBPropertyVector3d RotationOffset
Property(RW): Rotation offset.
Definition: fbtracker.h:274
class FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
FBPropertyDouble Focus
Property: Focus encoder value (relative).
Definition: fbtracker.h:210
FBPropertyDouble ManualFovY
Property(RW): Manual field of view Y value.
Definition: fbtracker.h:264
class FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
Sync'ed device class.
Definition: fbtracker.h:89
FBPropertyInt SyncDelay
Property: Synchronization delay (in sync count units).
Definition: fbtracker.h:189
FBPropertyVector3d Offset
Property: Camera offset.
Definition: fbtracker.h:207
FBPropertyDouble AspectRatio
Property(RW): Aspect ratio for calculating the Field of View X value.
Definition: fbtracker.h:275
Model template class.
Definition: fbcore.h:527
#define NULL
Definition: kaydara.h:169
FBPropertyDouble ZoomMultiplier
Property(RW): Filmback multiplier.
Definition: fbtracker.h:271
Device Input and Output Notification information structure.
Definition: fbcore.h:588
FBPropertyTime Time
Property: Time of packet.
Definition: fbtracker.h:212
class FBPropertyBase< FBVector3d, kFBPT_Vector3D > FBPropertyVector3d
FBPropertyVector3d type definition.
AnimationNodeNotify evaluation information.
FBPropertyString ModelTemplatePrefix
Property(RW): Model template prefix.
Definition: fbtracker.h:349
FBPropertyBool LensFovInDegrees
Property(RW): Is FOV in table in degrees (false)
Definition: fbtracker.h:268
Contains definitions for devices, boxes and models.
Property class: const char * (String).
Camera device packet.
Definition: fbtracker.h:199
FBPropertyInt PacketBufferSize
Property: Packet buffer size(default=100).
Definition: fbtracker.h:188
FBPropertyBool UsingCustomInstruments
Property(RW): Using custom instruments?
Definition: fbtracker.h:347
FBPropertyVector3d Position
Property: Position of camera.
Definition: fbtracker.h:205
FBX file interface.
Definition: fbfbx.h:80
MotionBuilder SDK base class.
Definition: fbcomponent.h:668
FBPropertyBool DebugInfo
Property: Debugging Info?
Definition: fbtracker.h:190
FBPropertyVector2d FieldOfView
Property: Field of View (X,Y) of camera lens.
Definition: fbtracker.h:208
Camera device base class.
Definition: fbtracker.h:286
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
FBPropertyInt NumberOfInstruments
Property(RW): Number of instruments.
Definition: fbtracker.h:348
FBPropertyBool ManualCenterMode
Property(RW): Manually adjust the optical center?
Definition: fbtracker.h:265
FBPropertyBool ManualFovMode
Property(RW): In manual mode (not using encoder values to control zoom)?
Definition: fbtracker.h:262
FBPropertyDeviceCameraPacket RecordPacket
Property(RW): Used as a buffer to contain the record state of the instrument, use to create the keys ...
Definition: fbtracker.h:257
Base Device class. Cannot be instantiated from Python.
Definition: fbcore.h:777
class FBPropertyBaseComponent< FBDeviceCameraPacket * > FBPropertyDeviceCameraPacket
Definition: fbtracker.h:214
Instrument for a camera device.
Definition: fbtracker.h:227
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBPropertyDouble ManualCenterY
Property(RW): Manual optical center Y coordinate.
Definition: fbtracker.h:267
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
kDeviceIOs
Types of I/O for device.
Definition: fbcore.h:795
Basic class definitions.
Time data structure.
Definition: fbtime.h:86
FBPropertyVector3d Rotation
Property: Orientation of camera.
Definition: fbtracker.h:206
FBPropertyVector2d OpticalCenter
Property: Optical Center of camera lens.
Definition: fbtracker.h:209
FBPropertyDouble NodalMultiplier
Property(RW): Multiplier for nodal offset.
Definition: fbtracker.h:272
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
FBPropertyString LensCalibrationFilename
Property(R-): Lens calibration filename.
Definition: fbtracker.h:260
Instrument abstraction layer.
Definition: fbcore.h:625
FBPropertyDouble Zoom
Property: Zoom encoder value.
Definition: fbtracker.h:211
FBPropertyDouble ManualCenterX
Property(RW): Manual optical center X coordinate.
Definition: fbtracker.h:266
FBPropertyInt OriginalSync
Property: Sync count for packet (from Application).
Definition: fbtracker.h:77
FBPropertyDeviceCameraPacket Packet
Property(RW): Used as a buffer to contain the current state of the instrument, use to put data in con...
Definition: fbtracker.h:256
Sync'ed device packet.
Definition: fbtracker.h:70
FBPropertyBool InvertZoom
Property(RW): Invert the zoom encoder values?
Definition: fbtracker.h:269
FBPropertyInt DeviceSync
Property: Sync count for packet (from Device).
Definition: fbtracker.h:79
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtracker.h:47
FBPropertyBool LensTableLoaded
Property(R-): Has the lens table been loaded?
Definition: fbtracker.h:259
FBPropertyDouble ManualFovX
Property(RW): Manual field of view X value.
Definition: fbtracker.h:263