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

vppoint2d.cpp

Go to the documentation of this file.
00001 //deprecated
00003 //
00004 //  PROJECT.....: vpat - Creating Virtual Patients
00005 //  RESPONSIBLE.: Carla Freitas e Luciana Nedel
00006 //
00007 //  FILE........: vppoint2D.cpp
00008 //  DESCRIPTION.: Contain the VPPoint2D class implementation that 
00009 //                is responsible for the 2D point operations.
00010 //
00011 //  AUTHOR......: Isabel Harb Manssour
00012 //  DATE........: July/10/2000
00013 //  DESCRIPTION.: Implementation of the class VPPoint2D methods.
00014 //
00015 //  AUTHOR......: Isabel Harb Manssour
00016 //  DATE........: September/06/2001
00017 //  DESCRIPTION.: Attributes change for "x", "y", and public.
00018 //
00020 
00021 #include <vppoint2d.h>
00022 
00023 
00025 // Description: Class "VPPoint2D" constructor without parameter.
00026 // Parameters.: -
00027 // Return.....: -
00028 
00029 VPPoint2D::VPPoint2D () {
00030     x = 0.0;
00031     y = 0.0;
00032 }
00033 
00034 
00036 // Description: Class "VPPoint2D" constructor with parameter.
00037 // Parameters.: float xi (initial x value), 
00038 //              float yi (initial y value)
00039 // Return.....: -
00040 
00041 VPPoint2D::VPPoint2D (float xi, float yi) {
00042     x = xi;
00043     y = yi;
00044 }
00045 
00046 
00048 // Description: Method "vpGetX" returns the value of x attribute.
00049 // Parameters.: -
00050 // Return.....: x (value of x attribute)
00051 
00052 float VPPoint2D::vpGetX() {
00053     return x;
00054 }
00055 
00056 
00058 // Description: Method "vpGetY" returns the value of y attribute.
00059 // Parameters.: -
00060 // Return.....: y(value of y attribute)
00061 
00062 float VPPoint2D::vpGetY() {
00063     return y;
00064 }
00065 
00066 
00068 // Description: Method "vpGetXY" set the value of x and y  
00069 //              atributes to the parameters.
00070 // Parameters.: float x (which receives the x value)
00071 //              float y (which receives the y value)    
00072 // Return.....: -
00073 
00074 void VPPoint2D::vpGetXY(float &_x, float &_y) {
00075     _x = x;
00076     _y = y;
00077 }
00078 
00079 
00080 
00082 
00083 // Description: Method "vpGetPoint2D" get the point value.     
00084 
00085 // Parameters.: -   
00086 
00087 // Return.....: VPPoint2D (object)
00088 
00089 
00090 
00091 VPPoint2D VPPoint2D::vpGetPoint2D(void) {
00092     return *this;
00093 }
00094 
00095 
00096 
00097 
00099 // Description: Method "vpSetX" sends a new value to the x attribute.
00100 // Parameters.: float x (contains a new value for x attribute)
00101 // Return.....: -       
00102 
00103 void VPPoint2D::vpSetX(float _x) {
00104     x = _x;
00105 }
00106     
00107 
00109 // Description: Method "vpSetY" sends a new value to the y attribute.
00110 // Parameters.: float y (contains a new value for y attribute)
00111 // Return.....: -       
00112 
00113 void VPPoint2D::vpSetY(float _y) {
00114     y = _y;
00115 }
00116 
00117 
00119 // Description: Method "vpSetXY" sends a new value to the x and y 
00120 //              attribute.
00121 // Parameters.: float x (contains a new value for x attribute)
00122 //              float y (contains a new value for y attribute)
00123 // Return.....: -       
00124 
00125 void VPPoint2D::vpSetXY(float _x, float _y) {
00126     x = _x;
00127     y = _y;
00128 }
00129 
00130 
00132 // Description: Method that implements the overload of = operator
00133 // Parameters.: VPPoint2D p (object that has the new value for the
00134 //                         attributes of the class)
00135 // Return.....: VPPoint2D (current object)
00136 
00137 VPPoint2D VPPoint2D::operator= (VPPoint2D p) {
00138     x = p.x;
00139     y = p.y;
00140     return *this;
00141 }
00142 
00143 
00145 // Description: Method that implements the overload of = operator
00146 // Parameters.: int num (number that will be subtracted)
00147 // Return.....: VPPoint2D (current object)
00148 
00149 VPPoint2D VPPoint2D::operator- (int num) {
00150     x = x - num;
00151     y = y - num;
00152     return *this;
00153 }

Generated on Tue Sep 6 10:00:05 2005 for VPAT by  doxygen 1.4.4