sgFileManager

 

sgFileManager is a namespace of the functions to save and to load the whole scene and separate objects to files. Besides, it is responsible for either import and export to other formats.

 

You can save your scene to a file and then load it from the file in the following two ways:

 

the first way considers the geometry repetitions, links to font files and to text objects strings - that is why the file itself will be of the minimum size (as far as possible). The structure of this file is the following:

1.A standard header.
2.A user-defined block of data of an arbitrary size.
3.The scene itself saved in the optimal format.

The following functions are responsible for scene saving and loading using the current way:

Save

GetFileHeader

GetUserData

Open

 

The objects saving and loading in the second way is totally the responsibility of the programmer, i.e. he himself develops the file structure. The sgCore library presents two functions - converting an object to a memory block and creating an object from a memory block. I.e. it is for the programmer to decide where to save an object in the file and how to load an object from the file.

 

The following functions are responsible for scene saving and loading using the current way:

ObjectToBitArray

BitArrayToObject

 

 

 

The sgFileManager namespace is defined in sgFileManager.h

 

The sgFileManager namespace functions:

Save

GetFileHeader

GetUserData

Open

ExportDXF

ImportDXF

ObjectToBitArray

BitArrayToObject