Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
gridhelper.hxx
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_TOOLBOX_COMPONENTS_DATAGRID__GRID_HELPER_HXX__
22#define __ANTARES_TOOLBOX_COMPONENTS_DATAGRID__GRID_HELPER_HXX__
23
24namespace Antares
25{
26namespace Component
27{
28namespace Datagrid
29{
31{
32 return virtualSize.y;
33}
34
36{
37 return virtualSize.x;
38}
39
40inline double VGridHelper::GetValueAsDouble(int row, int col)
41{
42 return GetNumericValue(row, col);
43}
44
45inline bool VGridHelper::GetValueAsBool(int row, int col)
46{
47 return !Yuni::Math::Zero(GetValueAsDouble(row, col));
48}
49
50inline bool VGridHelper::IsEmptyCell(int, int)
51{
52 return false;
53}
54
55inline int VGridHelper::realCol(uint col) const
56{
57 assert(col < (uint)indicesCols.size());
58 return indicesCols[col];
59}
60
61inline int VGridHelper::realRow(uint row) const
62{
63 assert(row < (uint)indicesRows.size());
64 return indicesRows[row];
65}
66
67inline bool VGridHelper::CanValueAs(int, int, const wxString&)
68{
69 return true;
70}
71
73{
74 return pRenderer;
75}
76
77} // namespace Datagrid
78} // namespace Component
79} // namespace Antares
80
81#endif // __ANTARES_TOOLBOX_COMPONENTS_DATAGRID__GRID_HELPER_HXX__
Data provider for Datagrids.
Definition renderer.h:53
virtual int GetNumberCols() override
Get the number of columns that the wxGrid should display.
Definition gridhelper.hxx:35
int realRow(uint row) const
Get the real index used by the renderer of a given row index used by the wxGrid.
Definition gridhelper.hxx:61
bool IsEmptyCell(int, int) override
Get if a cell is empty or not (unused)
Definition gridhelper.hxx:50
Renderer::IRenderer * renderer() const
The renderer.
Definition gridhelper.hxx:72
int realCol(uint col) const
Get the real index used by the renderer of a given column index used by the wxGrid.
Definition gridhelper.hxx:55
virtual double GetNumericValue(int row, int col) const
Get the float value of the cell at a given position.
Definition gridhelper.cpp:536
virtual int GetNumberRows() override
Get the number of rows that the wxGrid should display.
Definition gridhelper.hxx:30