I'm looking for the fastest way to send CGAL's geometry between processes (C++). Lets assume, that we have 2 processes - A and B. Process A is generating geometry and process B is displaying it. I want to connect them in the fastest awailable way. The geometry is of CGALs Polyhedron type.
I know I can use shared memory, but then I've got some problems:
- When I want to copy geometry from process A to shared memory I can use streaming Polyhedron to/from OFF format, but I’m not interested in it, because conversion to this format is too slow for my purpose.
- I can create shared memory and use "placement new" to create my object in shared memory and overcome the overhead of streaming and conversion, but then I have no further control of memory allocation by internal Polyhedron functions. (For example when adding new vertex with Polyhedron_incremental_builder_3 I can’t specify where exactly in the memory it should be placed – I can just call B.add_vertex( Point( 0, 0, 0)); and memory allocation is handled in that method internally)
Is there any way to create object in a specific place in shared memory and ensure, that it and its dynamic structures will "live" in this memory?
Or maybe there’s another fast way of sharing dynamic data (ie. Halfedge structures) between two processes?
HalfedgeDSclass and provide your custom allocator as template argument. As far as I know it's also possible to rebind defaultCGAL_ALLOCATOR(int)with your own. Unfortunately, I don't have more knowledge on it. I would be thankful if somebody could tell more in this matter.. - user1913403