Package mgui.geometry

Class Graph3D

java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.Graph3D
All Implemented Interfaces:
java.lang.Cloneable, Shape, XMLObject

public class Graph3D
extends Shape3D
Represents a graph as a 3D geometric shape.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

  • Constructor Details

  • Method Details

    • getGraph

      public InterfaceAbstractGraph getGraph()
    • setGraph

      public void setGraph​(InterfaceAbstractGraph graph)
    • getVertices

      public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()
      Description copied from class: Shape3D
      Returns a list of this shape's nodes as Point3f's. This list is a copy, so operations performed on these nodes will not affect this shape.
      Specified by:
      getVertices in class Shape3D
      Returns:
    • getJungVertices

      public java.util.ArrayList<AbstractGraphNode> getJungVertices()
    • setVertices

      public void setVertices​(org.jogamp.vecmath.Point3f[] nodes)
      Overrides:
      setVertices in class Shape3D
    • setVertices

      public void setVertices​(java.util.ArrayList<org.jogamp.vecmath.Point3f> nodes)
      Specified by:
      setVertices in class Shape3D
    • getSize

      public int getSize()
      Description copied from class: Shape3D
      Returns the number of vertices in this shape. Subclasses can provide more efficient implementations.
      Specified by:
      getSize in interface Shape
      Overrides:
      getSize in class Shape3D
      Returns:
      the number of vertices
    • getCoords

      public float[] getCoords()
      Specified by:
      getCoords in interface Shape
      Specified by:
      getCoords in class Shape3D
    • setCoords

      public void setCoords​(float[] coords)
      Specified by:
      setCoords in interface Shape
      Specified by:
      setCoords in class Shape3D
    • getVertex

      public org.jogamp.vecmath.Point3f getVertex​(int index)
      Description copied from class: Shape3D
      Returns the vertex at the specified index as a Point3f. 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.

      Specified by:
      getVertex in class Shape3D
      Returns:
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Overrides:
      getLocalName in class Shape3D
      Returns:
    • handleXMLElementEnd

      public void handleXMLElementEnd​(java.lang.String localName) throws org.xml.sax.SAXException
      Description copied from interface: XMLObject
      Handles the end of an XML element.
      Specified by:
      handleXMLElementEnd in interface XMLObject
      Overrides:
      handleXMLElementEnd in class Shape3D
      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.SAXException
      Description copied from interface: XMLObject
      Handles the start of an XML element.
      Specified by:
      handleXMLElementStart in interface XMLObject
      Overrides:
      handleXMLElementStart in class Shape3D
      Parameters:
      localName - Local name of the element
      attributes - Set of element attributes
      type - The XMLType of this element
      Throws:
      org.xml.sax.SAXException
    • handleXMLString

      public void handleXMLString​(java.lang.String s) throws org.xml.sax.SAXException
      Description copied from interface: XMLObject
      Handles a string within an XML element.
      Specified by:
      handleXMLString in interface XMLObject
      Overrides:
      handleXMLString in class Shape3D
      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.IOException
      Description 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 of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Overrides:
      writeXML in class Shape3D
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException