FreeHEP API
Version current

hep.graphics.heprep
Interface HepRepInstance

All Superinterfaces:
HepRepAttribute, HepRepConstants
All Known Implementing Classes:
AbstractHepRepInstanceAdapter, DefaultHepRepInstance, HepRepInstanceAdapter, HepRepInstanceAdapter

public interface HepRepInstance
extends HepRepAttribute

HepRepInstance interface.

Author:
Mark Donszelmann
Source Code:
HepRepInstance.java

Field Summary
 
Fields inherited from interface hep.graphics.heprep.HepRepConstants
SHOW_DESC, SHOW_EXTRA, SHOW_NAME, SHOW_NONE, SHOW_VALUE, TYPE_BOOLEAN, TYPE_COLOR, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_UNKNOWN
 
Method Summary
 void addInstance(HepRepInstance instance)
          Adds an sub-instance to this instance.
 void addPoint(HepRepPoint point)
          Adds a point to this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstance parent)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstance parent, HepRepSelectFilter filter)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstanceTree parent)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstanceTree parent, HepRepSelectFilter filter)
          Returns a deep copy of this instance.
 List getInstances()
          Returns a collection of all sub-instances this instance keeps.
 String getLayer()
          Returns String layername.
 List getPoints()
          Returns a collection of all points this instance keeps.
 int getPoints(double[][] xyz)
          Fills a double[3][n] array with the coordinates of all points, if none of the points have any attributes defined on them.
 HepRepInstance getSuperInstance()
          Returns the parent of this instance.
 HepRepType getType()
          Returns the associated type for this instance.
 Object getUserObject()
          Returns a user object previously set on this instance.
 boolean hasFrame()
          Returns true if this instance has a frame.
 void overlay(HepRepInstance instance)
          Overlays the instance on the current instance.
 void removeInstance(HepRepInstance instance)
          Removes a sub-instance from this instance.
 void setUserObject(Object object)
          Sets a User Object on this instance.
 
Methods inherited from interface hep.graphics.heprep.HepRepAttribute
addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, getAttValue, getAttValueFromNode, getAttValuesFromNode, removeAttValue
 

Method Detail

overlay

public void overlay(HepRepInstance instance)
Overlays the instance on the current instance. Attributes of the instance override or are added to the current instance. Sub-instances of the instance are added only if the current instance has no sub-instances. Points of the instance are added only if the current instance has no points.


addInstance

public void addInstance(HepRepInstance instance)
Adds an sub-instance to this instance.

Parameters:
instance - sub-instance.

removeInstance

public void removeInstance(HepRepInstance instance)
Removes a sub-instance from this instance.

Parameters:
instance - sub-instance.

getInstances

public List getInstances()
Returns a collection of all sub-instances this instance keeps.

Returns:
collection of HepRepInstances.

getType

public HepRepType getType()
Returns the associated type for this instance.

Returns:
associated HepRepType.

addPoint

public void addPoint(HepRepPoint point)
Adds a point to this instance.

Parameters:
point - to be added.

getPoints

public List getPoints()
Returns a collection of all points this instance keeps.

Returns:
collection of HepRepPoints.

getPoints

public int getPoints(double[][] xyz)
Fills a double[3][n] array with the coordinates of all points, if none of the points have any attributes defined on them. The actual number of points filled is returned. In case the number of points is larger than n, or if any points have attributes, -1 is returned. One could then call getPoint().

Returns:
number of points filled in xyz, or -1 in case of error or non-implementation. ONLY in JAVA
See Also:
getPoints()

hasFrame

public boolean hasFrame()
Returns true if this instance has a frame. Speedy access for iterator. ONLY in JAVA


getLayer

public String getLayer()
Returns String layername. Speedy access for iterator. ONLY in JAVA


getSuperInstance

public HepRepInstance getSuperInstance()
Returns the parent of this instance.

Returns:
parent of instance, or null if top-level.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstance parent)
                    throws CloneNotSupportedException
Returns a deep copy of this instance.

Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstance parent,
                           HepRepSelectFilter filter)
                    throws CloneNotSupportedException
Returns a deep copy of this instance.

Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
filter - run on all instances before copying.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstanceTree parent)
                    throws CloneNotSupportedException
Returns a deep copy of this instance.

Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstanceTree parent,
                           HepRepSelectFilter filter)
                    throws CloneNotSupportedException
Returns a deep copy of this instance.

Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
filter - run on all instances before copying.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

setUserObject

public void setUserObject(Object object)
Sets a User Object on this instance.

Parameters:
object - User Object.

getUserObject

public Object getUserObject()
Returns a user object previously set on this instance.

Returns:
User Object.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.