fbdevicelayout.h

Go to the documentation of this file.
00001 #ifndef __FBDEVICELAYOUT_H__
00002 #define __FBDEVICELAYOUT_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045 
00048     #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050 
00051 // Core includes
00052 #include <fbsdk/fbcore.h>   // FBPropertyDevice
00053 
00054 // UI includes
00055 #include <fbcontrols/fbcontrols.h>
00056 
00057 // Namespace declaration
00058 #ifdef FBSDKUseNamespace
00059     namespace FBSDKNamespace {
00060 #endif
00061 
00062 FB_FORWARD( FBDeviceCameraInstrument );
00063 FB_FORWARD( FBDeviceCamera );
00064 FB_FORWARD( FBDeviceOptical );
00065 
00071 #define FBRegisterDeviceLayout( ClassName,UniqueNameStr, IconFilename ) \
00072     HIObject RegisterDeviceLayout##ClassName( HIObject /*pOwner*/,char * /*pName*/,void *pData) \
00073     {\
00074         ClassName *Class = new ClassName( (HFBDevice)FBGetFBObject((HIObject)pData) ); \
00075         Class->mAllocated = true; \
00076         if (Class->FBCreate()) { \
00077             return Class->GetHIObject(); \
00078         } else { \
00079             delete Class; \
00080             return NULL; \
00081         } \
00082     } \
00083     FBLibraryModule( ClassName )    \
00084     {   \
00085         FBRegisterObject( ClassName,"UI_Associated_ClassName",UniqueNameStr,UniqueNameStr" Device Layout",RegisterDeviceLayout##ClassName, true, IconFilename );\
00086     }
00087 
00092 #define FBDeviceLayoutDeclare( ClassName,Parent ) \
00093     FBClassDeclare( ClassName,Parent ); \
00094   public: \
00095     ClassName(HFBDevice pDevice):Parent(pDevice) { FBClassInit; } \
00096   private:
00097 
00101 #define FBDeviceLayoutImplementation( ThisComponent ) \
00102     FBClassImplementation( ThisComponent )
00103 
00105 // FBDeviceLayout
00107 __FB_FORWARD( FBDeviceLayout );
00108 
00113 class FBSDK_DLL FBDeviceLayout :    public FBLayout {
00114     __FBClassDeclare( FBDeviceLayout,FBLayout );
00115 
00116 public:
00120     FBDeviceLayout( HFBDevice pDevice = NULL );
00121 
00122     FBPropertyDevice    Device;                 
00123 };
00124 
00126 // FBDeviceOpticalLayout
00128 __FB_FORWARD( FBDeviceOpticalLayout);
00129 
00131 class FBSDK_DLL FBDeviceOpticalLayout : public FBDeviceLayout
00132 {
00133     // Basic declaration macros
00134     __FBClassDeclare( FBDeviceOpticalLayout , FBDeviceLayout);
00135 
00136   public:
00138     enum FBDeviceOpticalGUIOptions  { 
00139         kGUIModelOpticalList        = 1<<0,     
00140         kGUIModelOpticalCreate      = 1<<1,     
00141         kGUIModelOpticalDampingTime = 1<<2,     
00142         kGUIDeviceStatus            = 1<<3,     
00143         kGUIDeviceReset             = 1<<4,     
00144         kGUIViewer                  = 1<<5      
00145     };
00146     
00150     FBDeviceOpticalLayout( HFBDevice pDevice = NULL );
00151 
00152     //---- See base class ----
00153     // Standard device virtual functions creation
00154     virtual bool FBCreate();
00155 
00156   public:
00157     HFBDeviceOptical        mDeviceOptical;         
00158     FBPropertyInt           GenericUIOptions;       
00159 };
00160 
00161 /**************************************************************************
00162  **************************************************************************/
00163 __FB_FORWARD( FBDeviceCameraLayout);
00165 #define FBTRACKER_NO_LENSFILE   "-- no lens file --"
00166 
00168 class FBSDK_DLL FBDeviceCameraLayout : public FBDeviceLayout
00169 {
00170     //--- Open Reality declaration.
00171     __FBClassDeclare( FBDeviceCameraLayout, FBDeviceLayout );
00172   public: 
00173     FBDeviceCameraLayout(HFBDevice pDevice);
00174 
00175     //--- Open Reality Creation/Destruction.
00176     virtual bool FBCreate();        
00177     virtual void FBDestroy();       
00178                                                     
00179 public:
00180     //--- UI Management
00181     virtual void    UICreate                            ();     
00182     virtual void        UICreateLayoutInstruments       ();     
00183     virtual void        UICreateLayoutCommunication     ();     
00184     virtual void        UICreateLayoutInfo              ();     
00185     virtual void        UICreateLayoutCustom            ();     
00186     virtual void    UIConfigure                         ();     
00187     virtual void        UIConfigureLayoutInstruments    ();     
00188     virtual void        UIConfigureLayoutCommunication  ();     
00189     virtual void        UIConfigureLayoutInfo           ();     
00190     virtual void        UIConfigureLayoutCustom         ();     
00191     virtual void    UIRefresh                           ();     
00192     virtual void        UIRefreshLayoutInstruments      ();     
00193     virtual void        UIRefreshLayoutCommunications   ();     
00194     virtual void        UIRefreshLayoutCustom           ();     
00195     virtual void    UIUpdateEnabled                     ();     
00196     virtual void    UIReset                             ();     
00197     virtual void        UIResetLayoutInstruments        ();     
00198     virtual void        UIResetLayoutCommunications     ();     
00199     virtual void        UIResetLayoutCustom             ();     
00200 
00205     virtual FBDeviceCameraInstrument* GetCurrentInstrument();
00206 
00207 protected:
00208     FBTabPanel          mTabPanel;                      
00209 
00210     FBLayout            mLayoutInstruments;             
00211         FBList              mListInstruments;           
00212         FBButton            mButtonActive;              
00213 
00214         // Fov
00215         FBButton            mButtonManualFov;           
00216         FBLabel             mLabelFovX;                 
00217         FBLabel             mLabelFovY;                 
00218         FBSlider            mSliderFovX;                
00219         FBSlider            mSliderFovY;                
00220         FBEditNumber        mEditNumberFovX;            
00221         FBEditNumber        mEditNumberFovY;            
00222 
00223         // Optical Center
00224         FBButton            mButtonManualCenter;        
00225         FBLabel             mLabelCenterX;              
00226         FBLabel             mLabelCenterY;              
00227         FBSlider            mSliderCenterX;             
00228         FBSlider            mSliderCenterY;             
00229         FBEditNumber        mEditNumberCenterX;         
00230         FBEditNumber        mEditNumberCenterY;         
00231 
00232         // Offsets
00233         FBLabel             mLabelOffsetT;              
00234         FBLabel             mLabelOffsetR;              
00235         FBEditVector        mEditVectorOffsetT;         
00236         FBEditVector        mEditVectorOffsetR;         
00237 
00238         // Lens Calibration
00239         FBButton            mButtonLoadLensfile;        
00240         FBButton            mButtonResetLensfile;       
00241         FBLabel             mLabelLensfileName;         
00242         FBLabel             mLabelInversion;            
00243         FBButton            mButtonInvertZoom;          
00244         FBButton            mButtonInvertFocus;         
00245         FBLabel             mLabelFovUnits;             
00246         FBButton            mButtonFovUnitsDeg;         
00247         FBButton            mButtonFovUnitsRad;         
00248         FBLabel             mLabelNodalX;               
00249         FBSlider            mSliderNodalX;              
00250         FBEditNumber        mEditNumberNodalX;          
00251         FBLabel             mLabelZoomX;                
00252         FBSlider            mSliderZoomX;               
00253         FBEditNumber        mEditNumberZoomX;           
00254 
00255         // Video format
00256         FBLabel             mLabelAspectRatio;          
00257         FBSlider            mSliderAspectRatio;         
00258         FBEditNumber        mEditNumberAspectRatio;     
00259         FBLabel             mLabelAspectRatioPresets;   
00260         FBList              mListAspectRatioPresets;    
00261 
00262     FBLayout            mLayoutCommunication;           
00263         // Sync
00264         FBLabel             mLabelSyncDelay;            
00265         FBSlider            mSliderSyncDelay;           
00266         FBEditNumber        mEditNumberSyncDelay;       
00267         FBButton            mButtonSyncInfo;            
00268     
00269         // Serial port
00270         FBButton            mButtonEnableSerial;        
00271             FBLabel             mLabelSerialPort;       
00272             FBList              mListSerialPort;        
00273             FBLabel             mLabelSerialBaudRate;   
00274             FBList              mListSerialBaudRate;    
00275 
00276         // Network
00277         FBButton            mButtonEnableNetwork;       
00278             FBLabel             mLabelNetworkAddress;   
00279             FBEdit              mEditNetworkAddress;    
00280             FBLabel             mLabelNetworkPort;      
00281             FBEdit              mEditNetworkPort;       
00282             FBLabel             mLabelNetworkProtocol;  
00283             FBList              mListNetworkProtocol;   
00284 
00285         // Shared Memory
00286         FBButton            mButtonEnableSharedMemory;  
00287             FBLabel             mLabelHandle;           
00288             FBEdit              mEditHandle;            
00289             FBLabel             mLabelAddress;          
00290             FBEdit              mEditAddress;           
00291 
00292         // Simulator
00293         FBButton            mButtonEnableSimulator;             
00294             FBLabel             mLabelSimulatorFrequency;       
00295             FBSlider            mSliderSimulatorFrequency;      
00296             FBEditNumber        mEditNumberSimulatorFrequency;  
00297             FBLabel             mLabelSimulatorAmplitude;       
00298             FBSlider            mSliderSimulatorAmplitude;      
00299             FBEditNumber        mEditNumberSimulatorAmplitude;  
00300             FBLabel             mLabelSimulatorZoom;            
00301             FBSlider            mSliderSimulatorZoom;           
00302             FBEditNumber        mEditNumberSimulatorZoom;       
00303             FBLabel             mLabelSimulatorFocus;           
00304             FBSlider            mSliderSimulatorFocus;          
00305             FBEditNumber        mEditNumberSimulatorFocus;      
00306 
00307     FBLayout            mLayoutInfo;                    
00308         FBSpread            mSpreadInfo;                
00309 
00310     FBLayout            mLayoutCustom;                  
00311 
00312 public:
00313     // Device/Idle callbacks
00314     virtual void    OnDeviceStatusChange        ( HISender pSender, HKEvent pEvent );       
00315     virtual void    OnUIIdle                    ( HISender pSender, HKEvent pEvent );       
00316 
00317     // Base UI manipulation callbacks
00318     virtual void    OnTabPanelChange            ( HISender pSender, HKEvent pEvent );       
00319     virtual void    OnListInstrumentsChange     ( HISender pSender, HKEvent pEvent );       
00320 
00321     // Instrument/lens
00322     // These should be fine
00323     virtual void    OnButtonActiveClick             ( HISender pSender, HKEvent pEvent );               
00324     virtual void    OnButtonManualChange                        ( HISender pSender, HKEvent pEvent );   
00325     virtual void        OnButtonManualFovClick                  ( HISender pSender, HKEvent pEvent );   
00326     virtual void        OnButtonManualCenterClick               ( HISender pSender, HKEvent pEvent );   
00327     virtual void    OnFovChange                     ( HISender pSender, HKEvent pEvent );               
00328     virtual void        OnFovXSliderChange                      ( HISender pSender, HKEvent pEvent );   
00329     virtual void        OnFovYSliderChange                      ( HISender pSender, HKEvent pEvent );   
00330     virtual void        OnFovXEditNumberChange                  ( HISender pSender, HKEvent pEvent );   
00331     virtual void        OnFovYEditNumberChange                  ( HISender pSender, HKEvent pEvent );   
00332     virtual void    OnCenterChange                  ( HISender pSender, HKEvent pEvent );               
00333     virtual void        OnCenterXSliderChange                   ( HISender pSender, HKEvent pEvent );   
00334     virtual void        OnCenterYSliderChange                   ( HISender pSender, HKEvent pEvent );   
00335     virtual void        OnCenterXEditNumberChange               ( HISender pSender, HKEvent pEvent );   
00336     virtual void        OnCenterYEditNumberChange               ( HISender pSender, HKEvent pEvent );   
00337     virtual void    OnOffsetChange                  ( HISender pSender, HKEvent pEvent );               
00338     virtual void        OnOffsetTChange                         ( HISender pSender, HKEvent pEvent );   
00339     virtual void        OnOffsetRChange                         ( HISender pSender, HKEvent pEvent );   
00340     virtual void    OnLensfileChange                ( HISender pSender, HKEvent pEvent );               
00341     virtual void    OnButtonLoadLensfileClick       ( HISender pSender, HKEvent pEvent );               
00342     virtual void    OnButtonResetLensfileClick      ( HISender pSender, HKEvent pEvent );               
00343     virtual void    OnInvertChange                  ( HISender pSender, HKEvent pEvent );               
00344     virtual void        OnInvertFocusClick                      ( HISender pSender, HKEvent pEvent );   
00345     virtual void        OnInvertZoomClick                       ( HISender pSender, HKEvent pEvent );   
00346     virtual void    OnFovUnitsChange                ( HISender pSender, HKEvent pEvent );               
00347     virtual void        OnFovUnitsDegClick                      ( HISender pSender, HKEvent pEvent );   
00348     virtual void        OnFovUnitsRadClick                      ( HISender pSender, HKEvent pEvent );   
00349     virtual void    OnNodalXChange                  ( HISender pSender, HKEvent pEvent );               
00350     virtual void        OnNodalXSliderChange                    ( HISender pSender, HKEvent pEvent );   
00351     virtual void        OnNodalXEditNumberChange                ( HISender pSender, HKEvent pEvent );   
00352     virtual void    OnZoomXChange                   ( HISender pSender, HKEvent pEvent );               
00353     virtual void        OnZoomXSliderChange                     ( HISender pSender, HKEvent pEvent );   
00354     virtual void        OnZoomXEditNumberChange                 ( HISender pSender, HKEvent pEvent );   
00355     virtual void    OnAspectRatioChange             ( HISender pSender, HKEvent pEvent );               
00356     virtual void        OnAspectRatioSliderChange               ( HISender pSender, HKEvent pEvent );   
00357     virtual void        OnAspectRatioEditNumberChange           ( HISender pSender, HKEvent pEvent );   
00358     virtual void        OnAspectRatioPresetChange               ( HISender pSender, HKEvent pEvent );   
00359 
00360     // Communications
00361     // These need to be overloaded.
00362     virtual void    OnSyncDelayChange               ( HISender pSender, HKEvent pEvent );               
00363     virtual void        OnSyncDelaySliderChange                 ( HISender pSender, HKEvent pEvent );   
00364     virtual void        OnSyncDelayEditNumberChange             ( HISender pSender, HKEvent pEvent );   
00365     virtual void    OnButtonSyncInfoClick           ( HISender pSender, HKEvent pEvent );               
00366 
00367     virtual void    OnEnableChange                  ( HISender pSender, HKEvent pEvent );               
00368     virtual void        OnEnableSerialClick                     ( HISender pSender, HKEvent pEvent );   
00369     virtual void        OnEnableSimulatorClick                  ( HISender pSender, HKEvent pEvent );   
00370     virtual void        OnEnableNetworkClick                    ( HISender pSender, HKEvent pEvent );   
00371     virtual void        OnEnableSharedMemoryClick               ( HISender pSender, HKEvent pEvent );   
00372 
00373     virtual void    OnSerialChange                  ( HISender pSender, HKEvent pEvent );               
00374     virtual void        OnSerialPortChange                      ( HISender pSender, HKEvent pEvent );   
00375     virtual void        OnSerialBaudRateChange                  ( HISender pSender, HKEvent pEvent );   
00376     virtual void    OnNetworkChange                 ( HISender pSender, HKEvent pEvent );               
00377     virtual void        OnNetworkAddressChange                  ( HISender pSender, HKEvent pEvent );   
00378     virtual void        OnNetworkPortChange                     ( HISender pSender, HKEvent pEvent );   
00379     virtual void        OnNetworkProtocolChange                 ( HISender pSender, HKEvent pEvent );   
00380     virtual void    OnSimulatorChange               ( HISender pSender, HKEvent pEvent );               
00381     virtual void        OnSimulatorAmplitudeEditNumberChange    ( HISender pSender, HKEvent pEvent );   
00382     virtual void        OnSimulatorAmplitudeSliderChange        ( HISender pSender, HKEvent pEvent );   
00383     virtual void        OnSimulatorFrequencyEditNumberChange    ( HISender pSender, HKEvent pEvent );   
00384     virtual void        OnSimulatorFrequencySliderChange        ( HISender pSender, HKEvent pEvent );   
00385     virtual void        OnSimulatorZoomEditNumberChange         ( HISender pSender, HKEvent pEvent );   
00386     virtual void        OnSimulatorZoomSliderChange             ( HISender pSender, HKEvent pEvent );   
00387     virtual void        OnSimulatorFocusEditNumberChange        ( HISender pSender, HKEvent pEvent );   
00388     virtual void        OnSimulatorFocusSliderChange            ( HISender pSender, HKEvent pEvent );   
00389     virtual void    OnSharedMemoryChange            ( HISender pSender, HKEvent pEvent );               
00390     virtual void        OnSharedMemoryHandleChange              ( HISender pSender, HKEvent pEvent );   
00391     virtual void        OnSharedMemoryAddressChange             ( HISender pSender, HKEvent pEvent );   
00392 
00393 protected:  
00394     HFBDeviceCamera     mDeviceCamera;          
00395     FBPropertyInt       SupportedCommTypes;     
00396     FBPropertyBool      CustomLayout;           
00397 };
00398     
00399 #ifdef FBSDKUseNamespace
00400     }
00401 #endif
00402 #endif