The CHoopsView class provides a HOOPS-specific implementation of the CView object. More...
#include <CHoopsView.h>
Public Member Functions | |
HRESULT | UpdateDI8State (unsigned long devIndex) |
HRESULT | InitDI8 (void) |
CHoopsDoc * | GetDocument () |
HBaseView * | GetHoopsView (void) |
CPalette * | GetPalette () |
void | InitializePalette () |
bool | GetFastPrint (void) |
void | SetFastPrint (bool fastprint) |
bool | GetMetaPrint (void) |
void | SetMetaPrint (bool metaprint) |
int | GetMetafileType (void) |
void | SetMetafileType (int emf_or_wmf) |
bool | GetFirstUpdate () |
void | SetFirstUpdate (bool firstupdate) |
bool | GetClipboardTruecolor (void) |
void | SetClipboardTruecolor (bool truecolor) |
void | SaveEMF (const char *filename, HOutputHandlerOptions *options=0) |
saves scene to enhanced metafile | |
HC_KEY | GetViewKey () |
HC_KEY | GetSceneKey () |
void | AdjustAxisWindow () |
virtual void | OnDraw (CDC *pDC) |
overridden but currently does nothing | |
virtual BOOL | PreCreateWindow (CREATESTRUCT &cs) |
virtual void | OnInitialUpdate () |
virtual BOOL | Create (LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID, CCreateContext *pContext=NULL) |
Public Attributes | |
DIDevice * | dev_handle |
DIDeviceInfo * | g_pDevice |
int | g_nDevices |
Protected Member Functions | |
DECLARE_DYNCREATE (CHoopsView) | |
implements runtime object creation | |
unsigned long | MapFlags (unsigned long state) |
unsigned long | MapKeyFlags (BYTE *virtual_key_state) |
virtual BOOL | OnPreparePrinting (CPrintInfo *pInfo) |
overloaded but currently does nothing | |
virtual void | OnBeginPrinting (CDC *pDC, CPrintInfo *pInfo) |
overloaded but currently does nothing | |
virtual void | OnEndPrinting (CDC *pDC, CPrintInfo *pInfo) |
overloaded but currently does nothing | |
virtual void | OnPrint (CDC *pDC, CPrintInfo *pInfo) |
virtual void | OnDisplayChanged (int xres, int yres, int depth) |
void | GetIntRectangle (HIntRectangle *rectangle) |
void | EditCopy (GDIExportInformation *pInfo) |
virtual afx_msg void | OnPaint () |
virtual afx_msg void | OnSize (UINT, int, int) |
virtual afx_msg void | OnEditCopy () |
virtual afx_msg void | OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags) |
virtual afx_msg void | OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags) |
virtual afx_msg void | OnLButtonDblClk (UINT nFlags, CPoint point) |
virtual afx_msg void | OnLButtonDown (UINT nFlags, CPoint point) |
virtual afx_msg void | OnLButtonUp (UINT nFlags, CPoint point) |
virtual afx_msg void | OnMouseMove (UINT nFlags, CPoint point) |
virtual afx_msg void | OnRButtonDblClk (UINT nFlags, CPoint point) |
virtual afx_msg void | OnRButtonDown (UINT nFlags, CPoint point) |
virtual afx_msg void | OnMButtonUp (UINT nFlags, CPoint point) |
virtual afx_msg void | OnMButtonDown (UINT nFlags, CPoint point) |
virtual afx_msg void | OnRButtonUp (UINT nFlags, CPoint point) |
virtual afx_msg BOOL | OnSetCursor (CWnd *pWnd, UINT nHitTest, UINT message) |
virtual afx_msg void | OnTimer (UINT nIDEvent) |
virtual afx_msg BOOL | OnMouseWheel (UINT nFlags, short zDelta, CPoint pt) |
virtual afx_msg LRESULT | OnAFXDisplayChange (WPARAM wparam, LPARAM lparam) |
virtual afx_msg BOOL | OnWndMsg (UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult) |
Static Protected Member Functions | |
static bool | GetKeyState (unsigned int key, int &flags) |
Protected Attributes | |
CPalette * | m_pViewPalette |
bool | m_bFastPrint |
bool | m_bUsingDI8Joystick |
DIDeviceInfo * | di8_data |
bool | m_bMetaPrint |
bool | m_bClipboardTruecolor |
int | m_MetafileType |
HBaseView * | m_pHView |
HC_KEY | m_ViewKey |
HC_KEY | m_SceneKey |
The CHoopsView class provides a HOOPS-specific implementation of the CView object.
CHoopsView creates and manages the connection of a HOOPS/3dGS driver instance to a CView object, which includes properly updating the window during exposes/resizes. It contains a pointer to a corresponding HOOPS/MVO HBaseView object.
It includes built-in support for printing, print preview, and copying to cliboard of the HOOPS/3dGS scene, and encapsulates palette management if HOOPS/3dGS is being used on 8-bit system with the MSW Driver.
This is the base class from which all custom HOOPS-based MFC/MDI CView objects should be derived.
void CHoopsView::AdjustAxisWindow | ( | ) |
Adjusts the relative size of the Axis window so that it always has the same size if the outer window is resized
|
virtual |
We overload the Create method to modify the CWnd window style; necessary for OpenGL support
|
protected |
does the actual work for copy to clipboard.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
helper to get the current ClientRect into a platform-independent structure
|
staticprotected |
Callback for retrieving low-level key-presses
key | ASCII Value of key to query state for |
flags | Status of Modifier keys (MVO_LEFT_SHIFT, MVO_RIGHT_SHIFT, MVO_SHIFT, MVO_CONTROL) |
|
inline |
|
inline |
CPalette* CHoopsView::GetPalette | ( | ) |
HC_KEY CHoopsView::GetSceneKey | ( | ) |
HC_KEY CHoopsView::GetViewKey | ( | ) |
void CHoopsView::InitializePalette | ( | ) |
Initialize this view's unique palette (meaning that we aren't sharing a palette among all views, which should be quite rare)
|
protected |
Maps the MFC button and Shift/Control state to abstracted HOOPS/MVO values
|
protected |
Maps the MFC key state to abstracted HOOPS/MVO values
|
protectedvirtual |
Called when WM_DISPLAYCHANGE happens. Calls OnDisplayChange();
|
protectedvirtual |
Called when display change happens. This can be used to adjust when screen orientation changes or resolution changes.
|
protectedvirtual |
Renders the scene to a Windows Metafile (emf or wmf) and places it on the clipboard. The type of metafile generated is accessed through GetMetafileType and SetMetafileType.
|
virtual |
Performs some HOOPS/MFC specific initialization: if HOOPS/MFC is being used in palette mode and each view has a unique palette, the palette is initialized.
|
protectedvirtual |
Calls the OnKeyDown method of the view's current HOOPS/MVO HBaseOperator object. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Calls the OnKeyUp method of the view's current HOOPS/MVO HBaseOperator object. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnLButtonDblClk event to all event listeners that are registered for the OnLButtonDblClk event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnLButtonDown event to all event listeners that are registered for the OnLButtonDown event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnLButtonUp event to all event listeners that are registered for the OnLButtonUp event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnMButtonDown event to all event listeners that are registered for the OnMButtonDown event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnMButtonUp event to all event listeners that are registered for the OnMButtonUp event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnMouseMove event to all event listeners that are registered for the OnMouseMove event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnMouseWheel event to all event listeners that are registered for the OnMouseWheel event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Overloaded CView method. Instructs HOOPS to traverse the scene-graph and update the display
|
protectedvirtual |
Prints the scene, or performs a print preview, according to the tye of Windows DC. If m_bFastPrint is true, the scene will be rendered to an offscreen bitmap and stretch-blitted to the printer. If false, the scene will be decomposed into native GDI information (2D vector and/or raster data).
If m_bFastPrint is true, it might be desirable to set m_bMetaPrint to true as well. In some cases, text and other objects may not print correctly without turning on both of these switches. See the section on GDI Driver Printing in the HOOPS/3dGS Platform and Device Guide for more details.
|
protectedvirtual |
Dispatches the OnRButtonDblClk event to all event listeners that are registered for the OnRButtonDblClk event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnRButtonDown event to all event listeners that are registered for the OnRButtonDown event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Dispatches the OnRButtonUp event to all event listeners that are registered for the OnRButtonUp event type. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
|
protectedvirtual |
Calls the OnTimer method of the view's current HOOPS/MVO HBaseOperator object. The GUI specific flags are mapped to HOOPS/MVO abstracted flags use the CHoopsView::MapFlags method
|
protectedvirtual |
Called when WM_POWERBROADCAST is sent by CHoopsFrame, from a "resume suspend". Calls HC_Control_Update to "reset device".
|
virtual |
We overload the PreCreateWindow method to modify the CWnd window class; necessary for OpenGL support
|
inline |
Sets whether copying to clipboard uses mapped or true color. The default is true.
|
inline |
Sets whether native GDI printing or a fast bitmap blit will be used for printing. The default is true.
|
inline |
Sets whether the first view update has occurred.
|
inline |
Sets whether an emf or wmf will be used for clipboard rendering. The default is EMF.
|
inline |
Sets whether a Windows Enhanced Metafile containing the scene will first be created and then played to the printer when CHoopsView::OnPrint() is called (rather than the scene going straight to the printer). The default is false.
|
protected |
If true, the scene will render to the clipboard in truecolor mode. The default is true.
|
protected |
If true, the scene is rendered to an offscreen bitmap and stretch-blitted to the printer or Windows metafile during printing or copy to clipboard. The default is true.
|
protected |
If true, the scene is rendered to a windows metafile and then played to the printer. The default is false.
|
protected |
If true, we have initialized and are using a 3DMouse or Joystick using DirectInput
|
protected |
Type of metafile generated when m_bMetaPrint==true, 0=WMF amd 1=EMF.
|
protected |
Pointer to HBaseView MVO object associated with this CView object.
|
protected |
Pointer to this view's unique palette. This will be null if we're in 24-bit mode, or if palettes are shared among all views.
|
protected |
The key of the HOOPS segment representing the top of the scene hierarchy, typically a subsegment of the driver instance segment (m_ViewKey) Intended to be used in conjuction with m_view_key as an ALTERNATIVE to MVO (and the HBaseView object referenced by m_pHView)
|
protected |
The key of the HOOPS driver instance segment associated with this view Intended to be used as an ALTERNATIVE to MVO (and the HBaseView object referenced by m_pHView)