|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDData
de.unihalle.informatik.MiToBo.core.datatypes.MTBPolygon2DSet
@ALDParametrizedClass public class MTBPolygon2DSet
Data type to represent a set of MTBPolygon2D
.
A set of 2D polygons lives in a common domain which is a rectangular subset
of R x R. Each polygon is of type Polygon2D or a subclass. For reading and
writing the derived class MTBSnake
is handled in addition to
MTBPolygon2D
.
Constructor Summary | |
---|---|
MTBPolygon2DSet()
Standard constructor |
|
MTBPolygon2DSet(double _xMin,
double _yMin,
double _xMax,
double _yMax)
Construct an empty set of polygons with given extent of domain. |
|
MTBPolygon2DSet(Vector<MTBPolygon2D> _polys,
double _xMin,
double _yMin,
double _xMax,
double _yMax)
Construct polygon set from given vector. |
Method Summary | |
---|---|
boolean |
add(MTBPolygon2D polygon)
Append a polygon (at the end) to the set of polygons. |
MTBPolygon2DSet |
clone()
|
MTBPolygon2D |
elementAt(int i)
Get a polygon by index. |
de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType |
getPolygon2DAsXml(MTBPolygon2D polygon,
de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType xmlPolygon)
Copy the information of polygon into the corresponding xml
element xmlPolygon . |
MTBPolygon2D |
getPolygon2DFromXml(de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType xmlPolygon)
* Get a new Polygon2D from the information of the
xmlPolygon . |
de.unihalle.informatik.MiToBo_xml.MTBXMLSnakeType |
getSnakeAsXml(MTBSnake snake,
de.unihalle.informatik.MiToBo_xml.MTBXMLSnakeType xmlSnake)
Copy the information of snake into the corresponding xml
element xmlSnake . |
double |
getXmax()
Returns maximal x coordinate of the domain. |
double |
getXmin()
Returns minimal x coordinate of the domain. |
double |
getYmax()
Returns maximal x coordinate of the domain. |
double |
getYmin()
Returns minimal y coordinate of the domain. |
void |
read(de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DSetType xmlPolygon2DSet)
Read a polygon set from an xml object xmlPolygon2DSet and set the MTB
polygon set accordingly. |
void |
read(String filename)
Read a polygon set from an xml file filename and set the MTB
polygon set accordingly. |
void |
setElementAt(int i,
MTBPolygon2D poly)
Set a polygon at i-th position of the set. |
int |
size()
Get the number of polygons of this polygon set. |
String |
toString()
|
de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DSetType |
toXMLType()
Create a xml representation of this polygon set using MiToBo's xml-scheme MTBXMLPolygon2DSet.xsd |
void |
write(String filename)
Write this polygon set as xml into file filename.xml
Additionally the processing history is written. |
void |
write(String filename,
boolean writeHistory)
Write this polygon set as xml into file filename If flag is
set to true, the processing history is written, too. |
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, wait, wait, wait |
Constructor Detail |
---|
public MTBPolygon2DSet()
public MTBPolygon2DSet(double _xMin, double _yMin, double _xMax, double _yMax)
_xMin
- minimum value of x-coordinates for the set_yMin
- minimum value of y-coordinates for the set_xMax
- maximum value of x-coordinates for the set_yMax
- maximum value of y-coordinates for the setpublic MTBPolygon2DSet(Vector<MTBPolygon2D> _polys, double _xMin, double _yMin, double _xMax, double _yMax)
_polys
- set of polygons_xMin
- minimum value of x-coordinates for the set_yMin
- minimum value of y-coordinates for the set_xMax
- maximum value of x-coordinates for the set_yMax
- maximum value of y-coordinates for the setMethod Detail |
---|
public MTBPolygon2DSet clone()
clone
in class Object
public double getXmin()
public double getXmax()
public double getYmin()
public double getYmax()
public int size()
public MTBPolygon2D elementAt(int i)
public void setElementAt(int i, MTBPolygon2D poly)
i
- positionpoly
- polygon object to set at position ipublic boolean add(MTBPolygon2D polygon)
polygon
- Polygon to add.public void read(String filename) throws IOException, org.apache.xmlbeans.XmlException, ClassNotFoundException
filename
and set the MTB
polygon set accordingly. The processing history is read also if available.
WARNING: currently assume filename WITHOUT extension.
filename
- Filename to read from, WITHOUT extension (for the moment).
IOException
org.apache.xmlbeans.XmlException
ClassNotFoundException
public void read(de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DSetType xmlPolygon2DSet) throws ClassNotFoundException
xmlPolygon2DSet
and set the MTB
polygon set accordingly.
WARNING: currently assume filename WITHOUT extension.
filename
- Filename to read from, WITHOUT extension (for the moment).
ClassNotFoundException
public MTBPolygon2D getPolygon2DFromXml(de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType xmlPolygon) throws ClassNotFoundException
Polygon2D
from the information of the
xmlPolygon
. Returns Polygon2D and Snake type polygons as
appropriate.
xmlPolygon
- polygon object stored in the xmlPolygon
ClassNotFoundException
public void write(String filename) throws de.unihalle.informatik.Alida.exceptions.ALDException
filename.xml
Additionally the processing history is written.
WARNING: currently assume filename WITHOUT extension.
filename
- Filename to write to, WITHOUT extension (for the moment)
de.unihalle.informatik.Alida.exceptions.ALDException
public void write(String filename, boolean writeHistory) throws de.unihalle.informatik.Alida.exceptions.ALDException
filename
If flag is
set to true, the processing history is written, too.
filename
- Filename to write to.writeHistory
- If true, the history is written as well.
de.unihalle.informatik.Alida.exceptions.ALDException
public de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DSetType toXMLType() throws ClassNotFoundException
ClassNotFoundException
- if the class of the polygons in the set are not known to the implementation
(rather an unknown extending class)public de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType getPolygon2DAsXml(MTBPolygon2D polygon, de.unihalle.informatik.MiToBo_xml.MTBXMLPolygon2DType xmlPolygon)
polygon
into the corresponding xml
element xmlPolygon
. If xmlPolygon
is null, a new
object is created, otherwise the passed object filled.
public de.unihalle.informatik.MiToBo_xml.MTBXMLSnakeType getSnakeAsXml(MTBSnake snake, de.unihalle.informatik.MiToBo_xml.MTBXMLSnakeType xmlSnake)
snake
into the corresponding xml
element xmlSnake
. If xmlSnake
is null, a new
obejct is created, otherwise the passed object filled.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |