Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
layers.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_TOOLBOX_COMPONENT_DATAGRID_RENDERER_LAYERS_H__
22#define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_LAYERS_H__
23
24#include "../renderer.h"
25#include "../../../../application/study.h"
26#include "../../../../toolbox/input/area.h"
27#include <antares/study/scenario-builder/rules.h>
28
29namespace Antares
30{
31namespace Component
32{
33namespace Datagrid
34{
35namespace Renderer
36{
37/*Per area layers ui grid renderer*/
38class LayersUI : public IRenderer
39{
40public:
46 virtual ~LayersUI();
48
49 virtual int width() const;
50 virtual int height() const;
51
52 virtual wxString columnCaption(int colIndx) const;
53
54 virtual wxString rowCaption(int rowIndx) const;
55
56 virtual wxString cellValue(int x, int y) const;
57
58 virtual double cellNumericValue(int x, int y) const;
59
60 virtual bool cellValue(int x, int y, const Yuni::String& value);
61
62 virtual void resetColors(int, int, wxColour&, wxColour&) const
63 {
64 // Do nothing
65 }
66
67 virtual bool valid() const;
68
69 virtual uint maxWidthResize() const
70 {
71 return 0;
72 }
73 virtual IRenderer::CellStyle cellStyle(int col, int row) const;
74
75 void control(Antares::Component::Datagrid::Component* control)
76 {
77 pControl = control;
78 }
79
80protected:
81 void onAreaChanged(Data::Area* area);
82 virtual void onStudyClosed();
83
84protected:
86 Data::Area* pArea;
87
88}; // class LayersUI
89
90/*General layer visibility grid renderer*/
92{
93public:
99 virtual ~LayersVisibility();
101
102 virtual int width() const;
103 virtual int height() const;
104
105 virtual wxString columnCaption(int colIndx) const;
106
107 virtual wxString rowCaption(int rowIndx) const;
108
109 virtual wxString cellValue(int x, int y) const;
110
111 virtual double cellNumericValue(int x, int y) const;
112
113 virtual bool cellValue(int x, int y, const Yuni::String& value);
114
115 virtual void resetColors(int, int, wxColour&, wxColour&) const
116 {
117 // Do nothing
118 }
119
120 virtual bool valid() const;
121
122 virtual uint maxWidthResize() const
123 {
124 return 0;
125 }
126 virtual IRenderer::CellStyle cellStyle(int col, int row) const;
127
128 void control(Antares::Component::Datagrid::Component* control)
129 {
130 pControl = control;
131 }
132
133protected:
134 virtual void onStudyClosed();
135
136protected:
138
139}; // class Layers
140
141} // namespace Renderer
142} // namespace Datagrid
143} // namespace Component
144} // namespace Antares
145
146#endif // __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_LAYERS_H__
A datagrid with virtual values.
Definition component.h:84
Data provider for Datagrids.
Definition renderer.h:53
virtual int height() const
The effective height of the grid.
Definition layers.cpp:61
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition layers.cpp:91
virtual uint maxWidthResize() const
The most suitable column count.
Definition layers.h:69
virtual wxString columnCaption(int colIndx) const
Get the caption of a column.
Definition layers.cpp:77
virtual int width() const
The effective width of the grid.
Definition layers.cpp:52
virtual double cellNumericValue(int x, int y) const
Get the floating value of a Cell.
Definition layers.cpp:178
virtual wxString cellValue(int x, int y) const
Get the string representation of a Cell.
Definition layers.cpp:205
virtual ~LayersUI()
Destructor.
Definition layers.cpp:42
virtual void onStudyClosed()
Event: the study has been closed.
Definition layers.cpp:243
LayersUI(Toolbox::InputSelector::Area *notifier)
Constructor for Layers from area selection notifier.
Definition layers.cpp:33
virtual uint maxWidthResize() const
The most suitable column count.
Definition layers.h:122
virtual int width() const
The effective width of the grid.
Definition layers.cpp:264
virtual wxString columnCaption(int colIndx) const
Get the caption of a column.
Definition layers.cpp:278
virtual ~LayersVisibility()
Destructor.
Definition layers.cpp:254
virtual double cellNumericValue(int x, int y) const
Get the floating value of a Cell.
Definition layers.cpp:340
virtual void onStudyClosed()
Event: the study has been closed.
Definition layers.cpp:381
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition layers.cpp:292
virtual wxString cellValue(int x, int y) const
Get the string representation of a Cell.
Definition layers.cpp:357
virtual int height() const
The effective height of the grid.
Definition layers.cpp:273
LayersVisibility()
Constructor for Layers from area selection notifier.
Definition layers.cpp:250
Definition for a single area.
Definition area.h:52
Visual Component for displaying all available areas (and groups)
Definition area.h:41