Hi All,
Good work Andrey
I try porting simplecad example to Android (LAMW). It's works, i will send pull request soon
I have a few questions:
1. What is it for:
GetCurrentDrawing^.pObjRoot^.ObjArray.ObjTree.maketreefrom(GetCurrentDrawing^.pObjRoot^.ObjArray, GetCurrentDrawing^.pObjRoot^.vp.BoundingBox, nil);
2. How to transform coordinates between ViewArea (Canvas) and WCS?
3. How to find entity in PTSimpleDrawing based on x, y + search radius?
And some suggestions:
1. FormatEntity should be executed only during Entity.Draw. If there is a very large drawing, after ZoomAll, most small entities are invisible due to the small size, and full Representation is not needed. FormatEntity should be done when the user zooms to it. Of course, first time regen will be longer, but it shouldn't be noticeable. Thanks to this, we get 2 x faster reading of DXF and lower memory requirements (at least at the beginning of work with the drawing).
2. There is a problem with big coordinates, because Representation has Single type.
I changed the GDBFloat to a double and that solved the problem, but I don't know how that might affect the rest of the engine. Maybe it's better to think about some global shift instead?
I also changed to double in TZGLGeneral2DDrawer: sx, sy, tx, ty - this should be neutral.
3. One of the priorities for me is regenerating drawing in the background, not in the main thread. Then the user does not wait for everything to be drawn, but can zoom - regeneration is interrupted and restarted. Thanks to this approach, walking in the drawing is fast, regardless of the size of the drawing and even the performance of the graphics engine.
Android dislikes long operations in the main thread. There is also a big limitation - Synchronize in TThread does not work. I know how to made, but I need ability drawing in fragments or some callback function like OnRegeneratingDrawingProgress ...