1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023931: Incorrect image export code in MFC sample: Added OCC_BaseDoc::ExportView() method to unify image export procedure in all MFC samples.

Compilation errors were corrected.
This commit is contained in:
aba
2013-12-05 15:03:53 +04:00
committed by bugmaster
parent 89c4bca846
commit 12c76beeb0
18 changed files with 239 additions and 316 deletions

View File

@@ -352,7 +352,7 @@ BEGIN
ID_BUTTONStart "Press to go to the first sample\nFirst sample (Home)"
ID_BUTTONNext "Press to go to the next sample\nNext sample (PgDn)"
ID_BUTTONShowResult "Press to toggle show of source code on/off\nSource code (F11)"
ID_DUMP_VIEW "Save current frame into a GIF file\nExport view to GIF (F12)"
ID_DUMP_VIEW "Save current frame into an image file\nExport view (F12)"
ID_BUTTONEnd "Press to go to the last sample\nLast sample (End)"
ID_BUTTONPrev "Press to go to the previous sample\nPrevious sample (PgUp)"
ID_BUTTONRepeat "Press to repeat the current sample\nRepeat sample (Space)"

View File

@@ -225,28 +225,15 @@ void COCCDemoDoc::OnUpdateBUTTONShowResult(CCmdUI* pCmdUI)
void COCCDemoDoc::OnDumpView()
{
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)
{
return;
}
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());
ExportView (aView);
}
void COCCDemoDoc::Fit()

View File

@@ -9,14 +9,13 @@
#pragma once
#endif // _MSC_VER > 1000
#include <OCC_BaseDoc.h>
#include "ResultDialog.h"
class OCCDemo_Presentation;
class COCCDemoDoc : public CDocument
class COCCDemoDoc : public OCC_BaseDoc
{
public:
Handle_V3d_Viewer GetViewer() const { return myViewer; };
Handle_AIS_InteractiveContext GetAISContext() const { return myAISContext; };
CResultDialog* GetResultDialog () {return &myCResultDialog;}
Standard_CString GetDataDir() {return myDataDir;}
@@ -72,8 +71,6 @@ protected:
DECLARE_MESSAGE_MAP()
private:
Handle_V3d_Viewer myViewer;
Handle_AIS_InteractiveContext myAISContext;
OCCDemo_Presentation *myPresentation;
CResultDialog myCResultDialog;
BOOL myShowResult;