double CellMutationStatesWriter<ELEMENT_DIM, SPACE_DIM>::GetCellDataForVtkOutput(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation) { double mutation_state = pCell->GetMutationState()->GetColour(); CellPropertyCollection collection = pCell->rGetCellPropertyCollection(); CellPropertyCollection label_collection = collection.GetProperties<CellLabel>(); if (label_collection.GetSize() == 1) { boost::shared_ptr<CellLabel> p_label = boost::static_pointer_cast<CellLabel>(label_collection.GetProperty()); mutation_state = p_label->GetColour(); } return mutation_state; }
void CellMutationStatesWriter<ELEMENT_DIM, SPACE_DIM>::VisitCell(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation) { double mutation_state = pCell->GetMutationState()->GetColour(); CellPropertyCollection collection = pCell->rGetCellPropertyCollection(); CellPropertyCollection label_collection = collection.GetProperties<CellLabel>(); if (label_collection.GetSize() == 1) { boost::shared_ptr<CellLabel> p_label = boost::static_pointer_cast<CellLabel>(label_collection.GetProperty()); mutation_state = p_label->GetColour(); } *this->mpOutStream << mutation_state << " "; }