Direct Construction
The gp, Geom2d and Geom packages describe elementary data structures of simple geometric objects. The constructors of these objects are elementary: the construction arguments are fields by which the objects are represented in their data structure.
On the other hand, the gce, GCE2d and GC packages provided by the Direct Construction component construct the same types of objects as gp, Geom2d and Geom respectively. However, the former implement geometric construction algorithms that translate the constructor's arguments into the data structure specific to each object.
Algorithms implemented by these packages are simple: there is no creation of objects defined by advanced positional constraints (for more information on this subject, see Geom2dGcc and GccAna which describe geometry by constraints).
gce, GCE2d and GC each offer a series of classes of construction algorithms.
For example, the class gce_MakeCirc provides a framework for:
- defining eight problems encountered in the geometric construction of circles, and
- implementing the eight related construction algorithms.
The object created (or implemented) is an algorithm which can be consulted to find out, in particular:
- its result, which is a gp_Circ, and
- its status. Here, the status indicates whether or not the construction was successful. If it was unsuccessful, the status gives the reason for the failure.
Example
gp_Pnt
P1 (0.,0.,0.);
gp_Pnt P2 (0.,10.,0.);
gp_Pnt P3 (10.,0.,0.);
gce_MakeCirc MC (P1,P2,P3);
if (MC.IsDone()) {
const gp_Circ& C = MC.Value();
}
In addition, gce, GCE2d and GC each have a Root class. This class is the root of all the classes in the package which return a status. The returned status (successful construction or construction error) is described by the enumeration gce_ErrorType.
Note: classes which construct geometric transformations do not return a status, and therefore do not inherit from Root.