13CAD
CAD-like software based on C++, Qt and VTK.
 All Classes Files Functions Variables Friends
Public Member Functions | Protected Attributes | Friends | List of all members
Vector3D Class Reference

#include <vector3d.h>

Public Member Functions

 Vector3D (double x, double y, double z)
 
double getX ()
 
double getY ()
 
double getZ ()
 
void setX (double x)
 
void setY (double y)
 
void setZ (double z)
 
Vector3D operator+ (Vector3D rhsVector)
 
Vector3D operator- (Vector3D rhsVector)
 
double dot (Vector3D rhsVector)
 
Vector3D cross (Vector3D rhsVector)
 
Vector3D operator* (double scalar)
 
double distance (Vector3D &v2)
 
Vector3D midpoint (Vector3D &v2)
 

Protected Attributes

double x
 
double y
 
double z
 

Friends

class Matrix3x3
 
bool operator== (const Vector3D &lhsVector, const Vector3D &rhsVector)
 
Vector3D operator* (double scalar, Vector3D v)
 
std::ostream & operator<< (std::ostream &os, Vector3D &v)
 

Detailed Description

3D vector representation of a vertex.

Member Function Documentation

Vector3D Vector3D::cross ( Vector3D  rhsVector)

Cross product (returns a Vector3D)

Cross product

double Vector3D::distance ( Vector3D v2)

Return distance between two vertices

double Vector3D::dot ( Vector3D  rhsVector)

Dot product (returns a single value)

Dot product

double Vector3D::getX ( )

Return X coordinate

double Vector3D::getY ( )

Return Y coordinate

double Vector3D::getZ ( )

Return Z coordinate

Vector3D Vector3D::midpoint ( Vector3D v2)

Return midpoint between two vertices

Vector3D Vector3D::operator* ( double  scalar)

Scalar multiplication (Vector3D on left hand side)

Scalar multiplication - vector on lhs

Vector3D Vector3D::operator+ ( Vector3D  rhsVector)

Addition operation

Vector3D Vector3D::operator- ( Vector3D  rhsVector)

Subtract operation

void Vector3D::setX ( double  x)

Set X coordinate

void Vector3D::setY ( double  y)

Set Y coordinate

void Vector3D::setZ ( double  z)

Set Z coordinate

Friends And Related Function Documentation

Vector3D operator* ( double  scalar,
Vector3D  v 
)
friend

Scalar multiplication (Vector3D on right hand side)

Scalar multiplication - vector on rhs

std::ostream& operator<< ( std::ostream &  os,
Vector3D v 
)
friend

Output Vector3D

bool operator== ( const Vector3D lhsVector,
const Vector3D rhsVector 
)
friend

Equality operation

Member Data Documentation

double Vector3D::x
protected

X coordinate

double Vector3D::y
protected

Y coordinate

double Vector3D::z
protected

Z coordinate


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