I was asked to solve the memory usage problem of a CAD application written in Visual C ++, which occurs when I try to export a drawing to PDF3D.
The export function works well for simple models or only parts of a complex model, but not for the entire complex model.
We use the sourceforge U3D project to create a U3D object; after we paste it into the pdf. This is the problem of creating an object that is problematic.
The sourceforge U3D project is a library built into C ++ for use in C ++ too, which has been dead since 2007, has poor documentation, and its collection of samples is far from enough! The TODO list of the project also indicates that it has memory problems!
So, I was asked to attack the problem with two sides:
They also said that side 2. is preferable since it is under our control.
When I tried to solve the problem, I got two conclusions:
I highly suspect that the U3D EncodeX method is responsible for misuse of memory.
I tried a lot of little things changes for how apllication interacts with lib (changing compression parameters, flags, etc.), and each time the result was a memory reallocation.
So the question is: is it worth continuing to use this library? The code is not happy to read ... Or maybe it would be nice to look at other libraries for the same purpose? I have not studied them, but I am seriously thinking about switching to VCGlib or libharu ... please offer something else if you know this is good.
Other alternatives would be: to use the Visual Technologies PDF3D exporter, which has unacceptable costs, or to develop my own implementation of the U3D exporter, which will have disadvantages as a very limited set of U3D functions, and also it could not prepare for the expected deadline. Therefore, prohibit these options.
I really need help deciding which is better.
Thanks in advance, SΓ©rgio