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

SearchCritical Class Reference

#include <SearchCritical.h>

Inheritance diagram for SearchCritical:

Inheritance graph
[legend]
Collaboration diagram for SearchCritical:

Collaboration graph
[legend]
List of all members.

Detailed Description

SearchCritical is a wrapper for NewtonCritical to search for critical points.

Simply call the search() method to invoke Newton's method for finding roots. The roots will be stored in the fRoots list (found in Newton.h). You can also print out the found roots to stdout by calling the print() method. Also, since SearchCritical inherits NewtonClassify, you can classify all of the roots found by "search()" and get their eigenvalues and eigenvectors.

Definition at line 27 of file SearchCritical.h.

Public Member Functions

 SearchCritical ()
 Default constructor.

 SearchCritical (Implicit *)
 Constructs an object containing critical points for a given Implicit.

virtual void setSurface (Implicit *)
 Changes the surface to search.

virtual ImplicitgetSurface ()
 Returns the current surface being searched.

void setBoxBounds (double)
 Sets the internal value of the bounds for a cubic box.

void setBoxBounds (Box3d)
 Sets the internal value of the bounds for a Box.

Box3d getBoxBounds ()
 Returns the current bounds for a Box for critical points.

void search ()
 Finds all of the critical points of the given surface.

void classify ()
 Classifies the critical points (eigen vectors/values).

void print ()
 Prints all critical points to stdout.

void display ()
 Displays all critical points in an OpenGL window.


Protected Member Functions

virtual bool NewtonPostProcess (Box< double > &X)
 Overridden NewtonPostProcess method to try to prevent critical sets.


Protected Attributes

Implicitsurface
 Find critical points for this Implicit surface.


Private Member Functions

void saveGLStateVariables ()
 Saves the OpenGL state variables which are changed by display() so they can be restored to their former values.

void restoreGLStateVariables ()
 Restores the previously saved OpenGL state variables which were modified within display().


Private Attributes

Box3d theBoxBounds
GLfloat savedPointSize
GLfloat savedColor [5]
GLboolean lightingOn
int savedfMaxRoots
 If we change fMaxRoots, save the original value for restoration.

double savedfSameTolerance
 If we change fSameTolerance, save the original value for restoration.


Constructor & Destructor Documentation

SearchCritical::SearchCritical  ) 
 

Default constructor.

This method isn't very useful since it sets the surface to be NULL which means that there is no surface for which to find critical points. This is just here so that you can declare a SearchCritical value without having to initialize it at the same time.

Definition at line 16 of file SearchCritical.cpp.

References setSurface().

SearchCritical::SearchCritical Implicit surf  ) 
 

Constructs an object containing critical points for a given Implicit.

You MUST pass in an Implicit surface. This method assumes that you are going to use the standard 3D Newton solver when finding critical points.

Parameters:
surf The implicit surface to be used when finding critical points.

Definition at line 27 of file SearchCritical.cpp.

References CP_CUBE_BOUNDS, setSurface(), surf, and theBoxBounds.


Member Function Documentation

void SearchCritical::classify  ) 
 

Classifies the critical points (eigen vectors/values).

This is simply a convenience method to call classify(fRoots). Make sure that you have actually FOUND the roots before trying to classify them.

See also:
search()

Definition at line 171 of file SearchCritical.cpp.

References NewtonClassify::classify(), Newton::fRoots, and getSurface().

Referenced by CriticalPointInterrogator::findCriticalPoints(), and CriticalMesh::initialMesh().

void SearchCritical::display  ) 
 

Displays all critical points in an OpenGL window.

Definition at line 233 of file SearchCritical.cpp.

References CP_MAX, CP_MIN, CP_POINT_SIZE, CP_SADDLE1, CP_SADDLE2, NewtonClassify::fKinds, Newton::fRoots, getSurface(), Newton::plIter, Implicit::proc(), restoreGLStateVariables(), and saveGLStateVariables().

Box3d SearchCritical::getBoxBounds  ) 
 

Returns the current bounds for a Box for critical points.

Returns:
The critical point bounds for the current Implicit.

Definition at line 89 of file SearchCritical.cpp.

References theBoxBounds.

Referenced by search().

Implicit * SearchCritical::getSurface  )  [virtual]
 

Returns the current surface being searched.

This method is virtual and should be overridden (along with setSurface(Implicit*)) to keep the surface variable consistent.

Returns:
The Implicit surface being searched for critical points.
See also:
setSurface(Implicit*)

Reimplemented from NewtonClassify.

Definition at line 54 of file SearchCritical.cpp.

References surface.

Referenced by classify(), display(), CriticalMesh::initialMesh(), print(), and search().

bool SearchCritical::NewtonPostProcess Box< double > &  X  )  [protected, virtual]
 

Overridden NewtonPostProcess method to try to prevent critical sets.

This is pretty much a hack, but maybe it will help in the long run. We check to see if we have reached the maximum number of roots we want to store. If so, we first increase the size of the interval used for checking to see if two roots are the same, and then we double the number of allowable roots.

Parameters:
X The Box containing the root to process just before we call NewtonOutput().
Returns:
True if the root (Box) is okay and we should call NewtonOutput(). False if you want to throw the Box away.

Reimplemented from Newton.

Definition at line 106 of file SearchCritical.cpp.

References Newton::fMaxRoots, Newton::fRoots, Newton::fSameTolerance, Newton::SameRoot(), savedfMaxRoots, savedfSameTolerance, and X.

void SearchCritical::print  ) 
 

Prints all critical points to stdout.

The first line lists the name of the Implicit object, and subsequent lines list the coordinates of the critical points.

Definition at line 184 of file SearchCritical.cpp.

References Newton::fRoots, Surface::getObjectName(), getSurface(), and Newton::plIter.

void SearchCritical::restoreGLStateVariables  )  [private]
 

Restores the previously saved OpenGL state variables which were modified within display().

Definition at line 223 of file SearchCritical.cpp.

References lightingOn, savedColor, and savedPointSize.

Referenced by display().

void SearchCritical::saveGLStateVariables  )  [private]
 

Saves the OpenGL state variables which are changed by display() so they can be restored to their former values.

Definition at line 212 of file SearchCritical.cpp.

References lightingOn, savedColor, and savedPointSize.

Referenced by display().

void SearchCritical::search  ) 
 

Finds all of the critical points of the given surface.

Use this method to do the actual work of finding the critical points of the Implicit surface that you passed in at construction time. The resulting critical points will be stored in the fRoots list (found in Newton.h). If you change the parameters of your Implicit surface, you will have to completely redo the finding process.

Definition at line 144 of file SearchCritical.cpp.

References Newton::FindZeros(), Newton::fMaxRoots, Newton::fNewtonTolerance, Newton::fSameTolerance, getBoxBounds(), getSurface(), savedfMaxRoots, and savedfSameTolerance.

Referenced by CriticalPointInterrogator::findCriticalPoints(), and CriticalMesh::initialMesh().

void SearchCritical::setBoxBounds Box3d  bounds  ) 
 

Sets the internal value of the bounds for a Box.

You must pass in a positive value for this method to do anything.

Parameters:
bounds The new bounds for searching for critical points.

Definition at line 80 of file SearchCritical.cpp.

References theBoxBounds.

void SearchCritical::setBoxBounds double  bounds  ) 
 

Sets the internal value of the bounds for a cubic box.

You must pass in a positive value for this method to do anything. The value you pass in the the length of a side of the box. So if you want a box with mincorner = (-1,-1,-1) and maxcorner = (1,1,1), you should pass in bounds = 2.

Parameters:
bounds The length of a side of a cube to be used as the bounds for searching for critical points.

Definition at line 68 of file SearchCritical.cpp.

References theBoxBounds.

Referenced by CriticalPointInterrogator::findCriticalPoints(), and CriticalMesh::initialMesh().

void SearchCritical::setSurface Implicit surf  )  [virtual]
 

Changes the surface to search.

This method is called by the constructors to set up the private surface variable. It is also virtual and should be overridden (along with getSurface()) to keep the surface variable consistent.

Parameters:
surf The new Implicit surface to search for critical points.
See also:
getSurface()

Reimplemented from NewtonClassify.

Definition at line 42 of file SearchCritical.cpp.

References surf, and surface.

Referenced by SearchCritical().


Member Data Documentation

GLboolean SearchCritical::lightingOn [private]
 

Definition at line 34 of file SearchCritical.h.

Referenced by restoreGLStateVariables(), and saveGLStateVariables().

GLfloat SearchCritical::savedColor[5] [private]
 

Definition at line 33 of file SearchCritical.h.

Referenced by restoreGLStateVariables(), and saveGLStateVariables().

int SearchCritical::savedfMaxRoots [private]
 

If we change fMaxRoots, save the original value for restoration.

Definition at line 36 of file SearchCritical.h.

Referenced by NewtonPostProcess(), and search().

double SearchCritical::savedfSameTolerance [private]
 

If we change fSameTolerance, save the original value for restoration.

Definition at line 38 of file SearchCritical.h.

Referenced by NewtonPostProcess(), and search().

GLfloat SearchCritical::savedPointSize [private]
 

Definition at line 32 of file SearchCritical.h.

Referenced by restoreGLStateVariables(), and saveGLStateVariables().

Implicit* SearchCritical::surface [protected]
 

Find critical points for this Implicit surface.

Reimplemented from NewtonClassify.

Definition at line 41 of file SearchCritical.h.

Referenced by getSurface(), and setSurface().

Box3d SearchCritical::theBoxBounds [private]
 

Definition at line 31 of file SearchCritical.h.

Referenced by getBoxBounds(), SearchCritical(), and setBoxBounds().


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