first commit
This commit is contained in:
7079
Lab4/RoseModel.mdl
Normal file
7079
Lab4/RoseModel.mdl
Normal file
File diff suppressed because it is too large
Load Diff
106
Lab4/circle.cpp
Normal file
106
Lab4/circle.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Circle; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Circle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Circle
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Circle.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Circle
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Circle::Circle()
|
||||
|
||||
//## begin Circle::Circle%.hasinit preserve=no
|
||||
|
||||
//## end Circle::Circle%.hasinit
|
||||
|
||||
//## begin Circle::Circle%.initialization preserve=yes
|
||||
|
||||
//## end Circle::Circle%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Circle::Circle%.body preserve=yes
|
||||
|
||||
//## end Circle::Circle%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Circle::Circle (int x, int y, int r, Color color)
|
||||
|
||||
//## begin Circle::Circle%939623931.hasinit preserve=no
|
||||
|
||||
//## end Circle::Circle%939623931.hasinit
|
||||
|
||||
//## begin Circle::Circle%939623931.initialization preserve=yes
|
||||
|
||||
//## end Circle::Circle%939623931.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Circle::Circle%939623931.body preserve=yes
|
||||
|
||||
setColor(color);
|
||||
|
||||
center.setx(x);
|
||||
|
||||
center.sety(y);
|
||||
|
||||
radius=r;
|
||||
|
||||
//## end Circle::Circle%939623931.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Circle::~Circle()
|
||||
|
||||
108
Lab4/circle.h
Normal file
108
Lab4/circle.h
Normal file
@@ -0,0 +1,108 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Circle; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Circle.h
|
||||
|
||||
|
||||
|
||||
#ifndef Circle_h
|
||||
|
||||
#define Circle_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Point
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h"
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Circle
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Circle : public Figure //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin Circle.initialDeclarations preserve=yes
|
||||
|
||||
//## end Circle.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Circle();
|
||||
|
||||
|
||||
|
||||
//## Constructors (specified)
|
||||
|
||||
//## Operation: Circle%939623931
|
||||
|
||||
Circle (int x, int y, int r, Color color);
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Circle();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%937398670
|
||||
|
||||
void draw (Graphics &g);
|
||||
|
||||
87
Lab4/cmplxfgr.cpp
Normal file
87
Lab4/cmplxfgr.cpp
Normal file
@@ -0,0 +1,87 @@
|
||||
//## 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
|
||||
|
||||
}
|
||||
|
||||
|
||||
100
Lab4/cmplxfgr.h
Normal file
100
Lab4/cmplxfgr.h
Normal file
@@ -0,0 +1,100 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: ComplexFigure; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\CmplxFgr.h
|
||||
|
||||
|
||||
|
||||
#ifndef CmplxFgr_h
|
||||
|
||||
#define CmplxFgr_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
// FList
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FList.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: ComplexFigure
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class ComplexFigure : public Figure //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin ComplexFigure.initialDeclarations preserve=yes
|
||||
|
||||
//## end ComplexFigure.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
ComplexFigure();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~ComplexFigure();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%939104770
|
||||
|
||||
void draw (Graphics &g);
|
||||
|
||||
61
Lab4/fgrhlder.cpp
Normal file
61
Lab4/fgrhlder.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: FigureHolder; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FgrHlder.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// FigureHolder
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FgrHlder.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class FigureHolder
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FigureHolder::FigureHolder()
|
||||
|
||||
//## begin FigureHolder::FigureHolder%.hasinit preserve=no
|
||||
|
||||
//## end FigureHolder::FigureHolder%.hasinit
|
||||
|
||||
//## begin FigureHolder::FigureHolder%.initialization preserve=yes
|
||||
|
||||
//## end FigureHolder::FigureHolder%.initialization
|
||||
94
Lab4/fgrhlder.h
Normal file
94
Lab4/fgrhlder.h
Normal file
@@ -0,0 +1,94 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: FigureHolder; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FgrHlder.h
|
||||
|
||||
|
||||
|
||||
#ifndef FgrHlder_h
|
||||
|
||||
#define FgrHlder_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: FigureHolder
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class FigureHolder
|
||||
|
||||
{
|
||||
|
||||
//## begin FigureHolder.initialDeclarations preserve=yes
|
||||
|
||||
public:
|
||||
|
||||
FigureHolder(Figure& f)
|
||||
|
||||
{
|
||||
|
||||
myFigure = f.clone();
|
||||
|
||||
}
|
||||
|
||||
//## end FigureHolder.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
FigureHolder();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
68
Lab4/figure.cpp
Normal file
68
Lab4/figure.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Figure; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Figure
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Figure::Figure()
|
||||
|
||||
//## begin Figure::Figure%.hasinit preserve=no
|
||||
|
||||
//## end Figure::Figure%.hasinit
|
||||
|
||||
//## begin Figure::Figure%.initialization preserve=yes
|
||||
|
||||
//## end Figure::Figure%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Figure::Figure%.body preserve=yes
|
||||
|
||||
//## end Figure::Figure%.body
|
||||
|
||||
103
Lab4/figure.h
Normal file
103
Lab4/figure.h
Normal file
@@ -0,0 +1,103 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Figure; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h
|
||||
|
||||
|
||||
|
||||
#ifndef Figure_h
|
||||
|
||||
#define Figure_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Graphics
|
||||
|
||||
#include "Graphic\Graphics.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Figure; Abstract
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
//## Uses: <unnamed>; Graphics { -> }
|
||||
|
||||
|
||||
|
||||
class Figure
|
||||
|
||||
{
|
||||
|
||||
//## begin Figure.initialDeclarations preserve=yes
|
||||
|
||||
//## end Figure.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Figure();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Figure();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%937398679
|
||||
|
||||
virtual void draw (Graphics &g) = 0;
|
||||
|
||||
|
||||
|
||||
//## Operation: erase%937398680
|
||||
30
Lab4/flist.cpp
Normal file
30
Lab4/flist.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: FList; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FList.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
48
Lab4/flist.h
Normal file
48
Lab4/flist.h
Normal file
@@ -0,0 +1,48 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: FList; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FList.h
|
||||
|
||||
|
||||
|
||||
#ifndef FList_h
|
||||
|
||||
#define FList_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// List
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\List.h"
|
||||
|
||||
// FigureHolder
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\FgrHlder.h"
|
||||
|
||||
71
Lab4/graphic/dbggrphc.cpp
Normal file
71
Lab4/graphic/dbggrphc.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: DebugGraphics; Pseudo Package body
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\DbgGrphc.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// DebugGraphics
|
||||
|
||||
#include "Graphic\DbgGrphc.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class DebugGraphics
|
||||
|
||||
|
||||
|
||||
DebugGraphics::DebugGraphics()
|
||||
|
||||
//## begin DebugGraphics::DebugGraphics%.hasinit preserve=no
|
||||
|
||||
//## end DebugGraphics::DebugGraphics%.hasinit
|
||||
|
||||
//## begin DebugGraphics::DebugGraphics%.initialization preserve=yes
|
||||
|
||||
//## end DebugGraphics::DebugGraphics%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin DebugGraphics::DebugGraphics%.body preserve=yes
|
||||
|
||||
//## end DebugGraphics::DebugGraphics%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
89
Lab4/graphic/dbggrphc.h
Normal file
89
Lab4/graphic/dbggrphc.h
Normal file
@@ -0,0 +1,89 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: DebugGraphics; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\DbgGrphc.h
|
||||
|
||||
|
||||
|
||||
#ifndef DbgGrphc_h
|
||||
|
||||
#define DbgGrphc_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Graphics
|
||||
|
||||
#include "Graphic\Graphics.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\DbgGrphc.h"
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: DebugGraphics
|
||||
|
||||
//## Category: Graphic
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class DebugGraphics : public Graphics //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin DebugGraphics.initialDeclarations preserve=yes
|
||||
|
||||
//## end DebugGraphics.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
DebugGraphics();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~DebugGraphics();
|
||||
|
||||
|
||||
82
Lab4/graphic/graphics.cpp
Normal file
82
Lab4/graphic/graphics.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Graphics; Pseudo Package body
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\Graphics.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Graphics
|
||||
|
||||
#include "Graphic\Graphics.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Graphics
|
||||
|
||||
|
||||
|
||||
Graphics::Graphics()
|
||||
|
||||
//## begin Graphics::Graphics%.hasinit preserve=no
|
||||
|
||||
//## end Graphics::Graphics%.hasinit
|
||||
|
||||
//## begin Graphics::Graphics%.initialization preserve=yes
|
||||
|
||||
//## end Graphics::Graphics%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Graphics::Graphics%.body preserve=yes
|
||||
|
||||
//## end Graphics::Graphics%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Graphics::~Graphics()
|
||||
|
||||
{
|
||||
|
||||
//## begin Graphics::~Graphics%.body preserve=yes
|
||||
|
||||
//## end Graphics::~Graphics%.body
|
||||
|
||||
95
Lab4/graphic/graphics.h
Normal file
95
Lab4/graphic/graphics.h
Normal file
@@ -0,0 +1,95 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Graphics; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Graphic\Graphics.h
|
||||
|
||||
|
||||
|
||||
#ifndef Graphics_h
|
||||
|
||||
#define Graphics_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
#include "Point.h"
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Point
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
typedef int Color;
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Graphics; Abstract
|
||||
|
||||
//## Category: Graphic
|
||||
|
||||
//## Subsystem: Graphic
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
//## Uses: <unnamed>; Point { -> }
|
||||
|
||||
|
||||
|
||||
class Graphics
|
||||
|
||||
{
|
||||
|
||||
//## begin Graphics.initialDeclarations preserve=yes
|
||||
|
||||
//## end Graphics.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Graphics();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Graphics();
|
||||
|
||||
|
||||
120
Lab4/line.cpp
Normal file
120
Lab4/line.cpp
Normal file
@@ -0,0 +1,120 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Line; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Line.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Line
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Line.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Line
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Line::Line (int x1, int y1, int x2, int y2, Color color)
|
||||
|
||||
//## begin Line::Line%939623930.hasinit preserve=no
|
||||
|
||||
//## end Line::Line%939623930.hasinit
|
||||
|
||||
//## begin Line::Line%939623930.initialization preserve=yes
|
||||
|
||||
//## end Line::Line%939623930.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Line::Line%939623930.body preserve=yes
|
||||
|
||||
setColor(color);
|
||||
|
||||
|
||||
|
||||
Point start, end;
|
||||
|
||||
start.setx(x1);
|
||||
|
||||
start.sety(y1);
|
||||
|
||||
end.setx(x2);
|
||||
|
||||
end.sety(y2);
|
||||
|
||||
myPoints.add(myPoints.getSize(), start);
|
||||
|
||||
myPoints.add(myPoints.getSize(), end);
|
||||
|
||||
//## end Line::Line%939623930.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Line::~Line()
|
||||
|
||||
{
|
||||
|
||||
//## begin Line::~Line%.body preserve=yes
|
||||
|
||||
//## end Line::~Line%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (implementation)
|
||||
|
||||
void Line::draw (Graphics &g)
|
||||
|
||||
{
|
||||
|
||||
//## begin Line::draw%937398668.body preserve=yes
|
||||
|
||||
Point start,end;
|
||||
|
||||
101
Lab4/line.h
Normal file
101
Lab4/line.h
Normal file
@@ -0,0 +1,101 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Line; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Line.h
|
||||
|
||||
|
||||
|
||||
#ifndef Line_h
|
||||
|
||||
#define Line_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// pList
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\pList.h"
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Line
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Line : public Figure //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin Line.initialDeclarations preserve=yes
|
||||
|
||||
//## end Line.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (specified)
|
||||
|
||||
//## Operation: Line%939623930
|
||||
|
||||
Line (int x1, int y1, int x2, int y2, Color color);
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Line();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%937398668
|
||||
|
||||
void draw (Graphics &g);
|
||||
136
Lab4/list.cpp
Normal file
136
Lab4/list.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: List; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\List.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// List
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\List.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Parameterized Class List
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
|
||||
List<T>::List()
|
||||
|
||||
//## begin List::List%.hasinit preserve=no
|
||||
|
||||
: size(0)
|
||||
|
||||
//## end List::List%.hasinit
|
||||
|
||||
//## begin List::List%.initialization preserve=yes
|
||||
|
||||
//## end List::List%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin List::List%.body preserve=yes
|
||||
|
||||
head=NULL;
|
||||
|
||||
//## end List::List%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
|
||||
List<T>::~List()
|
||||
|
||||
{
|
||||
|
||||
//## begin List::~List%.body preserve=yes
|
||||
|
||||
delete head;
|
||||
|
||||
//## end List::~List%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (implementation)
|
||||
|
||||
template <class T>
|
||||
|
||||
void List<T>::add (int position, T item)
|
||||
|
||||
{
|
||||
|
||||
//## begin List::add%937398674.body preserve=yes
|
||||
|
||||
|
||||
|
||||
size++;
|
||||
|
||||
Node<T>* newPtr = new Node<T>(item);
|
||||
|
||||
|
||||
|
||||
if (position==0) {
|
||||
|
||||
newPtr->next=head;
|
||||
|
||||
head=newPtr;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
Node<T>* prev=head;
|
||||
|
||||
111
Lab4/list.h
Normal file
111
Lab4/list.h
Normal file
@@ -0,0 +1,111 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: List; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\List.h
|
||||
|
||||
|
||||
|
||||
#ifndef List_h
|
||||
|
||||
#define List_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Node
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Node.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: List; Parameterized Class
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
|
||||
class List
|
||||
|
||||
{
|
||||
|
||||
//## begin List.initialDeclarations preserve=yes
|
||||
|
||||
//## end List.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
List();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~List();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: add%937398674
|
||||
|
||||
// Denna sätter in grejjer i listan...
|
||||
|
||||
void add (int position, T item);
|
||||
|
||||
|
||||
|
||||
//## Operation: del%937398675
|
||||
|
||||
void del (int position);
|
||||
|
||||
|
||||
|
||||
//## Operation: isEmpty%937398676
|
||||
|
||||
bool isEmpty ();
|
||||
61
Lab4/main.cpp
Normal file
61
Lab4/main.cpp
Normal file
@@ -0,0 +1,61 @@
|
||||
//#
|
||||
|
||||
//# main.c
|
||||
|
||||
//#
|
||||
|
||||
//# =======================================================
|
||||
|
||||
//# Lab i Avacerad C++
|
||||
|
||||
//# 4. Figures
|
||||
|
||||
//#
|
||||
|
||||
//#
|
||||
|
||||
//# Christian Ohlsson
|
||||
|
||||
//# Daniel Alfredsson
|
||||
|
||||
//# Karlstads universitet
|
||||
|
||||
//# 991013
|
||||
|
||||
//# =======================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
#include "Graphic\Graphics.h"
|
||||
|
||||
#include "line.h"
|
||||
|
||||
#include "rectngle.h"
|
||||
|
||||
#include "circle.h"
|
||||
|
||||
#include "flist.h"
|
||||
|
||||
#include "CmplxFgr.h"
|
||||
|
||||
|
||||
|
||||
void main(void) {
|
||||
|
||||
ComplexFigure cf;
|
||||
|
||||
FList myList;
|
||||
|
||||
Graphics g;
|
||||
|
||||
|
||||
|
||||
Line l(0,0,0,10, 9);
|
||||
|
||||
l.add(20,20);
|
||||
|
||||
|
||||
66
Lab4/node.cpp
Normal file
66
Lab4/node.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Node; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Node.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Node
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Node.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Parameterized Class Node
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
|
||||
Node<T>::Node()
|
||||
|
||||
//## begin Node::Node%.hasinit preserve=no
|
||||
|
||||
//## end Node::Node%.hasinit
|
||||
|
||||
//## begin Node::Node%.initialization preserve=yes
|
||||
|
||||
//## end Node::Node%.initialization
|
||||
|
||||
97
Lab4/node.h
Normal file
97
Lab4/node.h
Normal file
@@ -0,0 +1,97 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Node; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Node.h
|
||||
|
||||
|
||||
|
||||
#ifndef Node_h
|
||||
|
||||
#define Node_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Node; Parameterized Class
|
||||
|
||||
// detta är lite dokumentation
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
template <class T>
|
||||
|
||||
class Node
|
||||
|
||||
{
|
||||
|
||||
//## begin Node.initialDeclarations preserve=yes
|
||||
|
||||
public:
|
||||
|
||||
Node(T theData):data(theData){next = (Node<T>*)0;}
|
||||
|
||||
//## end Node.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Node();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Node();
|
||||
|
||||
|
||||
|
||||
// Additional Public Declarations
|
||||
|
||||
//## begin Node.public preserve=yes
|
||||
|
||||
Node *next;
|
||||
30
Lab4/plist.cpp
Normal file
30
Lab4/plist.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: pList; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\pList.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
48
Lab4/plist.h
Normal file
48
Lab4/plist.h
Normal file
@@ -0,0 +1,48 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: pList; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\pList.h
|
||||
|
||||
|
||||
|
||||
#ifndef pList_h
|
||||
|
||||
#define pList_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// List
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\List.h"
|
||||
|
||||
// Point
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h"
|
||||
|
||||
83
Lab4/point.cpp
Normal file
83
Lab4/point.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Point; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Point
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Point
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Point::Point()
|
||||
|
||||
//## begin Point::Point%.hasinit preserve=no
|
||||
|
||||
//## end Point::Point%.hasinit
|
||||
|
||||
//## begin Point::Point%.initialization preserve=yes
|
||||
|
||||
//## end Point::Point%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Point::Point%.body preserve=yes
|
||||
|
||||
//## end Point::Point%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Point::~Point()
|
||||
|
||||
{
|
||||
|
||||
//## begin Point::~Point%.body preserve=yes
|
||||
|
||||
//## end Point::~Point%.body
|
||||
101
Lab4/point.h
Normal file
101
Lab4/point.h
Normal file
@@ -0,0 +1,101 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Point; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h
|
||||
|
||||
|
||||
|
||||
#ifndef Point_h
|
||||
|
||||
#define Point_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Point
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Point
|
||||
|
||||
{
|
||||
|
||||
//## begin Point.initialDeclarations preserve=yes
|
||||
|
||||
//## end Point.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Point();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Point();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: getx%937398664
|
||||
|
||||
int getx ();
|
||||
|
||||
|
||||
|
||||
//## Operation: gety%937398665
|
||||
|
||||
int gety ();
|
||||
|
||||
|
||||
|
||||
//## Operation: setx%937398666
|
||||
107
Lab4/rectngle.cpp
Normal file
107
Lab4/rectngle.cpp
Normal file
@@ -0,0 +1,107 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Rectangle; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Rectngle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Rectangle
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Rectngle.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Rectangle
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Rectangle::Rectangle()
|
||||
|
||||
//## begin Rectangle::Rectangle%.hasinit preserve=no
|
||||
|
||||
//## end Rectangle::Rectangle%.hasinit
|
||||
|
||||
//## begin Rectangle::Rectangle%.initialization preserve=yes
|
||||
|
||||
//## end Rectangle::Rectangle%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Rectangle::Rectangle%.body preserve=yes
|
||||
|
||||
//## end Rectangle::Rectangle%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Rectangle::Rectangle (int x1, int y1, int x2, int y2, Color color)
|
||||
|
||||
//## begin Rectangle::Rectangle%939623932.hasinit preserve=no
|
||||
|
||||
//## end Rectangle::Rectangle%939623932.hasinit
|
||||
|
||||
//## begin Rectangle::Rectangle%939623932.initialization preserve=yes
|
||||
|
||||
//## end Rectangle::Rectangle%939623932.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Rectangle::Rectangle%939623932.body preserve=yes
|
||||
|
||||
setColor(color);
|
||||
|
||||
leftTop.setx(x1);
|
||||
|
||||
leftTop.sety(y1);
|
||||
|
||||
rightBottom.setx(x2);
|
||||
|
||||
rightBottom.sety(y2);
|
||||
|
||||
//## end Rectangle::Rectangle%939623932.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
106
Lab4/rectngle.h
Normal file
106
Lab4/rectngle.h
Normal file
@@ -0,0 +1,106 @@
|
||||
//## 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: H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\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 "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Point.h"
|
||||
|
||||
// Figure
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab4\Rose\Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Rectangle
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Rectangle : 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
|
||||
|
||||
196
Lab4/rose.dsp
Normal file
196
Lab4/rose.dsp
Normal file
@@ -0,0 +1,196 @@
|
||||
# Microsoft Developer Studio Project File - Name="Rose" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=Rose - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Rose.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Rose.mak" CFG="Rose - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Rose - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "Rose - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Rose - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x41d /d "NDEBUG"
|
||||
# ADD RSC /l 0x41d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "Rose - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x41d /d "_DEBUG"
|
||||
# ADD RSC /l 0x41d /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Rose - Win32 Release"
|
||||
# Name "Rose - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Circle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CmplxFgr.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphic\DbgGrphc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FgrHlder.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Figure.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Flist.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphic\Graphics.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Line.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\pList.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Point.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Rectngle.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Circle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CmplxFgr.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphic\DbgGrphc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FgrHlder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Figure.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Flist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Graphic\Graphics.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Line.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\List.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Node.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\pList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Point.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Rectngle.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
Lab4/rose.dsw
Normal file
29
Lab4/rose.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Rose"=".\Rose.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user