Курсовая работа: Работа со списками
point p1,p2;
Tline l;
k=koef; l1=line1,l2=line2;color=col;show_secondary=sec;scol=colsec;
l1.secondary=true;l2.secondary=true;l1.color=colsec;l2.color=colsec;Name=NameOfCurve;
if (show_secondary) {L.add(l1,Name);L.add(l2,Name);}
while (!(l.p1.x==l.p2.x && l.p1.y==l.p2.y)){
p1=l1.cut(k);p2=l2.cut(k);
l.setline(p1,p2,colsec,1);
if (show_secondary) L.add(l,Name);
l2.p1=p2;p2=l.cut(k);p1=l1.p1;
l.setline(p1,p2,color,0);L.add(l,Name);
l1.p1=p2;l1.p2=l2.p1;
}//end while
return (L);
}//end function
queue <Tline> BCurve::Load(){
return(this->Create(k,l1,l2,color,scol,show_secondary,Name));
}//end function
class TRectangle {
public:
queue <Tline> Create(int x1,int y1,int x2,int y2,TColor col);
};//end rectangle class
queue <Tline> TRectangle::Create(int x1,int y1,int x2,int y2,TColor col){
queue <Tline> Lines;
Tline l1;
l1.p1.x=x1;l1.p1.y=y1;l1.p2.x=x2;l1.p2.y=y1;l1.color=col;l1.secondary=false;
Lines.add(l1,"Rectangle");
l1.p1.x=x2;l1.p1.y=y1;l1.p2.x=x2;l1.p2.y=y2;l1.color=col;l1.secondary=false;
Lines.add(l1,"Rectangle");