1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex4.2/Point.hh

36 lines
650 B
C++

//Point.hh
#ifndef POINT_HH
#define POINT_HH
class Point
{
public:
Point() { init(0, 0, 0) ; }
Point( double x, double y, double z ) { init( x, y, z ); }
int getX() const { return x ; }
bool setX( int new_x ) { return ( x = new_x ) ; }
int getY() const { return y ; }
bool setY( int new_y ) { return ( y = new_y ) ; }
int getZ() const { return z ; }
bool setZ( int new_z ) { return ( z = new_z ) ; }
void setPoint( double in_x, double in_y, double in_z ) {
x = in_x ;
y = in_y ;
z = in_z ;
}
private:
void init( double x, double y, double z ) {
setPoint( x, y, z );
}
double x, y, z = 0 ;
};
#endif