GlistEngine
Loading...
Searching...
No Matches
gGUIGraph Class Reference

#include <gGUIGraph.h>

Inheritance diagram for gGUIGraph:
Collaboration diagram for gGUIGraph:

Classes

class  PolylineMesh
struct  PolylineStroke

Public Member Functions

 gGUIGraph ()
virtual ~gGUIGraph () override
void set (gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h) override
virtual void setMaxX (float maxX)
int getMaxX ()
virtual void setMinX (float minX)
int getMinX ()
virtual void setMaxY (float maxY)
int getMaxY ()
virtual void setMinY (float minY)
int getMinY ()
void enableGridlinesX (bool isEnabled)
void enableGridlinesY (bool isEnabled)
void setAxislinesEnable (bool xaxis, bool yaxis)
void setTitleX (std::string titleX)
std::string getTitleX ()
void setTitleY (std::string titleY)
std::string getTitleY ()
virtual void setLabelCountX (int labelCount)
int getLabelCountX ()
virtual void setLabelCountY (int labelCount)
int getLabelCountY ()
virtual void enableRange (bool isRangeEnabled)
virtual void setRange (float rangeStart, float rangeEnd)
int getRangeStart ()
int getRangeEnd ()
void enableBackground (bool isEnabled)
bool isBackgroundEnabled ()
void draw () override
virtual void clear ()
Public Member Functions inherited from gGUIControl
 gGUIControl ()
virtual ~gGUIControl () override
int getCursor (int x, int y) override
void update () override
virtual int calculateContentHeight ()
virtual bool countAsSpace ()
void setCountAsSpace (bool isSpace)
void setFont (gFont *font)
gFont * getFont ()
Public Member Functions inherited from gBaseGUIObject
 gBaseGUIObject ()
virtual ~gBaseGUIObject ()
int getId ()
int getType ()
void setEnabled (bool isEnabled)
bool isEnabled ()
void setVisible (bool isVisible)
bool isVisible ()
void setTitleOn (bool isTitleOn)
bool isTitleOn ()
virtual void setTopParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getTopParent ()
virtual void setParent (gBaseGUIObject *parentGUIObject)
gBaseGUIObject * getParent ()
void setParentSlotNo (int parentSlotLineNo, int parentSlotColumnNo)
int getParentSlotLineNo ()
int getParentSlotColumnNo ()
void setTitle (std::string title)
std::string getTitle ()
virtual void keyPressed (int key)
virtual void keyReleased (int key)
virtual void charPressed (unsigned int codepoint)
virtual void mouseMoved (int x, int y)
virtual void mousePressed (int x, int y, int button)
virtual void mouseDragged (int x, int y, int button)
virtual void mouseReleased (int x, int y, int button)
virtual void mouseScrolled (int x, int y)
virtual void mouseEntered ()
virtual void mouseExited ()
virtual void windowResized (int w, int h)
virtual void onGUIEvent (int guiObjectId, int eventType, int sourceEventType, std::string value1="", std::string value2="")
void setRootApp (gBaseApp *root)
virtual void setCursorOn (bool isOn)
virtual void unfocus ()
Public Member Functions inherited from gRenderObject
 gRenderObject ()
int getScreenWidth ()
int getScreenHeight ()
void pushMatrix ()
void popMatrix ()
Public Member Functions inherited from gObject
 gObject ()
void logi (std::string message)
void logd (std::string message)
void logw (std::string message)
void loge (std::string message)
void logi (std::string tag, std::string message)
void logd (std::string tag, std::string message)
void logw (std::string tag, std::string message)
void loge (std::string tag, std::string message)

Protected Member Functions

void setLabelsYForRange (float rangeMinY, float rangeMaxY)
void drawPolylineStroke (PolylineStroke &stroke, const gColor &color)

Static Protected Member Functions

