public abstract class BasicAttachment extends Attachment implements IModelPart, IRenderElementHolder
Base for GeometryAttachment implementations, which provide nodes with the ability to display ICE Geometry elements and their constituent IShapes.
Constructor and Description |
---|
BasicAttachment() |
Modifier and Type | Method and Description |
---|---|
void |
addGeometry(Geometry geom)
Adds a Geometry instance to this entity.
|
void |
addGeometry(IController geom)
Adds a Geometry instance to this entity.
|
void |
addShape(INode shape)
Adds a shape to this entity.
|
void |
attach(INode owner)
Adds this instance to the supplied node.
|
void |
clearShapes()
Removes all shapes associated with this entity.
|
void |
detach(INode owner)
Removes this instance from the supplied node.
|
IRenderElement |
getRender(INode node)
Get the IRenderElement for the given node.
|
java.util.ArrayList<IRenderElement> |
getRenderedNodes()
Get the IRenderElements contained by this attachment.
|
INode |
getShape(int index)
Returns the IShape at the specified index or null if it cannot be found.
|
java.util.List<INode> |
getShapes(boolean copy)
Returns a list of the shapes associated with this entity.
|
boolean |
hasShape(INode shape)
Returns true if the entity contains the supplied INode, false otherwise.
|
boolean |
isImmutable()
Returns true if the entity is immutable, false otherwise.
|
boolean |
isVisible()
Returns true if the entity is visible, false otherwise.
|
void |
removeShape(INode shape)
Removes the supplied INode from this entity.
|
void |
setImmutable(boolean immutable)
Sets the entity to be immutable, which means it's values cannot be
changed (no new geometry or shapes).
|
void |
setVisible(boolean visible)
Sets the entity to be visible or not visible in the scene.
|
getOwner, isSingleton
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
removeGeometry
getType
public void addGeometry(IController geom)
IModelPart
Adds a Geometry instance to this entity.
addGeometry
in interface IModelPart
geom
- an ICE Geometry instanceIModelPart.addGeometry(Geometry)
public void addGeometry(Geometry geom)
IModelPart
addGeometry
in interface IModelPart
geom
- Geometry instanceIModelPart.addGeometry(Geometry)
public void addShape(INode shape)
IModelPart
addShape
in interface IModelPart
shape
- An EAVP CSG INode instance.IModelPart#addShape(Geometry)
public void attach(INode owner)
IAttachment
Adds this instance to the supplied node. The attachment's functionality will be applied to the new owner node.
If the attachment is a singleton, this will replace any existing attachment of the same type.
attach
in interface IAttachment
attach
in class Attachment
owner
- the node to attach toIAttachment.attach(INode)
public void detach(INode owner)
IAttachment
Removes this instance from the supplied node. Any functionality provided by this attachment will be removed from the owner node.
If the supplied node is not attached, this is a no-op.
detach
in interface IAttachment
detach
in class Attachment
owner
- the node to detach fromIAttachment.detach(INode)
public void removeShape(INode shape)
IModelPart
removeShape
in interface IModelPart
shape
- The EAVP INode to remove.IModelPart#addShape(Geometry)
public boolean hasShape(INode shape)
IModelPart
hasShape
in interface IModelPart
shape
- EAVP CSG INode to test forpublic INode getShape(int index)
IModelPart
Returns the IShape at the specified index or null if it cannot be found.
getShape
in interface IModelPart
index
- the index to retrieve the IShape atpublic java.util.List<INode> getShapes(boolean copy)
IModelPart
Returns a list of the shapes associated with this entity.
Optionally, a copy can be made of the list.
getShapes
in interface IModelPart
copy
- public void clearShapes()
IModelPart
Removes all shapes associated with this entity.
clearShapes
in interface IModelPart
public void setVisible(boolean visible)
IModelPart
Sets the entity to be visible or not visible in the scene.
setVisible
in interface IModelPart
visible
- if true, the entity will be made visible otherwise the entity
will not be visiblepublic boolean isVisible()
IModelPart
Returns true if the entity is visible, false otherwise.
isVisible
in interface IModelPart
public boolean isImmutable()
IModelPart
Returns true if the entity is immutable, false otherwise.
isImmutable
in interface IModelPart
public void setImmutable(boolean immutable)
IModelPart
Sets the entity to be immutable, which means it's values cannot be changed (no new geometry or shapes).
setImmutable
in interface IModelPart
immutable
- if true, the entity will be made immutable otherwise the
entity will be mutablepublic java.util.ArrayList<IRenderElement> getRenderedNodes()
public IRenderElement getRender(INode node)
IRenderElementHolder
getRender
in interface IRenderElementHolder
node
- The node whose IRenderElement is sought.