CellProliferativeTypesWriter.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "CellProliferativeTypesWriter.hpp"
00037 #include "AbstractCellPopulation.hpp"
00038
00039 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00040 CellProliferativeTypesWriter<ELEMENT_DIM, SPACE_DIM>::CellProliferativeTypesWriter()
00041 : AbstractCellWriter<ELEMENT_DIM, SPACE_DIM>("results.vizcelltypes")
00042 {
00043 this->mVtkCellDataName = "Cell types";
00044 }
00045
00046 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00047 double CellProliferativeTypesWriter<ELEMENT_DIM, SPACE_DIM>::GetCellDataForVtkOutput(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00048 {
00049 double colour = pCell->GetCellProliferativeType()->GetColour();
00050
00051
00052 if (!pCell->GetMutationState()->IsType<WildTypeCellMutationState>())
00053 {
00054 colour = pCell->GetMutationState()->GetColour();
00055 }
00056 if (pCell->HasCellProperty<CellLabel>())
00057 {
00058 CellPropertyCollection collection = pCell->rGetCellPropertyCollection().GetProperties<CellLabel>();
00059 boost::shared_ptr<CellLabel> p_label = boost::static_pointer_cast<CellLabel>(collection.GetProperty());
00060 colour = p_label->GetColour();
00061 }
00062 if (pCell->HasCellProperty<ApoptoticCellProperty>() || pCell->HasApoptosisBegun())
00063 {
00065 colour = 6.0;
00066 }
00067
00068 return colour;
00069 }
00070
00071 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00072 void CellProliferativeTypesWriter<ELEMENT_DIM, SPACE_DIM>::VisitCell(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00073 {
00074 unsigned colour = pCell->GetCellProliferativeType()->GetColour();
00075
00076
00077 if (!pCell->GetMutationState()->IsType<WildTypeCellMutationState>())
00078 {
00079 colour = pCell->GetMutationState()->GetColour();
00080 }
00081 if (pCell->HasCellProperty<CellLabel>())
00082 {
00083 CellPropertyCollection collection = pCell->rGetCellPropertyCollection().GetProperties<CellLabel>();
00084 boost::shared_ptr<CellLabel> p_label = boost::static_pointer_cast<CellLabel>(collection.GetProperty());
00085 colour = p_label->GetColour();
00086 }
00087 if (pCell->HasCellProperty<ApoptoticCellProperty>() || pCell->HasApoptosisBegun())
00088 {
00090 colour = 6;
00091 }
00092
00093 *this->mpOutStream << colour << " ";
00094 }
00095
00096
00097 template class CellProliferativeTypesWriter<1,1>;
00098 template class CellProliferativeTypesWriter<1,2>;
00099 template class CellProliferativeTypesWriter<2,2>;
00100 template class CellProliferativeTypesWriter<1,3>;
00101 template class CellProliferativeTypesWriter<2,3>;
00102 template class CellProliferativeTypesWriter<3,3>;
00103
00104 #include "SerializationExportWrapperForCpp.hpp"
00105
00106 EXPORT_TEMPLATE_CLASS_ALL_DIMS(CellProliferativeTypesWriter)