Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Implicit Class Reference

#include <Implicit.h>

Inheritance diagram for Implicit:

Inheritance graph
[legend]
Collaboration diagram for Implicit:

Collaboration graph
[legend]
List of all members.

Detailed Description

The master class of all implicit surfaces.

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.

Subclasses of Implicit need to define the function defining the implicit surface: double proc(gmVector3 x) and should define an interval proc(Box<double> b) as well.

Subclasses also need to maintain their own parameterization, and so need to define the following parameterization interface:

Subclasses should define their own grad(), hess() and procq() methods, though numerical approximations are implemented in Implicit.

Definition at line 146 of file Implicit.h.

Constructors and Destructor

 Implicit ()
 Default Constructor.

 ~Implicit ()
 Destructor.


Evaluation

An implicit is evaluated by calling its proc(x) method which returns the scalar value associated with 3-D point x.

The implicit object itself can be called as a function, via the overloaded parentheses operator.

The function proc() can also be differentiated with respect to x once: grad() or twice: hess(), or with respect to its parameters: procq(). The functions proc() and its derivative grad() can also be differentiated with respect to the Qs over time as procqt() and gradqt() (assuming a linear trajectory between the last two parameter settings over unit time).

virtual double proc (gmVector3 x)=0
virtual Intervald proc (Box< double > b)
 proc returns the evaluation of the function that defines the Implicit surface.

double operator() (gmVector3 x)
 Shortcut evaluator/operator for the proc() of an Implicit.

VIRTUAL_DERIV gmVector3 grad (gmVector3 x)
 grad returns the gradient of the function (proc()) for a point or region.

VIRTUAL_DERIV gmMatrix3 hess (gmVector3 x)
 hess returns the Hessian of the function (proc()) for a point or region.

Intervald operator() (Box< double > b)
 Shortcut evaluator/operator for the proc() of an Implicit.

virtual Box3d grad (Box< double > x)
virtual IMatrix3d hess (Box< double > x)
gmVector3 gradGradN2 (gmVector3 &x)
 the gradient of the Norm Squared (gradient)


Differentiation @{

virtual void procq (gmVector3, double *)
 Deriv of func wrt parameters.

void procq (gmVector3, DoubleArray &)
 Evaluation of dFdQ into array.

void procq (gmVector3, DoubleVector &)
 Evaluation of dFdQ into vector.

void procq (gmVector3, TNT::Vector< double > &)
 Eval of dFdQ into TNT.

virtual void procq (Box< double >, Intervald *)
virtual void gradq (Box< double >, Intervald *, Intervald *, Intervald *)
virtual Intervald proct (Box< double >)
 Derivative of function wrt Qs over time.

virtual Box3d gradt (Box< double >)
 Derivative of gradient wrt Qs over time.

virtual void dqtdt (double *)
 Derivative of q(t) wrt t.


Differential Geometry

These members provide a variety of numerical and analytic differential geometry operations and parameters.

They are all defined via proc() and its derivatives.

virtual double lipschitz (Box3d x)
 Lipschitz bound of proc.

void setEpsilon (double epsilon)
 Sets the epsilon used by the numerical differentiation methods for grad() and hess().

gmVector3 normal (gmVector3 x)
 Return the normal of the Implicit function at a point (ie.

gmVector3 tangent (gmVector3 x)
 Returns the tangent of the Implicit function at a point.

gmVector3 binormal (gmVector3 x)
 Returns the binormal of the Implicit function at a point.

double k (gmVector3 x)
 Returns the curvature of the Implicit function at a point.

double gaussianCurvature (gmVector3 x)
 Returns the Gaussian curvature of the Implicit function at a point.

double meanCurvature (gmVector3 x)
 Returns the mean curvature of the Implicit function at a point.


Parameters

Provides a uniform interface to the parameters of all Implicit objects.

Parameters are always maintained as an array of floating point values.

virtual int qlen ()
 Number of implicit model parameters for this implicit object including its children.

virtual int plen ()
 Number of implicit model parameters for this implicit object only, not including its children.

virtual void getq (double *)
 Get copy of the implicit model parameters.

void getq (DoubleArray &)
 Get parameters into a double array.

void getq (DoubleVector &)
 Get parameters into a double vector.

void getq (TNT::Vector< double > &)
 Get parameters into TNT double vector.

virtual void getqold (double *)
 Get the OLD implicit model parameters.

void getqold (DoubleArray &)
 Get OLD parameters into a double array.

void getqold (DoubleVector &)
 Get OLD parameters into a double vector.

void getqold (TNT::Vector< double > &)
 Get OLD parameters into TNT vector.

bool qsChanged (void)
 Is qold different from current Qs?

virtual void _setq (double *)
 Overridden by subclasses to set Qs.

virtual void setq (double *)
 Change the implicit model parameter vector.

void setq (DoubleArray &)
 Set parameters from a double array.

void setq (DoubleVector &)
 Set parameters from a double vector.

void setq (TNT::Vector< double > &)
 Set parameters from TNT double vector.

virtual void getqname (char **qn)
 The name of each parameter.

void getqname (NameVector &)
 Fetches parameter names into a vector.

virtual void interpolate (Particles *ps, std::valarray< bool > flexible)
 Change the implicit to pass through particles.

void allocateQold (void)
 Get memory space for qold "array".

double * qold
 Array to hold "previous" Qs.

bool qsChangedFlag
 Set to true when setq is called.

int qoldsize
 Size of qold "array".


Hierarchy

Implicit objects are often composites of other Implicit objects.

For example, an Implicit might be the blended union of other Implicit primitives.

virtual int numChildren ()
 Number of children currently defined.

virtual int maxChildren ()
 Max number of children that can be defined.

virtual bool setChildren (std::vector< Implicit * >)
 If Implicit has any.

virtual bool setChild (int index, Implicit *child)
 If Implicit has children, sets the child specified by index.

virtual void getChildren (std::vector< Implicit * > &)
 If Implicit has any.

virtual ImplicitgetChild (int index)
 Get the specified child.

virtual const char ** getPixmapXPM (const int &size) const
 Returns the Pixmap for the Surface as a char* in the XPM image format.

gmVector4 color
 Holds the color of the implicit object.


Interrogation

Polygonizes the Implicit into the mesh stored in Surface::m_mesh

char * polygonize (double size, int bounds, gmVector3 x, int(*triproc)(int, int, int, jbVertices))
 Polygonizes the Implicit into the mesh stored in Surface::m_mesh.

char * marchingcubes (double size, gmVector3 x0, gmVector3 x1, int(*triproc)(int, int, int, jbVertices))
 Polygonizes specifically using marching cubes.

double area ()
 Determines the surface area of the Implicit.


Derivative Helpers

double Fx (gmVector3 x)
double Fy (gmVector3 x)
double Fz (gmVector3 x)
double Fxx (gmVector3 x)
double Fxy (gmVector3 x)
double Fxz (gmVector3 x)
double Fyx (gmVector3 x)
double Fyy (gmVector3 x)
double Fyz (gmVector3 x)
double Fzx (gmVector3 x)
double Fzy (gmVector3 x)
double Fzz (gmVector3 x)
Intervald Fx (Box< double >)
Intervald Fy (Box< double >)
Intervald Fz (Box< double >)
Intervald Fxx (Box< double >)
Intervald Fxy (Box< double >)
Intervald Fxz (Box< double >)
Intervald Fyx (Box< double >)
Intervald Fyy (Box< double >)
Intervald Fyz (Box< double >)
Intervald Fzx (Box< double >)
Intervald Fzy (Box< double >)
Intervald Fzz (Box< double >)
double m_epsilon
 Used for numerical derivative approximations.


Constructor & Destructor Documentation

Implicit::Implicit  ) 
 

Default Constructor.

Definition at line 51 of file Implicit.cpp.

References m_epsilon, qold, qoldsize, and qsChangedFlag.

Implicit::~Implicit  ) 
 

Destructor.

Definition at line 61 of file Implicit.cpp.

References qold.


Member Function Documentation

void Implicit::_setq double *   )  [virtual]
 

Overridden by subclasses to set Qs.

_setq() is called directly only in subclasses of Implicit. Outside the Implicit class hierarchy, always call setq(). So, if you want to save the old set of Qs, a subclass should override _setq(). In fact, the default _setq() in Implicit does nothing, so you have to override it to do the work of setting the current Q array. However, on the off chance you have a subclass where you do not want to save the old Qs, then override setq() to do the work of settings the current Qs. Typically you will want to save the old Qs so subclasses will usually override (and call) _setq().

Reimplemented in ADF, Algebraic, Blinn, Wyvill, Plane, Point, Segment, Sphere, BinaryOp, Blend, ImpList, Mover, Offset, Subtraction, UnaryOp, and RBFInterpolant.

Definition at line 1012 of file Implicit.cpp.

Referenced by Wyvill::_setq(), UnaryOp::_setq(), Offset::_setq(), Blinn::_setq(), Blend::_setq(), BinaryOp::_setq(), ADF::_setq(), Mover::impdiff(), procq(), and setq().

void Implicit::allocateQold void   )  [private]
 

Get memory space for qold "array".

This method is called by setq(double*) to allocate memory for qold AND set the value of qoldsize. This is necessary because some of the implicits change the size of their Qs during runtime. For example, Intersection initially has 0 Qs. When one child is set, then it has a qlen of that child. When both children are set, it has a qlen of the sum of the qlens of the children. We need to reallocate memory for qold when this happens.

Definition at line 927 of file Implicit.cpp.

