fbhud.h

Go to the documentation of this file.
00001 #ifndef __FBHUD_H__
00002 #define __FBHUD_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 #include <fbsdk/fbcomponent.h>
00052 #include <fbsdk/fbproperties.h>
00053 #include <fbsdk/fbtexture.h>
00054 
00055 #ifndef K_NO_HUD
00056 
00057 #ifdef FBSDKUseNamespace
00058 namespace FBSDKNamespace {
00059 #endif
00060 
00062 /* HUD horizontal alignment.*/
00063 enum FBHUDElementHAlignment {
00064     kFBHUDLeft,         
00065     kFBHUDRight,        
00066     kFBHUDCenter,       
00067 };
00068 
00069 FB_DEFINE_ENUM( FBSDK_DLL, HUDElementHAlignment );
00070 
00072 /* HUD vertical alignment.*/
00073 enum FBHUDElementVAlignment {
00074     kFBHUDBottom,                   
00075     kFBHUDTop,                      
00076     kFBHUDVCenter = kFBHUDCenter,   
00077 };
00078 
00079 FB_DEFINE_ENUM( FBSDK_DLL, HUDElementVAlignment );
00080 
00081 FB_FORWARD(FBViewingOptions);
00082 
00083 __FB_FORWARD( FBHUDElement ); 
00084 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDElement );
00085 
00089 class FBSDK_DLL FBHUDElement : public FBBox 
00090 {
00091     //--- Open Reality declaration.
00092     __FBClassDeclare( FBHUDElement, FBBox );
00093 
00094 protected:
00101     FBHUDElement( const char* pName, HIObject pObject=NULL );
00102 
00103 public:
00104     FBPropertyBool Visibility;                      
00105     FBPropertyBool Show;                            
00106     FBPropertyHUDElementHAlignment Justification;   
00107     FBPropertyHUDElementHAlignment HorizontalDock;  
00108     FBPropertyHUDElementVAlignment VerticalDock;    
00109     FBPropertyDouble X;                             
00110     FBPropertyDouble Y;                             
00111     FBPropertyBool PositionByPercent;               
00112     FBPropertyBool ScaleByPercent;                  
00113     FBPropertyDouble Width;                         
00114     FBPropertyDouble Height;                        
00115     FBPropertyBool ScaleUniformly;                  
00116 
00119     struct Rect
00120     {
00121         double mX;              
00122         double mY;              
00123         double mWidth;          
00124         double mHeight;         
00125         double mWidthScale;     
00126         double mHeightScale;    
00127     };
00128 
00134     virtual void GetIntrinsicDimension(FBViewingOptions* pViewingOptins, int& pWidth, int & pHeight);
00135 
00140     virtual void DrawElement(FBViewingOptions* pViewingOption, Rect& pRect);
00141 
00146     virtual bool FbxStore(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat);
00147 
00152     virtual bool FbxRetrieve(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat);
00153 };
00154 
00159 #define FBStorableCustomHUDElementImplementation(ClassName, Desc)\
00160     const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
00161     HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
00162     ClassName* Class = new ClassName(pName);\
00163     Class->mAllocated = true;\
00164     if( Class->FBCreate() ){\
00165     return Class->GetHIObject();\
00166     } else {\
00167     delete Class;\
00168     return NULL;}}\
00169     FBLibraryModule(ClassName##Storable){\
00170     FBString lGroup = "FbxStorable/HUDElement";\
00171     FBRegisterObject(ClassName##R2, lGroup, #ClassName, Desc, RegisterStorable##ClassName##Create, true, NULL);\
00172     }\
00173 
00174   
00176 // FBPropertyListHUDElement
00178 FB_DEFINE_LIST( FBSDK_DLL, HUDElement );
00179 FB_FORWARD( FBPropertyListHUDElement );
00180 
00182 class FBSDK_DLL FBPropertyListHUDElement : public FBPropertyListComponent
00183 {
00184 public:
00185     FBPropertyListHUDElement();
00190     FBHUDElement* operator[](int pIndex);
00191 };
00192 
00193 __FB_FORWARD( FBHUDTextElement ); 
00194 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextElement );
00195 
00196 
00200 class FBSDK_DLL FBHUDTextElement : public FBHUDElement 
00201 {
00202     //--- Open Reality declaration.
00203     __FBClassDeclare( FBHUDTextElement , FBHUDElement );
00204 
00205 public:
00211     FBHUDTextElement( const char* pName, HIObject pObject=NULL );
00212 
00215     FBStringList* GetFontList();
00216 
00217 public:
00218     FBPropertyString                Content;                
00219     FBPropertyString                Font;                   
00220     FBPropertyColorAndAlpha         Color;                  
00221     FBPropertyColorAndAlpha         BackgroundColor;        
00222     FBPropertyBool                  ForceTimeCodeDisplay;   
00223     FBPropertyBool                  AdjustWidthToFitText;   
00224 };
00225 
00226 
00227 __FB_FORWARD( FBHUDRectElement ); 
00228 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDRectElement );
00229 
00233 class FBSDK_DLL FBHUDRectElement : public FBHUDElement 
00234 {
00235     //--- Open Reality declaration.
00236     __FBClassDeclareGroup( FBHUDRectElement , FBHUDElement );
00237 
00238 public:
00243     FBHUDRectElement( const char* pName, HIObject pObject=NULL );
00244 
00245 public:
00246     FBPropertyColorAndAlpha         Color;              
00247 };
00248 
00249 
00250 __FB_FORWARD( FBHUDTextureElement ); 
00251 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextureElement );
00252 
00256 class FBSDK_DLL FBHUDTextureElement : public FBHUDElement 
00257 {
00258     //--- Open Reality declaration.
00259     __FBClassDeclare( FBHUDTextureElement , FBHUDElement );
00260 public:
00266     FBHUDTextureElement( const char* pName, HIObject pObject=NULL );
00267 
00268 public:
00269 
00270     FBPropertyListTexture Texture;       
00271 };
00272 
00273 
00274 __FB_FORWARD( FBHUDFlashElement ); 
00275 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDFlashElement );
00276 
00280 class FBSDK_DLL FBHUDFlashElement : public FBHUDElement 
00281 {
00282     //--- Open Reality declaration.
00283     __FBClassDeclare( FBHUDFlashElement , FBHUDElement );
00284 public:
00290     FBHUDFlashElement( const char* pName, HIObject pObject=NULL );
00291 
00292 public:
00293 
00294     FBPropertyString FilePath;       
00295 };
00296 
00297 __FB_FORWARD( FBHUDBloopSlateElement ); 
00298 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDBloopSlateElement );
00299 
00303 class FBSDK_DLL FBHUDBloopSlateElement : public FBHUDFlashElement
00304 {
00305     __FBClassDeclare( FBHUDBloopSlateElement, FBHUDFlashElement );
00306 
00307 public:
00313     FBHUDBloopSlateElement( const char* pName, HIObject pObject=NULL );
00314 
00315 public:
00316 
00317     FBPropertyColorAndAlpha BackgroundColor;            
00318     FBPropertyColorAndAlpha ForegroundColor;            
00319     FBPropertyBool          Enable;                     
00320     FBPropertyTime          ShowAfterDelayOnRecordPlay; 
00321     FBPropertyTime          ShowDuration;               
00322 };
00323 
00324 __FB_FORWARD( FBHUDTimelineElement ); 
00325 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTimelineElement );
00326 
00331 class FBSDK_DLL FBHUDTimelineElement : public FBHUDFlashElement
00332 {
00333     __FBClassDeclare( FBHUDTimelineElement, FBHUDFlashElement );
00334 
00335 public:
00341     FBHUDTimelineElement( const char* pName, HIObject pObject=NULL );
00342 
00343 public:
00344 
00345     FBPropertyColorAndAlpha HeadActiveColor;    
00346     FBPropertyColorAndAlpha HeadIdleColor;      
00347     FBPropertyTime HeadDuration;                
00348 
00349     FBPropertyColorAndAlpha CutActiveColor;     
00350     FBPropertyColorAndAlpha CutIdleColor;       
00351 
00352     FBPropertyColorAndAlpha TailActiveColor;    
00353     FBPropertyColorAndAlpha TailIdleColor;      
00354     FBPropertyTime TailDuration;                
00355 };
00356 
00357 __FB_FORWARD( FBHUD ); 
00358 FB_DEFINE_COMPONENT( FBSDK_DLL, HUD );
00359 
00366 class FBSDK_DLL FBHUD : public FBBox 
00367 {
00368     //--- Open Reality declaration.
00369     __FBClassDeclare( FBHUD, FBBox );
00370 public:
00376     FBHUD( const char* pName, HIObject pObject=NULL );
00377 
00378     enum EStockElement {
00379         eRecordLight,
00380         eFlashElement,
00381         eTextElement,
00382         eRectElement,
00383         eTextureElement,
00384         eBloopSlate,
00385         eTimeline
00386     };
00387 
00388     FBHUDElement *CreateElement(EStockElement pType, const char *pName);
00389 
00390 public:
00391     FBPropertyBool              Visibility; 
00392     FBPropertyEvent             OnDisplay;  
00393     FBPropertyListHUDElement    Elements;   
00394 };
00395 
00397 // FBPropertyListHUD
00399 FB_DEFINE_LIST( FBSDK_DLL, HUD );
00400 FB_FORWARD( FBPropertyListHUD );
00401 
00403 class FBSDK_DLL FBPropertyListHUD : public FBPropertyListComponent
00404 {
00405 public:
00406     FBPropertyListHUD();
00411     FBHUD* operator[](int pIndex);
00412 };
00413 
00414 #ifdef FBSDKUseNamespace
00415 }
00416 #endif
00417 
00418 #endif //K_NO_HUD
00419 
00420 #endif /* this must be the last line of this file */