cz.cuni.jagrlib.piece
Class RadiosityEquations

java.lang.Object
  extended by cz.cuni.jagrlib.DefaultProperty
      extended by cz.cuni.jagrlib.Piece
          extended by cz.cuni.jagrlib.piece.RadiosityEquations
All Implemented Interfaces:
Breakable, Property, SLEData, Template

public class RadiosityEquations
extends Piece
implements SLEData

Provides SLE (system of linear equations) from Brep for some SLE Solver.

See Also:
RadiosityEquations.java

Field Summary
protected  int attrColor
          Attribute: face color (albedo = ro).
protected  int attrEmission
          Attribute: face emmision (E).
protected  int attrResult
          Attribute: face radiosity (result = B).
protected  RadiosityBasisFunctions basis
          Accelerator: input radiosity basis functions.
protected  Brep brep
          Accelerator: input Brep database.
protected static java.lang.String CATEGORY
          Object category.
protected  java.lang.String colorName
          Attribute name: face color.
protected  int component
          Actual component number.
protected  int ctx
          Actual Brep context.
protected  java.lang.String emissionName
          Attribute name: face color.
protected  boolean isInitialized
          Was the SLE already initialized?
static RegPiece reg
          Static registration instance for this class.
protected static java.lang.String TEMPLATE_NAME
          Object template identifier.
 
Fields inherited from class cz.cuni.jagrlib.Piece
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak
 
Fields inherited from interface cz.cuni.jagrlib.iface.SLEData
NULL
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Fields inherited from interface cz.cuni.jagrlib.Template
ALL_PLUGS, C_1D, C_2D, C_3D, C_ALPHA, C_BINARY, C_BREP, C_CAMERA, C_CIRCLE, C_CLIP, C_COMPRESSION, C_CURVE, C_DATA, C_DRAW, C_EDITOR, C_ELLIPSE, C_FILL, C_FILTER, C_FLOAT, C_FUNCTION, C_IMAGE, C_INTEGER, C_IO, C_LIGHT, C_LINE, C_METRIC, C_POLYGON, C_PROJECTION, C_RADIOSITY, C_RASTER, C_RENDER, C_SAMPLE, C_SCENE, C_SET, C_SOLID, C_TEXT, C_TRANSFORM, C_VECTOR, C_VIEWER, C_WORKER, CAT_EMPTY, EMPTY, IFACE, JAGRLIB, JAGRLIB2, MANIPULATOR_COMBO, MANIPULATOR_CUSTOM, MANIPULATOR_DEFAULT, MANIPULATOR_MULTILINE, PL_ALPHAMASK, PL_BITMASK, PL_CAUSTIC, PL_CODEC, PL_COLORMAP, PL_COMPARE, PL_DATA, PL_DIRECT, PL_EDITOR, PL_FILTER, PL_FUNCTION, PL_IMAGE, PL_IMPORT, PL_INPUT, PL_INTERSECTION, PL_LIGHTSOURCE, PL_ORDER, PL_OUTPUT, PL_PALETTE, PL_PHOTON, PL_PROPERTY, PL_QUANTIZER, PL_RASTER, PL_RENDER, PL_SHADOW, PL_STREAM, PL_TRANSFORM, PL_TRIGGER, PL_VOLUME, PL_WINDOW, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_STRING
 
Constructor Summary
RadiosityEquations()
           
 
Method Summary
 int actualComponent()
          Get actual component number.
 java.lang.Object get(java.lang.String key)
          Gets the given property.
 double getCoeff(int row, int col)
          Reads a single matrix coefficient.
 double[] getColumn(int col, double[] result)
          Reads the whole matrix column.
 int getColumns()
          Number of unknowns = number of matrix columns (usually number of unknowns is equal to number of equations).
 double[][] getMatrix()
          Reads the whole matrix.
 double[] getReflectance(double[] reflectance)
          Reads the whole reflectance vector.
 double getReflectance(int i)
          Reads a single reflectance (radiosity: element albedo).
 double[] getRight(double[] result)
          Reads the whole right-side vector.
 double getRight(int row)
          Reads a single element of the right-side vector.
 double[] getRow(int row, double[] result)
          Reads the whole matrix row.
 int getRows()
          Number of equations = number of matrix rows (usually number of unknowns is equal to number of equations).
 double[] getSolution(double[] result)
          Reads the whole solution vector.
 double getSolution(int col)
          Reads a single unknown (element of solution vector).
 double[] getWeight(double[] values)
          Reads the whole weight vector.
 double getWeight(int i)
          Reads a single element weight (radiosity: element area).
protected  boolean init()
          Initialize accelerators.
 int nextCoeffInColumnChanged(int row, int col)
          Returns row-index of next coefficient which was changed since last resetChanges() call.
 int nextCoeffInRowChanged(int row, int col)
          Returns column-index of next coefficient which was changed since last resetChanges() call.
 int nextRightChanged(int row)
          Returns index of next right-side element which was changed since last resetChanges() call.
 void resetChanges()
          Resets (acknowledges) all SLE changes.
 void set(java.lang.String key, java.lang.Object value)
          Sets the given property.
 void setComponent(int c)
          Set actual component (non-mandatory).
 void setSolution(double[] values)
          Writes the whole solution vector.
 void setSolution(int col, double value)
          Writes value of a single unknown.
static int setTemplate(Template t, int ord)
          General-purpose registration routine.
 
Methods inherited from class cz.cuni.jagrlib.Piece
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop
 
Methods inherited from class cz.cuni.jagrlib.DefaultProperty
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit
 

Field Detail

brep

protected Brep brep
Accelerator: input Brep database.


basis

protected RadiosityBasisFunctions basis
Accelerator: input radiosity basis functions.


ctx

protected int ctx
Actual Brep context.


colorName

protected java.lang.String colorName
Attribute name: face color.


emissionName

protected java.lang.String emissionName
Attribute name: face color.


attrColor

protected int attrColor
Attribute: face color (albedo = ro).


attrEmission

protected int attrEmission
Attribute: face emmision (E).


attrResult

protected int attrResult
Attribute: face radiosity (result = B).


isInitialized

protected boolean isInitialized
Was the SLE already initialized?


component

protected int component
Actual component number.


TEMPLATE_NAME

protected static final java.lang.String TEMPLATE_NAME
Object template identifier.

See Also:
Constant Field Values

CATEGORY

protected static final java.lang.String CATEGORY
Object category.

See Also:
Constant Field Values

reg

public static final RegPiece reg
Static registration instance for this class. Automatically initialized in class-loading time.

Constructor Detail

RadiosityEquations

public RadiosityEquations()
Method Detail

getRows

public int getRows()
Number of equations = number of matrix rows (usually number of unknowns is equal to number of equations).

Specified by:
getRows in interface SLEData

getColumns

public int getColumns()
Number of unknowns = number of matrix columns (usually number of unknowns is equal to number of equations).

Specified by:
getColumns in interface SLEData

getCoeff

public double getCoeff(int row,
                       int col)
Reads a single matrix coefficient.

Specified by:
getCoeff in interface SLEData

getRow

public double[] getRow(int row,
                       double[] result)
Reads the whole matrix row.

Specified by:
getRow in interface SLEData

getColumn

public double[] getColumn(int col,
                          double[] result)
Reads the whole matrix column.

Specified by:
getColumn in interface SLEData

getMatrix

public double[][] getMatrix()
Reads the whole matrix.

Specified by:
getMatrix in interface SLEData

getRight

public double getRight(int row)
Reads a single element of the right-side vector.

Specified by:
getRight in interface SLEData

getRight

public double[] getRight(double[] result)
Reads the whole right-side vector.

Specified by:
getRight in interface SLEData
Parameters:
result - Pre-allocated array to hold result (can be null).

getSolution

public double getSolution(int col)
Reads a single unknown (element of solution vector).

Specified by:
getSolution in interface SLEData

getSolution

public double[] getSolution(double[] result)
Reads the whole solution vector.

Specified by:
getSolution in interface SLEData

setSolution

public void setSolution(int col,
                        double value)
Writes value of a single unknown.

Specified by:
setSolution in interface SLEData

setSolution

public void setSolution(double[] values)
Writes the whole solution vector.

Specified by:
setSolution in interface SLEData

nextRightChanged

public int nextRightChanged(int row)
Returns index of next right-side element which was changed since last resetChanges() call.

Specified by:
nextRightChanged in interface SLEData

nextCoeffInRowChanged

public int nextCoeffInRowChanged(int row,
                                 int col)
Returns column-index of next coefficient which was changed since last resetChanges() call. Passes through the given matrix row..

Specified by:
nextCoeffInRowChanged in interface SLEData

nextCoeffInColumnChanged

public int nextCoeffInColumnChanged(int row,
                                    int col)
Returns row-index of next coefficient which was changed since last resetChanges() call. Passes through the given matrix column..

Specified by:
nextCoeffInColumnChanged in interface SLEData

resetChanges

public void resetChanges()
Resets (acknowledges) all SLE changes.

Specified by:
resetChanges in interface SLEData

getWeight

public double getWeight(int i)
Reads a single element weight (radiosity: element area).

Specified by:
getWeight in interface SLEData

getWeight

public double[] getWeight(double[] values)
Reads the whole weight vector.

Specified by:
getWeight in interface SLEData
Parameters:
values - Pre-allocated array to hold result (can be null).

getReflectance

public double getReflectance(int i)
Reads a single reflectance (radiosity: element albedo).

Specified by:
getReflectance in interface SLEData

getReflectance

public double[] getReflectance(double[] reflectance)
Reads the whole reflectance vector.

Specified by:
getReflectance in interface SLEData
Parameters:
reflectance - Pre-allocated array to hold result (can be null).

actualComponent

public int actualComponent()
Get actual component number.

Specified by:
actualComponent in interface SLEData

setComponent

public void setComponent(int c)
Set actual component (non-mandatory).

Specified by:
setComponent in interface SLEData

init

protected boolean init()
Initialize accelerators.


set

public void set(java.lang.String key,
                java.lang.Object value)
Sets the given property.

Specified by:
set in interface Property
Overrides:
set in class DefaultProperty
Parameters:
key - Key string.
value - The new value.
See Also:
Property.commit()

get

public java.lang.Object get(java.lang.String key)
Gets the given property.

Specified by:
get in interface Property
Overrides:
get in class DefaultProperty
Parameters:
key - Key string.
Returns:
The actual value or null.

setTemplate

public static int setTemplate(Template t,
                              int ord)
General-purpose registration routine. Sets all plugs, strings, etc. to the given Template.