Package mgui.interfaces.shapes
Class Mesh3DInt
java.lang.Object
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
,java.lang.Comparable<InterfaceShape>
,AttributeListener
,AttributeObject
,InterfaceObject
,PersistentObject
,VariableObject
,PopupMenuObject
,NamedObject
,InterfaceQueryObject
,InterfaceShapeQueryObject
,VertexDataColumnListener
,InterfaceTransferable
,TreeObject
,CleanableObject
,XMLObject
,IconObject
,org.jogamp.java3d.GeometryUpdater
- Direct Known Subclasses:
CorticalHemisphereSet3DInt
,CorticalSurfaceSet3DInt
public class Mesh3DInt extends PointSet3DInt
Interface for a Mesh3D shape.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from class mgui.interfaces.shapes.Shape3DInt
Shape3DInt.VertexShapeTransformer
Nested classes/interfaces inherited from class mgui.interfaces.shapes.InterfaceShape
InterfaceShape.VertexDataSet
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
Fields Modifier and Type Field Description protected org.jogamp.java3d.Appearance
edge_appearance
protected org.jogamp.java3d.Appearance
fill_appearance
Fields inherited from class mgui.interfaces.shapes.Shape3DInt
boundBox, boundBoxNode, bounds_group, bounds_shape, boundSphere, centerPt, children2D, creatable_scene_node, drawEngine2D, group_node, has_3d_node, hasCameraListener, idStr, nodeListener, parent2D, scene3DObject, sceneNode, selected_vertices_group, shape_group, shape3d, vertex_shape_transformer, vertices_group
Fields inherited from class mgui.interfaces.shapes.InterfaceShape
attributes, constraints, data_columns, icon, ID, is_auxiliary, is_registered, isDrawable, isImageShape, isLight, isOverridden, last_column_added, last_column_changed, last_column_removed, linked_colour_maps, loader_options, notifyListeners, overrideAttr, parent_set, selected_nodes, shapeListeners, vertex_data, writer_options, xml_current_column, xml_current_loader, xml_current_shape, xml_current_shape_options, xml_current_type, xml_current_url, xml_is_vertex_data, xml_root_dir
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
attributeUpdated(AttributeEvent e)
Responds to an update in one of this shape's attributes.java.lang.String
getAlphaMode()
boolean
getBackFlip()
int[]
getDimensions()
Returns the dimensions of this object as an array of integersjava.awt.Color
getFillColour()
Returns this shape's fill colourboolean
getFlipNormals()
Shape
getGeometryInstance()
Returns an instance of thisInterfaceShape
's geometry class.Attribute<?>
getInheritingAttribute(Attribute<?> attribute)
Returns the 2D attribute inheriting from a 3D attribute.java.lang.String
getLocalName()
Returns the local name associated with this XML object.Mesh3D
getMesh()
protected float
getPolygonOffset()
protected float
getPolygonOffsetFactor()
protected Shape2DInt
getShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)
To be overridden by subclasses implementing a 2D representationprotected org.jogamp.java3d.TransparencyAttributes
getTransparencyAttributes()
java.lang.String
getXML(int tab, XMLObject.XMLType type)
void
handlePopupEvent(java.awt.event.ActionEvent e)
Handles an event on this object's popup menu.boolean
isHeritableAttribute(java.lang.String name)
Is this parent attribute inherited by a child shape?boolean
needsRedraw(Attribute<?> a)
Returnstrue
if a change toattribute
will require a redraw of this shape.void
setBackFlip(boolean b)
protected void
setEdgeAppearance()
protected void
setFillAppearance()
void
setFlipNormals(boolean b)
void
setGraphic3DPopupMenu(InterfacePopupMenu menu)
Subclasses should override this if necessary and call super.getGraphic3DPopupMenu() to get this top-level menu and add items to it.protected void
setIcon()
void
setMesh(Mesh3D mesh)
void
setScene3DObject(boolean make_live)
return an IndexedTriangleArray object representing this mesh.void
setShape(Shape3D shape)
java.lang.String
toString()
Methods inherited from class mgui.interfaces.shapes.PointSet3DInt
appendPoints, appendPoints, getLabelAppearance, getPointSet, getVertexAlpha, getVertexAppearance, getVertexColour, getVerticesAsPoints, getVerticesAsSpheres
Methods inherited from class mgui.interfaces.shapes.Shape3DInt
addShape2DChild, clear2DChildren, contains, copyAttributes, crossesPlane, deregisterCameraListener, destroy, draw2D, drawShape2D, drawShape2D, drawShape2D, fireChildren2D, fireChildren2DModified, fireShapeListeners, fireShapeModified, geometryChanged, getAlpha, getBoundBox, getBoundBoxNode, getBoundSphere, getCameraListener, getCenterOfGravity, getClosestVertex, getDTD, getFullName, getGeometricCenter, getGeometry, getIcon, getLabelColour, getLabelFont, getLabelScale, getLineColour, getLineStyle, getModifiedAttribute, getParent2D, getParentAttribute, getPopupMenu, getPopupMenuLength, getProximity, getScene3DObject, getScene3DObject, getShape, getShape2D, getShape2DInt, getShape2DInt, getShapeSceneNode, getShapeSceneNode, getShortXML, getTransferData, getTransferDataFlavors, getTreeLabel, getVertex, getVertexColour, getVertexCount, getVertexScale, getVertexScale, getVertexSelection, getVertices, hasAlpha, hasAlpha, hasCameraListener, hasParentShape, init, isDataFlavorSupported, isInheritingAttribute, isLive, issueTreeNode, performTransfer, registerCameraListener, releaseScene3DChildren, removeShape2DChild, setAlpha, setBoundBoxNode, setCreatableSceneNode, setCurrentColumn, setGeometry, setLabelColour, setLabelFont, setLabelScale, setLineStyle, setLive, setParent2D, setScene3DObject, setSelectedVertices, setShapeSceneNode, setShowSelectedVertices, setVertexSelection, showPopupMenu, showVertices, showVertices, updateChildren2D, updateData, updateSelectedVertices, updateShape, updateVertices
Methods inherited from class mgui.interfaces.shapes.InterfaceShape
_init, addDataLink, addShapeListener, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, cleanTreeNodes, compareTo, finalizeAfterXML, fromVariable, getAllVertexData, getAttribute, getAttributes, getAttributeValue, getByReferenceUrls, getColourMap, getColourMap, getConstraint, getConstraints, getCurrentColumn, getCurrentDataColumn, getCurrentVertexData, getDataLink, getDataMax, getDataMin, getDatumAtVertex, getDatumAtVertex, getDefaultColourMap, getFileLoader, getFileWriter, getID, getInheritedAttribute, getInheritedAttributes, getInheritedAttributeValue, getLastColumnAdded, getLastColumnChanged, getLastColumnRemoved, getLegalName, getLinkedVertexData, getLinkedVertexDatum, getLoaderOptions, getModel, getName, getNameMap, getNameMap, getNonLinkedDataColumns, getObjectIcon, getParentSet, getPopupMenu, getSourceURL, getUnit, getUrlReference, getVariables, getVariableType, getVariableValue, getVariableValues, getVertexData, getVertexData, getVertexDataColumn, getVertexDataColumnCount, getVertexDataColumnNames, getVertexDataColumns, getVertexDataMap, getWriterOptions, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, hasAttribute, hasColumn, hasData, inheritAttributesFromParent, isAuxiliaryShape, isAuxiliaryShape, isDestroyed, isDrawable, isImageShape, isLegalName, isLight, isSelectable, isVisible, newVertexData, queryObject, queryShapeAtVertex, register, removeColourMap, removeDataLink, removeNameMap, removeShapeListener, removeVertexData, renameVertexDataColumn, setAttribute, setAttributes, setColourMap, setColourMap, setConstraint, setCurrentColumn, setDataMax, setDataMax, setDataMax, setDataMin, setDataMin, setDataMin, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDefaultColourMap, setDefaultColourMap, setFileLoader, setFileLoader, setFileWriter, setID, setLoaderOptions, setName, setNameMap, setOverride, setParentSet, setSelectable, setTreeNode, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVertexDataMap, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, unsetOverride, updateDataColumns, vertexDataColumnChanged, vertexDataColumnColourMapChanged, writeXML, writeXML, writeXML
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, updateTreeNodes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface mgui.interfaces.util.CleanableObject
clean
-
Field Details
-
fill_appearance
protected org.jogamp.java3d.Appearance fill_appearance -
edge_appearance
protected org.jogamp.java3d.Appearance edge_appearance
-
-
Constructor Details
-
Mesh3DInt
public Mesh3DInt() -
Mesh3DInt
-
Mesh3DInt
-
-
Method Details
-
getFillColour
public java.awt.Color getFillColour()Returns this shape's fill colour- Returns:
-
getGeometryInstance
Description copied from class:InterfaceShape
Returns an instance of thisInterfaceShape
's geometry class.- Overrides:
getGeometryInstance
in classPointSet3DInt
- Returns:
-
setIcon
protected void setIcon()- Overrides:
setIcon
in classPointSet3DInt
-
getAlphaMode
public java.lang.String getAlphaMode() -
getFlipNormals
public boolean getFlipNormals() -
setFlipNormals
public void setFlipNormals(boolean b) -
getBackFlip
public boolean getBackFlip() -
setBackFlip
public void setBackFlip(boolean b) -
setShape
- Overrides:
setShape
in classShape3DInt
-
setScene3DObject
public void setScene3DObject(boolean make_live)return an IndexedTriangleArray object representing this mesh. Mesh must be finalized with Mesh3D.finalize()- Overrides:
setScene3DObject
in classPointSet3DInt
-
getShape2D
protected Shape2DInt getShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)Description copied from class:Shape3DInt
To be overridden by subclasses implementing a 2D representation- Overrides:
getShape2D
in classPointSet3DInt
- Parameters:
plane
- Plane on which to renderabove_dist
- Distance above plane within which to project a shapebelow_dist
- Distance below plane within which to project a shape- Returns:
-
isHeritableAttribute
public boolean isHeritableAttribute(java.lang.String name)Description copied from class:InterfaceShape
Is this parent attribute inherited by a child shape?- Overrides:
isHeritableAttribute
in classShape3DInt
- Returns:
-
getInheritingAttribute
Description copied from class:Shape3DInt
Returns the 2D attribute inheriting from a 3D attribute. Use when InheritFromParent=true. Subclasses should override this method if certain 3D attributes are not intended to be inherited (e.g., vertex scales).- Overrides:
getInheritingAttribute
in classShape3DInt
- Returns:
- The inheriting attribute, or
null
if attribute is not heritable
-
getMesh
-
setMesh
-
toString
public java.lang.String toString()- Overrides:
toString
in classPointSet3DInt
-
attributeUpdated
Description copied from class:Shape3DInt
Responds to an update in one of this shape's attributes.Subclasses should override and call this super method AFTER handling the attribute change appropriately. Subclasses should also override needsRedraw() to indicate whether the scene node should be regenerated.
- Specified by:
attributeUpdated
in interfaceAttributeListener
- Overrides:
attributeUpdated
in classPointSet3DInt
- Parameters:
e
- anAttributeEvent
specifying which attribute has been changed
-
setFillAppearance
protected void setFillAppearance() -
getTransparencyAttributes
protected org.jogamp.java3d.TransparencyAttributes getTransparencyAttributes() -
getPolygonOffset
protected float getPolygonOffset() -
getPolygonOffsetFactor
protected float getPolygonOffsetFactor() -
setEdgeAppearance
protected void setEdgeAppearance() -
needsRedraw
Description copied from class:InterfaceShape
Returnstrue
if a change toattribute
will require a redraw of this shape.- Overrides:
needsRedraw
in classPointSet3DInt
- Returns:
-
getDimensions
public int[] getDimensions()Description copied from interface:VariableObject
Returns the dimensions of this object as an array of integers- Specified by:
getDimensions
in interfaceVariableObject
- Overrides:
getDimensions
in classPointSet3DInt
- Returns:
- the dimensions of this object
-
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 classPointSet3DInt
- Returns:
-
getXML
- Overrides:
getXML
in classPointSet3DInt
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObject
Handles an event on this object's popup menu.- Specified by:
handlePopupEvent
in interfacePopupMenuObject
- Overrides:
handlePopupEvent
in classShape3DInt
-