Rename "Area" to "Rect"

After extracting ellipse from "Area" to a separate class, "Area"
means only a rectangle.
This commit is contained in:
Andrey Kalmykov 2024-04-14 13:16:22 +03:00
parent 75484d7074
commit a2e7d8eb9e
7 changed files with 16 additions and 16 deletions

View File

@ -259,7 +259,7 @@ void Component::paint(ViewPainter *p) {
}
// paint all rectangles
for (qucs::Area *pa: Rects) {
for (qucs::Rect *pa: Rects) {
if ((Simulator & QucsSettings.DefaultSimulator) == QucsSettings.DefaultSimulator) {
p->Painter->setPen(pa->Pen);
} else {
@ -387,7 +387,7 @@ void Component::paintIcon(QPixmap *pixmap)
}
// paint all rectangles
for (qucs::Area *pa: Rects) {
for (qucs::Rect *pa: Rects) {
pa->Pen.setWidth(3);
p->Painter->setPen(pa->Pen);
p->Painter->setBrush(pa->Brush);
@ -482,7 +482,7 @@ void Component::paintScheme(Schematic *p) {
p->PostPaintEvent(_Arc, cx + p3->x, cy + p3->y, p3->w, p3->h, p3->angle, p3->arclen);
for (qucs::Area *pa: Rects) // paint all rectangles
for (qucs::Rect *pa: Rects) // paint all rectangles
p->PostPaintEvent(_Rect, cx + pa->x, cy + pa->y, pa->w, pa->h);
for (qucs::Ellips *pa: Ellipses) // paint all ellipses
@ -540,7 +540,7 @@ void Component::rotate() {
}
// rotate all rectangles
for (qucs::Area *pa: Rects) {
for (qucs::Rect *pa: Rects) {
tmp = -pa->x;
pa->x = pa->y;
pa->y = tmp - pa->w;
@ -638,7 +638,7 @@ void Component::mirrorX() {
}
// mirror all rectangles
for (qucs::Area *pa: Rects)
for (qucs::Rect *pa: Rects)
pa->y = -pa->y - pa->h;
// mirror all ellipses
@ -699,7 +699,7 @@ void Component::mirrorY() {
}
// mirror all rectangles
for (qucs::Area *pa: Rects)
for (qucs::Rect *pa: Rects)
pa->x = -pa->x - pa->w;
// mirror all ellipses
@ -1293,7 +1293,7 @@ int Component::analyseLine(const QString &Row, int numProps) {
if (!getIntegers(Row, &i1, &i2, &i3, &i4)) return -1;
if (!getPen(Row, Pen, 5)) return -1;
if (!getBrush(Row, Brush, 8)) return -1;
Rects.append(new qucs::Area(i1, i2, i3, i4, Pen, Brush));
Rects.append(new qucs::Rect(i1, i2, i3, i4, Pen, Brush));
if (i1 < x1) x1 = i1; // keep track of component boundings
if (i1 > x2) x2 = i1;

View File

@ -83,7 +83,7 @@ public:
QList<qucs::Line *> Lines;
QList<struct qucs::Arc *> Arcs;
QList<qucs::Area *> Rects;
QList<qucs::Rect *> Rects;
QList<qucs::Ellips *> Ellipses;
QList<Port *> Ports;
QList<Text *> Texts;

View File

@ -219,7 +219,7 @@ void vacomponent::createSymbol(QJsonObject json)
colorfill = getString(paint, "colorfill");
stylefill = getString(paint, "stylefill");
Rects.append (new qucs::Area (x, y, w, h,
Rects.append (new qucs::Rect (x, y, w, h,
QPen (QColor (color), thick, penMap.value(style)),
QBrush(QColor (colorfill), brushMap.value(stylefill))
));

View File

@ -63,8 +63,8 @@ struct Arc {
QPen style;
};
struct Area {
Area(int _x, int _y, int _w, int _h, QPen _Pen,
struct Rect {
Rect(int _x, int _y, int _w, int _h, QPen _Pen,
QBrush _Brush = QBrush(Qt::NoBrush))
: x(_x), y(_y), w(_w), h(_h), Pen(_Pen), Brush(_Brush) {};
int x, y, w, h;

View File

@ -514,7 +514,7 @@ void createIcons() {
QList<qucs::Line *> Lines = c->Lines;
QList<struct qucs::Arc *> Arcs = c-> Arcs;
QList<qucs::Area *> Rects = c-> Rects;
QList<qucs::Rect *> Rects = c-> Rects;
QList<qucs::Ellips *> Ellips = c-> Ellipses;
QList<Port *> Ports = c->Ports;
QList<Text*> Texts = c->Texts;
@ -534,7 +534,7 @@ void createIcons() {
scene->addPath(*path);
}
for(qucs::Area *a: Rects) {
for(qucs::Rect *a: Rects) {
scene->addRect(a->x, a->y, a->w, a->h, a->Pen, a->Brush);
}

View File

@ -145,7 +145,7 @@ void SymbolWidget::paintEvent(QPaintEvent*)
// paint all rectangles
for(int i=0; i<Rects.size(); i++) {
qucs::Area *pa = Rects.at(i);
qucs::Rect *pa = Rects.at(i);
Painter.setPen(pa->Pen);
Painter.setBrush(pa->Brush);
Painter.drawRect(cx+pa->x, cy+pa->y, pa->w, pa->h);
@ -578,7 +578,7 @@ int SymbolWidget::analyseLine(const QString& Row)
if(!getCompLineIntegers(Row, &i1, &i2, &i3, &i4)) return -1;
if(!getPen(Row, Pen, 5)) return -1;
if(!getBrush(Row, Brush, 8)) return -1;
Rects.append(new qucs::Area(i1, i2, i3, i4, Pen, Brush));
Rects.append(new qucs::Rect(i1, i2, i3, i4, Pen, Brush));
if(i1 < x1) x1 = i1; // keep track of component boundings
if(i1 > x2) x2 = i1;

View File

@ -77,7 +77,7 @@ private:
int cx, cy, x1, x2, y1, y2;
QList<qucs::Line *> Lines;
QList<qucs::Arc *> Arcs;
QList<qucs::Area *> Rects;
QList<qucs::Rect *> Rects;
QList<qucs::Ellips *> Ellipses;
QList<Text *> Texts;
};