Commit 4bbe0c5e authored by tenter's avatar tenter

avoid infinite looping if the input points are invalid (fixes #2)

parent d0f671b0
...@@ -51,6 +51,12 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter ) ...@@ -51,6 +51,12 @@ run( std::vector< Real >& _pt_data, MeshT& _mesh, const Parameter& _parameter )
int pointCount = tree.setTreeMemory( _pt_data , m_parameter.Depth , m_parameter.MinDepth , m_parameter.Depth , Real(m_parameter.SamplesPerNode), int pointCount = tree.setTreeMemory( _pt_data , m_parameter.Depth , m_parameter.MinDepth , m_parameter.Depth , Real(m_parameter.SamplesPerNode),
m_parameter.Scale , m_parameter.Confidence , m_parameter.PointWeight , m_parameter.AdaptiveExponent , xForm ); m_parameter.Scale , m_parameter.Confidence , m_parameter.PointWeight , m_parameter.AdaptiveExponent , xForm );
if (pointCount <= 0)
{
std::cerr << "Invalid Input Points" << std::endl;
return false;
}
std::cerr << "Tree Clipping" << std::endl; std::cerr << "Tree Clipping" << std::endl;
tree.ClipTree(); tree.ClipTree();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment