dtUtil Namespace Reference

Contains generic, reusable features which are useful for most applications. More...


Classes

class  BarycentricSpace
 Transforms Cartesian data points into Barycentric coordinate systems. More...
struct  BreakOverride
 This macro should be used when deprecating (or removing) virtual functions. More...
struct  TargetTriangle
struct  CelestialMesh
struct  TypeTraits
class  Command
 An abstract class for all types which provide a uniform interface for executing Functors. More...
class  Command0
 A Command which does not need arguments and has no return value. More...
class  Command1
 A Command which uses one argument and has no return value. More...
class  Command2
 A Command which uses two arguments and has no return value. More...
class  IncomingCoordinateType
class  LocalCoordinateType
class  CoordinateConversionExceptionEnum
class  Coordinates
class  DataStreamException
class  DataStream
class  Enumeration
 This class represents a type-safe enumeration pattern. More...
class  BaseExceptionType
class  Exception
struct  FileInfo
class  FileExceptionEnum
 An enumeration of exception types that will be thrown by fileutils. More...
class  FileUtils
class  Fractal
 Fractal: This class is made to complement the noise classes where as the noise class hashes vectors to floats between -1 to 1 this class can be used to make summations of the noise to use this class I recommend including NoiseUtility.h and using the appropriate typedefs. More...
struct  Filter2
struct  BoundTL2
struct  UnboundTL2
struct  BoundHelper
struct  UnboundHelper
struct  MergeParmsH
struct  MergeParmsH< i, BoundPTL, UnboundPTL, IdsTL, dtUtil::NullType >
struct  MergeParmsH< 0, BoundPTL, UnboundPTL, dtUtil::NullType, TL >
class  Binder
struct  CallParms< TYPELIST_0()>
struct  CallParms< TYPELIST_1(P1)>
struct  CallParms< TYPELIST_2(P1, P2)>
struct  CallParms< TYPELIST_3(P1, P2, P3)>
struct  CallParms< TYPELIST_4(P1, P2, P3, P4)>
struct  CallParms< TYPELIST_5(P1, P2, P3, P4, P5)>
struct  CallParms< TYPELIST_6(P1, P2, P3, P4, P5, P6)>
struct  CallParms< TYPELIST_7(P1, P2, P3, P4, P5, P6, P7)>
struct  FunctorCall< CallType, R, TYPELIST_0()>
struct  FunctorCall< CallType, R, TYPELIST_1(P1)>
struct  FunctorCall< CallType, R, TYPELIST_2(P1, P2)>
struct  FunctorCall< CallType, R, TYPELIST_3(P1, P2, P3)>
struct  FunctorCall< CallType, R, TYPELIST_4(P1, P2, P3, P4)>
struct  FunctorCall< CallType, R, TYPELIST_5(P1, P2, P3, P4, P5)>
struct  FunctorCall< CallType, R, TYPELIST_6(P1, P2, P3, P4, P5, P6)>
struct  FunctorCall< CallType, R, TYPELIST_7(P1, P2, P3, P4, P5, P6, P7)>
class  Functor
struct  FunTraits< R(*)()>
struct  FunTraits< R(*)(P1)>
struct  FunTraits< R(*)(P1, P2)>
struct  FunTraits< R(*)(P1, P2, P3)>
struct  FunTraits< R(*)(P1, P2, P3, P4)>
struct  FunTraits< R(*)(P1, P2, P3, P4, P5)>
struct  FunTraits< R(*)(P1, P2, P3, P4, P5, P6)>
struct  FunTraits< R(*)(P1, P2, P3, P4, P5, P6, P7)>
struct  FunTraits< R(O::*)()>
struct  FunTraits< R(O::*)(P1)>
struct  FunTraits< R(O::*)(P1, P2)>
struct  FunTraits< R(O::*)(P1, P2, P3)>
struct  FunTraits< R(O::*)(P1, P2, P3, P4)>
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5)>
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6)>
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6, P7)>
struct  FunTraits< R(O::*)() const >
struct  FunTraits< R(O::*)(P1) const >
struct  FunTraits< R(O::*)(P1, P2) const >
struct  FunTraits< R(O::*)(P1, P2, P3) const >
struct  FunTraits< R(O::*)(P1, P2, P3, P4) const >
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5) const >
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6) const >
struct  FunTraits< R(O::*)(P1, P2, P3, P4, P5, P6, P7) const >
struct  Select
struct  Select< false, T, U >
struct  Int2Type
struct  IsIntType
struct  IsIntType< Int2Type< i >, i >
struct  NotIntType
class  NullType
struct  EmptyType
struct  TypeList
struct  CreateTL
struct  CreateTL< NullType, NullType, NullType, NullType, NullType, NullType, NullType, NullType >
struct  CreateIdsTL
struct  CreateIdsTL<-1,-1,-1,-1,-1,-1,-1,-1 >
struct  IdsFromTL
struct  IdsFromTL< NullType, i >
struct  AppendTL
struct  AppendTL< NullType, T >
struct  Length< NullType >
struct  Length< TypeList< T, U > >
struct  TypeAt< TypeList< T, U >, 0 >
struct  TypeAt< TypeList< T, U >, i >
struct  TypeAtNonStrict
struct  TypeAtNonStrict< TypeList< T, U >, 0, DefType >
struct  TypeAtNonStrict< TypeList< T, U >, i, DefType >
struct  TupleHolder
struct  InstantiateH< TypeList< T, U >, Holder, i >
struct  InstantiateH< NullType, Holder, i >
struct  TailAt< InstantiateH< TypeList< T, U >, Holder, i >, 0, i >
struct  TailAt< InstantiateH< TypeList< T, U >, Holder, i >, j, i >
struct  InstantiateHAccessor< 0, InstantiateH< TypeList< T, U >, Holder, i >, i >
struct  InstantiateHAccessor< j, InstantiateH< TypeList< T, U >, Holder, i >, i >
struct  HotSpotDefinition
class  HotSpotFileHandler
class  KeyFrameDecoder
 A class that fills key frame data with DOM parsing. More...
