HyperspaceExplorer 0.7.1
Functions
Util Namespace Reference

Utility functions. More...

Functions

void CheckGLErrors (const char *)
int GetGLList ()
void glVertex (const Vector< 3, double > &V)
Vector< 3, double > vnormalize (double xx, double yy, double zz)
double atod (QString)
 Convert a QString to double.
double atod (const std::string &)
 Convert a string to unsigned.
int atoi (const std::string &)
 Convert a string to signed int.
unsigned atou (const std::string &)
 Convert a string to unsigned.
string itoa (int x)
string ftoa (double x)
std::string sup2 ()
 A (I hope) Editor-independent repersentation of "²".
std::string sup3 ()
 A (I hope) Editor-independent repersentation of "³".
std::string trim (const std::string &str)
 Strips leading and trailing whitespace from a string.
std::vector< std::stringexplode (const std::string &delimiter, const std::string &str)
 Splits a string on each occurrence of delimiter.
bool isMultithreadedSensible ()
template<typename T >
std::vector< T >::iterator find (T find_me, std::vector< T > &v)
 Find an element in a vector.
template<typename T >
bool isPermutation (T m0, T m1, T n0, T n1)
 Whether the tuple (n0, n1) is a permutation of (m0, m1).
template<typename T >
bool isPermutation (T m0, T m1, T m2, T n0, T n1, T n2)
 Whether the tuple (n0, n1, n2) is a permutation of (m0, m1, m2).
template<typename T >
bool isPermutation (T m0, T m1, T m2, T m3, T n0, T n1, T n2, T n3)
 Whether the tuple (n0, n1, n2, n3) is a permutation of (m0, m1, m2, m3).
template<typename T >
bool isPermutation (T m0, T m1, T m2, T m3, T m4, T n0, T n1, T n2, T n3, T n4)
 Whether the tuple (n0, n1, n2, n3, n4) is a permutation of (m0, m1, m2, m3, n4).

Detailed Description

Utility functions.

__PRETTY_FUNCTION__ is a gcc extension. For other compilers, redefine it to print filename and line instead of the function signature.


Function Documentation

double Util::atod ( QString  s)

Convert a QString to double.

makes a double precision value from a QString implemented because I called a function atod () ages ago, for convenience

Parameters:
sstring to be converted
Returns:
its numerical value
The double precision value of the argument

Referenced by Script::ParmStmt< T >::execute().

Here is the caller graph for this function:

double Util::atod ( const std::string )

Convert a string to unsigned.

Returns:
The double precision value of the argument
int Util::atoi ( const std::string )

Convert a string to signed int.

Returns:
The integer value of the argument

Referenced by Script::ParmStmt< T >::execute().

Here is the caller graph for this function:

unsigned Util::atou ( const std::string )

Convert a string to unsigned.

Returns:
The unsigned value of the argument

Referenced by Script::ParmStmt< T >::execute(), Script::FramesStmt::FramesStmt(), Script::LoopStmt::LoopStmt(), Script::SizeStmt::SizeStmt(), and Script::SleepStmt::SleepStmt().

Here is the caller graph for this function:

void Util::CheckGLErrors ( const char *  )

debug function for OpenGL commands; outputs all current GL errors on cerr

Parameters:
opoptional repetition of last GL command

References std::cerr, and std::endl().

Here is the call graph for this function:

std::vector< std::string > Util::explode ( const std::string delimiter,
const std::string str 
)

Splits a string on each occurrence of delimiter.

Parameters:
delimiterThe string at which str is split.
strThe string which is split into its part
Returns:
The list of parts of str. delimiter is not included in any of the parts.

References std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), std::vector< _Tp, _Alloc >::insert(), and std::vector< _Tp, _Alloc >::push_back().

Here is the call graph for this function:

template<typename T >
std::vector<T>::iterator Util::find ( find_me,
std::vector< T > &  v 
)

Find an element in a vector.

Parameters:
find_meThe element to find in the vector v
vThe vector to search for element find_me
Returns:
The vector<T>::iterator pointing to the element or v.end() if it is not in v

References std::vector< _Tp, _Alloc >::begin(), and std::vector< _Tp, _Alloc >::end().

Here is the call graph for this function:

std::string Util::ftoa ( double  x)

makes a string from a double value implemented because I called a function ftoa () ages ago, for convenience

Parameters:
xnumber to be converted
Returns:
its string representation
int Util::GetGLList ( )

find the ID of the first free GL list

Returns:
first free GL list

Referenced by C4DView::PreRedraw().

Here is the caller graph for this function:

void Util::glVertex ( const VecMath::Vector< 3, double > &  V)

define a GL Vertex from a Vector<3>

Parameters:
Vthe vertex to be defined

References VecMath::Vector< D, N >::data(), and VecMath::sqnorm().

Referenced by C4DView::DrawCoordinates(), and C4DView::drawVertex().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Util::itoa ( int  x)

makes a string from an integer value implemented because I called a function itoa () ages ago, for convenience

Parameters:
xnumber to be converted
Returns:
its string representation

Referenced by VecMath::RotationAxes< D >::axis(), and C4DView::RenderScene().

Here is the caller graph for this function:

std::string Util::trim ( const std::string str)

Strips leading and trailing whitespace from a string.

Parameters:
strA string to trim.
Returns:
str without leading and trailing whitespace.
VecMath::Vector< 3, double > Util::vnormalize ( double  xx,
double  yy,
double  zz 
)

normalizes a Vector made from 3 doubles out-of-place

Parameters:
xxx component of Vector to be normalized
yyy component of Vector to be normalized
zzz component of Vector to be normalized
Returns:
normalized Vector
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:19 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo