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

UnaryOp Class Reference

#include <UnaryOp.h>

Inheritance diagram for UnaryOp:

Inheritance graph
[legend]
Collaboration diagram for UnaryOp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UnaryOp ()
 Default constructor.

virtual int qlen ()
 qlen Automatically returns total qlen of children.

virtual void _setq (double *q)
 _setq Automatically sets q of children.

virtual void getq (double *q)
 getq Automatically gets q of children.

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

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

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

virtual Box3d grad (Box< double > x)
virtual IMatrix3d hess (Box< double > x)
virtual void procq (gmVector3 x, double *q)
 procq Automatically computes df/dq of children.

virtual void getqname (char **qn)
 Automatically fills qn with operand parameter names.

virtual bool setChild (int index, Implicit *child)
 Sets one of the operands of this operation.

virtual ImplicitgetChild (int index)
 Get the specified child.

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

virtual int numChildren ()
 Number of children currently defined.


Protected Attributes

Implicitm_f
 Surface on which to operate.


Constructor & Destructor Documentation

UnaryOp::UnaryOp  )  [inline]
 

Default constructor.

Sets m_f to NULL.

Definition at line 22 of file UnaryOp.h.

References m_f.


Member Function Documentation

virtual void UnaryOp::_setq double *  q  )  [inline, virtual]
 

_setq Automatically sets q of children.

Does not need to be overridden if op has no parameters. Can be called from subclasses to handle children.

Reimplemented from Implicit.

Reimplemented in ADF, Blinn, Wyvill, Mover, and Offset.

Definition at line 34 of file UnaryOp.h.

References Implicit::_setq(), and m_f.

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

Get the specified child.

Parameters:
index the operand to get (either 0, or 1)
Returns:
child[index].

Reimplemented from Implicit.

Definition at line 34 of file UnaryOp.cpp.

References m_f.

virtual void UnaryOp::getq double *  q  )  [inline, virtual]
 

getq Automatically gets q of children.

Does not need to be overridden if op has no parameters. Can be called from subclasses to handle children.

Reimplemented from Implicit.

Reimplemented in ADF, Blinn, Wyvill, Mover, and Offset.

Definition at line 40 of file UnaryOp.h.

References Implicit::getq(), and m_f.

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

Automatically fills qn with operand parameter names.

UnaryOp's with no parameters need not redefine getqname(). UnaryOp's with parameters should set the names of only their parameters and then call UnaryOp::getqname(qn) to let it set its operand's parameters.

Reimplemented from Implicit.

Reimplemented in ADF, Blinn, Wyvill, Mover, and Offset.

Definition at line 51 of file UnaryOp.cpp.

References Surface::getObjectName(), Implicit::getqname(), m_f, Surface::name(), Implicit::qlen(), and qlen().

Referenced by Offset::getqname(), and ADF::getqname().

virtual Box3d UnaryOp::grad Box< double >  x  )  [inline, virtual]
 

Reimplemented from Implicit.

Reimplemented in Blob, Complement, Mover, and Offset.

Definition at line 53 of file UnaryOp.h.

References Implicit::grad(), and m_f.

virtual gmVector3 UnaryOp::grad gmVector3  x  )  [inline, virtual]
 

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 from Implicit.

Reimplemented in Blob, Complement, Mover, and Offset.

Definition at line 45 of file UnaryOp.h.

References Implicit::grad(), and m_f.

virtual IMatrix3d UnaryOp::hess Box< double >  x  )  [inline, virtual]
 

Reimplemented from Implicit.

Reimplemented in Blob, Complement, Mover, and Offset.

Definition at line 55 of file UnaryOp.h.

References Implicit::hess(), and m_f.

virtual gmMatrix3 UnaryOp::hess gmVector3  x  )  [inline, virtual]
 

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 from Implicit.

Reimplemented in Blob, Complement, Mover, and Offset.

Definition at line 47 of file UnaryOp.h.

References Implicit::hess(), and m_f.

virtual int UnaryOp::maxChildren  )  [inline, virtual]
 

Max number of children that can be defined.

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

Reimplemented from Implicit.

Definition at line 79 of file UnaryOp.h.

int UnaryOp::numChildren  )  [virtual]
 

Number of children currently defined.

Reimplemented from Implicit.

Definition at line 42 of file UnaryOp.cpp.

References m_f.

virtual Intervald UnaryOp::proc Box< double >  x  )  [inline, 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 from Implicit.

Reimplemented in ADF, Blob, Complement, Mover, and Offset.

Definition at line 51 of file UnaryOp.h.

References Intervald, m_f, and Implicit::proc().

virtual double UnaryOp::proc gmVector3  x  )  [inline, virtual]
 

Implements Implicit.

Reimplemented in ADF, Blob, Complement, Mover, and Offset.

Definition at line 43 of file UnaryOp.h.

References m_f, and Implicit::proc().

virtual void UnaryOp::procq gmVector3  x,
double *  q
[inline, virtual]
 

procq Automatically computes df/dq of children.

Does not need to be overridden if op has no parameters. Can be called from subclasses to handle children.

Reimplemented from Implicit.

Reimplemented in ADF, Blinn, Wyvill, Complement, Mover, and Offset.

Definition at line 62 of file UnaryOp.h.

References m_f, Implicit::procq(), and qlen().

virtual int UnaryOp::qlen void   )  [inline, virtual]
 

qlen Automatically returns total qlen of children.

Does not need to be overridden if op has no parameters. Can be called from subclasses to handle children.

Reimplemented from Implicit.

Reimplemented in ADF, Blinn, Wyvill, Mover, and Offset.

Definition at line 28 of file UnaryOp.h.

References m_f, and Implicit::qlen().

Referenced by getqname(), and procq().

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

Sets one of the operands of this operation.

Parameters:
index the operand to set (either 0, or 1)
child What to set the operand to.
Returns:
False if there are not exactly 2 children in the vector.

Reimplemented from Implicit.

Definition at line 16 of file UnaryOp.cpp.

References m_f.


Member Data Documentation

Implicit* UnaryOp::m_f [protected]
 

Surface on which to operate.

Definition at line 16 of file UnaryOp.h.

Referenced by Wyvill::_setq(), _setq(), Offset::_setq(), Blinn::_setq(), ADF::_setq(), ADF::ADF(), Complement::Complement(), ADF::createADF(), ADF::get_sample(), getChild(), Wyvill::getq(), getq(), Offset::getq(), Blinn::getq(), ADF::getq(), Wyvill::getqname(), getqname(), Blinn::getqname(), grad(), Offset::grad(), Mover::grad(), Complement::grad(), Blob::grad(), Offset::gradt(), hess(), Offset::hess(), Mover::hess(), Complement::hess(), Blob::hess(), Mover::impdiff(), Wyvill::init(), Offset::init(), Blinn::init(), Mover::Mover(), numChildren(), proc(), Offset::proc(), Mover::proc(), Complement::proc(), Blob::proc(), ADF::proc(), Wyvill::procq(), procq(), Offset::procq(), Mover::procq(), Complement::procq(), Blinn::procq(), ADF::procq(), Offset::proct(), Wyvill::qlen(), qlen(), Offset::qlen(), Blinn::qlen(), ADF::qlen(), setChild(), Mover::solve(), and UnaryOp().


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