36 lines
641 B
C++
36 lines
641 B
C++
//Point.hh
|
|
#ifndef POINT_HH
|
|
#define POINT_HH
|
|
|
|
|
|
class Point
|
|
{
|
|
public:
|
|
Point( double x = 0, double y = 0, double z = 0) { init( x, y, z ) ; }
|
|
|
|
// No need for Constructor or Destructor
|
|
|
|
int getX() const { return x ; }
|
|
void setX( double new_x ) { x = new_x ; }
|
|
|
|
int getY() const { return y ; }
|
|
void setY( double new_y ) { y = new_y ; }
|
|
|
|
int getZ() const { return z ; }
|
|
void setZ( double new_z ) { z = new_z ; }
|
|
|
|
void setPoint( double x, double y, double z ) {
|
|
setX(x) ;
|
|
setY(y) ;
|
|
setZ(z) ;
|
|
}
|
|
|
|
|
|
private:
|
|
void init( double x, double y, double z ) {
|
|
setPoint( x, y, z ) ;
|
|
}
|
|
|
|
double x, y, z = 0 ;
|
|
};
|
|
#endif
|