first commit
This commit is contained in:
7910
Lab6/RoseModel.mdl
Normal file
7910
Lab6/RoseModel.mdl
Normal file
File diff suppressed because it is too large
Load Diff
105
Lab6/circle.cpp
Normal file
105
Lab6/circle.cpp
Normal file
@@ -0,0 +1,105 @@
|
||||
//## 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: Circle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Circle
|
||||
|
||||
#include "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()
|
||||
116
Lab6/circle.h
Normal file
116
Lab6/circle.h
Normal file
@@ -0,0 +1,116 @@
|
||||
//## 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: 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 "Point.h"
|
||||
|
||||
// Figure
|
||||
|
||||
#include "Figure.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Circle
|
||||
|
||||
//## Category: Figures
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Circle : virtual 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);
|
||||
|
||||
|
||||
|
||||
//## Operation: erase%937398671
|
||||
|
||||
void erase (Graphics &g);
|
||||
|
||||
|
||||
|
||||
87
Lab6/cmplxfgr.cpp
Normal file
87
Lab6/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: CmplxFgr.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// ComplexFigure
|
||||
|
||||
#include "CmplxFgr.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include "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
Lab6/cmplxfgr.h
Normal file
100
Lab6/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: 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 "Figure.h"
|
||||
|
||||
// FList
|
||||
|
||||
#include "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);
|
||||
|
||||
71
Lab6/dbggrphc.cpp
Normal file
71
Lab6/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: Figures
|
||||
|
||||
//## Source file: DbgGrphc.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// DebugGraphics
|
||||
|
||||
#include "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
Lab6/dbggrphc.h
Normal file
89
Lab6/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: Figures
|
||||
|
||||
//## Source file: 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 "Graphics.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include "DbgGrphc.h"
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: DebugGraphics
|
||||
|
||||
//## Category: Graphic
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## 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();
|
||||
|
||||
|
||||
61
Lab6/fgrhlder.cpp
Normal file
61
Lab6/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: FgrHlder.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// FigureHolder
|
||||
|
||||
#include "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
Lab6/fgrhlder.h
Normal file
94
Lab6/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: 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 "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
Lab6/figure.cpp
Normal file
68
Lab6/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: Figure.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Figure
|
||||
|
||||
#include "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
Lab6/figure.h
Normal file
103
Lab6/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: 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 "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)
|
||||
|
||||
virtual ~Figure();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%937398679
|
||||
|
||||
virtual void draw (Graphics &g) = 0;
|
||||
|
||||
|
||||
|
||||
//## Operation: erase%937398680
|
||||
30
Lab6/flist.cpp
Normal file
30
Lab6/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: FList.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
48
Lab6/flist.h
Normal file
48
Lab6/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: 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 "List.h"
|
||||
|
||||
// FigureHolder
|
||||
|
||||
#include "FgrHlder.h"
|
||||
|
||||
51
Lab6/fstream.cpp
Normal file
51
Lab6/fstream.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: fstream; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab6\fstream.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// fstream
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab6\fstream.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class fstream
|
||||
|
||||
|
||||
|
||||
fstream::fstream()
|
||||
75
Lab6/fstream.h
Normal file
75
Lab6/fstream.h
Normal file
@@ -0,0 +1,75 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: fstream; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: H:\WebDocs\skola\Avancerad_C++\Lab6\fstream.h
|
||||
|
||||
|
||||
|
||||
#ifndef fstream_h
|
||||
|
||||
#define fstream_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: fstream
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class fstream
|
||||
|
||||
{
|
||||
|
||||
//## begin fstream.initialDeclarations preserve=yes
|
||||
|
||||
//## end fstream.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
fstream();
|
||||
82
Lab6/graphics.cpp
Normal file
82
Lab6/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: Figures
|
||||
|
||||
//## Source file: Graphics.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Graphics
|
||||
|
||||
#include "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
Lab6/graphics.h
Normal file
95
Lab6/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: Figures
|
||||
|
||||
//## Source file: 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 "Point.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
typedef int Color;
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Graphics; Abstract
|
||||
|
||||
//## Category: Graphic
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## 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();
|
||||
|
||||
|
||||
15
Lab6/h.cpp
Normal file
15
Lab6/h.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
Pcircle::Pcircle(int xPos, int yPos, int _radius, Color _color)
|
||||
//## begin Pcircle::Pcircle%.hasinit preserve=no
|
||||
//## end Pcircle::Pcircle%.hasinit
|
||||
//## begin Pcircle::Pcircle%.initialization preserve=yes
|
||||
//## end Pcircle::Pcircle%.initialization
|
||||
{
|
||||
//## begin Pcircle::Pcircle%.body preserve=yes
|
||||
// Circle::Circle(xPos, yPos, _radius, _color);
|
||||
|
||||
_pobj = Persistent::addType("Pcircle", new Pcircle);
|
||||
set_center(xPos, yPos);
|
||||
set_radius(_radius);
|
||||
set_color(_color);
|
||||
//## end Pcircle::Pcircle%.body
|
||||
}
|
||||
30
Lab6/instmap.cpp
Normal file
30
Lab6/instmap.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: InstMap; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: InstMap.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
49
Lab6/instmap.h
Normal file
49
Lab6/instmap.h
Normal file
@@ -0,0 +1,49 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: InstMap; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: InstMap.h
|
||||
|
||||
|
||||
|
||||
#ifndef InstMap_h
|
||||
|
||||
#define InstMap_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
#include "str.h"
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// MapFake
|
||||
|
||||
#include "MapFake.h"
|
||||
|
||||
// Persistent
|
||||
|
||||
//#include "Prsstent.h"
|
||||
272
Lab6/lab6.dsp
Normal file
272
Lab6/lab6.dsp
Normal file
@@ -0,0 +1,272 @@
|
||||
# Microsoft Developer Studio Project File - Name="lab6" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=lab6 - 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 "lab6.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 "lab6.mak" CFG="lab6 - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "lab6 - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "lab6 - 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)" == "lab6 - 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)" == "lab6 - 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 /W1 /Gm /vmg /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /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 "lab6 - Win32 Release"
|
||||
# Name "lab6 - 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=.\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=.\Graphics.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\InstMap.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=.\Pcircle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PersFig.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pline.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=.\Prctngle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Prsstent.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PsMap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Rectngle.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Str.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=.\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=.\Graphics.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\InstMap.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=.\MapFake.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Node.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pcircle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PersFig.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pline.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=.\Prctngle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Prsstent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PsMap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\PStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Rectngle.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Str.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
Lab6/lab6.dsw
Normal file
29
Lab6/lab6.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: "lab6"=".\lab6.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
120
Lab6/line.cpp
Normal file
120
Lab6/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: Line.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Line
|
||||
|
||||
#include "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;
|
||||
|
||||
102
Lab6/line.h
Normal file
102
Lab6/line.h
Normal file
@@ -0,0 +1,102 @@
|
||||
//## 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: 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 "pList.h"
|
||||
|
||||
// Figure
|
||||
|
||||
#include "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);
|
||||
|
||||
Line(){};
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Line();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: draw%937398668
|
||||
|
||||
136
Lab6/list.cpp
Normal file
136
Lab6/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++\Lab6\List.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module. preserve=no
|
||||
|
||||
//## end module.
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// List
|
||||
|
||||
#include "H:\WebDocs\skola\Avancerad_C++\Lab6\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
Lab6/list.h
Normal file
111
Lab6/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: 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 "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 ();
|
||||
89
Lab6/main.cpp
Normal file
89
Lab6/main.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
//#
|
||||
|
||||
//# main.c
|
||||
|
||||
//#
|
||||
|
||||
//# =======================================================
|
||||
|
||||
//# Lab i Avacerad C++
|
||||
|
||||
//# 4. Figures
|
||||
|
||||
//#
|
||||
|
||||
//#
|
||||
|
||||
//# Christian Ohlsson
|
||||
|
||||
//# Daniel Alfredsson
|
||||
|
||||
//# Karlstads universitet
|
||||
|
||||
//# 991013
|
||||
|
||||
//# =======================================================
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
#include "Graphics.h"
|
||||
|
||||
#include "line.h"
|
||||
|
||||
#include "rectngle.h"
|
||||
|
||||
#include "circle.h"
|
||||
|
||||
#include "flist.h"
|
||||
|
||||
#include "CmplxFgr.h"
|
||||
|
||||
#include "pstream.h"
|
||||
|
||||
#include "pcircle.h"
|
||||
|
||||
#include "prctngle.h"
|
||||
|
||||
|
||||
|
||||
void archive(int& i, PStream& ps){
|
||||
|
||||
if(ps.isSaving())
|
||||
|
||||
ps<<i<<endl;
|
||||
|
||||
else
|
||||
|
||||
ps>>i;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void archive(Point& i, PStream& ps){
|
||||
|
||||
if(ps.isSaving()){
|
||||
|
||||
ps<<i.getx()<<endl;
|
||||
|
||||
ps<<i.gety()<<endl;
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
int x;
|
||||
|
||||
ps>>x;
|
||||
|
||||
i.setx(x);
|
||||
|
||||
ps>>x;
|
||||
|
||||
i.sety(x);
|
||||
|
||||
}
|
||||
48
Lab6/mapfake.cpp
Normal file
48
Lab6/mapfake.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
template <class KeyType, class DataType>
|
||||
|
||||
Mapfake<KeyType, DataType>::Mapfake(){}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class KeyType, class DataType>
|
||||
|
||||
int Mapfake<KeyType, DataType>::getSize(){
|
||||
|
||||
return list.getSize();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class KeyType, class DataType>
|
||||
|
||||
DataType Mapfake<KeyType, DataType>::find(KeyType key)
|
||||
|
||||
{
|
||||
|
||||
int i=0;
|
||||
|
||||
if(list.getItem(0)->getKey() == key)
|
||||
|
||||
return list.getItem(0)->getData();
|
||||
|
||||
while(!list.isEmpty()) {
|
||||
|
||||
i++;
|
||||
|
||||
if(list.getItem(i)->getKey() == key)
|
||||
|
||||
return list.getItem(i)->getData();
|
||||
|
||||
}
|
||||
|
||||
return (DataType)0; // Just to supress compilerwarning
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
Lab6/mapfake.h
Normal file
32
Lab6/mapfake.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef __MAP_H
|
||||
|
||||
#define __MAP_H
|
||||
|
||||
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
#include "List.h"
|
||||
|
||||
|
||||
|
||||
template <class KeyType, class DataType>
|
||||
|
||||
class Mapfake{
|
||||
|
||||
private:
|
||||
|
||||
typedef class Tuple{
|
||||
|
||||
KeyType key;
|
||||
|
||||
DataType data;
|
||||
|
||||
public:
|
||||
|
||||
Tuple(KeyType _key, DataType _data){key = _key; data = _data;}
|
||||
|
||||
|
||||
|
||||
KeyType getKey(){return key;}
|
||||
|
||||
66
Lab6/node.cpp
Normal file
66
Lab6/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: Node.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Node
|
||||
|
||||
#include "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
|
||||
|
||||
95
Lab6/node.h
Normal file
95
Lab6/node.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: Node; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: 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
|
||||
|
||||
//## 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;
|
||||
102
Lab6/pcircle.cpp
Normal file
102
Lab6/pcircle.cpp
Normal file
@@ -0,0 +1,102 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Pcircle; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Pcircle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Pcircle
|
||||
|
||||
#include "Pcircle.h"
|
||||
|
||||
#include "PStream.h"
|
||||
|
||||
#include "Point.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
void archive(int &i, PStream &ps);
|
||||
|
||||
void archive(Point& i, PStream &ps);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Persistent* Pcircle::_pobj = Persistent::addType("Pcircle", new Pcircle);
|
||||
|
||||
// ************** GAMMAL ******************
|
||||
|
||||
//IMPLEMENT_PERSISTENT(Pcircle);
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Pcircle
|
||||
|
||||
|
||||
|
||||
Pcircle::~Pcircle()
|
||||
|
||||
{
|
||||
|
||||
//## begin Pcircle::~Pcircle%.body preserve=yes
|
||||
|
||||
//## end Pcircle::~Pcircle%.body
|
||||
|
||||
}
|
||||
|
||||
Pcircle::Pcircle(int xPos, int yPos, int _radius, Color _color)
|
||||
|
||||
//## begin Pcircle::Pcircle%.hasinit preserve=no
|
||||
|
||||
//## end Pcircle::Pcircle%.hasinit
|
||||
|
||||
//## begin Pcircle::Pcircle%.initialization preserve=yes
|
||||
|
||||
//## end Pcircle::Pcircle%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Pcircle::Pcircle%.body preserve=yes
|
||||
|
||||
// Circle::Circle(xPos, yPos, _radius, _color);
|
||||
|
||||
|
||||
|
||||
_pobj = Persistent::addType("Pcircle", new Pcircle);
|
||||
|
||||
setCenter(xPos, yPos);
|
||||
|
||||
setRad(_radius);
|
||||
|
||||
106
Lab6/pcircle.h
Normal file
106
Lab6/pcircle.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: Pcircle; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Pcircle.h
|
||||
|
||||
|
||||
|
||||
#ifndef Pcircle_h
|
||||
|
||||
#define Pcircle_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Circle
|
||||
|
||||
#include "Circle.h"
|
||||
|
||||
// PersFig
|
||||
|
||||
#include "PersFig.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Pcircle
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Pcircle : public Circle, public PersFig //## Inherits: <unnamed>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin Pcircle.initialDeclarations preserve=yes
|
||||
|
||||
//## end Pcircle.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
|
||||
|
||||
Pcircle(){};
|
||||
|
||||
Pcircle(int xPos, int yPos, int _radius, Color _color);
|
||||
|
||||
Pcircle(const Pcircle &src);
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Pcircle();
|
||||
|
||||
|
||||
|
||||
51
Lab6/persfig.cpp
Normal file
51
Lab6/persfig.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: PersFig; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PersFig.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// PersFig
|
||||
|
||||
#include "PersFig.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class PersFig
|
||||
|
||||
|
||||
|
||||
PersFig::PersFig()
|
||||
80
Lab6/persfig.h
Normal file
80
Lab6/persfig.h
Normal file
@@ -0,0 +1,80 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: PersFig; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PersFig.h
|
||||
|
||||
|
||||
|
||||
#ifndef PersFig_h
|
||||
|
||||
#define PersFig_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Figure
|
||||
|
||||
#include "Figure.h"
|
||||
|
||||
// Persistent
|
||||
|
||||
#include "Prsstent.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: PersFig
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class PersFig : public Persistent, //## Inherits: <unnamed>
|
||||
|
||||
virtual public Figure //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin PersFig.initialDeclarations preserve=yes
|
||||
|
||||
//## end PersFig.initialDeclarations
|
||||
|
||||
|
||||
|
||||
59
Lab6/pline.cpp
Normal file
59
Lab6/pline.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Pline; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Pline.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Pline
|
||||
|
||||
#include "Pline.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Pline
|
||||
|
||||
|
||||
|
||||
Pline::Pline()
|
||||
|
||||
//## begin Pline::Pline%.hasinit preserve=no
|
||||
|
||||
//## end Pline::Pline%.hasinit
|
||||
|
||||
//## begin Pline::Pline%.initialization preserve=yes
|
||||
|
||||
//## end Pline::Pline%.initialization
|
||||
85
Lab6/pline.h
Normal file
85
Lab6/pline.h
Normal file
@@ -0,0 +1,85 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Pline; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Pline.h
|
||||
|
||||
|
||||
|
||||
#ifndef Pline_h
|
||||
|
||||
#define Pline_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Line
|
||||
|
||||
#include "Line.h"
|
||||
|
||||
// PersFig
|
||||
|
||||
#include "PersFig.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Pline
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Pline : public PersFig, //## Inherits: <unnamed>
|
||||
|
||||
public Line //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin Pline.initialDeclarations preserve=yes
|
||||
|
||||
//## end Pline.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Pline();
|
||||
30
Lab6/plist.cpp
Normal file
30
Lab6/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: pList.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
48
Lab6/plist.h
Normal file
48
Lab6/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: 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 "List.h"
|
||||
|
||||
// Point
|
||||
|
||||
#include "Point.h"
|
||||
|
||||
83
Lab6/point.cpp
Normal file
83
Lab6/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: Point.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Point
|
||||
|
||||
#include "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
Lab6/point.h
Normal file
101
Lab6/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: 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
|
||||
96
Lab6/prctngle.cpp
Normal file
96
Lab6/prctngle.cpp
Normal file
@@ -0,0 +1,96 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Prectangle; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Prctngle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Prectangle
|
||||
|
||||
#include "Prctngle.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
|
||||
|
||||
Persistent* Prectangle::_pobj = Persistent::addType("Prectangle", new Prectangle);
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Prectangle
|
||||
|
||||
|
||||
|
||||
Prectangle::Prectangle()
|
||||
|
||||
//## begin Prectangle::Prectangle%.hasinit preserve=no
|
||||
|
||||
//## end Prectangle::Prectangle%.hasinit
|
||||
|
||||
//## begin Prectangle::Prectangle%.initialization preserve=yes
|
||||
|
||||
//## end Prectangle::Prectangle%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Prectangle::Prectangle%.body preserve=yes
|
||||
|
||||
//## end Prectangle::Prectangle%.body
|
||||
|
||||
}
|
||||
|
||||
Prectangle::Prectangle(int x1, int y1, int x2, int y2, Color c)
|
||||
|
||||
{
|
||||
|
||||
_pobj=Persistent::addType("Prectangle", new Prectangle);
|
||||
|
||||
setColor(c);
|
||||
|
||||
setLT(x1, y1);
|
||||
|
||||
setRB(x2, y2);
|
||||
|
||||
}
|
||||
|
||||
Prectangle::Prectangle(const Prectangle& src)
|
||||
|
||||
{
|
||||
|
||||
Point *lt, *rb;
|
||||
|
||||
lt=(Point*)&src.getLT();
|
||||
|
||||
setLT(lt->getx(), lt->gety());
|
||||
|
||||
104
Lab6/prctngle.h
Normal file
104
Lab6/prctngle.h
Normal file
@@ -0,0 +1,104 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Prectangle; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Prctngle.h
|
||||
|
||||
|
||||
|
||||
#ifndef Prctngle_h
|
||||
|
||||
#define Prctngle_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Rectangle
|
||||
|
||||
#include "Rectngle.h"
|
||||
|
||||
// PersFig
|
||||
|
||||
#include "PersFig.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include "PStream.h"
|
||||
|
||||
#include "Point.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
void archive(int &i, PStream &ps);
|
||||
|
||||
void archive(Point& i, PStream &ps);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Prectangle
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
class Prectangle : public PersFig, //## Inherits: <unnamed>
|
||||
|
||||
public Rectangle //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin Prectangle.initialDeclarations preserve=yes
|
||||
|
||||
//## end Prectangle.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Prectangle();
|
||||
|
||||
Prectangle(int x1, int y1, int x2, int y2, Color c);
|
||||
|
||||
Prectangle(const Prectangle &src);
|
||||
|
||||
80
Lab6/prsstent.cpp
Normal file
80
Lab6/prsstent.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Persistent; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Prsstent.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Persistent
|
||||
|
||||
#include "Prsstent.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class Persistent
|
||||
|
||||
|
||||
|
||||
//## begin Persistent::instMap.has preserve=no private: static InstMap {1 -> 1VO}
|
||||
|
||||
InstMap Persistent::instMap;
|
||||
|
||||
//## end Persistent::instMap.has
|
||||
|
||||
|
||||
|
||||
Persistent::Persistent()
|
||||
|
||||
//## begin Persistent::Persistent%.hasinit preserve=no
|
||||
|
||||
//## end Persistent::Persistent%.hasinit
|
||||
|
||||
//## begin Persistent::Persistent%.initialization preserve=yes
|
||||
|
||||
//## end Persistent::Persistent%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin Persistent::Persistent%.body preserve=yes
|
||||
|
||||
//## end Persistent::Persistent%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
116
Lab6/prsstent.h
Normal file
116
Lab6/prsstent.h
Normal file
@@ -0,0 +1,116 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: Persistent; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: Prsstent.h
|
||||
|
||||
|
||||
|
||||
#ifndef Prsstent_h
|
||||
|
||||
#define Prsstent_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// InstMap
|
||||
|
||||
#include "InstMap.h"
|
||||
|
||||
// PStream
|
||||
|
||||
//#include "PStream.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
class PStream;
|
||||
|
||||
|
||||
|
||||
#define DECLARE_PERSISTENT(X) \
|
||||
|
||||
char* name() const {return #X;} \
|
||||
|
||||
Persistent* clone() const {return new X(*this);} \
|
||||
|
||||
static Persistent* _pobj;
|
||||
|
||||
|
||||
|
||||
#define IMPLEMENT_PERSISTENT(X) \
|
||||
|
||||
Persistent* X::_pobj = Persistent::addType(#X, new X);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: Persistent
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
//## Uses: <unnamed>; PStream { -> }
|
||||
|
||||
|
||||
|
||||
class Persistent
|
||||
|
||||
{
|
||||
|
||||
//## begin Persistent.initialDeclarations preserve=yes
|
||||
|
||||
//## end Persistent.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
Persistent();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~Persistent();
|
||||
|
||||
30
Lab6/psmap.cpp
Normal file
30
Lab6/psmap.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: PsMap; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PsMap.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
45
Lab6/psmap.h
Normal file
45
Lab6/psmap.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: PsMap; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PsMap.h
|
||||
|
||||
|
||||
|
||||
#ifndef PsMap_h
|
||||
|
||||
#define PsMap_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// MapFake
|
||||
|
||||
#include "MapFake.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
184
Lab6/pstream.cpp
Normal file
184
Lab6/pstream.cpp
Normal file
@@ -0,0 +1,184 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: PStream; Pseudo Package body
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PStream.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// PStream
|
||||
|
||||
#include "PStream.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#include "prsstent.h"
|
||||
|
||||
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Class PStream
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PStream::PStream()
|
||||
|
||||
//## begin PStream::PStream%.hasinit preserve=no
|
||||
|
||||
: saving(false)
|
||||
|
||||
//## end PStream::PStream%.hasinit
|
||||
|
||||
//## begin PStream::PStream%.initialization preserve=yes
|
||||
|
||||
//## end PStream::PStream%.initialization
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::PStream%.body preserve=yes
|
||||
|
||||
for(int i=0 ; i<RESTORE_SIZE ; i++)
|
||||
|
||||
restore[i] = NULL;
|
||||
|
||||
//## end PStream::PStream%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PStream::~PStream()
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::~PStream%.body preserve=yes
|
||||
|
||||
//## end PStream::~PStream%.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (implementation)
|
||||
|
||||
void PStream::load (char* filename)
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::load%940866982.body preserve=yes
|
||||
|
||||
open(filename, ios::in);
|
||||
|
||||
saving=false;
|
||||
|
||||
//## end PStream::load%940866982.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PStream::save (char* filename)
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::save%940866983.body preserve=yes
|
||||
|
||||
open(filename, ios::out|ios::trunc);
|
||||
|
||||
saving=true;
|
||||
|
||||
//## end PStream::save%940866983.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PStream::close ()
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::close%940866984.body preserve=yes
|
||||
|
||||
if(isSaving()) {
|
||||
|
||||
(*this) << 0;
|
||||
|
||||
fstream::close();
|
||||
|
||||
}
|
||||
|
||||
saving=false;
|
||||
|
||||
//## end PStream::close%940866984.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool PStream::isSaving ()
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::isSaving%940866985.body preserve=yes
|
||||
|
||||
return saving;
|
||||
|
||||
//## end PStream::isSaving%940866985.body
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PStream::archive (Persistent*& x)
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream::archive%940866986.body preserve=yes
|
||||
|
||||
|
||||
|
||||
// Let's save some data...
|
||||
|
||||
142
Lab6/pstream.h
Normal file
142
Lab6/pstream.h
Normal file
@@ -0,0 +1,142 @@
|
||||
//## begin module.cm preserve=no
|
||||
|
||||
// %X% %Q% %Z% %W%
|
||||
|
||||
//## end module.cm
|
||||
|
||||
|
||||
|
||||
//## begin module.cp preserve=no
|
||||
|
||||
//## end module.cp
|
||||
|
||||
|
||||
|
||||
//## Module: PStream; Pseudo Package specification
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Source file: PStream.h
|
||||
|
||||
|
||||
|
||||
#ifndef PStream_h
|
||||
|
||||
#define PStream_h 1
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
#include "str.h"
|
||||
|
||||
#include <fstream.h>
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// PsMap
|
||||
|
||||
#include "PsMap.h"
|
||||
|
||||
// Persistent
|
||||
|
||||
#include "Prsstent.h"
|
||||
|
||||
// fstream
|
||||
|
||||
//#include "fstream.h"
|
||||
|
||||
//## begin module.additionalDeclarations preserve=yes
|
||||
|
||||
#define RESTORE_SIZE 100
|
||||
|
||||
//## end module.additionalDeclarations
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Class: PStream
|
||||
|
||||
//## Category: Persist
|
||||
|
||||
//## Subsystem: Figures
|
||||
|
||||
//## Persistence: Transient
|
||||
|
||||
//## Cardinality/Multiplicity: n
|
||||
|
||||
|
||||
|
||||
//## Uses: <unnamed>; Persistent { -> }
|
||||
|
||||
|
||||
|
||||
class PStream : public fstream //## Inherits: <unnamed>
|
||||
|
||||
{
|
||||
|
||||
//## begin PStream.initialDeclarations preserve=yes
|
||||
|
||||
//## end PStream.initialDeclarations
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//## Constructors (generated)
|
||||
|
||||
PStream();
|
||||
|
||||
|
||||
|
||||
//## Destructor (generated)
|
||||
|
||||
~PStream();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//## Other Operations (specified)
|
||||
|
||||
//## Operation: load%940866982
|
||||
|
||||
void load (char* filename);
|
||||
|
||||
|
||||
|
||||
//## Operation: save%940866983
|
||||
|
||||
void save (char* filename);
|
||||
|
||||
|
||||
|
||||
//## Operation: close%940866984
|
||||
|
||||
void close ();
|
||||
|
||||
|
||||
|
||||
//## Operation: isSaving%940866985
|
||||
|
||||
bool isSaving ();
|
||||
|
||||
|
||||
|
||||
//## Operation: archive%940866986
|
||||
|
||||
void archive (Persistent*& x);
|
||||
|
||||
|
||||
|
||||
//## Operation: find%940866987
|
||||
|
||||
107
Lab6/rectngle.cpp
Normal file
107
Lab6/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: Rectngle.cpp
|
||||
|
||||
|
||||
|
||||
//## begin module.additionalIncludes preserve=no
|
||||
|
||||
//## end module.additionalIncludes
|
||||
|
||||
|
||||
|
||||
//## begin module.includes preserve=yes
|
||||
|
||||
//## end module.includes
|
||||
|
||||
|
||||
|
||||
// Rectangle
|
||||
|
||||
#include "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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
111
Lab6/rectngle.h
Normal file
111
Lab6/rectngle.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: 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
|
||||
72
Lab6/str.cpp
Normal file
72
Lab6/str.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
#include <iostream.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "Str.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Str::Str():curPos(0){
|
||||
|
||||
str = new char[200];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Str::Str(char* _str){
|
||||
|
||||
str = new char[200];
|
||||
|
||||
strcpy(str, _str);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Str::~Str(){
|
||||
|
||||
delete [] str;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool Str::operator==(Str &src){
|
||||
|
||||
if(strcmp(src.getStr(), getStr()) == 0)
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Str::Str(const Str& src)
|
||||
|
||||
{
|
||||
|
||||
str = new char [strlen(src.str)+1] ;
|
||||
|
||||
strcpy(str,src.str);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Str& Str::operator =(const Str &src){
|
||||
|
||||
24
Lab6/str.h
Normal file
24
Lab6/str.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef __STR_H
|
||||
|
||||
#define __STR_H
|
||||
|
||||
|
||||
|
||||
#include <iostream.h>
|
||||
|
||||
|
||||
|
||||
class Str{
|
||||
|
||||
|
||||
|
||||
friend istream& operator >> (istream& is, Str &s);
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
Str();
|
||||
|
||||
Str(const Str& src);
|
||||
|
||||
16
Lab6/test.dat
Normal file
16
Lab6/test.dat
Normal file
@@ -0,0 +1,16 @@
|
||||
1
|
||||
Pcircle
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
1
|
||||
2
|
||||
Prectangle
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
1
|
||||
0
|
||||
Reference in New Issue
Block a user