Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::CartVect Class Reference

Cartesian Vector. More...

#include <CartVect.hpp>

+ Inheritance diagram for moab::CartVect:

Public Member Functions

 CartVect ()
 CartVect (double v)
 CartVect (double i, double j, double k)
 CartVect (const double a[3])
CartVectoperator= (const double v[3])
double & operator[] (unsigned i)
double operator[] (unsigned i) const
CartVectoperator+= (const CartVect &v)
CartVectoperator-= (const CartVect &v)
CartVectoperator*= (const CartVect &v)
CartVectoperator+= (double s)
CartVectoperator-= (double s)
CartVectoperator*= (double s)
CartVectoperator/= (double s)
bool operator== (const CartVect &v) const
bool operator== (double val) const
double length () const
 vector length
double length_squared () const
void normalize ()
 make unit length, or 0 if length < DBL_MIN
void flip ()
 flip direction
void scale (const CartVect &v)
double * array ()
const double * array () const
void get (double v[3]) const
void get (float v[3]) const

Private Attributes

double d [3]

Detailed Description

Cartesian Vector.

Examples:
ComputeTriDual.cpp, DeformMeshRemap.cpp, GenLargeMesh.cpp, LaplacianSmoother.cpp, and LloydRelaxation.cpp.

Definition at line 14 of file CartVect.hpp.


Constructor & Destructor Documentation

Definition at line 20 of file CartVect.hpp.

{}
moab::CartVect::CartVect ( double  v) [inline, explicit]

Initialze all three values to same scalar (typically zero)

Definition at line 22 of file CartVect.hpp.

References d.

    {
        d[0] = d[1] = d[2] = v;
    }
moab::CartVect::CartVect ( double  i,
double  j,
double  k 
) [inline]

Definition at line 26 of file CartVect.hpp.

References d.

    {
        d[0] = i;
        d[1] = j;
        d[2] = k;
    }
moab::CartVect::CartVect ( const double  a[3]) [inline, explicit]

Initialze from array

Definition at line 33 of file CartVect.hpp.

References d.

    {
        d[0] = a[0];
        d[1] = a[1];
        d[2] = a[2];
    }

Member Function Documentation

double* moab::CartVect::array ( ) [inline]

Definition at line 127 of file CartVect.hpp.

References d.

Referenced by moab::AffineXform::accumulate(), moab::BoundBox::BoundBox(), moab::box_from_axes(), moab::AdaptiveKDTreeIter::box_max(), moab::AdaptiveKDTreeIter::box_min(), moab::BoxPlaneIter::BoxPlaneIter(), moab::BVHTree::bruteforce_find(), moab::AdaptiveKDTree::build_tree(), moab::BVHTree::build_tree(), moab::BSPTreeIter::calculate_polyhedron(), moab::GeomQueryTool::closest_to_location(), moab::AdaptiveKDTree::closest_triangle(), moab::OrientedBox::compute_from_vertices(), moab::BVHTree::distance_search(), moab::AdaptiveKDTree::distance_search(), moab::IntxUtils::EdgeIntxRllCs(), moab::LinearTet::evaluate_reverse(), moab::LinearTri::evaluate_reverse(), moab::EvalSet::evaluate_reverse(), FBiGeom_getEntBoundBox(), moab::MergeMesh::find_merged_to(), moab::BVHTree::find_point(), moab::GeomQueryTool::find_volume(), moab::Intx2MeshInPlane::findNodes(), moab::IntxRllCssphere::findNodes(), moab::Intx2MeshOnSphere::findNodes(), moab::OrientedBoxTreeTool::get_close_tris(), moab::ElemEvaluator::get_normal(), moab::ElemEvaluator::get_vert_pos(), moab::FBEngine::getEntBoundBox(), moab::IntxUtils::global_gnomonic_projection(), moab::SmoothFace::init_gradient(), moab::Element::Map::inside_box(), moab::ElemEvaluator::integrate(), moab::LinearHex::integrateFcn(), moab::LinearQuad::integrateFcn(), moab::ElemEvaluator::jacobian(), main(), moab::OrientedBox::make_hex(), moab::AdaptiveKDTree::point_search(), moab::BVHTree::point_search(), moab::GeomQueryTool::poly_solid_angle(), moab::ray_intersect_halfspaces(), moab::ElemEvaluator::reverse_eval(), set_departure_points_position(), moab::ElemEvaluator::set_ent_handle(), moab::GeomQueryTool::test_volume_boundary(), moab::BoundBox::update(), moab::ReadNCDF::update(), and moab::BoundBox::update_box_spherical_elem().

    {
        return d;
    }
const double* moab::CartVect::array ( ) const [inline]

Definition at line 131 of file CartVect.hpp.

References d.

    {
        return d;
    }
void moab::CartVect::flip ( ) [inline]

flip direction

Definition at line 199 of file CartVect.hpp.

References d.

{
    d[0] = -d[0];
    d[1] = -d[1];
    d[2] = -d[2];
}
void moab::CartVect::get ( float  v[3]) const [inline]

initialize float array from this

Definition at line 145 of file CartVect.hpp.

References d.

    {
        v[0] = static_cast< float >( d[0] );
        v[1] = static_cast< float >( d[1] );
        v[2] = static_cast< float >( d[2] );
    }
CartVect & moab::CartVect::operator*= ( const CartVect v) [inline]

Assign cross product to this

Definition at line 175 of file CartVect.hpp.

{
    return *this = *this * v;
}
CartVect& moab::CartVect::operator*= ( double  s) [inline]

Definition at line 87 of file CartVect.hpp.

References d.

    {
        d[0] *= s;
        d[1] *= s;
        d[2] *= s;
        return *this;
    }
CartVect& moab::CartVect::operator+= ( const CartVect v) [inline]

Definition at line 56 of file CartVect.hpp.

References d.

    {
        d[0] += v.d[0];
        d[1] += v.d[1];
        d[2] += v.d[2];
        return *this;
    }
CartVect& moab::CartVect::operator+= ( double  s) [inline]

Definition at line 73 of file CartVect.hpp.

References d.

    {
        d[0] += s;
        d[1] += s;
        d[2] += s;
        return *this;
    }
CartVect& moab::CartVect::operator-= ( const CartVect v) [inline]

Definition at line 63 of file CartVect.hpp.

References d.

    {
        d[0] -= v.d[0];
        d[1] -= v.d[1];
        d[2] -= v.d[2];
        return *this;
    }
CartVect& moab::CartVect::operator-= ( double  s) [inline]

Definition at line 80 of file CartVect.hpp.

References d.

    {
        d[0] -= s;
        d[1] -= s;
        d[2] -= s;
        return *this;
    }
CartVect& moab::CartVect::operator/= ( double  s) [inline]

Definition at line 94 of file CartVect.hpp.

References d.

    {
        d[0] /= s;
        d[1] /= s;
        d[2] /= s;
        return *this;
    }
CartVect& moab::CartVect::operator= ( const double  v[3]) [inline]

Definition at line 39 of file CartVect.hpp.

References d.

    {
        d[0] = v[0];
        d[1] = v[1];
        d[2] = v[2];
        return *this;
    }
bool moab::CartVect::operator== ( const CartVect v) const [inline]

Definition at line 101 of file CartVect.hpp.

References d.

    {
        return d[0] == v[0] && d[1] == v[1] && d[2] == v[2];
    }
bool moab::CartVect::operator== ( double  val) const [inline]

Definition at line 105 of file CartVect.hpp.

References d.

    {
        return d[0] == val && d[1] == val && d[2] == val;
    }
double& moab::CartVect::operator[] ( unsigned  i) [inline]

Definition at line 47 of file CartVect.hpp.

References d.

    {
        return d[i];
    }
double moab::CartVect::operator[] ( unsigned  i) const [inline]

Definition at line 51 of file CartVect.hpp.

References d.

    {
        return d[i];
    }
void moab::CartVect::scale ( const CartVect v) [inline]

per-element scalar multiply (this[0] *= v[0], this[1] *= v[1], ...)

Examples:
LaplacianSmoother.cpp.

Definition at line 119 of file CartVect.hpp.

References d.

Referenced by perform_laplacian_smoothing().

    {
        d[0] *= v.d[0];
        d[1] *= v.d[1];
        d[2] *= v.d[2];
    }

Member Data Documentation

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines