public class QuimpDataConverter extends Object
As this object returns references to arrays and list, any modification done "in place" on returned data will affect future conversions done by calling accessor methods.
The base format are two arrays xc and yc. All other inputs are converted to arrays first. Conversion e.g. Snake->Snake causes that output Snake is not reference of input one because input has been converted to arrays first.
Constructor and Description |
---|
QuimpDataConverter()
Default constructor.
|
QuimpDataConverter(Collection<? extends Point2D> input)
Default constructor collection of awt.Point.
|
QuimpDataConverter(double[] x,
double[] y)
Default if Node list is in form of two arrays with coordinates.
|
QuimpDataConverter(float[] x,
float[] y)
Default if Node list is in form of two arrays with coordinates.
|
QuimpDataConverter(List<? extends Tuple2d> input)
Default constructor if Node list is in form of List.
|
QuimpDataConverter(Shape<?> s)
Default constructor if Node list is in form of Snake object.
|
Modifier and Type | Method and Description |
---|---|
float[] |
getFloatX()
Data accessor.
|
float[] |
getFloatY()
Data accessor.
|
List<Point2d> |
getList()
Data accessor.
|
List<Point2D> |
getListofDoublePoints()
Data accessor.
|
List<Point2D> |
getListofIntPoints()
Data accessor.
|
Outline |
getOutline()
Return Outline created from stored data.
|
Snake |
getSnake(int id)
Return Snake created from stored data.
|
double[] |
getX()
Data accessor.
|
double[] |
getY()
Data accessor.
|
int |
size()
Data accessor.
|
public QuimpDataConverter()
public QuimpDataConverter(List<? extends Tuple2d> input)
input
- list of vertices. If input is null xc and yc are set to 0 length arrays,
Snake is
null thenpublic QuimpDataConverter(Collection<? extends Point2D> input)
input
- list of vertices. If input is null xc and yc are set to 0 length arrays,
Snake is null thenpublic QuimpDataConverter(double[] x, double[] y)
x
- input list of verticesy
- input list of verticespublic QuimpDataConverter(float[] x, float[] y)
x
- input list of verticesy
- input list of verticespublic QuimpDataConverter(Shape<?> s)
s
- Shape to be converted. If null xc and yc are set to 0 length arrays, List is
also 0 length.public double[] getX()
public double[] getY()
public List<Point2d> getList()
Warning
If user modifies this list this object loses its consistency
To convert Shape
to list use Shape.asList()
.
public List<Point2D> getListofIntPoints()
Warning
If user modifies this list this object loses its consistency
To convert Shape
to list use Shape.asList()
.
public List<Point2D> getListofDoublePoints()
Warning
If user modifies this list this object loses its consistency
To convert Shape
to list use Shape.asList()
.
public float[] getFloatX()
public float[] getFloatY()
public int size()
public Snake getSnake(int id) throws BoaException
Head node is first point from list. Snake has centroid, linear coordinates and boundaries calculated already. Normals are set according to global BOAState.SegParam#expandSnake.
id
- new Id of snakeBoaException
- when there is less than 3 nodes.Snake.Snake(double[], double[], int)
,
Snake.removeNode(com.github.celldynamics.quimp.Node)
,
Shape.updateNormals(boolean)
public Outline getOutline()
Snake has centroid, local curvature and linear coordinates calculated already. Normals are set true
Snake.Snake(double[], double[], int)
,
Snake.removeNode(com.github.celldynamics.quimp.Node)
,
Shape.updateNormals(boolean)
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.