60 return m_cells.at(
static_cast<size_t>(x) * m_matWidth + y).get(); }
66 void Draw(wxDC *dc, wxDC *antialiassingDC)
override;
68 void AddNewCell(std::unique_ptr<Cell> &&cell);
70 void NewRow() { m_matHeight++; m_dropCenters.emplace_back(-1, -1);}
71 void NewColumn() { m_matWidth++; m_widths.emplace_back(-1);}
77 wxString
ToOMML()
const override;
79 wxString
ToTeX()
const override;
80 wxString
ToXML()
const override;
82 void SetSpecialFlag(
bool special) { m_specialMatrix = special; }
84 void SetInferenceFlag(
bool inference) { m_inferenceMatrix = inference; }
86 void RowNames(
bool rn) { m_rowNames = rn; }
88 void ColNames(
bool cn) { m_colNames = cn; }
90 void RoundedParens() { m_parenType = paren_rounded;}
91 void BracketParens() { m_parenType = paren_brackets;}
92 void StraightParens() { m_parenType = paren_straight;}
93 void AngledParens() { m_parenType = paren_angled;}
94 void NoParens() { m_parenType = paren_none;}
99 int drop = {}, center = {};
100 constexpr int Sum()
const {
return drop + center; }
101 constexpr DropCenter() =
default;
102 constexpr DropCenter(
int drop,
int center) : drop(drop), center(center) {}
106 std::vector<std::unique_ptr<Cell>> m_cells;
108 mutable std::vector<wxCoord> m_widths;
109 mutable std::vector<DropCenter> m_dropCenters;
111 size_t m_matWidth = 0;
112 size_t m_matHeight = 0;
114 enum parenType : int8_t
124 void InitBitFields_MatrCell()
127 m_parenType = paren_rounded;
128 m_specialMatrix =
false;
129 m_inferenceMatrix =
false;
133 uint8_t m_parenType : 3 ;
134 bool m_specialMatrix : 1 ;
135 bool m_inferenceMatrix : 1 ;
136 bool m_rowNames : 1 ;
137 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:97
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
virtual void SetCurrentPoint(wxPoint point)
Pass 2: Arrangement.
Definition: Cell.cpp:466
The configuration storage for the current worksheet.
Definition: Configuration.h:86
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:87
A Cell that displays a matrix.
Definition: MatrCell.h:50
wxString ToString() const override
Returns the cell's representation as a string.
Definition: MatrCell.cpp:254
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:57
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: MatrCell.cpp:438
wxString ToOMML() const override
Returns the cell's representation as OMML.
Definition: MatrCell.cpp:395
void SetCurrentPoint(wxPoint point) override
Pass 2: Arrangement.
Definition: MatrCell.cpp:101
wxString ToMathML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: MatrCell.cpp:340
Cell * GetInnerCell(size_t index) const override
Retrieve an inner cell with given index which must be less than GetInnerCellCount.
Definition: MatrCell.h:58
void Recalculate(const AFontSize fontsize) const override
Recalculate the size of the cell and the difference between top and center.
Definition: MatrCell.cpp:62
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: MatrCell.cpp:292
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
void Draw(wxDC *dc, wxDC *antialiassingDC) override
Pass 3 (Paint): Renders the cell using pre-calculated coordinates.
Definition: MatrCell.cpp:120
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: MatrCell.cpp:272