hep.wired.heprep.projection
Class CompositeProjection

java.lang.Object
  extended by hep.wired.heprep.projection.AbstractProjection
      extended by hep.wired.heprep.projection.CompositeProjection
All Implemented Interfaces:
Resetable, InverseProjection, Projection, ProjectionFeature, Feature, UVWindices, WiredRegistry.ID, XYZindices, org.freehep.xml.io.XMLIO
Direct Known Subclasses:
RhoZ, RhoZFishEye, YXClock, YXFishEye

public class CompositeProjection
extends AbstractProjection
implements Resetable, InverseProjection

Sequence of projections.

Version:
$Id: CompositeProjection.java 8598 2006-08-14 20:38:02Z duns $
Author:
Mark Donszelmann

Field Summary
 
Fields inherited from class hep.wired.heprep.projection.AbstractProjection
defaultProjections
 
Fields inherited from interface hep.wired.util.XYZindices
X, Y, Z
 
Fields inherited from interface hep.wired.util.UVWindices
U, V, W
 
Constructor Summary
CompositeProjection()
          Creates a composite projection.
CompositeProjection(String name)
          Creates a named empty composite projection.
CompositeProjection(String name, Projection[] projections)
          Creates a named composite projection filled with the given array of projections.
 
Method Summary
 void add(Projection p)
          Adds a projection to the end of the list.
 Projection copy()
          Returns a deep copy of the projection.
 double[] deltaTransform(double[] xyz)
          Returns an array of length 3: uvw = delta projection(xyz).
 Feature getFeature(Class featureClass)
          Returns feature if supported by this projection.
 String getFormula()
          Returns the formula in text readable form
 List getProjections()
          Returns the list of projections.
 double[] inverseDeltaTransform(double[] uvw)
          Returns an array of length 3: xyz = inverse delta projection(uvw).
 double[] inverseTransform(double[] uvw)
          Returns an array of length 3: xyz = inverse projection(uvw).
 Object reset(Object newStates)
          Resets graphics panel to a new state or its initial state.
 void restore(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void save(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
           
 void setViewPort(ViewPort viewPort)
          Sets the associated viewport.
 boolean supports(Class featureClass)
          Return true if this (composite) projection implements this featureClass.
 double[] transform(double[] xyz)
          Returns an array of length 3: uvw = projection(xyz).
 double[][] transform(double[][] xyz, int n)
          Implements this method in terms of double[] transform(double[] xyz).
 
Methods inherited from class hep.wired.heprep.projection.AbstractProjection
getID, getName, getViewPort, toString, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hep.wired.heprep.services.Projection
getName, getViewPort, transform, transform
 
Methods inherited from interface hep.wired.util.WiredRegistry.ID
getID
 

Constructor Detail

CompositeProjection

public CompositeProjection()
Creates a composite projection. A transform called on this projection will use all added projections to transform x,y,z into u,v,w.


CompositeProjection

public CompositeProjection(String name)
Creates a named empty composite projection. A transform called on this projection will use all added projections to transform x,y,z into u,v,w.


CompositeProjection

public CompositeProjection(String name,
                           Projection[] projections)
Creates a named composite projection filled with the given array of projections. A transform called on this projection will use those projections to transform x,y,z into u,v,w.

Method Detail

getFormula

public String getFormula()
Description copied from interface: Projection
Returns the formula in text readable form

Specified by:
getFormula in interface Projection
Overrides:
getFormula in class AbstractProjection

supports

public boolean supports(Class featureClass)
Description copied from interface: Projection
Return true if this (composite) projection implements this featureClass.

Specified by:
supports in interface Projection
Overrides:
supports in class AbstractProjection

getFeature

public Feature getFeature(Class featureClass)
Description copied from class: AbstractProjection
Returns feature if supported by this projection.

Specified by:
getFeature in interface Projection
Overrides:
getFeature in class AbstractProjection

setViewPort

public void setViewPort(ViewPort viewPort)
Description copied from interface: Projection
Sets the associated viewport.

Specified by:
setViewPort in interface Projection
Overrides:
setViewPort in class AbstractProjection

add

public void add(Projection p)
Adds a projection to the end of the list.


getProjections

public List getProjections()
Returns the list of projections.


transform

public double[] transform(double[] xyz)
Description copied from interface: Projection
Returns an array of length 3: uvw = projection(xyz). The returned array may have a lifetime up to the next call to this method on this object.

Specified by:
transform in interface Projection
Specified by:
transform in class AbstractProjection

transform

public double[][] transform(double[][] xyz,
                            int n)
Description copied from class: AbstractProjection
Implements this method in terms of double[] transform(double[] xyz). Not a very efficient implementation, so concrete projections should probably override this method with something better.

Specified by:
transform in interface Projection
Overrides:
transform in class AbstractProjection

deltaTransform

public double[] deltaTransform(double[] xyz)
Description copied from interface: Projection
Returns an array of length 3: uvw = delta projection(xyz). The returned array may have a lifetime up to the next call to this method on this object.

Specified by:
deltaTransform in interface Projection
Specified by:
deltaTransform in class AbstractProjection

inverseTransform

public double[] inverseTransform(double[] uvw)
                          throws UnsupportedOperationException
Description copied from interface: InverseProjection
Returns an array of length 3: xyz = inverse projection(uvw). The returned array may have a lifetime up to the next call to this method on this object. UnsupportedOperation is thrown in no inverse projection is possible.

Specified by:
inverseTransform in interface InverseProjection
Throws:
UnsupportedOperationException

inverseDeltaTransform

public double[] inverseDeltaTransform(double[] uvw)
                               throws UnsupportedOperationException
Description copied from interface: InverseProjection
Returns an array of length 3: xyz = inverse delta projection(uvw). The returned array may have a lifetime up to the next call to this method on this object. UnsupportedOperation is thrown in no inverse delta projection is possible.

Specified by:
inverseDeltaTransform in interface InverseProjection
Throws:
UnsupportedOperationException

copy

public Projection copy()
Description copied from interface: Projection
Returns a deep copy of the projection.

Specified by:
copy in interface Projection
Specified by:
copy in class AbstractProjection

reset

public Object reset(Object newStates)
Description copied from interface: Resetable
Resets graphics panel to a new state or its initial state.

Specified by:
reset in interface Resetable
Parameters:
newStates - new state, if null, use initial state of graphics panel.
Returns:
old state just before setting the new state

save

public void save(org.freehep.xml.io.XMLIOManager xmlioManager,
                 org.jdom.Element nodeEl)
Specified by:
save in interface org.freehep.xml.io.XMLIO
Overrides:
save in class AbstractProjection

restore

public void restore(org.freehep.xml.io.XMLIOManager xmlioManager,
                    org.jdom.Element nodeEl)
Specified by:
restore in interface org.freehep.xml.io.XMLIO
Overrides:
restore in class AbstractProjection


Copyright © 1996-2013 FreeHEP. All Rights Reserved.