References qlen(), qold, and qoldsize.

Referenced by setq().

double Implicit::area  )  [inline]
 

Determines the surface area of the Implicit.

For now, -1 means area cannot be calculated.

Returns:
-1 if area cannot be calculated
Todo:
implement this

Reimplemented in Sphere.

Definition at line 330 of file Implicit.h.

gmVector3 Implicit::binormal gmVector3  x  ) 
 

Returns the binormal of the Implicit function at a point.

Parameters:
x a point in space
Returns:
(0,0,0)
Todo:
implement

Definition at line 434 of file Implicit.cpp.

void Implicit::dqtdt double *  dq  )  [protected, virtual]
 

Derivative of q(t) wrt t.

This is used for 4D critical point finding. The implicit's Qs change from qold[i] (at t = 0) to q[i] (at t = 1). So, using a LRP, we get q(t)[i] = t * (q[i] - qold[i]) + qold[i]. Taking the derivative wrt t, we are left with q[i] - qold[i]. This is what gets returned in the passed-in array (pointer). Note that you must allocate memory for dq before calling this method.

Parameters:
dq The returned array of (q_curr[i] - q_prev[i]).
Note:
This method is called by proct() and gradt(). It's probably not needed by anything else.

Definition at line 378 of file Implicit.cpp.

References getq(), getqold(), and qlen().

Referenced by gradt(), and proct().

Intervald Implicit::Fx Box< double >   )  [protected]
 

Definition at line 524 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fx gmVector3  x  )  [protected]
 

Definition at line 506 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by Fxy(), Fxz(), gaussianCurvature(), grad(), gradGradN2(), and meanCurvature().

Intervald Implicit::Fxx Box< double >   )  [protected]
 

Definition at line 566 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fxx gmVector3  x  )  [protected]
 

Definition at line 547 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

Intervald Implicit::Fxy Box< double >   )  [protected]
 

Definition at line 575 of file Implicit.cpp.

References Fx(), Intervald, and m_epsilon.

double Implicit::Fxy gmVector3  x  )  [protected]
 

Definition at line 554 of file Implicit.cpp.

References Fx(), and m_epsilon.

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

Intervald Implicit::Fxz Box< double >   )  [protected]
 

Definition at line 581 of file Implicit.cpp.

References Fx(), Intervald, and m_epsilon.

double Implicit::Fxz gmVector3  x  )  [protected]
 

Definition at line 560 of file Implicit.cpp.

References Fx(), and m_epsilon.

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

Intervald Implicit::Fy Box< double >   )  [protected]
 

Definition at line 530 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fy gmVector3  x  )  [protected]
 

Definition at line 512 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by Fyx(), Fyz(), gaussianCurvature(), grad(), gradGradN2(), and meanCurvature().

Intervald Implicit::Fyx Box< double >   )  [protected]
 

Definition at line 611 of file Implicit.cpp.

References Fy(), Intervald, and m_epsilon.

double Implicit::Fyx gmVector3  x  )  [protected]
 

Definition at line 592 of file Implicit.cpp.

References Fy(), and m_epsilon.

Referenced by hess().

Intervald Implicit::Fyy Box< double >   )  [protected]
 

Definition at line 617 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fyy gmVector3  x  )  [protected]
 

Definition at line 598 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

Intervald Implicit::Fyz Box< double >   )  [protected]
 

Definition at line 626 of file Implicit.cpp.

References Fy(), Intervald, and m_epsilon.

double Implicit::Fyz gmVector3  x  )  [protected]
 

Definition at line 605 of file Implicit.cpp.

References Fy(), and m_epsilon.

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

Intervald Implicit::Fz Box< double >   )  [protected]
 

Definition at line 536 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fz gmVector3  x  )  [protected]
 

Definition at line 518 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by Fzx(), Fzy(), gaussianCurvature(), grad(), gradGradN2(), and meanCurvature().

Intervald Implicit::Fzx Box< double >   )  [protected]
 

Definition at line 656 of file Implicit.cpp.

References Fz(), Intervald, and m_epsilon.

double Implicit::Fzx gmVector3  x  )  [protected]
 

Definition at line 637 of file Implicit.cpp.

References Fz(), and m_epsilon.

Referenced by hess().

Intervald Implicit::Fzy Box< double >   )  [protected]
 

Definition at line 662 of file Implicit.cpp.

References Fz(), Intervald, and m_epsilon.

double Implicit::Fzy gmVector3  x  )  [protected]
 

Definition at line 643 of file Implicit.cpp.

References Fz(), and m_epsilon.

Referenced by hess().

Intervald Implicit::Fzz Box< double >   )  [protected]
 

Definition at line 668 of file Implicit.cpp.

References Intervald, m_epsilon, and proc().

double Implicit::Fzz gmVector3  x  )  [protected]
 

