Alphabetical Class Index   File Members   Compound Members   File List  

CHoopsView.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 // CHoopsView.h : interface of the CHoopsView class, derived from CView
00011 // Adds encapsulation of a HOOPS View Object, which corresponds to an
00012 // instance of a HOOPS driver
00013 //
00014 // Also provides high-level support for copying the view to the clipboard, 
00015 // printing and printpreview
00016 
00017 #ifndef _C_HOOPS_VIEW_
00018 #define _C_HOOPS_VIEW_
00019 
00020 
00021 #include "HBaseView.h"
00022 #include "HMFCGlobals.h"
00023 
00024 class CHoopsDoc;
00025 class GDIExportInformation;
00026 
00027 // msw driver specific driver_option debug flags
00028 
00036 #define DEBUG_FORCE_FULL_COLOR              0x00000010
00037 
00042 #define DEBUG_NO_WINDOWS_HOOK               0x00000040 
00043 
00049 #define DEBUG_SFB_COPY_TO_CLIPBOARD         0x00004000
00050 
00056 #define DEBUG_STARTUP_CLEAR_BLACK           0x00004000
00057 
00062 #define DEBUG_NO_RASTERS_IN_PRINTING        0x00020000
00063 
00068 #define DEBUG_PRINTING_MODE                 0x00040000
00069 
00074 #define DEBUG_CLIPBOARD_MODE                0x00080000
00075 
00076 
00082 #define DEBUG_PRINT_NOT_FRAMEBUFFER_MODE    0x00020000
00083 
00084 
00089 #define DEBUG_PRINT_NOT_RASTER_REDUCTION    0x00200000
00090 
00095 #define DEBUG_FORCE_SOFTWARE                0x01000000
00096 
00102 #define DEBUG_NO_PAINTERS_PANELLING         0x00000008
00103 
00108 #define DEBUG_16BIT_ZBUFFER                 0x00200000
00109 
00110 
00114 #define WMF             0
00115 
00119 #define EMF             1
00120 
00121 
00122 class DIDeviceInfo;
00123 class DIDevice;
00124 
00126 
00135 class HMFC_API CHoopsView : public CView
00136 {
00137 
00138 protected: // create from serialization only
00139     CHoopsView();
00140 
00141     DECLARE_DYNCREATE(CHoopsView);   
00142 
00143 
00144     CPalette *      m_pViewPalette;     
00150     bool            m_bFastPrint;   
00151 
00155     bool            m_bUsingDI8Joystick;
00156     DIDeviceInfo *  di8_data;
00157 
00162     bool            m_bMetaPrint;      
00163     
00165     bool            m_bClipboardTruecolor;
00166 
00168     int             m_MetafileType;
00169 
00171     HBaseView *     m_pHView;       
00172 
00177     HC_KEY          m_ViewKey;  
00178     
00184     HC_KEY          m_SceneKey; 
00185 
00187     unsigned long MapFlags( unsigned long state );  
00188     
00190     unsigned long MapKeyFlags( BYTE * virtual_key_state );                      
00191 
00192 public:
00193 
00194 
00195     HRESULT UpdateDI8State( unsigned long devIndex );
00196     HRESULT CHoopsView::InitDI8( void );
00197 
00198     DIDevice *      dev_handle;
00199     DIDeviceInfo *  g_pDevice;
00200     int             g_nDevices;
00201 
00205     CHoopsDoc * GetDocument();
00206 
00208     HBaseView * GetHoopsView( void ) { return m_pHView; }
00209 
00214     CPalette *  GetPalette();
00215 
00216 
00221     void        InitializePalette();
00222 
00223     // printing and metafile methods
00224 
00229     bool                GetFastPrint (void) {return m_bFastPrint;}
00230 
00232     void                SetFastPrint (bool fastprint) {m_bFastPrint = fastprint;}
00233 
00238     bool                GetMetaPrint (void) {return m_bMetaPrint;}
00239 
00243     void                SetMetaPrint (bool metaprint) {m_bMetaPrint = metaprint;}
00244 
00246     int                 GetMetafileType (void) { return m_MetafileType; }
00247 
00249     void                SetMetafileType (int emf_or_wmf) { m_MetafileType = emf_or_wmf; }
00250 
00252     bool                GetFirstUpdate(){return m_pHView->GetFirstUpdate();}
00253 
00255     void                SetFirstUpdate(bool firstupdate){ UNREFERENCED(firstupdate); }
00256 
00258     bool                GetClipboardTruecolor (void) { return m_bClipboardTruecolor; }
00259 
00261     void                SetClipboardTruecolor (bool truecolor) { m_bClipboardTruecolor = truecolor; }
00262 
00263 
00264     void        SaveEMF(const char *filename, HOutputHandlerOptions * options = 0);  
00265 
00266 
00268     HC_KEY      GetViewKey();
00269 
00272     HC_KEY      GetSceneKey();
00273 
00275     void        AdjustAxisWindow();
00276 
00277 // Overrides
00278     // ClassWizard generated virtual function overrides
00279     //{{AFX_VIRTUAL(CHoopsView)
00280     public:
00281     virtual void OnDraw(CDC* pDC);  
00282 
00284     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00285 
00290     virtual void OnInitialUpdate();
00291 
00293 #ifdef _UNICODE
00294     virtual BOOL Create(__wchar_t const * lpszClassName, __wchar_t const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00295     virtual BOOL Create(unsigned short const * lpszClassName, unsigned short const *  lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00296 #else
00297     virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
00298 #endif
00299     protected:
00300 
00302     virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
00303 
00305     virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
00306 
00308     virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
00309 
00319     virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
00320 
00321 
00322 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00323 
00324     virtual void OnNcDestroy();
00325 
00326     virtual void PostNcDestroy();
00327 
00328 #endif // DOXYGEN_SHOULD_SKIP_THIS
00329 
00330 
00331     //}}AFX_VIRTUAL
00332 
00333 // Implementation
00334 public:
00335     virtual ~CHoopsView();
00336 #ifdef _DEBUG
00337     virtual void AssertValid() const;
00338     virtual void Dump(CDumpContext& dc) const;
00339 #endif
00340 
00341 protected:
00342         
00347     virtual void OnDisplayChanged(int xres, int yres, int depth);
00349     void GetIntRectangle( HIntRectangle *rectangle );
00350 
00352     void EditCopy(GDIExportInformation * pInfo);
00353 
00354 
00355 // Generated message map functions
00356 protected:
00357     //{{AFX_MSG(CHoopsView)
00358 
00360     afx_msg virtual void OnPaint();
00361 
00362     afx_msg virtual void OnSize(UINT, int, int);
00363 
00368     afx_msg virtual void OnEditCopy();
00369 
00374     afx_msg virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00375 
00380     afx_msg virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
00381 
00386     afx_msg virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
00387 
00392     afx_msg virtual void OnLButtonDown(UINT nFlags, CPoint point);
00393 
00398     afx_msg virtual void OnLButtonUp(UINT nFlags, CPoint point);
00399 
00404     afx_msg virtual void OnMouseMove(UINT nFlags, CPoint point);
00405 
00410     afx_msg virtual void OnRButtonDblClk(UINT nFlags, CPoint point);
00411 
00416     afx_msg virtual void OnRButtonDown(UINT nFlags, CPoint point);
00417 
00422     afx_msg virtual void OnMButtonUp(UINT nFlags, CPoint point);
00423 
00428     afx_msg virtual void OnMButtonDown(UINT nFlags, CPoint point);
00429 
00434     afx_msg virtual void OnRButtonUp(UINT nFlags, CPoint point);
00435 
00440     afx_msg virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
00441 
00446 #if (_MSC_VER < 1400)
00447     afx_msg virtual void OnTimer(UINT nIDEvent);
00448 #else
00449     afx_msg virtual void OnTimer(UINT_PTR nIDEvent);
00450 #endif
00451 
00452 
00459     static bool GetKeyState(unsigned int key, int &flags);
00460 
00461  
00466     afx_msg virtual BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt );
00467 
00471     afx_msg virtual LRESULT OnAFXDisplayChange( WPARAM wparam, LPARAM lparam);
00472 
00473     
00478     afx_msg virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
00479 
00480 
00481     //}}AFX_MSG
00482     DECLARE_MESSAGE_MAP()
00483 };
00484 
00485 #ifndef _DEBUG  
00486 inline CHoopsDoc* CHoopsView::GetDocument()
00487    { return (CHoopsDoc*)m_pDocument; }
00488 #endif
00489 
00490 #endif
00491