From 606c91bb471928c697b119c0e7e7a67a58644ace Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 11 Apr 2013 14:56:10 -0700 Subject: [PATCH] remove the Vector3D class, not in use --- interface/src/Vector3D.cpp | 267 ------------------------------------- interface/src/Vector3D.h | 66 --------- 2 files changed, 333 deletions(-) delete mode 100755 interface/src/Vector3D.cpp delete mode 100755 interface/src/Vector3D.h diff --git a/interface/src/Vector3D.cpp b/interface/src/Vector3D.cpp deleted file mode 100755 index 0e6393ecac..0000000000 --- a/interface/src/Vector3D.cpp +++ /dev/null @@ -1,267 +0,0 @@ -//----------------------------------------------------------- -// -// Created by Jeffrey Ventrella and added as a utility -// class for High Fidelity Code base, April 2013 -// -//----------------------------------------------------------- - -#include "Vector3D.h" -#include // "Math.h" - -//--------------------------------------- -Vector3D::Vector3D() -{ - x = 0.0; - y = 0.0; - z = 0.0; -} - -//--------------------------------------- -Vector3D::Vector3D( double x_, double y_, double z_ ) -{ - x = x_; - y = y_; - z = z_; -} - -//--------------------------------------- -Vector3D::Vector3D( const Vector3D & v ) -{ - x = v.x; - y = v.y; - z = v.z; -} - -//----------------------------------------------------- -void Vector3D::setXYZ( double x_, double y_, double z_ ) -{ - x = x_; - y = y_; - z = z_; -} - - -//--------------------- -void Vector3D::clear() -{ - x = 0.0; - y = 0.0; - z = 0.0; -} - - -//----------------------------------------------------- -void Vector3D::addXYZ( double x_, double y_, double z_ ) -{ - x += x_; - y += y_; - z += z_; -} - -//--------------------------------------- -void Vector3D::set( const Vector3D &v ) -{ - x = v.x; - y = v.y; - z = v.z; -} - -//------------------------------------- -void Vector3D::add( const Vector3D &v ) -{ - x += v.x; - y += v.y; - z += v.z; -} - - -//-------------------------------------------- -void Vector3D::subtract ( const Vector3D &v ) -{ - x -= v.x; - y -= v.y; - z -= v.z; -} - -//----------------------------------------------------- -void Vector3D::addScaled( const Vector3D &v, double s ) -{ - x += v.x * s; - y += v.y * s; - z += v.z * s; -} - -//----------------------------------------------------- -void Vector3D::subtractScaled( const Vector3D &v, double s ) -{ - x -= v.x * s; - y -= v.y * s; - z -= v.z * s; -} - - -//------------------------- -void Vector3D::normalize() -{ - double d = sqrt( x * x + y * y + z * z ); - - if ( d > 0.0 ) - { - x /= d; - y /= d; - z /= d; - } -} - - -//-------------------------------------------- -void Vector3D::setX ( double x_ ) { x = x_; } -void Vector3D::setY ( double y_ ) { y = y_; } -void Vector3D::setZ ( double z_ ) { z = z_; } - -void Vector3D::addX ( double x_ ) { x += x_; } -void Vector3D::addY ( double y_ ) { y += y_; } -void Vector3D::addZ ( double z_ ) { z += z_; } - -double Vector3D::getX () { return x; } -double Vector3D::getY () { return y; } -double Vector3D::getZ () { return z; } - -void Vector3D::scaleX ( double s ) { x *= s; } -void Vector3D::scaleY ( double s ) { y *= s; } -void Vector3D::scaleZ ( double s ) { z *= s; } - - -//----------------------------------------------------- -void Vector3D::setToScaled( const Vector3D &v, double s ) -{ - Vector3D c; - - x = v.x * s; - y = v.y * s; - z = v.z * s; -} - -//-------------------------------------------------------------------- -void Vector3D::setToAverage( const Vector3D &v1, const Vector3D &v2 ) -{ - x = v1.x + ( v2.x - v1.x ) * 0.5; - y = v1.y + ( v2.y - v1.y ) * 0.5; - z = v1.z + ( v2.z - v1.z ) * 0.5; -} - - -//----------------------------------------------------- -void Vector3D::setToDifference( const Vector3D &v1, const Vector3D &v2 ) -{ - x = v1.x - v2.x; - y = v1.y - v2.y; - z = v1.z - v2.z; -} - -//----------------------------------------------------- -void Vector3D::scale( double s ) -{ - x *= s; - y *= s; - z *= s; -} - -//----------------------------------------------------- -double Vector3D::getMagnitude() -{ - return sqrt( x * x + y * y + z * z ); -} - - -//----------------------------------------------------- -double Vector3D::getMagnitudeSquared() -{ - return x * x + y * y + z * z ; -} - -//----------------------------------------------------- -double Vector3D::getDistanceTo( const Vector3D &v ) -{ - double xx = v.x - x; - double yy = v.y - y; - double zz = v.z - z; - - return sqrt( xx * xx + yy * yy + zz * zz ); -} - - -//----------------------------------------------------- -double Vector3D::getDistanceSquaredTo( const Vector3D &v ) -{ - double xx = v.x - x; - double yy = v.y - y; - double zz = v.z - z; - - return xx * xx + yy * yy + zz * zz; -} - - -//------------------------------------------------------------------- -double Vector3D::getDistance( const Vector3D &v1, const Vector3D &v2 ) -{ - double xx = v2.x - v1.x; - double yy = v2.y - v1.y; - double zz = v2.z - v1.z; - - return sqrt( xx * xx + yy * yy + zz * zz ); -} - - -//--------------------------------------------------------------------------- -double Vector3D::getDistanceSquared( const Vector3D &v1, const Vector3D &v2 ) -{ - double xx = v2.x - v1.x; - double yy = v2.y - v1.y; - double zz = v2.z - v1.z; - - return xx * xx + yy * yy + zz * zz; -} - - -//----------------------------------------------------- -double Vector3D::dotWith( const Vector3D &v ) -{ - return - x * v.x + - y * v.y + - z * v.z; -} - - - -//----------------------------------------------------------------- -void Vector3D::setToCross( const Vector3D &v1, const Vector3D &v2 ) -{ - x = v1.z * v2.y - v1.y * v2.z; - y = v1.x * v2.z - v1.z * v2.x; - z = v1.y * v2.x - v1.x * v2.y; -} - - -//--------------------------------------------------------------- -void Vector3D::setToSum( const Vector3D &v1, const Vector3D &v2 ) -{ - x = v1.x + v2.x; - y = v1.y + v2.y; - z = v1.z + v2.z; -} - - -//----------------------------------------------------- -void Vector3D::halve() -{ - x *= 0.5; - y *= 0.5; - z *= 0.5; -} - - - - - diff --git a/interface/src/Vector3D.h b/interface/src/Vector3D.h deleted file mode 100755 index 9b2bc9744c..0000000000 --- a/interface/src/Vector3D.h +++ /dev/null @@ -1,66 +0,0 @@ -//----------------------------------------------------------- -// -// Created by Jeffrey Ventrella and added as a utility -// class for High Fidelity Code base, April 2013 -// -//----------------------------------------------------------- - -#ifndef __interface__vector3D__ -#define __interface__vector3D__ - -class Vector3D -{ -public: - - //------------------ - // members - //------------------ - double x; - double y; - double z; - - //------------------ - // methods - //------------------ - Vector3D(); - Vector3D( double, double, double ); - Vector3D( const Vector3D & ); - - void clear(); - void set ( const Vector3D & ); - void setToScaled ( const Vector3D &, double ); - void add ( const Vector3D & ); - void subtract ( const Vector3D & ); - void addScaled ( const Vector3D &, double ); - void subtractScaled ( const Vector3D &, double ); - void normalize (); - void setToCross ( const Vector3D &, const Vector3D & ); - void setToAverage ( const Vector3D &, const Vector3D & ); - void setToSum ( const Vector3D &, const Vector3D & ); - void setXYZ ( double, double, double ); - void addXYZ ( double, double, double ); - void setX ( double ); - void setY ( double ); - void setZ ( double ); - void addX ( double ); - void addY ( double ); - void addZ ( double ); - void scaleX ( double ); - void scaleY ( double ); - void scaleZ ( double ); - void halve (); - double getX (); - double getY (); - double getZ (); - double getMagnitude (); - double getMagnitudeSquared (); - double getDistance ( const Vector3D &, const Vector3D & ); - double getDistanceSquared ( const Vector3D &, const Vector3D & ); - double getDistanceTo ( const Vector3D & ); - double getDistanceSquaredTo( const Vector3D & ); - double dotWith ( const Vector3D & ); - void scale ( double ); - void setToDifference ( const Vector3D &, const Vector3D & ); -}; - -#endif