Antares Simulator
Power System Simulator
layers.h
1 /*
2  * Copyright 2007-2025, 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 
29 namespace Antares::Component::Datagrid::Renderer
30 {
31 /*Per area layers ui grid renderer*/
32 class LayersUI: public IRenderer
33 {
34 public:
40  virtual ~LayersUI();
42 
43  virtual int width() const;
44  virtual int height() const;
45 
46  virtual wxString columnCaption(int colIndx) const;
47 
48  virtual wxString rowCaption(int rowIndx) const;
49 
50  virtual wxString cellValue(int x, int y) const;
51 
52  virtual double cellNumericValue(int x, int y) const;
53 
54  virtual bool cellValue(int x, int y, const Yuni::String& value);
55 
56  virtual void resetColors(int, int, wxColour&, wxColour&) const
57  {
58  // Do nothing
59  }
60 
61  virtual bool valid() const;
62 
63  virtual uint maxWidthResize() const
64  {
65  return 0;
66  }
67 
68  virtual IRenderer::CellStyle cellStyle(int col, int row) const;
69 
70  void control(Antares::Component::Datagrid::Component* control)
71  {
72  pControl = control;
73  }
74 
75 protected:
76  void onAreaChanged(Data::Area* area);
77  virtual void onStudyClosed();
78 
79 protected:
81  Data::Area* pArea;
82 
83 }; // class LayersUI
84 
85 /*General layer visibility grid renderer*/
87 {
88 public:
94  virtual ~LayersVisibility();
96 
97  virtual int width() const;
98  virtual int height() const;
99 
100  virtual wxString columnCaption(int colIndx) const;
101 
102  virtual wxString rowCaption(int rowIndx) const;
103 
104  virtual wxString cellValue(int x, int y) const;
105 
106  virtual double cellNumericValue(int x, int y) const;
107 
108  virtual bool cellValue(int x, int y, const Yuni::String& value);
109 
110  virtual void resetColors(int, int, wxColour&, wxColour&) const
111  {
112  // Do nothing
113  }
114 
115  virtual bool valid() const;
116 
117  virtual uint maxWidthResize() const
118  {
119  return 0;
120  }
121 
122  virtual IRenderer::CellStyle cellStyle(int col, int row) const;
123 
124  void control(Antares::Component::Datagrid::Component* control)
125  {
126  pControl = control;
127  }
128 
129 protected:
130  virtual void onStudyClosed();
131 
132 protected:
134 
135 }; // class Layers
136 
137 } // namespace Antares::Component::Datagrid::Renderer
138 
139 #endif // __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_LAYERS_H__
A datagrid with virtual values.
Definition: component.h:84
Data provider for Datagrids.
Definition: renderer.h:50
virtual int height() const
The effective height of the grid.
Definition: layers.cpp:57
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition: layers.cpp:89
virtual uint maxWidthResize() const
The most suitable column count.
Definition: layers.h:63
virtual wxString columnCaption(int colIndx) const
Get the caption of a column.
Definition: layers.cpp:75
virtual int width() const
The effective width of the grid.
Definition: layers.cpp:48
virtual double cellNumericValue(int x, int y) const
Get the floating value of a Cell.
Definition: layers.cpp:188
virtual wxString cellValue(int x, int y) const
Get the string representation of a Cell.
Definition: layers.cpp:215
virtual ~LayersUI()
Destructor.
Definition: layers.cpp:38
virtual void onStudyClosed()
Event: the study has been closed.
Definition: layers.cpp:255
LayersUI(Toolbox::InputSelector::Area *notifier)
Constructor for Layers from area selection notifier.
Definition: layers.cpp:27
virtual uint maxWidthResize() const
The most suitable column count.
Definition: layers.h:117
virtual int width() const
The effective width of the grid.
Definition: layers.cpp:277
virtual wxString columnCaption(int colIndx) const
Get the caption of a column.
Definition: layers.cpp:291
virtual ~LayersVisibility()
Destructor.
Definition: layers.cpp:267
virtual double cellNumericValue(int x, int y) const
Get the floating value of a Cell.
Definition: layers.cpp:361
virtual void onStudyClosed()
Event: the study has been closed.
Definition: layers.cpp:404
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition: layers.cpp:305
virtual wxString cellValue(int x, int y) const
Get the string representation of a Cell.
Definition: layers.cpp:378
virtual int height() const
The effective height of the grid.
Definition: layers.cpp:286
LayersVisibility()
Constructor for Layers from area selection notifier.
Definition: layers.cpp:262
Definition for a single area.
Definition: area.h:51
Visual Component for displaying all available areas (and groups)
Definition: area.h:37