class  LibrarySharingManager
 Singleton for controlling loading and unloading libraries shared by mulitple bodies of code. More...
class  LogFile
class  Log
 Log class which the engine uses for all of its logging needs. More...
class  MatrixUtil
 MatrixUtil is a utility class for operating on an osg::Matrix. More...
class  NodePrintOut
class  Noise1
 An implementation of 1D Gradient Noise. More...
class  Noise2
 An implementation of 2D Gradient Noise. More...
class  Noise3
 An implementation of 3D Gradient Noise. More...
class  NoiseTexture
 Noise Texture is a class that uses SeamlessNoise to generate an osg::Image. More...
class  ObjectFactory
 This class is a template object factory. More...
class  PolarDecomp
 PolarDecomp is a class that will take a 4x4 Matrix and break it up into the following components Rotation, Scale, and Translation. More...
class  ResourceLoader
class  ResourceManager
class  SeamlessNoise
 SeamlessNoise is a noise class that creates tileable noise. More...
struct  Serializer
 A place to implement functions for serialization. More...
class  StringTokenizer
class  IsSpace
 A functor which tests if a character is whitespace. More...
class  IsSlash
 Determines if the current character is a forward slash. More...
class  IsDelimeter
 Generic string delimeter check function class. More...
class  tree
class  tree_iterator
class  XercesErrorHandler
 Logs Xerces parsing errors. More...
class  XercesParser
 A class to unify the usage of Xerces parsing. More...
class  XMLStringConverter
 Utility methods for using strings, often for XML purposes. More...
class  StringToXMLConverter
 Utility methods for using strings, often for XML purposes. More...
class  AttributeSearch
 Searches a Xerces XML Attribute list for names of interest. More...
class  XercesWriter
 A class that manages one XML DOM document. More...

Namespaces

namespace  Bits
 Contains bit-wise operation functionality which makes using bits a little "bit" easier.

Typedefs

typedef std::vector< std::string > DirectoryContents
typedef Noise1< float, float > Noise1f
 NoiseUtility.h contains all necessary defines to use the Noise Library in dtUtil.
typedef Noise1< double, double > Noise1d
typedef Noise2< float, osg::Vec2f > Noise2f
typedef Noise2< double,
osg::Vec2d > 
Noise2d
typedef Noise3< float, osg::Vec3f > Noise3f
typedef Noise3< double,
osg::Vec3d > 
Noise3d
typedef Fractal< float,
osg::Vec2f, Noise2f
Fractal2f
typedef Fractal< double,
osg::Vec2d, Noise2d
Fractal2d
typedef Fractal< float,
osg::Vec3f, Noise3f
Fractal3f
typedef Fractal< double,
osg::Vec3d, Noise3d
Fractal3d
typedef Fractal< float,
osg::Vec3f, SeamlessNoise
SeamlessFractal

Enumerations

enum  FileType { FILE_NOT_FOUND, REGULAR_FILE, DIRECTORY }

Functions

template<class MMType>
MMType::iterator find_multimap_pair (MMType &mmap, const typename MMType::key_type &key, const typename MMType::mapped_type &value)
 find the iterator for the unique key-value pair.
template<class V>
CalculateBarycentricCenter (const V &a, const V &b, const V &c)
void DT_UTIL_EXPORT GetTargetTriangleData (const float azimuth, const float elevation, const CelestialMesh &mesh, TargetTriangle &outTriangle)
 GetTargetTriangleData - Finds the triangle in the mesh for the given azimuth elevation if it exists, otherwise it returns the closest triangle and its coordinates.
