Itasca C++ Interface
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions
dim.h File Reference

DIM - Provides code portability between 2D and 3D codes. More...

#include "base/src/base.h"

Go to the source code of this file.

Classes

class  Vector< T >
 A Vector2 in 2D, a Vector3 in 3D. More...
 
class  AVector< T >
 An AVector2 in 2D, an AVector3 in 3D. More...
 
class  Extent< T >
 A Extent2<T> in 2D, and a Extent3<T> in 2D. More...
 

Namespaces

namespace  itasca
 namespace Itasca
 

Macros

#define THREED
 Only defined if a 3D compile, TWOD is defined for a 2D compile.
 
#define DIMSTR   "3d"
 Expands to "2d" in 2D, "3d" in 3D.
 
#define CDIMSTR   "3D"
 Expands to "2D" in 2D, "3D" in 3D.
 
#define itascaxd   itasca3d
 Expands to itasca2d in 2D, itasca3d in 3D, for use as a namespace name....
 
#define DIMRET(x, y)   y
 Macro will disregard parameter x.
 

Typedefs

using DVect = DVect3
 Vector of doubles, either 2D or 3D.
 
using FVect = FVect3
 Vector of floats, either 2D or 3D.
 
using IVect = IVect3
 Vector of ints, either 2D or 3D.
 
using I64Vect = I64Vect3
 
using UVect = UVect3
 Vector of uints, either 2D or 3D.
 
using U64Vect = U64Vect3
 
using DExtent = DExtent3
 A DExtent2 in 2D, a DExtent3 in 3D.
 
using IExtent = IExtent3
 An IExtent2 in 2D, an IExtent3 in 3D.
 
using DAVect = DAVect3
 Angular vector of doubles, either 2D or 3D.
 
using FAVect = FAVect3
 Angular vector of floats, either 2D or 3D.
 
using Axes = Axes3D
 Axes system, either 2D or 3D.
 
using CAxes = CAxes3D
 Compact axis system, either 2D or 3D.
 
using Orientation = Orientation3
 Class for storing an "orientation", or a direction in space, either 2D or 3D.
 
using Quat = Quat3
 A complex number in 2D and quaternion in 3D.
 
using VAccum = itasca::Accumulator3
 3D vector accumulator
 
using AVAccum = itasca::Accumulator3
 3D angular accumulator
 

Functions

DMatrix< 3, 3 > toMatrixDIM (const SymTensor &s)
 
template<class T >
Vector3< T > toVect (const Vector2< T > &in)
 Converts a Vector2 to a Vector.
 
template<class T >
const Vector3< T > & toVect (const Vector3< T > &in)
 Converts a Vector3 to a Vector.
 
template<class T >
Vector3< T > toVect (const AVector2< T > &in)
 Converts an AVector2 to Angular Vector2 to a Vector.
 
template<class T >
AVector3< T > toAVect (const AVector2< T > &in)
 Converts an AVector2 to an AVector.
 
template<class T >
const AVector3< T > & toAVect (const AVector3< T > &in)
 Converts an AVector3 to an AVector.
 
template<class T >
AVector3< T > toAVect (const Vector2< T > &in)
 Converts an Vector2 to an AVector3.
 
template<class T >
AVector3< T > toAVect (const Vector3< T > &in)
 Converts an AVector3 to an AVector.
 
template<class T >
Extent< T > toExtent (const Extent2< T > &t)
 Converts Extent2 to an Extent.
 
template<class T >
Extent< T > toExtent (const Extent3< T > &t)
 Converts a Extent3 to an Extent.
 
template<class T >
IVect toIVect (const Vector3< T > &in)
 Converts a Vector3<T> to an IVect.
 
template<class T >
FVect toFVect (const Vector3< T > &in)
 Converts a Vector3<T> to a FVect.
 
template<class T >
DVect toDVect (const Vector3< T > &in)
 
template<class T , unsigned SX>
Vector3< T > toVector (const VMatrix< T, SX > &m, unsigned start)
 Converts a VMatrix to a Vector3, using three elements starting at index start.
 
constexpr DMatrix< 3, 3 > toMatrix (const SymTensor &s)
 
DSymMatrix< 3 > toSymMatrix (const SymTensor &s)
 
template<class T , class U >
constexpr const U & dimval (const T &, const U &val3)
 Returns the first argument in a 2D compile, and the second in a 3D compile.
 

Detailed Description

DIM - Provides code portability between 2D and 3D codes.

This file provides code portability between 2 and 3 dimension codes.
Depending on how DIM is defined, this file declares TYPEDEF and template functions for vectors, extents, axes, cubes, etc.
Declaration for vectors, axes, extents, etc for 2D and 3D.
The intention is to make it easier to write portable code that is the same in 2D and 3D.