Skip to content
Snippets Groups Projects
Commit 0da6e947 authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

Bug fixed : the number of point is based on the actual content of the 2D array...

Bug fixed : the number of point is based on the actual content of the 2D array and not on the number of Coordinates objects created.
parent d53544c6
No related branches found
No related tags found
1 merge request!10Surface reconstruction Refactoring
......@@ -26,8 +26,9 @@ public class LocalMaximumsDisplay extends AbstractAnalysis
{
if ( maximumCoordinates != null )
{
Coord3d[] points = new Coord3d[ Coordinate.number ];
Color[] colors = new Color[ Coordinate.number ];
int length = getNumberOfCoordinates();
Coord3d[] points = new Coord3d[ length ];
Color[] colors = new Color[ length ];
int x;
int y;
......@@ -46,7 +47,7 @@ public class LocalMaximumsDisplay extends AbstractAnalysis
{ Coordinate pixel = pixels.get(0);
x = pixel.getX();
y = pixel.getY();
z = pixel .getZ();
z = pixel.getZ();
points[ index ] = new Coord3d( x, y, z );
colors[ index ] = Color.BLACK;
index++;
......@@ -73,4 +74,20 @@ public class LocalMaximumsDisplay extends AbstractAnalysis
chart.getScene().add( scatter );
}
}
private int getNumberOfCoordinates()
{
int n = 0;
for ( int i = 0; i <= maximumCoordinates[0].length - 1; i++ )
{
for ( int j = 0; j <= maximumCoordinates.length - 1 ; j++ )
{
if( maximumCoordinates[i][j] != null)
{
n += maximumCoordinates[i][j].size();
}
}
}
return n;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment