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>
34template<enum Data::TimeSeriesType T>
40template<enum Data::TimeSeriesType T>
46template<enum Data::TimeSeriesType T>
49 return wxString() << wxT(
" point ") << (colIndx + 1) << wxT(
' ');
52template<enum Data::TimeSeriesType T>
55 return MatrixAncestorType::cellValue(x + 1, y);
58template<enum Data::TimeSeriesType T>
61 return MatrixAncestorType::cellNumericValue(x + 1, y);
64template<enum Data::TimeSeriesType T>
67 return MatrixAncestorType::cellValue(x + 1, y, value);
70template<enum Data::TimeSeriesType T>
75 auto* xcastData = area->xcastData<T>();
76 this->matrix(&(xcastData->conversion));
80 Renderer::ARendererArea::internalAreaChanged(area);
83template<enum Data::TimeSeriesType T>
84IRenderer::CellStyle XCastConversion<T>::cellStyle(
int col,
int row)
const
86 double b = MatrixAncestorType::cellNumericValue(col + 1, 0);
87 return (Yuni::Math::Abs(b) >= 1.0e+19)
88 || (col > 0 && b <= MatrixAncestorType::cellNumericValue(col, 0))
90 : MatrixAncestorType::cellStyle(col, row);
93template<enum Data::TimeSeriesType T>
96 return (rowIndx == 0) ? wxT(
"IN") : wxT(
"OUT");
99template<enum Data::TimeSeriesType T>
104 auto& matrix = (*pMatrix);
105 matrix[matrix.width - 1][0] = 0;
106 matrix[matrix.width - 1][1] = 0;
107 matrix.resizeWithoutDataLost(newX + 2, 2);
108 matrix[matrix.width - 1][0] = +std::numeric_limits<float>::max();
109 matrix.markAsModified();
110 MarkTheStudyAsModified();
114template<enum Data::TimeSeriesType T>
117 auto& matrix = *pMatrix;
118 if (matrix.height != 2)
122 matrix.markAsModified();
123 MarkTheStudyAsModified();
127 matrix[0][0] = -std::numeric_limits<float>::max();
128 matrix[0][1] = matrix[1][1];
129 matrix[matrix.width - 1][0] = +std::numeric_limits<float>::max();
130 matrix[matrix.width - 1][1] = matrix[matrix.width - 2][1];
135 matrix[0][0] = -std::numeric_limits<float>::max();
139 matrix[2][0] = +std::numeric_limits<float>::max();
144template<enum Data::TimeSeriesType T>
151template<enum Data::TimeSeriesType T>
virtual void onStudyClosed() override
The study has been closed.
Definition area.cpp:83
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition area.cpp:89
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition matrix.hxx:244
virtual void onStudyClosed() override
Event: the study has been closed.
Definition matrix.hxx:238
Definition xcast-conversion.h:37
virtual ~XCastConversion()
Destructor.
Definition xcast-conversion.hxx:41
virtual wxString rowCaption(int rowIndx) const
Get the row caption.
Definition xcast-conversion.hxx:94
virtual void onMatrixLoad()
Event triggered right after a matrix was loaded by the renderer.
Definition xcast-conversion.hxx:115
virtual void onStudyClosed() override
Event: the study has been closed.
Definition xcast-conversion.hxx:145
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition xcast-conversion.hxx:152
virtual double cellNumericValue(int x, int y) const
Get the value of a cell.
Definition xcast-conversion.hxx:59
virtual wxString columnCaption(int colIndx) const
Get the column caption.
Definition xcast-conversion.hxx:47
virtual wxString cellValue(int x, int y) const
Get the value of a cell.
Definition xcast-conversion.hxx:53
XCastConversion(wxWindow *control, Toolbox::InputSelector::Area *notifier)
Constructor.
Definition xcast-conversion.hxx:35
virtual bool onMatrixResize(uint oldX, uint oldY, uint &newX, uint &newY)
Event trigerred before resizing a matrix.
Definition xcast-conversion.hxx:100
Definition for a single area.
Definition area.h:52
@ conversionMaxPoints
Hard limit for the number of points of the transfer function.
Definition xcast.h:81