21 #ifndef __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_CONVERTION_HXX__
22 #define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_CONVERTION_HXX__
24 #include <antares/study/xcast/xcast.h>
26 namespace Antares::Component::Datagrid::Renderer
28 template<enum Data::TimeSeriesType T>
35 template<enum Data::TimeSeriesType T>
41 template<enum Data::TimeSeriesType T>
44 return wxString() << wxT(
" point ") << (colIndx + 1) << wxT(
' ');
47 template<enum Data::TimeSeriesType T>
50 return MatrixAncestorType::cellValue(x + 1, y);
53 template<enum Data::TimeSeriesType T>
56 return MatrixAncestorType::cellNumericValue(x + 1, y);
59 template<enum Data::TimeSeriesType T>
62 return MatrixAncestorType::cellValue(x + 1, y, value);
65 template<enum Data::TimeSeriesType T>
70 auto* xcastData = area->xcastData<T>();
71 this->matrix(&(xcastData->conversion));
77 Renderer::ARendererArea::internalAreaChanged(area);
80 template<enum Data::TimeSeriesType T>
81 IRenderer::CellStyle XCastConversion<T>::cellStyle(
int col,
int row)
const
83 double b = MatrixAncestorType::cellNumericValue(col + 1, 0);
84 return (Yuni::Math::Abs(b) >= 1.0e+19)
85 || (col > 0 && b <= MatrixAncestorType::cellNumericValue(col, 0))
87 : MatrixAncestorType::cellStyle(col, row);
90 template<enum Data::TimeSeriesType T>
93 return (rowIndx == 0) ? wxT(
"IN") : wxT(
"OUT");
96 template<enum Data::TimeSeriesType T>
103 auto& matrix = (*pMatrix);
104 matrix[matrix.width - 1][0] = 0;
105 matrix[matrix.width - 1][1] = 0;
106 matrix.resizeWithoutDataLost(newX + 2, 2);
107 matrix[matrix.width - 1][0] = +std::numeric_limits<float>::max();
108 matrix.markAsModified();
109 MarkTheStudyAsModified();
113 template<enum Data::TimeSeriesType T>
116 auto& matrix = *pMatrix;
117 if (matrix.height != 2)
121 matrix.markAsModified();
122 MarkTheStudyAsModified();
126 matrix[0][0] = -std::numeric_limits<float>::max();
127 matrix[0][1] = matrix[1][1];
128 matrix[matrix.width - 1][0] = +std::numeric_limits<float>::max();
129 matrix[matrix.width - 1][1] = matrix[matrix.width - 2][1];
134 matrix[0][0] = -std::numeric_limits<float>::max();
138 matrix[2][0] = +std::numeric_limits<float>::max();
143 template<enum Data::TimeSeriesType T>
150 template<enum Data::TimeSeriesType T>
virtual void onStudyClosed() override
The study has been closed.
Definition: area.cpp:86
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition: area.cpp:92
Definition: xcast-conversion.h:31
virtual ~XCastConversion()
Destructor.
Definition: xcast-conversion.hxx:36
virtual wxString rowCaption(int rowIndx) const
Get the row caption.
Definition: xcast-conversion.hxx:91
virtual void onMatrixLoad()
Event triggered right after a matrix was loaded by the renderer.
Definition: xcast-conversion.hxx:114
virtual void onStudyClosed() override
Event: the study has been closed.
Definition: xcast-conversion.hxx:144
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition: xcast-conversion.hxx:151
virtual double cellNumericValue(int x, int y) const
Get the value of a cell.
Definition: xcast-conversion.hxx:54
virtual wxString columnCaption(int colIndx) const
Get the column caption.
Definition: xcast-conversion.hxx:42
virtual wxString cellValue(int x, int y) const
Get the string representation of a cell.
Definition: xcast-conversion.hxx:48
XCastConversion(wxWindow *control, Toolbox::InputSelector::Area *notifier)
Constructor.
Definition: xcast-conversion.hxx:29
virtual bool onMatrixResize(uint oldX, uint oldY, uint &newX, uint &newY)
Event trigerred before resizing a matrix.
Definition: xcast-conversion.hxx:97
Definition for a single area.
Definition: area.h:51
@ conversionMaxPoints
Hard limit for the number of points of the transfer function.
Definition: xcast.h:81
A n-by-n matrix.
Definition: matrix.h:44