0025387: Error appears during export to STEP operation in ImportExport MFC sample
authorski <ski@opencascade.com>
Thu, 30 Oct 2014 09:12:17 +0000 (12:12 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 30 Oct 2014 09:12:56 +0000 (12:12 +0300)
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.

samples/mfc/standard/Common/ImportExport/ImportExport.cpp
samples/mfc/standard/Common/ImportExport/ImportExport.h
samples/mfc/standard/Common/ImportExport/SaveCSFDBDlg.cpp
samples/mfc/standard/Common/ImportExport/SaveSTEPDlg.cpp

index 51e05e4..5773eb1 100755 (executable)
@@ -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)); 
index 01165fa..98bb60c 100755 (executable)
@@ -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 !!
index 1b60496..bfa5299 100755 (executable)
 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)
index 2459de2..7e3cf5d 100755 (executable)
 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)
-        {
-
-        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
-
-    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;
-
-               }
+  CFileDialog::DoDataExchange(pDX);
+  if (!pDX->m_bSaveAndValidate)
+  {
+    m_DialogType = m_Cc1ModelType;
+  }
+
+  //{{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)
+  {
+    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");
-
-  m_SaveTypeCombo.InsertString(-1, L"FacetedBrep");
-
-  m_SaveTypeCombo.InsertString(-1, L"ShellBasedSurfaceModel");
-  m_SaveTypeCombo.InsertString(-1, L"GeometricCurveSet");
-       m_SaveTypeCombo.SetCurSel(m_DialogType);
-
-       return bRet;
+{      
+  BOOL bRet =  CFileDialog::OnInitDialog();
+
+  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);
+
+  return bRet;
 }
 
 BOOL CFileSaveSTEPDialog::OnFileNameOK()