plugins.big.bigsnakeutils.icy.snake3D
Class Snake3DScale

java.lang.Object
  extended by plugins.big.bigsnakeutils.icy.snake3D.Snake3DScale

public class Snake3DScale
extends java.lang.Object

This class is used to store the scales that are used to draw the skin of the snake.

Version:
May 3, 2014
Author:
Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Nicolas Chenouard (nicolas.chenouard@gmail.com), Philippe Thévenaz (philippe.thevenaz@epfl.ch)

Constructor Summary
Snake3DScale(double[][] coordinates, java.awt.Color color, boolean closed)
          This constructor builds a scale with the provided colors and flags.
Snake3DScale(int nPoints)
          This constructor builds a scale of length length.
Snake3DScale(int nPoints, java.awt.Color color, boolean closed)
          This constructor builds a scale with the provided colors and flags.
 
Method Summary
 boolean containsInXYProjection(java.awt.geom.Point2D point)
           
 java.awt.Color getColor()
          Returns the associated color of the scale.
 double[][] getCoordinates()
          Returns the coordinates of the scales.
 boolean isClosed()
          Returns if the scale is closed or not.
 void loadFromXML(org.w3c.dom.Node node)
          Loads the scale from an XML node.
 void saveToXML(org.w3c.dom.Node node)
          Saves the scale in an XML node.
 java.lang.String toString()
          This method returns text-based information about this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Snake3DScale

public Snake3DScale(int nPoints)
This constructor builds a scale of length length. The default color coloris set to Color.RED. The scale is closed by default.


Snake3DScale

public Snake3DScale(int nPoints,
                    java.awt.Color color,
                    boolean closed)
This constructor builds a scale with the provided colors and flags.


Snake3DScale

public Snake3DScale(double[][] coordinates,
                    java.awt.Color color,
                    boolean closed)
This constructor builds a scale with the provided colors and flags.

Method Detail

toString

public java.lang.String toString()
This method returns text-based information about this object.

Overrides:
toString in class java.lang.Object

saveToXML

public void saveToXML(org.w3c.dom.Node node)
               throws java.lang.Exception
Saves the scale in an XML node.

Throws:
java.lang.Exception

loadFromXML

public void loadFromXML(org.w3c.dom.Node node)
Loads the scale from an XML node.


getColor

public java.awt.Color getColor()
Returns the associated color of the scale.


isClosed

public boolean isClosed()
Returns if the scale is closed or not.


getCoordinates

public double[][] getCoordinates()
Returns the coordinates of the scales.


containsInXYProjection

public boolean containsInXYProjection(java.awt.geom.Point2D point)