mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0023776: Redesign of MFC samples after V2d viewer removing
This commit is contained in:
@@ -26,19 +26,17 @@ END_MESSAGE_MAP()
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp construction
|
||||
|
||||
COCCDemoApp::COCCDemoApp()
|
||||
COCCDemoApp::COCCDemoApp() : OCC_App()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
SampleName = "";
|
||||
SampleName = "";
|
||||
try
|
||||
{
|
||||
Handle(Aspect_DisplayConnection) aDisplayConnection;
|
||||
myGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
|
||||
}
|
||||
catch(Standard_Failure)
|
||||
{
|
||||
AfxMessageBox("Fatal Error During Graphic Initialisation");
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
AfxMessageBox ("Fatal Error During Graphic Initialisation");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,41 +14,41 @@
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include <OCC_BaseApp.h>
|
||||
#include <OCC_App.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// COCCDemoApp:
|
||||
// See OCCDemo.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class COCCDemoApp : public OCC_BaseApp
|
||||
class COCCDemoApp : public OCC_App
|
||||
{
|
||||
public:
|
||||
|
||||
COCCDemoApp();
|
||||
Handle(Graphic3d_GraphicDriver) GetGraphicDriver() const
|
||||
{ return myGraphicDriver; } ;
|
||||
|
||||
Handle(Graphic3d_GraphicDriver) GetGraphicDriver() const { return myGraphicDriver; }
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(COCCDemoApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(COCCDemoApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
//{{AFX_MSG(COCCDemoApp)
|
||||
//afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
//{{AFX_MSG(COCCDemoApp)
|
||||
//afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
|
||||
Handle(Graphic3d_GraphicDriver) myGraphicDriver;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
@@ -225,39 +225,28 @@ void COCCDemoDoc::OnUpdateBUTTONShowResult(CCmdUI* pCmdUI)
|
||||
|
||||
void COCCDemoDoc::OnDumpView()
|
||||
{
|
||||
// save current directory and restore it on exit
|
||||
char aCurPath[MAX_PATH];
|
||||
::GetCurrentDirectory(MAX_PATH, aCurPath);
|
||||
|
||||
::SetCurrentDirectory(myLastPath);
|
||||
|
||||
CFileDialog *aDlg = new CFileDialog(false, "gif", "OCCView.gif",
|
||||
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "GIF Files (*.gif)|*.gif||", NULL);
|
||||
|
||||
int result = aDlg->DoModal();
|
||||
if ( result == IDOK)
|
||||
CFileDialog aDlg (false, "gif", "OCCView.gif", OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
|
||||
"GIF Files (*.GIF)|*.gif|"
|
||||
"BMP Files (*.BMP)|*.bmp|"
|
||||
"PNG Files (*.PNG)|*.png|"
|
||||
"JPEG Files (*.JPEG)|*.jpeg|"
|
||||
"PPM Files (*.PPM)|*.ppm|"
|
||||
"TIFF Files (*.TIFF)|*.tiff|"
|
||||
"TGA Files (*.TGA)|*.tga|"
|
||||
"EXR Files (*.EXR)|*.exr||", NULL);
|
||||
if (aDlg.DoModal() != IDOK)
|
||||
{
|
||||
CString aFileName = aDlg->GetFileName();
|
||||
delete aDlg;
|
||||
|
||||
POSITION pos = GetFirstViewPosition();
|
||||
while (pos != NULL)
|
||||
{
|
||||
COCCDemoView* pView = (COCCDemoView*) GetNextView(pos);
|
||||
pView->UpdateWindow();
|
||||
}
|
||||
|
||||
myViewer->InitActiveViews();
|
||||
Handle(V3d_View) aView = myViewer->ActiveView();
|
||||
char aStrFileName[MAX_PATH];
|
||||
strcpy_s(aStrFileName, aFileName);
|
||||
aView->Dump(aStrFileName);
|
||||
return;
|
||||
}
|
||||
else
|
||||
delete aDlg;
|
||||
|
||||
::GetCurrentDirectory(MAX_PATH, myLastPath);
|
||||
::SetCurrentDirectory(aCurPath);
|
||||
|
||||
for (POSITION aPos = GetFirstViewPosition(); aPos != NULL;)
|
||||
{
|
||||
COCCDemoView* pView = (COCCDemoView* )GetNextView (aPos);
|
||||
pView->UpdateWindow();
|
||||
}
|
||||
myViewer->InitActiveViews();
|
||||
Handle(V3d_View) aView = myViewer->ActiveView();
|
||||
aView->Dump (aDlg.GetPathName());
|
||||
}
|
||||
|
||||
void COCCDemoDoc::Fit()
|
||||
|
Reference in New Issue
Block a user