The implicit class is a class that represents functions. This class is typically invoked as "Implicit *f" where f is a pointer to some instance of a concrete subclass of Implicit. The function can be evaluated as f->proc(x) or *f(x) where x is a point in space. In this implementation, we define the value of the function to be negative "within" an implicit surface, 0 "on" the surface, and positive "outside" the surface.
Derivatives grad(x) and hess(x) are also available. Some implicits define these analytically, or they may otherwise default to a slower numerical version.
The parameters of each Implicit object are available through a uniform parameter interface:
- int qlen() - the number of parameters
- setq(double *q) - set the parameters from the array q. This also saves a copy of the previous q array for evaluation of the curve over "time". External classes will call this method.
- _setq(double *q) - set the parameters from the array q. This version does not save a copy of the previous q array and should be overridden by most subclasses.
- getq(double *q) - return current parameters in the array q. You are responsible for allocating q. Make sure it is at least qlen() long.
- getqold(double *q) - return the previous parameters of the surface in the array q. You must allocate space for the q array.
- getqname(char **qn) - load an array of strings with names of the parameters. You are responsible for allocating an array of (char *) in qn[]. The Implicit object will allocate the individual strings.
- procq(gmVectro3 x, double *dq) - returns in dq an array of length qlen() the gradient of proc() wrt its parameters, evaluated at the point x.
Interval extensions proc(Box<double> b), grad(Box<double> b) and hess(Box<double> b) (and eventually procq()) should also be available for Implicit objects. Additionally, if you are planning on doing 4D critical point finding, you need to implement procqt() = dproc(X,t)/dq(t) and gradqt = dgrad(X,t)/dq(t).
Some implicit objects are operators on other implicits. The member numChildren() returns the number of children the operator currently has defined, and maxChildren() returns the number of children the operator can handle (-1 if it is unlimited). Children are accessed with getChild()/setChild()/getChildren()/setChildren().
Objects also have a name associated with them, and the name is synthesized uniquely. The name is available via getObjectName() and its variations.
Information about creating a new Implicit object is available in the detailed documentation of the Implicit class.
- Note:
- As of February 3, 2003, you have the option of using a new calling hierarchy for proc, grad, and hess. Previously, you had to define proc, grad, and hess for both gmVector3 and Box3d (and Box4d). If you #define INTERVAL_EVAL_ONLY, all you need to define is proc, grad, and hess for Box<double> and the other (non-interval) methods use these. For example, proc(gmVector3) calls proc(Box<double>) by converting the gmVector to a Box<double>, calling proc(Box<double>), and then returning the center() of the resulting Intervald. If you undefine the compiler option INTERVAL_EVAL_ONLY, you use the old calling hierarchy (assuming that all of the gmVector3 versions of proc, grad, and hess have been maintained to keep equivalent with the Box<double> versions).
Generated on Mon Jun 28 15:03:24 2004 for Advanced Surface Library by
1.3.4