OMNeT++ Simulation Library  5.4.1
ccanvas.h
1 //==========================================================================
2 // CCANVAS.H - header for
3 // OMNeT++/OMNEST
4 // Discrete System Simulation in C++
5 //
6 //==========================================================================
7 
8 /*--------------------------------------------------------------*
9  Copyright (C) 1992-2017 Andras Varga
10  Copyright (C) 2006-2017 OpenSim Ltd.
11 
12  This file is distributed WITHOUT ANY WARRANTY. See the file
13  `license' for details on this and other legal matters.
14 *--------------------------------------------------------------*/
15 
16 #ifndef __OMNETPP_CCANVAS_H
17 #define __OMNETPP_CCANVAS_H
18 
19 #include <string>
20 #include <map>
21 #include <vector>
22 #include "cownedobject.h"
23 
24 namespace omnetpp {
25 
26 class cCanvas;
27 class cProperty;
28 class cProperties;
29 class cObjectFactory;
30 
31 //TODO: doc: default values as precise enum names
32 //TODO: doc: @figure attributes for each figure type
33 //TODO: doc: revise class descriptions
34 
57 class SIM_API cFigure : public cOwnedObject
58 {
59  public:
64  struct SIM_API Point {
67  double x, y;
69 
71  Point() : x(0), y(0) {}
72  Point(double x, double y) : x(x), y(y) {}
73  Point operator + (const Point& p) const;
74  Point operator - (const Point& p) const;
75  Point operator * (double s) const;
76  Point operator / (double s) const;
77  double operator * (const Point& p) const;
78  double distanceTo(const Point& p) const;
79  double getLength() const;
80  Point& translate(double dx, double dy) {x += dx; y += dy; return *this;}
81  bool operator==(const Point& other) const {return x == other.x && y == other.y;}
82  std::string str() const;
84  };
85 
90  struct SIM_API Rectangle {
93  double x, y, width, height;
95 
97  Rectangle() : x(0), y(0), width(0), height(0) {}
98  Rectangle(double x, double y, double width, double height) : x(x), y(y), width(width), height(height) {}
99  Point getCenter() const;
100  Point getSize() const;
101  Rectangle& translate(double dx, double dy) {x += dx; y += dy; return *this;}
102  bool operator==(const Rectangle& other) const {return x == other.x && y == other.y && width == other.width && height == other.height;}
103  std::string str() const;
105  };
106 
120  struct SIM_API Color {
123  uint8_t red, green, blue;
125 
127  Color() : red(0), green(0), blue(0) {}
128  Color(uint8_t red, uint8_t green, uint8_t blue) : red(red), green(green), blue(blue) {}
129  Color(const char *color) {*this = parseColor(color);}
130  bool operator==(const Color& other) const {return red == other.red && green == other.green && blue == other.blue;}
131  std::string str() const;
133  };
134 
137  static const Color BLACK;
138  static const Color WHITE;
139  static const Color GREY;
140  static const Color RED;
141  static const Color GREEN;
142  static const Color BLUE;
143  static const Color YELLOW;
144  static const Color CYAN;
145  static const Color MAGENTA;
146 
147  static const int NUM_GOOD_DARK_COLORS;
148  static const int NUM_GOOD_LIGHT_COLORS;
149  static const Color GOOD_DARK_COLORS[14];
150  static const Color GOOD_LIGHT_COLORS[10];
152 
157  struct SIM_API Font {
160  std::string typeface;
161  int pointSize;
162  uint8_t style;
163 
164 
166  Font() : pointSize(0), style(FONT_NONE) {}
167  Font(std::string typeface, int pointSize=-1, uint8_t style=FONT_NONE) : typeface(typeface), pointSize(pointSize), style(style) {}
168  bool operator==(const Font& other) const {return typeface == other.typeface && pointSize == other.pointSize && style == other.style;}
169  std::string str() const;
171  };
172 
174  enum FontStyle { FONT_NONE=0, FONT_BOLD=1, FONT_ITALIC=2, FONT_UNDERLINE=4 };
175 
177  enum LineStyle { LINE_SOLID, LINE_DOTTED, LINE_DASHED };
178 
180  enum CapStyle { CAP_BUTT, CAP_SQUARE, CAP_ROUND };
181 
183  enum JoinStyle { JOIN_BEVEL, JOIN_MITER, JOIN_ROUND };
184 
186  enum FillRule { FILL_EVENODD, FILL_NONZERO };
187 
189  enum Arrowhead { ARROW_NONE, ARROW_SIMPLE, ARROW_TRIANGLE, ARROW_BARBED };
190 
192  enum Interpolation { INTERPOLATION_NONE, INTERPOLATION_FAST, INTERPOLATION_BEST };
193 
195  enum Anchor {ANCHOR_CENTER, ANCHOR_N, ANCHOR_E, ANCHOR_S, ANCHOR_W, ANCHOR_NW, ANCHOR_NE, ANCHOR_SE, ANCHOR_SW, ANCHOR_BASELINE_START, ANCHOR_BASELINE_MIDDLE, ANCHOR_BASELINE_END };
196 
197  //TODO enum Alignment { ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER }; // note: multi-line text is always left-aligned in tkpath
198 
211  struct SIM_API Transform {
214  double a, b, c, d, t1, t2;
216 
219  Transform() : a(1), b(0), c(0), d(1), t1(0), t2(0) {}
220  Transform(double a, double b, double c, double d, double t1, double t2) : a(a), b(b), c(c), d(d), t1(t1), t2(t2) {}
221  Transform(const Transform& t) : a(t.a), b(t.b), c(t.c), d(t.d), t1(t.t1), t2(t.t2) {}
222  Transform& operator=(const Transform& t) {a=t.a; b=t.b; c=t.c; d=t.d; t1=t.t1; t2=t.t2; return *this;}
223  Transform& translate(double dx, double dy);
224  Transform& translate(const Point& p) {return translate(p.x, p.y);}
225  Transform& scale(double s) {return scale(s,s);}
226  Transform& scale(double sx, double sy);
227  Transform& scale(double sx, double sy, double cx, double cy);
228  Transform& scale(double sx, double sy, const Point& c) {return scale(sx, sy, c.x, c.y);}
229  Transform& rotate(double phi);
230  Transform& rotate(double phi, double cx, double cy);
231  Transform& rotate(double phi, const Point& c) {return rotate(phi, c.x, c.y);}
232  Transform& skewx(double coeff); // note: if you want to skew by an angle, use coeff = tan(phi)
233  Transform& skewy(double coeff);
234  Transform& skewx(double coeff, double cy);
235  Transform& skewy(double coeff, double cx);
236  Transform& multiply(const Transform& t); // left-multiply: *this = t * (*this)
237  Transform& rightMultiply(const Transform& t); // *this = (*this) * t
238  Point applyTo(const Point& p) const;
239  bool operator==(const Transform& o) const {return a == o.a && b == o.b && c == o.c && d == o.d && t1 == o.t1 && t2 == o.t2;}
240  std::string str() const;
242  };
243 
248  struct SIM_API RGBA {
251  uint8_t red, green, blue, alpha;
253 
255  RGBA() : red(0), green(0), blue(0), alpha(0) {}
256  RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) : red(red), green(green), blue(blue), alpha(alpha) {}
257  void set(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {red=r; green=g; blue=b; alpha=a;}
258  void operator=(const Color& color) {red = color.red; green = color.green; blue = color.blue; alpha = 255;}
259  operator Color() const {return Color(red, green, blue);}
260  bool operator==(const RGBA& o) const {return red == o.red && green == o.green && blue == o.blue && alpha == o.alpha;}
261  std::string str() const;
263  };
264 
270  class SIM_API Pixmap {
271  private:
272  int width, height; // zero is allowed
273  RGBA *data;
274  private:
275  void allocate(int width, int height);
276  static uint8_t alpha(double opacity) {return opacity<=0 ? 0 : opacity>=1.0 ? 255 : (uint8_t)(opacity*255+0.5);}
277  public:
280  Pixmap();
281  Pixmap(int width, int height); // filled with transparent black
282  Pixmap(int width, int height, const RGBA& fill);
283  Pixmap(int width, int height, const Color& color, double opacity=1);
284  Pixmap(const Pixmap& other);
285  ~Pixmap();
286  Pixmap& operator=(const Pixmap& other);
287  void setSize(int width, int height, const RGBA& fill_); // nondestructive
288  void setSize(int width, int height, const Color& color, double opacity); // nondestructive
289  void fill(const RGBA& fill_);
290  void fill(const Color& color, double opacity);
291  int getWidth() const {return width;}
292  int getHeight() const {return height;}
293  RGBA& pixel(int x, int y);
294  const RGBA pixel(int x, int y) const {return const_cast<Pixmap*>(this)->pixel(x,y);}
295  void setPixel(int x, int y, const Color& color, double opacity=1.0) {RGBA& p = pixel(x,y); p.set(color.red, color.green, color.blue, alpha(opacity));}
296  const Color getColor(int x, int y) const {return (Color)pixel(x,y);}
297  void setColor(int x, int y, const Color& color) {RGBA& p = pixel(x,y); p.red = color.red; p.green = color.green; p.blue = color.blue;}
298  double getOpacity(int x, int y) const {return pixel(x,y).alpha / 255.0;}
299  void setOpacity(int x, int y, double opacity) {pixel(x,y).alpha = alpha(opacity);}
300  const uint8_t *buffer() const {return (uint8_t*)data;} // direct access for low-level manipulation
301  std::string str() const;
303  };
304 
305  // internal:
306  enum {
307  CHANGE_STRUCTURAL = 1, // child added, removed, or reordered, shown/hidden
308  CHANGE_TRANSFORM = 2, // transform change
309  CHANGE_GEOMETRY = 4, // geometry information (bounds, position, start/end angle, etc)
310  CHANGE_VISUAL = 8, // styling
311  CHANGE_INPUTDATA = 16, // text, image name or pixmap data, value to be displayed, etc
312  CHANGE_TAGS = 32, // figure tags
313  CHANGE_ZINDEX = 64, // zIndex
314  CHANGE_OTHER = 128 // tooltip, associated object
315  };
316 
317  private:
318  static int lastId;
319  static cStringPool stringPool;
320  int id;
321  double zIndex;
322  bool visible; // treated as structural change, for simpler handling
323  const char *tooltip; // stringpool'd
324  cObject *associatedObject;
325  Transform transform;
326  std::vector<cFigure*> children;
327  const char *tags; // stringpool'd
328  uint64_t tagBits; // bit-to-tagname mapping is stored in cCanvas. Note: change to std::bitset if 64 tags are not enough
329  uint8_t localChanges;
330  uint8_t subtreeChanges;
331 
332  protected:
333  // internal:
334  virtual void validatePropertyKeys(cProperty *property) const; // relies on isAllowedPropertyKey()
335  virtual bool isAllowedPropertyKey(const char *key) const; // allows "x-*" keys, plus the ones returned by getAllowedPropertyKeys()
336  virtual cFigure *getRootFigure() const;
337  void fireStructuralChange() {fire(CHANGE_STRUCTURAL);}
338  void fireTransformChange() {fire(CHANGE_TRANSFORM);}
339  void fireGeometryChange() {fire(CHANGE_GEOMETRY);}
340  void fireVisualChange() {fire(CHANGE_VISUAL);}
341  void fireInputDataChange() {fire(CHANGE_INPUTDATA);}
342  virtual void fire(uint8_t flags);
343 
344  protected:
345  // helpers for parse(cProperty*)
346  static Point parsePoint(cProperty *property, const char *key, int index);
347  static std::vector<Point> parsePoints(cProperty *property, const char *key);
348  _OPPDEPRECATED static Rectangle parseBounds(cProperty *property) {return parseBounds(property, Rectangle());} //TODO use parseBounds(property, getBounds()) instead
349  static Rectangle parseBounds(cProperty *property, const Rectangle& defaults);
350  static Transform parseTransform(cProperty *property, const char *key);
351  static Font parseFont(cProperty *property, const char *key);
352  static Rectangle computeBoundingBox(const Point& position, const Point& size, double ascent, Anchor anchor);
353  static void concatArrays(const char **dest, const char **first, const char **second); // concatenates nullptr-terminated arrays
354 
355  public:
356  // helpers for class descriptors and parse(cProperty*)
357  static Point parsePoint(const char *s); // parse Point::str() format
358  static Rectangle parseRectangle(const char *s); // parse Rectangle::str() format
359  static Transform parseTransform(const char *s); // parse Transform::str() format
360  static Font parseFont(const char *s); // parse Font::str() format
361  static Color parseColor(const char *s);
362  static bool parseBool(const char *s);
363  static LineStyle parseLineStyle(const char *s);
364  static CapStyle parseCapStyle(const char *s);
365  static JoinStyle parseJoinStyle(const char *s);
366  static FillRule parseFillRule(const char *s);
367  static Arrowhead parseArrowhead(const char *s);
368  static Interpolation parseInterpolation(const char *s);
369  static Anchor parseAnchor(const char *s);
370 
371  public:
372  // internal, mostly used by runtime GUIs:
373  virtual void updateParentTransform(Transform& transform) {transform.rightMultiply(getTransform());}
374  virtual void callRefreshDisplay(); // call refreshDisplay(), and recurse to its children
375  uint8_t getLocalChangeFlags() const {return localChanges;}
376  uint8_t getSubtreeChangeFlags() const {return subtreeChanges;}
377  void clearChangeFlags();
378  void refreshTagBits();
379  void refreshTagBitsRec();
380  int64_t getTagBits() const {return tagBits;}
381  void setTagBits(uint64_t tagBits) {this->tagBits = tagBits;}
382 
383  private:
384  void copy(const cFigure& other);
385 
386  public:
392  explicit cFigure(const char *name=nullptr);
393 
397  cFigure(const cFigure& other) : cOwnedObject(other), tooltip(nullptr), tags(nullptr) {copy(other);}
398 
402  virtual ~cFigure();
403 
409  cFigure& operator=(const cFigure& other);
411 
419  virtual cFigure *dup() const override {throw cRuntimeError(this, E_CANTDUP);}
420 
425  virtual void forEachChild(cVisitor *v) override;
426 
430  virtual std::string str() const override;
432 
439  int getId() const {return id;}
440 
444  virtual bool isVisible() const {return visible;}
445 
451  virtual void setVisible(bool visible);
452 
456  virtual const Transform& getTransform() const {return transform;}
457 
464  virtual void setTransform(const Transform& transform);
465 
470  virtual void resetTransform() {setTransform(Transform());}
471 
477  virtual double getZIndex() const {return zIndex;}
478 
489  virtual void setZIndex(double zIndex);
490 
497  virtual double getEffectiveZIndex() const;
498 
502  virtual const char *getTooltip() const {return tooltip;}
503 
510  virtual void setTooltip(const char *tooltip);
511 
518  virtual cObject *getAssociatedObject() const {return associatedObject;}
519 
525  virtual void setAssociatedObject(cObject *obj);
526 
532  virtual const char *getTags() const {return tags;}
533 
539  virtual void setTags(const char *tags);
541 
547  virtual cFigure *getParentFigure() const {return dynamic_cast<cFigure*>(getOwner());}
548 
554  virtual cCanvas *getCanvas() const;
555 
559  virtual int getNumFigures() const {return children.size();}
560 
566  virtual cFigure *getFigure(int pos) const;
567 
572  virtual cFigure *getFigure(const char *name) const;
573 
578  virtual int findFigure(const char *name) const;
579 
584  virtual int findFigure(const cFigure *figure) const;
585 
589  virtual bool containsFigures() const {return !children.empty();}
590 
595  virtual cFigure *findFigureRecursively(const char *name) const;
596 
615  virtual cFigure *getFigureByPath(const char *path) const;
617 
623  virtual void addFigure(cFigure *figure);
624 
631  virtual void addFigure(cFigure *figure, int pos);
632 
636  _OPPDEPRECATED void addFigureAbove(cFigure *figure, cFigure *referenceFigure) {figure->insertAbove(referenceFigure);}
637 
641  _OPPDEPRECATED void addFigureBelow(cFigure *figure, cFigure *referenceFigure) {figure->insertBelow(referenceFigure);}
642 
649  virtual cFigure *removeFigure(cFigure *figure);
650 
657  virtual cFigure *removeFigure(int pos);
658 
663  virtual cFigure *removeFromParent();
665 
674  virtual bool isAbove(const cFigure *figure) const;
675 
682  virtual bool isBelow(const cFigure *figure) const;
683 
696  virtual void insertAbove(cFigure *referenceFigure);
697 
710  virtual void insertBelow(cFigure *referenceFigure);
711 
717  virtual void insertAfter(const cFigure *referenceFigure);
718 
724  virtual void insertBefore(const cFigure *referenceFigure);
725 
732  virtual void raiseAbove(cFigure *figure);
733 
740  virtual void lowerBelow(cFigure *figure);
741 
748  virtual void raiseToTop();
749 
756  virtual void lowerToBottom();
757 
761  virtual cFigure *dupTree() const;
763 
766  virtual void translate(double dx, double dy) {transform.translate(dx,dy); fireTransformChange();}
767  virtual void scale(double s) {transform.scale(s); fireTransformChange();}
768  virtual void scale(double sx, double sy) {transform.scale(sx,sy); fireTransformChange();}
769  virtual void scale(double sx, double sy, double cx, double cy) {transform.scale(sx,sy,cx,cy); fireTransformChange();}
770  virtual void scale(double sx, double sy, const Point& c) {scale(sx, sy, c.x, c.y);}
771  virtual void rotate(double phi) {transform.rotate(phi); fireTransformChange();}
772  virtual void rotate(double phi, double cx, double cy) {transform.rotate(phi,cx,cy); fireTransformChange();}
773  virtual void rotate(double phi, const Point& c) {rotate(phi, c.x, c.y);}
774  virtual void skewx(double coeff) {transform.skewx(coeff); fireTransformChange();}
775  virtual void skewy(double coeff) {transform.skewy(coeff); fireTransformChange();}
776  virtual void skewx(double coeff, double cy) {transform.skewx(coeff,cy); fireTransformChange();}
777  virtual void skewy(double coeff, double cx) {transform.skewy(coeff,cx); fireTransformChange();}
779 
792  virtual void parse(cProperty *property);
793 
804  virtual const char **getAllowedPropertyKeys() const;
805 
810  virtual void moveLocal(double dx, double dy) = 0;
811 
818  virtual void move(double dx, double dy);
819 
827  virtual void refreshDisplay() {}
828 
834  virtual const char *getRendererClassName() const = 0;
836 };
837 
838 // import the namespace to be able to use the stream write operators
839 namespace canvas_stream_ops {
840 #define STREAMOP(CLASS) inline std::ostream& operator<<(std::ostream& os, const CLASS& x) { return os << x.str(); }
841 STREAMOP(cFigure::Point);
842 STREAMOP(cFigure::Rectangle);
843 STREAMOP(cFigure::Color);
844 STREAMOP(cFigure::Font);
845 STREAMOP(cFigure::Transform);
846 STREAMOP(cFigure::RGBA);
847 STREAMOP(cFigure::Pixmap);
848 #undef STREAMOP
849 };
850 
851 
862 class SIM_API cGroupFigure : public cFigure
863 {
864  private:
865  void copy(const cGroupFigure& other) {}
866  public:
869  explicit cGroupFigure(const char *name=nullptr) : cFigure(name) {}
870  cGroupFigure(const cGroupFigure& other) : cFigure(other) {copy(other);}
871  cGroupFigure& operator=(const cGroupFigure& other);
873 
876  virtual cGroupFigure *dup() const override {return new cGroupFigure(*this);}
877  virtual std::string str() const override;
878  virtual const char *getRendererClassName() const override {return "GroupFigureRenderer";}
879  virtual void moveLocal(double dx, double dy) override {}
881 };
882 
896 class SIM_API cPanelFigure : public cFigure
897 {
898  private:
899  Point position;
900  Point anchorPoint;
901  protected:
902  virtual const char **getAllowedPropertyKeys() const override;
903  virtual void parse(cProperty *property) override;
904  private:
905  void copy(const cPanelFigure& other);
906  public:
909  explicit cPanelFigure(const char *name=nullptr) : cFigure(name) {}
910  cPanelFigure(const cPanelFigure& other) : cFigure(other) {copy(other);}
911  cPanelFigure& operator=(const cPanelFigure& other);
913 
916  virtual cPanelFigure *dup() const override {return new cPanelFigure(*this);}
917  virtual std::string str() const override;
918  virtual const char *getRendererClassName() const override {return "";} // non-visual figure
919  virtual void updateParentTransform(Transform& transform) override;
920  virtual void move(double dx, double dy) override { moveLocal(dx, dy); }
921  virtual void moveLocal(double dx, double dy) override {position.x += dx; position.y += dy; fireTransformChange();}
923 
926  virtual const Point& getPosition() const {return position;}
927  virtual void setPosition(const Point& position) {this->position = position; fireTransformChange();}
928 
938  virtual const Point& getAnchorPoint() const {return anchorPoint;}
939  virtual void setAnchorPoint(const Point& anchorPoint) {this->anchorPoint = anchorPoint; fireTransformChange();}
940 
942 };
943 
960 class SIM_API cAbstractLineFigure : public cFigure
961 {
962  private:
963  Color lineColor;
964  LineStyle lineStyle;
965  double lineWidth;
966  double lineOpacity;
967  CapStyle capStyle;
968  Arrowhead startArrowhead, endArrowhead;
969  bool zoomLineWidth;
970  private:
971  void copy(const cAbstractLineFigure& other);
972  protected:
973  virtual const char **getAllowedPropertyKeys() const override;
974  public:
977  explicit cAbstractLineFigure(const char *name=nullptr) : cFigure(name), lineColor(BLACK), lineStyle(LINE_SOLID), lineWidth(1), lineOpacity(1), capStyle(CAP_BUTT), startArrowhead(ARROW_NONE), endArrowhead(ARROW_NONE), zoomLineWidth(false) {}
978  cAbstractLineFigure(const cAbstractLineFigure& other) : cFigure(other) {copy(other);}
979  cAbstractLineFigure& operator=(const cAbstractLineFigure& other);
981 
984  virtual cAbstractLineFigure *dup() const override {throw cRuntimeError(this, E_CANTDUP);}
985  virtual std::string str() const override;
986  virtual void parse(cProperty *property) override;
988 
994  virtual const Color& getLineColor() const {return lineColor;}
995 
999  virtual void setLineColor(const Color& lineColor);
1000 
1006  virtual double getLineWidth() const {return lineWidth;}
1007 
1013  virtual void setLineWidth(double lineWidth);
1014 
1018  virtual double getLineOpacity() const {return lineOpacity;}
1019 
1024  virtual void setLineOpacity(double lineOpacity);
1025 
1029  virtual LineStyle getLineStyle() const {return lineStyle;}
1030 
1035  virtual void setLineStyle(LineStyle lineStyle);
1036 
1040  virtual CapStyle getCapStyle() const {return capStyle;}
1041 
1046  virtual void setCapStyle(CapStyle capStyle);
1047 
1051  virtual Arrowhead getStartArrowhead() const {return startArrowhead;}
1052 
1057  virtual void setStartArrowhead(Arrowhead startArrowhead);
1058 
1062  virtual Arrowhead getEndArrowhead() const {return endArrowhead;}
1063 
1068  virtual void setEndArrowhead(Arrowhead endArrowhead);
1069 
1074  virtual bool getZoomLineWidth() const {return zoomLineWidth;}
1075 
1081  virtual void setZoomLineWidth(bool zoomLineWidth);
1083 };
1084 
1093 class SIM_API cLineFigure : public cAbstractLineFigure
1094 {
1095  private:
1096  Point start, end;
1097  private:
1098  void copy(const cLineFigure& other);
1099  protected:
1100  virtual const char **getAllowedPropertyKeys() const override;
1101  public:
1104  explicit cLineFigure(const char *name=nullptr) : cAbstractLineFigure(name) {}
1105  cLineFigure(const cLineFigure& other) : cAbstractLineFigure(other) {copy(other);}
1106  cLineFigure& operator=(const cLineFigure& other);
1108 
1111  virtual cLineFigure *dup() const override {return new cLineFigure(*this);}
1112  virtual std::string str() const override;
1113  virtual void parse(cProperty *property) override;
1114  virtual void moveLocal(double dx, double dy) override;
1115  virtual const char *getRendererClassName() const override {return "LineFigureRenderer";}
1117 
1123  virtual const Point& getStart() const {return start;}
1124 
1128  virtual void setStart(const Point& start);
1129 
1133  virtual const Point& getEnd() const {return end;}
1134 
1138  virtual void setEnd(const Point& end);
1140 };
1141 
1161 class SIM_API cArcFigure : public cAbstractLineFigure
1162 {
1163  private:
1164  Rectangle bounds; // bounding box of the oval that arc is part of
1165  double startAngle, endAngle; // in radians, CCW, 0=east
1166  private:
1167  void copy(const cArcFigure& other);
1168  protected:
1169  virtual const char **getAllowedPropertyKeys() const override;
1170  public:
1173  explicit cArcFigure(const char *name=nullptr) : cAbstractLineFigure(name), startAngle(0), endAngle(0) {}
1174  cArcFigure(const cArcFigure& other) : cAbstractLineFigure(other) {copy(other);}
1175  cArcFigure& operator=(const cArcFigure& other);
1177 
1180  virtual cArcFigure *dup() const override {return new cArcFigure(*this);}
1181  virtual std::string str() const override;
1182  virtual void parse(cProperty *property) override;
1183  virtual void moveLocal(double dx, double dy) override;
1184  virtual const char *getRendererClassName() const override {return "ArcFigureRenderer";}
1186 
1193  virtual const Rectangle& getBounds() const {return bounds;}
1194 
1199  virtual void setBounds(const Rectangle& bounds);
1200 
1205  virtual void setPosition(const Point& position, Anchor anchor);
1206 
1211  virtual double getStartAngle() const {return startAngle;}
1212 
1217  virtual void setStartAngle(double startAngle);
1218 
1223  virtual double getEndAngle() const {return endAngle;}
1224 
1229  virtual void setEndAngle(double endAngle);
1231 };
1232 
1250 class SIM_API cPolylineFigure : public cAbstractLineFigure
1251 {
1252  private:
1253  std::vector<Point> points;
1254  bool smooth;
1255  JoinStyle joinStyle;
1256  private:
1257  void copy(const cPolylineFigure& other);
1258  void checkIndex(int i) const;
1259  void checkInsIndex(int i) const;
1260  protected:
1261  virtual const char **getAllowedPropertyKeys() const override;
1262  public:
1265  explicit cPolylineFigure(const char *name=nullptr) : cAbstractLineFigure(name), smooth(false), joinStyle(JOIN_MITER) {}
1266  cPolylineFigure(const cPolylineFigure& other) : cAbstractLineFigure(other) {copy(other);}
1267  cPolylineFigure& operator=(const cPolylineFigure& other);
1269 
1272  virtual cPolylineFigure *dup() const override {return new cPolylineFigure(*this);}
1273  virtual std::string str() const override;
1274  virtual void parse(cProperty *property) override;
1275  virtual void moveLocal(double dx, double dy) override;
1276  virtual const char *getRendererClassName() const override {return "PolylineFigureRenderer";}
1278 
1284  virtual const std::vector<Point>& getPoints() const {return points;}
1285 
1289  virtual void setPoints(const std::vector<Point>& points);
1290 
1294  virtual int getNumPoints() const {return points.size();}
1295 
1300  virtual const Point& getPoint(int i) const {checkIndex(i); return points[i];}
1301 
1305  virtual void setPoint(int i, const Point& point);
1306 
1310  virtual void addPoint(const Point& point);
1311 
1315  virtual void removePoint(int i);
1316 
1321  virtual void insertPoint(int i, const Point& point);
1322 
1329  virtual bool getSmooth() const {return smooth;}
1330 
1337  virtual void setSmooth(bool smooth);
1339 
1345  virtual JoinStyle getJoinStyle() const {return joinStyle;}
1346 
1351  virtual void setJoinStyle(JoinStyle joinStyle);
1353 };
1354 
1375 class SIM_API cAbstractShapeFigure : public cFigure
1376 {
1377  private:
1378  bool outlined;
1379  bool filled;
1380  Color lineColor;
1381  Color fillColor;
1382  LineStyle lineStyle;
1383  double lineWidth;
1384  double lineOpacity;
1385  double fillOpacity;
1386  bool zoomLineWidth;
1387  private:
1388  void copy(const cAbstractShapeFigure& other);
1389  protected:
1390  virtual const char **getAllowedPropertyKeys() const override;
1391  public:
1394  explicit cAbstractShapeFigure(const char *name=nullptr) : cFigure(name), outlined(true), filled(false), lineColor(BLACK), fillColor(BLUE), lineStyle(LINE_SOLID), lineWidth(1), lineOpacity(1), fillOpacity(1), zoomLineWidth(false) {}
1395  cAbstractShapeFigure(const cAbstractShapeFigure& other) : cFigure(other) {copy(other);}
1396  cAbstractShapeFigure& operator=(const cAbstractShapeFigure& other);
1398 
1401  virtual cAbstractShapeFigure *dup() const override {throw cRuntimeError(this, E_CANTDUP);}
1402  virtual std::string str() const override;
1403  virtual void parse(cProperty *property) override;
1405 
1411  virtual bool isFilled() const {return filled;}
1412 
1417  virtual void setFilled(bool filled);
1418 
1422  virtual bool isOutlined() const {return outlined;}
1423 
1428  virtual void setOutlined(bool outlined);
1429 
1433  virtual const Color& getLineColor() const {return lineColor;}
1434 
1439  virtual void setLineColor(const Color& lineColor);
1440 
1444  virtual const Color& getFillColor() const {return fillColor;}
1445 
1451  virtual void setFillColor(const Color& fillColor);
1452 
1456  virtual LineStyle getLineStyle() const {return lineStyle;}
1457 
1462  virtual void setLineStyle(LineStyle lineStyle);
1463 
1469  virtual double getLineWidth() const {return lineWidth;}
1470 
1476  virtual void setLineWidth(double lineWidth);
1477 
1482  virtual double getLineOpacity() const {return lineOpacity;}
1483 
1488  virtual void setLineOpacity(double lineOpacity);
1489 
1494  virtual double getFillOpacity() const {return fillOpacity;}
1495 
1500  virtual void setFillOpacity(double fillOpacity);
1501 
1506  virtual bool getZoomLineWidth() const {return zoomLineWidth;}
1507 
1513  virtual void setZoomLineWidth(bool zoomLineWidth);
1515 };
1516 
1527 {
1528  private:
1529  Rectangle bounds;
1530  double cornerRx, cornerRy;
1531  protected:
1532  virtual const char **getAllowedPropertyKeys() const override;
1533  private:
1534  void copy(const cRectangleFigure& other);
1535  public:
1538  explicit cRectangleFigure(const char *name=nullptr) : cAbstractShapeFigure(name), cornerRx(0), cornerRy(0) {}
1539  cRectangleFigure(const cRectangleFigure& other) : cAbstractShapeFigure(other) {copy(other);}
1540  cRectangleFigure& operator=(const cRectangleFigure& other);
1542 
1545  virtual cRectangleFigure *dup() const override {return new cRectangleFigure(*this);}
1546  virtual std::string str() const override;
1547  virtual void parse(cProperty *property) override;
1548  virtual void moveLocal(double dx, double dy) override;
1549  virtual const char *getRendererClassName() const override {return "RectangleFigureRenderer";}
1551 
1557  virtual const Rectangle& getBounds() const {return bounds;}
1558 
1562  virtual void setBounds(const Rectangle& bounds);
1563 
1568  virtual void setPosition(const Point& position, Anchor anchor);
1569 
1574  virtual void setCornerRadius(double r) {setCornerRx(r);setCornerRy(r);}
1575 
1579  virtual double getCornerRx() const {return cornerRx;}
1580 
1585  virtual void setCornerRx(double rx);
1586 
1590  virtual double getCornerRy() const {return cornerRy;}
1591 
1596  virtual void setCornerRy(double ry);
1598 };
1599 
1609 class SIM_API cOvalFigure : public cAbstractShapeFigure
1610 {
1611  private:
1612  Rectangle bounds; // bounding box
1613  private:
1614  void copy(const cOvalFigure& other);
1615  protected:
1616  virtual const char **getAllowedPropertyKeys() const override;
1617  public:
1620  explicit cOvalFigure(const char *name=nullptr) : cAbstractShapeFigure(name) {}
1621  cOvalFigure(const cOvalFigure& other) : cAbstractShapeFigure(other) {copy(other);}
1622  cOvalFigure& operator=(const cOvalFigure& other);
1624 
1627  virtual cOvalFigure *dup() const override {return new cOvalFigure(*this);}
1628  virtual std::string str() const override;
1629  virtual void parse(cProperty *property) override;
1630  virtual void moveLocal(double dx, double dy) override;
1631  virtual const char *getRendererClassName() const override {return "OvalFigureRenderer";}
1633 
1639  virtual const Rectangle& getBounds() const {return bounds;}
1640 
1644  virtual void setBounds(const Rectangle& bounds);
1645 
1650  virtual void setPosition(const Point& position, Anchor anchor);
1652 };
1653 
1664 class SIM_API cRingFigure : public cAbstractShapeFigure
1665 {
1666  private:
1667  Rectangle bounds; // bounding box
1668  double innerRx, innerRy;
1669  private:
1670  void copy(const cRingFigure& other);
1671  protected:
1672  virtual const char **getAllowedPropertyKeys() const override;
1673  public:
1676  explicit cRingFigure(const char *name=nullptr) : cAbstractShapeFigure(name), innerRx(0), innerRy(0) {}
1677  cRingFigure(const cRingFigure& other) : cAbstractShapeFigure(other) {copy(other);}
1678  cRingFigure& operator=(const cRingFigure& other);
1680 
1683  virtual cRingFigure *dup() const override {return new cRingFigure(*this);}
1684  virtual std::string str() const override;
1685  virtual void parse(cProperty *property) override;
1686  virtual void moveLocal(double dx, double dy) override;
1687  virtual const char *getRendererClassName() const override {return "RingFigureRenderer";}
1689 
1695  virtual const Rectangle& getBounds() const {return bounds;}
1696 
1700  virtual void setBounds(const Rectangle& bounds);
1701 
1706  virtual void setPosition(const Point& position, Anchor anchor);
1707 
1713  virtual void setInnerRadius(double r) {setInnerRx(r);setInnerRy(r);}
1714 
1718  virtual double getInnerRx() const {return innerRx;}
1719 
1723  virtual void setInnerRx(double rx);
1724 
1728  virtual double getInnerRy() const {return innerRy;}
1729 
1733  virtual void setInnerRy(double ry);
1735 };
1736 
1765 {
1766  private:
1767  Rectangle bounds; // bounding box of the oval that the pie slice is part of
1768  double startAngle, endAngle; // in radians, CCW, 0=east
1769  private:
1770  void copy(const cPieSliceFigure& other);
1771  protected:
1772  virtual const char **getAllowedPropertyKeys() const override;
1773  public:
1776  explicit cPieSliceFigure(const char *name=nullptr) : cAbstractShapeFigure(name), startAngle(0), endAngle(0) {}
1777  cPieSliceFigure(const cPieSliceFigure& other) : cAbstractShapeFigure(other) {copy(other);}
1778  cPieSliceFigure& operator=(const cPieSliceFigure& other);
1780 
1783  virtual cPieSliceFigure *dup() const override {return new cPieSliceFigure(*this);}
1784  virtual std::string str() const override;
1785  virtual void parse(cProperty *property) override;
1786  virtual void moveLocal(double dx, double dy) override;
1787  virtual const char *getRendererClassName() const override {return "PieSliceFigureRenderer";}
1789 
1796  virtual const Rectangle& getBounds() const {return bounds;}
1797 
1802  virtual void setBounds(const Rectangle& bounds);
1803 
1808  virtual void setPosition(const Point& position, Anchor anchor);
1809 
1814  virtual double getStartAngle() const {return startAngle;}
1815 
1820  virtual void setStartAngle(double startAngle);
1821 
1826  virtual double getEndAngle() const {return endAngle;}
1827 
1832  virtual void setEndAngle(double endAngle);
1834 };
1835 
1849 class SIM_API cPolygonFigure : public cAbstractShapeFigure
1850 {
1851  private:
1852  std::vector<Point> points;
1853  bool smooth;
1854  JoinStyle joinStyle;
1855  FillRule fillRule;
1856  private:
1857  void copy(const cPolygonFigure& other);
1858  void checkIndex(int i) const;
1859  void checkInsIndex(int i) const;
1860  protected:
1861  virtual const char **getAllowedPropertyKeys() const override;
1862  public:
1865  explicit cPolygonFigure(const char *name=nullptr) : cAbstractShapeFigure(name), smooth(false), joinStyle(JOIN_MITER), fillRule(FILL_EVENODD) {}
1866  cPolygonFigure(const cPolygonFigure& other) : cAbstractShapeFigure(other) {copy(other);}
1867  cPolygonFigure& operator=(const cPolygonFigure& other);
1869 
1872  virtual cPolygonFigure *dup() const override {return new cPolygonFigure(*this);}
1873  virtual std::string str() const override;
1874  virtual void parse(cProperty *property) override;
1875  virtual void moveLocal(double dx, double dy) override;
1876  virtual const char *getRendererClassName() const override {return "PolygonFigureRenderer";}
1878 
1884  virtual const std::vector<Point>& getPoints() const {return points;}
1885 
1889  virtual void setPoints(const std::vector<Point>& points);
1890 
1894  virtual int getNumPoints() const {return points.size();}
1895 
1900  virtual const Point& getPoint(int i) const {checkIndex(i); return points[i];}
1901 
1905  virtual void setPoint(int i, const Point& point);
1906 
1910  virtual void addPoint(const Point& point);
1911 
1915  virtual void removePoint(int i);
1916 
1921  virtual void insertPoint(int i, const Point& point);
1922 
1927  virtual bool getSmooth() const {return smooth;}
1928 
1934  virtual void setSmooth(bool smooth);
1936 
1942  virtual JoinStyle getJoinStyle() const {return joinStyle;}
1943 
1948  virtual void setJoinStyle(JoinStyle joinStyle);
1949 
1956  virtual FillRule getFillRule() const {return fillRule;}
1957 
1965  virtual void setFillRule(FillRule fillRule);
1967 };
1968 
1985 class SIM_API cPathFigure : public cAbstractShapeFigure
1986 {
1987  public:
1988  struct PathItem { char code; };
1989  struct MoveTo : PathItem { double x; double y; };
1990  struct MoveRel : PathItem { double dx; double dy; };
1991  struct LineTo : PathItem { double x; double y; };
1992  struct LineRel : PathItem { double dx; double dy; };
1993  struct HorizontalLineTo : PathItem { double x; };
1994  struct HorizontalLineRel : PathItem { double dx; };
1995  struct VerticalLineTo : PathItem { double y; };
1996  struct VerticalLineRel : PathItem { double dy; };
1997  struct ArcTo : PathItem { double rx; double ry; double phi; bool largeArc; bool sweep; double x; double y; };
1998  struct ArcRel : PathItem { double rx; double ry; double phi; bool largeArc; bool sweep; double dx; double dy; };
1999  struct CurveTo : PathItem { double x1; double y1; double x; double y; };
2000  struct CurveRel : PathItem { double dx1; double dy1; double dx; double dy; };
2001  struct SmoothCurveTo : PathItem { double x; double y; };
2002  struct SmoothCurveRel : PathItem { double dx; double dy; };
2003  struct CubicBezierCurveTo : PathItem { double x1; double y1; double x2; double y2; double x; double y; };
2004  struct CubicBezierCurveRel : PathItem { double dx1; double dy1; double dx2; double dy2; double dx; double dy; };
2005  struct SmoothCubicBezierCurveTo : PathItem { double x2; double y2; double x; double y; };
2006  struct SmoothCubicBezierCurveRel : PathItem { double dx2; double dy2; double dx; double dy; };
2007  struct ClosePath : PathItem { };
2008 
2009  private:
2010  std::vector<PathItem*> path;
2011  mutable std::string cachedPathString;
2012  JoinStyle joinStyle;
2013  CapStyle capStyle;
2014  Point offset;
2015  FillRule fillRule;
2016 
2017  private:
2018  void copy(const cPathFigure& other);
2019  void addItem(PathItem *item);
2020  void doClearPath();
2021 
2022  protected:
2023  virtual const char **getAllowedPropertyKeys() const override;
2024 
2025  public:
2028  explicit cPathFigure(const char *name=nullptr) : cAbstractShapeFigure(name), joinStyle(JOIN_MITER), capStyle(CAP_BUTT), fillRule(FILL_EVENODD) {}
2029  cPathFigure(const cPathFigure& other) : cAbstractShapeFigure(other) {copy(other);}
2030  virtual ~cPathFigure() {doClearPath();}
2031  cPathFigure& operator=(const cPathFigure& other);
2033 
2036  virtual cPathFigure *dup() const override {return new cPathFigure(*this);}
2037  virtual std::string str() const override;
2038  virtual void parse(cProperty *property) override;
2042  virtual void moveLocal(double dx, double dy) override;
2043  virtual const char *getRendererClassName() const override {return "PathFigureRenderer";}
2045 
2051  virtual JoinStyle getJoinStyle() const {return joinStyle;}
2052 
2057  virtual void setJoinStyle(JoinStyle joinStyle);
2058 
2062  virtual CapStyle getCapStyle() const {return capStyle;}
2063 
2068  virtual void setCapStyle(CapStyle capStyle);
2069 
2076  virtual FillRule getFillRule() const {return fillRule;}
2077 
2086  virtual void setFillRule(FillRule fillRule);
2088 
2096  virtual const Point& getOffset() const {return offset;}
2097 
2105  virtual void setOffset(const Point& offset);
2107 
2113  virtual const char *getPath() const;
2114 
2120  virtual void setPath(const char *path);
2121 
2125  virtual int getNumPathItems() const {return path.size();}
2126 
2132  virtual const PathItem *getPathItem(int k) const {return path[k];}
2133 
2137  virtual void clearPath();
2138 
2145  virtual void addMoveTo(double x, double y); // M x y
2146 
2154  virtual void addMoveRel(double dx, double dy); // m dx dy
2155 
2162  virtual void addLineTo(double x, double y); // L x y
2163 
2170  virtual void addLineRel(double dx, double dy); // l dx dy
2171 
2178  virtual void addHorizontalLineTo(double x); // H x
2179 
2186  virtual void addHorizontalLineRel(double dx); // h dx
2187 
2194  virtual void addVerticalLineTo(double y); // V y
2195 
2202  virtual void addVerticalLineRel(double dy); // v dy
2203 
2218  virtual void addArcTo(double rx, double ry, double phi, bool largeArc, bool sweep, double x, double y); // A rx ry phi largeArc sweep x y
2219 
2235  virtual void addArcRel(double rx, double ry, double phi, bool largeArc, bool sweep, double dx, double dy); // a rx ry phi largeArc sweep dx dy
2236 
2243  virtual void addCurveTo(double x1, double y1, double x, double y); // Q x1 y1 x y
2244 
2252  virtual void addCurveRel(double dx1, double dy1, double dx, double dy); // q dx1 dy1 dx dy
2253 
2265  virtual void addSmoothCurveTo(double x, double y); // T x y
2266 
2278  virtual void addSmoothCurveRel(double dx, double dy); // t dx dy
2279 
2288  virtual void addCubicBezierCurveTo(double x1, double y1, double x2, double y2, double x, double y); // C x1 y1 x2 y2 x y
2289 
2299  virtual void addCubicBezierCurveRel(double dx1, double dy1, double dx2, double dy2, double dx, double dy); // c dx1 dy1 dx2 dy2 dx dy
2300 
2313  virtual void addSmoothCubicBezierCurveTo(double x2, double y2, double x, double y); // S x2 y2 x y
2314 
2327  virtual void addSmoothCubicBezierCurveRel(double dx2, double dy2, double dx, double dy); // s dx2 dy2 dx dy
2328 
2336  virtual void addClosePath(); // Z
2338 };
2339 
2357 class SIM_API cAbstractTextFigure : public cFigure
2358 {
2359  private:
2360  Point position;
2361  Color color; // note: tkpath's text supports separate colors and opacity for fill and outline -- ignore because probably SWT doesn't support it!
2362  double opacity;
2363  bool halo;
2364  Font font;
2365  std::string text;
2366  Anchor anchor;
2367  private:
2368  void copy(const cAbstractTextFigure& other);
2369  protected:
2370  virtual const char **getAllowedPropertyKeys() const override;
2371  public:
2374  explicit cAbstractTextFigure(const char *name=nullptr) : cFigure(name), color(BLACK), opacity(1), halo(false), anchor(ANCHOR_NW) {}
2375  cAbstractTextFigure(const cAbstractTextFigure& other) : cFigure(other) {copy(other);}
2376  cAbstractTextFigure& operator=(const cAbstractTextFigure& other);
2378 
2381  virtual cAbstractTextFigure *dup() const override {throw cRuntimeError(this, E_CANTDUP);}
2382  virtual std::string str() const override;
2383  virtual void parse(cProperty *property) override;
2387  virtual void moveLocal(double dx, double dy) override;
2389 
2397  virtual const Point& getPosition() const {return position;}
2398 
2404  virtual void setPosition(const Point& position);
2405 
2411  virtual Anchor getAnchor() const {return anchor;}
2412 
2418  virtual void setAnchor(Anchor anchor);
2419 
2434  virtual Rectangle getBounds() const;
2436 
2442  virtual const Color& getColor() const {return color;}
2443 
2447  virtual void setColor(const Color& color);
2448 
2452  virtual double getOpacity() const {return opacity;}
2453 
2458  virtual void setOpacity(double opacity);
2459 
2463  virtual bool getHalo() const {return halo;}
2464 
2476  virtual void setHalo(bool enabled);
2477 
2481  virtual const Font& getFont() const {return font;}
2482 
2488  virtual void setFont(Font font);
2490 
2496  virtual const char *getText() const {return text.c_str();}
2497 
2502  virtual void setText(const char* text);
2504 };
2505 
2514 class SIM_API cTextFigure : public cAbstractTextFigure
2515 {
2516  private:
2517  void copy(const cTextFigure& other) {}
2518  public:
2521  explicit cTextFigure(const char *name=nullptr) : cAbstractTextFigure(name) {}
2522  cTextFigure(const cTextFigure& other) : cAbstractTextFigure(other) {copy(other);}
2523  cTextFigure& operator=(const cTextFigure& other);
2525 
2528  virtual cTextFigure *dup() const override {return new cTextFigure(*this);}
2529  virtual const char *getRendererClassName() const override {return "TextFigureRenderer";}
2531 };
2532 
2542 class SIM_API cLabelFigure : public cAbstractTextFigure
2543 {
2544  private:
2545  void copy(const cLabelFigure& other) {}
2546  public:
2549  explicit cLabelFigure(const char *name=nullptr) : cAbstractTextFigure(name) {}
2550  cLabelFigure(const cLabelFigure& other) : cAbstractTextFigure(other) {copy(other);}
2551  cLabelFigure& operator=(const cLabelFigure& other);
2553 
2556  virtual cLabelFigure *dup() const override {return new cLabelFigure(*this);}
2557  virtual const char *getRendererClassName() const override {return "LabelFigureRenderer";}
2559 };
2560 
2586 class SIM_API cAbstractImageFigure : public cFigure
2587 {
2588  private:
2589  Point position;
2590  Anchor anchor; // note: do not use the ANCHOR_BASELINE_START/MIDDLE/END constants, as they are for text items
2591  double width, height; // zero or negative values mean using the image's own size
2592  Interpolation interpolation;
2593  double opacity;
2594  Color tintColor;
2595  double tintAmount; // in the range 0..1
2596  private:
2597  void copy(const cAbstractImageFigure& other);
2598  protected:
2599  virtual const char **getAllowedPropertyKeys() const override;
2600  virtual Point getDefaultSize() const = 0;
2601  public:
2604  explicit cAbstractImageFigure(const char *name=nullptr) : cFigure(name), anchor(ANCHOR_CENTER), width(0), height(0), interpolation(INTERPOLATION_FAST), opacity(1), tintColor(BLUE), tintAmount(0) { }
2605  cAbstractImageFigure(const cAbstractImageFigure& other) : cFigure(other) {copy(other);}
2606  cAbstractImageFigure& operator=(const cAbstractImageFigure& other);
2608 
2611  virtual cAbstractImageFigure *dup() const override {throw cRuntimeError(this, E_CANTDUP);}
2612  virtual void parse(cProperty *property) override;
2616  virtual void moveLocal(double dx, double dy) override;
2618 
2626  virtual const Point& getPosition() const {return position;}
2627 
2633  virtual void setPosition(const Point& position);
2634 
2640  virtual Anchor getAnchor() const {return anchor;}
2641 
2647  virtual void setAnchor(Anchor anchor);
2648 
2653  virtual double getWidth() const {return width;}
2654 
2661  virtual void setWidth(double width);
2662 
2667  virtual double getHeight() const {return height;}
2668 
2675  virtual void setHeight(double height); // zero means "unset"
2676 
2681  virtual void setSize(double width, double height) {setWidth(width); setHeight(height);}
2682 
2694  virtual Rectangle getBounds() const;
2696 
2704  virtual Interpolation getInterpolation() const {return interpolation;}
2705 
2711  virtual void setInterpolation(Interpolation interpolation);
2712 
2716  virtual double getOpacity() const {return opacity;}
2717 
2722  virtual void setOpacity(double opacity);
2723 
2727  virtual const Color& getTintColor() const {return tintColor;}
2728 
2736  virtual void setTintColor(const Color& tintColor);
2737 
2742  virtual double getTintAmount() const {return tintAmount;}
2743 
2752  virtual void setTintAmount(double tintAmount);
2754 };
2755 
2765 class SIM_API cImageFigure : public cAbstractImageFigure
2766 {
2767  private:
2768  std::string imageName;
2769  private:
2770  void copy(const cImageFigure& other);
2771  protected:
2772  virtual const char **getAllowedPropertyKeys() const override;
2773  virtual Point getDefaultSize() const override;
2774  public:
2777  explicit cImageFigure(const char *name=nullptr) : cAbstractImageFigure(name) {}
2778  cImageFigure(const cImageFigure& other) : cAbstractImageFigure(other) {copy(other);}
2779  cImageFigure& operator=(const cImageFigure& other);
2781 
2784  virtual cImageFigure *dup() const override {return new cImageFigure(*this);}
2785  virtual std::string str() const override;
2786  virtual void parse(cProperty *property) override;
2787  virtual const char *getRendererClassName() const override {return "ImageFigureRenderer";}
2789 
2795  virtual const char *getImageName() const {return imageName.c_str();}
2796 
2803  virtual void setImageName(const char* imageName);
2804 
2815  virtual int getImageNaturalWidth() const {return getDefaultSize().x;}
2816 
2827  virtual int getImageNaturalHeight() const {return getDefaultSize().y;}
2829 };
2830 
2841 class SIM_API cIconFigure : public cImageFigure
2842 {
2843  private:
2844  void copy(const cIconFigure& other) {}
2845  public:
2848  explicit cIconFigure(const char *name=nullptr) : cImageFigure(name) {}
2849  cIconFigure(const cIconFigure& other) : cImageFigure(other) {copy(other);}
2850  cIconFigure& operator=(const cIconFigure& other);
2852 
2855  virtual cIconFigure *dup() const override {return new cIconFigure(*this);}
2856  virtual const char *getRendererClassName() const override {return "IconFigureRenderer";}
2858 };
2859 
2869 class SIM_API cPixmapFigure : public cAbstractImageFigure
2870 {
2871  private:
2872  Pixmap pixmap;
2873  private:
2874  void copy(const cPixmapFigure& other);
2875  protected:
2876  virtual const char **getAllowedPropertyKeys() const override;
2877  virtual Point getDefaultSize() const override;
2878  public:
2881  explicit cPixmapFigure(const char *name=nullptr) : cAbstractImageFigure(name) {}
2882  cPixmapFigure(const cPixmapFigure& other) : cAbstractImageFigure(other) {copy(other);}
2883  virtual ~cPixmapFigure() {}
2884  cPixmapFigure& operator=(const cPixmapFigure& other);
2886 
2889  virtual cPixmapFigure *dup() const override {return new cPixmapFigure(*this);}
2890  virtual std::string str() const override;
2891  virtual void parse(cProperty *property) override;
2892  virtual const char *getRendererClassName() const override {return "PixmapFigureRenderer";}
2894 
2904  virtual const Pixmap& getPixmap() const {return pixmap;}
2905 
2910  virtual void setPixmap(const Pixmap& pixmap);
2911 
2913  virtual int getPixmapHeight() const {return pixmap.getHeight();}
2915  virtual int getPixmapWidth() const {return pixmap.getWidth();}
2917  virtual void setPixmapSize(int width, int height, const RGBA& fill); // nondestructive, set *newly added* pixels with this color and opacity
2919  virtual void setPixmapSize(int width, int height, const Color& color, double opacity); // nondestructive, fills *newly added* pixels with this color and opacity
2921  virtual void fillPixmap(const RGBA& fill);
2923  virtual void fillPixmap(const Color& color, double opacity);
2925  virtual const RGBA getPixel(int x, int y) const {return pixmap.pixel(x, y);}
2927  virtual void setPixel(int x, int y, const RGBA& argb);
2929  virtual void setPixel(int x, int y, const Color& color, double opacity = 1.0);
2931  virtual const Color getPixelColor(int x, int y) const {return pixmap.getColor(x,y);}
2933  virtual void setPixelColor(int x, int y, const Color& color);
2935  virtual double getPixelOpacity(int x, int y) const {return pixmap.getOpacity(x,y);}
2937  virtual void setPixelOpacity(int x, int y, double opacity);
2939 };
2940 
2959 class SIM_API cCanvas : public cOwnedObject
2960 {
2961  private:
2962  cFigure::Color backgroundColor;
2963  cFigure *rootFigure;
2964  std::map<std::string,int> tagBitIndex; // tag-to-bitindex
2965  static std::map<std::string,cObjectFactory*> figureFactories;
2966  std::map<const cObject*,double> animationSpeedMap; // maps source to animationSpeed
2967  double animationHoldEndTime; // the effective one will be the maximum endTime of all visible canvases
2968  public:
2969  // internal:
2970  virtual cFigure *parseFigure(cProperty *property) const;
2971  virtual cFigure *createFigure(const char *type) const;
2972  static bool containsCanvasItems(cProperties *properties);
2973  virtual void addFiguresFrom(cProperties *properties);
2974  virtual uint64_t parseTags(const char *s);
2975  virtual std::string getTags(uint64_t tagBits);
2976  const std::map<const cObject*,double>& getAnimationSpeedMap() const {return animationSpeedMap;} // for e.g. Qtenv
2977  double getAnimationHoldEndTime() const {return animationHoldEndTime;} // for e.g. Qtenv
2978  private:
2979  void copy(const cCanvas& other);
2980  public:
2983  explicit cCanvas(const char *name = nullptr);
2984  cCanvas(const cCanvas& other) : cOwnedObject(other), rootFigure(nullptr) {copy(other);}
2985  virtual ~cCanvas();
2986  cCanvas& operator=(const cCanvas& other);
2988 
2991  virtual cCanvas *dup() const override {return new cCanvas(*this);}
2992  virtual void forEachChild(cVisitor *v) override;
2993  virtual std::string str() const override;
2995 
3001  virtual const cFigure::Color& getBackgroundColor() const {return backgroundColor;}
3002 
3006  virtual void setBackgroundColor(const cFigure::Color& color) {this->backgroundColor = color;}
3008 
3015  virtual cFigure *getRootFigure() const {return rootFigure;}
3016 
3020  virtual void addFigure(cFigure *figure) {rootFigure->addFigure(figure);}
3021 
3028  virtual void addFigure(cFigure *figure, int pos) {rootFigure->addFigure(figure, pos);}
3029 
3033  _OPPDEPRECATED void addFigureAbove(cFigure *figure, cFigure *referenceFigure) {figure->insertAbove(referenceFigure);}
3034 
3038  _OPPDEPRECATED void addFigureBelow(cFigure *figure, cFigure *referenceFigure) {figure->insertBelow(referenceFigure);}
3039 
3044  virtual cFigure *removeFigure(cFigure *figure) {return rootFigure->removeFigure(figure);}
3045 
3050  virtual cFigure *removeFigure(int pos) {return rootFigure->removeFigure(pos);}
3051 
3057  virtual int findFigure(const char *name) const {return rootFigure->findFigure(name);}
3058 
3063  virtual int findFigure(cFigure *figure) const {return rootFigure->findFigure(figure);}
3064 
3069  virtual bool hasFigures() const {return rootFigure->containsFigures();}
3070 
3074  virtual int getNumFigures() const {return rootFigure->getNumFigures();}
3075 
3081  virtual cFigure *getFigure(int pos) const {return rootFigure->getFigure(pos);}
3082 
3087  virtual cFigure *getFigure(const char *name) const {return rootFigure->getFigure(name);}
3089 
3099  virtual cFigure *getSubmodulesLayer() const;
3100 
3105  virtual cFigure *findFigureRecursively(const char *name) const {return rootFigure->findFigureRecursively(name);}
3106 
3111  virtual cFigure *getFigureByPath(const char *path) const {return rootFigure->getFigureByPath(path);}
3113 
3120  virtual std::string getAllTags() const;
3121 
3126  virtual std::vector<std::string> getAllTagsAsVector() const;
3128 
3146  virtual void setAnimationSpeed(double animationSpeed, const cObject *source);
3147 
3152  virtual double getAnimationSpeed(const cObject *source);
3153 
3172  virtual void holdSimulationFor(double animationTimeDelta);
3174 };
3175 
3176 } // namespace omnetpp
3177 
3178 
3179 #endif
3180 
virtual double getLineWidth() const
Definition: ccanvas.h:1469
virtual int getImageNaturalHeight() const
Definition: ccanvas.h:2827
Arrowhead
Arrowhead style constants: ARROW_NONE, ARROW_SIMPLE, etc.
Definition: ccanvas.h:189
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2529
virtual cAbstractTextFigure * dup() const override
Definition: ccanvas.h:2381
virtual CapStyle getCapStyle() const
Definition: ccanvas.h:2062
virtual const std::vector< Point > & getPoints() const
Definition: ccanvas.h:1284
virtual const std::vector< Point > & getPoints() const
Definition: ccanvas.h:1884
Represents the "q" path command with parameters.
Definition: ccanvas.h:2000
virtual CapStyle getCapStyle() const
Definition: ccanvas.h:1040
virtual LineStyle getLineStyle() const
Definition: ccanvas.h:1456
Thrown when the simulation kernel or other components detect a runtime error.
Definition: cexception.h:282
virtual Anchor getAnchor() const
Definition: ccanvas.h:2411
A figure that displays a ring, with explicitly controllable inner/outer radii.
Definition: ccanvas.h:1664
A figure that displays a line that consists of multiple connecting straight line segments or of a sin...
Definition: ccanvas.h:1250
virtual const Point & getPosition() const
Definition: ccanvas.h:2626
virtual const Point & getPoint(int i) const
Definition: ccanvas.h:1900
CapStyle
Line cap style constants: CAP_BUTT, CAP_SQUARE, etc.
Definition: ccanvas.h:180
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
virtual cFigure * getFigure(int pos) const
virtual int getPixmapHeight() const
Definition: ccanvas.h:2913
virtual double getFillOpacity() const
Definition: ccanvas.h:1494
A figure that displays an image that can be manipulated programmatically.
Definition: ccanvas.h:2869
virtual bool isVisible() const
Definition: ccanvas.h:444
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:878
Represents the "M" path command with parameters.
Definition: ccanvas.h:1989
virtual cFigure * getParentFigure() const
Definition: ccanvas.h:547
std::string typeface
Typeface of the font. An empty string means the default font.
Definition: ccanvas.h:160
virtual bool getZoomLineWidth() const
Definition: ccanvas.h:1074
FontStyle
Font style constants: FONT_NONE, FONT_BOLD, etc.
Definition: ccanvas.h:174
virtual bool getZoomLineWidth() const
Definition: ccanvas.h:1506
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1549
A figure that displays an image, typically an icon or a background image, loaded from the OMNeT++ ima...
Definition: ccanvas.h:2765
virtual void moveLocal(double dx, double dy) override
Definition: ccanvas.h:921
virtual const Point & getEnd() const
Definition: ccanvas.h:1133
A rectangular RGBA pixel array.
Definition: ccanvas.h:270
virtual bool getSmooth() const
Definition: ccanvas.h:1927
virtual const Point & getPoint(int i) const
Definition: ccanvas.h:1300
Represents the "V" path command with parameters.
Definition: ccanvas.h:1995
virtual const Rectangle & getBounds() const
Definition: ccanvas.h:1796
virtual cArcFigure * dup() const override
Definition: ccanvas.h:1180
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1115
virtual const Rectangle & getBounds() const
Definition: ccanvas.h:1557
Interpolation
Image interpolation mode constants: INTERPOLATION_NONE, INTERPOLATION_FAST, etc.
Definition: ccanvas.h:192
virtual int findFigure(cFigure *figure) const
Definition: ccanvas.h:3063
virtual const Point & getOffset() const
Definition: ccanvas.h:2096
virtual const Rectangle & getBounds() const
Definition: ccanvas.h:1695
A figure that draws a circle or ellipse.
Definition: ccanvas.h:1609
virtual const char * getTooltip() const
Definition: ccanvas.h:502
virtual int getNumPoints() const
Definition: ccanvas.h:1894
virtual cPolylineFigure * dup() const override
Definition: ccanvas.h:1272
Represents an RGB color.
Definition: ccanvas.h:120
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1787
Represents an RGBA pixel, for Pixmap manipulation.
Definition: ccanvas.h:248
Homogeneous 2D transformation matrix.
Definition: ccanvas.h:211
Abstract base class for figures that display text. Text may be multi-line.
Definition: ccanvas.h:2357
Represents the "s" path command with parameters.
Definition: ccanvas.h:2006
virtual const RGBA getPixel(int x, int y) const
Definition: ccanvas.h:2925
virtual Anchor getAnchor() const
Definition: ccanvas.h:2640
virtual double getInnerRy() const
Definition: ccanvas.h:1728
virtual int getNumFigures() const
Definition: ccanvas.h:3074
virtual double getCornerRx() const
Definition: ccanvas.h:1579
int getId() const
Definition: ccanvas.h:439
Represents an item in a cPathFigure path.
Definition: ccanvas.h:1988
virtual double getZIndex() const
Definition: ccanvas.h:477
Sets up an axis-aligned, unscaled coordinate system for children, canceling the effect of any transfo...
Definition: ccanvas.h:896
virtual cPathFigure * dup() const override
Definition: ccanvas.h:2036
virtual cLabelFigure * dup() const override
Definition: ccanvas.h:2556
virtual cFigure * removeFigure(int pos)
Definition: ccanvas.h:3050
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2856
virtual cCanvas * dup() const override
Definition: ccanvas.h:2991
virtual bool containsFigures() const
Definition: ccanvas.h:589
virtual const Point & getStart() const
Definition: ccanvas.h:1123
virtual const Color & getLineColor() const
Definition: ccanvas.h:1433
Represents a point as (x,y) coordinates.
Definition: ccanvas.h:64
virtual cFigure * getRootFigure() const
Definition: ccanvas.h:3015
virtual void refreshDisplay()
Definition: ccanvas.h:827
virtual cFigure * findFigureRecursively(const char *name) const
Definition: ccanvas.h:3105
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1184
virtual const Rectangle & getBounds() const
Definition: ccanvas.h:1639
virtual const Color & getColor() const
Definition: ccanvas.h:2442
virtual double getTintAmount() const
Definition: ccanvas.h:2742
virtual int getNumFigures() const
Definition: ccanvas.h:559
virtual double getWidth() const
Definition: ccanvas.h:2653
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:918
Represents the "v" path command with parameters.
Definition: ccanvas.h:1996
Represents the "Z" path command.
Definition: ccanvas.h:2007
virtual JoinStyle getJoinStyle() const
Definition: ccanvas.h:1345
Abstract base class for various shapes.
Definition: ccanvas.h:1375
virtual int getImageNaturalWidth() const
Definition: ccanvas.h:2815
FillRule
Fill rule constants: FILL_EVENODD, FILL_NONZERO.
Definition: ccanvas.h:186
A figure that displays a pie slice, that is, a section of an axis-aligned disc or filled ellipse...
Definition: ccanvas.h:1764
virtual double getInnerRx() const
Definition: ccanvas.h:1718
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2043
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2787
virtual cRectangleFigure * dup() const override
Definition: ccanvas.h:1545
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1876
virtual bool hasFigures() const
Definition: ccanvas.h:3069
virtual void move(double dx, double dy) override
Definition: ccanvas.h:920
virtual cFigure * getFigure(int pos) const
Definition: ccanvas.h:3081
virtual LineStyle getLineStyle() const
Definition: ccanvas.h:1029
A figure that displays an image, typically an icon or a background image, loaded from the OMNeT++ ima...
Definition: ccanvas.h:2841
Provides a scene graph based 2D drawing API for modules.
Definition: ccanvas.h:2959
cFigure(const cFigure &other)
Definition: ccanvas.h:397
Stores a (NED) property with its (possibly compound) value.
Definition: cproperty.h:38
int pointSize
Font size in points. A zero or negative value means the default size.
Definition: ccanvas.h:161
virtual const Color & getFillColor() const
Definition: ccanvas.h:1444
Represents the "C" path command with parameters.
Definition: ccanvas.h:2003
virtual double getPixelOpacity(int x, int y) const
Definition: ccanvas.h:2935
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:104
Represents the "Q" path command with parameters.
Definition: ccanvas.h:1999
virtual double getEndAngle() const
Definition: ccanvas.h:1223
Represents the "H" path command with parameters.
Definition: ccanvas.h:1993
virtual cOvalFigure * dup() const override
Definition: ccanvas.h:1627
virtual cFigure * getFigureByPath(const char *path) const
Represents the "S" path command with parameters.
Definition: ccanvas.h:2005
virtual double getEndAngle() const
Definition: ccanvas.h:1826
virtual FillRule getFillRule() const
Definition: ccanvas.h:1956
virtual JoinStyle getJoinStyle() const
Definition: ccanvas.h:1942
virtual const cFigure::Color & getBackgroundColor() const
Definition: ccanvas.h:3001
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2557
virtual int findFigure(const char *name) const
virtual cFigure * getFigureByPath(const char *path) const
Definition: ccanvas.h:3111
virtual void setInnerRadius(double r)
Definition: ccanvas.h:1713
virtual cRingFigure * dup() const override
Definition: ccanvas.h:1683
virtual double getOpacity() const
Definition: ccanvas.h:2452
virtual const Color getPixelColor(int x, int y) const
Definition: ccanvas.h:2931
Represents the "T" path command with parameters.
Definition: ccanvas.h:2001
Common base class for line figures.
Definition: ccanvas.h:960
Represents the "t" path command with parameters.
Definition: ccanvas.h:2002
virtual const Pixmap & getPixmap() const
Definition: ccanvas.h:2904
virtual const Transform & getTransform() const
Definition: ccanvas.h:456
virtual cPieSliceFigure * dup() const override
Definition: ccanvas.h:1783
virtual cPolygonFigure * dup() const override
Definition: ccanvas.h:1872
virtual const Color & getLineColor() const
Definition: ccanvas.h:994
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1631
virtual bool getSmooth() const
Definition: ccanvas.h:1329
virtual int findFigure(const char *name) const
Definition: ccanvas.h:3057
virtual void insertBelow(cFigure *referenceFigure)
virtual cFigure * getFigure(const char *name) const
Definition: ccanvas.h:3087
virtual double getLineWidth() const
Definition: ccanvas.h:1006
Enables traversing the tree of (cObject-rooted) simulation objects.
Definition: cvisitor.h:56
virtual cGroupFigure * dup() const override
Definition: ccanvas.h:876
virtual cLineFigure * dup() const override
Definition: ccanvas.h:1111
A figure that displays an arc.
Definition: ccanvas.h:1161
virtual cFigure * removeFigure(cFigure *figure)
LineStyle
Line style constants: LINE_SOLID, LINE_DOTTED, etc.
Definition: ccanvas.h:177
virtual bool isOutlined() const
Definition: ccanvas.h:1422
virtual const Point & getAnchorPoint() const
Definition: ccanvas.h:938
virtual const PathItem * getPathItem(int k) const
Definition: ccanvas.h:2132
virtual cPixmapFigure * dup() const override
Definition: ccanvas.h:2889
virtual const char * getTags() const
Definition: ccanvas.h:532
A figure that displays a straight line segment.
Definition: ccanvas.h:1093
Represents the "A" path command with parameters.
Definition: ccanvas.h:1997
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1276
virtual cIconFigure * dup() const override
Definition: ccanvas.h:2855
Represents the "h" path command with parameters.
Definition: ccanvas.h:1994
Definition: cabstracthistogram.h:21
virtual int getNumPathItems() const
Definition: ccanvas.h:2125
A figure that displays a rectangle, with optionally rounded corners.
Definition: ccanvas.h:1526
virtual void moveLocal(double dx, double dy) override
Definition: ccanvas.h:879
A collection of properties (cProperty).
Definition: cproperties.h:34
virtual const Point & getPosition() const
Definition: ccanvas.h:2397
virtual cPanelFigure * dup() const override
Definition: ccanvas.h:916
Represents the "m" path command with parameters.
Definition: ccanvas.h:1990
virtual void setSize(double width, double height)
Definition: ccanvas.h:2681
virtual cImageFigure * dup() const override
Definition: ccanvas.h:2784
Represents the "L" path command with parameters.
Definition: ccanvas.h:1991
_OPPDEPRECATED void addFigureAbove(cFigure *figure, cFigure *referenceFigure)
Definition: ccanvas.h:636
virtual void addFigure(cFigure *figure, int pos)
Definition: ccanvas.h:3028
virtual const Font & getFont() const
Definition: ccanvas.h:2481
virtual void insertAbove(cFigure *referenceFigure)
virtual FillRule getFillRule() const
Definition: ccanvas.h:2076
virtual void setCornerRadius(double r)
Definition: ccanvas.h:1574
A figure that displays a "path", a complex shape or line modeled after SVG paths. ...
Definition: ccanvas.h:1985
JoinStyle
Line join style constants: JOIN_BEVEL, JOIN_MITER, etc.
Definition: ccanvas.h:183
virtual const char * getImageName() const
Definition: ccanvas.h:2795
virtual cTextFigure * dup() const override
Definition: ccanvas.h:2528
virtual void addFigure(cFigure *figure)
virtual double getStartAngle() const
Definition: ccanvas.h:1211
_OPPDEPRECATED void addFigureBelow(cFigure *figure, cFigure *referenceFigure)
Definition: ccanvas.h:3038
Represents a rectangle as an (x,y,width,height) tuple.
Definition: ccanvas.h:90
_OPPDEPRECATED void addFigureAbove(cFigure *figure, cFigure *referenceFigure)
Definition: ccanvas.h:3033
virtual Arrowhead getEndArrowhead() const
Definition: ccanvas.h:1062
virtual cFigure * dup() const override
Definition: ccanvas.h:419
virtual double getHeight() const
Definition: ccanvas.h:2667
virtual cAbstractLineFigure * dup() const override
Definition: ccanvas.h:984
virtual int getPixmapWidth() const
Definition: ccanvas.h:2915
A figure that displays text which is affected by zooming and transformations.
Definition: ccanvas.h:2514
virtual void setBackgroundColor(const cFigure::Color &color)
Definition: ccanvas.h:3006
virtual void addFigure(cFigure *figure)
Definition: ccanvas.h:3020
virtual const Rectangle & getBounds() const
Definition: ccanvas.h:1193
virtual cAbstractShapeFigure * dup() const override
Definition: ccanvas.h:1401
Anchor
Anchoring mode constants: ANCHOR_CENTER, ANCHOR_N, etc.
Definition: ccanvas.h:195
uint8_t style
Font style. Binary OR of FontStyle constants such as FONT_BOLD.
Definition: ccanvas.h:162
A figure with the sole purpose of grouping its children, and no visual representation.
Definition: ccanvas.h:862
virtual double getLineOpacity() const
Definition: ccanvas.h:1482
virtual Interpolation getInterpolation() const
Definition: ccanvas.h:2704
A figure that displays text which is unaffected by zooming or transformations, except for its positio...
Definition: ccanvas.h:2542
virtual double getCornerRy() const
Definition: ccanvas.h:1590
virtual bool isFilled() const
Definition: ccanvas.h:1411
virtual double getOpacity() const
Definition: ccanvas.h:2716
Abstract base class for figures that display an image.
Definition: ccanvas.h:2586
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:1687
virtual int getNumPoints() const
Definition: ccanvas.h:1294
virtual double getLineOpacity() const
Definition: ccanvas.h:1018
A figure that displays a (closed) polygon, determined by a sequence of points.
Definition: ccanvas.h:1849
Represents the "c" path command with parameters.
Definition: ccanvas.h:2004
A lightweight graphical object for cCanvas.
Definition: ccanvas.h:57
virtual const char * getText() const
Definition: ccanvas.h:2496
virtual double getStartAngle() const
Definition: ccanvas.h:1814
virtual const Color & getTintColor() const
Definition: ccanvas.h:2727
Represents the "a" path command with parameters.
Definition: ccanvas.h:1998
_OPPDEPRECATED void addFigureBelow(cFigure *figure, cFigure *referenceFigure)
Definition: ccanvas.h:641
virtual JoinStyle getJoinStyle() const
Definition: ccanvas.h:2051
virtual cFigure * removeFigure(cFigure *figure)
Definition: ccanvas.h:3044
virtual cAbstractImageFigure * dup() const override
Definition: ccanvas.h:2611
virtual Arrowhead getStartArrowhead() const
Definition: ccanvas.h:1051
virtual bool getHalo() const
Definition: ccanvas.h:2463
virtual void resetTransform()
Definition: ccanvas.h:470
virtual cObject * getAssociatedObject() const
Definition: ccanvas.h:518
virtual cFigure * findFigureRecursively(const char *name) const
Represents the "l" path command with parameters.
Definition: ccanvas.h:1992
Represents properties of a font.
Definition: ccanvas.h:157
Reference-counted storage for strings.
Definition: cstringpool.h:36
virtual const char * getRendererClassName() const override
Definition: ccanvas.h:2892