tag:blogger.com,1999:blog-52091105654444051982024-03-13T16:09:05.872-07:003D Application Developmentusing OpenCascade and .Netbxtrxhttp://www.blogger.com/profile/02536262903679342844noreply@blogger.comBlogger1079125tag:blogger.com,1999:blog-5209110565444405198.post-59357599246409263572013-08-12T03:03:00.001-07:002013-08-12T03:03:12.695-07:00New blogAfter the 1.7.8 release we decided to move the blog to the NaroCAD website, so from now on you can follow us on <a href="http://narocad.com/category/status-report/">narocad.com</a>Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-66889672996529009052013-08-01T07:33:00.002-07:002013-08-01T07:33:53.330-07:00Released NaroCAD 1.7.8 BetaToday we released NaroCAD 1.7.8 Beta:<br />
<br />
<b>Generated and fixed a new wrapper set for OpenCascade 6.5.5</b><br />
Fixed Cut to depth for negative values<br />
Reimplemented Cut through All<br />
Improved Undo and Redo functionality<br />
Fixed Spline display and editing<br />
Fixed display issues<br />
<br />
You can download it <a href="http://narocad.com/downloads/">here</a>Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-64698040788588695812013-07-30T06:27:00.001-07:002013-07-30T06:27:34.875-07:00Fillet and chamfer bug fixes and Spline investigationToday I fixed two bugs related to Fillet and Chamfer 3D which caused errors when performing two fillet operations on the same solid or when trying to cut through a solid resulted after Fillet or Chamfer was applied:<br />
<br />
<a href="http://3.bp.blogspot.com/-LyKL15vDwvA/Ufe-JZPifSI/AAAAAAAAC2U/m5hht-hX4_A/s1600/cut-after-two-fillet.png" imageanchor="1" ><img border="0" src="http://3.bp.blogspot.com/-LyKL15vDwvA/Ufe-JZPifSI/AAAAAAAAC2U/m5hht-hX4_A/s1600/cut-after-two-fillet.png" /></a><br />
<br />
I've also investigated Split and Combine spline, which in some cases don't have any effect because the coordinate for the mouse position doesn't match the spline nodes, even if the sphere gizmo is highlighted. Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-87030550400136871062013-07-25T06:41:00.001-07:002013-07-25T06:41:08.414-07:00Bug fixesOver the past few days I've worked on fixing some bugs found during testing (some that we had in the previous versions and some new):<br />
- Undo needed to be pressed twice to work<br />
- Undo after cut didn't show the sketch shapes that were used for cut<br />
- After trying to redo when there were no more redo steps, the application sometimes crashed<br />
- Cut to depth with negative values didn't work<br />
- Cut through all for solids resulted in wrong shapes<br />
- Pressing Cancel in the Chamfer window when the chamfer operation wasn't possible caused the selected shape to disappear<br />
<br />
The bug I'm working on now causes some letters to disappear from the hinter text:<br />
<br />
<a href="http://4.bp.blogspot.com/-jI6nOAgXUP4/UfDVMhuFK9I/AAAAAAAAC2A/TvYyr2pBk_M/s1600/missing-letters.png" imageanchor="1" ><img border="0" src="http://4.bp.blogspot.com/-jI6nOAgXUP4/UfDVMhuFK9I/AAAAAAAAC2A/TvYyr2pBk_M/s1600/missing-letters.png" /></a>Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-5934175145234565352013-07-25T00:36:00.000-07:002013-07-25T00:36:01.673-07:00Cut through all fixToday I updated the code for Cut through all to use a vector-based prism to create the object that is used to cut through all the objects on the scene:<br />
<br />
<object width="853" height="480"><param name="movie" value="//www.youtube.com/v/QeqkleFDElM?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/QeqkleFDElM?version=3&hl=en_US" type="application/x-shockwave-flash" width="853" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<br />
The old method, which used a prism built using the direction, with infinite length, caused the Occ operation of cut to fail in some cases (without an error), so I've replaced it with the equivalent of a mid-plane prism with a big depth. Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-11407366691730924612013-07-11T06:45:00.001-07:002013-07-11T06:45:29.641-07:00Interface changes and Cut Through All bugI've updated the interface to eliminate the black overlay problem mentioned in the previous post and this is how the current interface looks like:<br />
<br />
<a href="http://3.bp.blogspot.com/-M1VKj-CWENs/Ud61qB0Ll0I/AAAAAAAAC1g/hBlfIJecmCI/s1600/new-interface.png" imageanchor="1" ><img border="0" src="http://3.bp.blogspot.com/-M1VKj-CWENs/Ud61qB0Ll0I/AAAAAAAAC1g/hBlfIJecmCI/s1000/new-interface.png" /></a><br />
<br />
I also updated the installer to use the new dlls added to OpenCascade 6.5.5 and checked that everything works correctly after installation.<br />
<br />
Cut through all and Cut to depth work in most cases, with Redo and Undo functionality. The bug I'm working on now is when the cutting sketch contains a circle - in this case, the cutting is not performed. Cutting with complex shapes, on planes that aren't parallel to xOy or through solids works correctly:<br />
<br />
<a href="http://4.bp.blogspot.com/-4xDomfekWnw/Ud62uDs2F6I/AAAAAAAAC1s/819mB1f30hQ/s1600/cut-through-all.png" imageanchor="1" ><img border="0" src="http://4.bp.blogspot.com/-4xDomfekWnw/Ud62uDs2F6I/AAAAAAAAC1s/819mB1f30hQ/s400/cut-through-all.png" /></a><br />
<br />
The Cut to depth tool works correctly in all tested cases, including cutting with a circle.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-31049683861058059192013-07-04T06:37:00.000-07:002013-07-04T06:37:26.963-07:00Display fix for Splines and 3D solidsToday I fixed the display issues for coordinates and Hinter messages for the three types of splines and the 3D solids:<br />
<br />
<a href="http://4.bp.blogspot.com/-7tHkbRuTItI/UdV44m8IwcI/AAAAAAAAC08/ZJaJ2-HfSaM/s685/spline-coord.png" imageanchor="1" ><img border="0" src="http://4.bp.blogspot.com/-7tHkbRuTItI/UdV44m8IwcI/AAAAAAAAC08/ZJaJ2-HfSaM/s685/spline-coord.png" /></a><br />
<br />
I've also updated the property grids for some of the tools, removing the property lock icon for the ellipse tool and 3D solids. The locking wasn't correct because the underlying constraints are not implemented and after applying the lock it wasn't possible to remove it anymore. I will add them and the needed constraints when I work on improving the tools. <br />
<br />
The next issue to be solved is another display issue which sometimes causes a part of the layout to be black instead of transparent:<br />
<br />
<a href="http://1.bp.blogspot.com/-jkwxeBAVXf0/UdV6GFx02tI/AAAAAAAAC1M/6QCX-FachfA/s784/black-bg.png" imageanchor="1" ><img border="0" src="http://1.bp.blogspot.com/-jkwxeBAVXf0/UdV6GFx02tI/AAAAAAAAC1M/6QCX-FachfA/s784/black-bg.png" /></a><br />
<br />
<br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-82432303417379281832013-06-28T05:59:00.000-07:002013-06-28T06:11:18.690-07:00Wrappers updated to Occ version 6.5.5Today I finished updating the wrappers to version 6.5.5. We decided to update to this version rather than 6.6.0 because the newest version has many changes and some issues that aren't yet resolved, with few bug fixes added from 6.5.5. <br />
<br />
I started testing Naro and there are some issues that were fixed and some issues that we didn't have before. We can now display the parallel and perpendicular hinter images and spline editing works correctly, but there are problems when displaying text and coordinates:<br />
<br />
<a href="http://3.bp.blogspot.com/-JAeYcJ5Oprs/Uc2HRwZ3mJI/AAAAAAAAC0g/zMR4F6qCEvc/s776/line-constraints-on-scene.png" imageanchor="1" ><img border="0" src="http://3.bp.blogspot.com/-JAeYcJ5Oprs/Uc2HRwZ3mJI/AAAAAAAAC0g/zMR4F6qCEvc/s776/line-constraints-on-scene.png" /></a><br />
<br />
<object width="853" height="480"><param name="movie" value="//www.youtube.com/v/1uD_bgRTOZQ?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="//www.youtube.com/v/1uD_bgRTOZQ?version=3&hl=en_US" type="application/x-shockwave-flash" width="853" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<br />
Other tested features that work correctly:<br />
* extrude and cut<br />
* pipe<br />
* array pattern <br />
* circular pattern (with improvements for processing speed)<br />
* 3D fillet on straight and curved edges (there seems to be an improvement in the way the edge is detected for complex shapes)<br />
* boolean operations: fuse, intersect, substract<br />
* translate 3D shapes<br />
* dimension for line and circle<br />
* 3D <br />
* mirror point and mirror line<br />
* adding constraints and solving the sketch<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-33592849537799041512013-06-21T06:34:00.000-07:002013-06-21T06:34:48.049-07:00Investigating the 6.6.0 crashesAfter the changes for the NaroOccCore.dll were done, I updated the code for the main Naro project - everything compiles and the application starts, quickly crashing with an error about 'NaroOccCore.dll' not being found. This is a frequent error and it can mean not only that the dll wasn't found, but that there was an error loading one of the dlls that is referenced from it.<br />
<br />
One of the best tools to investigate this is the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Process Monitor</a>, but unfortunately it didn't report any missing dll. All dlls it tried to load were eventually found in one of the paths set in the environment variables and the file was loaded:<br />
<br />
<a href="http://4.bp.blogspot.com/-uG89QMY9-f8/UcRTjxJiJUI/AAAAAAAAC0E/RdkJHtxuUqQ/s1600/procmon.png" imageanchor="1" ><img border="0" src="http://4.bp.blogspot.com/-uG89QMY9-f8/UcRTjxJiJUI/AAAAAAAAC0E/RdkJHtxuUqQ/s1600/procmon.png" /></a><br />
<br />
Before the program crashed, all files were loaded and there were no files that weren't found. <br />
The next tool I used was <a href="http://www.dependencywalker.com/">Depency Walker</a> (the 32-bit version, as NaroOccCore.dll is built for Win32) and this is the result:<br />
<br />
<a href="http://1.bp.blogspot.com/-0C9v9CUx6GQ/UcRTj2sn5MI/AAAAAAAAC0A/aW-6cgp1fcQ/s1600/depends.png" imageanchor="1" ><img border="0" src="http://1.bp.blogspot.com/-0C9v9CUx6GQ/UcRTj2sn5MI/AAAAAAAAC0A/aW-6cgp1fcQ/s1600/depends.png" /></a><br />
<br />
I have rebuilt TKernel.dll and am now using dumpbin (though the Visual Studio Command Prompt) to analyze the exports and check why we have the dll errors. Only TKernell has such errors, but contains the main classes and most other dlls reference it.<br />
<br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-88867185007447394072013-06-13T06:14:00.000-07:002013-06-13T06:14:28.007-07:00Updating to OpenCASCADE 6.6.0The past two weeks I worked on updating the code for the newest version of OpenCASCADE, version 6.6.0. Today I completed the update for the wrapper generator and compiled NaroOccCore and NaroCppCore for this version and started updating Naro.<br />
<br />
The changes for the wrappers are the addition of new classes needed for compilation, the removal of classes that we used and aren't included in the new version and updating the methods in the classes that remained mostly unchanged. <br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-54402767315800143882013-05-30T02:18:00.003-07:002013-05-30T02:18:33.146-07:00Released NaroCAD 1.7.7 BetaToday we released NaroCAD 1.7.7 Beta, for which we implemented the automatic wrapper generator and generated and fixed a new wrapper set using PInvoke for OpenCascade 6.3.0. <br />
<br />
You can download it <a href="http://www.narocad.com/">here</a>.<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-9981295688679099972013-05-23T06:21:00.001-07:002013-05-23T06:21:35.350-07:00Code commited and bug fixesToday I commited the code changes done since I started working on the new wrappers. You can find them <a href="http://narocad.hg.sourceforge.net/hgweb/narocad/roxf/">here</a>.<br />
<br />
I've also completed a first version of the Test cases document, which is published on the narocad.com website <a herf="http://narocad.com/test-cases/">here</a>.<br />
<br />
I fixed some bugs I found for the Pipe Tool and will continue fixing some of the top priority bugs before we release a new version of Naro.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-79577562999898750592013-05-17T06:05:00.000-07:002013-05-17T06:05:42.347-07:00Working version with the new wrappersYesterday I finished the changes for the new wrappers and we have a working version of Naro, using the new wrappers. I've tested it in Release mode and also as an installed application. I fixed some of the bugs and am working on fixing the others, and aside from some small speed issues, the application behaves as it did before the wrappers port.<br />
<br />
I am working on a test plan that will include all the cases I mentioned in the previous post, as well as everything I added during today's testing and I will post it when it's done.<br />
<br />
<object width="853" height="480"><param name="movie" value="http://www.youtube.com/v/6R1frelEgGs?hl=en_US&version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/6R1frelEgGs?hl=en_US&version=3" type="application/x-shockwave-flash" width="853" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-27873874003930978552013-05-13T06:21:00.003-07:002013-05-13T06:21:35.915-07:00Fix for Release differences and testingToday we found the cause for the differences we had between Release and Debug builds, the Optimization property value set in NaroOccCore.vcproj. The Debug value was set to 4 and the Release to 2. Changing it to 4 in Release caused the .dll to be slightly bigger, but the behavior was correct and the methods returned correct values.<br />
<br />
After making these changes, I tested the Release version of the application and the following operations and tools were ok:<br />
- Extrude on default sketch, on sketch created on the face on an extruded shape and on sketch shape resulted after Trim<br />
- Cut through all - through one extruded solid and through two superimposed extruded solids<br />
- Cut to depth<br />
- Array pattern with a 3D shape and a solid resulted after two extrudes and one cut through all<br />
- Circular pattern with a 3D shape<br />
- Basic Hinter and Solver logic<br />
- Trim <br />
- Draw 3D shapes <br />
- Revolve line around line<br />
- Fillet and Chamfer 2D and 3D<br />
- New file, Save and Open saved file<br />
- Dimension<br />
- Arc (SER and CSE)<br />
- Fuse, Intersect and Substract extruded solids<br />
- Undo and Redo<br />
<br />
There are still some problems with the selection of the drawn shapes and solids - the program crashes in IdentifyShapesUnderMouse.<br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-5391999676129506022013-04-23T06:30:00.001-07:002013-04-23T06:30:50.253-07:00Extrude fixes for Release modeOver the past few days I investigated the issues we have with release mode and found that in some cases, in release mode, the IsNull property of a TopoDS_Shape was true, even if the shape was valid and the other properties were correct. Another property that had wrong values was context.HasOpenedContext.<br />
<br />
Here is a short demo with Extrude performed on complex shapes, ran in Release mode:<br />
<br />
<object width="640" height="480"><param name="movie" value="http://www.youtube.com/v/8LXYqWv9NZM?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8LXYqWv9NZM?version=3&hl=en_US" type="application/x-shockwave-flash" width="640" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<br />
The next issue to fix is the selection: when selecting a circle in release mode, the center point is returned as selected - this could be because the Context's selection is wrongly set, or the comparison method is incorrect.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-82754008881119600712013-04-17T04:57:00.002-07:002013-04-17T04:57:44.266-07:00Code changes integration finished and demoYesterday I finished the integration of code changes up to NaroCAD 1.7.6 into the solution containing the new wrappers and today I started testing.<br />
The application works well in Debug mode, but there is a bug causing selection not to work in Release mode. Here is a small demo ran in Debug mode:<br />
<br />
<object width="640" height="480"><param name="movie" value="http://www.youtube.com/v/vSJ9R86jE50?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/vSJ9R86jE50?version=3&hl=en_US" type="application/x-shockwave-flash" width="640" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
<br />
I will continue investigating the cause for the differences between Release and Debug mode and test it to make sure that the new version has the same functionality as 1.7.6.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-79679282862151884502013-04-10T06:24:00.000-07:002013-04-10T06:24:45.829-07:00NaroHost improvementsToday I worked on improving NaroHost and including the additional scripts I used into it, so there'll be fewer steps when we want to generate new wrappers. I also set the main structure for a tutorial on how to generate new wrappers, which will be published when all the code changes are done. Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-82838770299567739972013-04-08T05:20:00.002-07:002013-04-08T05:20:28.895-07:00New wrappers built successfullyToday I successfully built the new wrappers in Debug and Release mode, ran NaroCAD using these new wrappers without crashes, and created the installer and ran it:<br />
<br />
<iframe width="640" height="480" src="http://www.youtube.com/embed/Mt4zNe35aYE" frameborder="0" allowfullscreen></iframe><br />
<br />
and here is the Process Explorer view, where we can check that no debug dlls are used:<br />
<br />
<a href="http://2.bp.blogspot.com/-OOZFcTnEghA/UWK1jaFjEfI/AAAAAAAACys/NoPOKUN8jDc/s1600/naro-new-wrappers.png" imageanchor="1" ><img border="0" src="http://2.bp.blogspot.com/-OOZFcTnEghA/UWK1jaFjEfI/AAAAAAAACys/NoPOKUN8jDc/s1600/naro-new-wrappers.png" /></a><br />
<br />
The next step is to clean up the generation code, include all the external scripts I used into NaroHost and prepare a tutorial on how to generate the wrappers and how to add new wrappers.<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-41520446775823308772013-04-03T06:15:00.002-07:002013-04-03T06:19:00.181-07:00Building wrapper on old .api fileOver the past few days I've tried to build the NaroOccCore.dll file using the files generated by the old OccWrappers.api file, to make sure that the base classes used by Naro are correct and that the build process is correct, and when I have an identical .dll file, build from that to create the new .dll file.<br />
<br />
Unfortunately, even if the built dll file seems to be the same as the one found in the repository, there are some differences that cause it to crash.<br />
<br />
Things I checked:<br />
<br />
- the exports from both files using dumpbin: /exports, /imports and /dependents and they are the same, only the /rawdata results are different. <br />
- the other files are the same and that replacing only the dll file causes the application to work correctly or crash, depending on the dll version. <br />
- other versions of the code from different revisions, to make sure there weren't any changes that were used when building, but were commited later<br />
- other branches for changes that weren't added to the main branch<br />
- Qt version and install<br />
<br />
I am now checking if there are differences in the compile options or other settings that might have remained uncommited. <br />
<br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-85545257334787974722013-03-21T07:23:00.001-07:002013-03-21T07:23:22.643-07:00UpdateI did some more checks to find the causes for the crashes and one of the things I checked was the way the instances were created and deleted:<br />
- there are no Dtor calls on instances that weren't created before<br />
- there is not more than one Dtor call for the same instance<br />
- for the program crashes during a Dtor call, the instance hand't been deleted before <br />
<br />
There were situations when I drew as much as possible without the application becoming too slow, and there were no crashes. <br />
<br />
I built the dlls in Release mode (I installed Qt version 4.7.3 from <a href="ftp://ftp.qt-project.org/qt/source/">here: qt-win-opensource-4.7.3-vs2008.exe </a> and fixed some wrong settings in the NaroOccCore project file) and created the installer for this version of Naro. The resulting file is slightly smaller than the one built with the old wrappers. Enter Sketch doesn't work on the installed Naro, I'll fix the bug and start testing the new wrapper functionality in the installed version, as well. The good news is that the dlls are built correctly and there are no calls to VS2008-dependent dlls as it was when we previously built Naro with these wrappers.<br />
<br />
I also tried to improve the way 'const' in being handled in the generation code - I kept the other fixes and changed only the const keyword, but there were crashes after drawing one circle. I will continue investigating this. <br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-69615864773181459572013-03-19T07:47:00.002-07:002013-03-19T07:47:36.459-07:00Improvements to the new wrappersThis week I started working on fixing the new wrappers crashes in Naro.<br />
<br />
The things I checked were:<br />
- base class destructor calls - made some changes to NativeInstance.cs and updated some of the destructors to have try/catch blocks. <br />
- base class destructors in .cpp - changed StandardTransient.cpp and MMgtTShared.cpp destructor methods to cast the passed instance to the base class instead of the Handle_ class<br />
- checked that the OCC classes implemented the correct base classes<br />
- updated some methods and constructors and added the const keyword<br />
<br />
These changes caused the crashes to appear much later and in other methods (I've enabled debugging in the .cpp files) and it's now possible to draw many shapes:<br />
<br />
<a href="http://3.bp.blogspot.com/-gdpST7gZNCc/UUh52nU2RqI/AAAAAAAACyc/_FtuT6ODLeQ/s1600/new-wrappers-sample.png" imageanchor="1" ><img border="0" src="http://3.bp.blogspot.com/-gdpST7gZNCc/UUh52nU2RqI/AAAAAAAACyc/_FtuT6ODLeQ/s1600/new-wrappers-sample.png" /></a><br />
<br />
I will continue investigating the reasons for the crashes and find a way to automate the manual changes I've done to the code over the past two days.<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-32249023646852664232013-03-15T06:48:00.001-07:002013-03-15T06:48:34.261-07:00Update and new DLLsToday I managed to build the NaroHost solution without errors, so now I have both new DLLs in the Debug version: NaroOccCore.dll is 887 KB and NaroCppCore.dll is 1,85 MB. <br />
I've started testing Naro with these files (using the 3242 changeset) and it crashes after some shapes are drawn. I've tested Sketch creation and drawing circles, lines, rectangles and arcs. Next week I'll work on finding and fixing the cause of the crashes.<br />
<br />
The last steps for making NaroOccCore.dll build were:<br />
- improved the Generator to handle the string return type and convert it to Standard_CString and convert IntPtr to void*<br />
- improved the IsHandle method to process other classes correctly<br />
- fixed the .api template for empty constructors<br />
- added handling for some strange cases in Open Cascade when setters and getters were returning different types<br />
<br />
After generating the new .api file and running ApiWrappers for it, the generated files were correct and there were no errors, but when trying to build NaroHost again, using those files (to generate NaroOccWrappers.dll) there were several errors. The fixes for these were:<br />
- commenting some variables in Extrema_FuncExtPS.hxx and Extrema_PCFOfEPCOfExtPC.hxx (they aren't used by the code, but we get 'error C2248: cannot access private member declared in class 'TColStd_SequenceOfReal'' if we build with them uncommented).<br />
- adding the IsSameTransient method - this isn't part of the OpenCascade Standard package, so it isn't generated - I've added the code from source control, changeset 3242<br />
- adding casts in 3 files where the proper overload couldn't be resolved<br />
<br />
<br />
Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-80295177882181483132013-03-01T07:07:00.001-08:002013-03-01T07:10:33.616-08:00Xml file generation almost doneThis week I improved the XML generation code (the resulting files are .api - the same as the old OccWrapper.api file) and the conversion program to:<br />
* have better output for the templates <br />
* convert types<br />
* merge all generated files per package (will merge into one file eventually, but it's easier to check everything if they're split)<br />
* add IsRef attributes<br />
* parse methods and transform them into properties, with the corresponding XML attributes and children <br />
* handle static methods and properties<br />
<br />
With these changes, the NaroHost program doesn't need any changes - the .api file that it receives as input is correctly formatted and it can generate all the files as before. I've also created a little program that compares the files NaroHost generates using the old and new .api files (for now only the resulting .cs files) - since the new .api files cover all OpenCASCADE methods and classes, we have extra methods and new files and a regular line by line comparison wouldn't work. My tool splits the file in methods and DllImports and compares these, and for the .gp package, the results are good, with only two types of differences: <br />
* the old code generated only getters or setters for some properties and the new one sometimes generates both. I will need to refine the code to cover these cases, as well <br />
* empty Constructors were added when the old .xml file didn't have any parameterless constructors. If the new one adds constructors with no parameters, those aren't added anymore<br />
<br />
The time needed run OCWrappersExt, the conversion program and NaroHost is under 10 minutes.<br />
<br />
On Monday I will continue checking the .cpp and .h files and check the other packages.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-18603728795871488112013-02-26T04:12:00.001-08:002013-02-26T04:12:39.662-08:00Wrappers updateThis week I continued working on the xml generating code and now all the methods, constructors and enums are translated to the format used in the api files. There were some extra packages needed to run aside from the ones specified on the website (will update the information there when I finish generating the wrappers, to make sure everything is ok). The command I used was:<br />
<br />
-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 Dico MoniTool LibCtl Interface Transfer IFSelect XSControl StepBasic StepData StepGeom StepShape StepRepr StepVisual StepAP203 StepAP214 STEPConstruct TransferBRep STEPControl BRepMesh BRepExtrema BRepGProp ShapeExtend ShapeAnalysis BRepCheck<br />
<br />
This added some new classes that we didn't have at all, many of them related to Step. The run time was not affected by the newly added packages.<br />
There are 177 packages used by the old OccWrappers.api and 205 packages we need to parse in order to export the xml files for these. I wrote a LinqPAD program to check that all the required packages were exported and another program to concatenate the classes into one file for each package. <br />
<br />
The next step is loading these partial files in the NaroHost solution and checking that the translation was done correctly. Aside from loading the xml files, it will transform the C++ types to the types used in C# and do the Setter/Getter transformation. After the check is finished, I will incorporate the test programs in the NaroHost solutions so that the checks and file merges are done automatically.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0tag:blogger.com,1999:blog-5209110565444405198.post-35635475589111927942013-02-22T06:46:00.002-08:002013-02-22T06:48:54.776-08:00First version of the cdl-generated xml fileHere is the first version of the xml code I got from updating the cdl parser in OcWrappers (.api file on the left, generated code on the right):<br />
<br />
<a href="http://2.bp.blogspot.com/-ag2BpZUdUNA/USeFTbXM4FI/AAAAAAAACyI/oKx9kJ8o9lU/s1600/api-xml-generation-1.png" imageanchor="1" ><img border="0" src="http://2.bp.blogspot.com/-ag2BpZUdUNA/USeFTbXM4FI/AAAAAAAACyI/oKx9kJ8o9lU/s1600/api-xml-generation-1.png" /></a><br />
<br />
The code was generated using .edl templates and the same code that is currently used to generate the .cpp and .h files, which means that changes are easy to make, propagate automatically to all classes and the new files can be obtained quickly. I've run the parser for all the packages, all classes and all methods in OpenCascade 6.3.0 and the files were generated in 1 minute and 30 seconds.<br />
<br />
Next week I'll change the templates for constructors, destructors and properties and 'translate' the parameter types to the types used in C#. After these are done, I will check to make sure that the templates are correct for all classes used in Naro.Roxhttp://www.blogger.com/profile/15255582430291356137noreply@blogger.com0