Wired2Code

Just another WordPress.com site

DrawGin, 06.01.2011 status

The DrawGin library is rapidly taking shape and able to read most sections of an AutoCAD R14 formatted drawing. The next section to code up is the area where AcDbObject and AcDbEntity derived objects are stored (section 6 below). For the purpose of deserializing the bit encoded drawing data, sections 1, 2, 3, 4, 5 are completed.

  1. Drawing File Header – Defines where key sections are located within the drawing file.
  2. Preview Image – Bitmap image created when drawing was last saved.
  3. Header Variables – various setting variables associated with the drawing file.
  4. Classes Map – Holds information about various application defined classes that are used (instances of) in the drawing.
  5. Objects Map – Tells the file position of each object stored in the drawing (with AutoCAD object handle)
  6. Objects – The object instances referenced in the Objects Map (these are AcDbObject and AcDbEntity derived).

Most of the drawing format is defined at the bit level, which require special IO routines found in the OcBs directory (OcBitStream). The OcBsStreamIn class handles reading the various bit level data types and keeps track of the running CRC calculation. The stream also has a 4K memory buffer and handles huge 100 meg files, no problem.

Class DwgArchiveIn (will be renamed later to OcBsDwgArchive) is an archive class that will work much like MFC’s CArchive.

Classes in the OcDb represent the various data types that make up a drawing. Most of the classes will have a one-to-one similarity by name to those found in Autodesk’s ObjectARX SDK. At this time DrawGin is not going for ObjectARX compatibility, so member function names and signatures will not be the same.

Future blog entries will delve into the framework and implementation details. For now just wanted to post a quick status update.

June 1, 2011 Posted by | C++ Programming, DrawGin, gcc | , , , , , | Leave a comment