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.VertexShapeTransformerNested classes/interfaces inherited from class mgui.interfaces.shapes.InterfaceShape
InterfaceShape.VertexDataSetNested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected InterfaceGraphic2Dlast_section_addedprotected InterfaceGraphic2Dlast_section_removedjava.util.ArrayList<Shape3DInt>membersShapeModel3Dmodelprotected java.util.ArrayList<Camera3D>registered_camerasprotected java.util.HashMap<InterfaceGraphic2D,Polygon3DInt>section_polygonsprotected org.jogamp.java3d.BranchGroupsections_nodeorg.jogamp.java3d.SharedGroupsharedNodeFields 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_groupFields 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_dirFields 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 voidactivateClip(org.jogamp.java3d.ModelClip clip)Adds this model to the scopes of the current clip nodesbooleanaddShape(InterfaceShape shape)Addsshapeto this set, updates it, and fires this set's listeners.booleanaddShape(Shape3DInt thisShape, boolean update)Addsshapeto this set.booleanaddShape(Shape3DInt shape, boolean updateShape, boolean updateListeners)Addsshapeto this set.booleanaddShape(Shape3DInt thisShape, int index, boolean update)Addsshapeto this set atindex.booleanaddShape(Shape3DInt shape, int index, boolean updateShape, boolean updateListeners)Addsshapeto this shape set.voidaddShapes(java.util.ArrayList<Shape3DInt> shapes)voidaddShapes(java.util.ArrayList<Shape3DInt> shapes, boolean update, boolean listeners)Add multiple shapes to this set.intaddUnionSet(ShapeSet3DInt thisSet, boolean update)intaddUnionSet(ShapeSet3DInt thisSet, boolean updateShapes, boolean updateListeners)booleanaddWindow(InterfaceGraphic2D window)voidapplyOverride()Applies this set's attributes to all members.voidattributeUpdated(AttributeEvent e)Responds to an update in one of this shape's attributes.voidclearWindows()voidderegisterCamera(Camera3D c)voidderegisterCameras(java.util.ArrayList<Camera3D> cameras)voiddestroy()Destroy this object (prepare it to be removed from memory)protected voiddestroySectionNode(InterfaceGraphic2D window)voiddrawMember(int index, java.awt.Graphics2D g, DrawingEngine d)voiddrawShape(java.awt.Graphics2D g, DrawingEngine d)protected voidfireShapeListeners(ShapeEvent e)java.util.ArrayList<Shape3DInt>get3DShapes(boolean recurse)Returns all 3D shapes in this shape set; ifrecurseisfalse, 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.Point3fgetCenterPoint()Returns the center point of this shape set.intgetIndexOf(InterfaceShape shape)Returns the index ofshapein this set.InterfaceShapegetLastAdded()intgetLastInsert()InterfaceShapegetLastInserted()InterfaceShapegetLastModified()InterfaceShapegetLastMoved()InterfaceShapegetLastRemoved()InterfaceGraphic2DgetLastSectionAdded()InterfaceGraphic2DgetLastSectionRemoved()java.lang.StringgetLocalName()Returns the local name associated with this XML object.Shape3DIntgetMember(int i)Returns theith 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.ShapeModel3DgetModel()protected java.util.ArrayList<org.jogamp.vecmath.Point3f>getNodes(boolean recurse)Returns a list of all nodes of all members in this set.InterfacePopupMenugetPopupMenu()Produces and returns a popup menu for this object.org.jogamp.java3d.BranchGroupgetScene3DObject(ShapeSelectionSet selSet)java.util.ArrayList<InterfaceGraphic2D>getSectionWindows()Shape3DIntgetShape(int i)Returns theith member of this setShape3DIntgetShape(java.lang.String name)Searches this set for a shape namednameand returns the first instance found.Shape3DIntgetShape(java.lang.String name, boolean recurse)Searches this set for a shape namednameand returns the first instance found.protected Shape2DIntgetShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)To be overridden by subclasses implementing a 2D representationShape2DIntgetShape2DInt(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_distandbelow_dist.intgetShapeCount()java.util.Set<InterfaceShape>getShapeSet()java.util.List<Shape3DInt>getShapeType(Shape3DInt thisShape)java.util.List<Shape3DInt>getShapeType(Shape3DInt thisShape, boolean recurse)intgetSize()Returns the number of shapes in this setjava.util.Set<ShapeSet>getSubSets()java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()protected java.lang.StringgetUniqueName(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.StringgetXML(int tab, XMLObject.XMLType type)voidgraphicSourceChanged(GraphicEvent e)voidgraphicUpdated(GraphicEvent e)voidhandlePopupEvent(java.awt.event.ActionEvent e)Handles an event on this object's popup menu.booleanhasShape(java.lang.String name)Determines whether a shape with the namenameis in this set.booleanhasShape(java.lang.String name, boolean recurse)Determines whether a shape with the namenameis in this set.booleanhasShape(InterfaceShape s)Determines whethershapeis in this set.booleanhasShape(InterfaceShape shape, boolean recurse)Determines whethershapeis in this set.booleanhasWindow(InterfaceGraphic2D window)protected voidinit()booleanisAncestorSet(ShapeSet set)Determines whethersetis an ancestor of this set.booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)booleanisOverriding()Query whether this set is currently overriding its members' attributes.booleanisShape()booleanisVisible(int i)Determines whether theith member of this set is visiblevoidmergeWithSet(ShapeSet3DInt set)Mergesetwith this set.voidmergeWithSet(ShapeSet3DInt set, java.lang.String existing_shapes)Mergesetwith this set.voidmergeWithSet(ShapeSet3DInt set, java.lang.String existing_shapes, boolean update)Mergesetwith this set.booleanmoveShapeAfter(InterfaceShape inserted_shape, InterfaceShape target_shape)booleanmoveShapeAfter(Shape3DInt moved_shape, Shape3DInt target_shape, boolean update)Insertsinserted_shapeat a position aftertarget_shapein this list.booleanmoveShapeBefore(InterfaceShape inserted_shape, InterfaceShape target_shape)Moves the order ofshapeto the spot beforetarget.booleanmoveShapeBefore(Shape3DInt moved_shape, Shape3DInt target_shape, boolean update)Insertsinserted_shapeat a position beforetarget_shapein this list.booleanmoveShapeBottom(Shape3DInt shape)Movesshapeto the bottom of the rendering orderbooleanmoveShapeDown(Shape3DInt shape)Movesshapedown one in the rendering orderbooleanmoveShapeTop(Shape3DInt shape)Movesshapeto the top of the rendering orderbooleanmoveShapeUp(Shape3DInt shape)Movesshapeup one in the rendering orderbooleanneedsRedraw3D(Attribute a)booleanperformTransfer(javax.swing.TransferHandler.TransferSupport support)Moves a list of shapes to a position above this shape in its parent set.voidregister()Registers this shape with the current session, if it hasn't already been done, by assigning it a unique identifier.voidregisterCamera(Camera3D c)voidregisterCameras(java.util.ArrayList<Camera3D> cameras)voidremoveOverride()Removes this set's override; all members are rendered according to their own attributes.voidremoveShape(InterfaceShape shape)Removesshapefrom this shape set and removes it as a parent set and a shape listener.voidremoveShape(Shape3DInt shape, boolean updateShape, boolean updateListeners)Deprecated.Remove update argumentsvoidremoveShape2D(Shape2DInt shape, boolean updateShape, boolean updateListeners)voidremoveWindow(InterfaceGraphic2D window)voidsetBoundBoxNode()Sets a bounding box node for this ShapeInt, that can be retrieved usingShape3DInt.getBoundBoxNode().protected voidsetIcon()voidsetModel(ShapeModel3D m)Sets this shape set's current model.voidsetModel(ShapeModel3D model, boolean setID)Sets this shape set's current model.voidsetOverride(AttributeList attr)If attr is non-null, sets override attributes for all members of this set, and sets isOverridden to true.voidsetParentWindow(InterfaceGraphic<?> thisParent)voidsetScene3DObject(boolean make_live)Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes.voidsetScene3DObject(boolean make_live, ShapeSelectionSet filter)voidsetScene3DObject(boolean make_live, ShapeSelectionSet filter, boolean super_only)protected voidsetSectionNode(InterfaceGraphic2D window)Updates or creates the section node for this window.voidsetSectionNodes()protected voidsetSuperTreeNode(InterfaceTreeNode treeNode)voidsetTreeNode(InterfaceTreeNode treeNode)Constructs a tree node from this shape.voidshapeUpdated(ShapeEvent e)Responds to a change in a member shape.booleanshowSections()java.lang.StringtoString()voidunsetOverride()Unsets the override on this set.protected voidupdateCameras()voidupdateMembers()Calling this function causes all members to update themselves by callingupdateShape.protected ShapeSceneNodeupdateNewShape(Shape3DInt shape)voidupdateSectionNodes()Updates all existing section nodes.voidupdateShape()Updates the geometric bounds of this ShapeInt.voidupdateTreeNodes()protected java.lang.StringvalidateName(java.lang.String name)protected java.lang.StringvalidateName(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.voidwriteXML(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, updateVerticesMethods 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, writeXMLMethods inherited from class mgui.interfaces.AbstractInterfaceObject
cleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
cleanMethods inherited from interface mgui.interfaces.NamedObject
getName, setNameMethods inherited from interface mgui.interfaces.shapes.util.ShapeListener
isDestroyedMethods 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:
setIconin classShape3DInt
-
init
protected void init()- Overrides:
initin classShape3DInt
-
getLastSectionAdded
-
getLastSectionRemoved
-
getMembers
Returns a copy of this set's member list.- Specified by:
getMembersin 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:
getLastAddedin interfaceShapeSet
-
getLastRemoved
- Specified by:
getLastRemovedin interfaceShapeSet
-
getLastInserted
- Specified by:
getLastInsertedin interfaceShapeSet
-
getLastInsert
public int getLastInsert()- Specified by:
getLastInsertin interfaceShapeSet
-
getLastModified
- Specified by:
getLastModifiedin interfaceShapeSet
-
getLastMoved
- Specified by:
getLastMovedin interfaceShapeSet
-
getIndexOf
Returns the index ofshapein this set.- Specified by:
getIndexOfin 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:
setOverridein 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:
unsetOverridein 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:InterfaceShapeRegisters this shape with the current session, if it hasn't already been done, by assigning it a unique identifier.- Overrides:
registerin 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:
trueif 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:Shape3DIntTo be overridden by subclasses implementing a 2D representation- Overrides:
getShape2Din 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:Shape3DIntDetermines a 2D shape which is the projection of this 3D shape ontoplane, within the projection limits defined byabove_distandbelow_dist.- Overrides:
getShape2DIntin classShape3DIntabove_dist- The projection limit above the plane
-
registerCamera
-
registerCameras
-
deregisterCameras
-
deregisterCamera
-
isVisible
public boolean isVisible(int i)Determines whether theith member of this set is visible- Parameters:
i-- Returns:
-
getSize
public int getSize()Description copied from interface:ShapeSetReturns the number of shapes in this set -
getMember
Returns theith member of this set- Parameters:
i-- Returns:
-
getShape
Returns theith member of this set- Parameters:
i-- Returns:
-
getShapeSet
- Specified by:
getShapeSetin interfaceShapeSet
-
getSubSets
- Specified by:
getSubSetsin interfaceShapeSet
-
hasShape
public boolean hasShape(java.lang.String name)Determines whether a shape with the namenameis 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 namenameis in this set.- Parameters:
name-recurse- Whether to do a recursive search of all subsets.- Returns:
-
getShape
Searches this set for a shape namednameand 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 namednameand returns the first instance found. Recurse indicates that all subsets should also be searched.- Parameters:
name-recurse-- Returns:
-
mergeWithSet
Mergesetwith this set. Merge of subordinate sets is done recursively. Shapes are renamed if shapes already exist by the same name.- Parameters:
set-
-
mergeWithSet
Mergesetwith 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
Mergesetwith 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 whethershapeis in this set. Does a recursive search of all subsets. -
hasShape
Determines whethershapeis in this set. -
addShape
Addsshapeto this set, updates it, and fires this set's listeners. -
addShape
Addsshapeto this set.- Parameters:
shape3d-update- Whether to update this shape and fire its listeners- Returns:
-
addShape
Addsshapeto this set atindex.- Parameters:
shape3d-update- Whether to update this shape and fire its listeners- Returns:
-
addShape
Addsshapeto 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
Addsshapeto this shape set. IfupdateShapeistrue, 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. IfupdateListenersistrue, fires this shape set's listeners with aShapeAdded ShapeEvent.It is not recommended to set these arguments to
falseunless 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:
trueif successful
-
updateNewShape
-
moveShapeUp
Movesshapeup one in the rendering order- Parameters:
shape-- Returns:
trueif shape has been moved
-
moveShapeDown
Movesshapedown one in the rendering order- Parameters:
shape-- Returns:
-
moveShapeTop
Movesshapeto the top of the rendering order- Parameters:
shape-- Returns:
-
moveShapeBottom
Movesshapeto the bottom of the rendering order- Parameters:
shape-- Returns:
-
moveShapeBefore
Description copied from interface:ShapeSetMoves the order ofshapeto the spot beforetarget.- Specified by:
moveShapeBeforein interfaceShapeSet- Returns:
-
moveShapeBefore
Insertsinserted_shapeat a position beforetarget_shapein 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_shapeat a position aftertarget_shapein 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 whethersetis an ancestor of this set.- Specified by:
isAncestorSetin 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:
getModelin interfaceShapeSet- Overrides:
getModelin classInterfaceShape
-
fireShapeListeners
- Overrides:
fireShapeListenersin classShape3DInt
-
removeShape
Removesshapefrom 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:
removeShapein interfaceShapeSet- Parameters:
shape- The shape to remove
-
removeShape
Deprecated.Remove update argumentsRemovesshapefrom this shape set and removes it as a parent set and a shape listener. IfupdateShapeistrue, updates this set's bounds. IfupdateListenersistrue, fires this set's shape listeners with aShapeRemoved ShapeEvent.It is not recommended to set these arguments to
falseunless 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:
updateTreeNodesin classAbstractInterfaceObject
-
removeShape2D
-
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject- Specified by:
destroyin interfaceShapeListener- Overrides:
destroyin classShape3DInt
-
drawMember
-
drawShape
-
setSuperTreeNode
-
setTreeNode
Constructs a tree node from this shape. Adds anAttributeTreeNodevia the super method, and also adds a node to display the vertex-wise data columns associated with this ShapeInt.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classInterfaceShape- Parameters:
treeNode- node to construct
-
needsRedraw3D
-
toString
public java.lang.String toString()- Overrides:
toStringin 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:
shapeUpdatedin interfaceShapeListener- Parameters:
e- aShapeEventcharacterizing the change
-
attributeUpdated
Description copied from class:Shape3DIntResponds 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:
attributeUpdatedin interfaceAttributeListener- Overrides:
attributeUpdatedin classShape3DInt- Parameters:
e- anAttributeEventspecifying which attribute has been changed
-
addUnionSet
-
addUnionSet
-
getScene3DObject
- Overrides:
getScene3DObjectin classShape3DInt
-
setBoundBoxNode
public void setBoundBoxNode()Description copied from class:Shape3DIntSets 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:
setBoundBoxNodein classShape3DInt
-
hasWindow
-
addWindow
-
removeWindow
-
graphicSourceChanged
- Specified by:
graphicSourceChangedin interfaceInterfaceGraphicListener
-
graphicUpdated
- Specified by:
graphicUpdatedin 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:Shape3DIntSets 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:
setScene3DObjectin classShape3DInt
-
setScene3DObject
-
setScene3DObject
-
get3DShapes
Returns all 3D shapes in this shape set; ifrecurseisfalse, 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:Shape3DIntUpdates the geometric bounds of this ShapeInt. Does not callShape3DInt.setScene3DObject().- Overrides:
updateShapein 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:
getVerticesin 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. Ifrecurseistrue, 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:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Overrides:
getLocalNamein classShape3DInt- Returns:
-
getXML
- Overrides:
getXMLin 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:
getByReferenceUrlsin classInterfaceShape- Returns:
-
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites 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.Asciiwill be used.- Specified by:
writeXMLin interfaceXMLObject- Overrides:
writeXMLin 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:PopupMenuObjectProduces and returns a popup menu for this object.- Specified by:
getPopupMenuin interfacePopupMenuObject- Overrides:
getPopupMenuin classInterfaceShape- Returns:
-
handlePopupEvent
public void handlePopupEvent(java.awt.event.ActionEvent e)Description copied from interface:PopupMenuObjectHandles an event on this object's popup menu.- Specified by:
handlePopupEventin interfacePopupMenuObject- Overrides:
handlePopupEventin classShape3DInt
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable- Overrides:
isDataFlavorSupportedin classShape3DInt
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable- Overrides:
getTransferDataFlavorsin classShape3DInt
-
performTransfer
public boolean performTransfer(javax.swing.TransferHandler.TransferSupport support)Description copied from class:Shape3DIntMoves 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:
performTransferin interfaceInterfaceTransferable- Overrides:
performTransferin classShape3DInt- Returns:
trueif successful.
-