Itasca C++ Interface
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Axes2D Class Reference

Class for specifying a particular 2D cartesian axes system, and converting to and from it. More...

#include <axes.h>

Public Member Functions

BASE_EXPORT Axes2D ()
 Default construction, no initialization of data.
 
BASE_EXPORT Axes2D (const Axes2D &a)
 Copy constructor.
 
BASE_EXPORT Axes2D (const DVect2 &vx, const DVect2 &vy, bool normalize, const DVect2 &c=DVect2(0))
 
BASE_EXPORT Axes2D (double dip, const DVect2 &c=DVect2(0))
 
BASE_EXPORT Axes2D (const Orientation2 &o, const DVect2 &c=DVect2(0))
 
BASE_EXPORT constexpr const Axes2Doperator= (const Axes2D &a)
 Equality operator.
 
BASE_EXPORT bool operator== (const Axes2D &a) const
 Comparison operator.
 
BASE_EXPORT bool operator!= (const Axes2D &a) const
 Comparison operator.
 
BASE_EXPORT void setOrigin (const DVect2 &c)
 Specifies a new origin for the axes system.
 
BASE_EXPORT void setOrientation (double dip)
 Specifies a new orientation for the axes, by dip (in radians).
 
BASE_EXPORT void setOrientation (const Orientation2 &o)
 Specifies a new orientation for the axes, by orientation.
 
BASE_EXPORT const DVect2 & c () const
 The origin of the axes system.
 
BASE_EXPORT const DVect2 & e1 () const
 The x unit vector.
 
BASE_EXPORT const DVect2 & e2 () const
 The y unit vector.
 
BASE_EXPORT DVect2 & rc ()
 Reference access to the axes origin.
 
BASE_EXPORT DVect2 & re1 ()
 
BASE_EXPORT DVect2 & re2 ()
 
BASE_EXPORT DVect2 toLocal (const DVect2 &v) const
 Convert Dvect2 v from "global" system to this system.
 
BASE_EXPORT const DAVect2 & toLocal (const DAVect2 &v) const
 Convert DAVect2 v from "global" system to this system (identity transformation).
 
BASE_EXPORT DVect2 toGlobal (const DVect2 &v) const
 Convert DVect2 v from this system to a "global" system.
 
BASE_EXPORT const DAVect2 & toGlobal (const DAVect2 &v) const
 Convert DAVect2 v from this system to a "global" system (identity transformation).
 
BASE_EXPORT DVect2 getDir (uint32 dof) const
 Return e1 or e2 given degree-of-freedom dof (0-1)
 
BASE_EXPORT void setDir (uint32 dof, const DVect2 &v)
 
BASE_EXPORT void setDirAuto (uint32 dof, uint32 keepDOF=0xFFFFFFFF)
 
BASE_EXPORT Orientation2 getOrientation (uint32 dof=0) const
 Returns the equivalent orientation of degree-of-freedom dof (0-1)
 

Static Public Member Functions

static BASE_EXPORT Axes2D make (const DVect2 &y, bool normalize)
 Creates an Axes using vector y in the +y direction (need not be unit).
 
static BASE_EXPORT Axes2D makeX (const DVect2 &x, bool normalize)
 Creates an Axes using vector x in the +x direction (need not be unit).
 
static BASE_EXPORT Axes2D make (const Orientation2 &o)
 Creates an Axes using orientaion o for the +y direction.
 
static BASE_EXPORT Axes2D makeX (const Orientation2 &o)
 Creates an Axes using orientaion o for the +x direction.
 
static BASE_EXPORT Axes2D make (const DVect2 &dir, uint32 dof, bool normalize)
 
static BASE_EXPORT Axes2D makeDef ()
 
static BASE_EXPORT void setTolerance (double d)
 
static BASE_EXPORT double getTolerance ()
 Returns the tolerance used for comparison and detecting "near enough to zero".
 
static BASE_EXPORT Axes2D global ()
 

Detailed Description

Class for specifying a particular 2D cartesian axes system, and converting to and from it.

This class is allows one to specify an alternate cartesian coordinate system (including origin translation) and convert from "local" (to this Axes object) to "global" the default cartesian space. This class is a 2D version of Axes, and a 3D one exists as well. To the extent possible, the API has been made the same for both.

Constructor & Destructor Documentation

◆ Axes2D() [1/3]

Axes2D::Axes2D ( const DVect2 & vx,
const DVect2 & vy,
bool normalize,
const DVect2 & c = DVect2(0) )

Explicit constructor from two unit vectors

Warning
No checking is done to ensure vx and vy form an orthonormal basis!
Parameters
vxThe local x direction
vyThe local y direction
cThe axes origin

◆ Axes2D() [2/3]

BASE_EXPORT Axes2D::Axes2D ( double dip,
const DVect2 & c = DVect2(0) )
inlineexplicit

Explicit contructor from dip

Parameters
dipIn radians. See the Orientation2 class for a defintion of dip.
cThe axes origin

◆ Axes2D() [3/3]

BASE_EXPORT Axes2D::Axes2D ( const Orientation2 & o,
const DVect2 & c = DVect2(0) )
inlineexplicit

Explicit contructor from Orientation2

Parameters
oOrientation of axes relative to global.
cThe axes origin.

Member Function Documentation

◆ re1()

BASE_EXPORT DVect2 & Axes2D::re1 ( )
inline

Reference access to the axis x-direction.

Warning
If you use this, no check is made to ensure e1 and e2 are orthonormal!

◆ re2()

BASE_EXPORT DVect2 & Axes2D::re2 ( )
inline

Reference access to the axis y-direction.

Warning
If you use this, no check is made to ensure e1 and e2 are orthonormal!

◆ setTolerance()

void Axes2D::setTolerance ( double d)
static

Sets the tolerance used for comparison and detecting "near enough to zero". Defaults to 1e-6. A single tolerance is used for all 2D and 3D Axes objects.


The documentation for this class was generated from the following files: