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

@@ -9,103 +9,83 @@
#pragma once
#endif // _MSC_VER >= 1000
#include "OCC_BaseDoc.h"
#include "AIS_ConnectedInteractive.hxx"
#include "Geom_Transformation.hxx"
class CAnimationDoc : public CDocument
class CAnimationDoc : public OCC_BaseDoc
{
public:
void DragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle(V3d_View)& aView );
void InputEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView );
void MoveEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView );
void ShiftMoveEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView );
void ShiftDragEvent (const Standard_Integer x ,
const Standard_Integer y ,
const Standard_Integer TheState,
const Handle(V3d_View)& aView );
void ShiftInputEvent(const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView );
void Popup (const Standard_Integer x ,
const Standard_Integer y ,
const Handle(V3d_View)& aView );
void DragEvent (const Standard_Integer x,
const Standard_Integer y,
const Standard_Integer TheState,
const Handle(V3d_View)& aView);
void InputEvent (const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView);
void MoveEvent (const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView);
void ShiftMoveEvent (const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView);
void ShiftDragEvent (const Standard_Integer x,
const Standard_Integer y,
const Standard_Integer TheState,
const Handle(V3d_View)& aView);
void ShiftInputEvent (const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView);
void Popup (const Standard_Integer x,
const Standard_Integer y,
const Handle(V3d_View)& aView);
protected: // create from serialization only
CAnimationDoc();
DECLARE_DYNCREATE(CAnimationDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAnimationDoc)
public:
//}}AFX_VIRTUAL
CAnimationDoc();
DECLARE_DYNCREATE(CAnimationDoc)
// Implementation
public:
virtual ~CAnimationDoc();
virtual ~CAnimationDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CAnimationDoc)
afx_msg void OnShading();
afx_msg void OnThread();
afx_msg void OnFileLoadgrid();
afx_msg void OnUpdateWalkWalkthru(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public :
//{{AFX_MSG(CAnimationDoc)
afx_msg void OnShading();
afx_msg void OnThread();
afx_msg void OnFileLoadgrid();
afx_msg void OnUpdateWalkWalkthru(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
Handle_V3d_Viewer myViewer;
Handle_AIS_InteractiveContext myAISContext;
public :
Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
Handle_V3d_Viewer GetViewer() { return myViewer; };
Handle_AIS_Shape myAisCrankArm ;
Handle_AIS_Shape myAisCylinderHead ;
Handle_AIS_Shape myAisPropeller ;
Handle_AIS_Shape myAisPiston ;
Handle_AIS_Shape myAisEngineBlock ;
Standard_Real myDeviation;
Standard_Integer myAngle;
private :
Handle_AIS_Shape myAisCrankArm ;
Handle_AIS_Shape myAisCylinderHead ;
Handle_AIS_Shape myAisPropeller ;
Handle_AIS_Shape myAisPiston ;
Handle_AIS_Shape myAisEngineBlock ;
Standard_Real myDeviation;
Standard_Integer myAngle;
public :
void OnMyTimer();
Standard_Integer myCount;
Standard_Integer thread;
double m_Xmin, m_Ymin, m_Zmin, m_Xmax, m_Ymax, m_Zmax;
BOOL m_bIsGridLoaded;
public:
void OnMyTimer();
Standard_Integer myCount;
Standard_Integer thread;
double m_Xmin, m_Ymin, m_Zmin, m_Xmax, m_Ymax, m_Zmax;
BOOL m_bIsGridLoaded;
};
/////////////////////////////////////////////////////////////////////////////

View File

@@ -225,24 +225,7 @@ CAnimationDoc* CAnimationView3D::GetDocument() // non-debug version is inline
// CAnimationView3D message handlers
void CAnimationView3D::OnFileExportImage()
{
CFileDialog aDlg (FALSE, "*.BMP", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"BMP Files (*.BMP)|*.bmp|"
"GIF Files (*.GIF)|*.gif|"
"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;
}
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myView->Dump (aDlg.GetPathName());
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
GetDocument()->ExportView (myView);
}
void CAnimationView3D::OnSize(UINT /*nType*/, int cx, int cy)