Changeset View
Changeset View
Standalone View
Standalone View
source/gui/CChart.h
Show All 14 Lines | |||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_CCHART | #ifndef INCLUDED_CCHART | ||||
#define INCLUDED_CCHART | #define INCLUDED_CCHART | ||||
#include "graphics/ShaderProgramPtr.h" | #include "graphics/ShaderProgramPtr.h" | ||||
#include "gui/CGUIColor.h" | #include "gui/CGUIColor.h" | ||||
#include "gui/CGUIList.h" | |||||
#include "gui/CGUISeries.h" | |||||
#include "gui/IGUITextOwner.h" | #include "gui/IGUITextOwner.h" | ||||
#include "maths/Vector2D.h" | #include "maths/Vector2D.h" | ||||
#include <vector> | #include <vector> | ||||
struct CChartData | struct CChartData | ||||
{ | { | ||||
// Avoid copying the container. | // Avoid copying the container. | ||||
Show All 32 Lines | protected: | ||||
void UpdateSeries(); | void UpdateSeries(); | ||||
void SetupText(); | void SetupText(); | ||||
std::vector<CChartData> m_Series; | std::vector<CChartData> m_Series; | ||||
CVector2D m_LeftBottom, m_RightTop; | CVector2D m_LeftBottom, m_RightTop; | ||||
CStrW m_FormatX, m_FormatY; | |||||
std::vector<CPos> m_TextPositions; | std::vector<CPos> m_TextPositions; | ||||
float m_AxisWidth; | |||||
bool m_EqualX, m_EqualY; | bool m_EqualX, m_EqualY; | ||||
// Cache setting references for performance | |||||
CGUIColor m_AxisColor; | |||||
float m_AxisWidth; | |||||
float m_BufferZone; | |||||
CStrW m_Font; | |||||
CStrW m_FormatX; | |||||
CStrW m_FormatY; | |||||
CGUIList m_SeriesColor; | |||||
CGUISeries m_SeriesSetting; | |||||
EAlign m_TextAlign; | |||||
private: | private: | ||||
/** | /** | ||||
* Helper functions | * Helper functions | ||||
*/ | */ | ||||
void DrawLine(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const; | void DrawLine(const CShaderProgramPtr& shader, const CGUIColor& color, const std::vector<float>& vertices) const; | ||||
// Draws the triangle sequence so that the each next triangle has a common edge with the previous one. | // Draws the triangle sequence so that the each next triangle has a common edge with the previous one. | ||||
// If we need to draw n triangles, we need only n + 2 points. | // If we need to draw n triangles, we need only n + 2 points. | ||||
Show All 11 Lines |
Wildfire Games · Phabricator