void DT_UTIL_EXPORT GetCelestialCoordinates (osg::Vec3 targetDirection, const osg::Vec3 &lookForward, float &azimuth, float &elevation)
 GetCelestialCoordinates - calculates the azimuth and elevation w.r.t.
void DT_UTIL_EXPORT GetCelestialDirection (const float azimuth, const float elevation, const osg::Vec3 &forwardDirection, osg::Vec3 &outDirection)
 GetCelestialDirection - calculates the direction that a given azimuth and elevation points.
int DT_UTIL_EXPORT FindCelestialTriangleID (const CelestialMesh &mesh, float azimuth, float elevation)
 FindCelestialTriangleID - Looks up a celestial triangle from a mesh using azimuth and elevation.
void DT_UTIL_EXPORT GetClosestPointOnSegment (const osg::Vec3 &startPoint, const osg::Vec3 &endPoint, const osg::Vec3 &refPoint, osg::Vec3 &closestPoint)
 GetClosestPointOnSegment - calculates the point on a segment that is closest to a reference point.
bool DT_UTIL_EXPORT IsPointBetweenVectors (const osg::Vec3f &point, const osg::Vec3f &origin, const osg::Vec3f &A, const osg::Vec3f &B)
 IsPointBetweenVectors - determines whether a points is between the vectors origin to A and origin to B.
void DT_UTIL_EXPORT MapCelestialToScreen (float azimuth, float elevation, float maxDistance, float windowWidth, float windowHeight, const osg::Vec2 &screenOrigin, osg::Vec2 &outScreenPos)
 MapCelestialToScreen - maps azimuth and elevation to a screen position.
template<typename T>
safeASIN (T x)
std::ostream & operator<< (std::ostream &o, const Exception &ex)
template<class TL, class IdsTL, class BoundPTL, class UnboundPTL>
CallParms< TL >::ParmsListType MergeParms (BoundPTL const &bound, UnboundPTL const &unbound)
template<class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL<>::Type >
::Outgoing 
Bind (Incoming const &fun)
template<int i1, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1 >
::Type >::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateTL< dtUtil::Int2Type< i1 > >::Type >::Parm1 p1)
template<int i1, int i2, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2 >
::Type >::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2 >::Type >::Parm2 p2)
template<int i1, int i2, int i3, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2,
i3 >::Type >::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm2 p2, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm3 p3)
template<int i1, int i2, int i3, int i4, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2,
i3, i4 >::Type >::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm2 p2, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm3 p3, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm4 p4)
template<int i1, int i2, int i3, int i4, int i5, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2,
i3, i4, i5 >::Type >
::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm2 p2, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm3 p3, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm4 p4, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm5 p5)
template<int i1, int i2, int i3, int i4, int i5, int i6, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2,
i3, i4, i5, i6 >::Type >
::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm2 p2, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm3 p3, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm4 p4, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm5 p5, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm5 p6)
template<int i1, int i2, int i3, int i4, int i5, int i6, int i7, class Incoming>
Binder< Incoming, typename
dtUtil::CreateIdsTL< i1, i2,
i3, i4, i5, i6, i7 >::Type >
::Outgoing 
Bind (Incoming const &fun, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm1 p1, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm2 p2, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm3 p3, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm4 p4, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5 p5, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5 p6, typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5 p7)
template<typename CallType>
Functor< typename
dtUtil::FunTraits< CallType >
::ResultType, typename
dtUtil::FunTraits< CallType >
::TypeListType > 
MakeFunctor (CallType fun)
template<typename CallType, class PObj>
Functor< typename
dtUtil::FunTraits< CallType >
::ResultType, typename
dtUtil::FunTraits< CallType >
::TypeListType > 
MakeFunctor (CallType memfun, PObj const &pobj)
template<typename CallType, class Fun>
Functor< typename
dtUtil::FunTraits< CallType >
::ResultType, typename
dtUtil::FunTraits< CallType >
::TypeListType > 
MakeFunctor (Fun const &fun)
template<unsigned int j, class Instantiated>
InstantiateHAccessor< j,
Instantiated,
Instantiated::ordern >
::TargetHolder & 
GetH (Instantiated &h)
template<unsigned int j, class Instantiated>
InstantiateHAccessor< j,
Instantiated,
Instantiated::ordern >
::TargetHolder const & 
GetH (Instantiated const &h)
template<typename Real>
Real Min (Real a, Real b)
template<typename Real>
Real Max (Real a, Real b)
int RandRange (int from, int to)
float RandFloat (float min, float max)
float RandPercent ()
template<typename Real>
Real Abs (Real x)
template<typename Real>
void Clamp (Real &x, const Real low, const Real high)
template<typename Real>
void ClampMax (Real &x, const Real high)
template<typename Real>
void ClampMin (Real &x, const Real low)
template<typename Real>
Real Lerp (Real x, Real y, Real t)
 Apply a linear interpolation between the two supplied numbers using a third percentage value.
