Alphabetical Class Index   File Members   Compound Members   File List  

CHoopsView.h

00001 //
00002 // Copyright (c) 2000 by Tech Soft 3D, LLC.
00003 // The information contained herein is confidential and proprietary to
00004 // Tech Soft 3D, LLC., and considered a trade secret as defined under
00005 // civil and criminal statutes.  Tech Soft 3D shall pursue its civil
00006 // and criminal remedies in the event of unauthorized use or misappropriation
00007 // of its trade secrets.  Use of this information by anyone other than
00008 // authorized employees of Tech Soft 3D, LLC. is granted only under a
00009 // written non-disclosure agreement, expressly prescribing the scope and
00010 // manner of such use.
00011 //
00012 // $Id: _c_hoops_view_8h_source.html,v 1.4.2.3 2012-02-08 08:13:37 stage Exp $
00013 //
00014 
00015 // CHoopsView.h : interface of the CHoopsView class, derived from CView
00016 // Adds encapsulation of a HOOPS View Object, which corresponds to an
00017 // instance of a HOOPS driver
00018 //
00019 // Also provides high-level support for copying the view to the clipboard, 
00020 // printing and printpreview
00021 
00022 #ifndef _C_HOOPS_VIEW_
00023 #define _C_HOOPS_VIEW_
00024 
00025 
00026 #include "HBaseView.h"
00027 #include "HMFCGlobals.h"
00028 
00029 class CHoopsDoc;
00030 class GDIExportInformation;
00031 
00032 // msw driver specific driver_option debug flags
00033 
00041 #define DEBUG_FORCE_FULL_COLOR              0x00000010
00042 
00047 #define DEBUG_NO_WINDOWS_HOOK               0x00000040 
00048 
00054 #define DEBUG_SFB_COPY_TO_CLIPBOARD         0x00004000
00055 
00061 #define DEBUG_STARTUP_CLEAR_BLACK           0x00004000
00062 
00067 #define DEBUG_NO_RASTERS_IN_PRINTING        0x00020000
00068 
00073 #define DEBUG_PRINTING_MODE                 0x00040000
00074 
00079 #define DEBUG_CLIPBOARD_MODE                0x00080000
00080 
00081 
00087 #define DEBUG_PRINT_NOT_FRAMEBUFFER_MODE    0x00020000
00088 
00089 
00094 #define DEBUG_PRINT_NOT_RASTER_REDUCTION    0x00200000
00095 
00100 #define DEBUG_FORCE_SOFTWARE                0x01000000
00101 
00107 #define DEBUG_NO_PAINTERS_PANELLING 0x00000008
00108 
00113 #define DEBUG_16BIT_ZBUFFER                 0x00200000
00114 
00115 
00119 #define WMF             0
00120 
00124 #define EMF             1
00125 
00126 
00127 class DIDeviceInfo;
00128 class DIDevice;
00129 
00131 
00140 class HMFC_API CHoopsView : public CView
00141 {
00142 
00143 protected: // create from serialization only
00144     CHoopsView();
00145 
00146     DECLARE_DYNCREATE(CHoopsView);   
00147 
00148 
00149     CPalette        *m_pViewPalette;    
00155     bool            m_bFastPrint;   
00156 
00160     bool            m_bUsingDI8Joystick;
00161     DIDeviceInfo        *di8_data;
00162 
00167     bool            m_bMetaPrint;      
00168     
00170     bool            m_bClipboardTruecolor;
00171 
00173     int             m_MetafileType;
00174 
00176     HBaseView*      m_pHView;       
00177 
00182     HC_KEY          m_ViewKey;  
00183     
00189     HC_KEY          m_SceneKey; 
00190 
00192     unsigned long MapFlags( unsigned long state );  
00193     
00195     unsigned long MapKeyFlags( BYTE * virtual_key_state );                      
00196 
00197 public:
00198 
00199 
00200     HRESULT UpdateDI8State( unsigned long devIndex );
00201     HRESULT CHoopsView::InitDI8( void );
00202 
00203     DIDevice       *dev_handle;
00204     DIDeviceInfo   *g_pDevice;
00205     int             g_nDevices;
00206 
00210     CHoopsDoc* GetDocument();
00211 
00213     HBaseView* GetHoopsView( void ) { return m_pHView; }
00214 
00219     CPalette*   GetPalette();
00220 
00221 
00226     void        InitializePalette();
00227 
00228     // printing and metafile methods
00229 
00234     bool                GetFastPrint (void) {return m_bFastPrint;};
00235 
00237     void                SetFastPrint (bool fastprint) {m_bFastPrint = fastprint;};
00238 
00243     bool                GetMetaPrint (void) {return m_bMetaPrint;};
00244 
00248     void                SetMetaPrint (bool metaprint) {m_bMetaPrint = metaprint;};
00249 
00251     int                 GetMetafileType (void) { return m_MetafileType; };
00252 
00254     void                SetMetafileType (int emf_or_wmf) { m_MetafileType = emf_or_wmf; };
00255 
00257     bool                GetFirstUpdate(){return m_pHView->GetFirstUpdate();};
00258 
00260     void                SetFirstUpdate(bool firstupdate){/* do nothing - quit lying*/ ;};
00261 
00263     bool                GetClipboardTruecolor (void) { return m_bClipboardTruecolor; };
00264 
00266     void                SetClipboardTruecolor (bool truecolor) { m_bClipboardTruecolor = truecolor; };
00267 
00268 
00269     void        SaveEMF(const char *filename, HOutputHandlerOptions * options = 0);  
00270 
00271 
00273     HC_KEY      GetViewKey();
00274 
00277     HC_KEY      GetSceneKey();
00278 
00280     void        AdjustAxisWindow();
00281 
00282 // Overrides
00283     // ClassWizard generated virtual function overrides
00284     //{{AFX_VIRTUAL(CHoopsView)
00285     public:
00286     virtual void OnDraw(CDC* pDC);  
00287 
00289     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00290 
00295     virtual void OnInitialUpdate();
00296 
00298 #ifdef _UNICODE
00299     virtual BOOL Create(__wchar_t const * lpszClassName, __wchar_t const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00300     virtual BOOL Create(unsigned short const * lpszClassName, unsigned short const *  lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00301 #else
00302     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00303 #endif
00304     protected:
00305 
00307     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00308 
00310     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00311 
00313     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00314 
00324     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00325 
00326 
00327 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00328 
00329     virtual void OnNcDestroy();
00330 
00331     virtual void PostNcDestroy();
00332 
00333 #endif // DOXYGEN_SHOULD_SKIP_THIS
00334 
00335 
00336     //}}AFX_VIRTUAL
00337 
00338 // Implementation
00339 public:
00340     virtual ~CHoopsView();
00341 #ifdef _DEBUG
00342     virtual void AssertValid() const;
00343     virtual void Dump(CDumpContext& dc) const;
00344 #endif
00345 
00346 protected:
00347         
00352     virtual void OnDisplayChanged(int xres, int yres, int depth);
00354     void GetIntRectangle( HIntRectangle *rectangle );
00355 
00357     void EditCopy(GDIExportInformation * pInfo);
00358 
00359 
00360 // Generated message map functions
00361 protected:
00362     //{{AFX_MSG(CHoopsView)
00363 
00365     afx_msg virtual void OnPaint();
00366 
00367     afx_msg virtual void OnSize(UINT, int, int);
00368 
00373     afx_msg virtual void OnEditCopy();
00374 
00379     afx_msg virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00380 
00385     afx_msg virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00386 
00391     afx_msg virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
00392 
00397     afx_msg virtual void OnLButtonDown(UINT nFlags, CPoint point);
00398 
00403     afx_msg virtual void OnLButtonUp(UINT nFlags, CPoint point);
00404 
00409     afx_msg virtual void OnMouseMove(UINT nFlags, CPoint point);
00410 
00415     afx_msg virtual void OnRButtonDblClk(UINT nFlags, CPoint point);
00416 
00421     afx_msg virtual void OnRButtonDown(UINT nFlags, CPoint point);
00422 
00427     afx_msg virtual void OnMButtonUp(UINT nFlags, CPoint point);
00428 
00433     afx_msg virtual void OnMButtonDown(UINT nFlags, CPoint point);
00434 
00439     afx_msg virtual void OnRButtonUp(UINT nFlags, CPoint point);
00440 
00445     afx_msg virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00446 
00451 #if (_MSC_VER < 1400)
00452     afx_msg virtual void OnTimer(UINT nIDEvent);
00453 #else
00454     afx_msg virtual void OnTimer(UINT_PTR nIDEvent);
00455 #endif
00456 
00457 
00464     static bool GetKeyState(unsigned int key, int &flags);
00465 
00466  
00471     afx_msg virtual BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt );
00472 
00476     afx_msg virtual LRESULT OnAFXDisplayChange( WPARAM wparam, LPARAM lparam);
00477 
00478     
00483     afx_msg virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
00484 
00485 
00486     //}}AFX_MSG
00487     DECLARE_MESSAGE_MAP()
00488 };
00489 
00490 #ifndef _DEBUG  
00491 inline CHoopsDoc* CHoopsView::GetDocument()
00492    { return (CHoopsDoc*)m_pDocument; }
00493 #endif
00494 
00495 #endif
00496