FreeHEP API
Version v1.1

hep.graphics.heprep.streamer
Class StreamerHepRep

java.lang.Object
  |
  +--hep.graphics.heprep.streamer.StreamerHepRep
All Implemented Interfaces:
HepRep

public class StreamerHepRep
extends Object
implements HepRep

Version:
$Id: StreamerHepRep.java,v 1.1 2002/09/18 23:59:58 duns Exp $
Author:
M.Donszelmann

Field Summary
static String cvsId
           
 
Constructor Summary
StreamerHepRep(HepRepWriter streamer)
           
 
Method Summary
 void addInstanceTree(HepRepInstanceTree instanceTree)
          Adds an instancetree to this heprep.
 void addLayer(String layer)
          Add a layer to the list of layers in this heprep.
 void addTypeTree(HepRepTypeTree typeTree)
          Add a typetree to this heprep.
 String checkForException()
          Returns last exception thrown and clears it.
 HepRep copy()
          Returns a deep copy of the heprep, with all its attached trees, where instances are filtered using a HepRepSelectFilter.
 HepRep copy(HepRepSelectFilter filter)
          Returns a deep copy of the heprep, with all its attached trees, where instances are filtered using a HepRepSelectFilter.
 HepRepInstanceTree getInstances(String name, String version, String[] typeNames)
          Returns a named and versioned instancetree for a list of typenames.
 HepRepInstanceTree getInstancesAfterAction(String name, String version, String[] typeNames, HepRepAction[] actions, boolean getPoints, boolean getDrawAtts, boolean getNonDrawAtts, String[] invertAtts)
          Returns a named and versioned instancetree for a list of typenames after executing some action and for specific filters.
 Collection getInstanceTrees()
          Returns a collection of instancetrees.
 HepRepInstanceTree getInstanceTreeTop(String name, String version)
          Returns a named and versioned instancetree.
 List getLayerOrder()
          Returns the list of layers.
 HepRepType getType(String name)
          Searches for a named type in any of the typetrees.
 HepRepTypeTree getTypeTree(String name, String version)
          Returns a named and versioned typetree.
 Collection getTypeTrees()
          Returns the collection of all typetrees of this heprep.
 void removeInstanceTree(HepRepInstanceTree instanceTree)
          Remove an instanectree from this heprep.
 void removeTypeTree(HepRepTypeTree typeTree)
          Remove a typetree from this heprep.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsId

public static final String cvsId
See Also:
Constant Field Values
Constructor Detail

StreamerHepRep

public StreamerHepRep(HepRepWriter streamer)
               throws IOException
Method Detail

copy

public HepRep copy()
            throws CloneNotSupportedException
Description copied from interface: HepRep
Returns a deep copy of the heprep, with all its attached trees, where instances are filtered using a HepRepSelectFilter.

Specified by:
copy in interface HepRep
Returns:
copy of heprep.
Throws:
CloneNotSupportedException - in case copy is not possible

copy

public HepRep copy(HepRepSelectFilter filter)
            throws CloneNotSupportedException
Description copied from interface: HepRep
Returns a deep copy of the heprep, with all its attached trees, where instances are filtered using a HepRepSelectFilter.

Specified by:
copy in interface HepRep
Parameters:
filter - to be used for filtering instances.
Returns:
copy of heprep.
Throws:
CloneNotSupportedException - in case copy is not possible

getLayerOrder

public List getLayerOrder()
Description copied from interface: HepRep
Returns the list of layers.

Specified by:
getLayerOrder in interface HepRep
Returns:
the known layer names, in the order back-to-front.

addLayer

public void addLayer(String layer)
Description copied from interface: HepRep
Add a layer to the list of layers in this heprep. The layer is added to the back of the list.

Specified by:
addLayer in interface HepRep
Parameters:
layer - name of layer to be added to the back of the list.

addTypeTree

public void addTypeTree(HepRepTypeTree typeTree)
                 throws IOException
Description copied from interface: HepRep
Add a typetree to this heprep.

Specified by:
addTypeTree in interface HepRep
Parameters:
typeTree - to be added.
Throws:
IOException - only if the tree is written immediately to some stream.

removeTypeTree

public void removeTypeTree(HepRepTypeTree typeTree)
Description copied from interface: HepRep
Remove a typetree from this heprep.