template<typename T>
bool IsFinite (const T value)
template<typename T>
CalculateNormal (T sX, T sMin, T sMax)
 Normalizes a value within a specified space range.
template<typename T>
MapRangeValue (T sX, T xMin, T xMax, T yMin, T yMax)
 Calculates the corresponding value for a mirrored space.
bool Equivalent (float float1, float float2)
 This does a relative comparison of floats.
bool Equivalent (double double1, double double2)
 This does a relative comparison of doubles.
template<typename TVec, typename Real>
bool Equivalent (const TVec &lhs, const TVec &rhs, size_t size, Real epsilon)
 Does an epsilon equals on an any osg::Vec# or array.
template<typename TVec, typename Real>
bool Equivalent (const TVec &lhs, const TVec &rhs, Real epsilon)
 Does an epsilon equals on an any osg::Vec#.
template<typename TVec>
bool Equivalent (const TVec &lhs, const TVec &rhs)
 Does an epsilon equals on an any osg::Vec#, but auto calculates the epsilon per comparison.
template<typename Real>
bool WithinRange (Real lhs, Real rhs, Real epsilon)
template<typename BaseType, typename DerivedType>
BaseType * construct ()
 Templated function to provide a generic object construction utility.
const std::string & trim (std::string &toTrim)
 Trims whitespace off the front and end of a string.
template<class VecType>
bool ParseVec (const std::string &value, VecType &vec, unsigned size, unsigned numberPrecision=16)
 A templated function for taking any of the osg vector types and reading the data from a string.
template<typename T>
std::string ToString (const T &t)
 A utility function to convert a basic type into a string.
long DT_UTIL_EXPORT GetTimeZone (tm &timeParts)
const std::string DT_UTIL_EXPORT TimeAsUTC (time_t time)
 
Parameters:
time the time in seconds since the epoch to convert.

float DT_UTIL_EXPORT ToFloat (const std::string &d)
 Converts a string to a 'float'.
double DT_UTIL_EXPORT ToDouble (const std::string &str)
 converts a std::string to a 'double'
unsigned int DT_UTIL_EXPORT ToUnsignedInt (const std::string &u)
 converts a std::string to an 'unsigned int'
template<typename T>
ToType (const std::string &u)
 Converts a string to a specified type.
bool DT_UTIL_EXPORT Match (char *wildCards, char *str)
void DT_UTIL_EXPORT MakeIndexString (unsigned index, std::string &toFill, unsigned paddedLength=4)
 
Returns:
a string with text as an int value padded to the size specified.

std::string DT_UTIL_EXPORT FindAttributeValueFor (const char *attributeName, XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap *attrs)
 A utility that finds the string value for a specifically named attribute when a DOM Node is available.
 IMPLEMENT_ENUM (BaseExceptionType)
bool iMakeDirectory (const std::string &path)
static std::string sTitle ("Delta 3D Engine Log File")
static bool Scan (char *&wildCards, char *&str)
static bool WildMatch (char *wildCards, char *str)

Variables

const double MIN_LAT = ( (-80.5 * osg::PI) / 180.0 )
const double MAX_LAT = ( (84.5 * osg::PI) / 180.0 )
const double MIN_EASTING = 100000
const double MAX_EASTING = 900000
const double MIN_NORTHING = 0
const double MAX_NORTHING = 10000000
const double MAX_DELTA_LONG = ((osg::PI * 90)/180.0)
const double MIN_SCALE_FACTOR = 0.3
const double MAX_SCALE_FACTOR = 3.0
const double COS_67P5 = 0.38268343236508977
const double AD_C = 1.0026000
const double flatteningReciprocal = 298.257223563
 The reciprocal of the flattening parameter (WGS 84).
const double semiMajorAxis = 6378137.0
 The length of the semi-major axis, in meters (WGS 84).
const double Geocent_a = semiMajorAxis
const double Geocent_f = 1 / flatteningReciprocal
const double Geocent_e2 = (2.0 - Geocent_f) * Geocent_f
const double Geocent_ep2 = Geocent_e2 / (1.0 - Geocent_e2)
const double Geocent_ef = Geocent_f / (2.0 - Geocent_f)
const double Geocent_ef_3 = Geocent_ef * Geocent_ef * Geocent_ef
const double Geocent_ef_4 = Geocent_ef_3 * Geocent_ef
const double Geocent_e2_2 = Geocent_e2 * Geocent_e2
const double Geocent_e2_3 = Geocent_e2_2* Geocent_e2
const double CentralMeridianScale = 0.9996
 Scale used in UTM calculations.
const double MagneticNorthLatitude = 82.116
const double MagneticNorthLongitude = 114.0666
static const char * LOGNAME = "DataStream"
static const char * sLogFileName = "delta3d_log.html"
static dtCore::RefPtr< LogManager > manager (NULL)
int p [512]
int permutation [256]


Detailed Description

Contains generic, reusable features which are useful for most applications.

Typedef Documentation

typedef std::vector<std::string> dtUtil::DirectoryContents

typedef Fractal<double, osg::Vec2d, Noise2d> dtUtil::Fractal2d

typedef Fractal<float, osg::Vec2f, Noise2f> dtUtil::Fractal2f

typedef Fractal<double, osg::Vec3d, Noise3d> dtUtil::Fractal3d

typedef Fractal<float, osg::Vec3f, Noise3f> dtUtil::Fractal3f

typedef Noise1<double, double> dtUtil::Noise1d

typedef Noise1<float, float> dtUtil::Noise1f

NoiseUtility.h contains all necessary defines to use the Noise Library in dtUtil.

The noise classes are templated to allow varying precision and dimensions ex: for a noise class with floating point precision and two components use Noise2f

typedef Noise2<double, osg::Vec2d> dtUtil::Noise2d

typedef Noise2<float, osg::Vec2f> dtUtil::Noise2f

typedef Noise3<double, osg::Vec3d> dtUtil::Noise3d

typedef Noise3<float, osg::Vec3f> dtUtil::Noise3f

typedef Fractal<float, osg::Vec3f, SeamlessNoise> dtUtil::SeamlessFractal


Enumeration Type Documentation

enum dtUtil::FileType

Enumerator:
FILE_NOT_FOUND 
REGULAR_FILE 
DIRECTORY 


Function Documentation

template<typename Real>
Real dtUtil::Abs ( Real  x  )  [inline]

template<int i1, int i2, int i3, int i4, int i5, int i6, int i7, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2, i3, i4, i5, i6, i7>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm2  p2,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm3  p3,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm4  p4,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5  p5,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5  p6,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6, i7 >::Type >::Parm5  p7 
) [inline]

template<int i1, int i2, int i3, int i4, int i5, int i6, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2, i3, i4, i5, i6>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm2  p2,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm3  p3,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm4  p4,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm5  p5,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5, i6 >::Type >::Parm5  p6 
) [inline]

template<int i1, int i2, int i3, int i4, int i5, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2, i3, i4, i5>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm2  p2,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm3  p3,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm4  p4,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4, i5 >::Type >::Parm5  p5 
) [inline]

template<int i1, int i2, int i3, int i4, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2, i3, i4>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm2  p2,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm3  p3,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3, i4 >::Type >::Parm4  p4 
) [inline]

template<int i1, int i2, int i3, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2, i3>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm2  p2,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2, i3 >::Type >::Parm3  p3 
) [inline]

template<int i1, int i2, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1, i2>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2 >::Type >::Parm1  p1,
typename BoundHelper< Incoming, typename dtUtil::CreateIdsTL< i1, i2 >::Type >::Parm2  p2 
) [inline]

template<int i1, class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<i1>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun,
typename BoundHelper< Incoming, typename dtUtil::CreateTL< dtUtil::Int2Type< i1 > >::Type >::Parm1  p1 
) [inline]

template<class Incoming>
Binder<Incoming, typename dtUtil::CreateIdsTL<>::Type>::Outgoing dtUtil::Bind ( Incoming const &  fun  )  [inline]

template<class V>
V dtUtil::CalculateBarycentricCenter ( const V &  a,
const V &  b,
const V &  c 
) [inline]

template<typename T>
T dtUtil::CalculateNormal ( sX,
sMin,
sMax 
) [inline]

Normalizes a value within a specified space range.

Usage: To find the normalized value for a range: float nX = CalculateNormal( valueX , xMin , xMax );

Parameters:
sX the value with respect to the specified range to be normalized.
sMin specifies the left bound of the range.
sMax specifies the right bound of the range.
Returns:
the normalized coefficient for the input to the range.

template<typename Real>
void dtUtil::Clamp ( Real &  x,
const Real  low,
const Real  high 
) [inline]

template<typename Real>
void dtUtil::ClampMax ( Real &  x,
const Real  high 
) [inline]

template<typename Real>
void dtUtil::ClampMin ( Real &  x,
const Real  low 
) [inline]

template<typename BaseType, typename DerivedType>
BaseType* dtUtil::construct (  )  [inline]

Templated function to provide a generic object construction utility.

template<typename TVec>
bool dtUtil::Equivalent ( const TVec &  lhs,
const TVec &  rhs 
) [inline]

Does an epsilon equals on an any osg::Vec#, but auto calculates the epsilon per comparison.

Parameters:
lhs The first vector.
rhs The second vector.

template<typename TVec, typename Real>
bool dtUtil::Equivalent ( const TVec &  lhs,
const TVec &  rhs,
Real  epsilon 
) [inline]

