Biomechanical Joint Model
 Author: Anderson Maciel

comepoint2d.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2000 by Anderson Maciel                                 *
00003  *   andi.maciel@gmail.com                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  **************************************************************************/
00020 
00031 
00032 
00033 #include <algebra/comepoint2d.h>
00034 
00035 
00037 // Description: Class "COME_Point2D" constructor without parameter.
00038 // Parameters.: -
00039 // Return.....: -
00040 
00041 COME_Point2D::COME_Point2D () {
00042         point[0] = 0.0;
00043         point[1] = 0.0;
00044 }
00045 
00046 
00048 // Description: Class "COME_Point2D" constructor with parameter.
00049 // Parameters.: double xi (initial x value), 
00050 //                              double yi (initial y value)
00051 // Return.....: -
00052 
00053 COME_Point2D::COME_Point2D (double xi, double yi) {
00054         point[0] = xi;
00055         point[1] = yi;
00056 }
00057 
00058 
00060 // Description: Method "getX" returns the value of x attribute.
00061 // Parameters.: -
00062 // Return.....: point[0] (value of x attribute)
00063 
00064 double COME_Point2D::getX() {
00065         return point[0];
00066 }
00067 
00068 
00070 // Description: Method "getY" returns the value of y attribute.
00071 // Parameters.: -
00072 // Return.....: point[1] (value of y attribute)
00073 
00074 double COME_Point2D::getY() {
00075         return point[1];
00076 }
00077 
00078 
00080 // Description: Method "getXY" set the value of x and y  
00081 //                              atributes to the parameters.
00082 // Parameters.: double x (which receives the x value)
00083 //                              double y (which receives the y value)   
00084 // Return.....: -
00085 
00086 void COME_Point2D::getXY(double &x, double &y) {
00087         x = point[0];
00088         y = point[1];
00089 }
00090 
00091 
00092 
00094 
00095 // Description: Method "getPoint2D" get the point value.     
00096 
00097 // Parameters.: -       
00098 
00099 // Return.....: COME_Point2D (object)
00100 
00101 
00102 
00103 COME_Point2D COME_Point2D::getPoint2D(void) {
00104 
00105         return *this;
00106 
00107 }
00108 
00109 
00110 
00111 
00113 // Description: Method "setX" sends a new value to the x attribute.
00114 // Parameters.: double x (contains a new value for x attribute)
00115 // Return.....: -               
00116 
00117 void COME_Point2D::setX(double x) {
00118         point[0] = x;
00119 }
00120         
00121 
00123 // Description: Method "setY" sends a new value to the y attribute.
00124 // Parameters.: double y (contains a new value for y attribute)
00125 // Return.....: -               
00126 
00127 void COME_Point2D::setY(double y) {
00128         point[1] = y;
00129 }
00130 
00131 
00133 // Description: Method "setXY" sends a new value to the x and y 
00134 //                              attribute.
00135 // Parameters.: double x (contains a new value for x attribute)
00136 //                              double y (contains a new value for y attribute)
00137 // Return.....: -               
00138 
00139 void COME_Point2D::setXY(double x, double y) {
00140         point[0] = x;
00141         point[1] = y;
00142 }
00143 
00144 
00146 // Description: Method that implements the overload of = operator
00147 // Parameters.: COME_Point2D p (object that has the new value for the
00148 //                                             attributes of the class)
00149 // Return.....: COME_Point2D (current object)
00150 
00151 COME_Point2D COME_Point2D::operator= (COME_Point2D p) {
00152         point[0] = p.point[0];
00153         point[1] = p.point[1];
00154         return *this;
00155 }
00156 
00157 COME_Point2D COME_Point2D::operator- (const COME_Point2D& p) const{
00158  COME_Point2D vv(point[0]-p.point[0], point[1]-p.point[1]);
00159  return ( vv ) ;
00160 } 

Generated on Thu Dec 1 10:13:35 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5