Search in sources :

Example 1 with ComputeCentroidComponentEquation

use of cbit.vcell.math.ComputeCentroidComponentEquation in project vcell by virtualcell.

the class XmlReader method getComputeCentroid.

private ComputeCentroidComponentEquation getComputeCentroid(Element param, MathDescription mathDesc) throws XmlParseException {
    // get attributes
    String varname = unMangle(param.getAttributeValue(XMLTags.NameAttrTag));
    // find reference in the dictionnary
    // try a MembraneRegionVariable
    VolumeRegionVariable varref = (VolumeRegionVariable) mathDesc.getVariable(varname);
    if (varref == null) {
        throw new XmlParseException("The reference to the Volume Region variable " + varname + " could not be resolved!");
    }
    CentroidComponent normalComponent = null;
    String normalComponentString = param.getAttributeValue(XMLTags.ComputeCentroidComponentAttrTag);
    if (normalComponentString.equals(XMLTags.ComputeCentroidComponentAttrTagValue_X)) {
        normalComponent = CentroidComponent.X;
    } else if (normalComponentString.equals(XMLTags.ComputeCentroidComponentAttrTagValue_Y)) {
        normalComponent = CentroidComponent.Y;
    } else if (normalComponentString.equals(XMLTags.ComputeCentroidComponentAttrTagValue_Z)) {
        normalComponent = CentroidComponent.Z;
    }
    ComputeCentroidComponentEquation centroid = new ComputeCentroidComponentEquation(varref, normalComponent);
    return centroid;
}
Also used : VolumeRegionVariable(cbit.vcell.math.VolumeRegionVariable) ComputeCentroidComponentEquation(cbit.vcell.math.ComputeCentroidComponentEquation) CentroidComponent(cbit.vcell.math.ComputeCentroidComponentEquation.CentroidComponent)

Aggregations

ComputeCentroidComponentEquation (cbit.vcell.math.ComputeCentroidComponentEquation)1 CentroidComponent (cbit.vcell.math.ComputeCentroidComponentEquation.CentroidComponent)1 VolumeRegionVariable (cbit.vcell.math.VolumeRegionVariable)1