hep.wired.heprep.projection
Class AbstractProjection

java.lang.Object
  extended by hep.wired.heprep.projection.AbstractProjection
All Implemented Interfaces:
Projection, ProjectionFeature, Feature, UVWindices, WiredRegistry.ID, XYZindices, org.freehep.xml.io.XMLIO
Direct Known Subclasses:
CompositeProjection, FlatProjection, NullProjection, ParallelProjection, VariableProjection

public abstract class AbstractProjection
extends Object
implements Projection

Base class for projections.

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

Field Summary
static String 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
AbstractProjection()
          Creates a projection with the classname as name.
AbstractProjection(String name)
          Creates a named projection.
 
Method Summary
abstract  Projection copy()
          Returns a deep copy of the projection.
abstract  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
 String getID()
           
 String getName()
          Returns the name of the projection.
 ViewPort getViewPort()
          Returns the associated viewport.
 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.
 String toString()
          Returns name of projection
abstract  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).
 double[] transform(ViewPort viewPort, double[] xyz)
          Implements this method by a call to transform([]), followed by the viewPort.
 double[][] transform(ViewPort viewPort, double[][] xyz, int n)
          Implements this method by a call to transform([][], n), followed by running all points through the viewPort.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultProjections

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

AbstractProjection

public AbstractProjection()
Creates a projection with the classname as name.


AbstractProjection

public AbstractProjection(String name)
Creates a named projection.

Method Detail

getID

public String getID()
Specified by:
getID in interface WiredRegistry.ID

getName

public String getName()
Description copied from interface: Projection
Returns the name of the projection.

Specified by:
getName in interface Projection

getFormula

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

Specified by:
getFormula in interface Projection

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

getFeature

public Feature getFeature(Class featureClass)
Returns feature if supported by this projection.

Specified by:
getFeature in interface Projection

setViewPort

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

Specified by:
setViewPort in interface Projection

getViewPort

public ViewPort getViewPort()
Description copied from interface: Projection
Returns the associated viewport.

Specified by:
getViewPort in interface Projection

transform

public double[] transform(ViewPort viewPort,
                          double[] xyz)
Implements this method by a call to transform([]), followed by the viewPort.

Specified by:
transform in interface Projection

transform

public abstract 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

transform

public double[][] transform(ViewPort viewPort,
                            double[][] xyz,
                            int n)
Implements this method by a call to transform([][], n), followed by running all points through the viewPort. Concrete projections should probably override this method with something more efficient.

Specified by:
transform in interface Projection

transform

public double[][] transform(double[][] xyz,
                            int n)
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

deltaTransform

public abstract 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

copy

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

Specified by:
copy in interface Projection

toString

public String toString()
Returns name of projection

Overrides:
toString in class Object

save

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

restore

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


Copyright © 1996-2013 FreeHEP. All Rights Reserved.