Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CRectangleGraphics.hpp
Go to the documentation of this file.
1#ifndef LIBS_SHAPES_CRECTANGLEGRAPHICS_HPP_
2#define LIBS_SHAPES_CRECTANGLEGRAPHICS_HPP_
3
4#include "core/defines.hpp"
6
7#include <string>
8
10{
11public:
13 {
14 Rounded,
16 };
17
18 static CRectangleGraphics *createRectangle(double x, double y, double sizeX, double sizeY, double padding,
19 double zDepth);
20 static CRectangleGraphics *createRectangleGradient(double x, double y, double sizeX, double sizeY, double padding,
21 double zDepth, iv::types::color gradientColor);
22 static CRectangleGraphics *createRectangleOrgUpper(double x, double y, double sizeX, double sizeY, double padding,
23 double zDepth);
24 static CRectangleGraphics *createRectangleWithInvertedTexture(double x, double y, double sizeX, double sizeY,
25 double padding, double zDepth);
26 static CRectangleGraphics *createRectangleWithInvertedTextureOrgUpper(double x, double y, double sizeX,
27 double sizeY, double padding, double zDepth);
28 static CRectangleGraphics *createRectangleWithTexture(double x, double y, double sizeX, double sizeY,
29 double padding, double zDepth);
30 static CRectangleGraphics *createRectangleWithTextureOrgUpper(double x, double y, double sizeX, double sizeY,
31 double padding, double zDepth);
32
33 static CRectangleGraphics *createRectangleCornerRound(double x, double y, double sizeX, double sizeY,
34 double padding, double radiusRound, double zDepth);
35 static CRectangleGraphics *createRectangleCornerRoundWithGradient(double x, double y, double sizeX, double sizeY,
36 double padding, double radiusRound, double zDepth,
37 iv::types::color gradientColor);
38 static CRectangleGraphics *createRectangleCornerRoundOrgUpper(double x, double y, double sizeX, double sizeY,
39 double padding, double radiusRound, double zDepth);
40 static CRectangleGraphics *createRectangleCornerRoundWithTexture(double x, double y, double sizeX, double sizeY,
41 double padding, double radiusRound, double zDepth);
42 static CRectangleGraphics *createRectangleCornerRoundWithTextureOrgUpper(double x, double y, double sizeX,
43 double sizeY, double padding,
44 double radiusRound, double zDepth);
45
46 CRectangleGraphics(const CRectangleGraphics &rectangle);
47 explicit CRectangleGraphics(const CRectangleGraphics *rectangle);
49
50 bool operator==(const CRectangleGraphics &b) const;
51 bool operator!=(const CRectangleGraphics &b) const;
52
53 void draw(IGraphics *graphics) const;
54 void drawImage(IGraphics *graphics, const iv::ui::resources::ImageResource &resource) const;
55 void drawImageWithColor(IGraphics *graphics, iv::types::color colorRGB,
56 const iv::ui::resources::ImageResource &resource) const;
57 void drawEdges(IGraphics *graphics) const;
58 void removeObjectDraw(IGraphics *graphics);
59
60 void getPos(double *xPos, double *yPos) const;
61 void getSize(double *sizeX, double *sizeY) const;
62
63 void setFrame(double thickness, iv::types::color colorFrame);
64 void setFrameGradient(double thickness, iv::types::color colorExterior, iv::types::color colorInterior);
65 void setClip(IGraphics *graphics);
66 void translate(double x, double y);
67
68 [[nodiscard]] bool isSameSize(double sizeX, double sizeY) const;
69 [[nodiscard]] bool isPointInRectangle(double x, double y) const;
70
71private:
72 CRectangleGraphics(double x, double y, double sizeX, double sizeY, double padding, double zDepth, bool hasTexture,
73 bool textureInverted, bool hasGradient, iv::types::color gradientColor);
74 CRectangleGraphics(double x, double y, double sizeX, double sizeY, bool withTexture, double padding,
75 double radiusRound, double zDepth, bool hasGradient, iv::types::color gradientColor);
76
78 double m_x;
79 double m_y;
80 double m_z;
81
82 double m_round;
83 double m_sizeX;
84 double m_sizeY;
87
89 CSurface *m_surfaceFrameOpt;//TODO: renombrar a surfaceFrameIlluminateOpt
91};
92
93#endif /* LIBS_SHAPES_CRECTANGLEGRAPHICS_HPP_ */
Definition CRectangleGraphics.hpp:10
static CRectangleGraphics * createRectangleCornerRound(double x, double y, double sizeX, double sizeY, double padding, double radiusRound, double zDepth)
Definition CRectangleGraphics.cpp:413
static CRectangleGraphics * createRectangle(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:328
void getSize(double *sizeX, double *sizeY) const
Definition CRectangleGraphics.cpp:646
static CRectangleGraphics * createRectangleCornerRoundWithGradient(double x, double y, double sizeX, double sizeY, double padding, double radiusRound, double zDepth, iv::types::color gradientColor)
Definition CRectangleGraphics.cpp:424
double m_sizeX
Definition CRectangleGraphics.hpp:83
void setFrame(double thickness, iv::types::color colorFrame)
Definition CRectangleGraphics.cpp:821
static CRectangleGraphics * createRectangleGradient(double x, double y, double sizeX, double sizeY, double padding, double zDepth, iv::types::color gradientColor)
Definition CRectangleGraphics.cpp:340
void drawImage(IGraphics *graphics, const iv::ui::resources::ImageResource &resource) const
Definition CRectangleGraphics.cpp:606
bool operator==(const CRectangleGraphics &b) const
Definition CRectangleGraphics.cpp:575
double m_sizeXPadding
Definition CRectangleGraphics.hpp:85
void getPos(double *xPos, double *yPos) const
Definition CRectangleGraphics.cpp:637
static CRectangleGraphics * createRectangleOrgUpper(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:352
CSurface * m_surface
Definition CRectangleGraphics.hpp:88
double m_x
Definition CRectangleGraphics.hpp:78
EPrvRectangleEdgeType m_rectangleEdgeType
Definition CRectangleGraphics.hpp:77
CRectangleGraphics(const CRectangleGraphics &rectangle)
Definition CRectangleGraphics.cpp:472
static CRectangleGraphics * createRectangleCornerRoundWithTexture(double x, double y, double sizeX, double sizeY, double padding, double radiusRound, double zDepth)
Definition CRectangleGraphics.cpp:448
double m_round
Definition CRectangleGraphics.hpp:82
EPrvRectangleEdgeType
Definition CRectangleGraphics.hpp:13
double m_sizeYPadding
Definition CRectangleGraphics.hpp:86
void drawImageWithColor(IGraphics *graphics, iv::types::color colorRGB, const iv::ui::resources::ImageResource &resource) const
Definition CRectangleGraphics.cpp:611
~CRectangleGraphics()
Definition CRectangleGraphics.cpp:554
double m_z
Definition CRectangleGraphics.hpp:80
static CRectangleGraphics * createRectangleCornerRoundWithTextureOrgUpper(double x, double y, double sizeX, double sizeY, double padding, double radiusRound, double zDepth)
Definition CRectangleGraphics.cpp:460
CSurface * m_surfaceFrameOpt
Definition CRectangleGraphics.hpp:89
void setFrameGradient(double thickness, iv::types::color colorExterior, iv::types::color colorInterior)
Definition CRectangleGraphics.cpp:882
void draw(IGraphics *graphics) const
Definition CRectangleGraphics.cpp:591
void removeObjectDraw(IGraphics *graphics)
Definition CRectangleGraphics.cpp:622
CSurface * m_surfaceFrameDarkenOpt
Definition CRectangleGraphics.hpp:90
bool isPointInRectangle(double x, double y) const
Definition CRectangleGraphics.cpp:914
double m_sizeY
Definition CRectangleGraphics.hpp:84
void drawEdges(IGraphics *graphics) const
Definition CRectangleGraphics.cpp:617
void setClip(IGraphics *graphics)
Definition CRectangleGraphics.cpp:896
bool isSameSize(double sizeX, double sizeY) const
Definition CRectangleGraphics.cpp:909
static CRectangleGraphics * createRectangleWithInvertedTexture(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:364
void translate(double x, double y)
Definition CRectangleGraphics.cpp:903
bool operator!=(const CRectangleGraphics &b) const
Definition CRectangleGraphics.cpp:583
double m_y
Definition CRectangleGraphics.hpp:79
static CRectangleGraphics * createRectangleWithTexture(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:389
static CRectangleGraphics * createRectangleWithInvertedTextureOrgUpper(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:376
static CRectangleGraphics * createRectangleWithTextureOrgUpper(double x, double y, double sizeX, double sizeY, double padding, double zDepth)
Definition CRectangleGraphics.cpp:401
static CRectangleGraphics * createRectangleCornerRoundOrgUpper(double x, double y, double sizeX, double sizeY, double padding, double radiusRound, double zDepth)
Definition CRectangleGraphics.cpp:436
Definition CSurface.hpp:10
Definition IGraphics.hpp:20
Definition ImageResource.hpp:15
uint32_t color
Definition types.hpp:12