Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mlib::Point3< P, V > Class Template Reference
[MLIB]

A 3D point class with double precision floating point elements.

This class is designed to be base class of more specific types of 3D points. Specifically, 3D points in different coordinate systems. The template argument P is the type of the derived point class. This allows the Point3 to return new points of the same type as the derived class. The template argument V is the type of the corresponding 3D vector class for the coordinate system of the derived 3D point class. More...

#include <point3.H>

Inheritance diagram for mlib::Point3< P, V >:

Inheritance graph
[legend]
List of all members.

Descriptive interface

typedef double value_type
static int dim ()

Public Member Functions

Constructors
 Point3 ()
 Point3 (double s)
 Point3 (double x, double y, double z)
Element Access Functions
void set (double x, double y, double z)
const double * data () const
double operator[] (int index) const
double & operator[] (int index)
Overloaded Arithmetic Operators
operator * (double s) const
operator/ (double s) const
operator+ (const P &p) const
 Adds a point to a point.
operator+ (const V &v) const
operator- (const P &p) const
operator- (const V &v) const
operator- () const
void operator+= (const P &p)
 Adds a point to a point.
void operator+= (const V &v)
void operator-= (const V &v)
void operator *= (double s)
void operator/= (double s)
Two Point Operations
double dist_sqrd (const P &p) const
 Computes the distance squared between two points.
double dist (const P &p) const
 Computes the distance between two points.
Overloaded Comparison Operators
bool operator== (const P &p) const
 Are the two points exactly equal (component wise)?
bool operator!= (const P &p) const
 Are the two points not equal (component wise)?
Point Comparison Functions
bool is_equal (const P &p, double epsSqrd=epsAbsSqrdMath()) const
 Is the distance squared between the two points essentially zero?

Protected Attributes

double _x
double _y
double _z

Related Functions

(Note that these are not member functions.)

ostream & operator<< (ostream &os, const Point3< P, V > &p)
 Stream insertion operator for Point3's.
istream & operator>> (istream &is, Point3< P, V > &p)
 Stream extraction operator for Point3's.
double det (const Point3< P, V > &a, const Point3< P, V > &b, const Point3< P, V > &c)
 Computes the determinant of the 3x3 matrix containing the 3 Point3's as rows.
bool areCoplanar (const P &, const P &, const P &, const P &)
 Determines if four Point3's are co-planar.

Detailed Description

template<typename P, typename V>
class mlib::Point3< P, V >

A 3D point class with double precision floating point elements.

This class is designed to be base class of more specific types of 3D points. Specifically, 3D points in different coordinate systems. The template argument P is the type of the derived point class. This allows the Point3 to return new points of the same type as the derived class. The template argument V is the type of the corresponding 3D vector class for the coordinate system of the derived 3D point class.

Note:
Point3's can be added together using either the + operator or the % operator. Both perform exactly the same operation. -- This is not true anymore. The % operator has been removed from this class.
Todo:
Figure out why both the + operator and the % operator are used for point addition. -- Done
Todo:
Remove % operator in favor of + operator. -- Done

Definition at line 42 of file point3.H.


Member Typedef Documentation

template<typename P, typename V>
typedef double mlib::Point3< P, V >::value_type
 

Definition at line 62 of file point3.H.


Constructor & Destructor Documentation

template<typename P, typename V>
mlib::Point3< P, V >::Point3  )  [inline]
 

Definition at line 53 of file point3.H.

template<typename P, typename V>
mlib::Point3< P, V >::Point3 double  s  )  [inline, explicit]
 

Definition at line 54 of file point3.H.

template<typename P, typename V>
mlib::Point3< P, V >::Point3 double  x,
double  y,
double  z
[inline]
 

Definition at line 55 of file point3.H.


Member Function Documentation

template<typename P, typename V>
const double* mlib::Point3< P, V >::data  )  const [inline]
 

Definition at line 71 of file point3.H.