Does an epsilon equals on an any osg::Vec#.

Parameters:
lhs The first vector.
rhs The second vector.
epsilon the epsilon to use in the compare.

template<typename TVec, typename Real>
bool dtUtil::Equivalent ( const TVec &  lhs,
const TVec &  rhs,
size_t  size,
Real  epsilon 
) [inline]

Does an epsilon equals on an any osg::Vec# or array.

Parameters:
lhs The first vector.
rhs The second vector.
size The size or the vec.
epsilon the epsilon to use in the compare.

bool dtUtil::Equivalent ( double  double1,
double  double2 
) [inline]

This does a relative comparison of doubles.

This is a SAFE comparison that doesn't use cheesy 0.0001 type epsilon values. The epsilon is scaled based on the precision of the numbers passed in. This was taken from Christer Ericson's GDC '07 presentation: http://realtimecollisiondetection.net/pubs/GDC06_Ericson_Physics_Tutorial_Numerical_Robustness.ppt Note - This should be used when comparing very large and/or very small numbers.

Parameters:
double1 The first value
double2 The second value
Returns:
True if the values are equal within the relative precision of their values.

bool dtUtil::Equivalent ( float  float1,
float  float2 
) [inline]

This does a relative comparison of floats.

This is a SAFE comparison that doesn't use cheesy 0.0001 type epsilon values. The epsilon is scaled based on the precision of the numbers passed in. This was taken from Christer Ericson's GDC '07 presentation: http://realtimecollisiondetection.net/pubs/GDC06_Ericson_Physics_Tutorial_Numerical_Robustness.ppt Note - This should be used when comparing very large and/or very small numbers.

Parameters:
float1 The first float
float2 The second float
Returns:
True if the values are equal within the relative precision of their values.

template<class MMType>
MMType::iterator dtUtil::find_multimap_pair ( MMType &  mmap,
const typename MMType::key_type &  key,
const typename MMType::mapped_type &  value 
) [inline]

find the iterator for the unique key-value pair.

Parameters:
mmap the container instance to be searched.
key the container's key to be found.
the container's value matching key to be found.
Returns:
the found iterator, or the end of the container.

XERCES_CPP_NAMESPACE_USE std::string dtUtil::FindAttributeValueFor ( const char *  attributeName,
XERCES_CPP_NAMESPACE_QUALIFIER DOMNamedNodeMap *  attrs 
)

A utility that finds the string value for a specifically named attribute when a DOM Node is available.

A Xerces utility that finds the string value for a specifically named attribute.

Needed for DOM Document traversal.

Parameters:
attributeName the name of the attribute of interest.
attrs the NamedNodeMap (attributes) to be searched.
attributeName the name of the attribute of interest.
attrs the node with attributes to be searched.

int dtUtil::FindCelestialTriangleID ( const CelestialMesh mesh,
float  azimuth,
float  elevation 
)

FindCelestialTriangleID - Looks up a celestial triangle from a mesh using azimuth and elevation.

http://www.blackpawn.com/texts/pointinpoly/default.html

Parameters:
mesh - the celestial mesh used to find the triangle
azimuth - the horizontal angle of interest
elevation - the vertical angle of interest

void dtUtil::GetCelestialCoordinates ( osg::Vec3  targetDirection,
const osg::Vec3 &  lookForward,
float &  azimuth,
float &  elevation 
)

GetCelestialCoordinates - calculates the azimuth and elevation w.r.t.

a forward vector

Parameters:
targetDirection - a direction vector pointing to the point of interest
lookForward - current forward vector
azimuth - the horizontal angle between our forward and our target
elevation - the vertical angle between our forward and our target

void dtUtil::GetCelestialDirection ( const float  azimuth,
const float  elevation,
const osg::Vec3 &  forwardDirection,
osg::Vec3 &  outDirection 
)

GetCelestialDirection - calculates the direction that a given azimuth and elevation points.

Parameters:
azimuth - the horizontal angle of interest
elevation - the vertical angle of interest
forwardDirection - the current forward direction the azimuth and elevation are w.r.t
outDirection - the direction that a given azimuth and elevation points

void dtUtil::GetClosestPointOnSegment ( const osg::Vec3 &  startPoint,
const osg::Vec3 &  endPoint,
const osg::Vec3 &  refPoint,
osg::Vec3 &  closestPoint 
)

GetClosestPointOnSegment - calculates the point on a segment that is closest to a reference point.

Parameters:
startPoint - the start point of a line segment
endPoint - the end point of a line segment
refPoint - the point whose closest distance to the segment we are interested in
closestPoint - the final calculated point that is closest to refPoint

template<unsigned int j, class Instantiated>
InstantiateHAccessor<j, Instantiated, Instantiated::ordern>::TargetHolder const& dtUtil::GetH ( Instantiated const &  h  )  [inline]

template<unsigned int j, class Instantiated>
InstantiateHAccessor<j, Instantiated, Instantiated::ordern>::TargetHolder& dtUtil::GetH ( Instantiated &  h  )  [inline]

void dtUtil::GetTargetTriangleData ( const float  azimuth,
const float  elevation,
const CelestialMesh mesh,
TargetTriangle outTriangle 
)

GetTargetTriangleData - Finds the triangle in the mesh for the given azimuth elevation if it exists, otherwise it returns the closest triangle and its coordinates.

Parameters:
azimuth - the horizontal angle between our forward and our target
elevation - the vertical angle between our forward and our target
mesh - the mesh of celestial vertices that holds the triangle of interest
Returns:
outTriangle - struct containing the nearest triangle and it's location

long dtUtil::GetTimeZone ( tm &  timeParts  ) 

bool dtUtil::iMakeDirectory ( const std::string &  path  ) 

dtUtil::IMPLEMENT_ENUM ( BaseExceptionType   ) 

template<typename T>
bool dtUtil::IsFinite ( const T  value  )  [inline]

bool dtUtil::IsPointBetweenVectors ( const osg::Vec3f &  point,
const osg::Vec3f &  origin,
const osg::Vec3f &  A,
const osg::Vec3f &  B 
)

IsPointBetweenVectors - determines whether a points is between the vectors origin to A and origin to B.

Parameters:
point - the point that we want to test
origin - the point which is shared by both vectors
A - the end point for the first vector
B - the end point for the second vector

template<typename Real>
Real dtUtil::Lerp ( Real  x,
Real  y,
Real  t 
) [inline]

Apply a linear interpolation between the two supplied numbers using a third percentage value.

Parameters:
x : specifies the left bound of the range.
y : specifies the right bound of the range.
t,: the normalized value with respect to the specified range to be interpolated.
Returns:
the interpolated value for the coefficient of the range.

template<typename CallType, class Fun>
Functor<typename dtUtil::FunTraits<CallType>::ResultType, typename dtUtil::FunTraits<CallType>::TypeListType> dtUtil::MakeFunctor ( Fun const &  fun  )  [inline]

template<typename CallType, class PObj>
Functor<typename dtUtil::FunTraits<CallType>::ResultType, typename dtUtil::FunTraits<CallType>::TypeListType> dtUtil::MakeFunctor ( CallType  memfun,
PObj const &  pobj 
) [inline]

template<typename CallType>
Functor<typename dtUtil::FunTraits<CallType>::ResultType, typename dtUtil::FunTraits<CallType>::TypeListType> dtUtil::MakeFunctor ( CallType  fun  )  [inline]

void dtUtil::MakeIndexString ( unsigned  index,
std::string &  toFill,
unsigned  paddedLength = 4 
)

Returns:
a string with text as an int value padded to the size specified.

void dtUtil::MapCelestialToScreen ( float  azimuth,
float  elevation,
float  maxDistance,
float  windowWidth,
float  windowHeight,
const osg::Vec2 &  screenOrigin,
osg::Vec2 &  outScreenPos 
)

MapCelestialToScreen - maps azimuth and elevation to a screen position.

Parameters:
azimuth - the azimuth to be mapped
elevation - the elevation to be mapped
windowWidth - the desired max width of the screen sub window
windowHeight - the desired max height of the screen sub window
screenOrigin - the position on the screen from which the sub window begins
outScreenPos - the transformed final position in normalized screen coordinates

template<typename T>
T dtUtil::MapRangeValue ( sX,
xMin,
xMax,
yMin,
yMax 
) [inline]

Calculates the corresponding value for a mirrored space.

Given defined ranges for X space and Y space, and a known value in X space, where X space and Y space are linearly related, find the corresponding value in Y space. Usage: float y = MapRangeValue(x,xMin,xMax,yMin,yMax);

Parameters:
sX the value with respect to the X range to be transformed into the Y range.
xMin specifies the left bound of the X range.
xMax specifies the right bound of the X range.
yMin specifies the left bound of the Y range.
yMax specifies the right bound of the Y range.

bool dtUtil::Match ( char *  wildCards,
char *  str 
)

template<typename Real>
Real dtUtil::Max ( Real  a,
Real  b 
) [inline]

template<class TL, class IdsTL, class BoundPTL, class UnboundPTL>
CallParms<TL>::ParmsListType dtUtil::MergeParms ( BoundPTL const &  bound,
UnboundPTL const &  unbound 
) [inline]

template<typename Real>
Real dtUtil::Min ( Real  a,
Real  b 
) [inline]

std::ostream& dtUtil::operator<< ( std::ostream &  o,
const Exception &  ex 
) [inline]

template<class VecType>
bool dtUtil::ParseVec ( const std::string &  value,
VecType &  vec,
unsigned  size,
unsigned  numberPrecision = 16 
) [inline]

A templated function for taking any of the osg vector types and reading the data from a string.

If the string is empty or "NULL" it will set the vector to all 0s. It expects the data to be the proper number floating point values. The function will fail if there are not enough values.

Parameters:
value the string data.
vec the vector to fill.
size the length of the vector since the osg types have no way to query that.
numberPrecision This value indicates how much precision the numbers will contain when read from the string. (setprecision on std::istream)
Returns:
true if reading the data was successful or false if not.

float dtUtil::RandFloat ( float  min,
float  max 
) [inline]

float dtUtil::RandPercent (  )  [inline]

int dtUtil::RandRange ( int  from,
int  to 
) [inline]

template<typename T>
T dtUtil::safeASIN ( x  )  [inline]

static bool dtUtil::Scan ( char *&  wildCards,
char *&  str 
) [static]

static std::string dtUtil::sTitle ( "Delta 3D Engine Log File"   )  [static]

const std::string dtUtil::TimeAsUTC ( time_t  time  ) 

Parameters:
time the time in seconds since the epoch to convert.

Returns:
the given time as a UTC formatted string.

double dtUtil::ToDouble ( const std::string &  str  ) 

converts a std::string to a 'double'

float dtUtil::ToFloat ( const std::string &  d  ) 

Converts a string to a 'float'.

template<typename T>
std::string dtUtil::ToString ( const T &  t  )  [inline]

A utility function to convert a basic type into a string.

Use template argument T for the type you'd like to convert.

Parameters:
t the instance of the type to converted.

template<typename T>
T dtUtil::ToType ( const std::string &  u  )  [inline]

Converts a string to a specified type.

Parameters:
the string to be converted to the specified template argument type.
Returns:
the type that you specify as the template argument.
Typical use:
 std::string mystring("0");
 bool mybool = dtUtil::ToType<bool>( mystring );

unsigned int dtUtil::ToUnsignedInt ( const std::string &  u  ) 

converts a std::string to an 'unsigned int'

const std::string& dtUtil::trim ( std::string &  toTrim  )  [inline]

Trims whitespace off the front and end of a string.

Parameters:
toTrim the string to trim.

static bool dtUtil::WildMatch ( char *  wildCards,
char *  str 
) [static]

template<typename Real>
bool dtUtil::WithinRange ( Real  lhs,
Real  rhs,
Real  epsilon 
) [inline]


Variable Documentation

const double dtUtil::AD_C = 1.0026000

const double dtUtil::CentralMeridianScale = 0.9996

Scale used in UTM calculations.

const double dtUtil::COS_67P5 = 0.38268343236508977

const double dtUtil::flatteningReciprocal = 298.257223563

The reciprocal of the flattening parameter (WGS 84).

const double dtUtil::Geocent_a = semiMajorAxis

const double dtUtil::Geocent_e2 = (2.0 - Geocent_f) * Geocent_f

const double dtUtil::Geocent_e2_2 = Geocent_e2 * Geocent_e2

const double dtUtil::Geocent_e2_3 = Geocent_e2_2* Geocent_e2

const double dtUtil::Geocent_ef = Geocent_f / (2.0 - Geocent_f)

const double dtUtil::Geocent_ef_3 = Geocent_ef * Geocent_ef * Geocent_ef

const double dtUtil::Geocent_ef_4 = Geocent_ef_3 * Geocent_ef

const double dtUtil::Geocent_ep2 = Geocent_e2 / (1.0 - Geocent_e2)

const double dtUtil::Geocent_f = 1 / flatteningReciprocal

const char* dtUtil::LOGNAME = "DataStream" [static]

const double dtUtil::MagneticNorthLatitude = 82.116

const double dtUtil::MagneticNorthLongitude = 114.0666

dtCore::RefPtr<LogManager> dtUtil::manager(NULL) [static]

const double dtUtil::MAX_DELTA_LONG = ((osg::PI * 90)/180.0)

const double dtUtil::MAX_EASTING = 900000

const double dtUtil::MAX_LAT = ( (84.5 * osg::PI) / 180.0 )

const double dtUtil::MAX_NORTHING = 10000000

const double dtUtil::MAX_SCALE_FACTOR = 3.0

const double dtUtil::MIN_EASTING = 100000

const double dtUtil::MIN_LAT = ( (-80.5 * osg::PI) / 180.0 )

const double dtUtil::MIN_NORTHING = 0

const double dtUtil::MIN_SCALE_FACTOR = 0.3

int dtUtil::p[512]

int dtUtil::permutation[256]

const double dtUtil::semiMajorAxis = 6378137.0

The length of the semi-major axis, in meters (WGS 84).

const char* dtUtil::sLogFileName = "delta3d_log.html" [static]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008