34 #include <initializer_list> 89 virtual bool contains(
double x,
double y)
const;
101 virtual void draw(QPainter* painter) = 0;
214 virtual string
getType()
const = 0;
225 virtual double getX()
const;
230 virtual double getY()
const;
260 virtual void move(
double dx,
double dy);
279 virtual void rotate(
double theta);
289 virtual void scale(
double sf);
300 virtual void scale(
double sx,
double sy);
340 virtual void setBounds(
double x,
double y,
double width,
double height);
397 virtual void setColor(
int r,
int g,
int b);
417 virtual void setColor(
const string& color);
461 virtual void setFont(
const QFont& font);
476 virtual void setFont(
const string& font);
550 virtual void setSize(
double width,
double height);
567 virtual void setWidth(
double width);
572 virtual void setX(
double x);
577 virtual void setY(
double y);
592 GObject(
const GObject&) {
597 static bool _sAntiAliasing;
626 GObject(
double x = 0,
double y = 0,
double width = 0,
double height = 0);
633 virtual void initializeBrushAndPen(QPainter* painter =
nullptr);
639 static Qt::PenStyle toQtPenStyle(
LineStyle lineStyle);
682 GArc(
double width = 0,
double height = 0,
double start = 0,
double sweep = 0);
689 GArc(
double x,
double y,
double width,
double height,
double start,
double sweep);
692 bool contains(
double x,
double y)
const override;
698 void draw(QPainter* painter)
override;
729 string
getType()
const override;
755 virtual bool containsAngle(
double theta)
const;
756 virtual GPoint getArcPoint(
double theta)
const;
791 virtual void add(
GObject* gobj,
double x,
double y);
804 virtual void add(
GObject& gobj,
double x,
double y);
810 virtual void clear();
831 bool contains(
double x,
double y)
const override;
837 void draw(QPainter* painter)
override;
861 string
getType()
const override;
871 virtual QWidget* getWidget()
const;
888 virtual void remove(
GObject* gobj);
893 virtual void remove(
GObject& gobj);
910 virtual void repaintRegion(
int x,
int y,
int width,
int height);
932 virtual void setWidget(QWidget* widget);
943 virtual int findGObject(
GObject* gobj)
const;
944 virtual void removeAt(
int index);
947 std::vector<GObject*> _contents;
948 QWidget* _widget =
nullptr;
967 GImage(
const string& filename =
"",
double x = 0,
double y = 0);
977 GImage(std::istream& source,
double x = 0,
double y = 0);
983 GImage(
double width,
double height);
996 void draw(QPainter* painter)
override;
1008 virtual int getPixel(
int x,
int y)
const;
1011 string
getType()
const override;
1018 virtual void setPixel(
int x,
int y,
int rgb);
1040 bool load(
const string& filename);
1046 bool loadFromStream(std::istream& input);
1076 bool contains(
double x,
double y)
const override;
1082 void draw(QPainter* painter)
override;
1095 virtual double getEndX()
const;
1100 virtual double getEndY()
const;
1124 string
getType()
const override;
1149 virtual void setPoints(
double x0,
double y0,
double x1,
double y1);
1193 GOval(
double x = 0,
double y = 0,
double width = 0,
double height = 0);
1196 bool contains(
double x,
double y)
const override;
1202 void draw(QPainter* painter)
override;
1205 string
getType()
const override;
1225 GPolygon(std::initializer_list<double> coords);
1226 GPolygon(std::initializer_list<GPoint> points);
1232 virtual void addEdge(
double dx,
double dy);
1244 virtual void addEdges(std::initializer_list<double> coords);
1250 virtual void addEdges(std::initializer_list<GPoint> points);
1264 virtual void addVertex(
double x,
double y);
1277 virtual void addVertexes(std::initializer_list<double> coords);
1284 virtual void addVertexes(std::initializer_list<GPoint> points);
1289 virtual void clear();
1292 bool contains(
double x,
double y)
const override;
1298 void draw(QPainter* painter)
override;
1307 string
getType()
const override;
1340 QVector<QPointF> _vertices;
1356 GRect(
double x = 0,
double y = 0,
double width = 0,
double height = 0);
1362 void draw(QPainter* painter)
override;
1365 string
getType()
const override;
1397 bool contains(
double x,
double y)
const override;
1403 void draw(QPainter* painter)
override;
1412 string
getType()
const override;
1459 GText(
const string& str =
"",
double x = 0,
double y = 0);
1465 void draw(QPainter* painter)
override;
1473 virtual string
getFont()
const;
1497 virtual string
getText()
const;
1500 string
getType()
const override;
1503 void setFont(
const QFont& font)
override;
1506 void setFont(
const string& font)
override;
1513 virtual void setLabel(
const string& str);
1520 virtual void setText(
const string& str);
1541 #endif // _gobjects_h virtual string getText() const
Returns the string displayed by this object.
Definition: gobjects.cpp:1612
virtual GDimension getSize() const
Returns the size of the object as a GDimension.
Definition: gobjects.cpp:180
This struct contains real-valued x, y, width, and height fields.
Definition: gtypes.h:293
LineStyle _lineStyle
Definition: gobjects.h:607
GCompound * _parent
Definition: gobjects.h:616
virtual void setX(double x)
Sets the x location of the left side of this object.
Definition: gobjects.cpp:502
virtual string getLabel() const
Returns the string displayed by this object.
Definition: gobjects.cpp:1608
bool _visible
Definition: gobjects.h:614
void setFont(const QFont &font) override
Changes the font used to display the object as specified by the given Qt font.
Definition: gobjects.cpp:1620
virtual void setFillColor(int r, int g, int b)
Sets the color used to display the filled region of this object, if any.
Definition: gobjects.cpp:398
virtual void setFilled(bool flag)
Sets the fill status for the object, where false is outlined and true is filled.
Definition: gobjects.cpp:424
virtual void setCenterLocation(double x, double y)
Sets the location of the center of this object.
Definition: gobjects.cpp:368
virtual string getFillColor() const
Returns the color used to display the filled region of this object.
Definition: gobjects.cpp:148
virtual void conditionalRepaint()
Repaints the compound only if it needs to be repainted (if any of its contents have changed)...
Definition: gobjects.cpp:747
virtual void setCenterY(double y)
Sets the y-coordinate of the center of this object.
Definition: gobjects.cpp:364
virtual ~GImage()
Frees memory allocated internally by the image.
Definition: gobjects.cpp:1027
virtual void setBottomY(double y)
Sets the location of the bottom y-coordinate of this object.
Definition: gobjects.cpp:332
virtual bool isAutoRepaint() const
Returns whether the compound automatically repaints itself when its contents change.
Definition: gobjects.cpp:846
A GRoundRect represents a graphical object whose appearance consists of a rectangular box with rounde...
Definition: gobjects.h:1372
double _corner
Definition: gobjects.h:1424
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:1566
virtual GObject * getElement(int index) const
Returns a pointer to the graphical object at the specified index, numbering from back to front in the...
Definition: gobjects.cpp:821
virtual void setWidth(double width)
Changes the width of this object to the specified width without changing its height.
Definition: gobjects.cpp:498
virtual double getEndX() const
Returns the x-coordinate of the point at which the line ends.
Definition: gobjects.cpp:1196
virtual void setCorner(double corner)
Sets the diameter of the arc forming the corner of this rounded rectangle.
Definition: gobjects.cpp:1560
virtual void addEdges(std::initializer_list< double > coords)
Adds multiple edges to the polygon whose components are given by the displacements dx and dy from the...
Definition: gobjects.cpp:1317
virtual void setOpacity(double opacity)
Sets how opaque (non-transparent) this object will appear from 0.0 (completely transparent) to 1...
Definition: gobjects.cpp:474
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:1114
virtual ~GObject()
Frees the storage for the object.
Definition: gobjects.cpp:98
virtual void setRightX(double x)
Sets the location of the rightmost x-coordinate of this object.
Definition: gobjects.cpp:336
virtual void addVertex(double x, double y)
Adds a vertex at (x, y) relative to the polygon origin.
Definition: gobjects.cpp:1342
bool _fillFlag
Definition: gobjects.h:613
virtual void setCenterX(double x)
Sets the x-coordinate of the center of this object.
Definition: gobjects.cpp:360
This graphical object subclass represents an image from a file.
Definition: gobjects.h:957
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1439
virtual void setVisible(bool flag)
Sets whether this object is visible.
Definition: gobjects.cpp:493
GPolygon()
Constructs a new empty polygon at the origin.
Definition: gobjects.cpp:1297
virtual double getEndY() const
Returns the y-coordinate of the point at which the line ends.
Definition: gobjects.cpp:1200
virtual void clear()
Removes all graphical objects from the compound.
Definition: gobjects.cpp:743
virtual void setStartPoint(double x0, double y0)
Sets the initial point in the line to (x0, y0), leaving the end point unchanged.
Definition: gobjects.cpp:1248
GLine(double x0=0, double y0=0, double x1=0, double y1=0, LineStyle lineStyle=LINE_SOLID)
Constructs a line segment from its endpoints.
Definition: gobjects.cpp:1119
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1106
virtual void setVertex(int i, GPoint point)
Sets the vertex at the given 0-based index in this polygon to the given coordinates.
Definition: gobjects.cpp:1463
virtual bool isFilled() const
Returns true if the object is filled with color.
Definition: gobjects.cpp:251
GRectangle getBounds() const override
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:1586
std::ostream & operator<<(std::ostream &out, const GEvent &event)
Writes the given event to the given output stream.
Definition: gevent.cpp:494
double getWidth() const override
Returns the width of this object, which is equal to the width of the bounding box.
Definition: gobjects.cpp:1224
LineStyle
Styles that can be used for the outline around various shapes.
Definition: gobjects.h:72
virtual void clear()
Removes all vertexes from the polygon.
Definition: gobjects.cpp:1374
virtual double getFontAscent() const
Returns the maximum distance strings in this font extend above the baseline.
Definition: gobjects.cpp:1598
virtual double getCenterX() const
Returns the x-coordinate of the center of the object.
Definition: gobjects.cpp:136
virtual double getStartY() const
Returns the y-coordinate of the point at which the line starts.
Definition: gobjects.cpp:1216
virtual void rotate(double theta)
Transforms the object by rotating it theta degrees counterclockwise around its origin.
Definition: gobjects.cpp:284
GRectangle getBounds() const override
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:801
This graphical object subclass represents an elliptical arc.
Definition: gobjects.h:676
virtual double getCorner() const
Returns the diameter of the arc forming the corner of this rounded rectangle.
Definition: gobjects.cpp:1552
virtual string getFileName() const
Returns the file name used to load the image, as was passed to the constructor.
Definition: gobjects.cpp:1093
virtual int getVertexCount() const
Returns the number of vertexes in this polygon.
Definition: gobjects.cpp:1447
virtual bool isTransformed() const
Returns true if this object has been transformed by calling methods such as rotate() or scale() on it...
Definition: gobjects.cpp:255
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1491
string _color
Definition: gobjects.h:608
virtual void setFont(const QFont &font)
Changes the font used to display the object as specified by the given Qt font.
Definition: gobjects.cpp:429
static const double DEFAULT_CORNER
The default diameter of corners on rounded rectangles if none is supplied to the constructor.
Definition: gobjects.h:1378
This class is the common superclass of all graphical objects that can be displayed on a graphical win...
Definition: gobjects.h:66
static void setAntiAliasing(bool value)
Globally turns on/off the anti-aliasing feature that smooths out the edges of onscreen shapes...
Definition: gobjects.cpp:328
A GRect is a graphical object whose appearance consists of a rectangular box.
Definition: gobjects.h:1349
virtual GPoint getStartPoint() const
Returns the point at which the arc starts.
Definition: gobjects.cpp:671
double _dy
Definition: gobjects.h:1179
virtual string getColor() const
Returns the color used to display this object.
Definition: gobjects.cpp:144
virtual void removeAll()
Removes all graphical objects from the compound.
Definition: gobjects.cpp:866
QBrush _brush
Definition: gobjects.h:618
string _font
Definition: gobjects.h:612
This graphical object subclass represents a line segment.
Definition: gobjects.h:1058
virtual double getX() const
Returns the leftmost x-coordinate of the object.
Definition: gobjects.cpp:189
This abstract class is the superclass for all graphical interactors.
Definition: ginteractor.h:52
virtual GCompound * getParent() const
Returns a pointer to the GCompound that contains this object.
Definition: gobjects.cpp:172
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:679
virtual void setSize(double width, double height)
Changes the size of this object to the specified width and height.
Definition: gobjects.cpp:480
Definition: gobjects.h:73
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:1134
A GCanvas is a graphical drawing surface on which you can draw shapes, lines, and colors...
Definition: gcanvas.h:75
virtual string toStringExtra() const
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:545
virtual void move(double dx, double dy)
Moves the object on the screen using the displacements dx and dy.
Definition: gobjects.cpp:263
virtual std::vector< GPoint > getVertices() const
Returns a vector of the points in the polygon.
Definition: gobjects.cpp:1451
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:765
double _height
Definition: gobjects.h:604
virtual GPoint getCenterLocation() const
Returns the x/y-coordinates of the center of the object.
Definition: gobjects.cpp:132
virtual double getSweepAngle() const
Returns the sweep angle for this arc in degrees.
Definition: gobjects.cpp:675
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:1514
virtual GRectangle getFrameRectangle() const
Returns the boundaries of the rectangle used to frame the arc.
Definition: gobjects.cpp:663
Definition: gobjects.h:75
virtual void setLineStyle(LineStyle lineStyle)
Sets the object's style such as solid (GObject::LINE_SOLID) or dashed (GObject::LINE_DASH).
Definition: gobjects.cpp:454
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1616
virtual void setBounds(double x, double y, double width, double height)
Changes the bounds of this object to the specified values.
Definition: gobjects.cpp:348
string toString() const override
Returns a printable representation of the object.
Definition: gobjects.cpp:988
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1556
virtual void setY(double y)
Sets the y location of the top of this object.
Definition: gobjects.cpp:506
virtual void setEndPoint(double x1, double y1)
Sets the end point in the line to (x1, y1), leaving the start point unchanged.
Definition: gobjects.cpp:1228
virtual GRectangle getBounds() const
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:123
GCompound()
Creates a compound with no internal components.
Definition: gobjects.cpp:708
virtual void repaint()
Instructs the object to redraw itself on screen.
Definition: gobjects.cpp:267
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:1256
double getHeight() const override
Returns the height of this object, which is the same as the height of its bounding box...
Definition: gobjects.cpp:1435
virtual void setLabel(string str)
Changes the string stored within the text label, so that a new text string appears on the display...
Definition: gobjects.cpp:1630
GRoundRect(double width=0, double height=0, double corner=DEFAULT_CORNER)
Constructs a new rectangle with the specified width and height, located at (0, 0).
Definition: gobjects.cpp:1502
virtual void setForeground(int r, int g, int b)
Sets the color used to display this object.
Definition: gobjects.cpp:438
double getWidth() const override
Returns the width of this object, which is equal to the width of the bounding box.
Definition: gobjects.cpp:1459
This graphical object subclass represents a text string.
Definition: gobjects.h:1446
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1220
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:1379
friend class GDiffImage
Definition: gobjects.h:1052
virtual bool isVisible() const
Returns true if this object is visible on screen.
Definition: gobjects.cpp:259
virtual double getWidth() const
Returns the width of this object, which is equal to the width of the bounding box.
Definition: gobjects.cpp:185
double getHeight() const override
Returns the height of this object, which is the same as the height of its bounding box...
Definition: gobjects.cpp:1204
GRect(double x=0, double y=0, double width=0, double height=0)
Constructs a rectangle with the specified width and height.
Definition: gobjects.cpp:1476
This struct contains real-valued width and height fields.
Definition: gtypes.h:43
QPen _pen
Definition: gobjects.h:617
void sendToBack()
Moves this object to the back of the display in the z dimension.
Definition: gobjects.cpp:314
virtual GPoint getVertex(int i) const
Returns the vertex at the given 0-based index in this polygon.
Definition: gobjects.cpp:1443
virtual void setBottomRightLocation(double x, double y)
Sets the location of the bottom/right of this object.
Definition: gobjects.cpp:340
virtual bool contains(double x, double y) const
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:102
This graphical object subclass consists of a collection of other graphical objects.
Definition: gobjects.h:769
double _lineWidth
Definition: gobjects.h:605
GArc(double width=0, double height=0, double start=0, double sweep=0)
Creates a new GArc object consisting of an elliptical arc.
Definition: gobjects.cpp:550
double _opacity
Definition: gobjects.h:606
int _colorInt
Definition: gobjects.h:609
virtual void add(GObject *gobj)
Adds a new graphical object to the compound, if that object was not already present in the compound...
Definition: gobjects.cpp:713
virtual void setFrameRectangle(const GRectangle &rect)
Changes the boundaries of the rectangle used to frame the arc.
Definition: gobjects.cpp:687
virtual double getLineWidth() const
Returns the width of the line used to draw this object.
Definition: gobjects.cpp:160
virtual GPoint getLocation() const
Returns the location of the top-left corner of object.
Definition: gobjects.cpp:164
static bool isAntiAliasing()
Returns whether we should globally anti-alias graphical objects.
Definition: gobjects.cpp:247
GRectangle getBounds() const override
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:627
void sendToFront()
Moves this object to the front of the display in the z dimension.
Definition: gobjects.cpp:321
virtual GObject * getElementAt(double x, double y) const
Returns a pointer to the first graphical object that contains the given (x, y) point, or a null pointer if no object in this compound touches it.
Definition: gobjects.cpp:825
virtual string getType() const =0
Returns the type of the object as a string, such as "GOval" or "GRect".
virtual void setStartAngle(double start)
Sets the starting angle for this arc in degrees.
Definition: gobjects.cpp:691
GOval(double x=0, double y=0, double width=0, double height=0)
Constructs a new oval inscribed in the specified rectangle.
Definition: gobjects.cpp:1263
virtual void repaintRegion(int x, int y, int width, int height)
Instructs the compound to redraw the given rectangular region within itself, including any graphical ...
Definition: gobjects.cpp:905
virtual double getBottomY() const
Returns the y-coordinate of the bottom of the object.
Definition: gobjects.cpp:119
Definition: gobjects.h:77
virtual double getOpacity() const
Returns how opaque (non-transparent) this object will appear from 0.0 (completely transparent) to 1...
Definition: gobjects.cpp:168
virtual GPoint getEndPoint() const
Returns the point at which the line ends.
Definition: gobjects.cpp:1192
virtual void setHeight(double height)
Changes the height of this object to the specified height without changing its width.
Definition: gobjects.cpp:450
QImage * getQImage() const
Returns the inner Qt QImage object being wrapped.
Definition: gobjects.cpp:1102
virtual void conditionalRepaintRegion(int x, int y, int width, int height)
Repaints the given rectangular region of the compound only if it needs to be repainted (if any of its...
Definition: gobjects.cpp:753
virtual int getElementCount() const
Returns the number of graphical objects stored in the compound.
Definition: gobjects.cpp:834
virtual void setPixel(int x, int y, int rgb)
Sets the pixel at the given x/y location to the given color, represented as an RGB integer...
Definition: gobjects.cpp:1110
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:838
virtual void setText(string str)
Changes the string stored within the text label, so that a new text string appears on the display...
Definition: gobjects.cpp:1636
int _fillColorInt
Definition: gobjects.h:611
virtual GPoint getEndPoint() const
Returns the point at which the arc ends.
Definition: gobjects.cpp:659
virtual double getY() const
Returns the topmost y-coordinate of the object.
Definition: gobjects.cpp:193
virtual GPoint getBottomRightLocation() const
Returns the x/y coordinates of the bottom/right corner of the object.
Definition: gobjects.cpp:115
virtual int getPixel(int x, int y) const
Returns the color of the pixel at the given x/y location as an RGB integer.
Definition: gobjects.cpp:1097
virtual void resetTransform()
Undoes any previous scale/rotate transformations on this object.
Definition: gobjects.cpp:278
static const string DEFAULT_FONT
The default font used in text labels if none is provided.
Definition: gobjects.h:1451
void sendBackward()
Moves this object one step toward the back in the z dimension.
Definition: gobjects.cpp:300
Definition: gobjects.h:78
Definition: gobjects.h:76
bool _transformed
Definition: gobjects.h:615
virtual double getStartAngle() const
Returns the starting angle for this arc in degrees.
Definition: gobjects.cpp:667
virtual bool isEmpty() const
Returns true if the compound does not contain any graphical objects.
Definition: gobjects.cpp:850
virtual void addVertexes(std::initializer_list< double > coords)
Adds multiple edges to the polygon whose components are given by the coordinates dx and dy relative t...
Definition: gobjects.cpp:1353
GRectangle getBounds() const override
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:1182
This struct contains real-valued x and y fields.
Definition: gtypes.h:202
virtual void setAutoRepaint(bool autoRepaint)
Sets whether the compound automatically repaints itself when its contents change. ...
Definition: gobjects.cpp:980
This graphical object subclass represents an oval inscribed in a rectangular box. ...
Definition: gobjects.h:1186
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:564
virtual void setColor(int r, int g, int b)
Sets the color used to display this object.
Definition: gobjects.cpp:376
virtual double getHeight() const
Returns the height of this object, which is the same as the height of its bounding box...
Definition: gobjects.cpp:152
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:1640
GRectangle getBounds() const override
Returns the bounding box of this object, which is defined to be the smallest rectangle that covers ev...
Definition: gobjects.cpp:1414
double _width
Definition: gobjects.h:603
string _fillColor
Definition: gobjects.h:610
virtual void addPolarEdge(double r, double theta)
Adds an edge to the polygon specified in polar coordinates.
Definition: gobjects.cpp:1338
virtual double getRightX() const
Returns the x-coordinate of the right side of the object.
Definition: gobjects.cpp:176
virtual void setPoints(double x0, double y0, double x1, double y1)
Sets this line's two end points to (x0, y0) and (x1, y1).
Definition: gobjects.cpp:1236
Definition: gobjects.h:74
double _x
Definition: gobjects.h:601
virtual double getCenterY() const
Returns the y-coordinate of the center of the object.
Definition: gobjects.cpp:140
void sendForward()
Moves this object one step toward the front in the z dimension.
Definition: gobjects.cpp:307
double _dx
Definition: gobjects.h:1178
This graphical object subclass represents a polygon bounded by line segments.
Definition: gobjects.h:1215
virtual double getStartX() const
Returns the x-coordinate of the point at which the line starts.
Definition: gobjects.cpp:1212
GImage(string filename="", double x=0, double y=0)
Constructs a new image by loading the image from the specified file.
Definition: gobjects.cpp:993
virtual string getFont() const
Returns the current font for the label.
Definition: gobjects.cpp:1594
void repaint() override
Instructs the compound to redraw all of its graphical objects.
Definition: gobjects.cpp:890
virtual LineStyle getLineStyle() const
Returns the object's style such as solid or dashed.
Definition: gobjects.cpp:156
virtual void setLineWidth(double lineWidth)
Sets the width of the line used to draw this object.
Definition: gobjects.cpp:459
virtual void addEdge(double dx, double dy)
Adds an edge to the polygon whose components are given by the displacements dx and dy from the last v...
Definition: gobjects.cpp:1309
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:1469
virtual double getFontDescent() const
Returns the maximum distance strings in this font descend below the baseline.
Definition: gobjects.cpp:1603
virtual void setSweepAngle(double start)
Sets the sweep angle for this arc in degrees.
Definition: gobjects.cpp:696
double _y
Definition: gobjects.h:602
string toStringExtra() const override
Returns a string containing any extra unique information about this type of graphical object...
Definition: gobjects.cpp:701
string getType() const override
Returns the type of the object as a string, such as "GOval" or "GRect".
Definition: gobjects.cpp:1292
QTransform _transform
Definition: gobjects.h:619
GText(string str="", double x=0, double y=0)
Creates a GText object containing the specified string.
Definition: gobjects.cpp:1571
virtual GPoint getStartPoint() const
Returns the point at which the line starts.
Definition: gobjects.cpp:1208
virtual void setLocation(double x, double y)
Sets the location of the top-left corner of this object to the specified coordinates.
Definition: gobjects.cpp:464
virtual string toString() const
Returns a printable representation of the object.
Definition: gobjects.cpp:510
virtual void scale(double sf)
Scales the object by the specified scale factor.
Definition: gobjects.cpp:290
bool contains(double x, double y) const override
Returns true if the specified point is inside the object.
Definition: gobjects.cpp:1268