Specified by:
removeTypeTree in interface HepRep
Parameters:
typeTree - to be removed.

getTypeTree

public HepRepTypeTree getTypeTree(String name,
                                  String version)
Description copied from interface: HepRep
Returns a named and versioned typetree.

Specified by:
getTypeTree in interface HepRep
Parameters:
name - name of the typetree.
version - version of the typetree.
Returns:
named and versioned HepRepTypeTree.

getTypeTrees

public Collection getTypeTrees()
Description copied from interface: HepRep
Returns the collection of all typetrees of this heprep.

Specified by:
getTypeTrees in interface HepRep
Returns:
collection of HepRepTypeTrees.

getType

public HepRepType getType(String name)
Description copied from interface: HepRep
Searches for a named type in any of the typetrees. The first occurrence found is returned.

Specified by:
getType in interface HepRep
Parameters:
name - name of type.
Returns:
named HepRepType.

addInstanceTree

public void addInstanceTree(HepRepInstanceTree instanceTree)
                     throws IOException
Description copied from interface: HepRep
Adds an instancetree to this heprep.

Specified by:
addInstanceTree in interface HepRep
Parameters:
instanceTree - to be added.
Throws:
IOException - only if the tree is written immediately to some stream.

removeInstanceTree

public void removeInstanceTree(HepRepInstanceTree instanceTree)
Description copied from interface: HepRep
Remove an instanectree from this heprep.

Specified by:
removeInstanceTree in interface HepRep
Parameters:
instanceTree - to be removed.

getInstanceTreeTop

public HepRepInstanceTree getInstanceTreeTop(String name,
                                             String version)
Description copied from interface: HepRep
Returns a named and versioned instancetree. FIXME: doc is incorrect here, should only return TOP of the tree. Filling in should be done by getInstances calls.

This tree needs to be added to the heprep afterwards.

Specified by:
getInstanceTreeTop in interface HepRep
Parameters:
name - name of the instancetree.
version - version of the instancetree.
Returns:
HepRepIntanceTree

getInstances

public HepRepInstanceTree getInstances(String name,
                                       String version,
                                       String[] typeNames)
Description copied from interface: HepRep
Returns a named and versioned instancetree for a list of typenames.

This tree needs to be added to the heprep afterwards.

Specified by:
getInstances in interface HepRep
Parameters:
name - name of the instancetree.
version - version of the instancetree.
typeNames - a list of typenames for which we need instancetrees.
Returns:
HepRepIntanceTree

getInstancesAfterAction

public HepRepInstanceTree getInstancesAfterAction(String name,
                                                  String version,
                                                  String[] typeNames,
                                                  HepRepAction[] actions,
                                                  boolean getPoints,
                                                  boolean getDrawAtts,
                                                  boolean getNonDrawAtts,
                                                  String[] invertAtts)
Description copied from interface: HepRep
Returns a named and versioned instancetree for a list of typenames after executing some action and for specific filters. This tree needs to be added to the heprep afterwards.

The inversion effect of invertAtts depends on the values of GetDrawAtts and GetNonDrawAtts as follows:

Specified by:
getInstancesAfterAction in interface HepRep
Parameters:
name - name of the instancetree.
version - version of the instancetree.
typeNames - a list of typenames for which we need instancetrees.
actions - execute this list of actions before returning.
getPoints - include the HepRepPoints in the instance tree.
getDrawAtts - include the Draw attributes in the instance tree.
getNonDrawAtts - include the Non-Draw attributes in the instance tree.
invertAtts - list of attributes to be included or not depending on getDrawAtts and getNonDrawAtts.
Returns:
HepRepIntanceTree

checkForException

public String checkForException()
Description copied from interface: HepRep
Returns last exception thrown and clears it. Useful for implementations without exception handling.

Specified by:
checkForException in interface HepRep
Returns:
last exception and clears it.

getInstanceTrees

public Collection getInstanceTrees()
Description copied from interface: HepRep
Returns a collection of instancetrees.

Specified by:
getInstanceTrees in interface HepRep
Returns:
collection of HepRepInstanceTrees.

FreeHEP API
Version v1.1

Copyright © 2000-2002 FreeHEP, All Rights Reserved.