cz.cuni.jagrlib.iface
Interface RadiosityBasisFunctions

All Known Implementing Classes:
MonteCarloFF

public interface RadiosityBasisFunctions

Basis functions representing radiosity distribution over a set of Brep elements. Elements are represented by integer handles (e.g. faces residing in external Brep storage). Outgoing radiosity distribution on each element is represented by a set of coefficients, neighbour elements might share some coefficients. There are two major objectives defined in this interface:

  1. Form-factor computation (between any two coefficients in the scene)
  2. Radiosity distribution (approximation based on basis functions and actual data = coefficients)

Since:
0.26

Method Summary
 int coefficientsFromElement(int elem, int[] result)
          Returns coefficient indexes defining the given element.
 java.util.BitSet coefficientsFromElements(java.util.BitSet elements, java.util.BitSet result)
          Returns set of coefficients defining the given set of elements.
 double[] distribute(int elem, double[] coords, double[] result)
          Computes distribution coefficients for the single point of the element.
 int elementsFromCoefficient(int coeff, int[] result)
          Returns elements which are affected by the given single coefficient.
 java.util.BitSet elementsFromCoefficients(java.util.BitSet coefficients, java.util.BitSet result)
          Returns set of elements which are affected by the given set of coefficients.
 double formFactor(int from, int to)
          Computes single form-factor (F_{from,to}).
 int formFactorsFrom(int coeff, int[] ind, double[] ff)
          Computes "shooting" form-factors (single source coefficient is fixed).
 int formFactorsTo(int coeff, int[] ind, double[] ff)
          Computes "gathering" form-factors (single target coefficient is fixed).
 int getOrder()
          Order of the approximation (for information purposes only).
 int totalCoefficients()
          Total number of coefficients.
 int totalElements()
          Total number of elements in the scene.
 

Method Detail

getOrder

int getOrder()
Order of the approximation (for information purposes only). Number of coefficients defining radiosity distribution on single element.


coefficientsFromElement

int coefficientsFromElement(int elem,
                            int[] result)
Returns coefficient indexes defining the given element.

Parameters:
elem - Element handle.
result - Pre-allocated integer array to hold result (can be null).
Returns:
Size of result array.

elementsFromCoefficient

int elementsFromCoefficient(int coeff,
                            int[] result)
Returns elements which are affected by the given single coefficient.

Parameters:
coeff - Coefficient index.
result - Pre-allocated integer array to hold result (can be null).
Returns:
Size of result array.

coefficientsFromElements

java.util.BitSet coefficientsFromElements(java.util.BitSet elements,
                                          java.util.BitSet result)
Returns set of coefficients defining the given set of elements.

Parameters:
elements - Set of elements.
result - Non-mandatory object to be filled.
Returns:
Set of coefficient indices.

elementsFromCoefficients

java.util.BitSet elementsFromCoefficients(java.util.BitSet coefficients,
                                          java.util.BitSet result)
Returns set of elements which are affected by the given set of coefficients.

Parameters:
coefficients - Set of coefficients.
result - Non-mandatory object to be filled.
Returns:
Set of element handles.

distribute

double[] distribute(int elem,
                    double[] coords,
                    double[] result)
Computes distribution coefficients for the single point of the element.

Parameters:
elem - Element handle.
coords - World-space (?) coordinates of the point lying on the given element.
result - Non-mandatory pre-allocated array to hold result.
Returns:
Distribution multiplicators (coefficient indices match the result of coefficientsFromElement(int, int[])).

totalElements

int totalElements()
Total number of elements in the scene.


totalCoefficients

int totalCoefficients()
Total number of coefficients.


formFactorsFrom

int formFactorsFrom(int coeff,
                    int[] ind,
                    double[] ff)
Computes "shooting" form-factors (single source coefficient is fixed).

Parameters:
coeff - Source-coefficient index.
ind - Array to hold affected (lit) coefficient indices (can be null).
ff - Array to hold respective form-factors (can be null).
Returns:
Number of coefficients lit.

formFactorsTo

int formFactorsTo(int coeff,
                  int[] ind,
                  double[] ff)
Computes "gathering" form-factors (single target coefficient is fixed).

Parameters:
coeff - Target-coefficient index.
ind - Array to hold relevant (visible) coefficient indices (can be null).
ff - Array to hold respective form-factors (can be null).
Returns:
Number of relevant coefficients.

formFactor

double formFactor(int from,
                  int to)
Computes single form-factor (F_{from,to}).