Files
Avancerad_CPP/Lab6/rectngle.h
2026-03-05 13:16:26 +01:00

112 lines
2.9 KiB
C++

//## begin module.cm preserve=no
// %X% %Q% %Z% %W%
//## end module.cm
//## begin module.cp preserve=no
//## end module.cp
//## Module: Rectangle; Pseudo Package specification
//## Subsystem: Figures
//## Source file: Rectngle.h
#ifndef Rectngle_h
#define Rectngle_h 1
//## begin module.additionalIncludes preserve=no
//## end module.additionalIncludes
//## begin module.includes preserve=yes
//## end module.includes
// Point
#include "Point.h"
// Figure
#include "Figure.h"
//## begin module.additionalDeclarations preserve=yes
//## end module.additionalDeclarations
//## Class: Rectangle
//## Category: Figures
//## Subsystem: Figures
//## Persistence: Transient
//## Cardinality/Multiplicity: n
class Rectangle : virtual public Figure //## Inherits: <unnamed>
{
//## begin Rectangle.initialDeclarations preserve=yes
//## end Rectangle.initialDeclarations
public:
//## Constructors (generated)
Rectangle();
//## Constructors (specified)
//## Operation: Rectangle%939623932
Rectangle (int x1, int y1, int x2, int y2, Color color);
//## Destructor (generated)
~Rectangle();
//## Other Operations (specified)
//## Operation: draw%937398672
void draw (Graphics &g);
//## Operation: erase%937398673
void erase (Graphics &g);
//## Operation: clone%937398684
Figure * clone ();
// Additional Public Declarations
//## begin Rectangle.public preserve=yes
//## end Rectangle.public
protected:
// Additional Protected Declarations
//## begin Rectangle.protected preserve=yes
const Point getLT() const {return leftTop;}
void setLT(int x, int y){leftTop.setx(x);leftTop.sety(y);}
const Point getRB() const{return rightBottom;}
void setRB(int x, int y){rightBottom.setx(x);rightBottom.sety(y);}
//## end Rectangle.protected
private:
// Additional Private Declarations
//## begin Rectangle.private preserve=yes
//## end Rectangle.private
private: //## implementation
// Data Members for Has Relationships
//## Documentation Rectangle::leftTop.has
//## begin Rectangle::leftTop.has preserve=no private: Point {1 -> 1VO}
Point leftTop;
//## end Rectangle::leftTop.has
//## Documentation Rectangle::rightBottom.has
//## begin Rectangle::rightBottom.has preserve=no private: Point {1 -> 1VO}
Point rightBottom;
//## end Rectangle::rightBottom.has
// Additional Implementation Declarations
//## begin Rectangle.implementation preserve=yes
//## end Rectangle.implementation
};
//## begin Rectangle.postscript preserve=yes
//## end Rectangle.postscript
// Class Rectangle
//## begin module.epilog preserve=yes
//## end module.epilog
#endif