Geometric Constraint System

Geometric constraint system is a set of geometric objects and constraints that link these objects. The types of supported geometric objects and constraints are described in items Supported Geometry Types, Types of Geometric Constraints and Dimensions correspondingly. It is assumed that parametric sketch created by the application with all its objects and constraints has its own constraint system. From software engineering viewpoint it means that each parametric sketch is associated with the constraint system using GCE_system descriptor, and each its geometric object and constraint are represented by their unique type descriptors geom_item and constraint_item.

Before proceeding to work with sketch geometric constraints it is required to declare a constraint system for it by calling

GCE_system GCE_CreateSystem().   

The function returns the constraint system as GCE_system descriptor, it is a pointer to internal data structure instance in the geometric solver. All further manipulations with the constraint system will be performed using this descriptor. For example, if you want to declare a point in the sketch, then it is required to call the following function for its constrain system:

geom_item GCE_AddPoint(GCE_system gSys, GCE_point pVal).    

The function returns a descriptor of the geometric point that belongs to the gSys geometric constraint system. The pVal parameter defines the start coordinates of this point <X,Y>.

When you finish to work with the sketch, you should always call the function that deletes the constraint system:

void GCE_RemoveSystem(GCE_system gSys),  

This function completely releases the memory occupied by the constraint system with all object and constraint data. After calling the GCE_RemoveSystem function, the constraint system descriptor becomes invalid, i.e. if you try to use the descriptor then the application can crash.

The function

void GCE_ClearSystem(GCE_system gSys)

clears the constraint system, it deletes objects and constraints only from the memory, but it keeps the constraint system valid for further work.