Alphabetical Class Index   File Members   Compound Members   File List  

CHoopsView.h
1 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 // CHoopsView.h : interface of the CHoopsView class, derived from CView
11 // Adds encapsulation of a HOOPS View Object, which corresponds to an
12 // instance of a HOOPS driver
13 //
14 // Also provides high-level support for copying the view to the clipboard,
15 // printing and printpreview
16 
17 #ifndef _C_HOOPS_VIEW_
18 #define _C_HOOPS_VIEW_
19 
20 
21 #include "HBaseView.h"
22 #include "HMFCGlobals.h"
23 
24 class CHoopsDoc;
26 
27 // msw driver specific driver_option debug flags
28 
36 #define DEBUG_FORCE_FULL_COLOR 0x00000010
37 
42 #define DEBUG_NO_WINDOWS_HOOK 0x00000040
43 
49 #define DEBUG_SFB_COPY_TO_CLIPBOARD 0x00004000
50 
56 #define DEBUG_STARTUP_CLEAR_BLACK 0x00004000
57 
62 #define DEBUG_NO_RASTERS_IN_PRINTING 0x00020000
63 
68 #define DEBUG_PRINTING_MODE 0x00040000
69 
74 #define DEBUG_CLIPBOARD_MODE 0x00080000
75 
76 
82 #define DEBUG_PRINT_NOT_FRAMEBUFFER_MODE 0x00020000
83 
84 
89 #define DEBUG_PRINT_NOT_RASTER_REDUCTION 0x00200000
90 
95 #define DEBUG_FORCE_SOFTWARE 0x01000000
96 
102 #define DEBUG_NO_PAINTERS_PANELLING 0x00000008
103 
108 #define DEBUG_16BIT_ZBUFFER 0x00200000
109 
110 
114 #define WMF 0
115 
119 #define EMF 1
120 
121 
122 class DIDeviceInfo;
123 class DIDevice;
124 
126 
135 class HMFC_API CHoopsView : public CView
136 {
137 
138 protected: // create from serialization only
139  CHoopsView();
140 
141  DECLARE_DYNCREATE(CHoopsView);
142 
143 
144  CPalette * m_pViewPalette;
151 
156  DIDeviceInfo * di8_data;
157 
163 
166 
169 
172 
178 
185 
187  unsigned long MapFlags( unsigned long state );
188 
190  unsigned long MapKeyFlags( BYTE * virtual_key_state );
191 
192 public:
193 
194 
195  HRESULT UpdateDI8State( unsigned long devIndex );
196  HRESULT CHoopsView::InitDI8( void );
197 
198  DIDevice * dev_handle;
199  DIDeviceInfo * g_pDevice;
200  int g_nDevices;
201 
205  CHoopsDoc * GetDocument();
206 
208  HBaseView * GetHoopsView( void ) { return m_pHView; }
209 
214  CPalette * GetPalette();
215 
216 
221  void InitializePalette();
222 
223  // printing and metafile methods
224 
229  bool GetFastPrint (void) {return m_bFastPrint;}
230 
232  void SetFastPrint (bool fastprint) {m_bFastPrint = fastprint;}
233 
238  bool GetMetaPrint (void) {return m_bMetaPrint;}
239 
243  void SetMetaPrint (bool metaprint) {m_bMetaPrint = metaprint;}
244 
246  int GetMetafileType (void) { return m_MetafileType; }
247 
249  void SetMetafileType (int emf_or_wmf) { m_MetafileType = emf_or_wmf; }
250 
252  bool GetFirstUpdate(){return m_pHView->GetFirstUpdate();}
253 
255  void SetFirstUpdate(bool firstupdate){ UNREFERENCED(firstupdate); }
256 
258  bool GetClipboardTruecolor (void) { return m_bClipboardTruecolor; }
259 
261  void SetClipboardTruecolor (bool truecolor) { m_bClipboardTruecolor = truecolor; }
262 
263 
264  void SaveEMF(const char *filename, HOutputHandlerOptions * options = 0);
265 
266 
268  HC_KEY GetViewKey();
269 
272  HC_KEY GetSceneKey();
273 
275  void AdjustAxisWindow();
276 
277 // Overrides
278  // ClassWizard generated virtual function overrides
279  //{{AFX_VIRTUAL(CHoopsView)
280  public:
281  virtual void OnDraw(CDC* pDC);
282 
284  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
285 
290  virtual void OnInitialUpdate();
291 
293 #ifdef _UNICODE
294  virtual BOOL Create(__wchar_t const * lpszClassName, __wchar_t const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
295  virtual BOOL Create(unsigned short const * lpszClassName, unsigned short const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
296 #else
297  virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
298 #endif
299  protected:
300 
302  virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
303 
305  virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
306 
308  virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
309 
319  virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
320 
321 
322 #ifndef DOXYGEN_SHOULD_SKIP_THIS
323 
324  virtual void OnNcDestroy();
325 
326  virtual void PostNcDestroy();
327 
328 #endif // DOXYGEN_SHOULD_SKIP_THIS
329 
330 
331  //}}AFX_VIRTUAL
332 
333 // Implementation
334 public:
335  virtual ~CHoopsView();
336 #ifdef _DEBUG
337  virtual void AssertValid() const;
338  virtual void Dump(CDumpContext& dc) const;
339 #endif
340 
341 protected:
342 
347  virtual void OnDisplayChanged(int xres, int yres, int depth);
349  void GetIntRectangle( HIntRectangle *rectangle );
350 
352  void EditCopy(GDIExportInformation * pInfo);
353 
354 
355 // Generated message map functions
356 protected:
357  //{{AFX_MSG(CHoopsView)
358 
360  afx_msg virtual void OnPaint();
361 
362  afx_msg virtual void OnSize(UINT, int, int);
363 
368  afx_msg virtual void OnEditCopy();
369 
374  afx_msg virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
375 
380  afx_msg virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
381 
386  afx_msg virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
387 
392  afx_msg virtual void OnLButtonDown(UINT nFlags, CPoint point);
393 
398  afx_msg virtual void OnLButtonUp(UINT nFlags, CPoint point);
399 
404  afx_msg virtual void OnMouseMove(UINT nFlags, CPoint point);
405 
410  afx_msg virtual void OnRButtonDblClk(UINT nFlags, CPoint point);
411 
416  afx_msg virtual void OnRButtonDown(UINT nFlags, CPoint point);
417 
422  afx_msg virtual void OnMButtonUp(UINT nFlags, CPoint point);
423 
428  afx_msg virtual void OnMButtonDown(UINT nFlags, CPoint point);
429 
434  afx_msg virtual void OnRButtonUp(UINT nFlags, CPoint point);
435 
440  afx_msg virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
441 
446 #if (_MSC_VER < 1400)
447  afx_msg virtual void OnTimer(UINT nIDEvent);
448 #else
449  afx_msg virtual void OnTimer(UINT_PTR nIDEvent);
450 #endif
451 
452 
459  static bool GetKeyState(unsigned int key, int &flags);
460 
461 
466  afx_msg virtual BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt );
467 
471  afx_msg virtual LRESULT OnAFXDisplayChange( WPARAM wparam, LPARAM lparam);
472 
473 
478  afx_msg virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
479 
480 
481  //}}AFX_MSG
482  DECLARE_MESSAGE_MAP()
483 };
484 
485 #ifndef _DEBUG
487  { return (CHoopsDoc*)m_pDocument; }
488 #endif
489 
490 #endif
491 
bool GetFastPrint(void)
Definition: CHoopsView.h:229
The CHoopsDoc class provides a HOOPS-specific implementation of the CDocument object.
Definition: CHoopsDoc.h:27
HC_KEY m_ViewKey
Definition: CHoopsView.h:177
bool m_bFastPrint
Definition: CHoopsView.h:150
void SetMetaPrint(bool metaprint)
Definition: CHoopsView.h:243
int m_MetafileType
Definition: CHoopsView.h:168
#define HC_KEY
bool GetClipboardTruecolor(void)
Definition: CHoopsView.h:258
CHoopsDoc * GetDocument()
Definition: CHoopsView.h:486
HBaseView * GetHoopsView(void)
Definition: CHoopsView.h:208
Definition: HIOUtilityGDIOutput.h:88
void SetClipboardTruecolor(bool truecolor)
Definition: CHoopsView.h:261
void SetFastPrint(bool fastprint)
Definition: CHoopsView.h:232
bool GetMetaPrint(void)
Definition: CHoopsView.h:238
void SetMetafileType(int emf_or_wmf)
Definition: CHoopsView.h:249
CPalette * m_pViewPalette
Definition: CHoopsView.h:144
bool m_bMetaPrint
Definition: CHoopsView.h:162
int GetMetafileType(void)
Definition: CHoopsView.h:246
HC_KEY m_SceneKey
Definition: CHoopsView.h:184
bool m_bUsingDI8Joystick
Definition: CHoopsView.h:155
HBaseView * m_pHView
Definition: CHoopsView.h:171
void SetFirstUpdate(bool firstupdate)
Definition: CHoopsView.h:255
The CHoopsView class provides a HOOPS-specific implementation of the CView object.
Definition: CHoopsView.h:135
bool m_bClipboardTruecolor
Definition: CHoopsView.h:165
bool GetFirstUpdate()
Definition: CHoopsView.h:252