/** * @param CellMatrix $matrix * @param \Donquixote\Cellbrush\Axis\Axis $rows * @param \Donquixote\Cellbrush\Axis\Axis $columns */ public function modifyMatrix(CellMatrix $matrix, Axis $rows, Axis $columns) { // Fill the basic cells. foreach ($this->getCells() as $rowName => $rowCells) { $rowRange = $rows->subtreeRange($rowName); foreach ($rowCells as $colName => $cell) { $colRange = $columns->subtreeRange($colName); $brush = new RangedBrush($rowRange, $colRange); $matrix->addCell($brush, $cell); } } }
/** * @return CellMatrix * * @see BuildContainer::$CellMatrix */ protected function get_CellMatrix() { $matrix = new CellMatrix($this->nRows, $this->MatrixEmptyRow); foreach ($this->NamedCells as $rowName => $rowCells) { $rowRange = $this->rows->subtreeRange($rowName); foreach ($rowCells as $colName => $cell) { $colRange = $this->columns->subtreeRange($colName); $brush = new RangedBrush($rowRange, $colRange); $matrix->addCell($brush, $cell); } } foreach ($this->OpenEndCells as $rowName => $rowCells) { $rowRange = $this->rows->subtreeRange($rowName); foreach ($rowCells as $colName => $cTrue) { $colRange = $this->columns->subtreeRange($colName); $brush = new RangedBrush($rowRange, $colRange); $matrix->brushCellGrowRight($brush); } } return $matrix; }