MOAB: Mesh Oriented datABase  (version 5.4.1)
VerdictVector.hpp File Reference
#include "moab/verdict.h"
#include <cassert>
#include <cmath>
+ Include dependency graph for VerdictVector.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  VerdictVector

Typedefs

typedef void(VerdictVector::* transform_function )(double gamma, double gamma2)

Functions

VerdictVector vectorRotate (const double angle, const VerdictVector &normalAxis, const VerdictVector &referenceAxis)
VerdictVector operator~ (const VerdictVector &vec)
VerdictVector operator+ (const VerdictVector &vector1, const VerdictVector &vector2)
VerdictVector operator- (const VerdictVector &vector1, const VerdictVector &vector2)
VerdictVector operator* (const VerdictVector &vector1, const VerdictVector &vector2)
VerdictVector operator* (const VerdictVector &vector1, const double scalar)
VerdictVector operator* (const double scalar, const VerdictVector &vector1)
VerdictVector operator/ (const VerdictVector &vector1, const double scalar)
int operator== (const VerdictVector &v1, const VerdictVector &v2)
int operator!= (const VerdictVector &v1, const VerdictVector &v2)
double operator% (const VerdictVector &vector1, const VerdictVector &vector2)

Typedef Documentation

typedef void( VerdictVector::* transform_function)(double gamma, double gamma2)

Definition at line 31 of file VerdictVector.hpp.


Function Documentation

int operator!= ( const VerdictVector v1,
const VerdictVector v2 
) [inline]

Definition at line 467 of file VerdictVector.hpp.

References VerdictVector::xVal, VerdictVector::yVal, and VerdictVector::zVal.

{
    return ( v1.xVal != v2.xVal || v1.yVal != v2.yVal || v1.zVal != v2.zVal );
}
double operator% ( const VerdictVector vector1,
const VerdictVector vector2 
) [inline]

Definition at line 495 of file VerdictVector.hpp.

References VerdictVector::x(), VerdictVector::y(), and VerdictVector::z().

{
    return ( vector1.x() * vector2.x() + vector1.y() * vector2.y() + vector1.z() * vector2.z() );
}
VerdictVector operator* ( const VerdictVector vector1,
const VerdictVector vector2 
) [inline]

Definition at line 439 of file VerdictVector.hpp.

{
    return VerdictVector( vector1 ) *= vector2;
}
VerdictVector operator* ( const VerdictVector vector1,
const double  scalar 
) [inline]

Definition at line 445 of file VerdictVector.hpp.

{
    return VerdictVector( vector1 ) *= scalar;
}
VerdictVector operator* ( const double  scalar,
const VerdictVector vector1 
) [inline]

Definition at line 451 of file VerdictVector.hpp.

{
    return VerdictVector( vector1 ) *= scalar;
}
VerdictVector operator+ ( const VerdictVector vector1,
const VerdictVector vector2 
) [inline]

Definition at line 419 of file VerdictVector.hpp.

References VerdictVector::x(), VerdictVector::y(), and VerdictVector::z().

{
    double xv = vector1.x() + vector2.x();
    double yv = vector1.y() + vector2.y();
    double zv = vector1.z() + vector2.z();
    return VerdictVector( xv, yv, zv );
    //  return VerdictVector(vector1) += vector2;
}
VerdictVector operator- ( const VerdictVector vector1,
const VerdictVector vector2 
) [inline]

Definition at line 428 of file VerdictVector.hpp.

References VerdictVector::x(), VerdictVector::y(), and VerdictVector::z().

{
    double xv = vector1.x() - vector2.x();
    double yv = vector1.y() - vector2.y();
    double zv = vector1.z() - vector2.z();
    return VerdictVector( xv, yv, zv );
    //  return VerdictVector(vector1) -= vector2;
}
VerdictVector operator/ ( const VerdictVector vector1,
const double  scalar 
) [inline]

Definition at line 457 of file VerdictVector.hpp.

{
    return VerdictVector( vector1 ) /= scalar;
}
int operator== ( const VerdictVector v1,
const VerdictVector v2 
) [inline]

Definition at line 462 of file VerdictVector.hpp.

References VerdictVector::xVal, VerdictVector::yVal, and VerdictVector::zVal.

{
    return ( v1.xVal == v2.xVal && v1.yVal == v2.yVal && v1.zVal == v2.zVal );
}
VerdictVector operator~ ( const VerdictVector vec) [inline]

Definition at line 401 of file VerdictVector.hpp.

References VerdictVector::xVal, VerdictVector::yVal, and VerdictVector::zVal.

{
    double mag = sqrt( vec.xVal * vec.xVal + vec.yVal * vec.yVal + vec.zVal * vec.zVal );

    VerdictVector temp = vec;
    if( mag != 0.0 )
    {
        temp /= mag;
    }
    return temp;
}
VerdictVector vectorRotate ( const double  angle,
const VerdictVector normalAxis,
const VerdictVector referenceAxis 
)

Definition at line 225 of file VerdictVector.cpp.

References VerdictVector::normalize().

{
    // A new coordinate system is created with the xy plane corresponding
    // to the plane normal to the normal axis, and the x axis corresponding to
    // the projection of the reference axis onto the normal plane.  The normal
    // plane is the tangent plane at the root point.  A unit vector is
    // constructed along the local x axis and then rotated by the given
    // ccw angle to form the new point.  The new point, then is a unit
    // distance from the global origin in the tangent plane.

    double x, y;

    // project a unit distance from root along reference axis

    VerdictVector yAxis = normalAxis * referenceAxis;
    VerdictVector xAxis = yAxis * normalAxis;
    yAxis.normalize();
    xAxis.normalize();

    x = cos( angle );
    y = sin( angle );

    xAxis *= x;
    yAxis *= y;
    return VerdictVector( xAxis + yAxis );
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines