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

Offset Class Reference

#include <Offset.h>

Inheritance diagram for Offset:

Inheritance graph
[legend]
Collaboration diagram for Offset:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class defines an offset, which acts as a node in our scene graph.

Any implicit surface can be connected below an Offset node. Functions are provided for evaluating the implicit surface function at a point in space as well as the gradient and Hessian.

The implicit surface function for an offset can be described as:

o(x,y,z) = f(x,y,z) - R

where R is the offset value. Because the R term does not depend on (x,y,z), it will drop out of the gradient, leaving the original surface gradient. The Hessian will also be the original surface Hessian.

Definition at line 27 of file Offset.h.

Public Member Functions

 Offset ()
 Default constructor.

 Offset (Implicit *f, double r)
 Explicit constructor.

virtual double proc (gmVector3 x)
 Evaluation of function.

virtual gmVector3 grad (gmVector3 x)
 Evaluation of gradient.

virtual gmMatrix3 hess (gmVector3 x)
 Evaluation of hessian.

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 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 procq (gmVector3, double *)
 Evaluation of dFdq.

virtual void getq (double *)
 Retreives parameters.

virtual void _setq (double *)
 Assigns parameters.

virtual int qlen ()
 Returns the # of parameters.

virtual void getqname (char **qn)
 Retreives parameter names.

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


Private Member Functions

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

Intervald m_rlrp (Intervald)
 Convenience function for the calculation of a LRP over a time interval for a particular m_r.

double m_rdiff (void)
 Convenience function to calculate the difference between the current Q and the old Q.


Private Attributes

double m_r
 The numerical offset.


Constructor & Destructor Documentation

Offset::Offset  ) 
 

Default constructor.

Definition at line 25 of file Offset.cpp.

References init().

Offset::Offset Implicit f,
double  r
 

Explicit constructor.

Parameters:
f Surface to offset.
r Value of offset.

Definition at line 35 of file Offset.cpp.

References init().


Member Function Documentation

void Offset::_setq double *  q  )  [virtual]
 

Assigns parameters.

Parameters:
q Parameter array.

Reimplemented from UnaryOp.

Definition at line 165 of file Offset.cpp.

References Implicit::_setq(), UnaryOp::m_f, and m_r.

const char ** Offset::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 from Implicit.

Definition at line 210 of file Offset.cpp.

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

Retreives parameters.

Parameters:
q Parameter array.

Reimplemented from UnaryOp.

Definition at line 152 of file Offset.cpp.

References Implicit::getq(), UnaryOp::m_f, and m_r.

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

Retreives parameter names.

Parameters:
qn Paramater name array.

Reimplemented from UnaryOp.

Definition at line 203 of file Offset.cpp.

References UnaryOp::getqname().

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

Reimplemented from UnaryOp.

Definition at line 119 of file Offset.cpp.

References Implicit::grad(), and UnaryOp::m_f.

gmVector3 Offset::grad gmVector3  x  )  [virtual]
 

Evaluation of gradient.

Parameters:
x Point to evaluate at.
Returns:
The gradient at x.

Reimplemented from UnaryOp.

Definition at line 86 of file Offset.cpp.

References Implicit::grad(), and UnaryOp::m_f.

Box3d Offset::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 from Implicit.

Definition at line 143 of file Offset.cpp.

References Implicit::gradt(), and UnaryOp::m_f.

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

Reimplemented from UnaryOp.

Definition at line 124 of file Offset.cpp.

References Implicit::hess(), and UnaryOp::m_f.

gmMatrix3 Offset::hess gmVector3  x  )  [virtual]
 

Evaluation of hessian.

Parameters:
x Point to evaluate at.
Returns:
The Hessian at x.

Reimplemented from UnaryOp.

Definition at line 96 of file Offset.cpp.

References Implicit::hess(), and UnaryOp::m_f.

void Offset::init Implicit f,
double  r
[private]
 

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

Definition at line 16 of file Offset.cpp.

References UnaryOp::m_f, and m_r.

Referenced by Offset().

double Offset::m_rdiff void   )  [private]
 

Convenience function to calculate the difference between the current Q and the old Q.

This is used by proct() and gradt().

Definition at line 60 of file Offset.cpp.

References Implicit::getqold(), m_r, and qlen().

Referenced by proct().

Intervald Offset::m_rlrp Intervald  t  )  [private]
 

Convenience function for the calculation of a LRP over a time interval for a particular m_r.

We use the "current" and the "last" coefficients to calculate an interval of the coefficients over a given time interval. This is used for 4D critical point finding.

Definition at line 46 of file Offset.cpp.

References Implicit::getqold(), Intervald, m_r, and qlen().

Referenced by proc().

Offset::MAKE_NAME  ) 
 

Intervald Offset::proc Box< double >  b  )  [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 UnaryOp.

Definition at line 102 of file Offset.cpp.

References Intervald, UnaryOp::m_f, m_r, m_rlrp(), and Implicit::proc().

double Offset::proc gmVector3  x  )  [virtual]
 

Evaluation of function.

Parameters:
x Point to evaluate at.
Returns:
Function value.

Reimplemented from UnaryOp.

Definition at line 76 of file Offset.cpp.

References UnaryOp::m_f, m_r, and Implicit::proc().

void Offset::procq gmVector3  x,
double *  dfdq
[virtual]
 

Evaluation of dFdq.

Parameters:
x Point to evaluate at.
dfdq Array representing dfdq.

Reimplemented from UnaryOp.

Definition at line 179 of file Offset.cpp.

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

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

Definition at line 129 of file Offset.cpp.

References Intervald, UnaryOp::m_f, m_rdiff(), and Implicit::proct().

int Offset::qlen void   )  [virtual]
 

Returns the # of parameters.

Reimplemented from UnaryOp.

Definition at line 191 of file Offset.cpp.

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

Referenced by m_rdiff(), and m_rlrp().


Member Data Documentation

double Offset::m_r [private]
 

The numerical offset.

Definition at line 30 of file Offset.h.

Referenced by _setq(), getq(), init(), m_rdiff(), m_rlrp(), and proc().


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