static bool buildPolylineRibbon (PolylineMesh &mesh, const std::vector< std::vector< std::array< float, 2 > > > &runs, float halfWidth, bool roundedCorners)
static void buildPolylineStroke (PolylineStroke &stroke, const std::vector< std::vector< std::array< float, 2 > > > &runs, float thickness, bool roundedCorners)

Protected Attributes

bool isbackgroundenabled
float axisx1
float axisy1
float axisx2
float axisy2
float axisxstart
float axisystart
float axisxw
float axisyh
float maxy
float miny
float maxx
float minx
float largestvaluex
float largestvaluey
float smallestvaluex
float smallestvaluey
bool gridlinesxenabled
bool gridlinesyenabled
bool isxaxislinenable
bool yaxislenable
bool floatlabelsxenabled
bool floatlabelsyenabled
int labelcountx
int labelcounty
int rangestart
int rangeend
bool rangeenabled
Protected Attributes inherited from gGUIControl
bool countasspace
int oldwidth
int oldheight
gFont * localfont
Protected Attributes inherited from gBaseGUIObject
std::string title
gBaseApp * root
gBaseGUIObject * topparent
gBaseGUIObject * parent
bool isenabled
bool isvisible
bool istitleon
int parentslotlineno
int parentslotcolumnno

Additional Inherited Members

Public Types inherited from gBaseGUIObject
enum  { TEXTALIGNMENT_LEFT , TEXTALIGNMENT_MIDDLE , TEXTALIGNMENT_RIGHT }
Static Public Member Functions inherited from gBaseGUIObject
static void setBackgroundColor (gColor *backgroundColor)
static gColor * getBackgroundColor ()
static void setMiddlegroundColor (gColor *middlegroundColor)
static gColor * getMiddlegroundColor ()
static void setForegroundColor (gColor *foregroundColor)
static gColor * getForegroundColor ()
static void setTextBackgroundColor (gColor *textBackgroundColor)
static gColor * getTextBackgroundColor ()
static void setNavigationBackgroundColor (gColor *navigationBackgroundColor)
static gColor * getNavigationBackgroundColor ()
static void setFont (gFont *font)
static gFont * getFont ()
static void setFontColor (gColor *fontColor)
static gColor * getFontColor ()
static void setNavigationFontColor (gColor *navigationFontColor)
static gColor * getNavigationFontColor ()
static void setButtonColor (gColor *color)
static gColor * getButtonColor ()
static void setPressedButtonColor (gColor *color)
static gColor * getPressedButtonColor ()
static void setDisabledButtonColor (gColor *color)
static gColor * getDisabledButtonColor ()
static void setButtonFontColor (gColor *color)
static gColor * getButtonFontColor ()
static void setPressedButtonFontColor (gColor *color)
static gColor * getPressedButtonFontColor ()
static void setDisabledButtonFontColor (gColor *color)
static gColor * getDisabledButtonFontColor ()
Static Public Member Functions inherited from gRenderObject
static void setScreenSize (int screenWidth, int screenHeight)
static void setUnitScreenSize (int unitWidth, int unitHeight)
static void setScreenScaling (int screenScaling)
static void enableShadowMapping ()
static void disableShadowMapping ()
static bool isShadowMappingEnabled ()
static void enableExtraShaders (bool isEnabled=true)
static void disableExtraShaders ()
static bool isExtraShadersEnabled ()
static gRenderer * getRenderer ()
static void destroyRenderer ()
static void createRenderer (int renderEngine=G_RENDERER_GL)
Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
static std::string gGetAssetsDir ()
static void gSetAssetsDir (std::string assetsDir)
static std::string gGetFilesDir ()
static std::string gGetImagesDir ()
static std::string gGetFontsDir ()
static std::string gGetModelsDir ()
static std::string gGetTexturesDir ()
static std::string gGetShadersDir ()
static std::string gGetSoundsDir ()
static std::string gGetDatabasesDir ()
static std::string gGetVideosDir ()
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
Public Attributes inherited from gBaseGUIObject
int id
int type
int left
int top
int right
int bottom
int width
int height
int titlex
int titley
int titleheight
bool isfocused
bool iscursoron
bool issizer
bool iscontainer
bool isresizable
Static Public Attributes inherited from gBaseGUIObject
static const int GUIEVENT_FOCUSED = -1
static const int GUIEVENT_UNFOCUSED = -2
static const int CURSOR_ARROW = 0
static const int CURSOR_IBEAM = 1
static const int CURSOR_CROSSHAIR = 2
static const int CURSOR_HAND = 3
static const int CURSOR_HRESIZE = 4
static const int CURSOR_VRESIZE = 5
static int focusid
static int previousfocusid
Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
static const int LOGLEVEL_DEBUG
static const int LOGLEVEL_INFO
static const int LOGLEVEL_WARNING
static const int LOGLEVEL_ERROR
Static Protected Attributes inherited from gBaseGUIObject
static gColor * backgroundcolor
static gColor * middlegroundcolor
static gColor * foregroundcolor
static gColor * textbackgroundcolor
static gColor * navigationbackgroundcolor
static gFont * font
static gColor * fontcolor
static gColor * navigationfontcolor
static gColor * buttoncolor
static gColor * pressedbuttoncolor
static gColor * disabledbuttoncolor
static gColor * buttonfontcolor
static gColor * pressedbuttonfontcolor
static gColor * disabledbuttonfontcolor
static gGUIActionManager actionmanager
static gGUIResources res
Static Protected Attributes inherited from gRenderObject
static bool isshadowmappingenabled
static bool isextrashadersenabled
Static Protected Attributes inherited from gObject
static int renderpassnum
static int renderpassno
static int releasescaling
static int releaseresolution

