Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Narocad wrapper

Help
2009-10-07
2013-06-12
  • Marek Kowalski
    Marek Kowalski
    2009-10-07

    Hi
    I trying to use dispose method of OCAIS_Shape class. After it is called. So code like :

    OCTopoDS_Shape shape = new OCTopoDS_Shape();
    OCAIS_Shape shape2 = new OCAIS_Shape(shape);
    shape2.Dispose();
    shape.Dispose();

    this crashes application with error:

    "An unhandled exception of type 'System.AccessViolationException' occurred in OCWrappers.dll

    Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

    Does explicit destruction of object with use of narocad wrapper is possible?

    I checked code generated by wrapper generator. Every destructor of OCSelectMgr_SelectableObject and its descendants have following destructor:

    ~OCAIS_Shape()
    {
      nativeHandle->Nullify();
      delete nativeHandle;
    }

    ~OCAIS_InteractiveObject()
    {
      nativeHandle->Nullify();
      delete nativeHandle;
    }

    ~OCSelectMgr_SelectableObject()
    {
      nativeHandle->Nullify();
      delete nativeHandle;
    }

    Are they generated correctly? When I'm using dispose method of OCAIS_Shape three destructors are invoked instead of one.

     
  • bxtrx
    bxtrx
    2009-10-11

    Hi,

    Thank you for your interest in the wrappers. We know about the issue you have, it also happened to us a while ago. Another problem is that finalizers need to be generated at the classes.

    Because we are now focused on making a release on the NaroCad project we postponed the improvement of wrapper for after the release. Because soon also a new version of OpenCascade should be launched we think that it would be best to add this fix when adding also wrappers for the new version (this because the wrapper task takes about 2-4 weeks).

    If you are interested to work at fixing the wrappers we would be more than happy to assist you in this task.

    Sorry for the late reply,
    Mihai

     
  • Andrew Smith
    Andrew Smith
    2010-06-01

    Hi,

    Im intrested in OCWrappers. Are you planning to add wrappers for IGES import and export ?
    This are classes:
    IGESCAFControl
    IGESCAFControl_Reader
    IGESCAFControl_Writer

    Are you considering development of wrapper?

     
  • bxtrx
    bxtrx
    2010-06-01

    Hi,

    It seems that the new OpenCascade version wasn't launched until now. We're still waiting for a new OpenCascade version in order to schedule a wrapper work task. Currently our focus is to improve the NaroCAD project and the wrapper tasks have lower priority.

    Regarding the wrappers you need: currently the first priority is to add finalizers at wrappers. There are generated wrappers for about 11 IGES packages but it seems that the OCAF packages you need are not generated. Also the IGES wrappers were not included in the assembly we use at NaroCAD.
    If you are interested at generating these wrappers and improving them we would be more than happy to assist you on this task. Among sources there is a file named FileGeneratingHowToStepByStep.txt that describes step by step how the wrapper generator works.

    Best regards,
    Mihai

     
  • Andrew Smith
    Andrew Smith
    2010-06-02

    I read  FileGeneratingHowToStepByStep.txt . I followed every step of it   and to the list of packages that I wanted to wrap I added:

    LibCtl IGESData

    LibCtl is one of IGESData dependencies and it is wrapped properly.
    When WrappersExt is examining class IGESData_IgesModel I get many errors in command prompt. First of them is following.

    Error  c\…\ros\src\IgesData\IgesData_IgesModel.cdl the type 'InterfaceModel' is not defined.

    I saw that OCWrappers.sln contains most of Interface package classes including Interface_InterfaceModel but I didn't saw this pakcage in sample list of packages when running WrappersExt. IGESData is one of most importnant packages to wrap iges import export functionality. Do You have any suggestion how this problem could be solved?

     
  • bxtrx
    bxtrx
    2010-06-07

    Hi,

    I checked your problem. Please add the packages: LibCtl Dico MoniTool Interface IGESData at the end of the sample packages. This should generate properly the wrappers. (IGESDATA depends on LibCtl and Interface, at its turn Interface depends on Dico and MoniTool).

    Best regards,
    Mihai

     
  • Andrew Smith
    Andrew Smith
    2010-06-08

    Hi

    I added LibCtl Dico MoniTool Interface IGESData to my command arguments in solution properties. 
    I'm Getting error. Error occurs when wrapper generator is Extracting IGESData package. When I remove it from command arguments code is generated properly. So it seems that problem is IGESData package.
    Error is following:

    ' Unhandled exception at 0x00450fc3 in OCWrappersExt.exe: 0xC0000005: Access violation reading location 0xfefd0000. '

    It occurs when CPP_BuildType function in CPPExt.cxx is working on  type called IGESData_Protocol.

     
  • bxtrx
    bxtrx
    2010-06-08

    Hi,

    When I added the LibCtl Dico MoniTool Interface IGESData packages to wrapper generator I made step by step the instructions from FileGeneratingHowToStepByStep.txt on a fresh OCC install and it worked, no crashes.

    These are the packages that I used for generation:
    -cppext -cppdir out -cdldir c:\OpenCASCADE6.3.0\ros\src\ Standard MMgt TCollection Quantity TColgp TColStd Message gp TopLoc GeomAbs Geom Bnd TShort TColQuantity SortTools Resource Aspect Viewer OSD MFT PlotMgt Image Graphic2d Xw WNT AlienImage Graphic3d Visual3d V2d V3d TopAbs TopoDS Geom2d StdFail math Adaptor2d Adaptor3d Geom2dAdaptor Precision GeomAdaptor BRepAdaptor CPnts GCPnts TopTools TopExp Intrv TopBas TopTrans TopCnx IntRes2d IntAna2d IntAna Intf IntImp IntSurf IntCurveSurface HLRAlgo MeshDS MeshShape MeshAlgo Poly Prs3d PrsMgr SelectBasics Select2D Select3D SelectMgr StdSelect DsgPrs AIS BRep LProp BRepLProp BRepTools Geom2dLProp GProp TColGeom2d PLib AdvApprox GeomLProp LProp3d AdvApp2Var FEmTool AppParCurves AppCont Approx AppDef BndLib Extrema gce GC GCE2d Convert Geom2dConvert TColGeom GeomConvert GeomLib GeomProjLib  GeomTools Hermit ProjLib MeshVS CGM PS Prs2d AIS2D GGraphic2d BRepLib BRepBuilderAPI Primitives BRepPrim Sweep BRepSweep BRepPrimAPI IntImpParGen IntCurve Geom2dInt TopClass BRepClass CSLib BRepTopAdaptor IntStart IntWalk IntPatch BRepIntCurveSurface IntCurvesFace BRepClass3d TopOpeBRepTool TopOpeBRepDS TopOpeBRep TopOpeBRepBuild BOPTColStd BooleanOperations GeomAPI IntTools BOPTools BOP BRepAlgo BRepAlgoAPI  Law Draft BRepOffset MAT GccInt Bisector AppBlend GeomFill MAT2d BRepMAT2d ElSLib Plate GeomPlate BRepFill BRepOffsetAPI Blend BlendFunc BRepBlend ChFi2d ChFiDS ChFi3d BRepFilletAPI ChFiKPart FilletSurf PStandard PMMgt DBC PCollection PColStd PTColStd TDF Storage CDM PCDM PDF MDF CDF TDocStd TNaming TDataStd AppStdL AppStd TPrsStd TFunction LibCtl Dico MoniTool Interface IGESData

    Good luck at solving your problem,
    Mihai

     
  • Andrew Smith
    Andrew Smith
    2010-06-10

    Hi Mihai

    Could you give me specific parameters of machine You compiled OCWrappers ? I mean type of  Processor , Ram amount  and operating system, is it 64 bit version ?