View Issue Details

IDProjectCategoryView StatusLast Update
0023010CommunityOCCT:Data Exchangepublic2014-11-11 12:57
Reporterfrar Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2005 
Product Version6.5.2 
Target Version6.8.0Fixed in Version6.8.0 
Summary0023010: Error with a .stp model during transfer from STEPCAFControl_Reader to document
DescriptionI'm having a crash problem in STEPCAFControl_Reader::Transfer(Handle< TDocStd_Document > &doc) with a set of .stp models.

I have this error only with OpenCascade 6.5.2 while with OpenCascade 6.5.1 there aren't problems.
Steps To Reproduce1) Download file among attachments. It is exported with SolidWorks 2011 as AP_214 (in order to support colours) and other similar models gives same problems. If I export it as AP_203 there are no problems (but visualization is without colours).

2) Compile the following code changing path of fileName variable at the start. It is a simple reader that try to transfer loaded entities in a document. When you execute it, it gives a crash with message Access Violation.

// C++ standard headers
#include <iostream>

// OpenCascade headers
#include <STEPCAFControl_Reader.hxx>

// Project headers
#include "MyOcafApplication.h"

int main(int argc, char **argv)
{
     std::string fileName="C:/Sviluppo/SolidWorks_test/Parte2.STEP";

     // Create an OpenCascade Application
     MyOcafApplication *mCasApp = new MyOcafApplication();
     Handle(TDocStd_Document) doc;
     mCasApp->NewDocument("MDTV-XCAF", doc);

     // Reader for .stp cad model to load into a document
     STEPCAFControl_Reader stepReader;

     // Read file
     IFSelect_ReturnStatus status = stepReader.ReadFile(fileName.c_str());
     if ( status != IFSelect_RetDone )
          return false;

     // Set modes
     stepReader.SetColorMode(Standard_True);
     stepReader.SetLayerMode(Standard_True);
     stepReader.SetNameMode(Standard_True);

     // Transfer to doc passed as argument
     Standard_Boolean ok = stepReader.Transfer(doc); // ERROR HERE!!!

     delete mCasApp;

     return 0;
}

where OCAFApplication.h is the following:

#ifndef __TDOC_STD_APPLICATION__
#define __TDOC_STD_APPLICATION__

// OpenCascade headers
#include <TDocStd_Application.hxx>
#include <TColStd_SequenceOfExtendedString.hxx>

/*!
* \class MyOcafApplication
* \inherit TDocStd_Application
* \brief Class inherited from OpenCascade's TDocStd_Application. It is needed to use a TDocStd_Application that is an abstract class!
*/
class MyOcafApplication : public TDocStd_Application
{
     /*!
      * \fn void Formats(TDolStd_SequenceOfExtendedString& Formats)
      * \brief Method to add the format of the documents to be read by the application
      * \param Formats
      */
     void Formats(TColStd_SequenceOfExtendedString& Formats)
     {
          Formats.Append(TCollection_ExtendedString("MyOcafApplication"));
     }

     /*!
      * \fn Standard_CString ResourcesName()
      * \brief method to define the name of the resource file
      */
     Standard_CString ResourcesName()
     {
          return Standard_CString("Resources");
     }

};

#endif // __TDOC_STD_APPLICATION__
TagsNo tags attached.
Test case numberbugs xde bug23010

Attached Files

  • Parte2.STEP (27,578 bytes)

Activities

frar

2012-03-02 13:47

reporter  

Parte2.STEP (27,578 bytes)

ika

2014-07-24 13:31

developer   ~0030411

Dear Bugmaster,

There is no crashes on current master. The problem is not reproduced, so could you please close this issue?

bugmaster

2014-07-25 11:39

administrator   ~0030417

Dear MKV,

Please create testing case

apv

2014-07-28 17:39

tester   ~0030458

Test-case is created

Related Changesets

occt: master e4b5c45a

2014-07-31 09:26:42

apv


Committer: bugmaster Details Diff
0023010: Error with a .stp model during transfer from STEPCAFControl_Reader to document

Adding test case
Affected Issues
0023010
mod - src/QABugs/QABugs_19.cxx Diff File
add - tests/bugs/xde/bug23010 Diff File

Issue History

Date Modified Username Field Change
2012-03-02 13:47 frar New Issue
2012-03-02 13:47 frar Assigned To => gka
2012-03-02 13:47 frar File Added: Parte2.STEP
2014-07-24 13:31 ika Note Added: 0030411
2014-07-24 13:31 ika Assigned To gka => bugmaster
2014-07-24 13:31 ika Status new => feedback
2014-07-25 11:39 bugmaster Assigned To bugmaster => mkv
2014-07-25 11:39 bugmaster Note Added: 0030417
2014-07-25 16:41 mkv Assigned To mkv => apv
2014-07-28 17:39 apv Test case number => bugs xde bug23010
2014-07-28 17:39 apv Note Added: 0030458
2014-07-28 17:39 apv Assigned To apv => bugmaster
2014-07-28 17:39 apv Status feedback => tested
2014-07-28 17:42 apv Target Version => 6.8.0
2014-08-01 14:55 bugmaster Changeset attached => occt master e4b5c45a
2014-08-01 14:55 bugmaster Status tested => verified
2014-08-01 14:55 bugmaster Resolution open => fixed
2014-11-11 12:46 aiv Fixed in Version => 6.8.0
2014-11-11 12:57 aiv Status verified => closed