From df1a386b067a62c879b48b1eeca50b2982b4f92d Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 28 Jun 2021 21:53:17 -0700 Subject: Add table content list, cell status indicator --- core/src/Model/Template/TableTemplate.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'core/src/Model/Template/TableTemplate.cpp') diff --git a/core/src/Model/Template/TableTemplate.cpp b/core/src/Model/Template/TableTemplate.cpp index e01af02..6c3d86b 100644 --- a/core/src/Model/Template/TableTemplate.cpp +++ b/core/src/Model/Template/TableTemplate.cpp @@ -20,22 +20,22 @@ bool TableCell::IsMergedCell() const return PrimaryCellLocation.x == -1 || PrimaryCellLocation.y == -1; } -Vec2i TableCellArrayGroup::GetLeftCell() const +Vec2i TableArrayGroup::GetLeftCell() const { return { Row, LeftCell }; } -Vec2i TableCellArrayGroup::GetRightCell() const +Vec2i TableArrayGroup::GetRightCell() const { return { Row, RightCell }; } -int TableCellArrayGroup::GetCount() const +int TableArrayGroup::GetCount() const { return RightCell - LeftCell + 1; } -Vec2i TableCellArrayGroup::FindCell(std::string_view name) +Vec2i TableArrayGroup::FindCell(std::string_view name) { } @@ -165,10 +165,11 @@ void TableTemplate::SetCellType(Vec2i pos, TableCell::CellType type) case TableCell::ArrayParametricCell: { auto& ag = mArrayGroups[cell.DataId]; if (cell.Location.x == ag.LeftCell) { - + ag.LeftCell++; } else if (cell.Location.x == ag.RightCell) { - + ag.RightCell--; } else { + } } break; } @@ -205,17 +206,17 @@ int TableTemplate::GetArrayGroupCount() const return mArrayGroups.size(); } -const TableCellArrayGroup& TableTemplate::GetArrayGroup(int id) const +const TableArrayGroup& TableTemplate::GetArrayGroup(int id) const { return mArrayGroups[id]; } -TableCellArrayGroup& TableTemplate::GetArrayGroup(int id) +TableArrayGroup& TableTemplate::GetArrayGroup(int id) { return mArrayGroups[id]; } -TableCellArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) +TableArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) { // size_t max value: 18446744073709551615 // ^~~~~~~~~~~~~~~~~~~~ 20 chars @@ -226,7 +227,7 @@ TableCellArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) return AddArrayGroup(nameStr, row, left, right); } -TableCellArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row, int left, int right) +TableArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row, int left, int right) { assert(row >= 0 && row < GetTableHeight()); assert(left >= 0 && left < GetTableWidth()); @@ -243,7 +244,7 @@ TableCellArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row return nullptr; } - mArrayGroups.push_back(TableCellArrayGroup{ + mArrayGroups.push_back(TableArrayGroup{ .Row = row, .LeftCell = left, .RightCell = right, @@ -281,7 +282,7 @@ TableCell* TableTemplate::FindCell(std::string_view name) } } -TableCellArrayGroup* TableTemplate::FindArrayGroup(std::string_view name) +TableArrayGroup* TableTemplate::FindArrayGroup(std::string_view name) { auto iter = mName2ArrayGroups.find(name); if (iter != mName2ArrayGroups.end()) { -- cgit v1.2.3-70-g09d2