de.unihalle.informatik.MiToBo.segmentation.snakes.datatypes
Class MTBSnakePoint2D

java.lang.Object
  extended by java.awt.geom.Point2D
      extended by java.awt.geom.Point2D.Double
          extended by de.unihalle.informatik.MiToBo.segmentation.snakes.datatypes.MTBSnakePoint2D
All Implemented Interfaces:
Serializable, Cloneable

public class MTBSnakePoint2D
extends Point2D.Double

 
 Class to implement 2D snake points with a special structure:
 
 (snake points means control points of the snake, on which the snake energy
  is calculated and optimized)
  
 - every snake point has an old index (position) within the snake, if the point does not
   exists before, the old index is set to -1 by default
 - every snake point has a Point2D.Double object for point coordinates
 
 

Author:
misiak
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float
 
Field Summary
protected  int oldId
          Old index (position) of the point within the snake.
 
Fields inherited from class java.awt.geom.Point2D.Double
x, y
 
Constructor Summary
MTBSnakePoint2D()
          Standard constructor to create a new SnakePoint2D
MTBSnakePoint2D(double _x, double _y)
          Constructor to create a new SnakePoint2D with x- and y-coordinates for the point.
MTBSnakePoint2D(Point2D.Double p)
          Constructor to create a new SnakePoint2D from the specified Point2D.Double object.
 
Method Summary
 MTBSnakePoint2D clone()
          Override java.lang.Object.clone() to create and return a copy of this object.
 int getOldId()
          Get previous index of snake point from the previous snake.
 void setLocation(double _x, double _y)
          Overwrites Java Point2D method.
 void setLocation(double _x, double _y, int _oldId)
          Sets the location of this SnakePoint2D to the specified double coordinates.
 void setLocation(Point2D.Double p, int _oldId)
          Sets the location of this SnakePoint2D to the same coordinates as the specified Point2D.Double object.
 void setLocation(Point2D p)
          Overwrites Java Point2D method.
 void setOldId(int _oldId)
          Set old index of current snake point within the snake.
 
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY, toString
 
Methods inherited from class java.awt.geom.Point2D
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oldId

protected int oldId
Old index (position) of the point within the snake.

Constructor Detail

MTBSnakePoint2D

public MTBSnakePoint2D()
Standard constructor to create a new SnakePoint2D


MTBSnakePoint2D

public MTBSnakePoint2D(double _x,
                       double _y)
Constructor to create a new SnakePoint2D with x- and y-coordinates for the point. The old index of the point within the snake is set to -1 by default.

Parameters:
_x - x-coordinate of the snake point
_y - y-coordinate of the snake point

MTBSnakePoint2D

public MTBSnakePoint2D(Point2D.Double p)
Constructor to create a new SnakePoint2D from the specified Point2D.Double object. The old index of the point within the snake is set to -1 by default.

Parameters:
p - Point2D.Double object with coordinates for new 2D snake point
Method Detail

setOldId

public void setOldId(int _oldId)
Set old index of current snake point within the snake.

Parameters:
_oldId - old index of the point point in the previous snake

setLocation

public void setLocation(double _x,
                        double _y)
Overwrites Java Point2D method. Sets the location of this SnakePoint2D to the specified double coordinates. The old index of the snake point is kept.

Overrides:
setLocation in class Point2D.Double

setLocation

public void setLocation(Point2D p)
Overwrites Java Point2D method. Sets the location of this SnakePoint2D to the same coordinates as the specified Point2D object. The old index of the snake point is kept.

Overrides:
setLocation in class Point2D

setLocation

public void setLocation(Point2D.Double p,
                        int _oldId)
Sets the location of this SnakePoint2D to the same coordinates as the specified Point2D.Double object. The old index of the snake point is given by the oldId value.

Parameters:
p - 2D point with new coordinates for the current 2D snake point
_oldId - old index of the point within the snake

setLocation

public void setLocation(double _x,
                        double _y,
                        int _oldId)
Sets the location of this SnakePoint2D to the specified double coordinates. The old index of the snake point is given by the oldId value.

Parameters:
_x - new x-coordinate of the current 2D snake point
_y - new y-coordinate of the current 2D snake point
_oldId - old index of the point within the snake

getOldId

public int getOldId()
Get previous index of snake point from the previous snake.

Returns:
Current snake point index.

clone

public MTBSnakePoint2D clone()
Override java.lang.Object.clone() to create and return a copy of this object.

Overrides:
clone in class Point2D


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.