Detailed Description

This is a base class for all Graph classes. Developers can use the child classes of this class for their graph needs.

Constructor & Destructor Documentation

◆ gGUIGraph()

gGUIGraph::gGUIGraph ( )

◆ ~gGUIGraph()

virtual gGUIGraph::~gGUIGraph ( )
overridevirtual

Member Function Documentation

◆ buildPolylineRibbon()

bool gGUIGraph::buildPolylineRibbon ( PolylineMesh & mesh,
const std::vector< std::vector< std::array< float, 2 > > > & runs,
float halfWidth,
bool roundedCorners )
staticprotected

◆ buildPolylineStroke()

void gGUIGraph::buildPolylineStroke ( PolylineStroke & stroke,
const std::vector< std::vector< std::array< float, 2 > > > & runs,
float thickness,
bool roundedCorners )
staticprotected

◆ clear()

virtual void gGUIGraph::clear ( )
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ draw()

void gGUIGraph::draw ( )
overridevirtual

Reimplemented from gGUIControl.

◆ drawPolylineStroke()

void gGUIGraph::drawPolylineStroke ( PolylineStroke & stroke,
const gColor & color )
protected

◆ enableBackground()

void gGUIGraph::enableBackground ( bool isEnabled)

◆ enableGridlinesX()

void gGUIGraph::enableGridlinesX ( bool isEnabled)

◆ enableGridlinesY()

void gGUIGraph::enableGridlinesY ( bool isEnabled)

◆ enableRange()

virtual void gGUIGraph::enableRange ( bool isRangeEnabled)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ getLabelCountX()

int gGUIGraph::getLabelCountX ( )

◆ getLabelCountY()

int gGUIGraph::getLabelCountY ( )

◆ getMaxX()

int gGUIGraph::getMaxX ( )

◆ getMaxY()

int gGUIGraph::getMaxY ( )

◆ getMinX()

int gGUIGraph::getMinX ( )

◆ getMinY()

int gGUIGraph::getMinY ( )

◆ getRangeEnd()

int gGUIGraph::getRangeEnd ( )

◆ getRangeStart()

int gGUIGraph::getRangeStart ( )

◆ getTitleX()

std::string gGUIGraph::getTitleX ( )

◆ getTitleY()

std::string gGUIGraph::getTitleY ( )

