fbrenderer.h

Go to the documentation of this file.
00001 #ifndef __FBRENDERER_H__
fbrenderer.h
00002 #define __FBRENDERER_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL 
00045 
00048     #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050 
00051 #if !defined(K_NO_MANIPULATOR)
00052     #include <fbsdk/fbmanipulator.h>
00053 #endif
00054 
00055 #include <fbsdk/fbcomponent.h>
00056 #include <fbsdk/fbmodel.h>
00057 #include <fbcontrols/fbcontrols.h>  // FBInputType
00058 
00059 #ifdef FBSDKUseNamespace
00060     namespace FBSDKNamespace {
00061 #endif
00062 
00063 __FB_FORWARD( FBRenderer );
00064 FB_FORWARD( FBView );
00065 
00066 FB_DEFINE_COMPONENT( FBSDK_DLL, Renderer );
00067 
00068 FB_FORWARD( FBViewingOptions );
00069 
00071 enum FBDisplayMode {
00072     kFBDisplayModeDefault = 0,  
00073     kFBDisplayModeTexture,      
00074     kFBDisplayModeHardShade,    
00075     kFBDisplayModeFlatShade,    
00076     kFBDisplayModeWireFrame,    
00077     kFBDisplayModeCount         
00078 };
00079 
00081 
00084 enum FBDisplayWhat {
00085     kFBDisplayNone      = 0,            
00086     kFBDisplayNull      = (1 << 0),     
00087     kFBDisplayMarker    = (1 << 1),     
00088     kFBDisplaySkeleton  = (1 << 2),     
00089     kFBDisplayCenter    = (1 << 3),     
00090     kFBDisplayLight     = (1 << 4),     
00091     kFBDisplayCamera    = (1 << 5),     
00092     kFBDisplay3dIcon    = (1 << 6),     
00093     kFBDisplayAll       = 0xff          
00094 };
00095 
00097 
00098 enum FBPickingMode {
00099     kFBPickingModeStandard = 0,     
00100     kFBPickingModeXRay,             
00101     kFBPickingModeModelsOnly,       
00102     kFBPickingModeCount             
00103 };
00104 
00106 
00107 enum FBZSortMode {
00108     kFBZSortNone,                           
00109     kFBZSortFirstLayer,                     
00110     kFBZSortFirstLayerFastBufferRegion,     
00111     kFBZSortConvexGeometry,                 
00112     kFBZSortConvexGeometryFastBufferRegion, 
00113     kFBZSortFrontToBack,                    
00114     kFBZSortBackToFront,                    
00115     kFBZSortCount                           
00116 };
00117 
00119 
00120 enum FBDeviceKeyboardKey {
00121     kFBDKeyPageUp,          
00122     kFBDKeyPageDown,        
00123     kFBDKeyEnd,             
00124     kFBDKeyHome,            
00125     kFBDKeyArrowLeft,       
00126     kFBDKeyArrowUp,         
00127     kFBDKeyArrowRight,      
00128     kFBDKeyArrowDown,       
00129     kFBDKeyReturn,          
00130     kFBDKeyEscape,          
00131     kFBDKeySpace,           
00132     kFBDKey1,               
00133     kFBDKey2,               
00134     kFBDKey3,               
00135     kFBDKey4,               
00136     kFBDKey5,               
00137     kFBDKey6,               
00138     kFBDKey7,               
00139     kFBDKey8,               
00140     kFBDKey9,               
00141     kFBDKey0,               
00142     kFBDKeyF1,              
00143     kFBDKeyF2,              
00144     kFBDKeyF3,              
00145     kFBDKeyF4,              
00146     kFBDKeyF5,              
00147     kFBDKeyF6,              
00148     kFBDKeyF7,              
00149     kFBDKeyF8,              
00150     kFBDKeyF9,              
00151     kFBDKeyF10,             
00152     kFBDKeyF11,             
00153     kFBDKeyF12              
00154 };
00155 
00156 FB_DEFINE_ENUM( FBSDK_DLL, DeviceKeyboardKey );
00157 
00161 class FBSDK_DLL FBViewingOptions
00162 {
00163   public:
00167     FBModelShadingMode& ShadingMode();
00168 
00172     int& DisplayWhat();
00173 
00177     int& PickingMode();
00178 
00181     bool& ShowTimeCode();
00182 
00185     bool& ShowSafeArea();
00186 
00189     bool& ShowCameraLabel();
00190 
00191   private:
00192     FBViewingOptions();
00193     FBViewingOptions(const FBViewingOptions &);
00194     FBViewingOptions & operator =(const FBViewingOptions &);
00195 };
00196 
00197 FB_DEFINE_ENUM( FBSDK_DLL, ZSortMode );
00198 
00199 
00200 
00201 
00202 
00204 // FBPickInfos
00206 
00233 
00234 struct FBPickInfos {
00239     FBPickInfos( HFBModel pModel, FBVector3d pPoint ) : mModel( pModel ), mPoint( pPoint ) {};
00240     HFBModel   mModel;  
00241     FBVector3d mPoint;  
00242 };
00243 
00244 bool operator==( const FBPickInfos& pLhs, const FBPickInfos& pRhs );
00245 
00247 typedef class FBSDK_DLL FBArrayTemplate<FBPickInfos> FBPickInfosList;
00248 
00250 // FBViewerInfos
00252 __FB_FORWARD( FBViewerInfos ); 
00253 FB_DEFINE_COMPONENT( FBSDK_DLL, ViewerInfos );
00254 
00272 class FBSDK_DLL FBViewerInfos : public FBComponent 
00273 {
00274     //--- Open Reality declaration.
00275     __FBClassDeclare( FBViewerInfos, FBComponent );
00276 
00281     FBViewerInfos( const FBViewerInfos& );
00282 
00287     FBViewerInfos& operator=( const FBViewerInfos& );
00288 
00289 public:
00290 
00292     FBViewerInfos( HIObject pObject );
00293 
00294     FBPropertyBool Visibility;  
00295 };
00296 
00297 
00299 // FBRenderer
00301 
00303 class FBSDK_DLL FBRenderer : public FBComponent 
00304 {
00305     //--- Open Reality declaration.
00306     __FBClassDeclare( FBRenderer,FBComponent );
00307   public:
00313     FBRenderer(HIObject pObject);
00314 
00315     //--- Rendering manipulation
00323     void SetViewport(int pX,int pY,int pW,int pH);
00324 
00334     bool RenderBegin(int pX,int pY,int pW,int pH);
00335 
00341     bool RenderEnd(HFBView pView=NULL);
00342 
00355     bool PreRender(int pLayer = -1);
00356 
00361     bool Render(int pLayer = -1);
00362 
00366     bool SetViewingOptions(FBViewingOptions & pOptions);
00367 
00371     FBViewingOptions * GetViewingOptions();
00372 
00377     bool FrameCurrentCameraWithModels(bool pAll);
00378 
00379     //--- Camera manipulation, Manipulators
00389     bool MouseInput(int pX,int pY,FBInputType pInputType,int pButtonKey,FBInputModifier pModifier,int pLayer = -1);
00390 
00398     bool Pick(int pX, int pY, FBPickInfosList& pPickInfosList, bool pNeedIntersectPoistion = false );
00399 
00405     void KeyboardInput(FBDeviceKeyboardKey pKeyIndex, bool pKeyState, bool pIsTrigger = false);
00406 
00407     // Properties
00408     FBPropertyCamera                CurrentCamera;          
00409     FBPropertyBool                  UseCameraSwitcher;      
00410 
00411 #if !defined(K_NO_MANIPULATOR)
00412     FBPropertyManipulatorTransform  ManipulatorTransform;   
00413     FBPropertyListManipulator       Manipulators;           
00414 #endif
00415 
00416     FBPropertyScene                 Scene;                  
00417     FBPropertyBool                  AutoEvaluate;           
00418     FBPropertyBool                  Background;             
00419     FBPropertyZSortMode             ZSortMode;              
00420     FBPropertyInt                   LayerCount;             
00421     FBPropertyColor                 ClearColor;             
00422     FBPropertyViewerInfos           ViewerInfos;            
00423 };
00424 
00425 #ifdef FBSDKUseNamespace
00426     }
00427 #endif
00428 #endif /* this must be the last line of this file */

Please send us your comments about this page.