Definition at line 649 of file Implicit.cpp.

References m_epsilon, and proc().

Referenced by gaussianCurvature(), gradGradN2(), hess(), and meanCurvature().

double Implicit::gaussianCurvature gmVector3  x  ) 
 

Returns the Gaussian curvature of the Implicit function at a point.

Parameters:
x a point in space
Returns:
0
Todo:
implement

Definition at line 459 of file Implicit.cpp.

References Fx(), Fxx(), Fxy(), Fxz(), Fy(), Fyy(), Fyz(), Fz(), and Fzz().

Referenced by ParticleShaderCurvature::drawShape(), SurfacePropagation::speed(), and RBFPropagation::speed().

Implicit * Implicit::getChild int  index  )  [virtual]
 

Get the specified child.

Parameters:
index The index of the child to return
Returns:
NULL if no children or child[index]
Note:
Needs to be overridden.

Reimplemented in BinaryOp, ImpList, and UnaryOp.

Definition at line 1209 of file Implicit.cpp.

Referenced by getChildren().

void Implicit::getChildren std::vector< Implicit * > &  children  )  [virtual]
 

If Implicit has any.

This is a convenience function that will return all of the Implicit's children into a vector. Subclasses shouldn't need to overwrite this function as it simply uses getChild.

Parameters:
children The vector to put all the children into.
See also:
getChild(int)

Definition at line 1222 of file Implicit.cpp.

References getChild(), and maxChildren().

Referenced by plen(), and ImpFileManager::writeImplicit().

const char ** Implicit::getPixmapXPM const int &  size  )  const [virtual]
 

Returns the Pixmap for the Surface as a char* in the XPM image format.

This is a icon that can be used to represent the implicit in a GUI environment.

Reimplemented in Cone, Cylinder, Ellipsoid, Torus, Blob, Plane, Sphere, and Offset.

Definition at line 1232 of file Implicit.cpp.

void Implicit::getq TNT::Vector< double > &  q  ) 
 

Get parameters into TNT double vector.

Parameters:
q TNT::Vector<double> for parameters.

Definition at line 814 of file Implicit.cpp.

References getq(), and qlen().

void Implicit::getq DoubleVector q  ) 
 

Get parameters into a double vector.

Parameters:
q DoubleVector for parameters.

Definition at line 800 of file Implicit.cpp.

References DoubleVector, getq(), and qlen().

void Implicit::getq DoubleArray q  ) 
 

Get parameters into a double array.

Parameters:
q DoubleArray for parameters.

Definition at line 788 of file Implicit.cpp.

References DoubleArray, getq(), and qlen().

void Implicit::getq double *  q  )  [virtual]
 

Get copy of the implicit model parameters.

Parameters:
A pointer to the array to be returned.

Reimplemented in ADF, Algebraic, Blinn, Wyvill, Plane, Point, Segment, Sphere, BinaryOp, Blend, ImpList, Mover, Offset, Subtraction, UnaryOp, and RBFInterpolant.

Definition at line 780 of file Implicit.cpp.

Referenced by SurfacePropagation::applyConstraint(), dqtdt(), Wyvill::getq(), UnaryOp::getq(), Offset::getq(), getq(), Blinn::getq(), Blend::getq(), BinaryOp::getq(), ADF::getq(), Mover::impdiff(), interpolate(), procq(), setq(), Mover::solve(), and ImpFileManager::writeImplicit().

void Implicit::getqname NameVector names  ) 
 

Fetches parameter names into a vector.

Parameters:
names Vector of names to update.

Definition at line 748 of file Implicit.cpp.

References getqname(), NameVector, and qlen().

void Implicit::getqname char **  qn  )  [virtual]
 

The name of each parameter.

The names of the parameters of the function (if any) are put into an array which gets returned.

Parameters:
qn An array of size qlen of strings listing names of parameters

Reimplemented in ADF, Algebraic, Blinn, Wyvill, Plane, Point, Segment, Sphere, BinaryOp, Blend, ImpList, Mover, Offset, Subtraction, UnaryOp, and RBFInterpolant.

Definition at line 740 of file Implicit.cpp.

Referenced by Wyvill::getqname(), UnaryOp::getqname(), getqname(), Blinn::getqname(), Blend::getqname(), and BinaryOp::getqname().

void Implicit::getqold TNT::Vector< double > &  q  ) 
 

Get OLD parameters into TNT vector.

Parameters:
q TNT::Vector<double> for parameters.

Definition at line 861 of file Implicit.cpp.

References getqold(), and qlen().

void Implicit::getqold DoubleVector q  ) 
 

Get OLD parameters into a double vector.

Parameters:
q DoubleVector for parameters.

Definition at line 848 of file Implicit.cpp.

References DoubleVector, getqold(), and qlen().

void Implicit::getqold DoubleArray q  ) 
 

Get OLD parameters into a double array.

