mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0023776: Redesign of MFC samples after V2d viewer removing
This commit is contained in:
@@ -401,7 +401,7 @@ void Tesselate_Presentation::tesselateShape(const TopoDS_Shape& aShape)
|
||||
|
||||
void Tesselate_Presentation::sample(const Standard_CString aFileName)
|
||||
{
|
||||
CString initfile(((OCC_BaseApp*) AfxGetApp())->GetInitDataDir());
|
||||
CString initfile(((OCC_App*) AfxGetApp())->GetInitDataDir());
|
||||
initfile += "\\..\\..\\Data\\";
|
||||
initfile += aFileName;
|
||||
|
||||
|
@@ -13,9 +13,9 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CTriangulationApp construction
|
||||
|
||||
CTriangulationApp::CTriangulationApp()
|
||||
CTriangulationApp::CTriangulationApp() : OCC_App()
|
||||
{
|
||||
SampleName = "TopologyTriangulation"; //for about dialog
|
||||
SampleName = "TopologyTriangulation"; //for about dialog
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -8,18 +8,20 @@
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <OCC_3dApp.h>
|
||||
#include <OCC_App.h>
|
||||
|
||||
class CTriangulationApp : public OCC_3dApp
|
||||
class CTriangulationApp : public OCC_App
|
||||
{
|
||||
public:
|
||||
CTriangulationApp();
|
||||
|
||||
CTriangulationApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CTriangulationApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CTriangulationApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@@ -407,39 +407,28 @@ void CTriangulationDoc::OnUpdateBUTTONPrev(CCmdUI* pCmdUI)
|
||||
|
||||
void CTriangulationDoc::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)
|
||||
{
|
||||
OCC_3dView* pView = (OCC_3dView*) 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;)
|
||||
{
|
||||
OCC_3dView* pView = (OCC_3dView* )GetNextView (aPos);
|
||||
pView->UpdateWindow();
|
||||
}
|
||||
myViewer->InitActiveViews();
|
||||
Handle(V3d_View) aView = myViewer->ActiveView();
|
||||
aView->Dump (aDlg.GetPathName());
|
||||
}
|
||||
|
||||
void CTriangulationDoc::Fit()
|
||||
|
Reference in New Issue
Block a user