Resume Biography Gallery Digital Images Projects
Josh Grant
 
Master's Thesis
IVTrace
Creating 2D Images
Filter Functions
3D Elastic Collisions
3D Grapher
Open Inventor
Programming Tools
BoundingBox
ExaminerViewerPlus
MarchingCubes
ScalarArithmitic
SFScalarField
Courses
Photo-Realistic 2002
Visualization 2001
Photo-Realistic Computer Graphics
Intro to Computer Graphics
Scientific Visualization
 
ScalarArithmitic
November 2001

What is it?

A subclass of the Open Inventor SoEngine class used for computing the values of a function on a uniformly spaced regular grid.

How to use it

Once the source code has been downloaded and compiled, the engine can be used. The engine has 6 different input fields for computing a scalar field.
  • xDim, the number of points in the x direction.
  • yDim, the number of points in the y direction.
  • zDim, the number of points in the z direction.
  • minBounds, the minimum value of the grid.
  • maxBounds, the maximum value of the grid.
  • expression, the mathematical expression to be solved (must be a valid function computable by the SoCalculator engine).
The output of the engine is an SFScalarField.
The following piece of code will create a ScalarArithmitic engine.
// create pointer to object
ScalarArithmitic *arith = new ScalarArithmitic();
// set the inputs
arith->xDim.setValue(10.0);
arith->yDim.setValue(10.0);
arith->zDim.setValue(10.0);
arith->minBounds.setValue(-1.0, -1.0, -1.0);
arith->maxBounds.setValue( 1.0,  1.0,  1.0);
// evaluate the equation of a sphere
arith->expression.setValue("x*x + y*y + z*z");
// connect the output to an existing SFScalarField
sfield->connectFrom(&arith->scalarField);
Before creating an object of type ScalarArithmitic it must be initialized. Add ScalarArithmitic::initClass() to the main() routine of your program after the database has been initialized with either SoDB::init() or SoXt::init().
 

Josh Grant > Projects > Open Inventor > ScalarArithmitic

Comments or questions about this page can be addressed to Josh Grant at grant@cs.fsu.edu