41 return m_cells[
static_cast<size_t>(x) * m_matWidth + y].get(); }
45 void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC)
override;
47 void AddNewCell(std::unique_ptr<Cell> &&cell);
49 void NewRow() { m_matHeight++; m_dropCenters.emplace_back(-1, -1);}
50 void NewColumn() { m_matWidth++; m_widths.emplace_back(-1);}
56 wxString
ToOMML()
const override;
58 wxString
ToTeX()
const override;
59 wxString
ToXML()
const override;
61 void SetSpecialFlag(
bool special) { m_specialMatrix = special; }
63 void SetInferenceFlag(
bool inference) { m_inferenceMatrix = inference; }
65 void RowNames(
bool rn) { m_rowNames = rn; }
67 void ColNames(
bool cn) { m_colNames = cn; }
69 void RoundedParens() { m_parenType = paren_rounded;}
70 void BracketParens() { m_parenType = paren_brackets;}
71 void StraightParens() { m_parenType = paren_straight;}
72 void AngledParens() { m_parenType = paren_angled;}
73 void NoParens() { m_parenType = paren_none;}
78 int drop = {}, center = {};
79 constexpr int Sum()
const {
return drop + center; }
80 constexpr DropCenter() =
default;
81 constexpr DropCenter(
int drop,
int center) : drop(drop), center(center) {}
85 std::vector<std::unique_ptr<Cell>> m_cells;
87 std::vector<wxCoord> m_widths;
88 std::vector<DropCenter> m_dropCenters;
90 size_t m_matWidth = 0;
91 size_t m_matHeight = 0;
93 enum parenType : int8_t
103 void InitBitFields_MatrCell()
106 m_parenType = paren_rounded;
107 m_specialMatrix =
false;
108 m_inferenceMatrix =
false;
112 uint8_t m_parenType : 3 ;
113 bool m_specialMatrix : 1 ;
114 bool m_inferenceMatrix : 1 ;
115 bool m_rowNames : 1 ;
116 bool m_colNames : 1 ;
The definition of the base class of all cells the worksheet consists of.
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:98
A class that carries information about the type of a cell.
Definition: Cell.h:93
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:142
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:74
Definition: MatrCell.h:31
void Draw(wxPoint point, wxDC *dc, wxDC *antialiassingDC) override
Draw this cell.
Definition: MatrCell.cpp:101
wxString ToString() const override
Returns the cell's representation as a string.
Definition: MatrCell.cpp:245
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
size_t GetInnerCellCount() const override
The number of inner cells - for use by the iterators.
Definition: MatrCell.h:38
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: MatrCell.cpp:393
wxString ToOMML() const override
Returns the cell's representation as OMML.
Definition: MatrCell.cpp:350
wxString ToMathML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: MatrCell.cpp:331
Cell * GetInnerCell(size_t index) const override
Retrieve an inner cell with given index which must be less than GetInnerCellCount.
Definition: MatrCell.h:39
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: MatrCell.cpp:283
void Recalculate(AFontSize fontsize) override
Recalculate the size of the cell and the difference between top and center.
Definition: MatrCell.cpp:62
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: MatrCell.cpp:263