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