Parameters:
q DoubleArray for parameters.

Definition at line 836 of file Implicit.cpp.

References DoubleArray, getqold(), and qlen().

void Implicit::getqold double *  q  )  [virtual]
 

Get the OLD implicit model parameters.

Parameters:
A pointer to the array to be returned.

Definition at line 826 of file Implicit.cpp.

References qlen(), and qold.

Referenced by dqtdt(), getqold(), Segment::m_alrp(), Algebraic::m_alrp(), Segment::m_blrp(), Plane::m_dlrp(), Plane::m_nlrp(), Mover::m_olrp(), Offset::m_rdiff(), Sphere::m_rlrp(), and Offset::m_rlrp().

Box3d Implicit::grad Box< double >  x  )  [virtual]
 

Reimplemented in Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, and RBF.

Definition at line 138 of file Implicit.cpp.

References Box< Float >::center(), and grad().

gmVector3 Implicit::grad gmVector3  x  ) 
 

grad returns the gradient of the function (proc()) for a point or region.

Basically, the gradient returns a vector of partial derivatives, or more formally grad(proc()) = (dproc/dx,dproc/dy,dproc/dz).

Note:
Unless grad is overwritten, it defaults to the numerical approximation of the gradient = (proc(x+eps) - proc(x))/eps ...
Parameters:
x Where to evaluate the gradient of the function.
Returns:
The gradient result.
See also:
setEpsilon(double)

Reimplemented in Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, and RBF.

Definition at line 129 of file Implicit.cpp.

References Fx(), Fy(), and Fz().

Referenced by TopologyInterrogator::applyConstraint(), SurfacePropagation::applyConstraint(), SurfaceDeformation::applyConstraint(), SurfaceAdhesion::applyConstraint(), SilhouetteAdhesion::applyForce(), ParticleShaderGradientField::draw(), UnaryOp::grad(), Sum::grad(), Offset::grad(), Mover::grad(), grad(), Difference::grad(), Complement::grad(), Blob::grad(), Blend::grad(), Blob::hess(), Blend::hess(), interpolate(), lipschitz(), NewtonDegenerate::NewtonEquation(), NewtonDegenerate::NewtonSubdivisionBreak(), NewtonCritical::NewtonSubdivisionBreak(), normal(), and Mover::solve().

gmVector3 Implicit::gradGradN2 gmVector3 &  x  ) 
 

the gradient of the Norm Squared (gradient)

Definition at line 679 of file Implicit.cpp.

References Fx(), Fxx(), Fxy(), Fxz(), Fy(), Fyy(), Fyz(), Fz(), and Fzz().

Referenced by SingularityInterrogator::applyForce(), and ParticleShaderTriangle::drawPolygon().

void Implicit::gradq Box< double >  ,
Intervald ,
Intervald ,
Intervald
[virtual]
 

Reimplemented in Algebraic.

Definition at line 278 of file Implicit.cpp.

References Intervald.

Referenced by gradt().

Box3d Implicit::gradt Box< double >   )  [virtual]
 

Derivative of gradient wrt Qs over time.

Assumes a linear interpolation between parameters qold and q over one unit of time. No need to override this method. Instead, override gradq().

Reimplemented in Plane, Segment, Sphere, Mover, and Offset.

Definition at line 336 of file Implicit.cpp.

References dqtdt(), gradq(), Intervald, and qlen().

Referenced by Mover::grad(), Offset::gradt(), and NewtonDegenerate::NewtonEquation().

IMatrix3d Implicit::hess Box< double >  x  )  [virtual]
 

Reimplemented in Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, and RBF.

Definition at line 183 of file Implicit.cpp.

References Box< Float >::center(), and hess().

gmMatrix3 Implicit::hess gmVector3  x  ) 
 

hess returns the Hessian of the function (proc()) for a point or region.

Basically, the Hessian is a matrix of second partial derivatives, or more formally hess(proc()) =

d^2proc/dx^2, d^2proc/dxdy d^2proc/dxdz \ d^2proc/dxdy, d^2proc/dy^2 d^2proc/dydz \ d^2proc/dxdz, d^2proc/dydz d^2proc/dz^2

Note:
Unless hess is overwritten, it defaults to the numerical approximation of the Hessian.
Parameters:
x Where to evaluate the Hessian of the function.
Returns:
The Hessian result.
See also:
setEpsilon(double)
Note:
The Hessian is symmetric for our uses.

Reimplemented in Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, and RBF.

Definition at line 175 of file Implicit.cpp.

References Fxx(), Fxy(), Fxz(), Fyx(), Fyy(), Fyz(), Fzx(), Fzy(), and Fzz().

Referenced by SilhouetteAdhesion::applyForce(), NewtonClassify::classify(), UnaryOp::hess(), Sum::hess(), Offset::hess(), Mover::hess(), hess(), Difference::hess(), Complement::hess(), Blob::hess(), Blend::hess(), NewtonDegenerate::NewtonEquation(), and NewtonCritical::NewtonEquation().

void Implicit::interpolate Particles ps,
std::valarray< bool >  flexible
[virtual]
 

Change the implicit to pass through particles.

Reimplemented in RBF, RBF, RBFInterpolant, and RBF.

Definition at line 1039 of file Implicit.cpp.

References dot(), DoubleArray, Particles::dt, Particles::getAttribute(), ParticlePosition::getPosition(), getq(), grad(), k(), proc(), procq(), qlen(), setq(), Particles::size(), SVD::solve(), solveCholesky(), and ParticleVelocity::v.

Referenced by SurfaceDeformation::applyConstraint().

double Implicit::k gmVector3  x  ) 
 

Returns the curvature of the Implicit function at a point.

Parameters:
x a point in space
Returns:
0
Todo:
implement

Which curvature does k return?

Definition at line 447 of file Implicit.cpp.

Referenced by Mover::impdiff(), Algebraic::initPowerArrays(), interpolate(), and Mover::solve().

double Implicit::lipschitz Box3d  x  )  [virtual]
 

Lipschitz bound of proc.

This is an upper bound on the gradient magnitude.

Parameters:
x Box over which the Lipschitz bound should be computed.
Note:
Functions that are not globally Lipschitz may be Lipschitz over a compact domain. Also a tighter Lipschitz bound might be used depending on the domain.

Definition at line 197 of file Implicit.cpp.

References grad().

char * Implicit::marchingcubes double  size,
gmVector3  x0,
gmVector3  x1,
int(*  triproc)(int, int, int, jbVertices)
 

Polygonizes specifically using marching cubes.

Definition at line 706 of file Implicit.cpp.

References jbProcess::marchingcubes().

int Implicit::maxChildren  )  [virtual]
 

Max number of children that can be defined.

This will return -1 for operators that can have an arbitrary number of operands.

Reimplemented in BinaryOp, ImpList, and UnaryOp.

Definition at line 771 of file Implicit.cpp.

Referenced by getChildren(), and setChildren().

double Implicit::meanCurvature gmVector3  x  ) 
 

Returns the mean curvature of the Implicit function at a point.

Parameters:
x a point in space

Definition at line 478 of file Implicit.cpp.

References Fx(), Fxx(), Fxy(), Fxz(), Fy(), Fyy(), Fyz(), Fz(), and Fzz().

Referenced by RBFPropagation::adaptivity(), ParticleShaderDisk::drawShape(), ParticleShaderCurvature::drawShape(), SurfacePropagation::speed(), and RBFPropagation::speed().

gmVector3 Implicit::normal gmVector3  x  ) 
 

Return the normal of the Implicit function at a point (ie.

the normalized grad()).

Parameters:
x a point in space
Returns:
unit normal at x
Note:
If gradient is zero length, returns (1,0,0).

Reimplemented in TriMesh.

Definition at line 403 of file Implicit.cpp.

References grad().

Referenced by SkinMeshShape::applyForce(), SurfaceAdhesion::particleAdded(), and RBFInterpolant::placeCenters().

int Implicit::numChildren  )  [virtual]
 

Number of children currently defined.

Reimplemented in BinaryOp, ImpList, and UnaryOp.

Definition at line 763 of file Implicit.cpp.

Referenced by setChildren().

Intervald Implicit::operator() Box< double >  b  ) 
 

Shortcut evaluator/operator for the proc() of an Implicit.

Definition at line 98 of file Implicit.cpp.

References Intervald, and proc().

double Implicit::operator() gmVector3  x  ) 
 

Shortcut evaluator/operator for the proc() of an Implicit.

Definition at line 92 of file Implicit.cpp.

References proc().

int Implicit::plen  )  [virtual]
 

Number of implicit model parameters for this implicit object only, not including its children.

Reimplemented in Mover.

Definition at line 714 of file Implicit.cpp.

References getChildren(), and qlen().

Referenced by ImpFileManager::writeImplicit().

char * Implicit::polygonize double  size,
int  bounds,
gmVector3  x,
int(*  triproc)(int, int, int, jbVertices)
 

Polygonizes the Implicit into the mesh stored in Surface::m_mesh.

Definition at line 698 of file Implicit.cpp.

References jbProcess::polygonize().

Intervald Implicit::proc Box< double >  x  )  [virtual]
 

proc returns the evaluation of the function that defines the Implicit surface.

In normal circumstances, the gmVector3 version of proc defaults to a pure virtual function which means that you must define proc(gmVector3) in its subclasses. When INTERVAL_EVAL_ONLY is defined, the Implicit version of proc defaults to a pure virtual function and the gmVector3 version calls the Interval version. Either way, you must define proc() in subclasses of Implicit.

