36 #include "VesselSegment.hpp" 37 #include "UnitCollection.hpp" 38 #include "DimensionalChastePoint.hpp" 39 #include "DistanceMap.hpp" 41 template<
unsigned DIM>
45 mUseSegmentRadii(false)
50 template<
unsigned DIM>
57 template<
unsigned DIM>
63 template<
unsigned DIM>
69 template<
unsigned DIM>
78 unsigned number_of_points = this->
mpRegularGrid->GetNumberOfPoints();
84 std::vector<double> distances(number_of_points, 0.0);
87 std::vector<boost::shared_ptr<VesselSegment<DIM> > > segments;
88 segments = this->
mpNetwork->GetVesselSegments();
89 for (
unsigned i = 0; i < extents_z; i++)
91 for (
unsigned j = 0; j < extents_y; j++)
93 for (
unsigned k = 0; k < extents_x; k++)
95 unsigned grid_index = this->
mpRegularGrid->Get1dGridIndex(k, j, i);
97 units::quantity<unit::length> min_distance = DBL_MAX * unit::metres;
98 for (
unsigned idx = 0; idx < segments.size(); idx++)
100 units::quantity<unit::length> seg_dist = segments[idx]->GetDistance(location);
103 seg_dist = 0.0 * unit::metres;
105 if(seg_dist < min_distance)
107 min_distance = seg_dist;
110 distances[grid_index] = min_distance/this->
mpRegularGrid->GetReferenceLengthScale();
static boost::shared_ptr< DistanceMap< DIM > > Create()
boost::shared_ptr< RegularGrid< DIM > > mpRegularGrid
void SetUseSegmentRadii(bool useRadii)
vtkSmartPointer< vtkImageData > mpVtkSolution
virtual void UpdateSolution(std::vector< double > &rData)
boost::shared_ptr< VesselNetwork< DIM > > mpNetwork