18.08.2013 Views

Vega FEM Library (v1.1) User's Manual - University of Southern ...

Vega FEM Library (v1.1) User's Manual - University of Southern ...

Vega FEM Library (v1.1) User's Manual - University of Southern ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.1 camera<br />

class SphericalCamera Provides utilities for setting the OpenGL camera based upon a spherical-coordinate<br />

system centered at a specified focus point.<br />

void Look()<br />

Applies the current camera transformation to the active OpenGL matrix. Note that this does not run<br />

glMatrixMode or glLoadIdentity.<br />

void MoveRight(double amount)<br />

void MoveUp(double amount)<br />

void MoveIn(double amount)<br />

void ZoomIn(double amount)<br />

Move the camera by a user-specified <strong>of</strong>fset. Supply negative values to move/zoom in the opposite direction.<br />

void SavePosition(char * filename)<br />

void LoadPosition(char * filename)<br />

Save or load the camera position to a file. LoadPosition prints a warning if the specified file does not<br />

exist.<br />

2.2 configFile<br />

class ConfigFile Parses values from a text configuration file. The syntax <strong>of</strong> the configuration file is userdefined.<br />

Options can be read as int, bool, float, double, and char * (C-string) types. See any <strong>of</strong> the<br />

.config files in the examples folder for an example <strong>of</strong> the config file syntax.<br />

int addOption(char * optionName, T * destLocation)<br />

Defined for T as int, bool, float, double, char. Adds a mandatory option with name optionName.<br />

When the config file is later parsed, any value found for this option is written to the variable pointed to by<br />

destLocation. If no value for this option is found, the parse is considered to have failed. Returns a non-zero<br />

value if the option has already been defined.<br />

int addOptionOptional(char * optionName, T * destLocation, T defaultvalue)<br />

int addOptionOptional(char * optionName, char * destLocation, char * defaultvalue)<br />

Adds an optional option with name optionName. When the config file is later parsed, the variable pointed<br />

to by destLocation is set to the value found in the file, or to defaultValue if no value is set. Returns a<br />

non-zero value if the option has already been defined.<br />

int parseOptions(char * filename)<br />

Parses the options in file filename, writing the option values it reads to the appropriate variables. A<br />

non-zero value is returned if any mandatory options are not specified.<br />

2.3 corotationalLinear<strong>FEM</strong><br />

class CorotationalLinear<strong>FEM</strong> Implements the corotational linear finite element model described in [MG04].<br />

The class can also compute the exact tangent stiffness matrix; the implementation is described in [Bar12].<br />

CorotationalLinear<strong>FEM</strong>(TetMesh * tetMesh)<br />

Initializes the model based upon an input tetrahedral mesh.<br />

void GetStiffnessMatrixTopology(SparseMatrix ** stiffnessMatrixTopology)<br />

Writes to *stiffnessMatrixTopology a newly allocated (using new) zero matrix containing the pattern<br />

<strong>of</strong> non-zero entries <strong>of</strong> the stiffness matrix.<br />

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!