Package mgui.interfaces.shapes
Class VolumeSet3DInt
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.shapes.InterfaceShape
mgui.interfaces.shapes.Shape3DInt
mgui.interfaces.shapes.Volume3DInt
mgui.interfaces.shapes.VolumeSet3DInt
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
,java.lang.Comparable<InterfaceShape>
,AttributeListener
,AttributeObject
,InterfaceObject
,PersistentObject
,ColourMapListener
,VariableObject
,PopupMenuObject
,NamedObject
,InterfaceQueryObject
,InterfaceShapeQueryObject
,ShapeListener
,VertexDataColumnListener
,InterfaceTransferable
,TreeObject
,CleanableObject
,XMLObject
,IconObject
,org.jogamp.java3d.GeometryUpdater
,org.jogamp.java3d.ImageComponent3D.Updater
public class VolumeSet3DInt extends Volume3DInt implements ShapeListener
A set of
Volume3DInt
objects which render as an overlay image. This class extends Volume3DInt
and inherits its behaviour; it is specified as a stack of images with given image and geometric dimensions, and
samples from its member volumes within its bounding box to compose an overlay image. Anything outside the bounding
box is not rendered.
Overlays are determined by:
- An ordered list of member volumes
- 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 inherited from class mgui.interfaces.shapes.Volume3DInt
apply_mask, box_node, colour_models, composite_alphas, composite_column_order, dataFile, group_node, intRect3D, loader, masks, render_node, renderer, show_in_composite, textureSet, updater, xml_composite_alphas, xml_composite_column_order, xml_is_reading_composite_order, xml_is_reading_header, xml_show_in_composite
Fields inherited from class mgui.interfaces.shapes.Shape3DInt
boundBox, boundBoxNode, bounds_group, bounds_shape, boundSphere, centerPt, children2D, creatable_scene_node, drawEngine2D, 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
Constructors Constructor Description VolumeSet3DInt()
VolumeSet3DInt(Grid3D grid)
-
Method Summary
Modifier and Type Method Description void
addVolume(int index, float alpha, Volume3DInt volume, boolean update)
Addsvolume
at positionindex
of this overlay set, with givenalpha
level, and redraws the overlay.void
addVolume(Volume3DInt volume, float alpha, boolean update)
Addsvolume
to top of this overlay set, with givenalpha
level, and redraws the overlay.java.awt.image.BufferedImage[]
generateComposites()
This method updates the overlay compositeGrid3D
by sampling from all members and applying their transparency levels.float
getAlpha(int i)
Gets the transparency for the i'th volumeVolume3DInt
getMember(int i)
Gets the i'th member in this setint
getMemberCount()
java.util.ArrayList<Volume3DInt>
getMembers()
Gets a list of this set's membersprotected java.awt.image.BufferedImage
getSampledImage(java.awt.image.BufferedImage sample_image)
Returns an image having a colour model with typeBufferedImage.TYPE_INT_ARGB
, with colours set fromimage
's colour model.void
removeVolume(java.lang.String name, boolean update)
Removes the first volume having namename
from this set.void
removeVolume(Volume3DInt volume, boolean update)
Removes the given volume (actually the first volume having the identical name) from this set.void
setAlpha(int i, float alpha)
Sets the transparency for the i'th volume in this set.void
setScene3DObject(boolean make_live)
Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes.void
setTreeNode(InterfaceTreeNode treeNode)
Constructs a tree node from this shape.void
shapeUpdated(ShapeEvent e)
A shape that this object is listening to has been updated.Methods inherited from class mgui.interfaces.shapes.Volume3DInt
addMask, addMask, addVertexData, addVertexData, addVertexData, applyMask, attributeUpdated, clearMask, colourMapChanged, deregisterCameraListener, getApplyMasks, getBox, getCameraListener, getCenterOfVoxel, getClosestVertex, getColourModel, getColourModel, getCompositeAlpha, getCompositeOrderedColumns, getDataType, getDataType, getDatumAtPoint, getDatumAtPoint, getDatumAtVoxel, getDatumAtVoxel, getDatumAtVoxel, getDatumAtVoxel, getEffectiveMask, getGeometryInstance, getGrid, getInterpolatedValueAtPoint, getInterpolatedValueAtPoint, getInterpolatedValueAtPoint, getInterpolatedValueAtPoint, getMapMax, getMapMin, getMask, getMaskNames, getMasks, getRenderMode, getShape2D, getTexture, getVertexIndex, getVertexIndex, handleXMLElementEnd, handleXMLElementStart, hasAlpha, hasAlpha, hasAlpha, init, invertMask, isByRef, isComposite, isComposite, isComposite, isMaskApplied, isMaskedAtPoint, isMaskedAtVoxel, isMaskedAtVoxel, registerCameraListener, removeMask, removeVertexData, renameVertexDataColumn, sampleFromVolume, sampleFromVolume, sampleFromVolume, sampleFromVolume, setAllMasks, setApplyMasks, setBounds, setCompositeAlpha, setCompositeAlpha, setCompositeIndex, setCompositeIndex, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setDatumAtVoxel, setGrid, setGrid, setIcon, setMapMax, setMapMin, setMask, setMask, setMaskApplied, setParentSet, setRenderMode, setTexture, setTexture, setUpdater, showInComposite, showInComposite, showInComposite, toString, unionMask, unionMaskWithVolume, unionMaskWithVolume, update, updateData, updateDataColumns, updateSceneNode, updateShape, updateTexture, updateTextureColourMap, updateTextureValues, vertexDataColumnChanged, vertexDataColumnColourMapChanged, writeFullXML, writeXML
Methods inherited from class mgui.interfaces.shapes.Shape3DInt
addShape2DChild, clear2DChildren, contains, copyAttributes, crossesPlane, destroy, draw2D, drawShape2D, drawShape2D, drawShape2D, fireChildren2D, fireChildren2DModified, fireShapeListeners, fireShapeModified, geometryChanged, getAlpha, getBoundBox, getBoundBoxNode, getBoundSphere, getCenterOfGravity, getDimensions, getDTD, getFullName, getGeometricCenter, getGeometry, getIcon, getInheritingAttribute, getLabelColour, getLabelFont, getLabelScale, getLineColour, getLineStyle, getLocalName, getModifiedAttribute, getParent2D, getParentAttribute, getPopupMenu, getPopupMenuLength, getProximity, getScene3DObject, getScene3DObject, getShape, getShape2D, getShape2DInt, getShape2DInt, getShapeSceneNode, getShapeSceneNode, getShortXML, getTransferData, getTransferDataFlavors, getTreeLabel, getVertex, getVertexAppearance, getVertexColour, getVertexColour, getVertexCount, getVertexScale, getVertexScale, getVertexSelection, getVertices, handlePopupEvent, hasCameraListener, hasParentShape, isDataFlavorSupported, isHeritableAttribute, isInheritingAttribute, isLive, issueTreeNode, needsRedraw, performTransfer, releaseScene3DChildren, removeShape2DChild, setAlpha, setBoundBoxNode, setCreatableSceneNode, setCurrentColumn, setGeometry, setGraphic3DPopupMenu, setLabelColour, setLabelFont, setLabelScale, setLineStyle, setLive, setParent2D, setScene3DObject, setSelectedVertices, setShape, setShapeSceneNode, setShowSelectedVertices, setVertexSelection, showPopupMenu, showVertices, showVertices, updateChildren2D, updateData, updateSelectedVertices, updateVertices
Methods inherited from class mgui.interfaces.shapes.InterfaceShape
_init, addDataLink, addShapeListener, 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, getXML, getXMLSchema, handleXMLString, hasAttribute, hasColumn, hasData, inheritAttributesFromParent, isAuxiliaryShape, isAuxiliaryShape, isDestroyed, isDrawable, isImageShape, isLegalName, isLight, isSelectable, isVisible, newVertexData, queryObject, queryShapeAtVertex, register, removeColourMap, removeDataLink, removeNameMap, removeShapeListener, 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, setSelectable, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVertexDataMap, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, unsetOverride, 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
Methods inherited from interface mgui.interfaces.shapes.util.ShapeListener
destroy, isDestroyed
-
Constructor Details
-
VolumeSet3DInt
public VolumeSet3DInt() -
VolumeSet3DInt
-
-
Method Details
-
getMembers
Gets a list of this set's members- Returns:
-
getMember
Gets the i'th member in this set- Parameters:
i
-- Returns:
-
getMemberCount
public int getMemberCount() -
addVolume
Addsvolume
to top of this overlay set, with givenalpha
level, and redraws the overlay.- Parameters:
volume
-alpha
-update
-
-
addVolume
Addsvolume
at positionindex
of this overlay set, with givenalpha
level, and redraws the overlay. Preventsvolume
from creating its own scene nodes using thecreatable_scene_node
flag.- Parameters:
index
- The position of this volume in the set; negative adds to the topalpha
- The transparency of this volume in the overlayvolume
-update
-
-
removeVolume
Removes the given volume (actually the first volume having the identical name) from this set.- Parameters:
volume
-update
-
-
removeVolume
public void removeVolume(java.lang.String name, boolean update)Removes the first volume having namename
from this set.- Parameters:
volume
-update
-
-
setScene3DObject
public void setScene3DObject(boolean make_live)Description copied from class:Shape3DInt
Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes. This node should be retrieved using theShape3DInt.getShapeSceneNode()
method. A scene node will only created if one of these conditions is met:- The shape is auxiliary (i.e., not a model shape, but a helper shape such as a section polygon)
- The shape is associated with a ShapeModel3D, and this model is live (is associated with at least one Java3D scene graph).
- Overrides:
setScene3DObject
in classVolume3DInt
-
setAlpha
public void setAlpha(int i, float alpha)Sets the transparency for the i'th volume in this set.- Parameters:
i
-
-
getAlpha
public float getAlpha(int i)Gets the transparency for the i'th volume- Parameters:
i
-- Returns:
-
generateComposites
public java.awt.image.BufferedImage[] generateComposites()This method updates the overlay compositeGrid3D
by sampling from all members and applying their transparency levels.- Returns:
- A stack of composite images
-
getSampledImage
protected java.awt.image.BufferedImage getSampledImage(java.awt.image.BufferedImage sample_image)Returns an image having a colour model with typeBufferedImage.TYPE_INT_ARGB
, with colours set fromimage
's colour model.- Parameters:
image
-c_model
-- Returns:
-
shapeUpdated
Description copied from interface:ShapeListener
A shape that this object is listening to has been updated. The specific type of event is defined by ShapeEvent.EventType.- Specified by:
shapeUpdated
in interfaceShapeListener
- Overrides:
shapeUpdated
in classVolume3DInt
-
setTreeNode
Constructs a tree node from this shape. Adds anAttributeTreeNode
via the super method, and also adds a node to display the vertex-wise data columns associated with this ShapeInt.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classInterfaceShape
- Parameters:
treeNode
- node to construct
-