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

Blend Class Reference

#include <Blend.h>

Inheritance diagram for Blend:

Inheritance graph
[legend]
Collaboration diagram for Blend:

Collaboration graph
[legend]
List of all members.

Detailed Description

Blend is an abstract class designed to support a variety of blending operation.

The main functionality of blend is the definition of the method h(f,g) which is a real function of two real variables f and g which are the values of the two implicits to blend.

Definition at line 21 of file Blend.h.

Public Member Functions

 Blend ()
 Constructors.

 Blend (Implicit *, Implicit *)
 Constructor with two Implicits.

virtual double h (double f, double g)=0
 The function h merges the value of the two implicits to blend.

virtual Intervald h (Intervald f, Intervald g)=0
virtual double hf (double f, double g)
 dh/df Defaults to a numerical approximation.

virtual Intervald hf (Intervald f, Intervald g)
virtual double hg (double f, double g)
 dh/dg Defaults to a numerical approximation.

virtual Intervald hg (Intervald f, Intervald g)
virtual double hff (double f, double g)
 d^2h/df^2 Defaults to a numerical approximation.

virtual Intervald hff (Intervald f, Intervald g)
virtual double hgg (double f, double g)
 d^2h/dg^2 Defaults to a numerical approximation.

virtual Intervald hgg (Intervald f, Intervald g)
virtual double hfg (double f, double g)
 d^2h/dfdg Defaults to a numerical approximation.

virtual Intervald hfg (Intervald f, Intervald g)
virtual double hr1 (double f, double g)
 dh/dr1 The derivative of h wrt the first radius.

virtual Intervald hr1 (Intervald f, Intervald g)
virtual double hr2 (double f, double g)
 dh/dr2 The derivative of h wrt the second radius.

virtual Intervald hr2 (Intervald f, Intervald g)
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 >)
 proc returns the evaluation of the function that defines the Implicit surface.

virtual Box3d grad (Box< double >)
virtual IMatrix3d hess (Box< double >)
virtual void _setq (double *q)
 setq Automatically sets q of children.

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

virtual void procq (gmVector3 x, double *q)
 procq Automatically computes df/dq of children.

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

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


Public Attributes

double m_r1
double m_r2

Private Member Functions

void init (Implicit *, Implicit *)
 Called by the various constructors to allow for a single location for the init of a Sphere object.


Constructor & Destructor Documentation

Blend::Blend  ) 
 

Constructors.

Definition at line 18 of file Blend.cpp.

References init().

Blend::Blend Implicit f,
Implicit g
 

Constructor with two Implicits.

Definition at line 27 of file Blend.cpp.

References init().


Member Function Documentation

void Blend::_setq double *  q  )  [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 BinaryOp.

Reimplemented in Subtraction.

Definition at line 114 of file Blend.cpp.

References Implicit::_setq(), BinaryOp::m_f, BinaryOp::m_g, m_r1, m_r2, and Implicit::qlen().

Referenced by Subtraction::_setq().

void Blend::getq double *  q  )  [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 BinaryOp.

Reimplemented in Subtraction.

Definition at line 126 of file Blend.cpp.

References Implicit::getq(), BinaryOp::m_f, BinaryOp::m_g, m_r1, m_r2, and Implicit::qlen().

Referenced by Subtraction::getq().

void Blend::getqname char **  name  )  [virtual]
 

Automatically fills qn with operands parameter names.

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

Reimplemented from BinaryOp.

Reimplemented in Subtraction.

Definition at line 150 of file Blend.cpp.

References Implicit::getqname(), BinaryOp::m_f, BinaryOp::m_g, and Implicit::qlen().

Referenced by Subtraction::getqname().

Box3d Blend::grad Box< double >   )  [virtual]
 

Reimplemented from Implicit.

Reimplemented in Subtraction.

Definition at line 82 of file Blend.cpp.

References Implicit::grad(), hf(), hg(), Intervald, BinaryOp::m_f, BinaryOp::m_g, and Implicit::proc().

gmVector3 Blend::grad gmVector3  x  )  [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 Subtraction.

Definition at line 41 of file Blend.cpp.

References Implicit::grad(), hf(), hg(), BinaryOp::m_f, BinaryOp::m_g, and Implicit::proc().

Referenced by Subtraction::grad().

virtual Intervald Blend::h Intervald  f,
Intervald  g
[pure virtual]
 

Implemented in AIntersection, ASubtraction, AUnion, and RFunction.

virtual double Blend::h double  f,
double  g
[pure virtual]
 

The function h merges the value of the two implicits to blend.

New blends need only implement h and its derivatives.

f,g The values of the two implicits.

Returns:
The value of the blend of the two implicits.

Implemented in AIntersection, ASubtraction, AUnion, and RFunction.

Referenced by hf(), hg(), and proc().

IMatrix3d Blend::hess Box< double >   )  [virtual]
 

Reimplemented from Implicit.

Reimplemented in Subtraction.

Definition at line 94 of file Blend.cpp.

References Implicit::grad(), Implicit::hess(), hf(), hff(), hfg(), hg(), hgg(), Intervald, BinaryOp::m_f, BinaryOp::m_g, outer(), and Implicit::proc().

