GlistEngine
Loading...
Searching...
No Matches
gGUISurface.h
Go to the documentation of this file.
1/*
2 * gGUISurface.h
3 *
4 * Created on: 27 Jul 2022
5 * Author: Ezgi Lena Sonmez
6 */
7
8#ifndef UI_GGUISURFACE_H_
9#define UI_GGUISURFACE_H_
10
11#include "gGUIScrollable.h"
12#include "gRenderer.h"
13#include "gImage.h"
14#include "gGUISizer.h"
15#include <deque>
16
17
19public:
20 enum {
23 };
25 virtual ~gGUISurface();
26 void set(gBaseApp* root, gBaseGUIObject* topParentGUIObject, gBaseGUIObject* parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h);
28
29 void setBorder(float thickness, float borderposition);
30 int addRectangle(float x, float y, float w, float h, bool isFilled, gColor color = gColor(0.0f, 0.0f, 0.0f));
31 //void addRectangle(float x, float y, float w, float h, bool isFilled, float thickness, float borderposition, gColor color = gColor(0.0f, 0.0f, 0.0f));
32 int addLine(float x, float y, float x2, float y2, gColor color = gColor(0.0f, 0.0f, 0.0f));
33 //void drawLine(float x1, float y1, float z1, float x2, float y2, float z2);
34 int addCircle(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides = 64.0f, gColor color = gColor(0.0f, 0.0f, 0.0f));
35 int addArrow(float x1, float y1, float length, float angle, float tipLength, float tipAngle, gColor color = gColor(0.0f, 0.0f, 0.0f));
36 int addTriangle(float px, float py, float qx, float qy, float rx, float ry, bool isFilled, gColor color = gColor(0.0f, 0.0f, 0.0f));
37 int addImage(float x, float y, float w, float h, gImage* image);
38 int addText(std::string text, float x, float y, int fontFace, int fontType, gColor color = gColor(0.0f, 0.0f, 0.0f));
39 int addSizer(float x, float y, float w, float h, gGUISizer* newSizer);
40
41 std::vector<float> getShape(int shapeNo);
42 void setText(int shapeNo, std::string text, float x, float y, int fontFace, int fontType, gColor color = gColor(0.0f, 0.0f, 0.0f));
43 void setImage(int shapeNo, float x, float y, float w, float h, gImage* image);
44
45 void clear();
46
47 //void drawImage(float x, float y, float w, float h, std::string fullPath);
48 // void drawBox(float x, float y, float z, float w = 1.0f, float h = 1.0f, float d = 1.0f, bool isFilled = true);
49// void drawBox(glm::mat4 transformationMatrix, bool isFilled = true);
50// void drawSphere(float xPos, float yPos, float zPos, int xSegmentNum = 64, int ySegmentNum = 64, float scale = 1.0f, bool isFilled = true);
51
52private:
53 void drawBackground();
54 void resetColorAndBorder();
55 void drawShapes();
56
57 void mousePressed(int x, int y, int button);
58 void mouseReleased(int x, int y, int button);
59
60 std::vector<std::vector<float>> shapes;
61 std::deque<gImage*> images;
62 std::deque<std::string> texts;
63 std::deque<gGUISizer*> sizers;
64
65 int imageNum, textnum, sizernum;
66 int maxHeight;
67 //color
68 float r, g, b, a;
69 //frame of rectangle
70 float thickness, borderposition;
71 //boolean isFilled: initialize this as false
72 bool isFilled, mousepressedonlist;
73
74};
75
76#endif /* UI_GGUISURFACE_H_ */
Definition gBaseApp.h:16
Definition gBaseGUIObject.h:18
gBaseApp * root
Definition gBaseGUIObject.h:147
Definition gColor.h:17
Definition gGUIScrollable.h:68
Definition gGUISizer.h:14
Definition gGUISurface.h:18
int addImage(float x, float y, float w, float h, gImage *image)
int addSizer(float x, float y, float w, float h, gGUISizer *newSizer)
void setText(int shapeNo, std::string text, float x, float y, int fontFace, int fontType, gColor color=gColor(0.0f, 0.0f, 0.0f))
int addTriangle(float px, float py, float qx, float qy, float rx, float ry, bool isFilled, gColor color=gColor(0.0f, 0.0f, 0.0f))
virtual ~gGUISurface()
int addRectangle(float x, float y, float w, float h, bool isFilled, gColor color=gColor(0.0f, 0.0f, 0.0f))
int addText(std::string text, float x, float y, int fontFace, int fontType, gColor color=gColor(0.0f, 0.0f, 0.0f))
int addLine(float x, float y, float x2, float y2, gColor color=gColor(0.0f, 0.0f, 0.0f))
void clear()
void set(gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
std::vector< float > getShape(int shapeNo)
int addCircle(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides=64.0f, gColor color=gColor(0.0f, 0.0f, 0.0f))
void setImage(int shapeNo, float x, float y, float w, float h, gImage *image)
void setBorder(float thickness, float borderposition)
int addArrow(float x1, float y1, float length, float angle, float tipLength, float tipAngle, gColor color=gColor(0.0f, 0.0f, 0.0f))
void drawContent()
@ SHAPE_RECTANGLE
Definition gGUISurface.h:21
@ SHAPE_TEXT
Definition gGUISurface.h:22
@ SHAPE_LINE
Definition gGUISurface.h:21
@ SHAPE_CIRCLE
Definition gGUISurface.h:21
@ SHAPE_ARROW
Definition gGUISurface.h:21
@ SHAPE_IMAGE
Definition gGUISurface.h:22
@ SHAPE_TRIANGLE
Definition gGUISurface.h:21
@ SHAPE_GUISIZER
Definition gGUISurface.h:22
Definition gImage.h:34