📄 test6.cpp
字号:
// Ctest6App.cpp : Defines the class behaviors for the application.
//
#include "StdAfx.h"
#include "Resource.h"
#include "test6.h"
#include "test6Doc.h"
#include "test6View.h"
#include "MainFrm.h"
#include "Htest6View.h"
#include "HDB.h"
#include "CTDriver.h"
// HOOPS-bridge
#include "ha_bridge.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Ctest6App
BEGIN_MESSAGE_MAP(Ctest6App, CHoopsApp)
//{{AFX_MSG_MAP(Ctest6App)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Ctest6App construction
Ctest6App::Ctest6App()
{
// HC_Define_System_Options("no warnings, no info, no errors, no message limit");
m_pHoopsDB = NULL;
m_pCTDriver = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only Ctest6App object
Ctest6App theApp;
/////////////////////////////////////////////////////////////////////////////
// Ctest6App initialization
BOOL Ctest6App::InitInstance()
{
m_pHoopsDB = new HDB;
m_pHoopsDB->Init();
//m_pCTDriver must be started after m_pHoopsDB is created
m_pCTDriver = new CTDriver( 10 );
m_pCTDriver->StartTimer();
base_configuration base_config;
logical ok = initialize_base( &base_config);
api_start_modeller(0);
api_initialize_hoops_acis_bridge();
HA_Set_Rendering_Options("merge faces");
// Standard initialization
// If you are planning to use this source code in Visual Studio 6.0 or
// earlier versions, you should uncomment the following
//#ifdef _AFXDLL
// Enable3dControls(); // Call this when using MFC in a shared DLL
//#else
// Enable3dControlsStatic(); // Call this when linking to MFC statically
//#endif
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_HOOPSTYPE,
RUNTIME_CLASS(Ctest6Doc),
RUNTIME_CLASS(CMainFrame), // child frame
RUNTIME_CLASS(Ctest6View));
AddDocTemplate(pDocTemplate);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
enum { IDD = IDD_ABOUTBOX };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
// App command to run the dialog
void Ctest6App::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CHoopsApp commands
int Ctest6App::ExitInstance()
{
//m_pCTDriver must be deleted before m_pHoopsDB
if (m_pCTDriver) {
delete m_pCTDriver;
m_pCTDriver = NULL;
}
if (m_pHoopsDB)
{
delete m_pHoopsDB;
m_pHoopsDB = 0;
api_terminate_hoops_acis_bridge();
api_stop_modeller();
terminate_base();
}
return CHoopsApp::ExitInstance();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -