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 InterfaceAbstractGraph
graph
Fields 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()
InterfaceAbstractGraph
getGraph()
java.util.ArrayList<AbstractGraphNode>
getJungVertices()
java.lang.String
getLocalName()
Returns the local name associated with this XML object.int
getSize()
Returns the number of vertices in this shape.org.jogamp.vecmath.Point3f
getVertex(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.void
handleXMLElementEnd(java.lang.String localName)
Handles the end of an XML element.void
handleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
Handles the start of an XML element.void
handleXMLString(java.lang.String s)
Handles a string within an XML element.void
setCoords(float[] coords)
void
setGraph(InterfaceAbstractGraph graph)
void
setVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)
void
setVertices(org.jogamp.vecmath.Point3f[] nodes)
void
writeXML(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, writeXML
Methods 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:Shape3D
Returns 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:
getVertices
in classShape3D
- Returns:
-
getJungVertices
-
setVertices
public void setVertices(org.jogamp.vecmath.Point3f[] nodes)- Overrides:
setVertices
in classShape3D
-
setVertices
public void setVertices(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)- Specified by:
setVertices
in classShape3D
-
getSize
public int getSize()Description copied from class:Shape3D
Returns 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:Shape3D
Returns 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:XMLObject
Returns the local name associated with this XML object.- Specified by:
getLocalName
in interfaceXMLObject
- Overrides:
getLocalName
in classShape3D
- Returns:
-
handleXMLElementEnd
public void handleXMLElementEnd(java.lang.String localName) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObject
Handles the end of an XML element.- Specified by:
handleXMLElementEnd
in interfaceXMLObject
- Overrides:
handleXMLElementEnd
in 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:XMLObject
Handles the start of an XML element.- Specified by:
handleXMLElementStart
in interfaceXMLObject
- Overrides:
handleXMLElementStart
in classShape3D
- Parameters:
localName
- Local name of the elementattributes
- Set of element attributestype
- TheXMLType
of this element- Throws:
org.xml.sax.SAXException
-
handleXMLString
public void handleXMLString(java.lang.String s) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObject
Handles a string within an XML element.- Specified by:
handleXMLString
in interfaceXMLObject
- Overrides:
handleXMLString
in 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:XMLObject
Writes 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.Ascii
will be used.- Specified by:
writeXML
in interfaceXMLObject
- Overrides:
writeXML
in 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
-