libopencad
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CADFile Class Referenceabstract

The abstact CAD file class. More...

#include <cadfile.h>

Inheritance diagram for CADFile:
DWGFileR2000

Public Types

enum  OpenOptions { READ_ALL, READ_FAST, READ_FASTEST }
 The CAD file open options enum. More...
 

Public Member Functions

 CADFile (CADFileIO *poFileIO)
 
const CADHeadergetHeader () const
 
const CADClassesgetClasses () const
 
const CADTablesgetTables () const
 
virtual int parseFile (enum OpenOptions eOptions)
 
virtual size_t getLayersCount () const
 
virtual CADLayergetLayer (size_t index)
 

Protected Member Functions

virtual CADObjectgetObject (long index, bool bHandlesOnly=false)=0
 Get CAD Object from file. More...
 
virtual CADGeometrygetGeometry (long index)=0
 read geometry from CAD file More...
 
virtual int readSectionLocator ()=0
 initially read some basic values and section locator More...
 
virtual int readHeader (enum OpenOptions eOptions)=0
 Read header from CAD file. More...
 
virtual int readClasses (enum OpenOptions eOptions)=0
 Read classes from CAD file. More...
 
virtual int createFileMap ()=0
 Create the file map for fast access to CAD objects. More...
 
virtual int readTables (enum OpenOptions eOptions)
 Read tables from CAD file. More...
 

Protected Attributes

CADFileIOfileIO
 
CADHeader header
 
CADClasses classes
 
CADTables tables
 
std::map< long, long > objectsMap
 

Friends

class CADTables
 
class CADLayer
 

Detailed Description

The abstact CAD file class.

Member Enumeration Documentation

The CAD file open options enum.

Enumerator
READ_ALL 

read all available information

READ_FAST 

read some methadata

READ_FASTEST 

read only geometry and layers

Member Function Documentation

virtual int CADFile::createFileMap ( )
protectedpure virtual

Create the file map for fast access to CAD objects.

Returns
CADErrorCodes::SUCCESS if OK, or error code

Implemented in DWGFileR2000.

virtual CADGeometry* CADFile::getGeometry ( long  index)
protectedpure virtual

read geometry from CAD file

Parameters
handleHandle of CAD object
Returns
NULL if failed or pointer which mast be feed by user

Implemented in DWGFileR2000.

virtual CADObject* CADFile::getObject ( long  index,
bool  bHandlesOnly = false 
)
protectedpure virtual

Get CAD Object from file.

Parameters
indexObject index
bHandlesOnlyset TRUE if object data should be skipped, and only object handles should be read.
Returns
pointer to CADObject or nullptr. User have to free returned pointer.

Implemented in DWGFileR2000.

virtual int CADFile::readClasses ( enum OpenOptions  eOptions)
protectedpure virtual

Read classes from CAD file.

Parameters
eOptionsRead options
Returns
CADErrorCodes::SUCCESS if OK, or error code

Implemented in DWGFileR2000.

virtual int CADFile::readHeader ( enum OpenOptions  eOptions)
protectedpure virtual

Read header from CAD file.

Parameters
eOptionsRead options
Returns
CADErrorCodes::SUCCESS if OK, or error code

Implemented in DWGFileR2000.

virtual int CADFile::readSectionLocator ( )
protectedpure virtual

initially read some basic values and section locator

Returns
CADErrorCodes::SUCCESS if OK, or error code

Implemented in DWGFileR2000.

int CADFile::readTables ( enum OpenOptions  eOptions)
protectedvirtual

Read tables from CAD file.

Parameters
eOptionsRead options
Returns
CADErrorCodes::SUCCESS if OK, or error code

The documentation for this class was generated from the following files: