home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
win
/
sieciowe
/
oiv_demo.lzh
/
disk2
/
DATA.2
/
include
/
Ivf
/
IvfView.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-02
|
4KB
|
145 lines
/*
* Copyright (C) 1995 Template Graphics Software, Inc.
_______________________________________________________________________
_________________ TEMPLATE GRAPHICS SOFTWARE INC. ___________________
|
|
| This class provides methods to process messages directed to the
| view object and IVF viewer specific functions.
|
| Author(s): James R. Gambale, Jr.
|
_________________ TEMPLATE GRAPHICS SOFTWARE INC. ___________________
_______________________________________________________________________
*/
#ifndef __CIVFVIEW_H__
#define __CIVFVIEW_H__
class SoError;
class SoWinComponent;
class CIvfApp;
class CIvfMainFrame;
class CIvfDoc;
class CIvfVwr ;
class CIvfView
{
friend class CIvfMainFrame;
friend class CIvfDoc;
public:
CIvfView();
~CIvfView();
// This method uses the runtime class information pointed to by
// pVwrClass to construct an IVF viewer object. The IVF viewer
// object is manipulated through the virtual functions declared
// in the CIvfVwr class declaration. pVwrArgs is passed to
// the viewer creation method.
void IvfCreateViewer(CRuntimeClass *pVwrClass,
void *pVwrArgs=NULL) ;
// This method sets the current viewer to pViewer.
void IvfSetViewer(CRuntimeClass *pVwrClass,
CIvfVwr *pViewer,
void *pVwrArgs) ;
// This method destroys the current viewer.
void IvfDestroyViewer();
// This method returns a pointer to the current viewer.
CIvfVwr * IvfGetViewer() { return m_pViewer; } ;
// This method returns a pointer to the current viewer component.
SoWinComponent *IvfGetVwrComponent() ;
// This method notifies the view that the scene graph has changed.
void IvfSceneGraphChanged() ;
// This method is invoked when an error is encountered. A dialog
// containing the error message is displayed.
static void IvfErrorCallback( const SoError *error, void *data );
protected:
// pointer to the runtime class information for the current IVF viewer
CRuntimeClass *m_pVwrClass ;
// pointer to the current IVF viewer.
CIvfVwr * m_pViewer;
// pointer to the IVF viewer creation arguments
void * m_pVwrArgs;
// This method is invoked when the MFC (and IVF) view object(s) are
// abount to be destroyed.
void IvfOnDestroy();
// Paint message handler.
void IvfOnPaint();
// This method is invoked the during the first update of the view.
void IvfOnInitialUpdate();
// This method is invoked prior to view activation.
void IvfOnActivateView();
// This method is invoked prior to view deactivation.
void IvfOnDeactivateView();
// This method is invoked to update the frame title string.
BOOL IvfOnUpdateFrameTitle(CString &strTitle) ;
// This method is used to route messages to the IVF viewer dialogs.
// TRUE is returned if the message is processed, FALSE otherwise.
BOOL IvfPreTranslateMessage(MSG* pMsg);
// This method is used to route commands to the IVF viewer.
// TRUE is returned if the command is processed, FALSE otherwise.
BOOL IvfOnCommand(WPARAM wParam, LPARAM lParam);
// This method is used to route command messages to the IVF viewer.
// TRUE is returned if the command is processed, FALSE otherwise.
BOOL IvfOnCmdMsg(UINT nID, int nCode, void* pExtra,
AFX_CMDHANDLERINFO* pHandlerInfo) ;
};
// These macros are used in the application view class implementation
// to route commands to the IVF view object.
#define IVF_ON_METHOD_NAME(CmdName) On##CmdName
#define IVF_ON_UPD_METHOD_NAME(CmdName) OnUpdate##CmdName
#ifdef _DEBUG
#define IVF_COMMAND_HANDLER(ViewName,VwrName,CmdName) \
void ViewName::IVF_ON_METHOD_NAME(CmdName) () \
{ \
VwrName *pViewer = (VwrName *)m_pViewer ; \
pViewer->IVF_ON_METHOD_NAME(CmdName) (); \
} \
void ViewName::IVF_ON_UPD_METHOD_NAME(CmdName) (CCmdUI* pCmdUI)\
{ \
VwrName *pViewer = (VwrName *)m_pViewer ; \
pViewer->IVF_ON_UPD_METHOD_NAME(CmdName) (pCmdUI); \
}
#else
#define IVF_COMMAND_HANDLER(ViewName,VwrName,CmdName) \
void ViewName::IVF_ON_METHOD_NAME(CmdName) () \
{ \
VwrName *pViewer = (VwrName *)m_pViewer ; \
pViewer->IVF_ON_METHOD_NAME(CmdName) (); \
} \
void ViewName::IVF_ON_UPD_METHOD_NAME(CmdName) (CCmdUI* pCmdUI)\
{ \
VwrName *pViewer = (VwrName *)m_pViewer ; \
pViewer->IVF_ON_UPD_METHOD_NAME(CmdName) (pCmdUI); \
}
#endif
#endif