Class ShapeSet3DInt
- All Implemented Interfaces:
java.awt.datatransfer.Transferable
,java.lang.Comparable<InterfaceShape>
,AttributeListener
,AttributeObject
,InterfaceGraphicListener
,InterfaceObject
,PersistentObject
,VariableObject
,PopupMenuObject
,NamedObject
,InterfaceQueryObject
,InterfaceShapeQueryObject
,ShapeSet
,ShapeListener
,VertexDataColumnListener
,InterfaceTransferable
,TreeObject
,CleanableObject
,XMLObject
,IconObject
,org.jogamp.java3d.GeometryUpdater
public class ShapeSet3DInt extends Shape3DInt implements ShapeSet, InterfaceGraphicListener
Shape3DInt
objects. This class is itself a descendant of Shape3DInt
,
which means it inherits much of its behaviour and attributes, and can be added to another ShapeSet3DInt
.
Shapes added to a shape set inherit its spatial unit; thus, all shapes in a set must be defined in the same unit.
See Development Notes: Shape Sets for a more detailed description.
TODO: Also implement and enforce set-wide coordinate systems
- 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 InterfaceGraphic2D
last_section_added
protected InterfaceGraphic2D
last_section_removed
java.util.ArrayList<Shape3DInt>
members
ShapeModel3D
model
protected java.util.ArrayList<Camera3D>
registered_cameras
protected java.util.HashMap<InterfaceGraphic2D,Polygon3DInt>
section_polygons
protected org.jogamp.java3d.BranchGroup
sections_node
org.jogamp.java3d.SharedGroup
sharedNode
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
Constructors Constructor Description ShapeSet3DInt()
ShapeSet3DInt(java.lang.String name)
-
Method Summary
Modifier and Type Method Description void
activateClip(org.jogamp.java3d.ModelClip clip)
Adds this model to the scopes of the current clip nodesboolean
addShape(InterfaceShape shape)
Addsshape
to this set, updates it, and fires this set's listeners.boolean
addShape(Shape3DInt thisShape, boolean update)
Addsshape
to this set.boolean
addShape(Shape3DInt shape, boolean updateShape, boolean updateListeners)
Addsshape
to this set.boolean
addShape(Shape3DInt thisShape, int index, boolean update)
Addsshape
to this set atindex
.boolean
addShape(Shape3DInt shape, int index, boolean updateShape, boolean updateListeners)
Addsshape
to this shape set.void
addShapes(java.util.ArrayList<Shape3DInt> shapes)
void
addShapes(java.util.ArrayList<Shape3DInt> shapes, boolean update, boolean listeners)
Add multiple shapes to this set.int
addUnionSet(ShapeSet3DInt thisSet, boolean update)
int
addUnionSet(ShapeSet3DInt thisSet, boolean updateShapes, boolean updateListeners)
boolean
addWindow(InterfaceGraphic2D window)
void
applyOverride()
Applies this set's attributes to all members.void
attributeUpdated(AttributeEvent e)
Responds to an update in one of this shape's attributes.void
clearWindows()
void
deregisterCamera(Camera3D c)
void
deregisterCameras(java.util.ArrayList<Camera3D> cameras)
void
destroy()
Destroy this object (prepare it to be removed from memory)protected void
destroySectionNode(InterfaceGraphic2D window)
void
drawMember(int index, java.awt.Graphics2D g, DrawingEngine d)
void
drawShape(java.awt.Graphics2D g, DrawingEngine d)
protected void
fireShapeListeners(ShapeEvent e)
java.util.ArrayList<Shape3DInt>
get3DShapes(boolean recurse)
Returns all 3D shapes in this shape set; ifrecurse
isfalse
, limits this list to the set's members; otherwise, also adds all members of all subsets (along with the sets themselves).java.util.List<java.lang.String>
getByReferenceUrls()
Returns a list of URL strings for the latest call to writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater).org.jogamp.vecmath.Point3f
getCenterPoint()
Returns the center point of this shape set.int
getIndexOf(InterfaceShape shape)
Returns the index ofshape
in this set.InterfaceShape
getLastAdded()
int
getLastInsert()
InterfaceShape
getLastInserted()
InterfaceShape
getLastModified()
InterfaceShape
getLastMoved()
InterfaceShape
getLastRemoved()
InterfaceGraphic2D
getLastSectionAdded()
InterfaceGraphic2D
getLastSectionRemoved()
java.lang.String
getLocalName()
Returns the local name associated with this XML object.Shape3DInt
getMember(int i)
Returns thei
th member of this setjava.util.ArrayList<InterfaceShape>
getMembers()
Returns a copy of this set's member list.java.util.ArrayList<InterfaceShape>
getMembers(boolean recursive)
Returns a copy of this set's member list.ShapeModel3D
getModel()
protected java.util.ArrayList<org.jogamp.vecmath.Point3f>
getNodes(boolean recurse)
Returns a list of all nodes of all members in this set.InterfacePopupMenu
getPopupMenu()
Produces and returns a popup menu for this object.org.jogamp.java3d.BranchGroup
getScene3DObject(ShapeSelectionSet selSet)
java.util.ArrayList<InterfaceGraphic2D>
getSectionWindows()
Shape3DInt
getShape(int i)
Returns thei
th member of this setShape3DInt
getShape(java.lang.String name)
Searches this set for a shape namedname
and returns the first instance found.Shape3DInt
getShape(java.lang.String name, boolean recurse)
Searches this set for a shape namedname
and returns the first instance found.protected Shape2DInt
getShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)
To be overridden by subclasses implementing a 2D representationShape2DInt
getShape2DInt(Plane3D plane, float above_dist, float below_dist, boolean listen)
Determines a 2D shape which is the projection of this 3D shape ontoplane
, within the projection limits defined byabove_dist
andbelow_dist
.int
getShapeCount()
java.util.Set<InterfaceShape>
getShapeSet()
java.util.List<Shape3DInt>
getShapeType(Shape3DInt thisShape)
java.util.List<Shape3DInt>
getShapeType(Shape3DInt thisShape, boolean recurse)
int
getSize()
Returns the number of shapes in this setjava.util.Set<ShapeSet>
getSubSets()
java.awt.datatransfer.DataFlavor[]
getTransferDataFlavors()
protected java.lang.String
getUniqueName(java.lang.String name)
Finds a unique name by iteratively adding numbers to the end ofname
.java.util.ArrayList<org.jogamp.vecmath.Point3f>
getVertices()
Returns a list of all nodes of all members in this set, including all shapes in all subsets.java.lang.String
getXML(int tab, XMLObject.XMLType type)
void
graphicSourceChanged(GraphicEvent e)
void
graphicUpdated(GraphicEvent e)
void
handlePopupEvent(java.awt.event.ActionEvent e)
Handles an event on this object's popup menu.boolean
hasShape(java.lang.String name)
Determines whether a shape with the namename
is in this set.boolean
hasShape(java.lang.String name, boolean recurse)
Determines whether a shape with the namename
is in this set.boolean
hasShape(InterfaceShape s)
Determines whethershape
is in this set.boolean
hasShape(InterfaceShape shape, boolean recurse)
Determines whethershape
is in this set.boolean
hasWindow(InterfaceGraphic2D window)
protected void
init()
boolean
isAncestorSet(ShapeSet set)
Determines whetherset
is an ancestor of this set.boolean
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
boolean
isOverriding()
Query whether this set is currently overriding its members' attributes.boolean
isShape()
boolean
isVisible(int i)
Determines whether thei
th member of this set is visiblevoid
mergeWithSet(ShapeSet3DInt set)
Mergeset
with this set.void
mergeWithSet(ShapeSet3DInt set, java.lang.String existing_shapes)
Mergeset
with this set.void
mergeWithSet(ShapeSet3DInt set, java.lang.String existing_shapes, boolean update)
Mergeset
with this set.boolean
moveShapeAfter(InterfaceShape inserted_shape, InterfaceShape target_shape)
boolean
moveShapeAfter(Shape3DInt moved_shape, Shape3DInt target_shape, boolean update)
Insertsinserted_shape
at a position aftertarget_shape
in this list.boolean
moveShapeBefore(InterfaceShape inserted_shape, InterfaceShape target_shape)
Moves the order ofshape
to the spot beforetarget
.boolean
moveShapeBefore(Shape3DInt moved_shape, Shape3DInt target_shape, boolean update)
Insertsinserted_shape
at a position beforetarget_shape
in this list.boolean
moveShapeBottom(Shape3DInt shape)
Movesshape
to the bottom of the rendering orderboolean
moveShapeDown(Shape3DInt shape)
Movesshape
down one in the rendering orderboolean
moveShapeTop(Shape3DInt shape)
Movesshape
to the top of the rendering orderboolean
moveShapeUp(Shape3DInt shape)
Movesshape
up one in the rendering orderboolean
needsRedraw3D(Attribute a)
boolean
performTransfer(javax.swing.TransferHandler.TransferSupport support)
Moves a list of shapes to a position above this shape in its parent set.void
register()
Registers this shape with the current session, if it hasn't already been done, by assigning it a unique identifier.void
registerCamera(Camera3D c)
void
registerCameras(java.util.ArrayList<Camera3D> cameras)
void
removeOverride()
Removes this set's override; all members are rendered according to their own attributes.void
removeShape(InterfaceShape shape)
Removesshape
from this shape set and removes it as a parent set and a shape listener.void
removeShape(Shape3DInt shape, boolean updateShape, boolean updateListeners)
Deprecated.Remove update argumentsvoid
removeShape2D(Shape2DInt shape, boolean updateShape, boolean updateListeners)
void
removeWindow(InterfaceGraphic2D window)
void
setBoundBoxNode()
Sets a bounding box node for this ShapeInt, that can be retrieved usingShape3DInt.getBoundBoxNode()
.protected void
setIcon()
void
setModel(ShapeModel3D m)
Sets this shape set's current model.void
setModel(ShapeModel3D model, boolean setID)
Sets this shape set's current model.void
setOverride(AttributeList attr)
If attr is non-null, sets override attributes for all members of this set, and sets isOverridden to true.void
setParentWindow(InterfaceGraphic<?> thisParent)
void
setScene3DObject(boolean make_live)
Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes.void
setScene3DObject(boolean make_live, ShapeSelectionSet filter)
void
setScene3DObject(boolean make_live, ShapeSelectionSet filter, boolean super_only)
protected void
setSectionNode(InterfaceGraphic2D window)
Updates or creates the section node for this window.void
setSectionNodes()
protected void
setSuperTreeNode(InterfaceTreeNode treeNode)
void
setTreeNode(InterfaceTreeNode treeNode)
Constructs a tree node from this shape.void
shapeUpdated(ShapeEvent e)
Responds to a change in a member shape.boolean
showSections()
java.lang.String
toString()
void
unsetOverride()
Unsets the override on this set.protected void
updateCameras()
void
updateMembers()
Calling this function causes all members to update themselves by callingupdateShape
.protected ShapeSceneNode
updateNewShape(Shape3DInt shape)
void
updateSectionNodes()
Updates all existing section nodes.void
updateShape()
Updates the geometric bounds of this ShapeInt.void
updateTreeNodes()
protected java.lang.String
validateName(java.lang.String name)
protected java.lang.String
validateName(java.lang.String name, java.lang.String base, int i)
Returns a name that doesn't conflict with existing member names, by adding an integer to the end.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.interfaces.shapes.Shape3DInt
addShape2DChild, clear2DChildren, contains, copyAttributes, crossesPlane, deregisterCameraListener, draw2D, drawShape2D, drawShape2D, drawShape2D, fireChildren2D, fireChildren2DModified, fireShapeModified, geometryChanged, getAlpha, getBoundBox, getBoundBoxNode, getBoundSphere, getCameraListener, getCenterOfGravity, getClosestVertex, getDimensions, getDTD, getFullName, getGeometricCenter, getGeometry, getGeometryInstance, getIcon, getInheritingAttribute, getLabelColour, getLabelFont, getLabelScale, getLineColour, getLineStyle, getModifiedAttribute, getParent2D, getParentAttribute, getPopupMenu, getPopupMenuLength, getProximity, getScene3DObject, getShape, getShape2D, getShape2DInt, getShapeSceneNode, getShapeSceneNode, getShortXML, getTransferData, getTreeLabel, getVertex, getVertexAppearance, getVertexColour, getVertexColour, getVertexCount, getVertexScale, getVertexScale, getVertexSelection, hasAlpha, hasAlpha, hasCameraListener, hasParentShape, isHeritableAttribute, isInheritingAttribute, isLive, issueTreeNode, needsRedraw, registerCameraListener, releaseScene3DChildren, removeShape2DChild, setAlpha, 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, addVertexData, addVertexData, addVertexData, cleanTreeNodes, compareTo, finalizeAfterXML, fromVariable, getAllVertexData, getAttribute, getAttributes, getAttributeValue, 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, getName, getNameMap, getNameMap, getNonLinkedDataColumns, getObjectIcon, getParentSet, 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, 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, setParentSet, setSelectable, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVertexDataMap, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, updateDataColumns, vertexDataColumnChanged, vertexDataColumnColourMapChanged, writeXML, writeXML
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean
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.NamedObject
getName, setName
Methods inherited from interface mgui.interfaces.shapes.util.ShapeListener
isDestroyed
Methods inherited from interface mgui.interfaces.shapes.ShapeSet
getFullName, getUnit, isSelectable, isVisible, setUnit, show2D, show3D
-
Field Details
-
members
-
registered_cameras
-
model
-
sections_node
protected org.jogamp.java3d.BranchGroup sections_node -
section_polygons
-
last_section_added
-
last_section_removed
-
-
Constructor Details
-
ShapeSet3DInt
public ShapeSet3DInt() -
ShapeSet3DInt
public ShapeSet3DInt(java.lang.String name)
-
-
Method Details
-
setIcon
protected void setIcon()- Overrides:
setIcon
in classShape3DInt
-
init
protected void init()- Overrides:
init
in classShape3DInt
-
getLastSectionAdded
-
getLastSectionRemoved
-
getMembers
Returns a copy of this set's member list.- Specified by:
getMembers
in interfaceShapeSet
- Returns:
- a list of members
-
getMembers
Returns a copy of this set's member list.- Parameters:
recursive
- If true, returns all subset members as well- Returns:
- a list of members
-
getLastAdded
- Specified by:
getLastAdded
in interfaceShapeSet
-
getLastRemoved
- Specified by:
getLastRemoved
in interfaceShapeSet
-
getLastInserted
- Specified by:
getLastInserted
in interfaceShapeSet
-
getLastInsert
public int getLastInsert()- Specified by:
getLastInsert
in interfaceShapeSet
-
getLastModified
- Specified by:
getLastModified
in interfaceShapeSet
-
getLastMoved
- Specified by:
getLastMoved
in interfaceShapeSet
-
getIndexOf
Returns the index ofshape
in this set.- Specified by:
getIndexOf
in interfaceShapeSet
- Returns:
- index of shape, or -1 if it is not in this set
-
setOverride
If attr is non-null, sets override attributes for all members of this set, and sets isOverridden to true.- Overrides:
setOverride
in classInterfaceShape
- Parameters:
attr
- AttributeList with which to override the members of this set
-
unsetOverride
public void unsetOverride()Unsets the override on this set. If this set is overriding, itself, this override will be reapplied to its members.- Overrides:
unsetOverride
in classInterfaceShape
-
setModel
Sets this shape set's current model. This is only necessary for a top-level shape set (i.e., the model's base set). Any members, including other instances ofShapeSet3DInt
, will access this model through thegetModel()
method.TODO: reconsider the access modifier for this method; setting models should possibly be restricted to internal processes.
- Parameters:
model_node
- The model to set as this set's parent
-
setModel
Sets this shape set's current model. This is only necessary for a top-level shape set (i.e., the model's base set). Any members, including other instances ofShapeSet3DInt
, will access this model through thegetModel()
method.TODO: reconsider the access modifier for this method; setting models should possibly be restricted to internal processes.
- Parameters:
model
- The model to set as this set's parentsetID
- Whether to set a shape ID for this shape
-
register
public void register()Description copied from class:InterfaceShape
Registers this shape with the current session, if it hasn't already been done, by assigning it a unique identifier.- Overrides:
register
in classInterfaceShape
-
applyOverride
public void applyOverride()Applies this set's attributes to all members. -
removeOverride
public void removeOverride()Removes this set's override; all members are rendered according to their own attributes. -
isOverriding
public boolean isOverriding()Query whether this set is currently overriding its members' attributes.- Returns:
true
if this set is overriding
-
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 classShape3DInt
- 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:
-
getShape2DInt
Description copied from class:Shape3DInt
Determines a 2D shape which is the projection of this 3D shape ontoplane
, within the projection limits defined byabove_dist
andbelow_dist
.- Overrides:
getShape2DInt
in classShape3DInt
above_dist
- The projection limit above the plane
-
registerCamera
-
registerCameras
-
deregisterCameras
-
deregisterCamera
-
isVisible
public boolean isVisible(int i)Determines whether thei
th member of this set is visible- Parameters:
i
-- Returns:
-
getSize
public int getSize()Description copied from interface:ShapeSet
Returns the number of shapes in this set -
getMember
Returns thei
th member of this set- Parameters:
i
-- Returns:
-
getShape
Returns thei
th member of this set- Parameters:
i
-- Returns:
-
getShapeSet
- Specified by:
getShapeSet
in interfaceShapeSet
-
getSubSets
- Specified by:
getSubSets
in interfaceShapeSet
-
hasShape
public boolean hasShape(java.lang.String name)Determines whether a shape with the namename
is in this set. Does a recursive search of all subsets.- Parameters:
name
-- Returns:
-
hasShape
public boolean hasShape(java.lang.String name, boolean recurse)Determines whether a shape with the namename
is in this set.- Parameters:
name
-recurse
- Whether to do a recursive search of all subsets.- Returns:
-
getShape
Searches this set for a shape namedname
and returns the first instance found. Does not search subsets; see {code getShape(String name, boolean recurse)}.- Parameters:
name
-- Returns:
-
getShape
Searches this set for a shape namedname
and returns the first instance found. Recurse indicates that all subsets should also be searched.- Parameters:
name
-recurse
-- Returns:
-
mergeWithSet
Mergeset
with this set. Merge of subordinate sets is done recursively. Shapes are renamed if shapes already exist by the same name.- Parameters:
set
-
-
mergeWithSet
Mergeset
with this set. Merge of subordinate sets is done recursively.- Parameters:
set
- Set to merge with this oneexisting_shapes
- If a shape in this set has the same name as one being merged, do we rename it ("rename"
), skip it ("skip"
), or replace it ("overwrite"
)?
-
mergeWithSet
Mergeset
with this set. Merge of subordinate sets is done recursively.- Parameters:
set
- Set to merge with this oneexisting_shapes
- If a shape in this set has the same name as one being merged, do we rename it ("rename"
), skip it ("skip"
), or replace it ("overwrite"
)?
-
getUniqueName
protected java.lang.String getUniqueName(java.lang.String name)Finds a unique name by iteratively adding numbers to the end ofname
.- Parameters:
name
-- Returns:
-
hasShape
Determines whethershape
is in this set. Does a recursive search of all subsets. -
hasShape
Determines whethershape
is in this set. -
addShape
Addsshape
to this set, updates it, and fires this set's listeners. -
addShape
Addsshape
to this set.- Parameters:
shape3d
-update
- Whether to update this shape and fire its listeners- Returns:
-
addShape
Addsshape
to this set atindex
.- Parameters:
shape3d
-update
- Whether to update this shape and fire its listeners- Returns:
-
addShape
Addsshape
to this set.- Parameters:
shape
-updateShape
- Whether to update this shapeupdateListeners
- Whether to fire this set's listeners- Returns:
-
validateName
protected java.lang.String validateName(java.lang.String name) -
validateName
protected java.lang.String validateName(java.lang.String name, java.lang.String base, int i)Returns a name that doesn't conflict with existing member names, by adding an integer to the end.- Parameters:
name
-- Returns:
-
addShape
Addsshape
to this shape set. IfupdateShape
istrue
, performs updates on the shape, sets this set as its parent set and registers itself as a shape listener onshape
, registers camera listeners, and generates a Java3D node. IfupdateListeners
istrue
, fires this shape set's listeners with aShapeAdded ShapeEvent
.It is not recommended to set these arguments to
false
unless you are using this set to perform non-GUI-related tasks.- Parameters:
shape
- The shape to addindex
- The index at which to insert the shapeupdateShape
- Specifies whether to perform shape updatesupdateListeners
- Specifies whether to fire shape listeners- Returns:
true
if successful
-
updateNewShape
-
moveShapeUp
Movesshape
up one in the rendering order- Parameters:
shape
-- Returns:
true
if shape has been moved
-
moveShapeDown
Movesshape
down one in the rendering order- Parameters:
shape
-- Returns:
-
moveShapeTop
Movesshape
to the top of the rendering order- Parameters:
shape
-- Returns:
-
moveShapeBottom
Movesshape
to the bottom of the rendering order- Parameters:
shape
-- Returns:
-
moveShapeBefore
Description copied from interface:ShapeSet
Moves the order ofshape
to the spot beforetarget
.- Specified by:
moveShapeBefore
in interfaceShapeSet
- Returns:
-
moveShapeBefore
Insertsinserted_shape
at a position beforetarget_shape
in this list. Both shapes must already be in this set. To add a new shape at a specific position, useaddShape(mgui.interfaces.shapes.InterfaceShape)
.- Parameters:
inserted_shape
-target_shape
-update
-- Returns:
-
moveShapeAfter
-
moveShapeAfter
Insertsinserted_shape
at a position aftertarget_shape
in this list. Both shapes must already be in this set. To add a new shape at a specific position, useaddShape(mgui.interfaces.shapes.InterfaceShape)
.- Parameters:
inserted_shape
-target_shape
-update
-- Returns:
-
isAncestorSet
Determines whetherset
is an ancestor of this set.- Specified by:
isAncestorSet
in interfaceShapeSet
- Parameters:
set
-- Returns:
-
addShapes
-
addShapes
Add multiple shapes to this set. Use this instead of multiple calls to addShape, as it will only update itself once all shapes are added, rather once for every shape.- Parameters:
shapes
-update
-listeners
-
-
getModel
- Specified by:
getModel
in interfaceShapeSet
- Overrides:
getModel
in classInterfaceShape
-
fireShapeListeners
- Overrides:
fireShapeListeners
in classShape3DInt
-
removeShape
Removesshape
from this shape set and removes it as a parent set and a shape listener. Updates this set's bounds and fires this set's shape listeners with aShapeRemoved ShapeEvent
.- Specified by:
removeShape
in interfaceShapeSet
- Parameters:
shape
- The shape to remove
-
removeShape
Deprecated.Remove update argumentsRemovesshape
from this shape set and removes it as a parent set and a shape listener. IfupdateShape
istrue
, updates this set's bounds. IfupdateListeners
istrue
, fires this set's shape listeners with aShapeRemoved ShapeEvent
.It is not recommended to set these arguments to
false
unless you are using this set to perform non-GUI-related tasks.- Parameters:
shape
- The shape to removeupdateShape
- Specifies whether to update this set's boundsupdateListeners
- Specifies whether to fire this set's shape listeners
-
updateTreeNodes
public void updateTreeNodes()- Overrides:
updateTreeNodes
in classAbstractInterfaceObject
-
removeShape2D
-
destroy
public void destroy()Description copied from interface:InterfaceObject
Destroy this object (prepare it to be removed from memory)- Specified by:
destroy
in interfaceInterfaceObject
- Specified by:
destroy
in interfaceShapeListener
- Overrides:
destroy
in classShape3DInt
-
drawMember
-
drawShape
-
setSuperTreeNode
-
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
-
needsRedraw3D
-
toString
public java.lang.String toString()- Overrides:
toString
in classShape3DInt
-
shapeUpdated
Responds to a change in a member shape. Typically this involves callingupdateShape()
to update this set's bounds and center point.- Specified by:
shapeUpdated
in interfaceShapeListener
- Parameters:
e
- aShapeEvent
characterizing the change
-
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 classShape3DInt
- Parameters:
e
- anAttributeEvent
specifying which attribute has been changed
-
addUnionSet
-
addUnionSet
-
getScene3DObject
- Overrides:
getScene3DObject
in classShape3DInt
-
setBoundBoxNode
public void setBoundBoxNode()Description copied from class:Shape3DInt
Sets a bounding box node for this ShapeInt, that can be retrieved usingShape3DInt.getBoundBoxNode()
.TODO: reconsider the access modifier of this method; probably doesn't need to be public
- Overrides:
setBoundBoxNode
in classShape3DInt
-
hasWindow
-
addWindow
-
removeWindow
-
graphicSourceChanged
- Specified by:
graphicSourceChanged
in interfaceInterfaceGraphicListener
-
graphicUpdated
- Specified by:
graphicUpdated
in interfaceInterfaceGraphicListener
-
clearWindows
public void clearWindows() -
getSectionWindows
-
updateSectionNodes
public void updateSectionNodes()Updates all existing section nodes. -
setSectionNode
Updates or creates the section node for this window. If it doesn't already exist, it is created; otherwise it is modified to match the current state of the window.- Parameters:
window
-
-
activateClip
public void activateClip(org.jogamp.java3d.ModelClip clip)Adds this model to the scopes of the current clip nodes -
showSections
public boolean showSections() -
destroySectionNode
-
setSectionNodes
public void setSectionNodes() -
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 classShape3DInt
-
setScene3DObject
-
setScene3DObject
-
get3DShapes
Returns all 3D shapes in this shape set; ifrecurse
isfalse
, limits this list to the set's members; otherwise, also adds all members of all subsets (along with the sets themselves).- Parameters:
recurse
-- Returns:
-
getShapeType
-
getShapeType
-
getCenterPoint
public org.jogamp.vecmath.Point3f getCenterPoint()Returns the center point of this shape set. This can be updated by callingupdateShape
.- Returns:
-
updateMembers
public void updateMembers()Calling this function causes all members to update themselves by callingupdateShape
. -
updateShape
public void updateShape()Description copied from class:Shape3DInt
Updates the geometric bounds of this ShapeInt. Does not callShape3DInt.setScene3DObject()
.- Overrides:
updateShape
in classShape3DInt
-
updateCameras
protected void updateCameras() -
getShapeCount
public int getShapeCount() -
getVertices
public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()Returns a list of all nodes of all members in this set, including all shapes in all subsets. To get a list of only the shapes in this immediate set, usegetNodes(false)
.- Overrides:
getVertices
in classShape3DInt
- Returns:
- a list of nodes
-
getNodes
protected java.util.ArrayList<org.jogamp.vecmath.Point3f> getNodes(boolean recurse)Returns a list of all nodes of all members in this set. Ifrecurse
istrue
, also includes all subsets.- Parameters:
recurse
- Specifies whether to include all shapes in all subsets- Returns:
- a list of nodes
-
isShape
public boolean isShape() -
setParentWindow
-
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 classShape3DInt
- Returns:
-
getXML
- Overrides:
getXML
in classInterfaceShape
-
getByReferenceUrls
public java.util.List<java.lang.String> getByReferenceUrls()Returns a list of URL strings for the latest call to writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater). Is an empty list if no call has yet been made, or the latest write contained no by reference shapes.- Overrides:
getByReferenceUrls
in classInterfaceShape
- Returns:
-
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 classInterfaceShape
- 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
-
getPopupMenu
Description copied from interface:PopupMenuObject
Produces and returns a popup menu for this object.- Specified by:
getPopupMenu
in interfacePopupMenuObject
- Overrides:
getPopupMenu
in classInterfaceShape
- Returns:
-
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
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)- Specified by:
isDataFlavorSupported
in interfacejava.awt.datatransfer.Transferable
- Overrides:
isDataFlavorSupported
in classShape3DInt
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()- Specified by:
getTransferDataFlavors
in interfacejava.awt.datatransfer.Transferable
- Overrides:
getTransferDataFlavors
in classShape3DInt
-
performTransfer
public boolean performTransfer(javax.swing.TransferHandler.TransferSupport support)Description copied from class:Shape3DInt
Moves a list of shapes to a position above this shape in its parent set. Does nothing if this shape does not have a parent set.- Specified by:
performTransfer
in interfaceInterfaceTransferable
- Overrides:
performTransfer
in classShape3DInt
- Returns:
true
if successful.
-