aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Template/TableTemplate.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-06-28 21:53:17 -0700
committerrtk0c <[email protected]>2021-06-28 21:53:17 -0700
commitdf1a386b067a62c879b48b1eeca50b2982b4f92d (patch)
tree4213511f7f74779ea1e80abc030cb1272e3b9dee /core/src/Model/Template/TableTemplate.cpp
parent43cd2bd879d529fcbd0a0f64eccd4ce1eb872ab4 (diff)
Add table content list, cell status indicator
Diffstat (limited to 'core/src/Model/Template/TableTemplate.cpp')
-rw-r--r--core/src/Model/Template/TableTemplate.cpp25
1 files changed, 13 insertions, 12 deletions
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()) {