use of cbit.vcell.math.ExplicitDataGenerator in project vcell by virtualcell.
the class XmlReader method getExplicitDataGenerator.
private ExplicitDataGenerator getExplicitDataGenerator(Element element) {
String name = unMangle(element.getAttributeValue(XMLTags.NameAttrTag));
String domainStr = unMangle(element.getAttributeValue(XMLTags.DomainAttrTag));
Domain domain = null;
if (domainStr != null) {
domain = new Domain(domainStr);
}
String temp = element.getText();
Expression exp = unMangleExpression(temp);
ExplicitDataGenerator explicitDataGenerator = new ExplicitDataGenerator(name, domain, exp);
return explicitDataGenerator;
}
use of cbit.vcell.math.ExplicitDataGenerator in project vcell by virtualcell.
the class Xmlproducer method getXML.
private Element getXML(PostProcessingBlock postProcessingBlock) {
Element element = new Element(XMLTags.PostProcessingBlock);
for (DataGenerator dataGenerator : postProcessingBlock.getDataGeneratorList()) {
if (dataGenerator instanceof ExplicitDataGenerator) {
Element e = new Element(XMLTags.ExplicitDataGenerator);
e.setAttribute(XMLTags.NameAttrTag, mangle(dataGenerator.getName()));
if (dataGenerator.getDomain() != null) {
e.setAttribute(XMLTags.DomainAttrTag, mangle(dataGenerator.getDomain().getName()));
}
e.addContent(mangleExpression(dataGenerator.getExpression()));
element.addContent(e);
} else if (dataGenerator instanceof ProjectionDataGenerator) {
element.addContent(getXML((ProjectionDataGenerator) dataGenerator));
} else if (dataGenerator instanceof ConvolutionDataGenerator) {
element.addContent(getXML((ConvolutionDataGenerator) dataGenerator));
}
}
return element;
}
use of cbit.vcell.math.ExplicitDataGenerator in project vcell by virtualcell.
the class XmlReader method getPostProcessingBlock.
private void getPostProcessingBlock(MathDescription mathDesc, Element element) throws XmlParseException {
Iterator<Element> iterator = element.getChildren(XMLTags.ExplicitDataGenerator, vcNamespace).iterator();
while (iterator.hasNext()) {
Element tempelement = (Element) iterator.next();
ExplicitDataGenerator explicitDataGenerator = getExplicitDataGenerator(tempelement);
try {
mathDesc.getPostProcessingBlock().addDataGenerator(explicitDataGenerator);
} catch (MathException e) {
throw new XmlParseException(e);
}
}
iterator = element.getChildren(XMLTags.ProjectionDataGenerator, vcNamespace).iterator();
while (iterator.hasNext()) {
Element tempelement = (Element) iterator.next();
ProjectionDataGenerator projectionDataGenerator = getProjectionDataGenerator(tempelement);
try {
mathDesc.getPostProcessingBlock().addDataGenerator(projectionDataGenerator);
} catch (MathException e) {
throw new XmlParseException(e);
}
}
iterator = element.getChildren(XMLTags.ConvolutionDataGenerator, vcNamespace).iterator();
while (iterator.hasNext()) {
Element tempelement = (Element) iterator.next();
ConvolutionDataGenerator convolutionDataGenerator = getConvolutionDataGenerator(tempelement);
try {
mathDesc.getPostProcessingBlock().addDataGenerator(convolutionDataGenerator);
} catch (MathException e) {
throw new XmlParseException(e);
}
}
}
Aggregations