#ifndef CCC_SHAP_H #define CCC_SHAP_H /**************************************************************************** ** COPYRIGHT (C): 1995 Cay S. Horstmann. All Rights Reserved. ** PROJECT: Computing Concepts with C++ 2E ** FILE: ccc_shap.h ** PURPOSE: defines shapes for graphics ** VERSION 2.0 ** PROGRAMMER: Cay Horstmann (CSH) ** Jiaoyang Zhou ** NOTE TO STUDENTS: Once you mastered chapter 8, you should be able ** to understand this file. Just ignore the EXPORT directives, though. ** They are used to automatically extract header files from source files. ****************************************************************************/ #line 16 "ccc_shap.cpp" #ifndef CCC_ANSI_H #include using namespace std; #endif #ifdef CCC_USE_OLD_CLIBS #include #else #include #endif #line 36 "ccc_shap.cpp" class Point { public: Point(); Point(double x1, double y1); double get_x() const; double get_y() const; void move(double dx, double dy); private: double x; double y; }; /*-------------------------------------------------------------------------*/ class Circle { public: Circle(); Circle(Point p, double r); Point get_center() const; double get_radius() const; void move(double dx, double dy); private: Point center; double radius; }; /*-------------------------------------------------------------------------*/ class Line { public: Line(); Line(Point p1, Point p2); Point get_start() const; Point get_end() const; void move(double dx, double dy); private: Point from; Point to; }; /*-------------------------------------------------------------------------*/ class Message { public: Message(); Message(Point s, double x); Message(Point s, const string& m); Point get_start() const; string get_message() const; void move(double dx, double dy); private: Point start; string message; }; #endif