Open Reality Reference Guide
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
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 
82 
84 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDElement );
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:
106  FBPropertyHUDElementHAlignment Justification;
107  FBPropertyHUDElementHAlignment HorizontalDock;
108  FBPropertyHUDElementVAlignment VerticalDock;
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) override;
147 
152  virtual bool FbxRetrieve(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat) override;
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 
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 
358 // FBPropertyListHUD
360 __FB_FORWARD( FBHUD );
361 
362 FB_DEFINE_LIST( FBSDK_DLL, HUD );
364 
367 {
368 public:
374  FBHUD* operator[](int pIndex);
375 };
376 
378 // FBHUD
381 
388 class FBSDK_DLL FBHUD : public FBBox
389 {
390  //--- Open Reality declaration.
392 public:
398  FBHUD( const char* pName, HIObject pObject=NULL );
399 
400  enum EStockElement {
401  eRecordLight,
402  eFlashElement,
403  eTextElement,
404  eRectElement,
405  eTextureElement,
406  eBloopSlate,
407  eTimeline
408  };
409 
415  FBHUDElement* CreateElement( EStockElement pType, const char* pName );
416 
422  FBHUDElement* CreateCustomElement( const char* pHUDElementClassName, const char* pName );
423 
424 public:
429 };
430 
431 
432 
433 
441 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDManager );
443 {
445 
450  FBHUDManager(HIObject pObject = NULL);
451 
452 public:
453  FBPropertyHUD DefaultHUD;
454 
458  static FBHUDManager& TheOne();
459 };
460 
461 #ifdef FBSDKUseNamespace
462 }
463 #endif
464 
465 #endif //K_NO_HUD
466 
467 #endif /* this must be the last line of this file */
A box is a fundamental building block in the application architecture.
Definition: fbcore.h:218
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBX file interface.
Definition: fbfbx.h:80
Heads Up display.
Definition: fbhud.h:304
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Bloop slate background color, by default it is 100% transparent.
Definition: fbhud.h:317
FBPropertyColorAndAlpha ForegroundColor
Read Write Property: Bloop slate foreground color.
Definition: fbhud.h:318
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
FBPropertyTime ShowAfterDelayOnRecordPlay
Read Write Property: Delay before the bloop slate is displayed after recording has started.
Definition: fbhud.h:320
FBHUDBloopSlateElement(const char *pName, HIObject pObject=NULL)
Constructor.
Heads Up display.
Definition: fbhud.h:90
FBPropertyHUDElementHAlignment Justification
Read Write Property: Specifies if the justification of the HUD element is Left, Right,...
Definition: fbhud.h:106
FBPropertyHUDElementVAlignment VerticalDock
Read Write Property: Specifies if the HUD element will be vertically docked to the Bottom,...
Definition: fbhud.h:108
virtual void GetIntrinsicDimension(FBViewingOptions *pViewingOptins, int &pWidth, int &pHeight)
Callback for getting HUD element intrinsic dimension which is opposed to the actual display dimension...
FBPropertyDouble Y
Read Write Property: Specifies the vertical position of the HUD element, relative to dock position an...
Definition: fbhud.h:110
FBPropertyDouble X
Read Write Property: Specifies the horizontal position of the HUD element, relative to dock position ...
Definition: fbhud.h:109
FBPropertyDouble Width
Read Write Property: Specifies the width of HUD element on the screen. It's in pixel when ScaleByPerc...
Definition: fbhud.h:113
FBPropertyBool Show
Read Write Property: Specifies if the HUD element will be displayed or not.
Definition: fbhud.h:105
FBPropertyDouble Height
Read Write Property: Specifies the height of HUD element on the screen. It's in pixel when ScaleByPer...
Definition: fbhud.h:114
FBPropertyBool Visibility
Definition: fbhud.h:104
virtual bool FbxStore(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat) override
Store function that can be overloaded.
FBPropertyHUDElementHAlignment HorizontalDock
Read Write Property: Specifies if the HUD element will be horizontally docked to the Left,...
Definition: fbhud.h:107
FBPropertyBool ScaleByPercent
Read Write Property: When set to true, Scale is in percentage, relative to the corresponding camera v...
Definition: fbhud.h:112
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
FBPropertyBool ScaleUniformly
Read Write Property: Specifies whether the width and height of HUD element will be scaled uniformly a...
Definition: fbhud.h:115
virtual bool FbxRetrieve(FBFbxObject *pFbxObject, kFbxObjectStore pStoreWhat) override
Retrieve function that can be overloaded.
FBHUDElement(const char *pName, HIObject pObject=NULL)
Constructor.
virtual void DrawElement(FBViewingOptions *pViewingOption, Rect &pRect)
Callback for drawing HUD element.
Heads Up display.
Definition: fbhud.h:281
FBPropertyString FilePath
Read Write Property: Path to load the swf file from
Definition: fbhud.h:294
FBHUDFlashElement(const char *pName, HIObject pObject=NULL)
Constructor.
Heads Up display.
Definition: fbhud.h:389
FBPropertyListHUD HUDs
List: HUDS attached to this HUD.
Definition: fbhud.h:428
FBPropertyListHUDElement Elements
List: Elements present in the HUD.
Definition: fbhud.h:427
FBHUDElement * CreateElement(EStockElement pType, const char *pName)
Creates a stock HUD Element.
FBPropertyBool Visibility
Read Write Property: Indicate if the information will be displayed or not.
Definition: fbhud.h:425
FBHUD(const char *pName, HIObject pObject=NULL)
Constructor.
FBHUDElement * CreateCustomElement(const char *pHUDElementClassName, const char *pName)
Creates a custom HUD Element.
FBPropertyEvent OnDisplay
Event: Callback just before HUD is displayed to update custom values
Definition: fbhud.h:426
FBPropertyHUD DefaultHUD
Read Write Property: Specifies the HUD to be displayed on cameras that do not have HUD explicitly ass...
Definition: fbhud.h:453
static FBHUDManager & TheOne()
Access to the singleton Heads Up Display(HUD) Manager.
Heads Up display.
Definition: fbhud.h:234
FBHUDRectElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyColorAndAlpha Color
Read Write Property: Color of the rectangluar region.
Definition: fbhud.h:246
Heads Up display.
Definition: fbhud.h:201
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Background text color.
Definition: fbhud.h:221
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
FBHUDTextElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyString Content
Read Write Property: C like format to display like in printf.
Definition: fbhud.h:218
FBPropertyString Font
Read Write Property: Specifies the font.
Definition: fbhud.h:219
FBPropertyColorAndAlpha Color
Read Write Property: Text color.
Definition: fbhud.h:220
FBPropertyBool ForceTimeCodeDisplay
Read Write Property: Specifies if the display of time-related reference property will be in timecode ...
Definition: fbhud.h:222
FBStringList * GetFontList()
Returns a list of supported fonts.
Heads Up display.
Definition: fbhud.h:257
FBPropertyListTexture Texture
Read Write Property: Texture to display.
Definition: fbhud.h:270
FBHUDTextureElement(const char *pName, HIObject pObject=NULL)
Constructor.
Heads Up display.
Definition: fbhud.h:332
FBHUDTimelineElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyTime HeadDuration
Read Write Property: Specifies duration of the Head region.
Definition: fbhud.h:347
FBPropertyColorAndAlpha HeadActiveColor
Read Write Property: Specifies color of the Head region when it is active.
Definition: fbhud.h:345
FBPropertyColorAndAlpha HeadIdleColor
Read Write Property: Specifies color of the Head region when it is idle.
Definition: fbhud.h:346
FBPropertyColorAndAlpha CutActiveColor
Read Write Property: Specifies color of the Cut region when it is active.
Definition: fbhud.h:349
FBPropertyColorAndAlpha TailIdleColor
Read Write Property: Specifies color of the Tail region when it is idle.
Definition: fbhud.h:353
FBPropertyTime TailDuration
Read Write Property: Specifies duration of the Tail region.
Definition: fbhud.h:354
FBPropertyColorAndAlpha CutIdleColor
Read Write Property: Specifies color of the Cut region when it is idle.
Definition: fbhud.h:350
FBPropertyColorAndAlpha TailActiveColor
Read Write Property: Specifies color of the Tail region when it is active.
Definition: fbhud.h:352
PropertyEvent: Base event class.
Definition: fbproperties.h:515
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:536
PropertyList: Handle.
Definition: fbhud.h:183
FBHUDElement * operator[](int pIndex)
Get the model template at pIndex.
PropertyList: Handle.
Definition: fbhud.h:367
FBHUD * operator[](int pIndex)
Get the model template at pIndex.
PropertyList: Texture
Definition: fbtexture.h:159
Property class: const char * (String).
String list.
Definition: fbstring.h:208
Viewing options for rendering.
Definition: fbrenderer.h:176
Basic class definitions.
#define __FBClassDeclareGroup(Name, Parent)
For internal use only.
Definition: fbcomponent.h:155
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbhud.h:48
FBHUDElementHAlignment
Definition: fbhud.h:63
@ kFBHUDLeft
Left alignment.
Definition: fbhud.h:64
@ kFBHUDCenter
Center.
Definition: fbhud.h:66
@ kFBHUDRight
Right alignment.
Definition: fbhud.h:65
__FB_FORWARD(FBHUDManager)
Heads Up display manager.
FBHUDElementVAlignment
Definition: fbhud.h:73
@ kFBHUDBottom
Bottom alignment.
Definition: fbhud.h:74
@ kFBHUDVCenter
Center.
Definition: fbhud.h:76
@ kFBHUDTop
Top alignment.
Definition: fbhud.h:75
Property classes.
class K_DLLIMPORT FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:163
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
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:62
HUD element rectangle for drawing in the view.
Definition: fbhud.h:120
double mWidth
Element display region width.
Definition: fbhud.h:123
double mHeight
Element display region height.
Definition: fbhud.h:124
double mHeightScale
Element display region height scale factor compared with intrinsic height value.
Definition: fbhud.h:126
double mY
Element display region left bottom corner's Y coordinate.
Definition: fbhud.h:122
double mWidthScale
Element display region width scale factor compared with intrinsic width value.
Definition: fbhud.h:125
double mX
Element display region left bottom corner's X coordinate.
Definition: fbhud.h:121