home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 3.ddi / BGICLA.ZIP / CIRCLE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-24  |  1022 b   |  38 lines

  1. /**************************************************************************
  2.     Listing 15 - CIRCLE.CPP
  3.  
  4.     Written by Kevin D. Weeks, April 1990
  5.     Released to the Public Domain
  6. */
  7.  
  8. #include "circle.hpp"
  9.  
  10. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  11.     Constructor - primary constructor. Copies of all attributes are
  12.     accepted although init_color and init_width may be defaults.
  13. */
  14. Circle::Circle(const int init_radius, const Point &init_center,
  15.                const COLORS init_color, const line_widths init_width)
  16. {
  17.     struct linesettingstype line_type;
  18.  
  19.     if (init_width == DEFAULT)
  20.     {
  21.         getlinesettings(&line_type);
  22.         width = (line_widths)line_type.thickness;
  23.     }
  24.     else
  25.         width = init_width;
  26.  
  27.     if (init_color == DEFAULT)
  28.         color = (COLORS)getcolor();
  29.     else
  30.         color = init_color;
  31.  
  32.     start_angle = 0;
  33.     end_angle = 360;
  34.     radius = init_radius;
  35.     center = init_center;
  36.     visible = FALSE;
  37. }
  38.