|GTS Library Reference Manual|
GTS uses a simple object system implemented in C which allows all the basic paradigms of object-oriented programming: inheritance of class members and virtual functions overloading in particular.
The class hierarchy is implemented via a hierarchy of nested C structs and type casting. In order to avoid "wild" type casts between objects belonging to incompatible classes, type casting is done through macros which check if the conversion is valid. This type checking is however relatively expensive and can be disabled on production code by omitting the GTS_CHECK_CASTS define at compile time.
The basic geometrical objects of GTS do not have any support for attributes such as color, texture coordinates, material properties etc... which may be of interest when using GTS for graphical applications. This choice was made on purpose in order to keep GTS as general as possible. Using object inheritance it should however be easy to extend the base classes to fit your personal needs.
When destroying geometrical objects you must keep in mind their geometrical relationships. Destroying a vertex also destroys all the edges using this particular vertex, destroying an edge destroys the triangles. Vertices, edges or faces not used by any segment, triangle or surface respectively are considered to be "floating" objects. When initially created all vertices, edges or faces are floating. Destroying a segment, triangle or surface will cause the destruction of any new floating vertex, edge or face.
|<<< Miscellaneous macros and functions||Object class >>>|