gmMatrix3 Blend::hess gmVector3  x  )  [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 Subtraction.

Definition at line 53 of file Blend.cpp.

References Implicit::grad(), Implicit::hess(), hf(), hff(), hfg(), hg(), hgg(), BinaryOp::m_f, BinaryOp::m_g, outer(), and Implicit::proc().

Referenced by Subtraction::hess().

virtual Intervald Blend::hf Intervald  f,
Intervald  g
[inline, virtual]
 

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 47 of file Blend.h.

References h(), Intervald, and Implicit::m_epsilon.

virtual double Blend::hf double  f,
double  g
[inline, virtual]
 

dh/df Defaults to a numerical approximation.

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 45 of file Blend.h.

References h(), and Implicit::m_epsilon.

Referenced by grad(), hess(), hff(), and hgg().

virtual Intervald Blend::hff Intervald  f,
Intervald  g
[inline, virtual]
 

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 63 of file Blend.h.

References hf(), Intervald, and Implicit::m_epsilon.

virtual double Blend::hff double  f,
double  g
[inline, virtual]
 

d^2h/df^2 Defaults to a numerical approximation.

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 61 of file Blend.h.

References hf(), and Implicit::m_epsilon.

Referenced by hess().

virtual Intervald Blend::hfg Intervald  f,
Intervald  g
[inline, virtual]
 

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 79 of file Blend.h.

References hg(), Intervald, and Implicit::m_epsilon.

virtual double Blend::hfg double  f,
double  g
[inline, virtual]
 

d^2h/dfdg Defaults to a numerical approximation.

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 77 of file Blend.h.

References hg(), and Implicit::m_epsilon.

Referenced by hess().

virtual Intervald Blend::hg Intervald  f,
Intervald  g
[inline, virtual]
 

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 55 of file Blend.h.

References h(), Intervald, and Implicit::m_epsilon.

virtual double Blend::hg double  f,
double  g
[inline, virtual]
 

dh/dg Defaults to a numerical approximation.

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 53 of file Blend.h.

References h(), and Implicit::m_epsilon.

Referenced by grad(), hess(), and hfg().

virtual Intervald Blend::hgg Intervald  f,
Intervald  g
[inline, virtual]
 

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 71 of file Blend.h.

References hf(), Intervald, and Implicit::m_epsilon.

virtual double Blend::hgg double  f,
double  g
[inline, virtual]
 

d^2h/dg^2 Defaults to a numerical approximation.

Reimplemented in AIntersection, ASubtraction, AUnion, and RFunction.

Definition at line 69 of file Blend.h.

References hf(), and Implicit::m_epsilon.

Referenced by hess().

virtual Intervald Blend::hr1 Intervald  f,
Intervald  g
[inline, virtual]
 

Definition at line 86 of file Blend.h.

References Intervald.

virtual double Blend::hr1 double  f,
double  g
[inline, virtual]
 

dh/dr1 The derivative of h wrt the first radius.

Defaults to zero since we have no way of knowing.

Definition at line 85 of file Blend.h.

Referenced by procq().

virtual Intervald Blend::hr2 Intervald  f,
Intervald  g
[inline, virtual]
 

Definition at line 92 of file Blend.h.

References Intervald.

virtual double Blend::hr2 double  f,
double  g
[inline, virtual]
 

dh/dr2 The derivative of h wrt the second radius.

Defaults to zero since we have no way of knowing.

Definition at line 91 of file Blend.h.

Referenced by procq().

void Blend::init Implicit f,
Implicit g
[private]
 

Called by the various constructors to allow for a single location for the init of a Sphere object.

Definition at line 7 of file Blend.cpp.

References BinaryOp::m_f, BinaryOp::m_g, m_r1, and m_r2.

Referenced by Blend().

Intervald Blend::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 from Implicit.

Reimplemented in Subtraction.

Definition at line 74 of file Blend.cpp.

References h(), Intervald, BinaryOp::m_f, BinaryOp::m_g, and Implicit::proc().

double Blend::proc gmVector3  x  )  [virtual]
 

Implements Implicit.

Reimplemented in Subtraction.

Definition at line 33 of file Blend.cpp.

References h(), BinaryOp::m_f, BinaryOp::m_g, and Implicit::proc().

Referenced by Subtraction::proc().

void Blend::procq gmVector3  x,
double *  q
[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 BinaryOp.

Reimplemented in Subtraction.

Definition at line 138 of file Blend.cpp.

References hr1(), hr2(), BinaryOp::m_f, BinaryOp::m_g, Implicit::proc(), Implicit::procq(), and Implicit::qlen().

Referenced by Subtraction::procq().

int Blend::qlen void   )  [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 BinaryOp.

Reimplemented in Subtraction.

Definition at line 162 of file Blend.cpp.

References BinaryOp::m_f, BinaryOp::m_g, and Implicit::qlen().

Referenced by Subtraction::qlen().


Member Data Documentation

double Blend::m_r1
 

Definition at line 27 of file Blend.h.

Referenced by _setq(), AIntersection::AIntersection(), AUnion::AUnion(), getq(), AUnion::h(), ASubtraction::h(), AIntersection::h(), AUnion::hf(), ASubtraction::hf(), AIntersection::hf(), AUnion::hff(), ASubtraction::hff(), AIntersection::hff(), AIntersection::hfg(), ASubtraction::hg(), AIntersection::hg(), ASubtraction::hgg(), AIntersection::hgg(), AUnion::indomain(), and init().

double Blend::m_r2
 

Definition at line 27 of file Blend.h.

Referenced by _setq(), AIntersection::AIntersection(), AUnion::AUnion(), getq(), AUnion::h(), ASubtraction::h(), AIntersection::h(), ASubtraction::hf(), AIntersection::hf(), ASubtraction::hff(), AIntersection::hff(), AIntersection::hfg(), AUnion::hg(), ASubtraction::hg(), AIntersection::hg(), AUnion::hgg(), ASubtraction::hgg(), AIntersection::hgg(), AUnion::indomain(), and init().


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