fbsdk/fbhud.h Source File

fbhud.h
Go to the documentation of this file.
1 #ifndef __FBHUD_H__
2 #define __FBHUD_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 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48  #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbcomponent.h>
52 #include <fbsdk/fbproperties.h>
53 #include <fbsdk/fbtexture.h>
54 
55 #ifndef K_NO_HUD
56 
57 #ifdef FBSDKUseNamespace
58 namespace FBSDKNamespace {
59 #endif
60 
62 /* HUD horizontal alignment.*/
67 };
68 
69 FB_DEFINE_ENUM( FBSDK_DLL, HUDElementHAlignment );
70 
72 /* HUD vertical alignment.*/
77 };
78 
79 FB_DEFINE_ENUM( FBSDK_DLL, HUDElementVAlignment );
80 
81 FB_FORWARD(FBViewingOptions);
82 
85 
89 class FBSDK_DLL FBHUDElement : public FBBox
90 {
91  //--- Open Reality declaration.
93 
94 protected:
101  FBHUDElement( const char* pName, HIObject pObject=NULL );
102 
103 public:
116 
119  struct Rect
120  {
121  double mX;
122  double mY;
123  double mWidth;
124  double mHeight;
125  double mWidthScale;
126  double mHeightScale;
127  };
128 
134  virtual void GetIntrinsicDimension(FBViewingOptions* pViewingOptins, int& pWidth, int & pHeight);
135 
140  virtual void DrawElement(FBViewingOptions* pViewingOption, Rect& pRect);
141 
146  virtual bool FbxStore(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat);
147 
152  virtual bool FbxRetrieve(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat);
153 };
154 
159 #define FBStorableCustomHUDElementImplementation(ClassName, Desc)\
160  const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
161  HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
162  ClassName* Class = new ClassName(pName);\
163  Class->mAllocated = true;\
164  if( Class->FBCreate() ){\
165  return Class->GetHIObject();\
166  } else {\
167  delete Class;\
168  return NULL;}}\
169  FBLibraryModule(ClassName##Storable){\
170  FBString lGroup = "FbxStorable/HUDElement";\
171  FBRegisterObject(ClassName##R2, lGroup, #ClassName, Desc, RegisterStorable##ClassName##Create, true, NULL);\
172  }\
173 
174 
176 // FBPropertyListHUDElement
178 FB_DEFINE_LIST( FBSDK_DLL, HUDElement );
180 
183 {
184 public:
190  FBHUDElement* operator[](int pIndex);
191 };
192 
194 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextElement );
195 
196 
201 {
202  //--- Open Reality declaration.
204 
205 public:
211  FBHUDTextElement( const char* pName, HIObject pObject=NULL );
212 
215  FBStringList* GetFontList();
216 
217 public:
224 };
225 
226 
228 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDRectElement );
229 
234 {
235  //--- Open Reality declaration.
237 
238 public:
243  FBHUDRectElement( const char* pName, HIObject pObject=NULL );
244 
245 public:
247 };
248 
249 
251 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextureElement );
252 
257 {
258  //--- Open Reality declaration.
260 public:
266  FBHUDTextureElement( const char* pName, HIObject pObject=NULL );
267 
268 public:
269 
271 };
272 
273 
275 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDFlashElement );
276 
281 {
282  //--- Open Reality declaration.
284 public:
290  FBHUDFlashElement( const char* pName, HIObject pObject=NULL );
291 
292 public:
293 
295 };
296 
298 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDBloopSlateElement );
299 
304 {
306 
307 public:
313  FBHUDBloopSlateElement( const char* pName, HIObject pObject=NULL );
314 
315 public:
316 
322 };
323 
325 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTimelineElement );
326 
332 {
334 
335 public:
341  FBHUDTimelineElement( const char* pName, HIObject pObject=NULL );
342 
343 public:
344 
348 
351 
355 };
356 
357 __FB_FORWARD( FBHUD );
359 
366 class FBSDK_DLL FBHUD : public FBBox
367 {
368  //--- Open Reality declaration.
370 public:
376  FBHUD( const char* pName, HIObject pObject=NULL );
377 
385  eTimeline
386  };
387 
393  FBHUDElement* CreateElement( EStockElement pType, const char* pName );
394 
400  FBHUDElement* CreateCustomElement( const char* pHUDElementClassName, const char* pName );
401 
402 public:
406 };
407 
409 // FBPropertyListHUD
413 
416 {
417 public:
423  FBHUD* operator[](int pIndex);
424 };
425 
435 {
437 
442  FBHUDManager(HIObject pObject = NULL);
443 
444 public:
446 
450  static FBHUDManager& TheOne();
451 };
452 
453 #ifdef FBSDKUseNamespace
454 }
455 #endif
456 
457 #endif //K_NO_HUD
458 
459 #endif /* this must be the last line of this file */
FBPropertyTime TailDuration
Read Write Property: Specifies duration of the Tail region.
Definition: fbhud.h:354
FBX file interface.
Definition: fbfbx.h:80
class FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
PropertyEvent: Base event class.
Definition: fbproperties.h:507
FBPropertyHUD DefaultHUD
Read Write Property: Specifies the HUD to be displayed on cameras that do not have HUD explicitly ass...
Definition: fbhud.h:445
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBPropertyHUDElementVAlignment VerticalDock
Read Write Property: Specifies if the HUD element will be vertically docked to the Bottom...
Definition: fbhud.h:108
FBPropertyBool Show
Read Write Property: Specifies if the HUD element will be displayed or not.
Definition: fbhud.h:105
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Background text color.
Definition: fbhud.h:221
FBHUDElementHAlignment
Definition: fbhud.h:63
FBPropertyHUDElementHAlignment HorizontalDock
Read Write Property: Specifies if the HUD element will be horizontally docked to the Left...
Definition: fbhud.h:107
A box is a fundamental building block in the application architecture.
Definition: fbcore.h:218
FBPropertyString Content
Read Write Property: C like format to display like in printf.
Definition: fbhud.h:218
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
Definition: fbproperties.h:139
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
double mHeight
Element display region height.
Definition: fbhud.h:124
Property class: const char * (String).
FBPropertyBool ScaleByPercent
Read Write Property: When set to true, Scale is in percentage, relative to the corresponding camera v...
Definition: fbhud.h:112
FBPropertyTime HeadDuration
Read Write Property: Specifies duration of the Head region.
Definition: fbhud.h:347
FBHUDElementVAlignment
Definition: fbhud.h:73
FBPropertyColorAndAlpha CutActiveColor
Read Write Property: Specifies color of the Cut region when it is active.
Definition: fbhud.h:349
FBPropertyDouble Width
Read Write Property: Specifies the width of HUD element on the screen.
Definition: fbhud.h:113
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbhud.h:48
#define NULL
Definition: kaydara.h:179
double mWidth
Element display region width.
Definition: fbhud.h:123
Top alignment.
Definition: fbhud.h:75
double mY
Element display region left bottom corner's Y coordinate.
Definition: fbhud.h:122
FBPropertyEvent OnDisplay
Event: Callback just before HUD is displayed to update custom values
Definition: fbhud.h:404
FBPropertyDouble X
Read Write Property: Specifies the horizontal position of the HUD element, relative to dock position ...
Definition: fbhud.h:109
Heads Up display.
Definition: fbhud.h:303
Property classes.
FBPropertyString Font
Read Write Property: Specifies the font.
Definition: fbhud.h:219
FBPropertyColorAndAlpha TailActiveColor
Read Write Property: Specifies color of the Tail region when it is active.
Definition: fbhud.h:352
FBPropertyBool ScaleUniformly
Read Write Property: Specifies whether the width and height of HUD element will be scaled uniformly a...
Definition: fbhud.h:115
FBPropertyListHUDElement Elements
List: Elements present in the HUD.
Definition: fbhud.h:405
FBPropertyBool Visibility
Definition: fbhud.h:104
Heads Up display.
Definition: fbhud.h:233
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
Bottom alignment.
Definition: fbhud.h:74
FBPropertyTime ShowDuration
Read Write Property: Time that the bloop slate will be displayed.
Definition: fbhud.h:321
FBPropertyBool Enable
Read Write Property: Bloop slate will appear if set to true.
Definition: fbhud.h:319
FBPropertyListTexture Texture
Read Write Property: Texture to display.
Definition: fbhud.h:270
FBPropertyColorAndAlpha HeadActiveColor
Read Write Property: Specifies color of the Head region when it is active.
Definition: fbhud.h:345
PropertyList: Texture
Definition: fbtexture.h:158
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
HUD element rectangle for drawing in the view.
Definition: fbhud.h:119
Heads Up display.
Definition: fbhud.h:256
Heads Up display.
Definition: fbhud.h:280
FBPropertyBool Visibility
Read Write Property: Indicate if the information will be displayed or not.
Definition: fbhud.h:403
FBPropertyBool ForceTimeCodeDisplay
Read Write Property: Specifies if the display of time-related reference property will be in timecode ...
Definition: fbhud.h:222
FBPropertyDouble Height
Read Write Property: Specifies the height of HUD element on the screen.
Definition: fbhud.h:114
PropertyList: Handle.
Definition: fbhud.h:182
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
Left alignment.
Definition: fbhud.h:64
class FBPropertyBaseComponent< FBHUD * > FBPropertyHUD
Definition: fbhud.h:358
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
Heads Up display.
Definition: fbhud.h:331
FBPropertyString FilePath
Read Write Property: Path to load the swf file from
Definition: fbhud.h:294
FBPropertyBool AdjustWidthToFitText
Read Write Property: If On it it will adjust the width of a text element so that a text character's a...
Definition: fbhud.h:223
Heads Up display.
Definition: fbhud.h:200
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
Basic class definitions.
FBPropertyColorAndAlpha ForegroundColor
Read Write Property: Bloop slate foreground color.
Definition: fbhud.h:318
Heads Up display.
Definition: fbhud.h:366
FBPropertyDouble Y
Read Write Property: Specifies the vertical position of the HUD element, relative to dock position an...
Definition: fbhud.h:110
int pWidth
Definition: fbtool.h:209
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
PropertyList: Handle.
Definition: fbhud.h:415
double mHeightScale
Element display region height scale factor compared with intrinsic height value.
Definition: fbhud.h:126
FBPropertyColorAndAlpha CutIdleColor
Read Write Property: Specifies color of the Cut region when it is idle.
Definition: fbhud.h:350
Heads Up display.
Definition: fbhud.h:89
class FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
String list.
Definition: fbstring.h:201
class FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
int int pHeight
Definition: fbtool.h:209
FBPropertyTime ShowAfterDelayOnRecordPlay
Read Write Property: Delay before the bloop slate is displayed after recording has started...
Definition: fbhud.h:320
FBPropertyBool PositionByPercent
Read Write Property: When set to true, X and Y position values are in percentage, relative to the cor...
Definition: fbhud.h:111
FBPropertyColorAndAlpha TailIdleColor
Read Write Property: Specifies color of the Tail region when it is idle.
Definition: fbhud.h:353
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Bloop slate background color, by default it is 100% transparent.
Definition: fbhud.h:317
FBPropertyColorAndAlpha Color
Read Write Property: Color of the rectangluar region.
Definition: fbhud.h:246
#define __FBClassDeclareGroup(Name, Parent)
For internal use only.
Definition: fbcomponent.h:169
FBPropertyColorAndAlpha HeadIdleColor
Read Write Property: Specifies color of the Head region when it is idle.
Definition: fbhud.h:346
FBPropertyColorAndAlpha Color
Read Write Property: Text color.
Definition: fbhud.h:220
double mWidthScale
Element display region width scale factor compared with intrinsic width value.
Definition: fbhud.h:125
class FBPropertyBaseEnum< enum FBHUDElementHAlignment > FBPropertyHUDElementHAlignment
Definition: fbhud.h:69
Right alignment.
Definition: fbhud.h:65
class FBPropertyBaseEnum< enum FBHUDElementVAlignment > FBPropertyHUDElementVAlignment
Definition: fbhud.h:79
double mX
Element display region left bottom corner's X coordinate.
Definition: fbhud.h:121
FBPropertyHUDElementHAlignment Justification
Read Write Property: Specifies if the justification of the HUD element is Left, Right, or Center.
Definition: fbhud.h:106
class FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool