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;
}
Aggregations