cc.setMaximum(boundary);
return boundary;
}
} else if (contextObject instanceof Domain) {
Domain domain = (Domain) contextObject;
if (elementName.equals(SpatialConstants.listOfInteriorPoints)){
ListOf<InteriorPoint> listOfInteriorPoints = domain.getListOfInteriorPoints();
return listOfInteriorPoints;
}
} else if (contextObject instanceof AnalyticGeometry) {
AnalyticGeometry analyticGeometry = (AnalyticGeometry) contextObject;
if (elementName.equals(SpatialConstants.listOfAnalyticVolumes)){
ListOf<AnalyticVolume> listOfAnalyticVolumes = analyticGeometry.getListOfAnalyticVolumes();
return listOfAnalyticVolumes;
}
} else if (contextObject instanceof SampledFieldGeometry) {
SampledFieldGeometry sfg = (SampledFieldGeometry) contextObject;
if (elementName.equals(SpatialConstants.listOfSampledVolumes)){
ListOf<SampledVolume> listOfSampledVolumes = sfg.getListOfSampledVolumes();
return listOfSampledVolumes;
} else if (elementName.equals(SpatialConstants.sampledField)){
SampledField sf = new SampledField();
sfg.setSampledField(sf);
return sf;
}
} else if (contextObject instanceof SampledField) {
SampledField sf = (SampledField) contextObject;
if (elementName.equals(SpatialConstants.imageData)){
ImageData im = new ImageData();
sf.setImageData(im);
return im;
}
} else if (contextObject instanceof CSGeometry) {
CSGeometry csg = (CSGeometry) contextObject;
if (elementName.equals(SpatialConstants.listOfCSGObjects)){
ListOf<CSGObject> listOfCSGObjects = csg.getListOfCSGObjects();
return listOfCSGObjects;
}
} else if (contextObject instanceof CSGObject) {
CSGObject cso = (CSGObject) contextObject;
if (elementName.equals(SpatialConstants.csgPrimitive)){
CSGPrimitive csgNode = new CSGPrimitive();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgPseudoPrimitive)){
CSGPseudoPrimitive csgNode = new CSGPseudoPrimitive();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgSetOperator)){
CSGSetOperator csgNode = new CSGSetOperator();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgTranslation)){
CSGTranslation csgNode = new CSGTranslation();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgRotation)){
CSGRotation csgNode = new CSGRotation();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgScale)){
CSGScale csgNode = new CSGScale();
cso.setCSGNode(csgNode);
return csgNode;
} else if (elementName.equals(SpatialConstants.csgHomogeneousTransformation)){
CSGHomogeneousTransformation csgNode = new CSGHomogeneousTransformation();
cso.setCSGNode(csgNode);
return csgNode;
}
} else if (contextObject instanceof CSGSetOperator) {
CSGSetOperator csgso = (CSGSetOperator) contextObject;
if (elementName.equals(SpatialConstants.listOfCSGNodes)) {
ListOf<CSGNode> listOfCSGNodes = csgso.getListOfCSGNodes();
return listOfCSGNodes;
}
} else if (contextObject instanceof CSGHomogeneousTransformation) {
CSGHomogeneousTransformation csght = (CSGHomogeneousTransformation) contextObject;
if (elementName.equals(SpatialConstants.forwardTransformation)) {
TransformationComponent tc = new TransformationComponent();
csght.setForwardTransformation(tc);
return tc;
} else if (elementName.equals(SpatialConstants.reverseTransformation)) {
TransformationComponent tc = new TransformationComponent();
csght.setReverseTransformation(tc);
return tc;
}
} else if (contextObject instanceof ParametricGeometry) {
ParametricGeometry pg = (ParametricGeometry) contextObject;
if (elementName.equals(SpatialConstants.listOfSpatialPoints)){
ListOf<SpatialPoint> listOfSpatialPoints = pg.getListOfSpatialPoints();
return listOfSpatialPoints;
} else if (elementName.equals(SpatialConstants.listOfParametricObjects)){
ListOf<ParametricObject> listOfParametricObjects = pg.getListOfParametricObjects();
return listOfParametricObjects;
}
} else if (contextObject instanceof ParametricObject) {
ParametricObject po = (ParametricObject) contextObject;
if (elementName.equals(SpatialConstants.imageData)){
PolygonObject polygonObject = new PolygonObject();
po.setPolygonObject(polygonObject);
return polygonObject;
}
}
else if (contextObject instanceof ListOf<?>) {
ListOf<SBase> listOf = (ListOf<SBase>) contextObject;
if (elementName.equals(SpatialConstants.coordinateComponent)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
CoordinateComponent elem = new CoordinateComponent();
geo.addCoordinateComponent(elem);
return elem;
} else if (elementName.equals(SpatialConstants.domainType)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
DomainType elem = new DomainType();
geo.addDomainType(elem);
return elem;
} else if (elementName.equals(SpatialConstants.domain)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
Domain elem = new Domain();
geo.addDomain(elem);
return elem;
} else if (elementName.equals(SpatialConstants.adjacentDomains)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AdjacentDomains elem = new AdjacentDomains();
geo.addAdjacentDomain(elem);
return elem;
} else if (elementName.equals(SpatialConstants.sampledFieldGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
SampledFieldGeometry elem = new SampledFieldGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AnalyticGeometry elem = new AnalyticGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
AnalyticGeometry elem = new AnalyticGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.csGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
CSGeometry elem = new CSGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.parametricGeometry)) {
Geometry geo = (Geometry) listOf.getParentSBMLObject();
ParametricGeometry elem = new ParametricGeometry();
geo.addGeometryDefinition(elem);
return elem;
} else if (elementName.equals(SpatialConstants.interiorPoint)) {
Domain domain = (Domain) listOf.getParentSBMLObject();
InteriorPoint elem = new InteriorPoint();
domain.addInteriorPoint(elem);
return elem;
} else if (elementName.equals(SpatialConstants.analyticVolume)) {
AnalyticGeometry av = (AnalyticGeometry) listOf.getParentSBMLObject();
AnalyticVolume elem = new AnalyticVolume();
av.addAnalyticVolume(elem);