Diagram.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. #ifndef Diagramm_H
  2. #define Diagramm_H
  3. #include "Array.h"
  4. #include "Critical.h"
  5. #include "Drawing.h"
  6. namespace Framework
  7. {
  8. class Rahmen; //! Border.h
  9. class AlphaFeld; //! AlphaField.h
  10. class Text; //! Text.h
  11. class Schrift; //! Font.h
  12. class HScrollBar; //! Scroll.h
  13. class VScrollBar; //! Scroll.h
  14. class SLDiag; //! from this file
  15. class LDiag; //! from this file
  16. class TextRenderer;
  17. //! A 2D GUI Framework drawing that draws a live diagram of values
  18. class SLDiag : public DrawableBackground
  19. {
  20. public:
  21. class Style : public DrawableBackground::Style
  22. {
  23. public:
  24. //! A grid is drawn in the diagram for orientation
  25. static const __int64 Gitter = 0x01000;
  26. //! The names of the graphs are displayed
  27. static const __int64 LinienName = 0x02000;
  28. //! Combination of flags Visible, Background,
  29. //! Border, Grid, LineName
  30. static const __int64 normal
  31. = Sichtbar | Hintergrund | Rahmen | Gitter | LinienName;
  32. };
  33. private:
  34. int gF;
  35. Array<int>* lFarbe;
  36. RCArray<Text>* lName;
  37. RCArray<Array<int>>* ph;
  38. RCArray<Array<int>>* pb;
  39. Array<int>* lastValue;
  40. TextRenderer* textRd;
  41. Punkt gitterGr;
  42. int lines;
  43. public:
  44. //! Constructor
  45. DLLEXPORT SLDiag();
  46. //! Destructor
  47. DLLEXPORT virtual ~SLDiag();
  48. //! Sets the used TextRenderer
  49. //! \param textRd The text renderer
  50. DLLEXPORT void setTextRendererZ(TextRenderer* textRd);
  51. //! Sets a pointer to the used font
  52. //! \param schrift The font
  53. DLLEXPORT void setSchriftZ(Schrift* schrift);
  54. //! Sets the spacing between the grid lines
  55. //! \param gr For x the spacing between each vertical line in
  56. //! pixels and for y the spacing between each horizontal line in
  57. //! the displayed y values
  58. DLLEXPORT void setGSize(Punkt& gr);
  59. //! Sets the color of the grid lines
  60. //! \param f The color in A8R8G8B8 format
  61. DLLEXPORT void setGFarbe(int f);
  62. //! Adds a new graph to the diagram
  63. //! \param name The name of the graph. It is displayed in the diagram
  64. //! when the LineName flag is set
  65. DLLEXPORT void addLinie(const char* name);
  66. //! Adds a new graph to the diagram
  67. //! \param name The name of the graph. It is displayed in the diagram
  68. //! when the LineName flag is set
  69. DLLEXPORT void addLinie(Text* txt);
  70. //! Sets the color of a graph
  71. //! \param lNum The index of the graph
  72. //! \param f The color in A8R8G8B8 format
  73. DLLEXPORT void setLFarbe(int lNum, int f);
  74. //! Adds a point to a graph. This shifts all points of the graph
  75. //! to the left so that the new point appears on the right. If a point
  76. //! goes off the left edge of the diagram, it is deleted. This way the
  77. //! diagram appears like a live measurement \param x The distance to the
  78. //! last point in pixels \param y The value of the displayed function at the point
  79. DLLEXPORT void addPunkt(int lNum, int x, int h);
  80. //! Removes a graph
  81. //! \param lNum The index of the graph
  82. DLLEXPORT void removeLinie(int lNum);
  83. //! Draws the diagram
  84. //! \param zRObj The image to draw into
  85. DLLEXPORT void render(Bild& zRObj) override;
  86. //! Returns the used font
  87. DLLEXPORT Schrift* getSchrift() const;
  88. //! Returns the used font without increased reference counter
  89. DLLEXPORT Schrift* zSchrift() const;
  90. //! Returns the size of a grid square, where the width is in pixels
  91. //! and the height is in y axis values
  92. DLLEXPORT const Punkt& getGSize() const;
  93. //! Returns the color of the grid in A8R8G8B8 format
  94. DLLEXPORT int getGFarbe() const;
  95. //! Returns the index of a graph
  96. //! \param name The name of the graph
  97. DLLEXPORT int getLinienNummer(const char* name) const;
  98. //! Returns the index of a graph
  99. //! \param name The name of the graph
  100. DLLEXPORT int getLinienNummer(Text* name) const;
  101. //! Returns the name of a graph
  102. //! \param lNum The index of the graph
  103. DLLEXPORT Text* getLinienName(int lNum) const;
  104. //! Returns the name of a graph without increased reference counter
  105. //! \param lNum The index of the graph
  106. DLLEXPORT Text* zLinienNamen(int lNum) const;
  107. //! Returns the highest y value of all graphs
  108. DLLEXPORT int getHighestValue() const;
  109. //! Returns the highest y value of a specific graph
  110. //! \param lNum The index of the graph
  111. DLLEXPORT int getHighestValue(int lNum) const;
  112. //! Returns the average value of all points stored in the diagram
  113. //! for a graph \param lNum The index of the graph
  114. DLLEXPORT int getMedian(int lNum) const;
  115. //! Returns the number of graphs
  116. DLLEXPORT int getLAnzahl() const;
  117. //! Returns the y value of the last point of a graph
  118. //! \param lNum The index of the graph
  119. DLLEXPORT int getLastValue(int lNum) const;
  120. };
  121. //! Point of a value in a diagram
  122. struct DiagPunkt
  123. {
  124. //! Position of the point on the horizontal interval of the diagram
  125. double hIntervall;
  126. //! Position of the point on the vertical interval of the diagram
  127. double vIntervall;
  128. };
  129. //! Value that is visualized in a diagram
  130. struct DiagWert : public virtual ReferenceCounter
  131. {
  132. //! Style of a diagram value
  133. class Style
  134. {
  135. public:
  136. static const int Sichtbar
  137. = 0x01; //! Determines whether the value should be displayed
  138. static const int Alpha
  139. = 0x02; //! Determines whether alpha blending should be used
  140. //! when drawing the value
  141. static const int Hintergrund
  142. = 0x04; //! Determines whether the value has a background
  143. static const int HAlpha
  144. = 0x08; //! Determines whether alpha blending should be used
  145. //! when drawing the background
  146. static const int Name = 0x10; //! Determines whether the name of
  147. //! the value should be drawn
  148. };
  149. //! Style of the value
  150. int style;
  151. //! Color of the value
  152. int farbe;
  153. //! Background color of the value
  154. int hintergrund;
  155. //! Name of the value
  156. Text* name;
  157. //! Points of the value
  158. Array<DiagPunkt*>* punkte;
  159. //! Constructor
  160. DLLEXPORT DiagWert();
  161. //! Destructor
  162. DLLEXPORT ~DiagWert();
  163. };
  164. //! Data for a diagram
  165. struct DiagDaten : public virtual ReferenceCounter
  166. {
  167. class Style
  168. {
  169. public:
  170. static const int Sichtbar
  171. = 0x0001; //! Determines whether the data should be visible
  172. static const int Raster
  173. = 0x0002; //! Determines whether a grid for orientation
  174. //! should be displayed
  175. static const int RasterAlpha
  176. = 0x0004; //! Determines whether alpha blending should be used
  177. //! for drawing the grid
  178. static const int AutoIntervallHeight
  179. = 0x0008; //! Determines that all values are automatically scaled
  180. //! on the y axis so that the full height of the
  181. //! diagram is always used
  182. static const int AutoIntervallBreite
  183. = 0x0010; //! Determines that all values are automatically scaled
  184. //! on the x axis so that the full width of the
  185. //! diagram is always used
  186. static const int HIntervall
  187. = 0x0020; //! Determines whether the X axis should be drawn
  188. static const int VIntervall
  189. = 0x0040; //! Determines whether the Y axis should be drawn
  190. static const int HIntervallTexte
  191. = 0x0200; //! Determines whether custom texts for the X axis
  192. //! values should be drawn
  193. static const int VIntervallTexte
  194. = 0x0400; //! Determines whether custom texts for the Y axis
  195. //! values should be drawn
  196. static const int AutoRasterBreite
  197. = 0x0800; //! Determines whether the spacing between vertical
  198. //! grid lines should be chosen automatically
  199. static const int AutoRasterHeight
  200. = 0x1000; //! Determines whether the spacing between horizontal
  201. //! grid lines should be chosen automatically
  202. static const int intervalle
  203. = HIntervall
  204. | VIntervall; //! Combines flags HIntervall, VIntervall
  205. static const int intervallTexte
  206. = HIntervallTexte
  207. | VIntervallTexte; //! Combines flags HIntervallTexte,
  208. //! VIntervallTexte
  209. static const int autoRaster
  210. = AutoRasterHeight | AutoRasterBreite
  211. | Raster; //! Combines flags AutoRasterHeight,
  212. //! AutoRasterBreite, Raster
  213. static const int autoIntervall
  214. = AutoIntervallHeight
  215. | AutoIntervallBreite; //! Combines flags AutoIntervallHeight,
  216. //! AutoIntervallBreite
  217. };
  218. //! Style of the diagram
  219. int style;
  220. //! Width of a grid line
  221. int rasterDicke;
  222. //! Width of a grid cell
  223. double rasterBreite;
  224. //! Height of a grid cell
  225. double rasterHeight;
  226. //! Color of the grid
  227. int rasterFarbe;
  228. //! Font color of the horizontal interval
  229. int hIntervallFarbe;
  230. //! Font color of the vertical interval
  231. int vIntervallFarbe;
  232. //! Name of the horizontal interval
  233. Text* hIntervallName;
  234. //! Name of the vertical interval
  235. Text* vIntervallName;
  236. //! Labels of the horizontal interval
  237. RCArray<Text>* hIntervallTexte;
  238. //! Labels of the vertical interval
  239. RCArray<Text>* vIntervallTexte;
  240. //! Individual horizontal intervals
  241. Array<double>* hIntervallWerte;
  242. //! Individual vertical intervals
  243. Array<double>* vIntervallWerte;
  244. //! Width of value 1 in pixels for the horizontal interval (overridden
  245. //! by setting AutoIntervallBreite)
  246. double hIntervallBreite;
  247. //! Height of value 1 in pixels for the vertical interval (overridden
  248. //! by setting AutoIntervallHeight)
  249. double vIntervallHeight;
  250. //! Values visualized in the diagram
  251. RCArray<DiagWert>* werte;
  252. //! Constructor
  253. DLLEXPORT DiagDaten();
  254. //! Destructor
  255. DLLEXPORT ~DiagDaten();
  256. };
  257. //! Base class for the different diagram types
  258. class BaseDiag
  259. {
  260. protected:
  261. DiagDaten* daten;
  262. bool changed;
  263. Critical* lock;
  264. public:
  265. //! Constructor
  266. //! \param lock A pointer to the Critical used to make the diagram class
  267. //! that inherits from this class thread-safe
  268. DLLEXPORT BaseDiag(Critical* lock);
  269. //! Destructor
  270. DLLEXPORT virtual ~BaseDiag();
  271. //! Sets a pointer to the diagram data
  272. //! \param dd The data
  273. DLLEXPORT void setDiagDatenZ(DiagDaten* dd);
  274. //! Copies diagram data
  275. //! \param dd The data
  276. DLLEXPORT void setDiagDaten(DiagDaten* dd);
  277. //! Sets the grid line thickness
  278. //! \param d The width of a grid line in pixels
  279. DLLEXPORT void setRasterDicke(int d);
  280. //! Sets the grid width
  281. //! \param br The spacing between two vertical grid lines in pixels
  282. DLLEXPORT void setRasterBreite(int br);
  283. //! Sets the grid height
  284. //! \param hi The spacing between two horizontal grid lines in pixels
  285. DLLEXPORT void setRasterHeight(int hi);
  286. //! Sets the grid color
  287. //! \param f The color in A8R8G8B8 format
  288. DLLEXPORT void setRasterFarbe(int f);
  289. //! Sets the interval width
  290. //! \param br The distance between values 0 and 1 on the X axis in pixels
  291. DLLEXPORT void setHIntervallBreite(double br);
  292. //! Sets the interval height
  293. //! \param hi The distance between values 0 and 1 on the Y axis in pixels
  294. DLLEXPORT void setVIntervallHeight(double hi);
  295. //! Sets the color of the X axis
  296. //! \param f The color in A8R8G8B8 format
  297. DLLEXPORT void setHIntervallFarbe(int f);
  298. //! Sets the color of the Y axis
  299. //! \param f The color in A8R8G8B8 format
  300. DLLEXPORT void setVIntervallFarbe(int f);
  301. //! Sets the name of the X axis
  302. //! \param name The name
  303. DLLEXPORT void setHIntervallName(const char* name);
  304. //! Sets the name of the X axis
  305. //! \param name The name
  306. DLLEXPORT void setHIntervallName(Text* name);
  307. //! Sets the name of the Y axis
  308. //! \param name The name
  309. DLLEXPORT void setVIntervallName(const char* name);
  310. //! Sets the name of the Y axis
  311. //! \param name The name
  312. DLLEXPORT void setVIntervallName(Text* name);
  313. //! Labels a specific value on the X axis, if the HIntervallTexte flag
  314. //! was set in DiagDaten \param hIntervall The value to label
  315. //! \param text The label
  316. DLLEXPORT void addHIntervallText(double hIntervall, const char* text);
  317. //! Labels a specific value on the X axis, if the HIntervallTexte flag
  318. //! was set in DiagDaten \param hIntervall The value to label
  319. //! \param text The label
  320. DLLEXPORT void addHIntervallText(double hIntervall, Text* text);
  321. //! Sets a pointer to a label for a specific value on the X axis,
  322. //! if the HIntervallTexte flag was set in DiagDaten
  323. //! \param hIntervall The value to label
  324. //! \param text The label
  325. DLLEXPORT void setHIntervallTextZ(double hIntervall, Text* text);
  326. //! Changes a label for a specific value on the X axis, if the
  327. //! HIntervallTexte flag was set in DiagDaten \param hIntervall The
  328. //! value to label \param text The label
  329. DLLEXPORT void setHIntervallText(double hIntervall, Text* text);
  330. //! Changes a label for a specific value on the X axis, if the
  331. //! HIntervallTexte flag was set in DiagDaten \param hIntervall The
  332. //! value to label \param text The label
  333. DLLEXPORT void setHIntervallText(double hIntervall, const char* text);
  334. //! Removes a label for a specific value on the X axis,
  335. //! if the HIntervallTexte flag was set in DiagDaten \param
  336. //! hIntervall The value that should no longer be labeled
  337. DLLEXPORT void removeHIntervallText(double hIntervall);
  338. //! Labels a specific value on the Y axis, if the VIntervallTexte flag
  339. //! was set in DiagDaten \param vIntervall The value to label
  340. //! \param text The label
  341. DLLEXPORT void addVIntervallText(double vIntervall, const char* text);
  342. //! Labels a specific value on the Y axis, if the VIntervallTexte flag
  343. //! was set in DiagDaten \param vIntervall The value to label
  344. //! \param text The label
  345. DLLEXPORT void addVIntervallText(double vIntervall, Text* text);
  346. //! Sets a pointer to a label for a specific value on the Y axis,
  347. //! if the VIntervallTexte flag was set in DiagDaten
  348. //! \param vIntervall The value to label
  349. //! \param text The label
  350. DLLEXPORT void setVIntervallTextZ(double vIntervall, Text* text);
  351. //! Changes a label for a specific value on the Y axis, if the
  352. //! VIntervallTexte flag was set in DiagDaten \param vIntervall The
  353. //! value to label \param text The label
  354. DLLEXPORT void setVIntervallText(double vIntervall, Text* text);
  355. //! Changes a label for a specific value on the Y axis, if the
  356. //! VIntervallTexte flag was set in DiagDaten \param vIntervall The
  357. //! value to label \param text The label
  358. DLLEXPORT void setVIntervallText(double vIntervall, const char* text);
  359. //! Removes a label for a specific value on the Y axis,
  360. //! if the VIntervallTexte flag was set in DiagDaten \param
  361. //! vIntervall The value that should no longer be labeled
  362. DLLEXPORT void removeVIntervallText(double vIntervall);
  363. //! Adds a value (graph) displayed in the diagram
  364. //! \param w The new value
  365. DLLEXPORT void addWertZ(DiagWert* w);
  366. //! Adds a value (graph) displayed in the diagram by copying
  367. //! another \param w The value to copy
  368. DLLEXPORT void addWert(DiagWert* w);
  369. //! Adds a value (graph) displayed in the diagram
  370. //! \param name The name of the value
  371. DLLEXPORT void addWert(const char* name);
  372. //! Adds a value (graph) displayed in the diagram
  373. //! \param name The name of the value
  374. DLLEXPORT void addWert(Text* txt);
  375. //! Sets the color of a value
  376. //! \param wNum The index of the value
  377. //! \param fc The color in A8R8G8B8 format
  378. DLLEXPORT void setWertFarbe(int wNum, int fc);
  379. //! Adds a point to a value
  380. //! \param wNum The index of the value
  381. //! \param p The new point
  382. DLLEXPORT void addPunktZ(int wNum, DiagPunkt* p);
  383. //! Adds a point to a value by copying a point
  384. //! \param wNum The index of the value
  385. //! \param p The point to copy
  386. DLLEXPORT void addPunkt(int wNum, DiagPunkt* p);
  387. //! Adds a point to a value
  388. //! \param wNum The index of the value
  389. //! \param hI The value of the point on the X axis
  390. //! \param vI The value of the point on the Y axis
  391. DLLEXPORT void addPunkt(int wNum, double hI, double vI);
  392. //! Sets a pointer to an existing point of a value
  393. //! \param wNum The index of the value
  394. //! \param hI The X axis value of the point to replace
  395. //! \param p The new point
  396. DLLEXPORT void setPunktZ(int wNum, double hI, DiagPunkt* p);
  397. //! Sets an existing point of a value by copying a point
  398. //! \param wNum The index of the value \param hI The X axis value of
  399. //! the point to replace \param p The new point
  400. DLLEXPORT void setPunkt(int wNum, double hI, DiagPunkt* p);
  401. //! Sets an existing point of a value
  402. //! \param wNum The index of the value
  403. //! \param hI The X axis value of the point to replace
  404. //! \param h The X axis value of the new point \param v
  405. //! The Y axis value of the new point
  406. DLLEXPORT void setPunkt(int wNum, double hI, double h, double v);
  407. //! Sets a pointer to an existing point of a value
  408. //! \param wNum The index of the value
  409. //! \param pNum The index of the point in the value
  410. //! \param p The new point
  411. DLLEXPORT void setPunktZ(int wNum, int pNum, DiagPunkt* p);
  412. //! Sets an existing point of a value by copying a point
  413. //! \param wNum The index of the value \param pNum The index of the
  414. //! point in the value \param p The new point
  415. DLLEXPORT void setPunkt(int wNum, int pNum, DiagPunkt* p);
  416. //! Sets an existing point of a value
  417. //! \param wNum The index of the value
  418. //! \param pNum The index of the point in the value
  419. //! \param h The X axis value of the new point
  420. //! \param v The Y axis value of the new point
  421. DLLEXPORT void setPunkt(int wNum, int pNum, double h, double v);
  422. //! Deletes an existing point
  423. //! \param wNum The index of the value
  424. //! \param hI The X axis value of the point to delete
  425. DLLEXPORT void removePunkt(int wNum, double hI);
  426. //! Deletes an existing point
  427. //! \param wNum The index of the value
  428. //! \param pNum The index of the point in the value
  429. DLLEXPORT void removePunkt(int wNum, int pNum);
  430. //! Removes a value
  431. //! \param wNum The index of the value
  432. DLLEXPORT void removeWert(int wNum);
  433. //! Removes a value
  434. //! \param name The name of the value
  435. DLLEXPORT void removeWert(const char* name);
  436. //! Removes a value
  437. //! \param name The name of the value
  438. DLLEXPORT void removeWert(Text* name);
  439. //! Adds styles to the DiagDaten
  440. //! \param style The new styles
  441. DLLEXPORT void addDatenStyle(int style);
  442. //! Sets the styles of the DiagDaten
  443. //! \param style The new styles
  444. DLLEXPORT void setDatenStyle(int style);
  445. //! Sets the styles of the DiagDaten
  446. //! \param style The styles
  447. //! \param addRemove 1 if the styles should be added. 0 if the styles
  448. //! should be removed
  449. DLLEXPORT void setDatenStyle(int style, bool addRemove);
  450. //! Removes styles from the DiagDaten
  451. //! \param style The styles to remove
  452. DLLEXPORT void removeDatenStyle(int style);
  453. //! Adds styles to a specific value
  454. //! \param wNum The index of the value
  455. //! \param style The new styles
  456. DLLEXPORT void addWertStyle(int wNum, int style);
  457. //! Sets the styles of a specific value
  458. //! \param wNum The index of the value
  459. //! \param style The new styles
  460. DLLEXPORT void setWertStyle(int wNum, int style);
  461. //! Sets the styles of a specific value
  462. //! \param wNum The index of the value
  463. //! \param style The styles
  464. //! \param addRemove 1 if the styles should be added. 0 if the styles
  465. //! should be removed
  466. DLLEXPORT void setWertStyle(int wNum, int style, bool addRemove);
  467. //! Removes styles from a specific value
  468. //! \param wNum The index of the value
  469. //! \param style The styles to remove
  470. DLLEXPORT void removeWertStyle(int wNum, int style);
  471. //! Returns the diagram data
  472. DLLEXPORT DiagDaten* getDiagDaten() const;
  473. //! Returns the diagram data without increased reference counter
  474. DLLEXPORT DiagDaten* zDiagDaten() const;
  475. //! Returns the data of a value
  476. //! \param wNum The index of the value
  477. DLLEXPORT DiagWert* getDiagWert(int wNum) const;
  478. //! Returns the data of a value without increased reference counter
  479. //! \param wNum The index of the value
  480. DLLEXPORT DiagWert* zDiagWert(int wNum) const;
  481. //! Returns the data of a value
  482. //! \param name The name of the value
  483. DLLEXPORT DiagWert* getDiagWert(const char* name) const;
  484. //! Returns the data of a value without increased reference counter
  485. //! \param name The name of the value
  486. DLLEXPORT DiagWert* zDiagWert(const char* name) const;
  487. //! Returns the index of a value
  488. //! \param name The name of the value
  489. DLLEXPORT int getDiagWertPos(const char* name) const;
  490. //! Returns the index of a point from a value
  491. //! \param wNum The index of the value
  492. //! \param hI The X axis value of the point
  493. DLLEXPORT int getDiagPunktPos(int wNum, double hI) const;
  494. //! Returns the index of a point from a value
  495. //! \param wName The name of the value
  496. //! \param hI The X axis value of the point
  497. DLLEXPORT int getDiagPunktPos(char* wName, double hI) const;
  498. //! Checks whether specific styles are set in the DiagDaten
  499. //! \param style The styles
  500. DLLEXPORT inline bool hatDatenStyle(int style) const;
  501. //! Checks whether specific styles are not set in the DiagDaten
  502. //! \param style The styles
  503. DLLEXPORT inline bool hatDatenStyleNicht(int style) const;
  504. //! Checks whether specific styles are set for a specific value
  505. //! \param wNum The index of the value
  506. //! \param style The styles
  507. DLLEXPORT inline bool hatWertStyle(int wNum, int style) const;
  508. //! Checks whether specific styles are not set for a specific value
  509. //! \param wNum The index of the value \param style The styles
  510. DLLEXPORT inline bool hatWertStyleNicht(int wNum, int style) const;
  511. };
  512. //! A 2D GUI Framework drawing that displays diagram data as
  513. //! line graphs
  514. class LDiag : public DrawableBackground,
  515. public BaseDiag
  516. {
  517. public:
  518. class Style : public DrawableBackground::Style
  519. {
  520. public:
  521. //! Determines whether a border is drawn around the data
  522. static const __int64 DatenRahmen = 0x0001000;
  523. //! Determines whether the data has a background
  524. static const __int64 DatenHintergrund = 0x02000;
  525. //! Determines whether alpha blending is used when drawing
  526. //! the data background
  527. static const __int64 DatenHAlpha = 0x04000;
  528. //! Determines whether an image is used for the data background
  529. static const __int64 DatenHBild = 0x008000;
  530. //! Determines whether the data has a color gradient
  531. static const __int64 DatenBuffered = 0x010000;
  532. //! Combines flags VScroll and HScroll
  533. static const __int64 scroll = VScroll | HScroll;
  534. //! Combines flags Background, scroll, DataBorder
  535. static const __int64 normal = Hintergrund | scroll | DatenRahmen;
  536. };
  537. private:
  538. TextRenderer* textRd;
  539. Rahmen* dRam;
  540. int dBgF;
  541. Bild* dBgB;
  542. AlphaFeld* dAf;
  543. Bild* vIntervallRB;
  544. Bild* hIntervallRB;
  545. int schriftGr;
  546. //! Processes mouse messages
  547. //! \param me The event triggered by the mouse input
  548. DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override;
  549. public:
  550. //! Constructor
  551. DLLEXPORT LDiag();
  552. //! Destructor
  553. DLLEXPORT virtual ~LDiag();
  554. //! Sets the used TextRenderer
  555. //! \param textRd The text renderer
  556. DLLEXPORT void setTextRendererZ(TextRenderer* textRd);
  557. //! Sets the font
  558. //! \param schrift The font
  559. DLLEXPORT void setSchriftZ(Schrift* schrift);
  560. //! Sets the font size
  561. //! \param gr The height of a line in pixels
  562. DLLEXPORT void setSchriftSize(int gr);
  563. //! Sets the inner border around the actual diagram (border around the
  564. //! data) \param ram The border
  565. DLLEXPORT void setDatenRahmenZ(Rahmen* ram);
  566. //! Sets the inner border around the actual diagram (border around the
  567. //! data) by copying a border \param ram The border to copy
  568. DLLEXPORT void setDatenRahmen(Rahmen* ram);
  569. //! Sets the width of the inner border around the actual diagram
  570. //! (border around the data) \param br The width in pixels
  571. DLLEXPORT void setDatenRahmenBreite(int br);
  572. //! Sets the color of the inner border around the actual diagram
  573. //! (border around the data) \param fc The color in A8R8G8B8 format
  574. DLLEXPORT void setDatenRahmenFarbe(int fc);
  575. //! Sets the background of the actual diagram
  576. DLLEXPORT void setDatenHintergrundFarbe(int fc);
  577. DLLEXPORT void setDatenHintergrundBildZ(Bild* b);
  578. DLLEXPORT void setDatenHintergrundBild(Bild* b);
  579. //! Sets the color gradient of the actual diagram (color gradient of
  580. //! the data) \param af The color gradient
  581. DLLEXPORT void setDatenAlphaFeldZ(AlphaFeld* af);
  582. //! Sets the color gradient of the actual diagram (color gradient of
  583. //! the data) by copying a color gradient \param af The color
  584. //! gradient to copy
  585. DLLEXPORT void setDatenAlphaFeld(AlphaFeld* af);
  586. //! Sets the color of the color gradient of the actual diagram
  587. //! (color gradient of the data) \param fc The color in A8R8G8B8 format
  588. DLLEXPORT void setDatenAlphaFeldFarbe(int fc);
  589. //! Sets the strength of the color gradient of the actual diagram
  590. //! (color gradient of the data) \param st The strength
  591. DLLEXPORT void setDatenAlphaFeldStrength(int st);
  592. //! Draws the object to zRObj if it is visible
  593. //! \param zRObj The image to draw into
  594. DLLEXPORT void render(Bild& zRObj) override;
  595. //! Returns the font
  596. DLLEXPORT Schrift* getSchrift() const;
  597. //! Returns the font without increased reference counter
  598. DLLEXPORT Schrift* zSchrift() const;
  599. //! Returns the inner border around the actual diagram (border around
  600. //! the data)
  601. DLLEXPORT Rahmen* getDatenRahmen() const;
  602. //! Returns the inner border around the actual diagram without increased
  603. //! reference counter (border around the data)
  604. DLLEXPORT Rahmen* zDatenRahmen() const;
  605. //! Returns the color of the inner border around the actual diagram in
  606. //! A8R8G8B8 format (border around the data)
  607. DLLEXPORT int getDatenRahmenFarbe() const;
  608. //! Returns the width of the inner border around the actual diagram in
  609. //! pixels (border around the data)
  610. DLLEXPORT int getDatenRahmenBreite() const;
  611. //! Returns the background color of the actual diagram in
  612. //! A8R8G8B8 format (background of the data)
  613. DLLEXPORT int getDatenHintergrundFarbe() const;
  614. //! Returns the background image of the actual diagram
  615. //! (background image of the data)
  616. DLLEXPORT Bild* getDatenHintergrundBild() const;
  617. //! Returns the background image of the actual diagram without increased
  618. //! reference counter (background image of the data)
  619. DLLEXPORT Bild* zDatenHintergrundBild() const;
  620. //! Returns the color gradient of the actual diagram
  621. //! (color gradient of the data)
  622. DLLEXPORT AlphaFeld* getDatenAlphaFeld() const;
  623. //! Returns the color gradient of the actual diagram without increased
  624. //! reference counter (color gradient of the data)
  625. DLLEXPORT AlphaFeld* zDatenAlphaFeld() const;
  626. //! Returns the color of the color gradient of the actual diagram in
  627. //! A8R8G8B8 format (color gradient of the data)
  628. DLLEXPORT int getDatenAlphaFeldFarbe() const;
  629. //! Returns the strength of the color gradient of the actual diagram
  630. //! (color gradient of the data)
  631. DLLEXPORT int getDatenAlphaFeldStrength() const;
  632. };
  633. } // namespace Framework
  634. #endif