I'm currently doing a project that involves reading a DXF file and drawing its contents using openGL. The reading part is almost done since dxflib does all the parsing for me however the writing part seems that it will take more time though I need clarification on this.
Basically, one feature of the program is to read a DXF file and draw the contents on a plane as if the DXF file is set as a texture to the plane. After that the user can add cameras to the plane including each of their viewing frustum (this is one of the features of the program and the cameras and their viewing frustum are rendered as simple boxes and cones respectively) and then later export to DXF. When I export it back to DXF I just want to add the cameras and their frustums (as rectangle and triangles) into the DXF file and keep the rest of the file the same
. After reading the writing tutorial from the site (http://www.ribbonsoft.com/doc/dxflib/2. ... iting.html
), it seems that I have to set all the data i.e. headers, tables, layers as if I'm doing it from an empty DXF file.
So if I just want to "modify" an existing DXF file, I would have to do it in the following order:
1.) Read its contents via DL_Dxf::in and parse EVERY information (basically implementing all its virtual functions so I can copy every data)
2.) Create a new DXF file using DL_Dxf::out and get a DL_WriterA object.
3.) Write all data starting from the header until the entities section which I have parsed in step 1
It really seems tedious if all you want is just to "modify" an existing DXF file. Is this the only way to do it?
I would appreciate it if someone can enlighten me on this.
Thank you very much.