Package mgui.geometry
Class Graph3D
java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.Graph3D
public class Graph3D extends Shape3D
Represents a graph as a 3D geometric shape.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected InterfaceAbstractGraphgraphFields inherited from class mgui.geometry.Shape3D
xml_count, xml_current_block, xml_encoding, xml_itr, xml_vertices -
Constructor Summary
Constructors Constructor Description Graph3D()Graph3D(InterfaceAbstractGraph graph)Graph3D(InterfaceAbstractGraph graph, java.util.HashMap<AbstractGraphNode,org.jogamp.vecmath.Point3f> nodes) -
Method Summary
Modifier and Type Method Description float[]getCoords()InterfaceAbstractGraphgetGraph()java.util.ArrayList<AbstractGraphNode>getJungVertices()java.lang.StringgetLocalName()Returns the local name associated with this XML object.intgetSize()Returns the number of vertices in this shape.org.jogamp.vecmath.Point3fgetVertex(int index)Returns the vertex at the specified index as aPoint3f.java.util.ArrayList<org.jogamp.vecmath.Point3f>getVertices()Returns a list of this shape's nodes asPoint3f's.voidhandleXMLElementEnd(java.lang.String localName)Handles the end of an XML element.voidhandleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)Handles the start of an XML element.voidhandleXMLString(java.lang.String s)Handles a string within an XML element.voidsetCoords(float[] coords)voidsetGraph(InterfaceAbstractGraph graph)voidsetVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)voidsetVertices(org.jogamp.vecmath.Point3f[] nodes)voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.Methods inherited from class mgui.geometry.Shape3D
clone, contains, getBoundBox, getCenter, getDTD, getProximity, getProximityPoint, getShortXML, getXML, getXML, getXMLSchema, loadAsciiCoords, loadBinaryCoords, loadCoords, loadXMLCoord, transform, transform, writeAsciiCoords, writeBinaryCoords, writeCoords, writeXML, writeXMLMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
graph
-
-
Constructor Details
-
Graph3D
public Graph3D() -
Graph3D
-
Graph3D
public Graph3D(InterfaceAbstractGraph graph, java.util.HashMap<AbstractGraphNode,org.jogamp.vecmath.Point3f> nodes)
-
-
Method Details
-
getGraph
-
setGraph
-
getVertices
public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()Description copied from class:Shape3DReturns a list of this shape's nodes asPoint3f's. This list is a copy, so operations performed on these nodes will not affect this shape.- Specified by:
getVerticesin classShape3D- Returns:
-
getJungVertices
-
setVertices
public void setVertices(org.jogamp.vecmath.Point3f[] nodes)- Overrides:
setVerticesin classShape3D
-
setVertices
public void setVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)- Specified by:
setVerticesin classShape3D
-
getSize
public int getSize()Description copied from class:Shape3DReturns the number of vertices in this shape. Subclasses can provide more efficient implementations. -
getCoords
public float[] getCoords() -
setCoords
public void setCoords(float[] coords) -
getVertex
public org.jogamp.vecmath.Point3f getVertex(int index)Description copied from class:Shape3DReturns the vertex at the specified index as aPoint3f. This vertex is a copy, so operations performed on it will not affect this shape.Note: subclasses may want to provide a more efficient implementation of this method.
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Overrides:
getLocalNamein classShape3D- Returns:
-
handleXMLElementEnd
public void handleXMLElementEnd(java.lang.String localName) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObjectHandles the end of an XML element.- Specified by:
handleXMLElementEndin interfaceXMLObject- Overrides:
handleXMLElementEndin classShape3D- Parameters:
localName- Local name of the element- Throws:
org.xml.sax.SAXException
-
handleXMLElementStart
public void handleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObjectHandles the start of an XML element.- Specified by:
handleXMLElementStartin interfaceXMLObject- Overrides:
handleXMLElementStartin classShape3D- Parameters:
localName- Local name of the elementattributes- Set of element attributestype- TheXMLTypeof this element- Throws:
org.xml.sax.SAXException
-
handleXMLString
public void handleXMLString(java.lang.String s) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObjectHandles a string within an XML element.- Specified by:
handleXMLStringin interfaceXMLObject- Overrides:
handleXMLStringin classShape3D- Parameters:
s- String to handle- Throws:
org.xml.sax.SAXException
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format ofXMLFormat.Asciiwill be used.- Specified by:
writeXMLin interfaceXMLObject- Overrides:
writeXMLin classShape3D- Parameters:
tab- The number of tabs to place before the XML textwriter- The writeroptions- XMLOutputOptions defining the write parametersprogress_bar- Optional progress updater (may benull)- Throws:
java.io.IOException
-