Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
area-link-renderer.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#ifndef __ANTARES_WINDOWS_OUTPUT_PANEL_AREA_LINK_RENDERER_H__
22#define __ANTARES_WINDOWS_OUTPUT_PANEL_AREA_LINK_RENDERER_H__
23
24#include "../../../toolbox/components/datagrid/renderer.h"
25#include <yuni/core/string.h>
26#include <antares/array/matrix.h>
27#include "../output.h"
28
29namespace Antares
30{
31namespace Private
32{
33namespace OutputViewerData
34{
36{
37public:
45 using CellType = Yuni::CString<64, false>;
46
47public:
49
50
54
56 virtual ~AreaLinkRenderer();
58
59 virtual int width() const;
60
61 virtual int height() const;
62
63 virtual wxString columnCaption(int colIndx) const;
64
65 virtual wxString rowCaption(int rowIndx) const;
66
67 virtual wxString cellValue(int, int) const;
68
69 virtual double cellNumericValue(int, int) const;
70
71 virtual bool cellValue(int x, int y, const Yuni::String& value);
72
73 virtual void resetColors(int, int, wxColour&, wxColour&) const
74 { /*Do nothing*/
75 }
76
77 virtual Date::Precision precision()
78 {
79 return Date::hourly;
80 }
81
82 virtual IRenderer::CellStyle cellStyle(int, int) const;
83 virtual wxColour cellBackgroundColor(int, int) const;
84 virtual wxColour cellTextColor(int, int) const;
85 virtual wxColour verticalBorderColor(int x, int y) const;
86 virtual int cellAlignment(int, int) const;
87
88 virtual bool valid() const;
89
90 virtual void onScroll();
91 virtual void onSelectCell(unsigned x, unsigned y);
92 virtual void onExternalSelectCell(unsigned x, unsigned y);
93
95
96 void grid(DatagridType* grid)
97 {
98 pGrid = grid;
99 }
101
102protected:
106 DatagridType* pGrid;
107
113 uint pWidth;
117 std::vector<wxString> pColNames;
118 std::vector<bool> pColToUseForRowCaption;
119
122 uint pSelectionCellY;
123
124}; // class AreaLinkRenderer
125
126} // namespace OutputViewerData
127} // namespace Private
128} // namespace Antares
129
130#endif // __ANTARES_WINDOWS_OUTPUT_PANEL_AREA_LINK_RENDERER_H__
A datagrid with virtual values.
Definition component.h:84
Data provider for Datagrids.
Definition renderer.h:53
A n-by-n matrix.
Definition jit.h:30
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition area-link-renderer.cpp:187
virtual wxString columnCaption(int colIndx) const
Get the caption of a column.
Definition area-link-renderer.cpp:180
virtual double cellNumericValue(int, int) const
Get the floating value of a Cell.
Definition area-link-renderer.cpp:283
AreaLinkRenderer(OutputViewerComponent *component, const Antares::Matrix< CellType > *matrix)
Constructor.
Definition area-link-renderer.cpp:36
OutputViewerComponent * pComponent
Reference to the parent control.
Definition area-link-renderer.h:104
uint pSelectionCellX
Current selection.
Definition area-link-renderer.h:121
const MatrixType * pMatrix
The matrix.
Definition area-link-renderer.h:111
virtual ~AreaLinkRenderer()
Destructor.
Definition area-link-renderer.cpp:159
virtual wxColour verticalBorderColor(int x, int y) const
Get the color of the vertical right border.
Definition area-link-renderer.cpp:254
virtual int cellAlignment(int, int) const
Get the alignment of a cell (-1: left, 0: center, +1: right)
Definition area-link-renderer.cpp:278
uint pWidth
The pseudo Width.
Definition area-link-renderer.h:113
virtual void onScroll()
A scroll event has been triggered.
Definition area-link-renderer.cpp:308
virtual wxString cellValue(int, int) const
Get the string representation of a Cell.
Definition area-link-renderer.cpp:261
Antares::Component::Datagrid::Component DatagridType
Grid.
Definition area-link-renderer.h:43
virtual Date::Precision precision()
Time Precision.
Definition area-link-renderer.h:77
virtual bool cellValue(int x, int y, const Yuni::String &value)
Try to modify a cell value.
virtual int width() const
The effective width of the grid.
Definition area-link-renderer.cpp:165
uint pHeight
The pseudo height.
Definition area-link-renderer.h:115
virtual int height() const
The effective height of the grid.
Definition area-link-renderer.cpp:170
Component: Viewer for simulation results.
Definition output.h:49