◆ isBackgroundEnabled()

bool gGUIGraph::isBackgroundEnabled ( )

◆ set()

void gGUIGraph::set ( gBaseApp * root,
gBaseGUIObject * topParentGUIObject,
gBaseGUIObject * parentGUIObject,
int parentSlotLineNo,
int parentSlotColumnNo,
int x,
int y,
int w,
int h )
overridevirtual

Reimplemented from gGUIControl.

Reimplemented in gGUILineGraph.

◆ setAxislinesEnable()

void gGUIGraph::setAxislinesEnable ( bool xaxis,
bool yaxis )

◆ setLabelCountX()

virtual void gGUIGraph::setLabelCountX ( int labelCount)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setLabelCountY()

virtual void gGUIGraph::setLabelCountY ( int labelCount)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setLabelsYForRange()

void gGUIGraph::setLabelsYForRange ( float rangeMinY,
float rangeMaxY )
protected

Sets the Y axis range directly and regenerates the Y axis labels to match it exactly, instead of updateLabelsY()'s usual snap-to-a-nice-step recalculation. Lets a subclass that computes its own miny/maxy (e.g. an autoscaled line graph) keep the drawn labels in sync.

◆ setMaxX()

virtual void gGUIGraph::setMaxX ( float maxX)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setMaxY()

virtual void gGUIGraph::setMaxY ( float maxY)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setMinX()

virtual void gGUIGraph::setMinX ( float minX)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setMinY()

virtual void gGUIGraph::setMinY ( float minY)
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setRange()

virtual void gGUIGraph::setRange ( float rangeStart,
float rangeEnd )
virtual

Reimplemented in gGUICandleStickChart, and gGUILineGraph.

◆ setTitleX()

void gGUIGraph::setTitleX ( std::string titleX)

◆ setTitleY()

void gGUIGraph::setTitleY ( std::string titleY)

Member Data Documentation

◆ axisx1

float gGUIGraph::axisx1
protected

◆ axisx2

float gGUIGraph::axisx2
protected

◆ axisxstart

float gGUIGraph::axisxstart
protected

◆ axisxw

float gGUIGraph::axisxw
protected

◆ axisy1

float gGUIGraph::axisy1
protected

◆ axisy2

float gGUIGraph::axisy2
protected

◆ axisyh

float gGUIGraph::axisyh
protected

◆ axisystart

float gGUIGraph::axisystart
protected

◆ floatlabelsxenabled

bool gGUIGraph::floatlabelsxenabled
protected

◆ floatlabelsyenabled

bool gGUIGraph::floatlabelsyenabled
protected

◆ gridlinesxenabled

bool gGUIGraph::gridlinesxenabled
protected

◆ gridlinesyenabled

bool gGUIGraph::gridlinesyenabled
protected

◆ isbackgroundenabled

bool gGUIGraph::isbackgroundenabled
protected

◆ isxaxislinenable

bool gGUIGraph::isxaxislinenable
protected

◆ labelcountx

int gGUIGraph::labelcountx
protected

◆ labelcounty

int gGUIGraph::labelcounty
protected

◆ largestvaluex

float gGUIGraph::largestvaluex
protected

◆ largestvaluey

float gGUIGraph::largestvaluey
protected

◆ maxx

float gGUIGraph::maxx
protected

◆ maxy

float gGUIGraph::maxy
protected

◆ minx

float gGUIGraph::minx
protected

◆ miny

float gGUIGraph::miny
protected

◆ rangeenabled

bool gGUIGraph::rangeenabled
protected

◆ rangeend

int gGUIGraph::rangeend
protected

◆ rangestart

int gGUIGraph::rangestart
protected

◆ smallestvaluex

float gGUIGraph::smallestvaluex
protected

◆ smallestvaluey

float gGUIGraph::smallestvaluey
protected

◆ yaxislenable

bool gGUIGraph::yaxislenable
protected

The documentation for this class was generated from the following file: