home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / VCW411.ZIP / CIRCLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-29  |  3.2 KB  |  145 lines

  1. #ifndef   CIRCLE_H
  2. #define   CIRCLE_H
  3.  
  4. // -[Keep_Heading]-
  5.  
  6.  
  7. // -[Copyright_Mesg]-
  8. // --------------------------------------------------------------- //
  9. // (c) Copyright 1993-1994. Step Ahead Software Pty Limited. All rights reserved.
  10. // Class Name  : Circle
  11. // Designer    : Example Writer
  12. // Filename    : CIRCLE.h
  13. // Description : 
  14. // Circle objects are objects in the system that are shown on the screen
  15. // as a circle at a location X,Y with a size specified by Radius. Their
  16. // colour is determined by the protected Colour member in their base
  17. // class Shape.
  18. // --------------------------------------------------------------- //
  19.  
  20. // ==================================================
  21. // = LIBRARY
  22. // Step 3 Graphics Example
  23. // = FILENAME
  24. // CIRCLE.cpp
  25. // = RCSID
  26. // $Id$
  27. // = AUTHOR
  28. // Example Writer
  29. // = COPYRIGHT
  30. // (c) Copyright 1993-1994. Step Ahead Software Pty Limited. All rights reserved.
  31. // ==================================================
  32. #define    CC_GEN    1
  33. #include    "SHAPE.h"
  34.  
  35. #include  "genclsid.h"
  36.  
  37.  
  38. // -[Keep_h_Extras]-
  39.  
  40.  
  41. // -[Class_Dec]-
  42. class Circle;
  43. typedef Circle * PCircle;
  44. typedef Circle & RCircle;
  45. typedef Circle * & RPCircle;
  46. typedef const Circle * PCCircle;
  47. typedef const Circle & RCCircle;
  48.  
  49.  
  50. class Circle : public Shape
  51. // = TITLE
  52. // Circle
  53. // = CLASSTYPE
  54. // Concrete
  55. // = AUDIENCE
  56. // 
  57. // = DESCRIPTION
  58. // Circle objects are objects in the system that are shown on the screen
  59. // as a circle at a location X,Y with a size specified by Radius. Their
  60. // colour is determined by the protected Colour member in their base
  61. // class Shape.
  62. // 
  63. // = NOTES
  64. // 
  65. // = SEE ALSO
  66. // Shape
  67. {
  68. // -[Keep_Class_Extras]-
  69.  
  70.  
  71. // -[Member_Data_Decs]-
  72.   public:
  73.   protected:
  74.  
  75.     // Radius of circle.
  76.     int Radius;
  77.   private:
  78.  
  79.  
  80. // -[Member_Function_Decs]-
  81.   public:
  82.  
  83.     // Constructs a circle object with the given parameters.
  84.     Circle(int InitX, int InitY, int InitRadius);
  85.  
  86.     // Returns a hash value
  87.     virtual hashValueType hashValue() const;
  88.  
  89.     // Unique class ID
  90.     virtual classType isA() const;
  91.  
  92.     // Tests Equality
  93.     virtual int isEqual(const Object& testObject) const;
  94.  
  95.     // Class Name
  96.     virtual char * nameOf() const;
  97.  
  98.     // Output Class Info
  99.     virtual void printOn(Rostream outputStream) const;
  100.  
  101.     // Draws the circle of radius given in the Radius member.
  102.     virtual void Show(HDC hDC);
  103.   protected:
  104.   private:
  105.  
  106.  
  107. // -[Persistent_1]-
  108.   // OWL1.0 Streamability
  109.   public:
  110.     Circle(StreamableInit); // Used to create a new object
  111.     static PTStreamable build();
  112.   protected:
  113.     // Reads data in from the stream
  114.     virtual Pvoid read(Ripstream is);    // Writes data out to the stream
  115.     virtual void write(Ropstream os);
  116.   private:
  117.     virtual const Pchar streamableName() const;
  118.  
  119. };
  120.  
  121. // -[Persistent_2]-
  122. // OWL1.0 Streamability
  123. inline Ripstream operator >> ( Ripstream is, RCircle cl )
  124.   { return is >> (RTStreamable)cl; }
  125. inline Ripstream operator >> ( Ripstream is, RPCircle cl )
  126.   { return is >> (RPvoid)cl; }
  127. inline Ropstream operator << ( Ropstream os, RCCircle cl )
  128.   { return os << (RTStreamable)cl; }
  129. inline Ropstream operator << ( Ropstream os, PCCircle cl )
  130.   { return os << (PTStreamable)cl; }
  131.  
  132.  
  133. // -[Keep]-
  134.  
  135.  
  136. // -[Global_Data_Decs]-
  137.  
  138.  
  139. // -[Global_Function_Decs]-
  140.  
  141. // -[Function_Defs]-
  142.  
  143. // -[End_Cond]-
  144. #endif
  145.