misc.cc File Reference

#include "misc.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include "face.h"
#include "vertex.h"

Include dependency graph for misc.cc:


Functions

int distinguishable (double a, double b, double epsilon)
int distinguishable (double a, double b)
void cross (double *const a, double *const b, double *const cr)
double dot (vec_d const &a, vec_d const &b)
double dot (double const *const a, double const *const b)
double dot (vector3 const &a, vector3 const &b)
double dot (vector3 const *a, vector3 const *b)
bool checkIntSize (void)
std::string processDir (std::string pathname)
bool parseCommandLine (int argc, char **argv, std::string const &message)
int getLargestProjection (vector3 const *normal)
result checkLineFaceInt (Face const *const f, vector3 const &origin, vector3 const &end, bool ignore_line)

Function Documentation

bool checkIntSize ( void   ) 

Determine if integers are 32 bit.

Returns:
True if integers are 32 bit on this machine; false otherwise.

result checkLineFaceInt ( Face const *const  f,
vector3 const &  origin,
vector3 const &  end,
bool  ignore_line 
)

Detect and report intersection of line segment and face.

Parameters:
[in] f Face of interest.
[in] origin Vector position of one end of line segment.
[in] end Vector position of other end of line segment.
[in] ignore_line If true then compute intersection of full line and face; otherwise use line segment for intersection.
Returns:

void cross ( double *const  a,
double *const  b,
double *const  cr 
)

Calculate cross product of two input vectors.

Parameters:
[in] a First vector.
[in] b Second vector.
[out] cr Vector cross product of a x b.

int distinguishable ( double  a,
double  b 
)

Determine if two floating-point precision numbers are equivalent in value within DOUBLE_EPSILON.

Parameters:
[in] a First number.
[in] b Second number.
Returns:
1 if Inputs are different; 0 otherwise.

int distinguishable ( double  a,
double  b,
double  epsilon 
)

Determine if two floating-point precision numbers are equivalent in value within epsilon.

Parameters:
[in] a First number.
[in] b Second number.
[in] epsilon The difference between the two input values must be greater than the fraction of the largest input value defined by epsilon.
Returns:
1 if Inputs are different; 0 otherwise.

double dot ( vector3 const *  a,
vector3 const *  b 
)

double dot ( vector3 const &  a,
vector3 const &  b 
)

double dot ( double const *const   a,
double const *const   b 
)

double dot ( vec_d const &  a,
vec_d const &  b 
)

Calculate dot product of two input vectors.

Parameters:
[in] a First vector.
[in] b Second vector.
Returns:
Vector dot product of a and b.

int getLargestProjection ( vector3 const *  normal  ) 

Determine which of three principal surfaces has greatest exposure to face of interest.

Parameters:
[in] normal Face normal vector of arbitrary length.
Returns:
Code for which principal surface has the largest projection of face.

bool parseCommandLine ( int  argc,
char **  argv,
std::string const &  message 
)

Parse meshmorph command line.

Parameters:
[in] argc Argc.
[in] argv Argv.
[in] message General error/help message explaining meshmorph.
Returns:
True if frozen vertex file name detected; false otherwise.

std::string processDir ( std::string  pathname  ) 

Ensure pathname ends with exactly one '/'.

Parameters:
[in] pathname Arbitrary pathname.
Returns:
Input pathname with '/' added if absent.


Generated on Sun Aug 3 14:17:24 2008 for meshmorph by  doxygen 1.5.1