Open Reality Reference Guide
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  **************************************************************************/
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 () override;
117  virtual void FBDestroy () override;
118 
119  // Overloaded FBDevice functions
120  virtual bool AnimationNodeNotify( FBAnimationNode* pAnimationNode, FBEvaluateInfo* pEvaluateInfo ) override;
121  virtual bool FbxStore ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
122  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
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
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
256  FBPropertyDeviceCameraPacket Packet;
257  FBPropertyDeviceCameraPacket RecordPacket;
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 () override;
298  virtual void FBDestroy () override;
299 
300  // Overloaded parent functions
301  virtual bool DeviceSyncAnimationNodeNotify ( FBAnimationNode* pAnimationNode, FBEvaluateInfo* pEvaluateInfo, int pCorrectedSync ) override;
302  virtual void DeviceIONotify ( kDeviceIOs pAction, FBDeviceNotifyInfo& pDeviceNotifyInfo ) override;
303  virtual bool ModelTemplateBindNotify( FBModel* pModel,int pIndex, FBModelTemplate* pModelTemplate ) override;
304  virtual bool FbxStore ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
305  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat ) override;
306  virtual void RecordingInitAnimation ( FBAnimationNode* pAnimationNode ) override;
307  virtual void RecordingDoneAnimation ( FBAnimationNode* pAnimationNode ) override;
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
FBPropertyVector2d
class K_DLLIMPORT FBPropertyBase< FBVector2d, kFBPT_Vector2D > FBPropertyVector2d
FBPropertyVector2d type definition.
Definition: fbproperties.h:1464
FBDeviceCameraInstrument::InstrumentWriteData
virtual bool InstrumentWriteData(FBEvaluateInfo *pEvaluateInfo) override
Write data to instrument's connectors.
FBDeviceCameraInstrument::InstrumentRecordFrame
virtual void InstrumentRecordFrame(FBTime pRecordTime, FBDeviceNotifyInfo &pNotifyInfo) override
Record the data to the function curves for the instrument.
FBDeviceSyncPacket::DeviceSync
FBPropertyInt DeviceSync
Property: Sync count for packet (from Device).
Definition: fbtracker.h:79
FBDeviceSync::PacketRelease
virtual void PacketRelease(FBDeviceSyncPacket *pPacket)
Release a fetched packet.
FBDeviceCameraPacket::Zoom
FBPropertyDouble Zoom
Property: Zoom encoder value.
Definition: fbtracker.h:211
FBDeviceSyncPacket::OriginalSync
FBPropertyInt OriginalSync
Property: Sync count for packet (from Application).
Definition: fbtracker.h:77
FBDeviceCamera::DeviceCameraWriteData
virtual bool DeviceCameraWriteData(FBEvaluateInfo *pEvaluateInfo)
Write data to camera connectors.
kFbxObjectStore
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
FBDeviceCamera::DeviceCameraEvalData
virtual void DeviceCameraEvalData(FBDeviceNotifyInfo &pNotifyInfo)
I/O for camera device.
FBDeviceSync::PrintDebugAnimInfo
virtual void PrintDebugAnimInfo(int pSync, FBDeviceSyncPacket *pSyncPacket, FBEvaluateInfo *pEvaluateInfo)
Print to screen animation info.
FBDevice::kDeviceIOs
kDeviceIOs
Types of I/O for device.
Definition: fbcore.h:795
FBDeviceCameraInstrument::ManualCenterMode
FBPropertyBool ManualCenterMode
Property(RW): Manually adjust the optical center?
Definition: fbtracker.h:265
FBAnimationNode
Definition: fbdata.h:1047
FBPropertyInt
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
Definition: fbproperties.h:1331
FBDeviceCameraInstrument::InvertFocus
FBPropertyBool InvertFocus
Property(RW): Invert the focus encoder values?
Definition: fbtracker.h:270
FBDeviceSync
Sync'ed device class.
Definition: fbtracker.h:90
FBDeviceCamera::LoadLensTables
virtual bool LoadLensTables(const char *pFilename)
Load the lens lookup tables.
FBDeviceCameraPacket
Camera device packet.
Definition: fbtracker.h:200
FBDeviceCameraPacket::FieldOfView
FBPropertyVector2d FieldOfView
Property: Field of View (X,Y) of camera lens.
Definition: fbtracker.h:208
FBDeviceSync::PacketLock
virtual FBDeviceSyncPacket * PacketLock()
Lock a packet from the queue.
FBDevice
Base Device class. Cannot be instantiated from Python.
Definition: fbcore.h:777
FBDeviceSync::PacketUnlock
virtual void PacketUnlock(FBDeviceSyncPacket *pPacket, bool pValidPacket)
Unlock a previously locked packet.
FBDeviceCameraInstrument
Instrument for a camera device.
Definition: fbtracker.h:228
FBDeviceCamera::DeviceCameraRecordFrame
virtual void DeviceCameraRecordFrame(FBTime &pRecordTime, FBDeviceNotifyInfo &pNotifyInfo)
Record a frame of data to the FCurves for the camera device.
FBDeviceCameraPacket::Position
FBPropertyVector3d Position
Property: Position of camera.
Definition: fbtracker.h:205
FBGetSyncTimeMode
K_DLLIMPORT FBTimeMode FBGetSyncTimeMode()
Returns the time mode for the current system sync.
FBDeviceCameraInstrument::InvertZoom
FBPropertyBool InvertZoom
Property(RW): Invert the zoom encoder values?
Definition: fbtracker.h:269
FBDeviceCameraInstrument::ManualFovX
FBPropertyDouble ManualFovX
Property(RW): Manual field of view X value.
Definition: fbtracker.h:263
FBPropertyDouble
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
Definition: fbproperties.h:1340
FBDeviceCameraInstrument::ZoomMultiplier
FBPropertyDouble ZoomMultiplier
Property(RW): Filmback multiplier.
Definition: fbtracker.h:271
FBDeviceCameraInstrument::AspectRatio
FBPropertyDouble AspectRatio
Property(RW): Aspect ratio for calculating the Field of View X value.
Definition: fbtracker.h:275
FBDeviceCameraInstrument::FbxStore
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat) override
Storage/Retrieval of information into the FBX file format.
FBDeviceSync::DebugInfo
FBPropertyBool DebugInfo
Property: Debugging Info?
Definition: fbtracker.h:190
FBDeviceCamera::DeviceCameraAnimationNodeNotify
virtual bool DeviceCameraAnimationNodeNotify(FBEvaluateInfo *pEvaluateInfo, FBDeviceCameraPacket *pDstPacket, FBDeviceSyncPacket *pSrcPacket)
Evaluation engine callback for camera device.
FBTime
Time data structure.
Definition: fbtime.h:88
FBDeviceCameraInstrument::RotationOffset
FBPropertyVector3d RotationOffset
Property(RW): Rotation offset.
Definition: fbtracker.h:274
FBDeviceCamera::RecordingInitAnimation
virtual void RecordingInitAnimation(FBAnimationNode *pAnimationNode) override
When recording, initialize animation.
FBDeviceNotifyInfo
Device Input and Output Notification information structure.
Definition: fbcore.h:589
FBDeviceCameraInstrument::TranslationOffset
FBPropertyVector3d TranslationOffset
Property(RW): Translation offset;
Definition: fbtracker.h:273
FBDeviceSync::AnimationNodeNotify
virtual bool AnimationNodeNotify(FBAnimationNode *pAnimationNode, FBEvaluateInfo *pEvaluateInfo) override
Notification function for animation thread.
FBDeviceSync::FBDeviceSync
FBDeviceSync(const char *pName, HIObject pObject=NULL)
Constructor.
FBDeviceCameraInstrument::RecordPacket
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
FBDeviceSync::FbxStore
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat) override
Storage/Retrieval of information into the FBX file format.
FBDeviceCamera::NumberOfInstruments
FBPropertyInt NumberOfInstruments
Property(RW): Number of instruments.
Definition: fbtracker.h:348
FBDeviceCameraPacket::Focus
FBPropertyDouble Focus
Property: Focus encoder value (relative).
Definition: fbtracker.h:210
FBDeviceSync::FBDestroy
virtual void FBDestroy() override
Open Reality destruction function.
FBDeviceSync::PacketFetch
virtual FBDeviceSyncPacket * PacketFetch(int pRequestedSync)
Fetch the data packet for the requested sync count.
FBDeviceCameraPacket::Rotation
FBPropertyVector3d Rotation
Property: Orientation of camera.
Definition: fbtracker.h:206
FBPropertyTime
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
Definition: fbproperties.h:1346
FBDeviceCameraInstrument::ManualCenterY
FBPropertyDouble ManualCenterY
Property(RW): Manual optical center Y coordinate.
Definition: fbtracker.h:267
FBDeviceCameraPacket::OpticalCenter
FBPropertyVector2d OpticalCenter
Property: Optical Center of camera lens.
Definition: fbtracker.h:209
FBDeviceCameraInstrument::ProcessLensData
virtual void ProcessLensData(FBDeviceCameraPacket *pDataPacket)
Process the lens table data for this data packet.
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FBDeviceCamera::FBCreate
virtual bool FBCreate() override
Open Reality Creation function.
FBDeviceCameraPacket::Offset
FBPropertyVector3d Offset
Property: Camera offset.
Definition: fbtracker.h:207
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtracker.h:47
FBDeviceSyncPacket::CorrectedSync
FBPropertyInt CorrectedSync
Property: Corrected sync count (from Sync queue).
Definition: fbtracker.h:78
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBDeviceSync::PacketRemove
virtual FBDeviceSyncPacket * PacketRemove(int pPacketIndex)
Remove a packet from the packet queue.
FBDeviceCameraInstrument::LensFovInDegrees
FBPropertyBool LensFovInDegrees
Property(RW): Is FOV in table in degrees (false)
Definition: fbtracker.h:268
FBModelTemplate
Model template class.
Definition: fbcore.h:527
FBPropertyVector3d
class K_DLLIMPORT FBPropertyBase< FBVector3d, kFBPT_Vector3D > FBPropertyVector3d
FBPropertyVector3d type definition.
Definition: fbproperties.h:1469
FBDeviceCamera::DeviceIONotify
virtual void DeviceIONotify(kDeviceIOs pAction, FBDeviceNotifyInfo &pDeviceNotifyInfo) override
Real-Time engine thread: Device I/O.
FBDeviceSync::PacketRegister
virtual void PacketRegister(FBDeviceSyncPacket *pPacket)
Register a packet in the buffer.
FBDeviceCameraPacket::Time
FBPropertyTime Time
Property: Time of packet.
Definition: fbtracker.h:212
FBDeviceCameraPacket::FBDeviceCameraPacket
FBDeviceCameraPacket()
Constructor.
FBDeviceSync::FBCreate
virtual bool FBCreate() override
Open Reality Creation function.
FBDeviceCamera::FBDeviceCamera
FBDeviceCamera(const char *pName, HIObject pObject=NULL)
Constructor.
FBDeviceSyncPacket
Sync'ed device packet.
Definition: fbtracker.h:71
FBDeviceCamera::FBDestroy
virtual void FBDestroy() override
Open Reality destruction function.
FBDeviceCamera::DeviceSyncAnimationNodeNotify
virtual bool DeviceSyncAnimationNodeNotify(FBAnimationNode *pAnimationNode, FBEvaluateInfo *pEvaluateInfo, int pCorrectedSync) override
Real-Time synchronous evaluation callback.
FBDeviceSync::PacketBufferSize
FBPropertyInt PacketBufferSize
Property: Packet buffer size(default=100).
Definition: fbtracker.h:188
FBDeviceCameraInstrument::Packet
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
FBDeviceCamera::UsingCustomInstruments
FBPropertyBool UsingCustomInstruments
Property(RW): Using custom instruments?
Definition: fbtracker.h:347
FBDeviceSyncPacket::FBDeviceSyncPacket
FBDeviceSyncPacket()
Constructor.
FBPropertyBool
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
Definition: fbproperties.h:1308
fbcomponent.h
Basic class definitions.
FBDeviceCamera
Camera device base class.
Definition: fbtracker.h:287
FBDeviceCamera::ModelTemplateBindNotify
virtual bool ModelTemplateBindNotify(FBModel *pModel, int pIndex, FBModelTemplate *pModelTemplate) override
Model Template binding notification callback.
FBDeviceCamera::ModelTemplatePrefix
FBPropertyString ModelTemplatePrefix
Property(RW): Model template prefix.
Definition: fbtracker.h:349
FBDeviceSync::SyncDelay
FBPropertyInt SyncDelay
Property: Synchronization delay (in sync count units).
Definition: fbtracker.h:189
fbcore.h
Contains definitions for devices, boxes and models.
FBDeviceSync::PacketGetCount
virtual int PacketGetCount()
Get the number of packets in the queue.
FBTimeMode
FBTimeMode
Different time modes available.
Definition: fbtime.h:63
FBDeviceCameraInstrument::LensTableLoaded
FBPropertyBool LensTableLoaded
Property(R-): Has the lens table been loaded?
Definition: fbtracker.h:259
FBDeviceCameraInstrument::ManualFovMode
FBPropertyBool ManualFovMode
Property(RW): In manual mode (not using encoder values to control zoom)?
Definition: fbtracker.h:262
FBDeviceInstrument
Instrument abstraction layer.
Definition: fbcore.h:626
FB_DEFINE_COMPONENT
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBDeviceCamera::RecordingDoneAnimation
virtual void RecordingDoneAnimation(FBAnimationNode *pAnimationNode) override
When recording, finish animation.
FBDeviceCameraInstrument::FBDeviceCameraInstrument
FBDeviceCameraInstrument(FBDevice *pDevice)
Constructor.
FBFbxObject
FBX file interface.
Definition: fbfbx.h:80
FBDeviceSync::PrintDebugIONotifyInfo
virtual void PrintDebugIONotifyInfo(FBDeviceNotifyInfo &pInfo, int pPacketCount)
Print to screen input/output notification info.
FBEvaluateInfo
AnimationNodeNotify evaluation information.
Definition: fbevaluateinfo.h:79
FBDeviceCameraInstrument::ManualFovY
FBPropertyDouble ManualFovY
Property(RW): Manual field of view Y value.
Definition: fbtracker.h:264
FBPropertyString
Property class: const char * (String).
Definition: fbproperties.h:1281
FBModel
Model class.
Definition: fbmodel.h:274
FBComponent
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBDeviceCameraInstrument::LensCalibrationFilename
FBPropertyString LensCalibrationFilename
Property(R-): Lens calibration filename.
Definition: fbtracker.h:260
FBDeviceSync::DeviceSyncAnimationNodeNotify
virtual bool DeviceSyncAnimationNodeNotify(FBAnimationNode *pAnimationNode, FBEvaluateInfo *pEvaluateInfo, int pCorrectedSync)=0
Real-Time synchronous evaluation callback.
FBDeviceCamera::ProcessLensData
virtual void ProcessLensData(FBDeviceCameraPacket *pDataPacket)
Process the lens table data for this data packet.
FBDeviceCameraInstrument::NodalMultiplier
FBPropertyDouble NodalMultiplier
Property(RW): Multiplier for nodal offset.
Definition: fbtracker.h:272
FBDeviceSync::PrintDebugIOInfo
virtual void PrintDebugIOInfo(FBDeviceSyncPacket *pSyncPacket, FBDeviceNotifyInfo &pDeviceNotifyInfo)
Print to screen input/output info.
FBDeviceCameraInstrument::LoadLensTables
virtual bool LoadLensTables(const char *pFilename)
Load the lens lookup tables.
FBDeviceCameraInstrument::ManualCenterX
FBPropertyDouble ManualCenterX
Property(RW): Manual optical center X coordinate.
Definition: fbtracker.h:266
FBDeviceCamera::FbxStore
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat) override
Storage/Retrieval of information into the FBX file format.