Open Reality Reference Guide
 
Loading...
Searching...
No Matches
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
58namespace FBSDKNamespace {
59#endif
60
62/* HUD horizontal alignment.*/
67};
68
69FB_DEFINE_ENUM( FBSDK_DLL, HUDElementHAlignment );
70
72/* HUD vertical alignment.*/
77};
78
79FB_DEFINE_ENUM( FBSDK_DLL, HUDElementVAlignment );
80
82
84FB_DEFINE_COMPONENT( FBSDK_DLL, HUDElement );
85
90{
91 //--- Open Reality declaration.
93
94protected:
101 FBHUDElement( const char* pName, HIObject pObject=NULL );
102
103public:
105 FBPropertyHUDElementHAlignment Justification;
106 FBPropertyHUDElementHAlignment HorizontalDock;
107 FBPropertyHUDElementVAlignment VerticalDock;
115
118 struct Rect
119 {
120 double mX;
121 double mY;
122 double mWidth;
123 double mHeight;
124 double mWidthScale;
126 };
127
133 virtual void GetIntrinsicDimension(FBViewingOptions* pViewingOptins, int& pWidth, int & pHeight);
134
139 virtual void DrawElement(FBViewingOptions* pViewingOption, Rect& pRect);
140
145 virtual bool FbxStore(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat) override;
146
151 virtual bool FbxRetrieve(FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat) override;
152};
153
158#define FBStorableCustomHUDElementImplementation(ClassName, Desc)\
159 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
160 HIObject RegisterStorable##ClassName##Create(HIObject /*pOwner*/, const char* pName, void* /*pData*/){\
161 ClassName* Class = new ClassName(pName);\
162 Class->mAllocated = true;\
163 if( Class->FBCreate() ){\
164 return Class->GetHIObject();\
165 } else {\
166 delete Class;\
167 return NULL;}}\
168 FBLibraryModule(ClassName##Storable){\
169 FBString lGroup = "FbxStorable/HUDElement";\
170 FBRegisterObject(ClassName##R2, lGroup, #ClassName, Desc, RegisterStorable##ClassName##Create, true, NULL);\
171 }\
172
173
175// FBPropertyListHUDElement
177FB_DEFINE_LIST( FBSDK_DLL, HUDElement );
179
182{
183public:
190};
191
193FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextElement );
194
195
200{
201 //--- Open Reality declaration.
203
204public:
210 FBHUDTextElement( const char* pName, HIObject pObject=NULL );
211
215
216public:
223};
224
225
227FB_DEFINE_COMPONENT( FBSDK_DLL, HUDRectElement );
228
233{
234 //--- Open Reality declaration.
236
237public:
242 FBHUDRectElement( const char* pName, HIObject pObject=NULL );
243
244public:
246};
247
248
250FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTextureElement );
251
256{
257 //--- Open Reality declaration.
259public:
265 FBHUDTextureElement( const char* pName, HIObject pObject=NULL );
266
267public:
268
270};
271
272
274FB_DEFINE_COMPONENT( FBSDK_DLL, HUDFlashElement );
275
280{
281 //--- Open Reality declaration.
283public:
289 FBHUDFlashElement( const char* pName, HIObject pObject=NULL );
290
291public:
292
294};
295
297FB_DEFINE_COMPONENT( FBSDK_DLL, HUDBloopSlateElement );
298
303{
305
306public:
312 FBHUDBloopSlateElement( const char* pName, HIObject pObject=NULL );
313
314public:
315
321};
322
324FB_DEFINE_COMPONENT( FBSDK_DLL, HUDTimelineElement );
325
331{
333
334public:
340 FBHUDTimelineElement( const char* pName, HIObject pObject=NULL );
341
342public:
343
347
350
354};
355
357// FBPropertyListHUD
360
363
366{
367public:
373 FBHUD* operator[](int pIndex);
374};
375
377// FBHUD
380
387class FBSDK_DLL FBHUD : public FBBox
388{
389 //--- Open Reality declaration.
391public:
397 FBHUD( const char* pName, HIObject pObject=NULL );
398
399 enum EStockElement {
400 eRecordLight,
401 eFlashElement,
402 eTextElement,
403 eRectElement,
404 eTextureElement,
405 eBloopSlate,
406 eTimeline
407 };
408
414 FBHUDElement* CreateElement( EStockElement pType, const char* pName );
415
421 FBHUDElement* CreateCustomElement( const char* pHUDElementClassName, const char* pName );
422
423public:
428};
429
430
431
432
440FB_DEFINE_COMPONENT( FBSDK_DLL, HUDManager );
442{
444
449 FBHUDManager(HIObject pObject = NULL);
450
451public:
452 FBPropertyHUD DefaultHUD;
453
458};
459
460#ifdef FBSDKUseNamespace
461}
462#endif
463
464#endif //K_NO_HUD
465
466#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.
FBX file interface.
Definition fbfbx.h:80
Heads Up display.
Definition fbhud.h:303
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Bloop slate background color, by default it is 100% transparent.
Definition fbhud.h:316
FBPropertyColorAndAlpha ForegroundColor
Read Write Property: Bloop slate foreground color.
Definition fbhud.h:317
FBPropertyTime ShowDuration
Read Write Property: Time that the bloop slate will be displayed.
Definition fbhud.h:320
FBPropertyBool Enable
Read Write Property: Bloop slate will appear if set to true.
Definition fbhud.h:318
FBPropertyTime ShowAfterDelayOnRecordPlay
Read Write Property: Delay before the bloop slate is displayed after recording has started.
Definition fbhud.h:319
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:105
FBPropertyHUDElementVAlignment VerticalDock
Read Write Property: Specifies if the HUD element will be vertically docked to the Bottom,...
Definition fbhud.h:107
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:109
FBPropertyDouble X
Read Write Property: Specifies the horizontal position of the HUD element, relative to dock position ...
Definition fbhud.h:108
FBPropertyDouble Width
Read Write Property: Specifies the width of HUD element on the screen. It's in pixel when ScaleByPerc...
Definition fbhud.h:112
FBPropertyBool Show
Read Write Property: Specifies if the HUD element will be displayed or not.
Definition fbhud.h:104
FBPropertyDouble Height
Read Write Property: Specifies the height of HUD element on the screen. It's in pixel when ScaleByPer...
Definition fbhud.h:113
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:106
FBPropertyBool ScaleByPercent
Read Write Property: When set to true, Scale is in percentage, relative to the corresponding camera v...
Definition fbhud.h:111
FBPropertyBool PositionByPercent
Read Write Property: When set to true, X and Y position values are in percentage, relative to the cor...
Definition fbhud.h:110
FBPropertyBool ScaleUniformly
Read Write Property: Specifies whether the width and height of HUD element will be scaled uniformly a...
Definition fbhud.h:114
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:280
FBPropertyString FilePath
Read Write Property: Path to load the swf file from
Definition fbhud.h:293
FBHUDFlashElement(const char *pName, HIObject pObject=NULL)
Constructor.
Heads Up display.
Definition fbhud.h:388
FBPropertyListHUD HUDs
List: HUDS attached to this HUD.
Definition fbhud.h:427
FBPropertyListHUDElement Elements
List: Elements present in the HUD.
Definition fbhud.h:426
FBHUDElement * CreateCustomElement(const char *pHUDElementClassName, const char *pName)
Creates a custom HUD Element.
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:424
FBHUD(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyEvent OnDisplay
Event: Callback just before HUD is displayed to update custom values
Definition fbhud.h:425
FBPropertyHUD DefaultHUD
Read Write Property: Specifies the HUD to be displayed on cameras that do not have HUD explicitly ass...
Definition fbhud.h:452
static FBHUDManager & TheOne()
Access to the singleton Heads Up Display(HUD) Manager.
Heads Up display.
Definition fbhud.h:233
FBHUDRectElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyColorAndAlpha Color
Read Write Property: Color of the rectangluar region.
Definition fbhud.h:245
Heads Up display.
Definition fbhud.h:200
FBPropertyColorAndAlpha BackgroundColor
Read Write Property: Background text color.
Definition fbhud.h:220
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:222
FBHUDTextElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyString Content
Read Write Property: C like format to display like in printf.
Definition fbhud.h:217
FBPropertyString Font
Read Write Property: Specifies the font.
Definition fbhud.h:218
FBStringList * GetFontList()
Returns a list of supported fonts.
FBPropertyColorAndAlpha Color
Read Write Property: Text color.
Definition fbhud.h:219
FBPropertyBool ForceTimeCodeDisplay
Read Write Property: Specifies if the display of time-related reference property will be in timecode ...
Definition fbhud.h:221
Heads Up display.
Definition fbhud.h:256
FBPropertyListTexture Texture
Read Write Property: Texture to display.
Definition fbhud.h:269
FBHUDTextureElement(const char *pName, HIObject pObject=NULL)
Constructor.
Heads Up display.
Definition fbhud.h:331
FBHUDTimelineElement(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyTime HeadDuration
Read Write Property: Specifies duration of the Head region.
Definition fbhud.h:346
FBPropertyColorAndAlpha HeadActiveColor
Read Write Property: Specifies color of the Head region when it is active.
Definition fbhud.h:344
FBPropertyColorAndAlpha HeadIdleColor
Read Write Property: Specifies color of the Head region when it is idle.
Definition fbhud.h:345
FBPropertyColorAndAlpha CutActiveColor
Read Write Property: Specifies color of the Cut region when it is active.
Definition fbhud.h:348
FBPropertyColorAndAlpha TailIdleColor
Read Write Property: Specifies color of the Tail region when it is idle.
Definition fbhud.h:352
FBPropertyTime TailDuration
Read Write Property: Specifies duration of the Tail region.
Definition fbhud.h:353
FBPropertyColorAndAlpha CutIdleColor
Read Write Property: Specifies color of the Cut region when it is idle.
Definition fbhud.h:349
FBPropertyColorAndAlpha TailActiveColor
Read Write Property: Specifies color of the Tail region when it is active.
Definition fbhud.h:351
PropertyEvent: Base event class.
PropertyList: Concrete class for PropertyList of component
PropertyList: Handle.
Definition fbhud.h:182
FBHUDElement * operator[](int pIndex)
Get the model template at pIndex.
PropertyList: Handle.
Definition fbhud.h:366
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.
#define __FBClassDeclare(Name, Parent)
For internal use only.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
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
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.
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_COMPONENT(DllTag, Type)
Define a component and give it the ability to be a property.
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
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
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition fbtypes.h:68
HUD element rectangle for drawing in the view.
Definition fbhud.h:119
double mWidth
Element display region width.
Definition fbhud.h:122
double mHeight
Element display region height.
Definition fbhud.h:123
double mHeightScale
Element display region height scale factor compared with intrinsic height value.
Definition fbhud.h:125
double mY
Element display region left bottom corner's Y coordinate.
Definition fbhud.h:121
double mWidthScale
Element display region width scale factor compared with intrinsic width value.
Definition fbhud.h:124
double mX
Element display region left bottom corner's X coordinate.
Definition fbhud.h:120