PlaneBasedCellKiller.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 "PlaneBasedCellKiller.hpp"
00037
00038 template<unsigned DIM>
00039 PlaneBasedCellKiller<DIM>::PlaneBasedCellKiller(AbstractCellPopulation<DIM>* pCellPopulation,
00040 c_vector<double, DIM> point,
00041 c_vector<double, DIM> normal)
00042 : AbstractCellKiller<DIM>(pCellPopulation),
00043 mPointOnPlane(point)
00044 {
00045 assert(norm_2(normal) > 0.0);
00046 mNormalToPlane = normal/norm_2(normal);
00047 }
00048
00049 template<unsigned DIM>
00050 const c_vector<double, DIM>& PlaneBasedCellKiller<DIM>::rGetPointOnPlane() const
00051 {
00052 return mPointOnPlane;
00053 }
00054
00055 template<unsigned DIM>
00056 const c_vector<double, DIM>& PlaneBasedCellKiller<DIM>::rGetNormalToPlane() const
00057 {
00058 return mNormalToPlane;
00059 }
00060
00061 template<unsigned DIM>
00062 void PlaneBasedCellKiller<DIM>::CheckAndLabelCellsForApoptosisOrDeath()
00063 {
00064 for (typename AbstractCellPopulation<DIM>::Iterator cell_iter = this->mpCellPopulation->Begin();
00065 cell_iter != this->mpCellPopulation->End();
00066 ++cell_iter)
00067 {
00068 c_vector<double, DIM> cell_location = this->mpCellPopulation->GetLocationOfCellCentre(*cell_iter);
00069
00070 if (inner_prod(cell_location - mPointOnPlane, mNormalToPlane) > 0.0)
00071 {
00072 cell_iter->Kill();
00073 }
00074 }
00075 }
00076
00077 template<unsigned DIM>
00078 void PlaneBasedCellKiller<DIM>::OutputCellKillerParameters(out_stream& rParamsFile)
00079 {
00080 *rParamsFile << "\t\t\t<PointOnPlane>";
00081 for (unsigned index=0; index != DIM-1U; index++)
00082 {
00083 *rParamsFile << mPointOnPlane[index] << ",";
00084 }
00085 *rParamsFile << mPointOnPlane[DIM-1] << "</PointOnPlane>\n";
00086
00087 *rParamsFile << "\t\t\t<NormalToPlane>";
00088 for (unsigned index=0; index != DIM-1U; index++)
00089 {
00090 *rParamsFile << mNormalToPlane[index] << ",";
00091 }
00092 *rParamsFile << mNormalToPlane[DIM-1] << "</NormalToPlane>\n";
00093
00094
00095 AbstractCellKiller<DIM>::OutputCellKillerParameters(rParamsFile);
00096 }
00097
00099
00101
00102 template class PlaneBasedCellKiller<1>;
00103 template class PlaneBasedCellKiller<2>;
00104 template class PlaneBasedCellKiller<3>;
00105
00106
00107 #include "SerializationExportWrapperForCpp.hpp"
00108 EXPORT_TEMPLATE_CLASS_SAME_DIMS(PlaneBasedCellKiller)