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:
@@ -120,7 +120,18 @@ BOOL CModelClippingDlg::OnInitDialog()
|
||||
if (m_ModelClippingONOFF)
|
||||
{
|
||||
// register and activate clipping plane
|
||||
if (!myView->GetClipPlanes().Contains (myClippingPlane))
|
||||
Standard_Boolean toAddPlane = Standard_True;
|
||||
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (myView->GetClipPlanes());
|
||||
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||
{
|
||||
if (aPlaneIt.Value() == myClippingPlane)
|
||||
{
|
||||
toAddPlane = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (toAddPlane)
|
||||
{
|
||||
myView->AddClipPlane (myClippingPlane);
|
||||
}
|
||||
@@ -188,7 +199,18 @@ void CModelClippingDlg::OnCheckModelclippingonoff()
|
||||
if (m_ModelClippingONOFF)
|
||||
{
|
||||
// register and activate clipping plane
|
||||
if (!myView->GetClipPlanes().Contains (myClippingPlane))
|
||||
Standard_Boolean toAddPlane = Standard_True;
|
||||
Graphic3d_SequenceOfHClipPlane::Iterator aPlaneIt (myView->GetClipPlanes());
|
||||
for (; aPlaneIt.More(); aPlaneIt.Next())
|
||||
{
|
||||
if (aPlaneIt.Value() == myClippingPlane)
|
||||
{
|
||||
toAddPlane = Standard_False;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (toAddPlane)
|
||||
{
|
||||
myView->AddClipPlane (myClippingPlane);
|
||||
}
|
||||
|
@@ -511,7 +511,7 @@ END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
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_TEXTURE_ON "Run texture example\nRun texture example"
|
||||
END
|
||||
|
||||
|
@@ -1057,30 +1057,17 @@ void CViewer3dDoc::OnUpdateBUTTONEnd(CCmdUI* pCmdUI)
|
||||
pCmdUI->Enable (isTextureSampleStarted);
|
||||
}
|
||||
|
||||
void CViewer3dDoc::OnDumpView()
|
||||
void CViewer3dDoc::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 (*.JPG)|*.jpg|"
|
||||
"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;)
|
||||
{
|
||||
CViewer3dView* pView = (CViewer3dView* )GetNextView (aPos);
|
||||
pView->UpdateWindow();
|
||||
}
|
||||
|
||||
myViewer->InitActiveViews();
|
||||
Handle(V3d_View) aView = myViewer->ActiveView();
|
||||
aView->Dump (aDlg.GetPathName());
|
||||
ExportView (aView);
|
||||
}
|
||||
|
||||
void CViewer3dDoc::Start()
|
||||
|
Reference in New Issue
Block a user