88 lines
2.4 KiB
C++
88 lines
2.4 KiB
C++
//## begin module.cm preserve=no
|
|
|
|
// %X% %Q% %Z% %W%
|
|
|
|
//## end module.cm
|
|
|
|
|
|
|
|
//## begin module.cp preserve=no
|
|
|
|
//## end module.cp
|
|
|
|
|
|
|
|
//## Module: ComplexFigure; Pseudo Package body
|
|
|
|
//## Subsystem: Figures
|
|
|
|
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\CmplxFgr.cpp
|
|
|
|
|
|
|
|
//## begin module.additionalIncludes preserve=no
|
|
|
|
//## end module.additionalIncludes
|
|
|
|
|
|
|
|
//## begin module.includes preserve=yes
|
|
|
|
//## end module.includes
|
|
|
|
|
|
|
|
// ComplexFigure
|
|
|
|
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\CmplxFgr.h"
|
|
|
|
//## begin module.additionalDeclarations preserve=yes
|
|
|
|
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\Graphics.h"
|
|
|
|
//## end module.additionalDeclarations
|
|
|
|
|
|
|
|
|
|
|
|
// Class ComplexFigure
|
|
|
|
|
|
|
|
|
|
|
|
ComplexFigure::ComplexFigure()
|
|
|
|
//## begin ComplexFigure::ComplexFigure%.hasinit preserve=no
|
|
|
|
//## end ComplexFigure::ComplexFigure%.hasinit
|
|
|
|
//## begin ComplexFigure::ComplexFigure%.initialization preserve=yes
|
|
|
|
//## end ComplexFigure::ComplexFigure%.initialization
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::ComplexFigure%.body preserve=yes
|
|
|
|
//## end ComplexFigure::ComplexFigure%.body
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ComplexFigure::~ComplexFigure()
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::~ComplexFigure%.body preserve=yes
|
|
|
|
//## end ComplexFigure::~ComplexFigure%.body
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## Other Operations (implementation)
|
|
|
|
void ComplexFigure::draw (Graphics &g)
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::draw%939104770.body preserve=yes
|
|
|
|
for(int i = 0; i < myFList.getSize(); i++)
|
|
|
|
{
|
|
|
|
FigureHolder fh = myFList.getItem(i);
|
|
|
|
Figure* f = fh.getFigure();
|
|
|
|
f->draw(g);
|
|
|
|
}
|
|
|
|
//## end ComplexFigure::draw%939104770.body
|
|
|
|
}
|
|
|
|
|
|
|
|
void ComplexFigure::erase (Graphics &g)
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::erase%939104771.body preserve=yes
|
|
|
|
//## end ComplexFigure::erase%939104771.body
|
|
|
|
}
|
|
|
|
|
|
|
|
Figure * ComplexFigure::clone ()
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::clone%939104772.body preserve=yes
|
|
|
|
return new ComplexFigure(*this);
|
|
|
|
//## end ComplexFigure::clone%939104772.body
|
|
|
|
}
|
|
|
|
|
|
|
|
void ComplexFigure::add (FigureHolder figure)
|
|
|
|
{
|
|
|
|
//## begin ComplexFigure::add%939734506.body preserve=yes
|
|
|
|
myFList.add(myFList.getSize(), figure);
|
|
|
|
//## end ComplexFigure::add%939734506.body
|
|
|
|
}
|
|
|
|
|
|
|
|
// Additional Declarations
|
|
|
|
//## begin ComplexFigure.declarations preserve=yes
|
|
|
|
//## end ComplexFigure.declarations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## begin module.epilog preserve=yes
|
|
|
|
//## end module.epilog
|
|
|