1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-16 10:54:53 +03:00

0025387: Error appears during export to STEP operation in ImportExport MFC sample

Combo-box for selection of translation mode is available in Export to STEP and CSFDB files.
Default valuer for STEP export mode is set to As Is, i.e. automatic selection.

Added #define in function CFileDialog because it takes only 6 parameters in Visual Studio 2005.
This commit is contained in:
ski 2014-10-30 12:12:17 +03:00 committed by bugmaster
parent db4d439c8f
commit 4084fb643c
4 changed files with 39 additions and 42 deletions

View File

@ -836,7 +836,7 @@ IFSelect_ReturnStatus CImportExport::SaveSTEP(const Handle(TopTools_HSequenceOfS
CFileSaveSTEPDialog aDlg(NULL);
aDlg.m_Cc1ModelType = STEPControl_ManifoldSolidBrep;
aDlg.m_Cc1ModelType = STEPControl_AsIs;
if (aDlg.DoModal() == IDOK) {
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));

View File

@ -86,7 +86,7 @@ public :
static IFSelect_ReturnStatus SaveSTEP(const Standard_CString& aFileName,
const Handle(TopTools_HSequenceOfShape)& aHSequenceOfShape,
const STEPControl_StepModelType aValue = STEPControl_ManifoldSolidBrep);
const STEPControl_StepModelType aValue = STEPControl_AsIs);
static void ReadSAT(const Handle(AIS_InteractiveContext)& anInteractiveContext);
static Handle(TopTools_HSequenceOfShape) ReadSAT(); // not by reference --> the sequence is created here !!

View File

@ -14,7 +14,12 @@
CFileSaveCSFDBDialog::CFileSaveCSFDBDialog(CWnd* pParent /*=NULL*/)
: CFileDialog(FALSE,_T("*.csfdb"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("CSFDB Files (*.csfdb)|*.csfdb;|CSFDB Files (*.csf)|*.csf;||"),
pParent)
pParent
#if (_MSC_VER < 1500)
)
#else
,0,0)
#endif
{
//{{AFX_DATA_INIT(CFileSaveCSFDBDialog)

View File

@ -12,15 +12,19 @@
CFileSaveSTEPDialog::CFileSaveSTEPDialog(CWnd* pParent /*=NULL*/)
: CFileDialog(FALSE,_T("*.STEP"),NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("STEP Files (*.step)|*.step;|STEP Files (*.stp)|*.stp;||"),
pParent)
pParent
#if (_MSC_VER < 1500)
)
#else
,0,0)
#endif
//dlg.m_ofn.lpstrInitialDir = initdir;
{
//{{AFX_DATA_INIT(CFileSaveSTEPDialog)
m_Cc1ModelType = STEPControl_ManifoldSolidBrep;
m_Cc1ModelType = STEPControl_AsIs;
//}}AFX_DATA_INIT
CString CASROOTValue;
@ -35,34 +39,21 @@ CString initdir = (CASROOTValue + "\\..\\data\\step");
void CFileSaveSTEPDialog::DoDataExchange(CDataExchange* pDX)
{
CFileDialog::DoDataExchange(pDX);
if (!pDX->m_bSaveAndValidate)
{
CFileDialog::DoDataExchange(pDX);
if (!pDX->m_bSaveAndValidate)
{
m_DialogType = m_Cc1ModelType;
}
if (m_Cc1ModelType==STEPControl_ManifoldSolidBrep) m_DialogType=0;
if (m_Cc1ModelType==STEPControl_BrepWithVoids) Standard_Failure::Raise("unsupported enumeration terme");
if (m_Cc1ModelType==STEPControl_FacetedBrep) m_DialogType=1;
if (m_Cc1ModelType==STEPControl_FacetedBrepAndBrepWithVoids) Standard_Failure::Raise("unsupported enumeration terme");
if (m_Cc1ModelType==STEPControl_ShellBasedSurfaceModel) m_DialogType=2;
if (m_Cc1ModelType==STEPControl_GeometricCurveSet) m_DialogType=3;
//{{AFX_DATA_MAP(CFileSaveSTEPDialog)
DDX_Control(pDX, IDC_FSaveSTEP_Type, m_SaveTypeCombo);
DDX_CBIndex(pDX, IDC_FSaveSTEP_Type, m_DialogType );
//}}AFX_DATA_MAP
}
//{{AFX_DATA_MAP(CFileSaveSTEPDialog)
DDX_Control(pDX, IDC_FSaveSTEP_Type, m_SaveTypeCombo);
DDX_CBIndex(pDX, IDC_FSaveSTEP_Type, m_DialogType );
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate)
{
if (m_DialogType==0) m_Cc1ModelType=STEPControl_ManifoldSolidBrep;
if (m_DialogType==1) m_Cc1ModelType=STEPControl_FacetedBrep;
if (m_DialogType==2) m_Cc1ModelType=STEPControl_ShellBasedSurfaceModel;
if (m_DialogType==3) m_Cc1ModelType=STEPControl_GeometricCurveSet;
}
if (pDX->m_bSaveAndValidate)
{
m_Cc1ModelType = (STEPControl_StepModelType)m_DialogType;
}
}
BEGIN_MESSAGE_MAP(CFileSaveSTEPDialog, CFileDialog)
@ -75,18 +66,19 @@ END_MESSAGE_MAP()
// CFileSaveSTEPDialog message handlers
BOOL CFileSaveSTEPDialog::OnInitDialog()
{
BOOL bRet = CFileDialog::OnInitDialog();
m_SaveTypeCombo.InsertString(-1, L"ManifoldSolidBrep");
{
BOOL bRet = CFileDialog::OnInitDialog();
m_SaveTypeCombo.InsertString(-1, L"FacetedBrep");
m_SaveTypeCombo.InsertString(-1, L"As Is");
m_SaveTypeCombo.InsertString(-1, L"Manifold Solid BRep");
m_SaveTypeCombo.InsertString(-1, L"BRep With Voids");
m_SaveTypeCombo.InsertString(-1, L"Faceted BRep");
m_SaveTypeCombo.InsertString(-1, L"Faceted BRep With Voids");
m_SaveTypeCombo.InsertString(-1, L"Shell Based Surface Model");
m_SaveTypeCombo.InsertString(-1, L"Geometric Curve Set");
m_SaveTypeCombo.SetCurSel(m_DialogType);
m_SaveTypeCombo.InsertString(-1, L"ShellBasedSurfaceModel");
m_SaveTypeCombo.InsertString(-1, L"GeometricCurveSet");
m_SaveTypeCombo.SetCurSel(m_DialogType);
return bRet;
return bRet;
}
BOOL CFileSaveSTEPDialog::OnFileNameOK()