21 #ifndef otbPointSetDensityFunction_hxx
22 #define otbPointSetDensityFunction_hxx
32 template <
class TPo
intSet,
class TOutput>
36 double surface =
CONST_PI * m_Radius * m_Radius;
38 if (this->GetPointSet()->GetNumberOfPoints() != 0)
40 typedef typename TPointSet::PointsContainer::ConstIterator iteratorType;
41 iteratorType it = this->GetPointSet()->GetPoints()->Begin();
43 while (it != this->GetPointSet()->GetPoints()->End())
45 float distX = input[0] - it.Value()[0];
46 float distY = input[1] - it.Value()[1];
47 float distsq = distX * distX + distY * distY;
49 if (distsq <= m_Radius * m_Radius)
58 return static_cast<float>(accu / surface);
64 template <
class TPo
intSet,
class TOutput>
67 this->Superclass::PrintSelf(os, indent);