#include <ImpFileManager.h>
It makes use of factories to create objects from file descriptions.
The file manager has a version number and checks this against the version number that appears at the top of .imp files. If the file format ever changes this can be used to read the file properly based on version number.
Usage:
ImpFileManager ifm; // your very own file manager Implicit* surface; // your handy surface pointer
ifm.readFile("surf.imp", surface); // read from file ifm.writeFile("surf.imp", surface); // write to file
You can also leave off the .imp extension and the file manager will add it in automatically.
Definition at line 38 of file ImpFileManager.h.
Public Member Functions | |
| ImpFileManager () | |
| Constructor. | |
| void | setVerbose (int v) |
| Set verbose mode. | |
| bool | readImplicit (std::ifstream &file, Implicit *&object, std::string &name) |
| Read an implicit object from file. | |
| bool | writeImplicit (std::ofstream &file, Implicit *&object, std::string tabs) |
| Write an implicit object to file. | |
| bool | readFile (const std::string &name, Implicit *&surface) |
| Read an implicit surface from file. | |
| bool | readFile (const std::string &name, std::vector< Surface * > &surfaces) |
| Read a group of implicit surfaces from file. | |
| bool | writeFile (const std::string &name, std::vector< Surface * > &surfaces) |
| Write a group of implicit surfaces to file. | |
| bool | writeFile (const std::string &name, Implicit *&surface) |
| Write an implicit surface to file. | |
Private Attributes | |
| const std::string | version |
| Version of this file manager. | |
| const std::string | suffix |
| Implicit file suffix. | |
| int | verbose |
|
|
Constructor.
Definition at line 14 of file ImpFileManager.cpp. |
|
||||||||||||
|
Read a group of implicit surfaces from file.
Definition at line 227 of file ImpFileManager.cpp. References readImplicit(), verbose, and version. |
|
||||||||||||
|
Read an implicit surface from file. Read an implicit surface from file.
Definition at line 177 of file ImpFileManager.cpp. References readImplicit(), surface, verbose, and version. |
|
||||||||||||||||
|
Read an implicit object from file. The format for an object is: name [params] { ... }
Definition at line 29 of file ImpFileManager.cpp. References Algebraic::coefficients(), NEW_IMPLICIT, Implicit::qlen(), Implicit::setChildren(), Implicit::setq(), and verbose. Referenced by readFile(). |
|
|
Set verbose mode.
Definition at line 17 of file ImpFileManager.cpp. References verbose. |
|
||||||||||||
|
Write an implicit surface to file. Write an implicit surface to file.
Definition at line 287 of file ImpFileManager.cpp. References surface, verbose, version, and writeImplicit(). |
|
||||||||||||
|
Write a group of implicit surfaces to file. Writes a set of implicits (a scene) to file.
Definition at line 326 of file ImpFileManager.cpp. References verbose, version, and writeImplicit(). |
|
||||||||||||||||
|
Write an implicit object to file. The format for an object is: name [params] { ... }
Definition at line 127 of file ImpFileManager.cpp. References Implicit::getChildren(), Implicit::getq(), Surface::name(), Implicit::plen(), and Implicit::qlen(). Referenced by writeFile(). |
|
|
Implicit file suffix.
Definition at line 43 of file ImpFileManager.h. |
|
|
Definition at line 45 of file ImpFileManager.h. Referenced by readFile(), readImplicit(), setVerbose(), and writeFile(). |
|
|
Version of this file manager.
Definition at line 42 of file ImpFileManager.h. Referenced by readFile(), and writeFile(). |
1.3.4