Parameters:
x Where to evaluate the function.
Returns:
The function result. The function is positive outside the surface and negative inside.

Reimplemented in ADF, Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, and RBF.

Definition at line 85 of file Implicit.cpp.

References Box< Float >::center(), Intervald, and proc().

virtual double Implicit::proc gmVector3  x  )  [pure virtual]
 

Implemented in ADF, Algebraic, Blob, Plane, Segment, Sphere, Blend, Complement, Difference, ImpList, Mover, Offset, Subtraction, Sum, UnaryOp, RBF, RBF, RBF, and TriMesh.

Referenced by SurfaceAdhesion::applyConstraint(), SkinMeshShape::applyForce(), jbProcess::converge(), SearchCritical::display(), jbProcess::find(), Fx(), Fxx(), Fy(), Fyy(), Fz(), Fzz(), ADF::get_sample(), Blob::grad(), Blend::grad(), Blob::hess(), Blend::hess(), interpolate(), NewtonDegenerate::NewtonEquation(), NewtonDegenerate::NewtonSubdivisionBreak(), operator()(), UnaryOp::proc(), Sum::proc(), Offset::proc(), Mover::proc(), proc(), Difference::proc(), Complement::proc(), Blob::proc(), Blend::proc(), Wyvill::procq(), procq(), Blinn::procq(), Blend::procq(), jbProcess::setcorner(), and Mover::solve().

void Implicit::procq Box< double >  ,
Intervald
[virtual]
 

Reimplemented in Algebraic.

Definition at line 255 of file Implicit.cpp.

References Intervald.

void Implicit::procq gmVector3  ,
TNT::Vector< double > & 
 

Eval of dFdQ into TNT.

Definition at line 247 of file Implicit.cpp.

References procq(), and qlen().

void Implicit::procq gmVector3  ,
DoubleVector
 

Evaluation of dFdQ into vector.

Definition at line 241 of file Implicit.cpp.

References DoubleVector, and procq().

void Implicit::procq gmVector3  ,
DoubleArray
 

Evaluation of dFdQ into array.

Definition at line 235 of file Implicit.cpp.

References DoubleArray, and procq().

void Implicit::procq gmVector3  ,
double * 
[virtual]
 

Deriv of func wrt parameters.

Reimplemented in ADF, Algebraic, Blinn, Wyvill, Plane, Sphere, BinaryOp, Blend, Complement, Mover, Offset, Subtraction, UnaryOp, and RBFInterpolant.

Definition at line 214 of file Implicit.cpp.

References _setq(), getq(), m_epsilon, proc(), and qlen().

Referenced by SurfacePropagation::applyConstraint(), SurfaceAdhesion::applyConstraint(), Mover::impdiff(), interpolate(), Wyvill::procq(), UnaryOp::procq(), Offset::procq(), procq(), Complement::procq(), Blinn::procq(), Blend::procq(), BinaryOp::procq(), ADF::procq(), proct(), and Mover::solve().

Intervald Implicit::proct Box< double >   )  [virtual]
 

Derivative of function wrt Qs over time.

Assumes a linear interpolation between parameters qold and q over one unit of time. No need to override this method. Instead, override procq().

Reimplemented in Plane, Segment, Sphere, Mover, and Offset.

Definition at line 300 of file Implicit.cpp.

References dqtdt(), Intervald, procq(), and qlen().

Referenced by NewtonDegenerate::NewtonEquation(), and Offset::proct().

int Implicit::qlen  )  [virtual]
 

Number of implicit model parameters for this implicit object including its children.

Reimplemented in ADF, Algebraic, Blinn, Wyvill, Plane, Point, Segment, Sphere, BinaryOp, Blend, ImpList, Mover, Offset, Subtraction, UnaryOp, and RBFInterpolant.

Definition at line 731 of file Implicit.cpp.

Referenced by Wyvill::_setq(), Blinn::_setq(), Blend::_setq(), BinaryOp::_setq(), allocateQold(), SurfacePropagation::applyConstraint(), SurfaceAdhesion::applyConstraint(), SurfaceDeformation::attachAttributes(), dqtdt(), Wyvill::getq(), getq(), Blinn::getq(), Blend::getq(), BinaryOp::getq(), Wyvill::getqname(), UnaryOp::getqname(), getqname(), Blinn::getqname(), Blend::getqname(), BinaryOp::getqname(), getqold(), gradt(), Mover::impdiff(), interpolate(), plen(), Wyvill::procq(), procq(), Complement::procq(), Blinn::procq(), Blend::procq(), BinaryOp::procq(), proct(), Wyvill::qlen(), UnaryOp::qlen(), Offset::qlen(), Blinn::qlen(), Blend::qlen(), BinaryOp::qlen(), ADF::qlen(), ImpFileManager::readImplicit(), setq(), Mover::solve(), and ImpFileManager::writeImplicit().

