コード例 #1
0
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;
}
コード例 #2
0
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 << " ";
}