Referenced by ZcrossTexture::draw(), TEXT2D::draw(), TEXT2D::draw_debug(), SHOW_TRIS::draw_flat_tri(), and SHOW_TRIS::draw_wire_tri().

template<typename P, typename V>
static int mlib::Point3< P, V >::dim  )  [inline, static]
 

Definition at line 63 of file point3.H.

template<typename P, typename V>
double mlib::Point3< P, V >::dist const P &  p  )  const [inline]
 

Computes the distance between two points.

Definition at line 111 of file point3.H.

Referenced by QuadtreeNode::area(), at_length(), QuadtreeNode::build_quadtree(), closest_vert(), Bsimplex::dist(), GEOM::do_cam_focus(), QuadtreeNode::farthest_pt(), BMESH::intersect(), map_centroid(), Bface::quad_dim1(), Bface::quad_dim2(), remove_nodes(), Bvert::view_intersect(), Bface::view_intersect(), Bedge::view_intersect(), and Bvert::wdist().

template<typename P, typename V>
double mlib::Point3< P, V >::dist_sqrd const P &  p  )  const [inline]
 

Computes the distance squared between two points.

Definition at line 107 of file point3.H.

Referenced by mlib::Point3< NDCZpt, NDCZvec >::dist(), and mlib::Point3< NDCZpt, NDCZvec >::is_equal().

template<typename P, typename V>
bool mlib::Point3< P, V >::is_equal const P &  p,
double  epsSqrd = epsAbsSqrdMath()
const [inline]
 

Is the distance squared between the two points essentially zero?

Definition at line 129 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator * double  s  )  const [inline]
 

Definition at line 81 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::operator *= double  s  )  [inline]
 

Definition at line 98 of file point3.H.

template<typename P, typename V>
bool mlib::Point3< P, V >::operator!= const P &  p  )  const [inline]
 

Are the two points not equal (component wise)?

Definition at line 121 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator+ const V &  v  )  const [inline]
 

Definition at line 87 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator+ const P &  p  )  const [inline]
 

Adds a point to a point.

Warning:
This should only be used to add points that have already been pre-weighted by coefficients that add up to 1.

Definition at line 86 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::operator+= const V &  v  )  [inline]
 

Definition at line 96 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::operator+= const P &  p  )  [inline]
 

Adds a point to a point.

Warning:
This should only be used to add points that have already been pre-weighted by coefficients that add up to 1.

Definition at line 95 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator-  )  const [inline]
 

Definition at line 90 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator- const V &  v  )  const [inline]
 

Definition at line 89 of file point3.H.

template<typename P, typename V>
V mlib::Point3< P, V >::operator- const P &  p  )  const [inline]
 

Definition at line 88 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::operator-= const V &  v  )  [inline]
 

Definition at line 97 of file point3.H.

template<typename P, typename V>
P mlib::Point3< P, V >::operator/ double  s  )  const [inline]
 

Definition at line 82 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::operator/= double  s  )  [inline]
 

Definition at line 99 of file point3.H.

template<typename P, typename V>
bool mlib::Point3< P, V >::operator== const P &  p  )  const [inline]
 

Are the two points exactly equal (component wise)?

Definition at line 119 of file point3.H.

template<typename P, typename V>
double& mlib::Point3< P, V >::operator[] int  index  )  [inline]
 

Definition at line 74 of file point3.H.

template<typename P, typename V>
double mlib::Point3< P, V >::operator[] int  index  )  const [inline]
 

Definition at line 73 of file point3.H.

template<typename P, typename V>
void mlib::Point3< P, V >::set double  x,
double  y,
double  z
[inline]
 

Definition at line 70 of file point3.H.


Friends And Related Function Documentation

template<typename P, typename V>
bool areCoplanar const P &  ,
const P &  ,
const P &  ,
const P & 
[related]
 

Determines if four Point3's are co-planar.

Definition at line 19 of file point3.C.

template<typename P, typename V>
double det const Point3< P, V > &  a,
const Point3< P, V > &  b,
const Point3< P, V > &  c
[related]
 

Computes the determinant of the 3x3 matrix containing the 3 Point3's as rows.

Definition at line 166 of file point3.H.

template<typename P, typename V>
ostream & operator<< ostream &  os,
const Point3< P, V > &  p
[related]
 

Stream insertion operator for Point3's.

Definition at line 146 of file point3.H.

template<typename P, typename V>
istream & operator>> istream &  is,
Point3< P, V > &  p
[related]
 

Stream extraction operator for Point3's.

Definition at line 155 of file point3.H.

References dummy.


Member Data Documentation

template<typename P, typename V>
double mlib::Point3< P, V >::_x [protected]
 

Definition at line 46 of file point3.H.

Referenced by mlib::Point3< NDCZpt, NDCZvec >::data(), mlib::Point3< NDCZpt, NDCZvec >::dist_sqrd(), mlib::Point3< NDCZpt, NDCZvec >::operator *(), mlib::Point3< NDCZpt, NDCZvec >::operator *=(), mlib::Point3< NDCZpt, NDCZvec >::operator!=(), mlib::Point3< NDCZpt, NDCZvec >::operator+(), mlib::Point3< NDCZpt, NDCZvec >::operator+=(), mlib::Point3< NDCZpt, NDCZvec >::operator-(), mlib::Point3< NDCZpt, NDCZvec >::operator-=(), mlib::Point3< NDCZpt, NDCZvec >::operator/(), mlib::Point3< NDCZpt, NDCZvec >::operator/=(), mlib::Point3< NDCZpt, NDCZvec >::operator==(), mlib::Point3< NDCZpt, NDCZvec >::operator[](), and mlib::Point3< NDCZpt, NDCZvec >::set().

template<typename P, typename V>
double mlib::Point3< P, V >::_y [protected]
 

Definition at line 46 of file point3.H.

Referenced by mlib::Point3< NDCZpt, NDCZvec >::dist_sqrd(), mlib::Point3< NDCZpt, NDCZvec >::operator *(), mlib::Point3< NDCZpt, NDCZvec >::operator *=(), mlib::Point3< NDCZpt, NDCZvec >::operator!=(), mlib::Point3< NDCZpt, NDCZvec >::operator+(), mlib::Point3< NDCZpt, NDCZvec >::operator+=(), mlib::Point3< NDCZpt, NDCZvec >::operator-(), mlib::Point3< NDCZpt, NDCZvec >::operator-=(), mlib::Point3< NDCZpt, NDCZvec >::operator/(), mlib::Point3< NDCZpt, NDCZvec >::operator/=(), mlib::Point3< NDCZpt, NDCZvec >::operator==(), and mlib::Point3< NDCZpt, NDCZvec >::set().

template<typename P, typename V>
double mlib::Point3< P, V >::_z [protected]
 

Definition at line 46 of file point3.H.

Referenced by mlib::Point3< NDCZpt, NDCZvec >::dist_sqrd(), mlib::Point3< NDCZpt, NDCZvec >::operator *(), mlib::Point3< NDCZpt, NDCZvec >::operator *=(), mlib::Point3< NDCZpt, NDCZvec >::operator!=(), mlib::Point3< NDCZpt, NDCZvec >::operator+(), mlib::Point3< NDCZpt, NDCZvec >::operator+=(), mlib::Point3< NDCZpt, NDCZvec >::operator-(), mlib::Point3< NDCZpt, NDCZvec >::operator-=(), mlib::Point3< NDCZpt, NDCZvec >::operator/(), mlib::Point3< NDCZpt, NDCZvec >::operator/=(), mlib::Point3< NDCZpt, NDCZvec >::operator==(), and mlib::Point3< NDCZpt, NDCZvec >::set().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:48:11 2006 for jot by  doxygen 1.4.4