CSolver(3U) | InterViews Reference Manual | CSolver(3U) |
CSolver - enforces connector semantics
#include <Unidraw/csolver.h>
A CSolver object defines and implements a model for specifying connectivity semantics that connector subclasses can build upon to implement their specialized semantics. Normally, only one CSolver instance is used per application, and only connector subclasses need access it. The Unidraw class constructor initializes the csolver global to point to a CSolver instance it creates. Thus applications should not instantiate CSolver directly.
CSolver models a connection between two connectors (regardless of their particular subclass or semantics) as a pair of generic connectors with a piece of CGlue interposed. The CGlue characterizes the relationship between the connectors' centers in terms of a natural size (which corresponds to the distance between the centers), elasticity, and deformation limits. Connector subclasses specify their connectivity behavior with a CGlue instance and subsequently rely on the CSolver to reorient them to conform to that behavior. For example, when a pin is told to connect itself to another pin, it registers with the global csolver a connection containing the two connectors (the pins themselves) and a piece of CGlue having zero natural size, elasticity, and deformation limits. This specification effectively constrains the connectors' centers to coincide. The connectivity semantics of other connector combinations, including those involving application-specific connectors, must be specified using CGlue.
Catalog(3U), GGlue(3U), Connector(3U), globals(3U)
20 November 1990 | Unidraw |