bool Implicit::qsChanged void   ) 
 

Is qold different from current Qs?

If so, then it returns true and resets the qsChangedFlag to "false". Thus, if you call qsChanged multiple times before you call setq again, qsChanged will return "true" only once. Note that this incorrectly returns "true" if setq() was called with the same set of Qs that were previously stored. Hopefully that won't occur too often.

Returns:
True of the current Qs are different from the previous Qs.

Definition at line 911 of file Implicit.cpp.

References qsChangedFlag.

bool Implicit::setChild int  index,
Implicit child
[virtual]
 

If Implicit has children, sets the child specified by index.

Parameters:
index The index of the child to set.
child The child of this object.
Returns:
False if the child is invalid.
Note:
Needs to be overridden.

Reimplemented in BinaryOp, ImpList, and UnaryOp.

Definition at line 1198 of file Implicit.cpp.

Referenced by setChildren().

bool Implicit::setChildren std::vector< Implicit * >  children  )  [virtual]
 

If Implicit has any.

Parameters:
children The children of this object.
Returns:
False if the child vector is invalid.

Reimplemented in ADF.

Definition at line 1177 of file Implicit.cpp.

References maxChildren(), numChildren(), and setChild().

Referenced by ImpFileManager::readImplicit().

void Implicit::setEpsilon double  epsilon  ) 
 

Sets the epsilon used by the numerical differentiation methods for grad() and hess().

Parameters:
epsilon Size of neighborhood for numerical differentiation

Definition at line 497 of file Implicit.cpp.

References epsilon, and m_epsilon.

void Implicit::setq TNT::Vector< double > &  q  ) 
 

Set parameters from TNT double vector.

Parameters:
q TNT::Vector<double> for parameters.

Definition at line 995 of file Implicit.cpp.

References DoubleVector, qlen(), and setq().

void Implicit::setq DoubleVector q  ) 
 

Set parameters from a double vector.

Parameters:
q DoubleVector of parameters.

Definition at line 981 of file Implicit.cpp.

References DoubleVector, qlen(), and setq().

void Implicit::setq DoubleArray q  ) 
 

Set parameters from a double array.

Parameters:
q DoubleArray of parameters.

Definition at line 969 of file Implicit.cpp.

References DoubleArray, qlen(), and setq().

void Implicit::setq double *  q  )  [virtual]
 

Change the implicit model parameter vector.

This method first saves the last Qs into qold and then calls the object's _setq() to set the current Q array. If you don't need to save the last Qs, then override this method. Otherwise, override _setq() which does the actual work of setting the Q array and doesn't save qold.

Parameters:
A pointer to the array holding the new Qs
See also:
double* qold

_setq(double*)

Definition at line 954 of file Implicit.cpp.

References _setq(), allocateQold(), getq(), qold, and qsChangedFlag.

Referenced by SurfacePropagation::applyConstraint(), interpolate(), ImpFileManager::readImplicit(), setq(), and Mover::solve().

gmVector3 Implicit::tangent gmVector3  x  ) 
 

Returns the tangent of the Implicit function at a point.

Parameters:
x a point in space
Returns:
(0,0,0)
Todo:
implement

How is this tangent vector fixed to a consistent direction?

Definition at line 422 of file Implicit.cpp.


Member Data Documentation

gmVector4 Implicit::color
 

Holds the color of the implicit object.

If alpha is less than one then the color should be alpha*RGB + (1-alpha)*(combination of RGB of children).

Definition at line 311 of file Implicit.h.

double Implicit::m_epsilon [protected]
 

Used for numerical derivative approximations.

Also used for subclass derivative numerical approxations e.g. blend.

See also:
grad, hess

Definition at line 341 of file Implicit.h.

Referenced by Fx(), Fxx(), Fxy(), Fxz(), Fy(), Fyx(), Fyy(), Fyz(), Fz(), Fzx(), Fzy(), Fzz(), Blend::hf(), Blend::hff(), Blend::hfg(), Blend::hg(), Blend::hgg(), Implicit(), procq(), and setEpsilon().

double* Implicit::qold [private]
 

Array to hold "previous" Qs.

The member variable qold gets updated everytime setq is called with the existing parameters that have been replaced by the new parameters from the setq call.

Definition at line 254 of file Implicit.h.

Referenced by allocateQold(), getqold(), Implicit(), setq(), and ~Implicit().

int Implicit::qoldsize [private]
 

Size of qold "array".

Definition at line 256 of file Implicit.h.

Referenced by allocateQold(), and Implicit().

bool Implicit::qsChangedFlag [private]
 

Set to true when setq is called.

Definition at line 255 of file Implicit.h.

Referenced by Implicit(), qsChanged(), and setq().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:02:21 2004 for Advanced Surface Library by doxygen 1.3.4