МО РФ
НГТУ
Расчётно-графическое задание.
по курсу
ООП
Факультет ПМИ
Группа ПМ-21
Студент Воронов А. С.
Преподаватель Полетаева И А
Новосибирск 2003
Цель работы:
Составить совокупность диаграмм классов в среде Rational Rose, соответствующую графической системе, разработанной в лабораторной работе №5, и произвести автоматическую генерацию прототипа кода разработанных классов.
Составить диаграмму классов, содержащую пакет (пространство имен), и вложенные в нее диаграммы, содержащие
– геометрические фигуры;
– шаблон и инстанцированные контейнеры.
Описание классов
Класс figure – исходный класс содержащий виртуальные функции и информацию о секторе (радиус, начальный и конечный углы)
#ifndef figure_h
#define figure_h 1
class figure
{
public:
figure(const figure &right);
~figure();
figure & operator=(const figure &right);
int operator==(const figure &right) const;
int operator!=(const figure &right) const;
virtual void set ();
virtual int draw ();
virtual void get ();
protected:
private:
const int& get_r () const;
const int& get_nu () const;
const int& get_ku () const;
int r;
int nu;
int ku;
private:
};
inline figure::figure ()
{}
inline const int& figure::get_r () const
{ return r;}
inline const int& figure::get_nu () const
{ return nu;}
inline const int& figure::get_ku () const
{ return ku;}
#endif
Класс figure_contur – потомок класса figure (добавлена информация о цвете линии)
#ifndef figureContur_h
#define figureContur_h 1
#include "figure.h"
class figureContur : public figure
{ public:
figureContur(const figureContur &right);
figureContur ();
~figureContur();
figureContur & operator=(const figureContur &right);
int operator==(const figureContur &right) const;
int operator!=(const figureContur &right) const;
void set ();
int draw ();
void get ();
protected:
private:
const int& get_lineColor () const;
int lineColor;
};
inline figureContur::figureContur ()
{}
inline void figureContur::set ()
{}
inline int figureContur::draw ()
{}
inline void figureContur::get ()
{}
inline const int& figureContur::get_lineColor () const
{ return lineColor;}
#endif
Класс paint – класс – закраска, содержащий информацию о цвете фона, о цвете и типе закраски фигуры
#ifndef paint_h
#define paint_h 1
class paint
{
public:
paint(const paint &right);
~paint();
paint & operator=(const paint &right);
int operator==(const paint &right) const;
int operator!=(const paint &right) const;
void set ();
void get ();
void feepPaint ();
void figurePaint ();
protected:
private:
const int& get_color () const;
const int& get_type () const;
const int& get_feepColor () const;
int color;
int type;
int feepColor;
};
inline paint::paint ()
{}
inline void paint::set ()
{}
inline void paint::get ()
{}
inline void paint::feepPaint ()
{}
inline void paint::figurePaint ()
{}
inline const int& paint::get_color () const
{ return color;}
inline const int& paint::get_type () const
{ return type;}
inline const int& paint::get_feepColor () const
{ return feepColor;}
#endif
Класс fillFigure – закрашенная фигура – потомок paint и figure_contur
#ifndef fillFigure_h
#define fillFigure_h 1
#include "paint.h"
#include "figureContur.h"
class fillFigure : public figureContur,
public paint
{
public:
fillFigure();
fillFigure(const fillFigure &right);
~fillFigure();
fillFigure & operator=(const fillFigure &right);
int operator==(const fillFigure &right) const;
int operator!=(const fillFigure &right) const;
void set ();
int draw ();
void get ();
protected:
private:
};
inline void fillFigure::set ()
{}
inline int fillFigure::draw ()
{}
inline void fillFigure::get ()
{}
#endif
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.