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);
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 
378  enum EStockElement {
379  eRecordLight,
380  eFlashElement,
381  eTextElement,
382  eRectElement,
383  eTextureElement,
384  eBloopSlate,
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
411 FB_DEFINE_LIST( FBSDK_DLL, HUD );
413 
416 {
417 public:
423  FBHUD* operator[](int pIndex);
424 };
425 
433 FB_DEFINE_COMPONENT( FBSDK_DLL, HUDManager );
435 {
437 
442  FBHUDManager(HIObject pObject = NULL);
443 
444 public:
445  FBPropertyHUD DefaultHUD;
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 */
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
FBPropertyHUDElementVAlignment VerticalDock
Read Write Property: Specifies if the HUD element will be vertically docked to the Bottom...
Definition: fbhud.h:108
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
FBX file interface.
Definition: fbfbx.h:80
FBPropertyColorAndAlpha CutActiveColor
Read Write Property: Specifies color of the Cut region when it is active.
Definition: fbhud.h:349
Top alignment.
Definition: fbhud.h:75
PropertyList: Handle.
Definition: fbhud.h:182
#define FB_DEFINE_LIST(DllTag, Type)
Define a component list.
Definition: fbproperties.h:161
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:549
HUD element rectangle for drawing in the view.
Definition: fbhud.h:119
Heads Up display.
Definition: fbhud.h:303
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
FBPropertyDouble Width
Read Write Property: Specifies the width of HUD element on the screen. It&#39;s in pixel when ScaleByPerc...
Definition: fbhud.h:113
Center.
Definition: fbhud.h:66
FBPropertyBool Visibility
Definition: fbhud.h:104
FBPropertyString FilePath
Read Write Property: Path to load the swf file from
Definition: fbhud.h:294
class K_DLLIMPORT FBPropertyBase< FBColorAndAlpha, kFBPT_ColorRGBA > FBPropertyColorAndAlpha
FBPropertyColorAndAlpha type definition.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbhud.h:48
Left alignment.
Definition: fbhud.h:64
FBPropertyBool AdjustWidthToFitText
Read Write Property: If On it it will adjust the width of a text element so that a text character&#39;s a...
Definition: fbhud.h:223
FBPropertyColorAndAlpha CutIdleColor
Read Write Property: Specifies color of the Cut region when it is idle.
Definition: fbhud.h:350
FBPropertyBool ScaleUniformly
Read Write Property: Specifies whether the width and height of HUD element will be scaled uniformly a...
Definition: fbhud.h:115
Property classes.
double mX
Element display region left bottom corner&#39;s X coordinate.
Definition: fbhud.h:121
FBPropertyBool Enable
Read Write Property: Bloop slate will appear if set to true.
Definition: fbhud.h:319
FBPropertyHUDElementHAlignment Justification
Read Write Property: Specifies if the justification of the HUD element is Left, Right, or Center.
Definition: fbhud.h:106
FBPropertyListHUDElement Elements
List: Elements present in the HUD.
Definition: fbhud.h:405
FBPropertyDouble X
Read Write Property: Specifies the horizontal position of the HUD element, relative to dock position ...
Definition: fbhud.h:109
double mY
Element display region left bottom corner&#39;s Y coordinate.
Definition: fbhud.h:122
Bottom alignment.
Definition: fbhud.h:74
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:148
Viewing options for rendering.
Definition: fbrenderer.h:175
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Background text color.
Definition: fbhud.h:221
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
Heads Up display.
Definition: fbhud.h:256
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
__FB_FORWARD(FBHUDManager)
Heads Up display manager.
FBPropertyListTexture Texture
Read Write Property: Texture to display.
Definition: fbhud.h:270
PropertyEvent: Base event class.
Definition: fbproperties.h:507
double mWidth
Element display region width.
Definition: fbhud.h:123
FBPropertyBool Show
Read Write Property: Specifies if the HUD element will be displayed or not.
Definition: fbhud.h:105
FBPropertyColorAndAlpha HeadActiveColor
Read Write Property: Specifies color of the Head region when it is active.
Definition: fbhud.h:345
FBPropertyHUD DefaultHUD
Read Write Property: Specifies the HUD to be displayed on cameras that do not have HUD explicitly ass...
Definition: fbhud.h:445
FBPropertyTime ShowAfterDelayOnRecordPlay
Read Write Property: Delay before the bloop slate is displayed after recording has started...
Definition: fbhud.h:320
Heads Up display.
Definition: fbhud.h:331
FBPropertyColorAndAlpha TailActiveColor
Read Write Property: Specifies color of the Tail region when it is active.
Definition: fbhud.h:352
FBPropertyTime TailDuration
Read Write Property: Specifies duration of the Tail region.
Definition: fbhud.h:354
Heads Up display.
Definition: fbhud.h:233
String list.
Definition: fbstring.h:201
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
double mHeightScale
Element display region height scale factor compared with intrinsic height value.
Definition: fbhud.h:126
FBHUDElementVAlignment
Definition: fbhud.h:73
Property class: const char * (String).
Basic class definitions.
FBPropertyColorAndAlpha Color
Read Write Property: Text color.
Definition: fbhud.h:220
FBPropertyDouble Y
Read Write Property: Specifies the vertical position of the HUD element, relative to dock position an...
Definition: fbhud.h:110
FBPropertyColorAndAlpha HeadIdleColor
Read Write Property: Specifies color of the Head region when it is idle.
Definition: fbhud.h:346
PropertyList: Handle.
Definition: fbhud.h:415
Center.
Definition: fbhud.h:76
A box is a fundamental building block in the application architecture.
Definition: fbcore.h:218
FBPropertyHUDElementHAlignment HorizontalDock
Read Write Property: Specifies if the HUD element will be horizontally docked to the Left...
Definition: fbhud.h:107
FBPropertyColorAndAlpha Color
Read Write Property: Color of the rectangluar region.
Definition: fbhud.h:246
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
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
FBPropertyTime HeadDuration
Read Write Property: Specifies duration of the Head region.
Definition: fbhud.h:347
double mWidthScale
Element display region width scale factor compared with intrinsic width value.
Definition: fbhud.h:125
FBPropertyString Content
Read Write Property: C like format to display like in printf.
Definition: fbhud.h:218
double mHeight
Element display region height.
Definition: fbhud.h:124
FBPropertyDouble Height
Read Write Property: Specifies the height of HUD element on the screen. It&#39;s in pixel when ScaleByPer...
Definition: fbhud.h:114
FBHUDElementHAlignment
Definition: fbhud.h:63
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
FBPropertyBool Visibility
Read Write Property: Indicate if the information will be displayed or not.
Definition: fbhud.h:403
Heads Up display.
Definition: fbhud.h:200
Heads Up display.
Definition: fbhud.h:89
FBPropertyBool ForceTimeCodeDisplay
Read Write Property: Specifies if the display of time-related reference property will be in timecode ...
Definition: fbhud.h:222
FBPropertyString Font
Read Write Property: Specifies the font.
Definition: fbhud.h:219
#define __FBClassDeclareGroup(Name, Parent)
For internal use only.
Definition: fbcomponent.h:169
MotionBuilder SDK base class.
Definition: fbcomponent.h:664
Heads Up display.
Definition: fbhud.h:280
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Bloop slate background color, by default it is 100% transparent.
Definition: fbhud.h:317
FBPropertyBool ScaleByPercent
Read Write Property: When set to true, Scale is in percentage, relative to the corresponding camera v...
Definition: fbhud.h:112
Right alignment.
Definition: fbhud.h:65
PropertyList: Texture
Definition: fbtexture.h:158
Heads Up display.
Definition: fbhud.h:366
FBPropertyColorAndAlpha TailIdleColor
Read Write Property: Specifies color of the Tail region when it is idle.
Definition: fbhud.h:353
FBPropertyEvent OnDisplay
Event: Callback just before HUD is displayed to update custom values
Definition: fbhud.h:404