de.unihalle.informatik.MiToBo.core.datatypes
Class MTBContour2DSet

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDData
      extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBContour2DSet
All Implemented Interfaces:
Cloneable

@ALDParametrizedClass
public class MTBContour2DSet
extends de.unihalle.informatik.Alida.operator.ALDData
implements Cloneable

A set of 2D contours living in a common domain which is a rectangular subset of R x R. Each contours is of type Contour2D

Author:
Stefan Posch

Constructor Summary
MTBContour2DSet()
          Standard constructor.
MTBContour2DSet(double xMin, double yMin, double xMax, double yMax)
          Construct an empty set of contours with given extent of domain.
 
Method Summary
 boolean add(MTBContour2D contour)
          Append a contour (at the end) to the set of contours.
 MTBContour2DSet clone()
           
 MTBContour2D elementAt(int i)
          Get a contour by index.
 de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType getContour2DAsXml(MTBContour2D contour, de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType xmlC)
          Copy the information of contour into the corresponding xml element xmlContour.
 MTBContour2D getContour2DFromXml(de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType xmlContour)
          Get a new MTBContour2D from the information of the xmlContour.
 double getXMax()
          Get the maximal x-coordinate of the domain of this contour set.
 double getXMin()
          Get the minimal x-coordinate of the domain of this contour set.
 double getYMax()
          Get the maximal y-coordinate of the domain of this contour set.
 double getYMin()
          Get the minimal y-coordinate of the domain of this contour set.
 void read(de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DSetType xmlContourSet)
          Read a contour set from an xml object xmlContourSet and set the MTB polygon set accordingly.
 void read(String filename)
          Read a contour set from an xml file filename and set the MTB polygon set accordingly.
 void removeElementAt(int i)
          Delete the i-th contour from the set
 void setElementAt(MTBContour2D contour, int i)
          Set the i-th contour from the set.
 int size()
          Get the number of contours of this contour set
 de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DSetType toXMLType()
           
 void write(String filename)
          Write this contour set into XML file filename.xml Additionally, its processing history is written.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTBContour2DSet

public MTBContour2DSet()
Standard constructor.


MTBContour2DSet

public MTBContour2DSet(double xMin,
                       double yMin,
                       double xMax,
                       double yMax)
Construct an empty set of contours with given extent of domain.

Parameters:
xMin - minimal x-coordinate of the domain
yMin - minimal y-coordinate of the domain
xMax - maximal x-coordinate of the domain
yMax - maximal y-coordinate of the domain
Method Detail

clone

public MTBContour2DSet clone()
Overrides:
clone in class Object

size

public int size()
Get the number of contours of this contour set

Returns:
Number of contours.

elementAt

public MTBContour2D elementAt(int i)
Get a contour by index.

Returns:
The i-th contour.

getXMin

public double getXMin()
Get the minimal x-coordinate of the domain of this contour set.

Returns:
Minimal x-coordinate.

getXMax

public double getXMax()
Get the maximal x-coordinate of the domain of this contour set.

Returns:
Maximal x-coordinate.

getYMin

public double getYMin()
Get the minimal y-coordinate of the domain of this contour set.

Returns:
Minimal y-coordinate.

getYMax

public double getYMax()
Get the maximal y-coordinate of the domain of this contour set.

Returns:
Maximal y-coordinate.

add

public boolean add(MTBContour2D contour)
Append a contour (at the end) to the set of contours.

Parameters:
contour - contour to add

setElementAt

public void setElementAt(MTBContour2D contour,
                         int i)
Set the i-th contour from the set.

Parameters:
contour - new contour element
i - index of the new contour

removeElementAt

public void removeElementAt(int i)
Delete the i-th contour from the set

Parameters:
i - index of contour to remove

read

public void read(String filename)
          throws IOException,
                 org.apache.xmlbeans.XmlException
Read a contour set from an xml file filename and set the MTB polygon set accordingly. The processing history is read also if available.

WARNING: currently assume filename WITHOUT extension.

Parameters:
filename - Filename to read from, WITHOUT extension (for the moment).
Throws:
IOException
org.apache.xmlbeans.XmlException

read

public void read(de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DSetType xmlContourSet)
          throws IOException,
                 org.apache.xmlbeans.XmlException
Read a contour set from an xml object xmlContourSet and set the MTB polygon set accordingly.

WARNING: currently assume filename WITHOUT extension.

Parameters:
filename - Filename to read from, WITHOUT extension (for the moment).
Throws:
IOException
org.apache.xmlbeans.XmlException

write

public void write(String filename)
           throws de.unihalle.informatik.Alida.exceptions.ALDException
Write this contour set into XML file filename.xml Additionally, its processing history is written.

WARNING: currently assume filename WITHOUT extension.

Parameters:
filename - Filename to write to, WITHOUT extension (for the moment)
Throws:
de.unihalle.informatik.Alida.exceptions.ALDException

toXMLType

public de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DSetType toXMLType()

getContour2DAsXml

public de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType getContour2DAsXml(MTBContour2D contour,
                                                                               de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType xmlC)
Copy the information of contour into the corresponding xml element xmlContour. If xmlContour is null, a new obejct is created, otherwise the passed object filled.


getContour2DFromXml

public MTBContour2D getContour2DFromXml(de.unihalle.informatik.MiToBo_xml.MTBXMLContour2DType xmlContour)
Get a new MTBContour2D from the information of the xmlContour.

Parameters:
xmlContour - xml contour object
Returns:
MTBContour2D object.


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