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